/*
 * Typography pairing. Inter carries human language; IBM Plex Mono carries
 * machine language (identifiers, timestamps, versions, system chrome labels).
 * Noto Sans Myanmar is bundled because reviewers read Burmese on desktops that
 * often have no Myanmar font installed. All three are self-hosted: this portal
 * must never request assets from a third party.
 */
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Sans Myanmar";
  src: url("/static/fonts/noto-sans-myanmar.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+1000-109F, U+200C-200D, U+25CC, U+A92E, U+A9E0-A9FE, U+AA60-AA7F, U+116D0-116E3;
}

:root {
  --canvas: #F7F7F5;
  --surface: #FFFFFF;
  --surface-subtle: #F1F2F3;
  --ink: #24262B;
  --ink-muted: #686D76;
  --ink-faint: #8B919B;
  --line: #D9DCE2;
  --line-soft: #E9EBEF;
  --line-strong: #B9BEC8;
  --accent: #4056D6;
  --accent-soft: #EEF0FC;
  --success: #237A55;
  --success-soft: #EAF5EF;
  --warning: #966000;
  --warning-soft: #FBF3DF;
  --danger: #A43A3A;
  --danger-soft: #F9EAEA;

  --radius-control: 6px;
  --radius-panel: 10px;
  --shadow-panel: 0 10px 30px rgba(36, 38, 43, 0.10), 0 1px 2px rgba(36, 38, 43, 0.04);

  --header-h: 64px;
  --target: 40px;
  --target-lg: 44px;
  --shell-x: 32px;
  --shell-max: 1440px;
  --read-max: 760px;

  --stack-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  --stack-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono";
  --stack-my: "Noto Sans Myanmar", "Myanmar Text", "Padauk", "Noto Sans Myanmar UI";

  --font-sans: var(--stack-sans), var(--stack-my), sans-serif;
  --font-mono: var(--stack-mono), var(--stack-my), monospace;
  --font-my: var(--stack-my), var(--stack-sans), sans-serif;

  --track-label: 0.09em;
  --track-mode: 0.2em;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 23px;
  font-weight: 400;
  font-synthesis-weight: none;
}

/* Burmese needs more leading, and must never be tracked or uppercased. */
:lang(my), [lang="my"] {
  font-family: var(--font-my);
  line-height: 1.65;
  letter-spacing: 0;
  text-transform: none;
  font-feature-settings: normal;
}

/* Machine language: identifiers, timestamps, versions, and system chrome. */
.mono,
.meta-label,
.row-time,
.record .k,
.identity-email,
.focus-title,
.group-label,
.rail-title,
.split-head,
.pair-lang,
.message-label,
.option-head,
.panel-head .rail-title,
legend,
thead th,
code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.row-time,
.rail-facts b,
.result-count,
tbody td,
.dots {
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding-left: 20px; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 40;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
}

/* ---------- Application shell ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
}
.app-header-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--shell-x);
  min-height: var(--header-h);
  display: flex;
  align-items: stretch;
  gap: 28px;
}

.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--ink);
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand span {
  font-size: 11px;
  line-height: 15px;
  font-weight: 400;
  color: var(--ink-muted);
}

.nav {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.nav > a,
.nav-more > summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-lg);
  padding: 0 12px;
  margin: 10px 0;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 400;
  border-radius: var(--radius-control);
  white-space: nowrap;
}
.nav > a:hover,
.nav-more > summary:hover { color: var(--ink); text-decoration: none; background: var(--surface-subtle); }
.nav > a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 0;
}

.nav-more { position: relative; display: flex; }
.nav-more > summary { list-style: none; cursor: pointer; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more[open] > summary { color: var(--ink); background: var(--surface-subtle); }
.menu {
  position: absolute;
  top: calc(100% - 6px);
  left: 0;
  z-index: 30;
  min-width: 200px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
}
.menu a,
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--target-lg);
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  border-radius: var(--radius-control);
  cursor: pointer;
}
.menu a:hover,
.menu button:hover { background: var(--surface-subtle); text-decoration: none; }
.menu a[aria-current="page"] { background: var(--accent-soft); font-weight: 600; }
.menu-sep { display: block; height: 1px; margin: 6px 4px; background: var(--line-soft); }

.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.identity {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 18px;
  color: var(--ink-muted);
  max-width: 280px;
}
.identity-email {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tools-sep { width: 1px; height: 20px; background: var(--line-soft); }

.drawer { display: none; align-items: center; }

/* ---------- Focus mode header ---------- */

