:root {
  --bg: #f4f6f6; --card: #fff; --ink: #1c2b2b; --muted: #5d6e6e; --line: #dbe3e3;
  --accent: #0f6b6b; --accent-ink: #0a4f4f; --on-accent: #fff; --soft: #e6f2f1;
  --live: #1f9d55; --live-soft: #e3f6ea; --danger: #c0392b; --warn: #b7791f; --chat: #d63a3a;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg:#0f1717; --card:#172222; --ink:#e6eeee; --muted:#9db1b1; --line:#2a3b3b; --accent:#3cb4b0; --accent-ink:#7fd8d4; --on-accent:#06201f; --soft:#1b3030; --live:#35c273; --live-soft:#173626; --shadow:0 1px 2px rgba(0,0,0,.4); color-scheme: dark; } }
:root[data-theme="dark"] { --bg:#0f1717; --card:#172222; --ink:#e6eeee; --muted:#9db1b1; --line:#2a3b3b; --accent:#3cb4b0; --accent-ink:#7fd8d4; --on-accent:#06201f; --soft:#1b3030; --live:#35c273; --live-soft:#173626; --shadow:0 1px 2px rgba(0,0,0,.4); color-scheme: dark; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent-ink); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: .4rem 0 .8rem; }
small, .muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; margin: .5rem 0; }

header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .6rem 1.2rem; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--accent); text-decoration: none; font-size: 1.1rem; }
.brand span { color: var(--muted); font-weight: 500; }
nav { display: flex; gap: 1rem; align-items: center; margin-left: auto; }
nav a { text-decoration: none; color: var(--ink); } nav a:hover { color: var(--accent); }
.burger { display: none; margin-left: auto; }
.theme { font-size: .85rem; white-space: nowrap; }
button.link { background: none; border: 0; color: var(--accent-ink); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
a.btn-link { background: var(--accent); color: var(--on-accent); padding: .35rem .9rem; border-radius: 8px; }
nav a.btn-link:hover { color: var(--on-accent); opacity: .9; }

main { max-width: 1100px; margin: 0 auto; padding: 1.2rem; outline: 0; }
body.in-meeting main { max-width: 1300px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 1rem; } .grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: .6rem; }
.back { display: inline-block; margin-bottom: .6rem; text-decoration: none; color: var(--muted); }
.org-logo { border-radius: 6px; object-fit: contain; background: #fff; }

button, .btn { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: .4rem .9rem; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: var(--accent); }
button.primary, .btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--danger); border-color: var(--danger); }
button.danger.solid { background: var(--danger); color: #fff; }
button.small { padding: .15rem .6rem; font-size: .85rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.icon-btn { padding: .1rem .5rem; font-size: 1.2rem; line-height: 1.2; border-color: transparent; background: transparent; }
.live-btn { display: block; width: 100%; text-align: center; padding: .9rem 1rem; font-size: 1.2rem; font-weight: 700; color: #fff; background: var(--live); border-color: var(--live); border-radius: 12px; text-decoration: none; margin: .4rem 0; }
.live-btn:hover { filter: brightness(1.08); }

input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; max-width: 100%; }
input[type=text], input[type=email], input[type=url], input[type=datetime-local], input[type=date], input[type=number], select, textarea { width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; margin-right: .4rem; }
textarea { min-height: 4rem; resize: vertical; }
label.f { display: block; margin: .6rem 0; font-weight: 600; font-size: .92rem; }
label.f > input, label.f > select, label.f > textarea { margin-top: .2rem; font-weight: 400; }
.checks { display: flex; flex-wrap: wrap; gap: .3rem .9rem; } .check { font-weight: 400; display: inline-flex; align-items: center; }
.hint { color: var(--muted); font-size: .85rem; font-weight: 400; }
.err { color: var(--danger); }

.tags { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.tag { display: inline-block; background: var(--soft); color: var(--accent-ink); border-radius: 999px; padding: 0 .6rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.tag.live { background: var(--live); color: #fff; } .tag.live::before { content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: #fff; margin-right: .35rem; animation: pulse 1.4s infinite; }
.tag.ended { background: var(--line); color: var(--muted); } .tag.warn { background: #fdf0d5; color: var(--warn); } .tag.pending { background: #fdf0d5; color: var(--warn); }
.tag.done { background: var(--live-soft); color: var(--live); } .tag.red { background: var(--chat); color: #fff; }
@keyframes pulse { 50% { opacity: .3; } }

table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; } th { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.table-wrap { overflow-x: auto; }
.tabs { display: flex; gap: .2rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .5rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; } .list > li { padding: .55rem 0; border-bottom: 1px solid var(--line); } .list > li:last-child { border: 0; }
.quiet { font-size: .9rem; color: var(--muted); } .quiet .card, .card.quiet { box-shadow: none; }

/* meeting */
.hero { display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap; align-items: flex-start; }
.live-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; align-items: start; }
.live-side { position: sticky; top: 4.2rem; }
.roster li { display: flex; align-items: center; gap: .4rem; padding: .25rem 0; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--line); flex: none; } .dot.on { background: var(--live); }
.unread { width: .7rem; height: .7rem; border-radius: 50%; background: var(--chat); flex: none; }
.name-btn { background: none; border: 0; padding: 0; color: var(--ink); text-align: left; cursor: pointer; text-decoration: underline dotted; }
.agenda-item { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; margin: .5rem 0; }
.agenda-item.current { border-color: var(--live); background: var(--live-soft); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; } .timer.over { color: var(--danger); }
.interaction { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; margin: .6rem 0; background: var(--card); }
.interaction.hl { border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--soft); }
.interaction-head { display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; }
.bar { background: var(--soft); border-radius: 6px; height: 1.4rem; position: relative; overflow: hidden; margin: .25rem 0; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--accent); opacity: .35; }
.bar > span { position: relative; padding: 0 .5rem; line-height: 1.4rem; font-size: .88rem; }
.flash { animation: flash 1.6s ease-out; } @keyframes flash { 0% { background: #ffe58a; } 100% { background: transparent; } }
.item-card { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; margin: .5rem 0; }
.item-card.hl { border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--soft); }
.item-layout { display: flex; gap: .8rem; justify-content: space-between; flex-wrap: wrap; }
.docs a, .docs button.link { margin-right: .6rem; }

/* modal, toast, chat */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow: auto; }
.modal { background: var(--card); border-radius: 12px; width: min(520px, 100%); box-shadow: 0 10px 40px rgba(0,0,0,.35); } .modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1rem; border-bottom: 1px solid var(--line); } .modal-head h3 { margin: 0; }
.modal-body { padding: 1rem; }
#toasts { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 90; display: grid; gap: .4rem; justify-items: center; }
.toast { background: #1c2b2b; color: #fff; padding: .5rem 1rem; border-radius: 8px; box-shadow: var(--shadow); transition: opacity .4s; } .toast.err { background: var(--danger); } .toast.out { opacity: 0; }
.chat-log { max-height: 50vh; overflow: auto; display: flex; flex-direction: column; gap: .5rem; padding: .3rem; min-height: 6rem; }
.msg { max-width: 82%; background: var(--soft); border-radius: 12px; padding: .4rem .7rem; } .msg.mine { align-self: flex-end; background: var(--accent); color: var(--on-accent); } .msg.mine a { color: inherit; }
.msg small { display: block; opacity: .75; } .msg { overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble { position: fixed; right: 2rem; bottom: 2rem; z-index: 80; background: var(--chat); color: #fff; border-radius: 999px; padding: .6rem .6rem .6rem 1.1rem; display: flex; gap: .7rem; align-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.3); transition: opacity .5s; max-width: calc(100vw - 2rem); }
.bubble.out { opacity: 0; } .bubble button { background: none; border: 0; color: #fff; padding: 0; text-align: left; } .bubble .x { font-size: 1.3rem; padding: 0 .4rem; }

/* landing */
.landing-hero { text-align: center; padding: 2.5rem 1rem 1.5rem; } .landing-hero h1 { font-size: 2.3rem; } .landing-hero p { max-width: 38rem; margin: .6rem auto 1.2rem; color: var(--muted); font-size: 1.1rem; }
.landing-hero .row { justify-content: center; } .landing-hero .btn.primary { padding: .6rem 1.4rem; } .landing-hero .btn.alt { border-color: var(--accent); color: var(--accent-ink); padding: .6rem 1.4rem; }
.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } .features .card h3 { color: var(--accent-ink); }
.signin-box { max-width: 420px; margin: 2rem auto; }
.oauth { display: block; width: 100%; margin: .5rem 0; text-align: center; padding: .6rem; }

@media (max-width: 860px) {
  .burger { display: block; } nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--card); flex-direction: column; align-items: flex-start; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); margin: 0; }
  body.nav-open nav { display: flex; } .theme { margin-left: 0; }
  .live-layout { grid-template-columns: 1fr; } .live-side { position: static; }
  main { padding: .8rem; }
  body.in-meeting .live-main.card, .live-main > .card { background: transparent; border: 0; box-shadow: none; padding-left: 0; padding-right: 0; }
  .interaction-head { flex-direction: column-reverse; align-items: stretch; }
  .item-layout { flex-direction: column; }
  .bubble { right: 1rem; bottom: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .tag.live::before, .flash { animation: none; } }
div.f { margin: .8rem 0; }
