:root {
  --bg: #0d0b10; --panel: #17141c; --panel2: #1e1a24; --line: #2b2632; --ink: #f4f1ea; --muted: #a59fae;
  --brass: #d9a441; --neon: #ff3d7f; --good: #3ecf8e; --bad: #ff6b6b;
  --v-hq: #ff3d7f; --v-vv: #d9a441; --v-db: #9b7bff; --v-corp: #5ec8c0; --v-all: #f4f1ea; --v-vendor: #a59fae;
  --nav-h: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.45 Inter, system-ui, sans-serif; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--brass); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.splash { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 12px; color: var(--muted); }
.splash img { width: 96px; margin: 0 auto; filter: drop-shadow(0 0 18px rgba(217,164,65,.35)); }

/* buttons and inputs */
.btn { border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--neon); border-color: var(--neon); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], textarea, select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--brass); }
textarea { resize: vertical; min-height: 64px; }
label.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; font-size: 14px; }
label.check input { width: 17px; height: 17px; accent-color: var(--neon); margin: 0; }
.error { color: var(--bad); font-size: 14px; }

/* sign in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 400px at 20% 0%, rgba(255,61,127,.16), transparent 70%), radial-gradient(700px 300px at 90% 10%, rgba(217,164,65,.14), transparent 70%); }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: grid; gap: 14px; }
.login-card img { width: 72px; }
.login-card h1 { font: 400 30px/1.05 "Archivo Black", Inter, sans-serif; margin: 0; }
.login-card h1 span { color: var(--neon); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.linkish { background: none; border: 0; color: var(--brass); cursor: pointer; padding: 0; font-size: 14px; }

/* shell */
.app { display: grid; grid-template-rows: auto 1fr; height: 100vh; height: 100dvh; }
.top { display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.top .brand { display: flex; align-items: center; gap: 10px; font: 400 18px "Archivo Black", Inter, sans-serif; white-space: nowrap; }
.top .brand img { width: 32px; }
.top .brand span { color: var(--neon); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav button { background: none; border: 0; padding: 8px 12px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; position: relative; }
.nav button[aria-current=page] { color: var(--ink); background: var(--panel2); }
.nav button.final { color: var(--brass); }
.badge { display: inline-block; min-width: 19px; padding: 0 6px; border-radius: 99px; background: var(--neon); color: #fff; font-size: 11.5px; line-height: 19px; text-align: center; margin-left: 6px; font-weight: 700; }
.me { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; color: #0d0b10; flex: none; }
.main { min-height: 0; overflow: hidden; }
.page { height: 100%; overflow-y: auto; padding: 22px; }
.page-inner { max-width: 1000px; margin: 0 auto; }
.page h2 { font: 400 26px/1.1 "Archivo Black", Inter, sans-serif; margin: 0 0 4px; }
.page .sub { color: var(--muted); margin: 0 0 18px; }

/* chat */
.chat { display: grid; grid-template-columns: 320px 1fr; height: 100%; }
.convos { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.convos-h { padding: 12px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.convo-list { overflow-y: auto; flex: 1; }
.convo { display: flex; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; background: none; border-left: 3px solid transparent; width: 100%; text-align: left; border-top: 0; border-right: 0; }
.convo:hover { background: var(--panel2); }
.convo[aria-current=true] { background: var(--panel2); border-left-color: var(--neon); }
.convo .t { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo .p { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo .meta { margin-left: auto; text-align: right; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.convo .body { min-width: 0; flex: 1; }
.empty { padding: 30px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); margin-bottom: 6px; font-size: 16px; }

.thread { display: flex; flex-direction: column; min-height: 0; }
.thread-h { padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; min-height: 58px; }
.thread-h .t { font-weight: 700; }
.thread-h .s { color: var(--muted); font-size: 13px; }
.back { display: none; }

/* address bar */
.to { position: relative; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.to-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); cursor: text; }
.to-box:focus-within { border-color: var(--brass); }
.to-box .lbl { color: var(--muted); font-weight: 600; padding: 0 4px; }
.to-box input { flex: 1; min-width: 160px; border: 0; background: none; padding: 5px 2px; outline: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; }
.chip.group { border-color: rgba(217,164,65,.5); }
.chip button { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0 5px; font-size: 15px; line-height: 1; }
.sugg { position: absolute; left: 18px; right: 18px; top: calc(100% - 6px); z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.5); max-height: 360px; overflow-y: auto; }
.sugg h4 { margin: 0; padding: 9px 12px 4px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.opt { display: flex; gap: 10px; align-items: center; padding: 8px 12px; cursor: pointer; }
.opt[aria-selected=true], .opt:hover { background: var(--panel2); }
.opt .n { font-weight: 600; }
.opt .d { color: var(--muted); font-size: 12.5px; }
.opt .gs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.gtag { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: rgba(217,164,65,.12); color: var(--brass); border: 1px solid rgba(217,164,65,.25); }
.gicon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(217,164,65,.15); color: var(--brass); flex: none; font-size: 14px; }

.msgs { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 760px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 9px 13px; min-width: 0; }
.msg.mine .bubble { background: #2a1726; border-color: rgba(255,61,127,.35); }
.msg.request .bubble { border-color: var(--brass); box-shadow: 0 0 0 1px rgba(217,164,65,.25) inset; }
.msg.final .bubble { border-color: var(--brass); background: linear-gradient(135deg, rgba(217,164,65,.14), var(--panel) 60%); }
.bubble .who { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.bubble .who b { color: var(--ink); }
.bubble .txt { white-space: pre-wrap; word-wrap: break-word; }
.bubble .tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; align-items: center; }
.tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; }
.tag.req { background: rgba(217,164,65,.18); color: var(--brass); }
.tag.final { background: var(--brass); color: #0d0b10; }
.tag.new { background: var(--neon); color: #fff; }
.taskbox { margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line); font-size: 13px; }
.taskbox.done { color: var(--good); }

.composer { border-top: 1px solid var(--line); padding: 10px 18px 14px; display: grid; gap: 8px; background: var(--panel); }
.composer textarea { min-height: 52px; max-height: 200px; }
.composer .row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.composer .row .btn.primary { margin-left: auto; }
.hint { font-size: 12px; color: var(--muted); }

/* lists and cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stack { display: grid; gap: 10px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.pill { border: 1px solid var(--line); background: none; border-radius: 99px; padding: 6px 13px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.pill[aria-pressed=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.task { display: flex; gap: 12px; align-items: flex-start; }
.task input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--good); margin-top: 2px; flex: none; }
.task .tt { font-weight: 600; white-space: pre-wrap; }
.task.done .tt { text-decoration: line-through; color: var(--muted); }
.task .tm { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 3px; align-items: center; }
.task .x { margin-left: auto; }
.overdue { color: var(--bad); font-weight: 600; }
.addrow { display: grid; grid-template-columns: 1fr 170px auto; gap: 8px; margin-bottom: 16px; }

.final-card { border-left: 4px solid var(--brass); display: grid; gap: 8px; }
.final-card.is-new { box-shadow: 0 0 0 1px rgba(255,61,127,.45), 0 8px 30px rgba(255,61,127,.12); }
.final-card .fh { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.final-card .fh .v { font-weight: 700; }
.final-card .txt { white-space: pre-wrap; font-size: 15.5px; }
.final-card .ff { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.final-hero { border-radius: 18px; padding: 22px; margin-bottom: 18px; background: linear-gradient(135deg, #2a2010, #1b1430 60%, #2a1020); border: 1px solid rgba(217,164,65,.4); }
.final-hero h2 { color: var(--brass); }

.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.person { display: flex; gap: 10px; }
.person .n { font-weight: 700; }
.person .d { font-size: 13px; color: var(--muted); }
.person .c { font-size: 13px; margin-top: 4px; display: grid; gap: 2px; }
.section-h { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

table.roster { width: 100%; border-collapse: collapse; font-size: 14px; }
table.roster th, table.roster td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.roster th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
table.roster select, table.roster input { padding: 5px 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; align-items: end; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { width: min(560px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: grid; gap: 12px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0; }
.modal .to { padding: 0; border: 0; }
.modal .sugg { left: 0; right: 0; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 99; max-width: 90vw; }

@media (max-width: 760px) {
  .app { grid-template-rows: auto 1fr auto; }
  .top { padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .top .brand b { display: none; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--panel); border-top: 1px solid var(--line); z-index: 30; padding: 6px 6px max(6px, env(safe-area-inset-bottom)); justify-content: space-around; }
  .nav button { padding: 6px 8px; font-size: 12.5px; }
  .main { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  .me .who { display: none; }
  .chat { grid-template-columns: 1fr; }
  .chat.open .convos { display: none; }
  .chat:not(.open) .thread { display: none; }
  .back { display: inline-block; }
  .page { padding: 16px; }
  .addrow { grid-template-columns: 1fr; }
}

/* voice */
.field-mic { display: flex; gap: 8px; align-items: flex-start; }
.field-mic > textarea, .field-mic > input { flex: 1; }
.mic { flex: none; min-width: 44px; min-height: 40px; font-size: 17px; }
.mic.on { background: var(--neon); border-color: var(--neon); color: #fff; font-size: 13px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255,61,127,.25); } }
.speak { padding: 1px 7px; font-size: 13px; border: 0; color: var(--muted); }
.speak:hover { color: var(--ink); }
.thread-h .speak, .toolbar .speak, .final-hero .speak { border: 1px solid var(--line); padding: 6px 12px; font-size: 13.5px; color: var(--ink); }

/* my tools */
a.tool { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
a.tool:hover { border-color: var(--brass); transform: translateY(-1px); }
.tool-i { font-size: 24px; width: 40px; height: 40px; display: grid; place-items: center; background: var(--panel2); border-radius: 10px; flex: none; }
a.tool .n { font-weight: 700; }
a.tool .d { font-size: 13px; color: var(--muted); }
a.tool .go { margin-left: auto; font-size: 12.5px; color: var(--brass); white-space: nowrap; }

/* nav labels: icon + text on desktop, icon over short text on phones */
.nav-t { margin-left: 5px; }
@media (max-width: 760px) {
  .nav { justify-content: flex-start; overflow-x: auto; gap: 2px; }
  .nav button { display: grid; justify-items: center; gap: 1px; min-width: 64px; font-size: 10.5px; line-height: 1.15; white-space: normal; text-align: center; }
  .nav-i { font-size: 18px; }
  .nav-t { margin-left: 0; max-width: 70px; }
  .nav .badge { position: absolute; top: 0; right: 4px; margin: 0; }
}

/* meeting agendas */
.ag .ag-sec { margin-bottom: 14px; display: grid; gap: 12px; }
.ag-title { margin: 0; font: 400 17px "Archivo Black", Inter, sans-serif; letter-spacing: .02em; }
.ag-h { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.ag-lbl { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.ag-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.ag-stat { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.ag-stat .l { font-size: 12px; color: var(--muted); }
.ag-stat .v { font: 400 20px "Archivo Black", Inter, sans-serif; }
.ag-stat .s { font-size: 12px; color: var(--muted); }
.ag-daily { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ag-daily > div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; text-align: center; }
.ag-daily .l { font-size: 11.5px; color: var(--muted); }
.ag-daily .v { font-weight: 700; font-size: 13.5px; }
.ag-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ag-table select, .ag-table input { min-width: 0; }
.ag-done td { opacity: .6; }
.ag-day { display: flex; gap: 10px; align-items: flex-start; }
.ag-day > b { width: 78px; flex: none; font-size: 13px; padding-top: 9px; }
.ag-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; margin-top: 10px; }
.ag-add select { width: auto; }
.ag-transcript { max-height: 260px; overflow-y: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; font-size: 14px; }
.ag-block textarea { min-height: 80px; }
@media (max-width: 760px) { .ag-two { grid-template-columns: 1fr; } .ag-daily { grid-template-columns: repeat(4, 1fr); } }
.ag-cat { border-top: 1px solid var(--line); padding-top: 10px; }

/* Phone bottom bar: five everyday sections plus More (2026-11-01) */
.more-btn, .more-sheet { display: none; }
@media (max-width: 760px) {
  .nav { justify-content: space-around; overflow-x: visible; }
  .nav button.sec { display: none; }
  .nav button { min-width: 0; flex: 1; }
  .more-btn { display: grid; }
  .more-sheet:not([hidden]) { display: grid; position: fixed; left: 10px; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 40; gap: 4px; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -10px 30px rgba(0,0,0,.25); }
  .more-sheet button { text-align: left; padding: 14px 12px; border: 0; border-radius: 10px; background: var(--panel2); color: var(--ink); font-weight: 600; font-size: 16px; }
}
