/* PHYSIO SAMOS — admin console styles.
   The console lives in the site's own world: the palette tokens below are copied from :root in
   public/assets/css/main.css (keep them in step), the fonts are the site's self-hosted files.
   It is an Operate surface, so the site's display moves (clamped hero type, WebGL, pill domes) stay
   on the site: Manrope runs the interface at a fixed scale, Literata appears only where an article
   is written or previewed, JuliaMono only for times, addresses and counts. */
@import url("/admin/fonts.css");

:root {
  --bg: #f5f1ea;
  --bg-2: #ede7dc;
  --bg-3: #e3dcce;
  --ink: #1a1f1e;
  --ink-2: #2d4a47;
  --ink-3: #4a5e5b;
  --muted: #6c7875;
  --line: #d8d0c1;
  --line-2: #c8bea9;
  --sage: #68a29b;
  --sage-dark: #2d4a47;
  --sage-light: #a8c8c2;
  --terra: #d97757;
  --terra-dark: #b85d3f;
  --paper: #ffffff;

  --font-display: "Literata", ui-serif, Georgia, serif;
  --font-sans: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JuliaMono", ui-monospace, SFMono-Regular, monospace;

  /* The console's own roles, all mixed from the palette for the light-only admin. */
  --rail: color-mix(in srgb, var(--bg-2) 70%, var(--bg));
  --hairline: color-mix(in srgb, var(--ink) 12%, transparent);
  --hairline-strong: color-mix(in srgb, var(--ink) 22%, transparent);
  --hover: color-mix(in srgb, var(--ink) 6%, transparent);
  --press: color-mix(in srgb, var(--ink) 11%, transparent);
  --primary: var(--sage-dark);
  --on-primary: #f5f1ea;
  --focus: color-mix(in srgb, var(--sage) 70%, var(--ink));
  /* "Live on the site" is terracotta and nothing else is. Text in it is pulled toward ink so the
     label clears 4.5:1 on paper. */
  --live: var(--terra);
  --live-text: color-mix(in srgb, var(--terra-dark) 72%, var(--ink));
  --live-wash: color-mix(in srgb, var(--terra) 13%, var(--paper));
  --scheduled-text: var(--sage-dark);
  --scheduled-wash: color-mix(in srgb, var(--sage) 16%, var(--paper));
  --draft-text: var(--ink-3);
  --draft-wash: color-mix(in srgb, var(--ink) 6%, var(--paper));
  --danger: #a3392b;
  --danger-wash: color-mix(in srgb, #a3392b 10%, var(--paper));
  --warn-text: #7a5412;
  --warn-wash: color-mix(in srgb, #d9a441 18%, var(--paper));

  --shadow-sheet: 0 1px 2px rgba(26, 31, 30, 0.05), 0 10px 30px -18px rgba(26, 31, 30, 0.18);
  --shadow-float: 0 12px 28px -10px rgba(26, 31, 30, 0.28), 0 2px 6px rgba(26, 31, 30, 0.08);

  --r-sm: 7px;
  --r: 11px;
  --r-lg: 16px;
  --control-h: 38px;
  --rail-w: 244px;
  --side-w: 348px;
  color-scheme: light;
}


* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 500 15px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--sage) 38%, transparent); color: inherit; }
input, textarea, select, button { font: inherit; color: inherit; }
textarea, input { caret-color: var(--terra-dark); }
img { display: block; max-width: 100%; }
a { color: var(--sage-dark); text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--bg); }
.mono { font-family: var(--font-mono); font-weight: 400; font-size: 12.5px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 15px; height: 15px; }
.icon--lg { width: 22px; height: 22px; }
.spin { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--ink-3); }
.boot img { border-radius: 10px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 20px;
  padding: 22px 14px 16px; background: var(--rail); border-right: 1px solid var(--hairline);
}
.rail__brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; color: var(--ink); }
.rail__brand img { max-width: 100%; object-fit: contain; object-position: left; }
.rail__brand span { font-size: 12px; color: var(--ink-3); line-height: 1.2; }
.rail__nav { display: grid; gap: 2px; }
.rail__link {
  display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 600; transition: background-color 150ms ease, color 150ms ease;
}
.rail__link .icon { color: var(--ink-3); }
.rail__link[aria-current="page"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(26, 31, 30, 0.08); }
.rail__link[aria-current="page"] .icon { color: var(--sage-dark); }
.rail__count { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.rail__site {
  margin-top: 4px; padding: 12px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--hairline);
  display: grid; gap: 8px; font-size: 13px;
}
.rail__site a { display: inline-flex; align-items: center; gap: 5px; justify-self: start; font-weight: 600; font-size: 13px; }
.rail__site a .icon { flex: none; }
.rail__foot { margin-top: auto; display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--hairline); }
/* Name and email on one line each, cut with an ellipsis; sign-out is an icon at the right (2026-09-17). */
.rail__user { display: flex; align-items: center; gap: 10px; padding: 4px 0 4px 8px; min-width: 0; }
.rail__user .avatar { flex: none; }
.rail__user strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail__user .who { flex: 1 1 auto; min-width: 0; }
.rail__user .who > span { display: block; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail__signout { flex: none; color: var(--ink-3); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  /* --bg on --sage-dark reads in both themes: cream on deep teal, near-black on light sage. */
  background: var(--sage-dark); color: var(--bg); font-weight: 700; font-size: 13px; line-height: 1; letter-spacing: 0.02em;
}
.topbar { display: none; }

.main { min-width: 0; }
.page { max-width: 1180px; margin: 0 auto; padding: 32px 40px 80px; }
.page--wide { max-width: none; padding: 0; }
/* Settings uses the full page width like every other page (owner, 2026-09-17). */
/* The account sheet is two columns, name beside password, so the fields fill the sheet instead of
   stopping at 520px inside it; it stacks with the rest of the page's grids on narrow screens. */
.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px 40px; align-items: start; }
.account-grid__col { display: grid; gap: 14px; }
.account-grid__col--rule { padding-left: 40px; border-left: 1px solid var(--hairline); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 750; line-height: 1.2; }
.page-head p { color: var(--ink-3); margin-top: 4px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section { margin-top: 36px; }
.section h2 { font-size: 16px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; }
.section h2 .mono { color: var(--ink-3); }
/* Settings closes on who made the console and which version it is (owner, 2026-09-17). */
.platform-info {
  margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap;
}
.platform-info__logo { height: 22px; width: auto; }
.platform-info__meta { display: flex; gap: 28px; margin: 0; font-size: 13px; }
.platform-info__meta div { display: grid; gap: 2px; }
.platform-info__meta dt { color: var(--ink-3); font-size: 12px; }
.platform-info__meta dd { margin: 0; font-weight: 600; color: var(--ink); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-h);
  padding: 0 15px; border-radius: var(--r-sm); border: 1px solid var(--hairline-strong); background: var(--paper);
  font-weight: 650; font-size: 14px; white-space: nowrap; text-decoration: none; color: var(--ink);
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--primary); border-color: transparent; color: var(--on-primary); }
.btn--live { background: var(--terra-dark); border-color: transparent; color: #fff; }
.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn--danger-text { color: var(--danger); }
.btn--quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn--icon { width: var(--control-h); padding: 0; }
.btn--icon.btn--sm { width: 32px; }
.btn--block { width: 100%; }
@media (hover: hover) {
  .rail__link:hover:not([aria-current="page"]) { background: var(--hover); color: var(--ink); }
  .btn:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 5%, var(--paper)); border-color: var(--line-2); }
  .btn--primary:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 86%, var(--ink)); }
  .btn--live:hover:not(:disabled) { background: color-mix(in srgb, var(--terra-dark) 85%, var(--ink)); }
  .btn--quiet:hover:not(:disabled) { background: var(--hover); border-color: transparent; }
  .btn--danger:hover:not(:disabled) { background: var(--danger-wash); border-color: var(--danger); }
}

