/* ============================================================
   MINUTES.AI — Swiss / editorial light design system (Ink monochrome)
   ============================================================ */

:root {
  --paper: #FCFCFB;
  --card: #FFFFFF;
  --field: #F4F3F0;
  --ink: #1A1915;
  --ink-2: #5C5A52;
  --ink-3: #8E8C83;
  --line: rgba(26,25,21,0.12);
  --line-2: rgba(26,25,21,0.07);
  --accent: #1A1915;
  --accent-soft: rgba(26,25,21,0.06);
  --on-accent: #FCFCFB;
  --danger: #B23B2E;
  --ok: #2E9E5B;

  --sans: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Newsreader', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

.eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3);
}
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.hidden { display: none !important; }
.grow { flex: 1; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }

.side {
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 30px 20px 22px;
  background: var(--paper);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; margin-bottom: 40px; }
.mark {
  width: 30px; height: 30px; border-radius: 6px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.mark svg { width: 17px; height: 17px; }
.wordmark { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.wordmark .dot { color: var(--accent); }
.wordmark .ai { color: var(--ink-3); font-weight: 600; }

.nav-eyebrow { padding: 0 10px; margin: 0 0 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 7px; cursor: pointer;
  color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  background: transparent; border: none; text-align: left; width: 100%;
  position: relative; transition: background .15s, color .15s; font-family: var(--sans);
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; stroke-width: 1.8; }
.nav-item:hover { background: var(--accent-soft); color: var(--ink); }
.nav-item.active { color: var(--ink); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -20px; top: 7px; bottom: 7px;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}

.side-spacer { flex: 1; }
.side-foot { display: flex; flex-direction: column; gap: 12px; }
.signout {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 7px; border: none; background: transparent; cursor: pointer;
  color: var(--ink-2); font-size: 13.5px; font-weight: 500; font-family: var(--sans);
}
.signout svg { width: 16px; height: 16px; flex: 0 0 auto; }
.signout:hover { color: var(--danger); }
.status {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 11.5px; color: var(--ink-2);
}
.status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); flex: 0 0 auto; }
.status.warn .dot { background: var(--danger); }
.status.ok .dot { background: var(--ok); }
.status .status-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* API status badge (JS replaces className with `api-status <state>`) */
.api-status {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 11.5px; color: var(--ink-2);
}
.api-status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); flex: 0 0 auto;
}
.api-status.connected::before { background: var(--ok); }
.api-status.local::before { background: var(--accent); }
.api-status.disconnected::before { background: var(--danger); }
.api-status .status-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* -- main -- */
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; height: 100vh; }
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 34px 44px 24px; border-bottom: 1px solid var(--line); gap: 32px;
}
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
.page-sub { margin-top: 9px; color: var(--ink-2); font-size: 14px; max-width: 52ch; }
.meeting-meta { text-align: right; flex: 0 0 auto; }
.meeting-meta .eyebrow { display: block; margin-bottom: 6px; }
.meeting-title-field {
  font-size: 18px; font-weight: 600; color: var(--ink); border: none; background: transparent;
  text-align: right; font-family: var(--sans); outline: none; width: 280px; max-width: 100%;
  border-bottom: 1px solid transparent; padding: 2px 0;
}
.meeting-title-field:focus { border-bottom-color: var(--accent); }

.canvas { flex: 1; padding: 30px 44px 0; overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }

/* view switching */
.content-view { display: none; flex-direction: column; flex: 1; min-height: 0; }
.content-view.active { display: flex; animation: view-fade .35s cubic-bezier(0.16,1,0.3,1); }
@keyframes view-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   WORKSPACE
   ============================================================ */