.focus-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
}
.focus-header-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 10px var(--shell-x);
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}
.focus-start { display: flex; align-items: center; gap: 8px; }
.focus-end { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.focus-title {
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: var(--track-mode);
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
  white-space: nowrap;
}

.dots { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.dots li { width: 7px; height: 7px; border-radius: 99px; background: var(--line); }
.dots li.done { background: var(--line-strong); }
.dots li.current { background: var(--ink); }

/* ---------- Context bar ---------- */

.context-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 15;
  background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
}
.context-bar-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 10px var(--shell-x);
  min-height: 56px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.context-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-width: 0;
  flex: 1 1 auto;
}
.context-title {
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 44ch;
}
.context-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.context-meta { font-size: 13px; color: var(--ink-muted); }

/* ---------- Page frame ---------- */

.page { flex: 1 1 auto; }
.page-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 20px var(--shell-x) 56px;
}
.page-inner.narrow { max-width: 900px; }
.page-inner.flush { padding-top: 8px; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 12px 0 4px;
}
.page-head h1 { margin: 0; }
.lede {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 21px;
  max-width: var(--read-max);
}
.page-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

h1 { font-size: 22px; line-height: 30px; font-weight: 600; letter-spacing: -0.016em; }
h2 { font-size: 17px; line-height: 25px; font-weight: 600; letter-spacing: -0.012em; }
h3 { font-size: 15px; line-height: 22px; font-weight: 600; letter-spacing: -0.008em; }

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 18px var(--shell-x);
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 19px;
}
.site-footer .inner { max-width: var(--shell-max); margin: 0 auto; }

/* ---------- Grouped rows ---------- */

.group { margin-top: 26px; }
.group:first-of-type { margin-top: 12px; }
.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.group-label {
  font-size: 11px;
  line-height: 15px;
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-muted);
}
.group-count { font-size: 12px; color: var(--ink-faint); }

.rows { display: block; }
.row {
  display: grid;
  grid-template-columns: 10px minmax(150px, 0.9fr) minmax(0, 2.1fr) 116px 96px;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line-soft);
  color: inherit;
}
a.row:hover, a.row:focus-visible {
  background: var(--accent-soft);
  text-decoration: none;
  outline-offset: -2px;
}
.row.is-selected { background: var(--accent-soft); }
.row-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--line-strong);
  justify-self: center;
}
.row-name {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-name .count { font-weight: 400; color: var(--ink-faint); margin-left: 6px; }
.row-text {
  min-width: 0;
  font-size: 14px;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-subject { font-weight: 500; color: var(--ink); }
.row-preview { color: var(--ink-muted); }
.row-preview::before { content: "—"; color: var(--ink-faint); margin: 0 8px; }
.row-owner {
  margin-left: 10px;
  font-size: 11px;
  color: var(--ink-muted);
}
.row-time {
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-muted);
  text-align: right;
  white-space: nowrap;
}
.row-name .count { font-family: var(--font-mono); font-size: 11px; }
.rail-facts b { font-family: var(--font-mono); font-size: 13px; }
.row-end { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }

.row--wide { grid-template-columns: 10px minmax(0, 1fr) 116px 96px; }
.row--pair { grid-template-columns: 10px minmax(0, 1fr) auto; }
.row--plain { grid-template-columns: 10px minmax(150px, 0.9fr) minmax(0, 2.1fr) 116px 96px; }

/* ---------- Status ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  line-height: 17px;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}
.status .dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--ink-faint);
  flex-shrink: 0;
}
.dot--draft, .dot--archived, .dot--superseded { background: var(--ink-faint); }
.dot--in_review, .dot--paused, .dot--warning, .dot--started, .dot--in_progress, .dot--stale { background: var(--warning); }
.dot--published, .dot--info { background: var(--accent); }
.dot--approved, .dot--completed, .dot--ok, .dot--success, .dot--recent { background: var(--success); }
.dot--closed { background: #4A4E57; }
.dot--declined, .dot--error, .dot--degraded, .dot--danger, .dot--needs_attention { background: var(--danger); }

.chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 11px;
  line-height: 1;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */

.btn,
button,
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--target);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover,
button:hover,
a.button:hover { background: var(--surface-subtle); text-decoration: none; }