.field { display: grid; gap: 6px; }
.field + .field { margin-top: 16px; }
.label { font-size: 13px; font-weight: 700; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.label .mono { color: var(--ink-3); font-weight: 400; }
.label .mono.is-over { color: var(--danger); }
.hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.input, .textarea, .select {
  width: 100%; min-height: var(--control-h); padding: 8px 11px; border-radius: var(--r-sm);
  border: 1px solid var(--hairline-strong); background: var(--paper); color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.textarea { resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 22%, transparent); }
.field.is-error .input, .field.is-error .textarea { border-color: var(--danger); }
.field__error { font-size: 12.5px; color: var(--danger); font-weight: 600; }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); background: var(--paper); overflow: hidden; }
.input-group:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 22%, transparent); }
.input-group .input { border: 0; box-shadow: none; min-width: 0; }
.input-group__prefix { display: flex; align-items: center; padding: 0 0 0 11px; color: var(--ink-3); white-space: nowrap; }

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  position: relative; width: 46px; height: 26px; border-radius: 26px; background: var(--bg-3);
  border: 1px solid var(--hairline-strong); transition: background-color 180ms ease, border-color 180ms ease; flex: none;
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--paper); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 200ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.switch input:checked + .switch__track { background: var(--terra-dark); border-color: transparent; }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: 0.5; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--hairline); }
.segmented button {
  border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 5px; font-size: 13px; font-weight: 650;
  color: var(--ink-3); display: inline-flex; align-items: center; gap: 7px;
}
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(26, 31, 30, 0.12); }
.segmented .count { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); font-weight: 400; }