/* guided 5-step workflow */
.flow-h1 { margin-top: 5px; }
.step-counter {
  font-size: 11.5px; color: var(--ink-3); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 13px; flex: 0 0 auto; letter-spacing: 0.04em;
}
.flow-canvas { padding-bottom: 40px; }
.flow { display: flex; flex-direction: column; max-width: 940px; }
.flow-step { display: grid; grid-template-columns: 34px 1fr; column-gap: 22px; }
.flow-gutter { grid-column: 1; grid-row: 1 / 3; position: relative; display: flex; justify-content: center; }
.flow-node {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 500; z-index: 1; flex: 0 0 auto;
}
.flow-step.is-final .flow-node { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* vertical spine bridges each node to the next (gutter spans both rows) */
.flow-gutter::after {
  content: ""; position: absolute; left: 50%; top: 34px; bottom: 0;
  width: 1px; background: var(--line); transform: translateX(-0.5px);
}
.flow-step.is-final .flow-gutter::after { display: none; }

.flow-head { grid-column: 2; grid-row: 1; display: flex; align-items: flex-start; gap: 14px; padding-top: 6px; margin-bottom: 14px; }
.flow-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
.flow-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.flow-content { grid-column: 2; grid-row: 2; padding-bottom: 26px; min-width: 0; }

/* step 01 — title */
.title-input {
  width: 100%; max-width: 560px; background: var(--card); border: 1px solid var(--line);
  border-radius: 9px; padding: 13px 16px; font-family: var(--sans);
  font-size: 17px; font-weight: 600; color: var(--ink); outline: none;
}
.title-input::placeholder { color: var(--ink-3); font-weight: 500; }
.title-input:focus { border-color: var(--accent); }

/* step 02 — template dropdown (sized to match the step-01 title field) */
.select.tpl-select {
  width: 100%; max-width: 560px;
  background-color: var(--card);
  font-size: 15px; font-weight: 500;
  border-radius: 9px; padding: 13px 42px 13px 16px;
  background-position: right 14px center; background-size: 16px;
}
.select.tpl-select:hover { border-color: var(--ink-3); }

.panel-tag {
  margin-left: auto; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); white-space: nowrap;
  border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; flex: 0 0 auto;
}

.source-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.field-label { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.select {
  -webkit-appearance: none; appearance: none;
  background-color: var(--field);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E8C83' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
  border: 1px solid var(--line); border-radius: 7px; color: var(--ink);
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  padding: 8px 32px 8px 12px; cursor: pointer; outline: none;
  max-width: 240px;
}
.select.grow { flex: 1; max-width: none; }
.select:focus { border-color: var(--accent); }

.recorder {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: 9px; padding: 13px 16px; margin-bottom: 16px;
  background: var(--card);
}
.mic-btn {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  border: 1px solid var(--line); background: var(--field); cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--ink-2);
  transition: background .15s, color .15s, border-color .15s;
}
.mic-btn svg { width: 16px; height: 16px; }
.mic-btn:hover { background: var(--accent-soft); color: var(--ink); }
.mic-btn.active {
  background: var(--danger); border-color: var(--danger); color: #fff;
  animation: pulse-rec 1.6s infinite;
}
@keyframes pulse-rec {
  0% { box-shadow: 0 0 0 0 rgba(178,59,46,0.5); }
  70% { box-shadow: 0 0 0 10px rgba(178,59,46,0); }
  100% { box-shadow: 0 0 0 0 rgba(178,59,46,0); }
}
.rec-meta { display: flex; flex-direction: column; min-width: 0; }
.rec-status { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; line-height: 1.3; }
.rec-time { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-top: 2px; line-height: 1.2; }
.rec-wave { margin-left: auto; display: flex; align-items: center; gap: 3px; height: 18px; flex: 0 0 auto; }
.rec-wave i { width: 2.5px; background: var(--line); border-radius: 2px; display: block; }
.rec-wave i:nth-child(1){height:5px}.rec-wave i:nth-child(2){height:11px}
.rec-wave i:nth-child(3){height:7px}.rec-wave i:nth-child(4){height:14px}
.rec-wave i:nth-child(5){height:6px}
.recorder.active .rec-wave i { background: var(--accent); animation: wave 0.8s ease-in-out infinite alternate; }
.recorder.active .rec-wave i:nth-child(1){animation-delay:.1s}.recorder.active .rec-wave i:nth-child(2){animation-delay:.2s}
.recorder.active .rec-wave i:nth-child(3){animation-delay:.3s}.recorder.active .rec-wave i:nth-child(4){animation-delay:.4s}
.recorder.active .rec-wave i:nth-child(5){animation-delay:.5s}
@keyframes wave { from { transform: scaleY(0.4); } to { transform: scaleY(1.5); } }

.textarea {
  flex: 1; min-height: 160px; width: 100%; resize: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  padding: 16px 18px; font-family: var(--sans); font-size: 14px; line-height: 1.65;
  color: var(--ink); outline: none;
}
.textarea::placeholder { color: var(--ink-3); }
.textarea:focus { border-color: var(--accent); }
.notes-area { background: var(--field); }
/* flow-step textarea sizing (override the flexed base) */
.ta-transcript, .ta-notes { flex: none; min-height: 200px; height: 200px; resize: vertical; }