.btn-primary,
button[type="submit"].primary,
a.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover,
button.primary:hover,
a.button.primary:hover { background: #3448BD; border-color: #3448BD; }

.btn-quiet,
button.quiet,
a.button.quiet {
  border-color: transparent;
  background: none;
  color: var(--ink-muted);
}
.btn-quiet:hover,
button.quiet:hover,
a.button.quiet:hover { color: var(--ink); background: var(--surface-subtle); }

.btn-danger,
button.danger,
a.button.danger { color: var(--danger); border-color: var(--line); background: var(--surface); }
.btn-danger:hover,
button.danger:hover,
a.button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }

button.danger-solid {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  font-weight: 600;
}
button.danger-solid:hover { background: #8f3232; }

.btn-icon {
  min-width: var(--target);
  padding: 0;
  color: var(--ink-muted);
  border-color: transparent;
  background: none;
}
.btn-icon:hover { color: var(--ink); background: var(--surface-subtle); }
.btn-sm { min-height: 34px; padding: 0 10px; font-size: 13px; }

button:disabled,
.btn:disabled,
.btn.is-disabled {
  color: var(--ink-faint);
  border-color: var(--line-soft);
  background: var(--surface);
  cursor: default;
}

.inline-form { display: inline-flex; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions--end { justify-content: flex-end; }

/* ---------- Notices ---------- */

.notice {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  margin: 12px 0 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-panel);
  background: var(--surface);
  font-size: 14px;
  line-height: 21px;
}
.notice-body { min-width: 0; }
.notice strong { font-weight: 600; }
.notice p { margin: 0; color: var(--ink-muted); }
.notice p:first-child { color: var(--ink); }
.notice ul { margin: 6px 0 0; color: var(--ink-muted); }
.notice.info { background: var(--accent-soft); border-color: #D5DBF7; }
.notice.success { background: var(--success-soft); border-color: #C3DFD0; }
.notice.warn { background: var(--warning-soft); border-color: #EBD9A6; }
.notice.error { background: var(--danger-soft); border-color: #E8C4C4; }
.notice .icon { flex-shrink: 0; margin-top: 2px; color: var(--ink-muted); }

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  margin-top: 12px;
  padding: 16px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-control);
  color: var(--ink-muted);
  font-size: 14px;
  text-align: center;
}
.empty {
  padding: 22px 4px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 21px;
}
.empty strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.empty .actions { margin-top: 12px; }

/* ---------- Work surface and rail ---------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: 24px;
  align-items: start;
  margin-top: 16px;
}
.workspace--center {
  grid-template-columns: minmax(0, 780px) 248px;
  justify-content: center;
}

.paper {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-panel);
  padding: 40px 44px 44px;
}
.paper--reading { max-width: 820px; }
.paper > * + * { margin-top: 16px; }
.paper h1 { margin: 0; }
.paper-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-muted);
}
.paper-meta > span + span::before {
  content: "·";
  margin-right: 12px;
  color: var(--ink-faint);
}
.paper-divider { height: 1px; background: var(--line-soft); margin: 28px 0; }

.sheet-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}
.sheet-head .who { font-size: 14px; line-height: 21px; }
.sheet-head .aside { font-size: 14px; line-height: 21px; color: var(--ink-muted); text-align: right; }

.section {
  padding-top: 28px;
  margin-top: 28px;
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: 152px;
}
.section:first-of-type { padding-top: 0; margin-top: 24px; border-top: 0; }
.section-head { display: flex; align-items: baseline; gap: 10px; }
.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 99px;
  background: var(--surface-subtle);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.section-hint { margin: 6px 0 0; color: var(--ink-muted); font-size: 13px; line-height: 20px; }

.rail {
  position: sticky;
  top: calc(var(--header-h) + 72px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rail-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-panel);
  padding: 16px;
}
.rail-title {
  font-size: 11px;
  line-height: 15px;
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.rail-note { font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.rail-note + .rail-note { margin-top: 8px; }
.rail-stack { display: flex; flex-direction: column; gap: 8px; }
.rail-stack .btn,
.rail-stack button,
.rail-stack a.button {
  width: 100%;
  justify-content: flex-start;
  font-size: 13px;
}
.rail-stack form { display: block; }
.rail-stack form > button { width: 100%; }
.rail-split { display: flex; gap: 8px; }
.rail-split > * { flex: 1; }
.rail-group { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.rail-facts { list-style: none; margin: 0; padding: 0; }
.rail-facts li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-muted);
}
.rail-facts li:last-child { border-bottom: 0; }
.rail-facts b { color: var(--ink); font-weight: 600; }
.rail-links { list-style: none; margin: 0; padding: 0; }
.rail-links a {
  display: block;
  padding: 7px 0;
  font-size: 13px;
  color: var(--ink-muted);
}
.rail-links a:hover { color: var(--ink); text-decoration: none; }

details.disclose > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--target);
  cursor: pointer;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
  list-style: none;
}
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary:hover { color: var(--ink); }
details.disclose[open] > summary { color: var(--ink); }

/* ---------- Stepper ---------- */

.stepper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}
.stepper li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-faint);
}
.stepper li::after {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--line);
  margin-left: 4px;
}
.stepper li:last-child::after { display: none; }
.stepper .marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 99px;
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-faint);
}
.stepper li.done { color: var(--ink-muted); }
.stepper li.done .marker { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.stepper li.current { color: var(--ink); font-weight: 600; }
.stepper li.current .marker { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Forms ---------- */

.form { max-width: var(--read-max); }
.field { margin-top: 20px; }
.field:first-child { margin-top: 0; }
.field > label,
.label {
  display: block;
  font-size: 13px;
  line-height: 19px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.hint {
  display: block;
  font-size: 13px;
  line-height: 19px;
  font-weight: 400;
  color: var(--ink-muted);
  margin: -2px 0 6px;
}
.field-note { margin-top: 6px; font-size: 13px; color: var(--ink-muted); }

input[type="text"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="file"],
select,
textarea {
  width: 100%;
  min-height: var(--target);
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 21px;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent-soft);
  outline-offset: 0;
}
textarea { min-height: 104px; line-height: 1.65; resize: vertical; }
select { appearance: none; padding-right: 32px; background-image: none; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--target-lg);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
}
.check input[type="checkbox"], .check input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.check--stack { align-items: flex-start; min-height: 0; padding: 4px 0; }
.check--stack input { margin-top: 3px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 16px; }
.check-grid .check { min-height: 34px; font-size: 13px; }

.notes { list-style: none; margin: 8px 0 0; padding: 0; }
.notes li {
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-muted);
  padding: 5px 0;
}
.notes b { color: var(--ink); font-weight: 600; }