/* ---------- state labels ---------- */
.state {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 24px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state--published { background: var(--live-wash); color: var(--live-text); }
.state--published::before { background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 22%, transparent); }
.state--scheduled { background: var(--scheduled-wash); color: var(--scheduled-text); }
/* Draft is an outlined chip on paper: a grey wash matched the hovered row's grey (owner, 2026-09-17). */
.state--draft { background: var(--paper); color: var(--draft-text); box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.state--trash { background: transparent; color: var(--muted); border: 1px dashed var(--hairline-strong); }
.state--ready { background: var(--scheduled-wash); color: var(--scheduled-text); }
.state--machine { background: var(--warn-wash); color: var(--warn-text); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.45; }
.notice .icon { margin-top: 1px; }
.notice--warn { background: var(--warn-wash); color: var(--warn-text); }
.notice--danger { background: var(--danger-wash); color: var(--danger); }
.notice--info { background: var(--scheduled-wash); color: var(--scheduled-text); }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- sheets ---------- */
.sheet { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--shadow-sheet); }
.sheet__pad { padding: 20px 22px; }
/* A sheet holding a row list: the rows run to the sheet's edges, full-width dividers split them, and a
   hovered row fills the whole band between two dividers (owner, 2026-09-17). The clip keeps the first
   and last bands inside the sheet's rounded corners. */
.sheet--rows { overflow: clip; }
.post-rows > li + li, .writer-rows > li + li { border-top: 1px solid var(--hairline); }

/* The blog's public state: the first thing on the dashboard, a statement rather than a setting. */
.blog-state { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px 22px; align-items: center; padding: 22px 24px; }
.blog-state__mark {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--draft-wash); color: var(--ink-3);
}
.blog-state.is-on .blog-state__mark { background: var(--live-wash); color: var(--live-text); }
.blog-state h2 { font-size: 20px; font-weight: 750; line-height: 1.25; }
.blog-state p { color: var(--ink-3); margin-top: 3px; font-size: 14px; }
.blog-state__side { display: flex; align-items: center; gap: 14px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 28px; margin-top: 28px; }
.list-plain { list-style: none; margin: 0; padding: 0; }