/* step 05 — synthesize recap + action */
.synth-final {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  border: 1px solid var(--line); border-radius: 11px;
  padding: 15px 16px 15px 22px; background: var(--card); flex-wrap: wrap;
}
.synth-recap { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink); flex-wrap: wrap; }
.recap-item { white-space: nowrap; }
.recap-k { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-right: 7px; }
.recap-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line); flex: 0 0 auto; }
.btn-lg { padding: 13px 24px; font-size: 14px; flex: 0 0 auto; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer; white-space: nowrap;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em;
  border-radius: 8px; padding: 11px 20px; border: 1px solid transparent; transition: opacity .15s, background .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { opacity: 0.88; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(178,59,46,0.3); }
.btn-danger:hover { background: rgba(178,59,46,0.07); }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }

/* ============================================================
   ARCHIVE
   ============================================================ */
.toolbar { display: flex; gap: 14px; align-items: center; margin-bottom: 28px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }
.input {
  width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 14px; font-family: var(--sans); font-size: 13.5px; color: var(--ink); outline: none;
}
.search .input { padding-left: 40px; }
.input:focus { border-color: var(--accent); }

.arch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-bottom: 30px; }
.arch-card {
  border: 1px solid var(--line); border-radius: 11px; padding: 22px; background: var(--card);
  display: flex; flex-direction: column; min-height: 188px; cursor: pointer; transition: border-color .15s;
  position: relative;
}
.arch-card:hover { border-color: var(--accent); }
.arch-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
.arch-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.arch-date { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.arch-card h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; margin-bottom: 9px; }
.arch-card p { font-size: 13px; color: var(--ink-2); line-height: 1.55; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.arch-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--ink-3); }
.arch-foot svg { width: 14px; height: 14px; flex: 0 0 auto; }
.arch-owner { margin-left: auto; }
.delete-meet-btn {
  position: absolute; top: 16px; right: 16px; opacity: 0;
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-3); cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: opacity .15s, color .15s;
}
.delete-meet-btn svg { width: 14px; height: 14px; }
.arch-card:hover .delete-meet-btn { opacity: 1; }
.delete-meet-btn:hover { color: var(--danger); border-color: rgba(178,59,46,0.4); }
.empty-state { display: none; flex-direction: column; align-items: center; text-align: center; color: var(--ink-3); padding: 80px 20px; font-size: 14px; }

/* ============================================================
   USERS — table
   ============================================================ */
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3); padding: 0 16px 14px; border-bottom: 1px solid var(--line);
}
.table thead th:last-child { text-align: right; }
.table tbody td { padding: 17px 16px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; vertical-align: middle; }
.table tbody tr:hover { background: var(--accent-soft); }
.u-cell { display: flex; align-items: center; gap: 12px; }
.u-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--field); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--ink-2); flex: 0 0 auto; text-transform: uppercase;
}
.u-name { font-weight: 600; }
.role {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 5px;
  border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; display: inline-block;
}
.role.admin { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: transparent;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-2);
}
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn:hover { background: var(--accent-soft); color: var(--ink); }
.icon-btn.danger:hover { color: var(--danger); border-color: rgba(178,59,46,0.4); }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings { max-width: 720px; display: flex; flex-direction: column; gap: 34px; padding-bottom: 40px; }
.set-block > .eyebrow { display: block; margin-bottom: 4px; }
.set-block h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 4px; }
.set-block .blurb { font-size: 13px; color: var(--ink-2); margin-bottom: 20px; max-width: 56ch; }
.set-card { border: 1px solid var(--line); border-radius: 11px; padding: 24px; background: var(--card); }
.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row + .form-row { margin-top: 20px; }
.form-row label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.form-row .hint { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.pwd { position: relative; }
.pwd .input { padding-right: 42px; font-family: var(--mono); font-size: 13px; }
.pwd .eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: none; background: none; cursor: pointer; color: var(--ink-3); display: flex; }
.pwd .eye svg { width: 16px; height: 16px; }
.divider { height: 1px; background: var(--line); margin: 28px 0; }