fieldset {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-control);
  padding: 4px 14px 12px;
  margin: 0;
}
legend {
  padding: 0 6px;
  font-size: 11px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-muted);
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-control);
  overflow: hidden;
}
.pair > .pair-side { padding: 14px 16px 16px; }
.pair > .pair-side + .pair-side { border-left: 1px solid var(--line-soft); }
.pair-lang {
  font-size: 11px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.pair .field { margin-top: 0; }

.options { margin-top: 16px; }
.option-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.option-head {
  padding: 0 0 8px;
  font-size: 11px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-muted);
}
.option-row:last-child { border-bottom: 0; }

.form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.form-footer .muted { font-size: 13px; }

/* ---------- Toolbar, tables, pager ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 0 4px;
}
.toolbar .field { margin-top: 0; }
.toolbar .field--search { flex: 1 1 220px; max-width: 320px; }
.toolbar .field--select { flex: 0 1 180px; }
.toolbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.result-count { display: block; margin: 12px 0 0; font-size: 12px; color: var(--ink-muted); }

.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 20px;
}
thead th {
  background: var(--canvas);
  font-size: 11px;
  line-height: 15px;
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: left;
  padding: 0 12px 10px 4px;
  border-bottom: 1px solid var(--line-soft);
}
tbody td {
  padding: 13px 12px 13px 4px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
tbody tr:hover td { background: var(--surface); }
tbody tr.is-selected td { background: var(--accent-soft); }
.panel table thead th { background: var(--surface); }

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-muted);
}
.pager a { min-height: 34px; display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-control); color: var(--ink); }
.pager a:hover { background: var(--surface); text-decoration: none; }

/* ---------- Split workspace ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(300px, 0.4fr) minmax(0, 0.6fr);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-panel);
  overflow: hidden;
  margin-top: 16px;
}
.split-list { border-right: 1px solid var(--line-soft); min-width: 0; }
.split-list .split-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}
.split-list .row { padding: 12px 18px; }
.split-detail { padding: 28px 32px 32px; min-width: 0; }
.split-detail h2:first-child { margin-top: 0; }

.record { list-style: none; margin: 0; padding: 0; }
.record li {
  display: grid;
  grid-template-columns: minmax(120px, 0.4fr) minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  line-height: 21px;
}
.record dt, .record .k { color: var(--ink-muted); font-size: 12px; letter-spacing: 0.01em; }
.record .v { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }

/* ---------- Conversation preview ---------- */