/* ---------- posts list ---------- */
.toolbar-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; width: min(320px, 100%); }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 36px; }
.post-rows { list-style: none; margin: 0; padding: 0; }
.post-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 14px 20px; transition: background-color 150ms ease;
}
.post-row__thumb { width: 64px; height: 48px; border-radius: 7px; overflow: hidden; background: var(--bg-2); display: grid; place-items: center; color: var(--muted); }
.post-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-row__title { font-weight: 700; font-size: 15.5px; color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-row__title.is-empty { color: var(--muted); font-style: italic; font-weight: 600; }
/* The whole row opens the post: the title link's ::after covers the row, and the action buttons sit
   above it (owner, 2026-09-17). */
.post-row { position: relative; }
.post-row__title::after { content: ""; position: absolute; inset: 0; }
.post-row__title:focus-visible { outline: none; }
.post-row:has(.post-row__title:focus-visible) { box-shadow: inset 0 0 0 2px var(--primary); }
.post-row__actions { position: relative; z-index: 1; }
/* Two meta lines: state and date, then writer and languages. Each part keeps itself on one line. */
.post-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.post-row__meta > * { white-space: nowrap; }
.post-row__writer { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-weight: 600; color: var(--ink-2); }
.post-row__writer > span { overflow: hidden; text-overflow: ellipsis; }
.post-row__writer.is-missing { font-weight: 500; font-style: italic; color: var(--muted); }
.post-row__langs { display: inline-flex; gap: 4px; }
.lang-tag { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; padding: 1px 5px; border-radius: 4px; background: var(--bg-2); color: var(--ink-3); }
.lang-tag.is-ready { background: var(--scheduled-wash); color: var(--scheduled-text); }
.lang-tag.is-source { background: var(--ink); color: var(--bg); }
.post-row__actions { display: flex; gap: 4px; align-items: center; }
@media (hover: hover) { .post-row:hover { background: var(--hover); } }

.empty { text-align: center; padding: 56px 24px; color: var(--ink-3); display: grid; justify-items: center; gap: 10px; }
.empty h3 { color: var(--ink); font-size: 17px; }
.empty .btn { margin-top: 6px; }

.skeleton { border-radius: 6px; background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2)); background-size: 200% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); min-height: 100vh; }
.editor__bar {
  position: sticky; top: 0; z-index: 20; grid-column: 1 / -1; display: flex; align-items: center; gap: 10px;
  height: 58px; padding: 0 18px 0 12px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--hairline);
}
.editor__bar .save-state { font-size: 13px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.editor__bar .save-state.is-dirty { color: var(--warn-text); }
.editor__bar .save-state.is-error { color: var(--danger); }
.editor__bar .spacer { flex: 1; }
.editor__main { min-width: 0; padding: 26px 40px 120px; }
.editor__side { border-left: 1px solid var(--hairline); background: var(--rail); padding: 18px 18px 120px; display: grid; align-content: start; gap: 14px; grid-template-columns: minmax(0, 1fr); }
/* An auto track grew to the Sharing panel's widest field and pushed the column past the page (2026-09-17). */
.editor__side > * { min-width: 0; }

.lang-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hairline); margin: 0 0 22px; flex-wrap: wrap; overflow: visible; flex-shrink: 0; }
.lang-tabs button {
  border: 0; background: none; height: 40px; padding: 0 14px; font-weight: 700; font-size: 13.5px; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 7px; border-bottom: 2px solid transparent; margin-bottom: 0; white-space: nowrap;
}
.lang-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.lang-tabs .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.lang-tabs .dot.is-ready { background: var(--sage); }
.lang-tabs .dot.is-draft { background: #d9a441; }
.lang-tabs .dot.is-source { background: var(--ink); }

/* Title and summary share one box, split by a hairline, like the text box below them (owner, 2026-09-17).
   Each field is one line at rest and grows with its text. */
.head-fields {
  border: 1px solid var(--hairline-strong); border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow-sheet);
  overflow: clip; transition: border-color 150ms ease;
}
.head-fields:focus-within { border-color: color-mix(in srgb, var(--focus) 60%, var(--hairline-strong)); }
.title-input, .excerpt-input {
  display: block; width: 100%; resize: none; overflow: hidden; border: 0; background: transparent; padding: 16px 30px;
}
.title-input { font: 600 34px/1.25 var(--font-display); letter-spacing: -0.01em; color: var(--ink); }
.excerpt-input { border-top: 1px solid var(--hairline); padding-top: 12px; padding-bottom: 14px; font: 500 17px/1.55 var(--font-sans); color: var(--ink-2); }
.title-input:focus, .excerpt-input:focus { outline: none; }
.title-input::placeholder, .excerpt-input::placeholder { color: var(--muted); }