/* template manager (Settings → Templates) */
.tpl-manage-list { display: flex; flex-direction: column; }
.tpl-manage-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.tpl-manage-row:first-child { padding-top: 0; }
.tpl-manage-row:last-child { border-bottom: none; padding-bottom: 0; }
.tpl-manage-info { min-width: 0; }
.tpl-manage-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.tpl-manage-desc { margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52ch; }
.tpl-manage-row .row-actions { flex: 0 0 auto; align-items: center; }

/* progress (model download) */
.progress-track { height: 6px; background: var(--field); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width .3s; }

/* ============================================================
   DIALOGS / AUTH
   ============================================================ */
/* Native <dialog> (showModal) — reset UA chrome, become a full-viewport
   centering layer so the inner .dialog card floats in the middle. */
dialog.app-dialog {
  border: none; padding: 0; margin: 0; background: transparent;
  max-width: 100vw; max-height: 100vh; width: 100%; height: 100%;
  overflow: visible; color: var(--ink);
}
dialog.app-dialog:not([open]) { display: none; }
dialog.app-dialog[open] { display: flex; align-items: center; justify-content: center; padding: 32px; }
dialog.app-dialog::backdrop { background: rgba(26,25,21,0.32); backdrop-filter: blur(2px); }
dialog.app-dialog > .dialog { animation: dialog-pop .22s cubic-bezier(0.16,1,0.3,1); }
@keyframes dialog-pop { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }

.dialog {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.18); width: 100%; max-width: 560px;
  display: flex; flex-direction: column; overflow: hidden; max-height: 86vh;
}
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 26px 28px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 26px 28px; overflow-y: auto; }
.dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 28px; border-top: 1px solid var(--line); }
.close-x { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line); background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ink-2); flex: 0 0 auto; }
.close-x svg { width: 15px; height: 15px; }
.dialog h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }

/* auth */
.auth-wrap { position: fixed; inset: 0; z-index: 90; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--paper); }
.auth-left { padding: 56px 60px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); }
.auth-hero { font-size: 46px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; max-width: 12ch; margin-top: 40px; }
.auth-hero .accent { color: var(--accent); }
.auth-foot { font-size: 12px; color: var(--ink-3); display: flex; gap: 22px; flex-wrap: wrap; }
.auth-right { display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--field); }
.auth-card { width: 100%; max-width: 360px; }
.auth-card h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 6px; }
.auth-card .sub { font-size: 13.5px; color: var(--ink-2); margin-bottom: 28px; }
.auth-card .form-row + .form-row { margin-top: 16px; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 24px; }

