/* Vince — "Blueprint": the Aethereon brand as an engineering sheet.
   One ink (#2d4059) on paper, a faint drawing grid, mono annotations.
   Monochrome on purpose: the brand has no accent colour. Status is carried by
   shape and weight (solid, outline, dashed, struck), never by hue. */

:root {
  --ink: #2d4059;
  --ink-2: #4a5d78;
  --ink-3: #7d8ca3;
  --tint: #8fb3dc;
  --paper: #f3f5f8;
  --card: #ffffff;
  --line: #d5dce6;
  --grid: rgba(45, 64, 89, 0.055);
  --focus: #2d4059;
  --display: 'Big Shoulders Display', 'Archivo Narrow', system-ui, sans-serif;
  --body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: #d9e3f0;
    --ink-2: #b2c1d6;
    --ink-3: #8193ab;
    --tint: #8fb3dc;
    --paper: #16202e;
    --card: #1d2a3b;
    --line: #34465e;
    --grid: rgba(143, 179, 220, 0.06);
    --focus: #8fb3dc;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --ink: #d9e3f0; --ink-2: #b2c1d6; --ink-3: #8193ab; --tint: #8fb3dc;
  --paper: #16202e; --card: #1d2a3b; --line: #34465e; --grid: rgba(143, 179, 220, 0.06); --focus: #8fb3dc;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font: 15px/1.55 var(--body);
}
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.sheet { max-width: 1080px; margin: 0 auto; padding: 16px 16px 32px; min-height: 100vh; display: flex; flex-direction: column; }

/* title block */
.titleblock { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 6px 0 12px; border-bottom: 2px solid var(--ink); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 4px; background: #fff; padding: 2px; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1; }
.brand-role { color: var(--ink-3); text-transform: uppercase; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-family: var(--mono); font-size: 11px; text-transform: uppercase; border: 1px solid var(--ink); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.pill.off { border-style: dashed; color: var(--ink-3); border-color: var(--ink-3); }
.pill.solid { background: var(--ink); color: var(--paper); }

/* tabs */
.tabs { display: flex; gap: 2px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { font-family: var(--mono); font-size: 12px; text-transform: uppercase; text-decoration: none; padding: 7px 11px; border: 1px solid transparent; border-radius: 4px; color: var(--ink-2); white-space: nowrap; }
.tabs a:hover { border-color: var(--line); }
.tabs a.on { border-color: var(--ink); color: var(--ink); background: var(--card); }

main { flex: 1; outline: none; }
main:focus, main:focus-visible { outline: none; }
.fig { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 10px 0 14px; }
.fig h1 { font-family: var(--display); font-weight: 800; font-size: 34px; text-transform: uppercase; letter-spacing: 0.03em; margin: 0; line-height: 1.05; }
.fig .mono { color: var(--ink-3); text-transform: uppercase; }
.lead { color: var(--ink-2); max-width: 64ch; margin: -6px 0 16px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 14px; position: relative; }
.panel + .panel { margin-top: 12px; }
.panel h2 { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 10px; color: var(--ink-2); font-weight: 500; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }

/* draft cards */
.cards { display: grid; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: 6px; padding: 12px 14px; text-decoration: none; display: block; }
.card:hover { border-color: var(--ink-3); border-left-color: var(--ink); }
.card.st-draft { border-left-style: dashed; }
.card.st-approved { border-left-width: 6px; }
.card.st-rejected, .card.st-failed { border-left-color: var(--ink-3); }
.card.st-rejected .card-title { text-decoration: line-through; color: var(--ink-3); }
.card-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-title { font-weight: 600; }
.card-meta { color: var(--ink-3); }
.card-text { color: var(--ink-2); margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.tag { font-family: var(--mono); font-size: 11px; text-transform: uppercase; border: 1px solid var(--ink-3); border-radius: 3px; padding: 1px 6px; color: var(--ink-2); white-space: nowrap; }
.tag.solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tag.dash { border-style: dashed; }

/* draft editor */
.editor { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 760px) { .editor { grid-template-columns: 1fr; } }
label { display: block; font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--ink-2); margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
textarea.post { min-height: 340px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
.count { text-align: right; color: var(--ink-3); margin-top: 4px; }
.findings { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.findings li { border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; font-size: 13px; }
.findings li.block { border: 2px solid var(--ink); }
.findings li .mono { text-transform: uppercase; }
.clear { color: var(--ink-3); }

.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
button, .btn { font: 500 13px var(--mono); text-transform: uppercase; letter-spacing: 0.03em; padding: 9px 14px; border-radius: 4px; border: 1px solid var(--ink); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--ink); color: var(--paper); }
button.ghost { border-style: dashed; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:not(:disabled):hover { box-shadow: 0 0 0 2px var(--line); }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 500 11px var(--mono); text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--ink); padding: 6px 8px; }
.table td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; }
.scroll-x { overflow-x: auto; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.stat b { display: block; font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1; margin: 4px 0; }
.stat span { color: var(--ink-3); font-size: 13px; }
.meter { height: 8px; border: 1px solid var(--ink); border-radius: 2px; margin-top: 8px; position: relative; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--ink); }

/* calendar */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
@media (max-width: 760px) { .week { grid-template-columns: 1fr; } .day.empty-day { display: none; } }
.day { background: var(--card); border: 1px solid var(--line); border-radius: 4px; min-height: 96px; padding: 6px; }
.day.today { border: 2px solid var(--ink); }
.day .mono { color: var(--ink-3); text-transform: uppercase; display: block; margin-bottom: 4px; }
.slot { font-size: 12px; border: 1px dashed var(--ink-3); border-radius: 3px; padding: 4px 6px; margin-top: 4px; color: var(--ink-3); }
.slot.filled { border-style: solid; border-color: var(--ink); color: var(--ink); text-decoration: none; display: block; }
.slot.filled.st-approved { background: var(--ink); color: var(--paper); }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 62vh; overflow-y: auto; padding: 4px 2px 8px; }
.msg { max-width: 80%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--card); white-space: pre-wrap; word-wrap: break-word; }
.msg.daniel { align-self: flex-end; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.msg .mono { display: block; color: var(--ink-3); font-size: 10px; text-transform: uppercase; margin-bottom: 2px; }
.msg.daniel .mono { color: var(--tint); }
.composer { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.composer textarea { min-height: 52px; }
.held { border: 2px dashed var(--ink); border-radius: 6px; padding: 8px 12px; margin-top: 10px; }

.empty { border: 1px dashed var(--ink-3); border-radius: 6px; padding: 18px; color: var(--ink-3); text-align: center; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.login { max-width: 360px; margin: 12vh auto; }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--ink); margin-top: 24px; padding-top: 8px; color: var(--ink-3); text-transform: uppercase; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(150%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 6px; font-size: 14px; transition: transform 0.2s ease; max-width: calc(100vw - 32px); z-index: 10; }
.toast:not(.show) { visibility: hidden; }
.toast.show { transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