.compose { margin-top: 22px; border: 1px solid var(--hairline-strong); border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow-sheet); }
.compose:focus-within { border-color: color-mix(in srgb, var(--focus) 60%, var(--hairline-strong)); }
.compose__tools {
  position: sticky; top: 58px; z-index: 10; display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  padding: 6px 8px; border-bottom: 1px solid var(--hairline); background: var(--paper); border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.compose__tools .sep { width: 1px; height: 20px; background: var(--hairline-strong); margin: 0 6px; }
.compose__tools .spacer { flex: 1; }
.tool {
  width: 34px; height: 34px; border-radius: 6px; border: 0; background: transparent; color: var(--ink-2);
  display: grid; place-items: center; transition: background-color 120ms ease, color 120ms ease;
}
.tool:disabled { opacity: 0.4; }
@media (hover: hover) { .tool:hover:not(:disabled) { background: var(--hover); color: var(--ink); } }
.tool:active:not(:disabled) { background: var(--press); }
.compose__panes { display: grid; grid-template-columns: minmax(0, 1fr); }
.compose__panes.is-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.compose__panes.is-split .write { border-right: 1px solid var(--hairline); }
.write {
  display: block; width: 100%; min-height: 520px; border: 0; resize: none; background: transparent; padding: 22px 26px 40px;
  font: 500 16.5px/1.7 var(--font-sans); color: var(--ink); tab-size: 2; overflow: hidden;
}
.write:focus { outline: none; }
.compose__foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 9px 14px; border-top: 1px solid var(--hairline); font-size: 12.5px; color: var(--ink-3); }
.compose__foot details summary { cursor: pointer; }
.syntax { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin-top: 8px; }
.syntax code { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.is-dragging .compose { border-color: var(--sage); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sage) 25%, transparent); }

/* The preview pane reads like the public article (keep in step with .blog-prose in main.css). */
.preview { padding: 22px 30px 48px; min-width: 0; }
.prose { font: 400 17px/1.72 var(--font-sans); color: var(--ink-2); max-width: 68ch; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { font: 600 27px/1.2 var(--font-display); color: var(--ink); margin-top: 1.7em; letter-spacing: -0.005em; }
.prose h3 { font: 600 21px/1.3 var(--font-display); color: var(--ink); margin-top: 1.4em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.55em; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { color: var(--sage-dark); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 2px 0 2px 20px; border-left: 1px solid var(--hairline-strong); font: italic 400 20px/1.55 var(--font-display); color: var(--ink); }
.prose hr { border: 0; height: 1px; background: var(--hairline-strong); margin: 2em 0; }
.prose figure { margin-left: 0; margin-right: 0; }
.prose figure img { width: 100%; height: auto; border-radius: 12px; }
.prose figcaption { margin-top: 8px; font-size: 13.5px; color: var(--ink-3); }
.preview__title { font: 600 34px/1.18 var(--font-display); color: var(--ink); margin-bottom: 12px; }
.preview__lead { font-size: 18px; color: var(--ink-3); margin-bottom: 22px; max-width: 60ch; }

/* ---------- inspector ---------- */
.panel { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--r); }
.panel > summary, .panel__head {
  list-style: none; display: flex; align-items: center; gap: 9px; padding: 13px 15px; font-weight: 700; font-size: 14px; cursor: pointer;
}
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary .chev { margin-left: auto; color: var(--ink-3); transition: transform 180ms ease; }
.panel[open] > summary .chev { transform: rotate(180deg); }
.panel > summary .icon:first-child { color: var(--ink-3); }
.panel__body { padding: 2px 15px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.panel__body > * { min-width: 0; }
.panel__body .field + .field { margin-top: 0; }
/* A disclosure inside a panel: the panel's own summary style one step down, and the same 14px field
   rhythm as the panel body (owner, 2026-09-17). */
.subpanel { border-top: 1px solid var(--hairline); margin: 0 -15px -16px; }
.subpanel > summary {
  list-style: none; display: flex; align-items: center; gap: 9px; padding: 12px 15px;
  font-size: 13.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; border-radius: 0 0 var(--r) var(--r);
}
.subpanel > summary::-webkit-details-marker { display: none; }
.subpanel > summary .chev { margin-left: auto; color: var(--ink-3); transition: transform 180ms ease; }
.subpanel[open] > summary { border-radius: 0; }
.subpanel[open] > summary .chev { transform: rotate(180deg); }
@media (hover: hover) { .subpanel > summary:hover { background: var(--hover); color: var(--ink); } }
.subpanel > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.subpanel__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 2px 15px 16px; }
.subpanel__body .field + .field { margin-top: 0; }
.subpanel__body > .btn { justify-self: stretch; width: 100%; justify-content: center; }
/* The cover's buttons share the panel's width; one button alone fills it. */
.cover-actions { display: flex; gap: 8px; }
.cover-actions > .btn { flex: 1 1 0; justify-content: center; }
.publish-state { display: grid; gap: 6px; font-size: 13.5px; }
.publish-state dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0; }
.publish-state dt { color: var(--ink-3); }
.publish-state dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.publish-actions { display: grid; gap: 8px; }
.publish-actions .row { display: flex; gap: 8px; }
.publish-actions .row .btn { flex: 1; }