.thread { display: flex; flex-direction: column; gap: 14px; }
.message {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-control);
  padding: 18px 20px;
  background: var(--surface);
}
.message-label {
  font-size: 11px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.message-body { white-space: pre-wrap; font-size: 14px; line-height: 1.65; }
.message-en { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--ink-muted); white-space: pre-wrap; }
.message-accept { margin-top: 12px; font-size: 13px; color: var(--ink-muted); }
.message-accept .key {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  margin-right: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
  color: var(--ink);
}

/* ---------- Questions ---------- */

.qrow {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.qrow-num { font-size: 13px; font-weight: 600; color: var(--ink-muted); padding-top: 2px; }
.qrow-body { min-width: 0; }
.qrow-prompt { font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.qrow-options { margin-top: 6px; font-size: 13px; color: var(--ink-muted); }
.qrow-actions { display: flex; align-items: center; gap: 4px; }

/* ---------- Service health ---------- */

.health { padding: 20px 0 10px; }
.health-sentence {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.014em;
}
.health-dot { width: 9px; height: 9px; border-radius: 99px; flex-shrink: 0; }
.health-dot.ok { background: var(--success); }
.health-dot.degraded { background: var(--warning); }
.health-sub { font-size: 13px; color: var(--ink-muted); margin-top: 6px; padding-left: 21px; }

/* ---------- Panels ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-panel);
}
.panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 { font-size: 15px; line-height: 22px; }
.panel-head h2.mono { font-size: 14px; letter-spacing: 0; font-weight: 500; }
.panel-head p { margin-top: 4px; font-size: 13px; line-height: 19px; color: var(--ink-muted); }
.panel-body { padding: 20px; }
.panel-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.panel-rows { list-style: none; margin: 0; padding: 0; }
.panel-rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.panel-rows li:last-child { border-bottom: 0; }

.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
  margin-top: 8px;
}

.dialog {
  max-width: 520px;
  margin: 24px auto 0;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  padding: 32px;
}
.dialog h1 { font-size: 19px; line-height: 27px; }
.dialog p { margin-top: 10px; color: var(--ink-muted); font-size: 14px; line-height: 21px; }
.dialog .form { margin-top: 20px; }

details.row-expand > summary { list-style: none; cursor: pointer; }
details.row-expand > summary::-webkit-details-marker { display: none; }
details.row-expand > summary:hover { background: var(--surface); }
details.row-expand[open] > summary { background: var(--surface); }
details.row-expand[open] > summary .row-dot { box-shadow: 0 0 0 3px var(--accent-soft); }
.meta-block {
  padding: 4px 4px 20px 28px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

/* ---------- Utilities ---------- */

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-sm { width: 15px; height: 15px; }

.muted { color: var(--ink-muted); }
/* ink-faint does not meet AA for body text: decorative and disabled use only. */
.faint { color: var(--ink-faint); }
.mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0; }
input.mono, textarea.mono { font-size: 13px; }
code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 1px 5px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--surface-subtle);
}
.nowrap { white-space: nowrap; }
.stack-8 > * + * { margin-top: 8px; }
.stack-16 > * + * { margin-top: 16px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.form--full { max-width: none; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 1199px) {
  :root { --shell-x: 24px; }
  .workspace, .workspace--center, .layout-2 { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; flex-direction: row; flex-wrap: wrap; }
  .rail-card { flex: 1 1 240px; }
  .paper { padding: 32px; }
  .row, .row--plain { grid-template-columns: 10px minmax(0, 1fr) 116px 92px; }
  .row-text { display: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-list { border-right: 0; border-bottom: 1px solid var(--line-soft); }
}

@media (max-width: 767px) {
  :root { --shell-x: 16px; --header-h: 56px; }
  .nav, .nav-more { display: none; }
  .drawer { display: flex; }
  .identity { display: none; }
  .app-header-inner { gap: 12px; }
  .row, .row--plain, .row--wide { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .row-time { display: none; }
  .pair { grid-template-columns: 1fr; }
  .pair > .pair-side + .pair-side { border-left: 0; border-top: 1px solid var(--line-soft); }
  .paper { padding: 24px 20px; }
  .page-head { align-items: flex-start; }
  .focus-header-inner { grid-template-columns: auto minmax(0, 1fr); row-gap: 10px; }
  .focus-title { grid-column: 2; text-align: right; }
  .focus-end { grid-column: 1 / -1; justify-content: flex-start; }
  .split-detail { padding: 20px; }
  .record li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dialog { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