/* generating */
.gen { text-align: center; max-width: 460px; }
.gen .ring { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); margin: 0 auto 24px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gen h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; }
.gen p { color: var(--ink-2); font-size: 13.5px; margin-bottom: 26px; }
.log { text-align: left; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.log-item { display: flex; align-items: center; gap: 12px; padding: 13px 18px; font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.log-item:last-child { border-bottom: none; }
.log-item .tick { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line); flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.log-item .tick svg { width: 9px; height: 9px; color: var(--on-accent); opacity: 0; }
.log-item.completed { color: var(--ink); }
.log-item.completed .tick { background: var(--accent); border-color: var(--accent); }
.log-item.completed .tick svg { opacity: 1; }
.log-item.active .tick { border-color: var(--accent); }

/* results / markdown */
.result-meta { display: flex; align-items: center; gap: 12px; }
.markdown { font-size: 14px; line-height: 1.7; color: var(--ink); }
.markdown h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 12px; }
.markdown h2 { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 26px 0 12px; }
.markdown h2:first-child, .markdown h1:first-child { margin-top: 0; }
.markdown h3 { font-size: 16px; font-weight: 600; margin: 20px 0 8px; }
.markdown p { margin-bottom: 12px; color: var(--ink-2); }
.markdown ul { list-style: none; margin-bottom: 16px; }
.markdown li { position: relative; padding-left: 22px; margin-bottom: 8px; color: var(--ink-2); }
.markdown li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; }
.markdown strong { color: var(--ink); font-weight: 600; }
.markdown code { font-family: var(--mono); font-size: 12.5px; background: var(--field); padding: 1px 5px; border-radius: 4px; }
.markdown table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 13px; }
.markdown th, .markdown td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.markdown th { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.markdown blockquote { border-left: 2px solid var(--line); padding-left: 14px; color: var(--ink-2); margin-bottom: 12px; }

/* ============================================================
   AUDIO / TEXT FILE UPLOAD
   ============================================================ */
.audio-workspace { margin-bottom: 16px; }
.audio-dropzone {
  border: 1.5px dashed var(--line); border-radius: 11px; padding: 32px 24px; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s; background: var(--field);
}
.audio-dropzone:hover, .audio-dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon { width: 34px; height: 34px; color: var(--ink-3); margin-bottom: 12px; }
.audio-dropzone h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.dropzone-text { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.accent-link { color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; }
.audio-info-card { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; background: var(--card); }
.audio-meta { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.audio-file-icon { width: 30px; height: 30px; flex: 0 0 auto; }
.audio-text-details { min-width: 0; }
.audio-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio-size { font-size: 11.5px; color: var(--ink-3); }
.btn-remove-icon { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--ink-3); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.btn-remove-icon svg { width: 16px; height: 16px; }
.btn-remove-icon:hover { color: var(--danger); border-color: rgba(178,59,46,0.4); }
.audio-lang-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
audio { width: 100%; margin-top: 14px; }

.mic-inline-controls { display: flex; align-items: center; gap: 10px; }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--paper);
  padding: 12px 16px; border-radius: 9px; font-size: 13px; font-weight: 500;
  box-shadow: 0 12px 34px rgba(0,0,0,0.22); max-width: 360px;
  animation: toast-in .25s cubic-bezier(0.16,1,0.3,1);
  transition: opacity .25s, transform .25s;
}
.toast svg { width: 16px; height: 16px; flex: 0 0 auto; }
.toast .toast-icon { display: flex; }
.toast.removing { opacity: 0; transform: translateY(12px); }
.toast-success { border-left: 3px solid var(--ok); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid #D9942B; }
.toast-info { border-left: 3px solid var(--ink-3); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ============================================================
   NOTION-STYLE NOTES EDITOR (bubble toolbar + slash menu)
   ============================================================ */
.fmt-bubble {
  position: fixed; z-index: 300; display: none; align-items: center; gap: 1px;
  background: var(--ink); border-radius: 9px; padding: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.30);
}
.fmt-bubble button {
  border: none; background: transparent; color: var(--paper); cursor: pointer;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; line-height: 1;
  padding: 6px 8px; border-radius: 6px; min-width: 28px;
  display: flex; align-items: center; justify-content: center;
}
.fmt-bubble button:hover { background: rgba(255,255,255,0.16); }
.fmt-bubble button .i-em { font-style: italic; font-family: var(--serif); }
.fmt-bubble .sep { width: 1px; align-self: stretch; background: rgba(255,255,255,0.20); margin: 3px 3px; }

.slash-menu {
  position: fixed; z-index: 300; display: none; width: 250px; max-height: 290px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.18); padding: 6px;
}
.slash-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.slash-item .s-key {
  width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; color: var(--ink-2); background: var(--field);
}
.slash-item .s-label { font-size: 13px; font-weight: 500; color: var(--ink); }
.slash-item.is-active { background: var(--accent-soft); }

/* WYSIWYG manual-notes surface (renders formatting live) */
.wysiwyg {
  width: 100%; min-height: 200px; resize: vertical; overflow-y: auto;
  background: var(--field); border: 1px solid var(--line); border-radius: 9px;
  padding: 16px 18px; font-family: var(--sans); font-size: 14px; line-height: 1.65;
  color: var(--ink); outline: none;
}
.wysiwyg:focus { border-color: var(--accent); }
.wysiwyg.is-empty::before {
  content: attr(data-placeholder); color: var(--ink-3); pointer-events: none;
}
.wysiwyg > :first-child { margin-top: 0; }
.wysiwyg h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.015em; margin: 10px 0 6px; line-height: 1.2; }
.wysiwyg h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 10px 0 6px; line-height: 1.25; }
.wysiwyg h3 { font-size: 15px; font-weight: 600; margin: 8px 0 4px; }
.wysiwyg p { margin: 0 0 8px; }
.wysiwyg ul, .wysiwyg ol { margin: 0 0 8px; padding-left: 24px; }
.wysiwyg li { margin: 2px 0; }
.wysiwyg blockquote { border-left: 2px solid var(--line); padding-left: 12px; margin: 0 0 8px; color: var(--ink-2); }
.wysiwyg code { font-family: var(--mono); font-size: 12.5px; background: var(--card); padding: 1px 5px; border-radius: 4px; }
.wysiwyg pre { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 0 0 8px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; }
.wysiwyg hr { border: none; border-top: 1px solid var(--line); margin: 12px 0; }
#template-dialog .wysiwyg { min-height: 150px; }