.cover { position: relative; border-radius: var(--r-sm); overflow: hidden; background: var(--bg-2); aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--ink-3); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover__actions { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }

.snippet { border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 12px 13px; background: var(--bg); }
.snippet__url { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snippet__title { color: #1a4fb5; font-size: 17px; line-height: 1.3; margin-top: 4px; }
.snippet__desc { font-size: 13px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }

.revisions { list-style: none; margin: 0; padding: 0; display: grid; }
.revisions li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--hairline); font-size: 13px; }
.revisions li:first-child { border-top: 0; }
.revisions .grow { flex: 1; min-width: 0; }

.translate-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; margin-bottom: 22px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--hairline); }
.translate-bar .grow { flex: 1; min-width: 200px; font-size: 13.5px; color: var(--ink-3); }
.translate-bar strong { color: var(--ink); }

/* ---------- media ---------- */
.dropzone {
  display: grid; justify-items: center; gap: 8px; padding: 26px; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg);
  color: var(--ink-3); text-align: center; background: color-mix(in srgb, var(--paper) 55%, transparent); transition: border-color 150ms ease, background-color 150ms ease;
}
.dropzone.is-over { border-color: var(--sage); background: var(--scheduled-wash); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-top: 20px; }
.media-tile { display: grid; gap: 8px; text-align: left; border: 0; background: none; padding: 0; color: inherit; }
.media-tile__img { aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: var(--bg-2); border: 1px solid var(--hairline); }
.media-tile__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.media-tile[aria-pressed="true"] .media-tile__img { outline: 3px solid var(--sage-dark); outline-offset: 2px; }
.media-tile__name { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-tile__meta { font-size: 12px; color: var(--ink-3); }
@media (hover: hover) { .media-tile:hover .media-tile__img img { transform: scale(1.03); } }
.media-detail { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; }
.media-detail img { width: 100%; height: auto; border-radius: var(--r); background: var(--bg-2); }
.upload-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--bg-2); }

