@font-face { font-family: "Playfair"; src: url(/fonts/PlayfairDisplay[wght].ttf) format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Playfair"; font-style: italic; src: url(/fonts/PlayfairDisplay-Italic[wght].ttf) format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url(/fonts/Montserrat[wght].ttf) format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F4EFE4; --panel: #FBF8F1; --panel-2: #EFE7D6; --line: #DCD0B8; --ink: #2A2622; --muted: #6E655A;
  --brick: #A23B2A; --brick-soft: #F1DCD4; --teal: #2F6F73; --teal-soft: #D8E8E6; --ok: #3F7A3A; --warn: #A86A12;
  --shadow: 0 1px 2px rgb(42 38 34 / .06), 0 4px 16px rgb(42 38 34 / .06);
  --serif: "Playfair", Georgia, serif; --sans: "Montserrat", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1C1916; --panel: #25211D; --panel-2: #2E2924; --line: #3D3630; --ink: #EFE7D6; --muted: #A89C8C;
    --brick: #D2654F; --brick-soft: #3E2620; --teal: #6FB0AE; --teal-soft: #1F3433; --ok: #7DB874; --warn: #E0A64A;
    --shadow: 0 1px 2px rgb(0 0 0 / .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1C1916; --panel: #25211D; --panel-2: #2E2924; --line: #3D3630; --ink: #EFE7D6; --muted: #A89C8C;
  --brick: #D2654F; --brick-soft: #3E2620; --teal: #6FB0AE; --teal-soft: #1F3433; --ok: #7DB874; --warn: #E0A64A;
  --shadow: 0 1px 2px rgb(0 0 0 / .3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: 30px; } h2 { font-size: 21px; } h3 { font-size: 16px; }
a { color: var(--teal); }
small, .muted { color: var(--muted); }
[hidden] { display: none !important; }

.shell { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; background: var(--panel); }
.brandmark { font: 800 13px/1.15 var(--sans); letter-spacing: .14em; color: var(--ink); text-decoration: none; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 6px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.side nav a:hover { background: var(--panel-2); }
.side nav a.on { background: var(--ink); color: var(--bg); }
.linkish { background: none; border: 0; color: var(--muted); cursor: pointer; text-align: left; padding: 8px 10px; font: inherit; margin-top: auto; }
.view { padding: 28px 32px 80px; max-width: 1240px; width: 100%; min-width: 0; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 5; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; gap: 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .side .brandmark br { display: none; } .side .brandmark { white-space: nowrap; font-size: 11px; }
  .side nav { flex-direction: row; } .side nav a { white-space: nowrap; padding: 6px 9px; }
  .linkish { margin: 0; white-space: nowrap; }
  .view { padding: 18px 16px 60px; }
  h1 { font-size: 24px; }
}

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head p { margin: 0; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.g-img { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.section { margin-top: 28px; }
.eyebrow { font: 700 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

.btn { font: 600 13px var(--sans); border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.brick { background: var(--brick); color: #fff; border-color: var(--brick); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.pill { font: 700 11px var(--sans); padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--ink); white-space: nowrap; }
.pill.brick { background: var(--brick); color: #fff; } .pill.teal { background: var(--teal-soft); color: var(--teal); }
.pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.pill.bad { background: var(--brick-soft); color: var(--brick); }

input, select, textarea { font: 14px var(--sans); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; width: 100%; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55; min-height: 120px; resize: vertical; }
textarea.prose { font: 14px/1.6 var(--sans); }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 12px; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
label.inline input { width: auto; }
.form { display: grid; gap: 12px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form .two { grid-template-columns: 1fr; } }

/* stages */
.stages { display: flex; gap: 4px; margin: 10px 0 4px; }
.stages i { flex: 1; height: 6px; border-radius: 3px; background: var(--panel-2); }
.stages i.done { background: var(--teal); }
.stagelist { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.stage { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--panel); font-weight: 600; font-size: 12px; display: flex; gap: 8px; align-items: center; }
.stage .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-size: 11px; color: #fff; }
.stage.done .dot { background: var(--teal); border-color: var(--teal); }

.ep-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; padding: 0; overflow: hidden; }
.ep-card .poster { aspect-ratio: 16/9; background: var(--panel-2) center/cover; position: relative; }
.ep-card .poster span { position: absolute; left: 10px; top: 10px; }
.ep-card .body { padding: 12px 14px 14px; }
.ep-card h3 { font-size: 17px; margin: 2px 0; }
.ep-card:hover { border-color: var(--ink); }

.cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.slot { border: 1px dashed var(--line); border-radius: 9px; padding: 12px; min-height: 96px; background: var(--panel); }
.slot.filled { border-style: solid; }
.slot .date { font: 700 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.slot a { display: block; font: 700 14px/1.25 var(--serif); color: var(--ink); text-decoration: none; margin-top: 6px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 20px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--brick); }

video, audio { width: 100%; border-radius: 8px; background: #000; display: block; }
audio { background: none; height: 40px; }
video.v { aspect-ratio: 9/16; max-height: 520px; object-fit: contain; }
.thumbimg { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 6px; background: var(--panel-2); display: block; cursor: zoom-in; }
.fig small { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.md { line-height: 1.65; overflow-wrap: anywhere; }
.md h1 { font-size: 26px; } .md h2 { font-size: 20px; margin-top: 1.4em; } .md h3 { margin-top: 1.2em; }
.md blockquote { margin: .6em 0; padding: 4px 14px; border-left: 3px solid var(--brick); background: var(--panel-2); border-radius: 0 6px 6px 0; }
.md code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.md table { border-collapse: collapse; display: block; overflow-x: auto; }
.md td, .md th { border: 1px solid var(--line); padding: 4px 8px; }

.log { background: #1A1714; color: #E9DFC9; font: 12.5px/1.55 ui-monospace, Menlo, monospace; padding: 14px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 62vh; overflow: auto; }
.joblist { display: flex; flex-direction: column; }
.job { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.job:hover { background: var(--panel-2); }
.job .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--teal); border-right-color: transparent; animation: s 0.9s linear infinite; display: inline-block; }
@keyframes s { to { transform: rotate(360deg); } }

.chat { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 820px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.msg.user { align-self: flex-end; background: var(--ink); color: var(--bg); border-color: var(--ink); white-space: pre-wrap; }
.msg.user a { color: inherit; }
.composer { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.composer textarea { min-height: 52px; font: 14px/1.5 var(--sans); }

.action { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.action:last-child { border-bottom: 0; }
.action b { display: block; }
.action small { display: block; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 8px; font-weight: 600; z-index: 50; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--brick); color: #fff; }
dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); padding: 22px; width: min(640px, calc(100vw - 32px)); max-height: 88vh; }
dialog::backdrop { background: rgb(20 16 12 / .5); }
dialog.wide { width: min(1100px, calc(100vw - 32px)); }
dialog img { max-width: 100%; border-radius: 6px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(360px, 100%); display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0; }
.err { color: var(--brick); margin: 0; min-height: 1em; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.platforms { display: flex; gap: 6px; flex-wrap: wrap; }
.idea h3 { font-size: 17px; }
.idea ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.files a { text-decoration: none; }
.files td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.files table { width: 100%; border-collapse: collapse; }

/* autopilot */
.apsplit { grid-template-columns: minmax(240px, 1fr) 2fr; }
@media (max-width: 820px) { .apsplit { grid-template-columns: 1fr; } }
.apbanner { display: flex; flex-direction: column; justify-content: center; gap: 4px; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.apbanner .eyebrow, .apbanner .muted { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.apbanner a { color: var(--bg); font: 700 15px/1.3 var(--serif); }
.apbanner .big { font: 800 34px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.apsteps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.apsteps li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: baseline; }
.apsteps b { font: 700 13px var(--sans); color: var(--brick); }
.apweek { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 820px) { .apweek { grid-template-columns: repeat(7, 132px); overflow-x: auto; padding-bottom: 6px; } }
.apday { border: 1px dashed var(--line); border-radius: 9px; padding: 10px; min-height: 120px; background: var(--panel); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.apday.filled { border-style: solid; }
.apday.today { border-color: var(--brick); border-width: 2px; }
.apday.off { opacity: .5; }
.apday .date { font: 700 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.apday .date span { color: var(--ink); font-size: 13px; }
.apday a { font: 700 13px/1.25 var(--serif); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.apreview { display: grid; grid-template-columns: 260px 1fr; gap: 20px; margin-bottom: 14px; align-items: start; }
@media (max-width: 640px) { .apreview { grid-template-columns: 1fr; } }
.apreview video.v { max-height: 460px; }
.apinfo h3 { font-size: 20px; margin-top: 8px; }
.md.small { font-size: 13px; color: var(--muted); }
.g-short { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.ep-card .poster.tall { aspect-ratio: 9/14; }
.apday .pill { white-space: normal; max-width: 100%; }

/* Buffer */
ul.plain { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
fieldset.bufch { border: 1px solid var(--line, #ddd); border-radius: 8px; padding: 8px 12px; display: grid; gap: 6px; }
fieldset.bufch legend { padding: 0 4px; font-size: .85em; }
.tbl th, .tbl td { padding: 7px 12px; border-bottom: 1px solid var(--line); } .tbl th { font-size: 12px; color: var(--muted, inherit); }

.apday .apitem { margin-top: 6px; }
.apday .apitem + .apitem { border-top: 1px solid var(--line); padding-top: 6px; }
.okhead { display: flex; gap: 16px; align-items: flex-start; }
.okcover { width: 110px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
@media (max-width: 560px) { .okcover { width: 80px; } }