/* ============================================================
   TAG CHIPS & PICKER
   ============================================================ */

/* Title + tag picker inline row */
.title-tag-row { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 700px; flex-wrap: wrap; }
.title-tag-row .title-input { flex: 1; min-width: 180px; max-width: none; }

/* Tag picker container — styled as a field that matches the title input's
   height (align-self: stretch tracks the input exactly, no magic numbers). */
.tag-picker {
  position: relative; flex: 0 0 auto; align-self: stretch;
  display: flex; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 9px; padding: 0 8px;
}
.tag-picker:focus-within { border-color: var(--accent); }
.tag-picker-row { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; height: 100%; }

.tag-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; border-radius: 5px;
  padding: 3px 8px 3px 6px; border: 1px solid transparent; white-space: nowrap;
}
.tag-chip-remove {
  border: none; background: transparent; padding: 0; margin-left: 1px; cursor: pointer;
  color: inherit; opacity: 0.55; line-height: 1; font-size: 15px;
  display: flex; align-items: center;
}
.tag-chip-remove:hover { opacity: 1; }
.tag-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }

.tag-add-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-3);
  border: none; border-radius: 6px; padding: 5px 7px;
  background: transparent; cursor: pointer; transition: color .15s, background .15s;
  font-family: var(--sans); white-space: nowrap;
}
.tag-add-btn svg { width: 12px; height: 12px; }
.tag-add-btn:hover { color: var(--accent); background: var(--field); }

.tag-picker-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  min-width: 190px; max-width: 260px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.14); padding: 5px;
}
.tag-pick-option {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 7px;
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink); transition: background .1s;
}
.tag-pick-option:hover { background: var(--field); }
.tag-pick-option.is-selected { background: var(--accent-soft); }
.tag-pick-check { width: 13px; height: 13px; margin-left: auto; flex: 0 0 auto; color: var(--accent); opacity: 0; }
.tag-pick-option.is-selected .tag-pick-check { opacity: 1; }
.tag-pick-empty { padding: 10px 12px; font-size: 12.5px; color: var(--ink-3); }

.tag-manage-color { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }

.tag-color-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-color-swatch {
  width: 28px; height: 28px; border-radius: 7px; cursor: pointer;
  border: 2px solid transparent; display: flex; align-items: center; justify-content: center;
  transition: transform .12s, border-color .15s; flex: 0 0 auto;
}
.tag-color-swatch:hover { transform: scale(1.1); }
.tag-color-swatch.is-active { border-color: var(--ink); }
.tag-color-swatch svg { width: 13px; height: 13px; color: white; opacity: 0; }
.tag-color-swatch.is-active svg { opacity: 1; }

.arch-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.arch-tags .tag-chip { font-size: 10.5px; padding: 2px 7px 2px 5px; }

/* ============================================================
   MOBILE
   ============================================================ */
.mobile-header { display: none; }
.sidebar-overlay { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; width: 248px; z-index: 80;
    transform: translateX(-100%); transition: transform .25s; box-shadow: 0 0 40px rgba(0,0,0,0.2);
  }
  .side.open { transform: none; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(26,25,21,0.3); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .sidebar-overlay.active { opacity: 1; pointer-events: auto; }
  .mobile-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  /* the brand mark is shared with the sidebar, which adds a 40px bottom margin —
     reset it here so the wordmark centers against the menu button */
  .mobile-header .brand { margin-bottom: 0; padding: 0; }
  .mobile-menu-btn { width: 40px; height: 40px; margin-left: -8px; border-radius: 8px; border: none; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ink-2); flex: 0 0 auto; transition: background .15s, color .15s; }
  .mobile-menu-btn:hover { background: var(--accent-soft); color: var(--ink); }
  .mobile-menu-btn svg { width: 22px; height: 22px; }
  .main { height: auto; flex: 1; }
  .topbar { flex-direction: column; align-items: flex-start; padding: 22px 20px 18px; }
  .meeting-meta { text-align: left; }
  .meeting-title-field { text-align: left; }
  .canvas { padding: 22px 20px 0; }
  .flow-step { grid-template-columns: 26px 1fr; column-gap: 14px; }
  .flow-node { width: 26px; height: 26px; font-size: 11px; }
  .flow-gutter::after { top: 26px; }
  .synth-final { padding: 16px; }
  .arch-grid { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-left { display: none; }
}