/* ---------- dialogs, toasts ---------- */
dialog.dialog {
  border: 0; padding: 0; border-radius: var(--r-lg); background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-float); width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 900px);
}
dialog.dialog--wide { width: min(1040px, calc(100vw - 32px)); }
dialog.dialog::backdrop { background: color-mix(in srgb, #0d1614 45%, transparent); backdrop-filter: blur(2px); }
dialog.dialog[open] { animation: dialog-in 200ms cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.dialog__head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; }
.dialog__head h2 { font-size: 18px; font-weight: 750; flex: 1; }
.dialog__body { padding: 14px 20px 18px; display: grid; gap: 14px; overflow: auto; max-height: calc(86vh - 140px); }
.dialog__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--hairline); }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 1000; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 12px; border-radius: 10px;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-float); font-size: 14px; font-weight: 600; max-width: min(560px, calc(100vw - 32px));
  animation: toast-in 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.toast--error { background: var(--danger); color: #fff; }
.toast button { background: transparent; border: 0; color: inherit; text-decoration: underline; font-weight: 700; padding: 0 0 0 6px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- sign-in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
/* The track is capped at the box's own width. An auto track sizes to the box's max-content (its lead
   paragraph unwrapped, ~870px), and the 380px box then sat at the start of that wide, centred track. */
.signin__form { display: grid; grid-template-columns: minmax(0, 380px); place-content: center; padding: 40px 24px; }
.signin__box { width: min(380px, 100%); display: grid; gap: 18px; }
/* The box's own gap is the spacing: .field + .field would add 16px to one gap only (owner, 2026-09-17). */
.signin__box .field + .field { margin-top: 0; }
.signin__box h1 { font-size: 24px; font-weight: 750; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; }
.user-rows { list-style: none; margin: 0; padding: 0; }
.user-rows li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hairline); }
.user-rows li:first-child { border-top: 0; }
.user-rows .grow { flex: 1; min-width: 0; }
.activity { list-style: none; margin: 0 -22px; padding: 0; }
.activity li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 22px; font-size: 13.5px; }
.activity li + li { border-top: 1px solid var(--hairline); }
.activity .when { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.activity-more { display: inline-block; margin-top: 10px; font-size: 13.5px; font-weight: 600; }
.compose__foot .count { font-variant-numeric: tabular-nums; }
.post-row__actions { flex-wrap: wrap; justify-content: flex-end; }
.signin.signin--single { grid-template-columns: minmax(0, 1fr); }
.kbd { font-family: var(--font-mono); font-size: 11px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--hairline-strong); color: var(--ink-3); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor__side { border-left: 0; border-top: 1px solid var(--hairline); padding: 18px 40px 120px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .compose__panes.is-split { grid-template-columns: minmax(0, 1fr); }
  .compose__panes.is-split .write { border-right: 0; border-bottom: 1px solid var(--hairline); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .rail.is-open { display: flex; position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 200; box-shadow: var(--shadow-float); }
  .rail-scrim { position: fixed; inset: 0; background: color-mix(in srgb, #0d1614 40%, transparent); z-index: 150; }
  .topbar { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px; border-bottom: 1px solid var(--hairline); background: var(--rail); position: sticky; top: 0; z-index: 30; }
  .topbar img { height: 28px; }
  .page { padding: 22px 18px 72px; }
  .dash-grid, .media-detail, .settings-grid, .signin, .account-grid { grid-template-columns: minmax(0, 1fr); }
  .account-grid__col--rule { padding: 22px 0 0; border-left: 0; border-top: 1px solid var(--hairline); }
  .blog-state { grid-template-columns: auto minmax(0, 1fr); }
  .blog-state__side { grid-column: 1 / -1; justify-content: space-between; }
  .editor__bar { top: 56px; }
  .compose__tools { top: 114px; }
  .editor__main { padding: 20px 18px 100px; }
  .editor__side { padding: 18px 18px 100px; }
  .post-row { grid-template-columns: 48px minmax(0, 1fr); }
  .post-row__thumb { width: 48px; height: 40px; }
  .post-row__actions { grid-column: 2; }
  .title-input { font-size: 28px; }
  .title-input, .excerpt-input { padding-left: 16px; padding-right: 16px; }
}
@media (pointer: coarse) {
  :root { --control-h: 44px; }
  .tool { width: 42px; height: 42px; }
  .btn--sm { height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* Editor on narrow screens (finish review, 2026-09-14): the bar stays one row — icon-only view switch
   and page link, the save state shown only when something needs attention — the language tabs and the
   toolbar scroll sideways instead of wrapping, and the gap before the side panels closes. */
@media (max-width: 900px) {
  .editor__bar { gap: 6px; padding: 0 8px; height: 52px; }
  .editor__bar .segmented__label, .editor__bar .btn__label, .editor__bar .save-state__label { display: none; }
  .editor__bar .segmented button { padding: 0 9px; }
  .editor__bar .save-state:not(.is-dirty):not(.is-error) { display: none; }
  .compose__tools { position: static; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .compose__tools::-webkit-scrollbar { display: none; }

  .editor__main { padding-bottom: 28px; }
  .editor__side { padding-top: 4px; }
}
@media (max-width: 420px) { .editor__bar .state { display: none; } }

/* Decorative login surface: the admin remains light in every OS theme. */
/* The sign-in is a split screen: a brand panel on the left, the form on paper on the right (2026-09-17;
   it replaced a WebGL background). Below 900px the panel goes and the form stands alone. */
.signin--split { grid-template-columns: minmax(0, 1.15fr) minmax(440px, 1fr); background: var(--paper); }
.signin__art {
  position: relative; margin: 14px; border-radius: 22px; overflow: hidden; isolation: isolate;
  display: flex; align-items: flex-end; padding: 44px;
  color: #f5f1ea;
  /* The site's home hero render (owner, 2026-09-17), under a light teal tint so it belongs to the
     console's palette. The .jpg is the one main.css uses, so a visitor's cache may already hold it. */
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--sage-dark) 22%, transparent), color-mix(in srgb, var(--sage-dark) 38%, transparent)),
    var(--sage-dark) url("/media/hero-treatment-room-1264.jpg") center / cover no-repeat;
}
/* A bottom scrim under the copy: the render is bright where the window is. */
.signin__art::after {
  content: ""; position: absolute; inset: 35% 0 0; z-index: -1;
  background: linear-gradient(to top, rgba(13, 22, 20, 0.82), rgba(13, 22, 20, 0.45) 45%, transparent);
}
.signin__art-copy { max-width: 560px; }
.signin__art-eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; margin-bottom: 14px; }
.signin__art-title { font: 600 clamp(30px, 3vw, 44px)/1.15 var(--font-display); letter-spacing: -0.01em; max-width: 15em; text-wrap: balance; }
.signin__art-title em { font-style: italic; font-weight: 500; color: color-mix(in srgb, var(--sage-light) 70%, #f5f1ea); }
.signin--split .signin__form { grid-template-columns: minmax(0, 360px); padding: 48px 40px; }
.signin--split .signin__box { width: 100%; gap: 20px; }
.signin__head { display: grid; gap: 6px; }
.signin__head h1 { font-size: 30px; font-weight: 750; letter-spacing: -0.01em; }
.signin__head p { color: var(--ink-3); font-size: 14.5px; }
.signin__logo { margin-bottom: 18px; }
.signin__logo img { max-width: 100%; object-fit: contain; object-position: left; }
.signin__foot {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--hairline);
  font-size: 12.5px; color: var(--ink-3);
}
.signin__foot .icon { flex: none; }
@media (max-width: 900px) {
  .signin--split { grid-template-columns: minmax(0, 1fr); }
  .signin__art { display: none; }
  .signin--split .signin__form { padding: 32px 20px; }
}

.editor__side .segmented { display: flex; width: 100%; }
.editor__side .segmented button { flex: 1 1 0; min-width: 0; justify-content: center; text-align: center; }

/* Desktop workspace requirement: actual usable dimensions, not device detection. */
.viewport-notice { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.viewport-notice__card { width: min(100%, 540px); display: grid; gap: 20px; padding: 32px; background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--r); }
.viewport-notice__card > img { max-width: 100%; object-fit: contain; object-position: left; }
.viewport-notice__card h1 { font-size: 24px; line-height: 1.35; }
.viewport-notice__card p { color: var(--ink-2); line-height: 1.7; }
