:root {
  color-scheme: light;
  --page: #efebe3;
  --surface: #fffdf9;
  --surface-2: #f5f1e8;
  --ink: #1d1c1a;
  --ink-2: #55524b;
  --muted: #736f66;
  --border: rgba(40, 30, 10, 0.12);
  --accent: #2b2a27;
  --accent-ink: #fffdf9;
  --focus: #1f63b8;
  --note: #fff6cc;
  --note-pinned: #ffefa3;
  --paper-line: #e9e3d3;
  --good: #0ca30c;
  --good-text: #006300;
  --warning: #fab219;
  --warning-text: #8a5a00;
  --critical: #d03b3b;
  --critical-text: #b42828;
  --info: #8a877d;
  --shadow: 0 1px 2px rgba(40, 30, 10, 0.06), 0 6px 18px rgba(40, 30, 10, 0.05);
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #121110;
    --surface: #1c1b19;
    --surface-2: #26241f;
    --ink: #f0ece3;
    --ink-2: #c9c4b8;
    --muted: #9a958a;
    --border: rgba(255, 255, 255, 0.1);
    --accent: #f0ece3;
    --accent-ink: #1d1c1a;
    --focus: #6aa6f0;
    --note: #2c2918;
    --note-pinned: #3a3415;
    --paper-line: #2e2c27;
    --good-text: #2fc42f;
    --warning-text: #fab219;
    --critical-text: #ef7373;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #121110;
  --surface: #1c1b19;
  --surface-2: #26241f;
  --ink: #f0ece3;
  --ink-2: #c9c4b8;
  --muted: #9a958a;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #f0ece3;
  --accent-ink: #1d1c1a;
  --focus: #6aa6f0;
  --note: #2c2918;
  --note-pinned: #3a3415;
  --paper-line: #2e2c27;
  --good-text: #2fc42f;
  --warning-text: #fab219;
  --critical-text: #ef7373;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Division colours: solid band + light tint. Same solid in both themes. */
.div-otomotiv { --div: #1f63b8; --div-tint: #e9f1fc; }
.div-maden { --div: #c2531f; --div-tint: #fcefe7; }
.div-teker { --div: #0f8a5f; --div-tint: #e4f5ee; }
.div-none, .div-genel { --div: #8a877d; --div-tint: var(--surface-2); }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .div-otomotiv { --div-tint: #172338; }
  :root:where(:not([data-theme="light"])) .div-maden { --div-tint: #2e1d15; }
  :root:where(:not([data-theme="light"])) .div-teker { --div-tint: #132a21; }
}
:root[data-theme="dark"] .div-otomotiv { --div-tint: #172338; }
:root[data-theme="dark"] .div-maden { --div-tint: #2e1d15; }
:root[data-theme="dark"] .div-teker { --div-tint: #132a21; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 650; }
a { color: inherit; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  min-width: 0;
}
input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
input[type="range"] { padding: 0; border: 0; background: none; accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 9px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--border); font-weight: 500; }
.btn.danger { background: transparent; color: var(--critical-text); border: 1px solid currentColor; font-weight: 500; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--ink-2);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; text-decoration: none; }
.mainnav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav a {
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  white-space: nowrap;
}
.mainnav a[aria-current="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.topbar-actions { display: flex; gap: 8px; }
@media (max-width: 560px) {
  .topbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .brand span { display: none; }
  .mainnav a { padding: 6px 8px; }
  #logout { display: none; }
}
@media (min-width: 561px) { .footer-logout { display: none; } }

/* ---------- page layout ---------- */
main { outline: none; }
.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 16px 110px;
  display: grid;
  gap: 16px;
  min-width: 0;
}
.page.narrow { max-width: 860px; }
.page > * { min-width: 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.section-head .actions { display: flex; gap: 6px; }
.section-sub { margin: -4px 0 10px; font-size: 13px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-foot { display: flex; justify-content: flex-end; }
.footer { text-align: center; font-size: 13px; }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.split { display: grid; gap: 16px; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.empty { color: var(--muted); margin: 6px 0; font-size: 14px; }
.back { text-decoration: none; color: var(--ink-2); font-size: 14px; }
.save-status { font-size: 13px; color: var(--muted); min-height: 1em; }
.save-status[data-state="error"] { color: var(--critical-text); }

/* ---------- home ---------- */
.hero p { margin: 4px 0 0; }
.quick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
}
.quick input { border: 0; background: transparent; font-size: 16px; }
@media (max-width: 640px) {
  .quick { grid-template-columns: 1fr 1fr; }
  .quick input { grid-column: 1 / -1; grid-row: 1; border-bottom: 1px solid var(--border); border-radius: 0; }
  .quick .btn { grid-column: 1 / -1; justify-content: center; }
}

.division-row { display: grid; gap: 16px; }
@media (min-width: 900px) { .division-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.division-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--div-tint);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.division-head {
  display: grid;
  gap: 6px;
  padding: 16px;
  background: var(--div);
  color: #fff;
  text-decoration: none;
}
.division-head h2 { font-size: 22px; font-weight: 700; }
.division-stats { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.division-stats span { background: rgba(255, 255, 255, 0.18); padding: 2px 8px; border-radius: 999px; }
.division-stats .alert { background: #fff; color: #9b1c1c; font-weight: 600; }
.division-head .enter { font-size: 13px; opacity: 0.9; }
.division-head:hover .enter { text-decoration: underline; }
.division-body { padding: 6px 16px 12px; flex: 1; }
.division-body .item { border-color: color-mix(in srgb, var(--div) 18%, transparent); }

.desk-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 720px) { .desk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- division page ---------- */
.division-banner {
  background: var(--div);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  display: grid;
  gap: 4px;
  box-shadow: var(--shadow);
}
.division-banner .back { color: rgba(255, 255, 255, 0.85); }
.division-banner h1 { font-size: 30px; }
.division-banner p { margin: 0; opacity: 0.9; }

/* ---------- list items (tasks, replies) ---------- */
.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}
.items .item:first-child { border-top: 0; }
.item input[type="checkbox"] { margin-top: 1px; }
.item-body { display: grid; gap: 2px; min-width: 0; }
.item-title { overflow-wrap: anywhere; font-weight: 500; }
.item.done .item-title { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.item-note { font-size: 13px; color: var(--ink-2); }
.star { color: #d08700; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 12.5px; color: var(--muted); }
.meta a { color: var(--ink-2); }
.due.overdue { color: var(--critical-text); font-weight: 600; }
.due.today { color: var(--warning-text); font-weight: 600; }
.due.soon { color: var(--ink-2); font-weight: 600; }
.x-btn {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  font-size: 14px;
  opacity: 0.6;
}
.x-btn:hover { opacity: 1; color: var(--critical-text); }
.more { font-size: 13px; margin: 4px 0 0; }
.done-list { margin-top: 8px; }
.done-list summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; }

.chip { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.chip .dot, .chip-link .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--div); flex: none; }

/* add forms */
.add-form { display: grid; gap: 6px; margin-bottom: 8px; }
.add-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.add-row input[type="date"] { flex: 0 1 150px; }
.add-row input:not([type]) { flex: 1 1 120px; }
.add-row select { flex: 0 1 120px; }
.add-row .btn { margin-left: auto; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }

/* status chips: icon + label */
.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 10px;
}
.status.good { color: var(--good-text); }
.status.good::before {
  background-color: var(--good);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2l2 2 4-4.4' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.status.warning { color: var(--warning-text); }
.status.warning::before {
  background-color: var(--warning);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3.6 2.6v4.8M6.4 2.6v4.8' stroke='%230b0b0b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}
.status.critical { color: var(--critical-text); }
.status.critical::before {
  background-color: var(--critical);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 2.2v3.4' stroke='white' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='5' cy='7.7' r='0.9' fill='white'/%3E%3C/svg%3E");
}
.status.info { color: var(--ink-2); }
.status.info::before {
  background-color: var(--info);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3.5 2.5l3 2.5-3 2.5' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---------- meetings ---------- */
.meetings { display: grid; gap: 4px; }
.meeting-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px;
  margin: 0 -8px;
  border-radius: 10px;
  text-decoration: none;
}
.meeting-row:hover { background: var(--surface-2); }
.meeting-row.past { opacity: 0.75; }
.date-block {
  display: grid;
  place-items: center;
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  line-height: 1.05;
}
.date-block b { font-size: 18px; }
.date-block small { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.meeting-row.today .date-block { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.meeting-row.today .date-block small { color: inherit; opacity: 0.8; }
.meeting-main { display: grid; gap: 2px; min-width: 0; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

/* ---------- projects ---------- */
.project-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.project-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--div);
  background: var(--surface);
  text-decoration: none;
  align-content: start;
}
.project-card:hover { background: var(--surface-2); }
.project-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.progress { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress span { display: block; height: 100%; background: var(--div); border-radius: 999px; }
.next-step { font-size: 13px; color: var(--ink-2); }
.add-project { margin-top: 10px; }

/* ---------- notes ---------- */
.note-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.note-grid.compact { grid-template-columns: 1fr; }
.note-card {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 14px;
  min-height: 130px;
  border-radius: 4px 4px 14px 4px;
  background: var(--note);
  text-decoration: none;
  box-shadow: 0 1px 1px rgba(40, 30, 10, 0.08), 0 4px 10px rgba(40, 30, 10, 0.07);
  transition: transform 0.15s ease;
  min-width: 0;
}
.note-card.pinned { background: var(--note-pinned); }
.home .note-grid .note-card:nth-child(odd) { transform: rotate(-0.6deg); }
.home .note-grid .note-card:nth-child(even) { transform: rotate(0.5deg); }
.note-card:hover { transform: none !important; }
.note-top { display: flex; justify-content: space-between; gap: 6px; }
.note-text {
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}
.ink-thumb { width: 100%; border-radius: 6px; display: block; border: 1px solid var(--border); }

/* ---------- detail pages ---------- */
.detail { display: grid; gap: 14px; border-top: 5px solid var(--div, var(--border)); }
.note-detail { border-top: 5px solid #e2c84a; }
.title-input {
  font-size: 24px;
  font-weight: 700;
  border: 0;
  border-bottom: 1px dashed transparent;
  border-radius: 0;
  padding: 4px 0;
  background: transparent;
  width: 100%;
}
.title-input:hover, .title-input:focus { border-bottom-color: var(--border); }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.fields.inline { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 20px; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.field input, .field select, .field textarea { font-size: 15px; color: var(--ink); width: 100%; }
.field textarea { resize: vertical; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input { flex: 1; }

.timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); display: grid; gap: 12px; }
.timeline li { position: relative; font-size: 14px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--muted);
}
.timeline p { margin: 2px 0 0; white-space: pre-wrap; }
.timeline .muted { font-size: 12.5px; }

/* ---------- writing: lined paper for typed and handwritten notes ---------- */
.writing-area { display: grid; gap: 10px; }
.writing {
  width: 100%;
  min-height: 55vh;
  resize: vertical;
  font-size: 16px;
  line-height: 28px;
  padding: 6px 14px 14px 52px;
  border-radius: 10px;
  background-color: var(--surface);
  background-image:
    linear-gradient(90deg, transparent 40px, rgba(226, 120, 110, 0.35) 40px, rgba(226, 120, 110, 0.35) 41px, transparent 41px),
    repeating-linear-gradient(var(--surface) 0 27px, var(--paper-line) 27px 28px);
  background-attachment: local;
  background-position: 0 6px;
}
.segmented {
  display: inline-flex;
  justify-self: start;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 10px;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--ink-2);
}
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

.ink { display: grid; gap: 8px; }
.ink-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  position: sticky;
  top: 58px;
  z-index: 2;
  padding: 6px 8px;
  background: var(--surface-2);
  border-radius: 10px;
}
.ink-toolbar .group { display: flex; gap: 4px; align-items: center; }
.tool {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
  min-height: 34px;
}
.tool[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.tool.width { width: 36px; display: grid; place-items: center; padding: 0; }
.tool.width span { display: block; width: 18px; border-radius: 4px; background: currentColor; }
.color-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
  padding: 0;
}
.color-dot[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.ink-page {
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(40, 30, 10, 0.12), 0 6px 20px rgba(40, 30, 10, 0.08);
  background: #fffdf6;
}
.ink-canvas { display: block; width: 100%; touch-action: none; cursor: crosshair; }

/* ---------- list pages ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  font-size: 14px;
  color: var(--ink-2);
}
.chip-link[aria-current="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ---------- assistant ---------- */
.fab {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 6;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  cursor: pointer;
}
body.inking .fab { display: none; }
.drawer {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
@media (min-width: 760px) {
  .drawer { left: auto; width: 440px; border-left: 1px solid var(--border); box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12); }
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
}
.drawer-head > div { display: flex; gap: 8px; }
.chat { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; padding: 10px 12px; border-radius: 12px; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); }
.msg.assistant p, .msg.assistant ul, .msg.assistant ol { margin: 0 0 8px; }
.msg.assistant :last-child { margin-bottom: 0; }
.msg.assistant ul, .msg.assistant ol { padding-left: 20px; }
.msg.assistant h3 { font-size: 14px; margin: 4px 0 6px; }
.msg.error { align-self: stretch; color: var(--critical-text); font-size: 14px; }
.msg.thinking { color: var(--muted); font-style: italic; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; }
.suggestions button {
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-2);
}
.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.chat-form textarea { flex: 1; resize: none; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 360px; display: grid; gap: 10px; }
.login h1 { font-size: 22px; margin-bottom: 8px; }
.login label { font-size: 13px; color: var(--ink-2); }
.error { color: var(--critical-text); min-height: 1em; margin: 0; font-size: 14px; }

/* ---------- meeting template ---------- */
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tpl-top { gap: 4px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--div, var(--muted)); }
.prev-link { font-size: 13px; text-decoration: none; }
.tpl-section { display: grid; gap: 12px; }
.tpl-head { display: flex; gap: 12px; align-items: flex-start; }
.tpl-head .section-sub { margin: 2px 0 0; }
.tpl-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
}
.participants { display: grid; gap: 10px; }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
}
.owner { color: var(--ink-2); font-weight: 600; }
.next-meeting { display: grid; gap: 10px; }
.next-link { display: grid; gap: 6px; justify-items: start; }
.next-link .meetings { width: 100%; }
.next-link p { margin: 0; font-size: 13px; }
.transcript {
  white-space: pre-wrap;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-2);
  padding: 12px;
  border-radius: 8px;
  max-height: 420px;
  overflow: auto;
  margin: 8px 0 0;
}

/* Plaud */
.plaud-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-2);
}
.banner-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
}
.banner-box.info { border-left: 4px solid var(--focus); }
.banner-box.ok { border-left: 4px solid var(--good); }
.banner-box.error { border-left: 4px solid var(--critical); color: var(--critical-text); }
.banner-box .muted { flex-basis: 100%; font-size: 13px; }
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--focus);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.dialog::backdrop { background: rgba(20, 15, 5, 0.45); }
.dialog-body { display: grid; gap: 12px; padding: 20px; }
.dialog-body p { margin: 0; }
.dialog-body textarea { width: 100%; resize: vertical; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.plaud-card summary { cursor: pointer; }
.plaud-settings { display: grid; gap: 10px; margin-top: 12px; justify-items: start; }
.plaud-settings p { margin: 0; }
.plaud-settings h3 { font-size: 15px; margin-top: 8px; }
.plaud-settings .small { font-size: 13px; }
.template-text {
  width: 100%;
  white-space: pre-wrap;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-2);
  padding: 12px;
  border-radius: 8px;
  margin: 0;
}
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.url-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.url-row code {
  font-size: 12px;
  background: var(--surface-2);
  padding: 4px 8px;
  border-radius: 6px;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.mail-link { color: var(--focus) !important; font-weight: 600; text-decoration: none; }
.mail-link:hover { text-decoration: underline; }
