/* the Agreement — "Meridian" design language.
   Tokens and components per documentation/design_handoff_theagreement_app/README.md
   (hi-fi: The Agreement app.dc.html).
   Fonts self-hosted from official sources under the SIL Open Font License 1.1:
   Schibsted Grotesk (Schibsted, via github.com/google/fonts), IBM Plex Mono
   (IBM, via github.com/google/fonts) and Source Serif 4 (Adobe, via
   github.com/google/fonts — wordmark/logo only). License texts in vendor/fonts/. */

@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('vendor/fonts/SchibstedGrotesk-var.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('vendor/fonts/IBMPlexMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('vendor/fonts/IBMPlexMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('vendor/fonts/SourceSerif4-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* color */
  --ink: #141a20;
  --body: #232c34;
  --secondary: #5c6b78;
  --muted: #8794a0;
  --disabled: #c9ced3;
  --accent: #0f6cf2;
  --accent-hover: #0d5ed4;
  --accent-tint: #e7f0fd;
  --accent-tint-border: #b9d2f5;
  --success: #1fa06a;
  --warning: #e8a020;
  --error: #c43e2f;
  --error-row: #fdf3f2;
  --warn-bg: #fdf8ef;
  --warn-border: #f0d9b8;
  --warn-text: #8a5d10;
  --bg: #ffffff;
  --bg-soft: #fbfcfd;
  --bg-head: #f4f6f8;
  --bg-frame: #eef1f4;
  --border: #e6eaee;
  --border-row: #eef1f4;
  --border-form: #d5dce2;

  /* type */
  --font-ui: 'Schibsted Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-doc: 'Aptos', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  /* wordmark/logo only — never for UI copy */
  --font-brand: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  /* shape */
  --r-card: 12px;
  --r-ctl: 8px;
  --r-pill: 99px;
  --shadow-primary: 0 1px 3px rgba(15, 108, 242, .3);
  --shadow-card: 0 2px 8px rgba(15, 108, 242, .08);
}

/* ---------- base ---------- */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--ink); margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }

/* ---------- app shell ---------- */

.shell { display: flex; height: 100vh; }

.sidebar {
  width: 232px;
  flex: 0 0 auto;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px 10px 12px;
  transition: width 150ms ease-out;
}
.sidebar-top { display: flex; align-items: center; gap: 8px; padding: 0 6px 14px; }
.logo {
  width: 24px; height: 24px; flex: 0 0 auto;
  border-radius: 6px; background: var(--accent);
  color: #fff; font-family: var(--font-brand); font-weight: 600; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
/* Wordmark: serif "The Agreement" + lowercase grotesk "app" (handoff §App shell). */
.wordmark { flex: 1; white-space: nowrap; }
.wordmark .wm-name {
  font-family: var(--font-brand); font-size: 14.5px; font-weight: 600; color: var(--ink);
}
.wordmark .wm-app {
  font-family: var(--font-ui); font-size: 12px; font-weight: 500; color: var(--muted);
  margin-left: 3px;
}
.collapse-btn {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 4px 6px; border-radius: var(--r-ctl);
}
.collapse-btn:hover { background: var(--bg-frame); color: var(--secondary); }

.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
  padding: 12px 10px 5px; white-space: nowrap; overflow: hidden;
}
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--body);
  padding: 7px 10px; border-radius: 7px;
  cursor: pointer; border: 0; background: none;
  font-family: inherit; text-align: left; width: 100%;
  white-space: nowrap; overflow: hidden;
}
.nav-item:hover { background: var(--bg-frame); text-decoration: none; }
.nav-item.active { font-weight: 600; color: var(--accent); background: var(--accent-tint); }
.nav-icon { width: 16px; flex: 0 0 auto; text-align: center; font-size: 13px; }

.sidebar-bottom { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.avatar-row { display: flex; align-items: center; gap: 9px; padding: 6px 6px 2px; }
.avatar {
  width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%;
  background: #dbe7f8; color: var(--accent);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.avatar-name {
  font-size: 12.5px; color: var(--secondary); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* rail mode */
.shell.rail .sidebar { width: 52px; padding: 14px 10px 12px; }
.shell.rail .wordmark,
.shell.rail .nav-label,
.shell.rail .avatar-name,
.shell.rail .nav-item span.nav-text { display: none; }
.shell.rail .sidebar-top { justify-content: center; padding: 0 0 14px; }
.shell.rail .collapse-btn { display: none; }
.shell.rail .nav-item {
  width: 32px; height: 32px; padding: 0; border-radius: 8px;
  justify-content: center;
}
.shell.rail .nav-item.active {
  background: var(--accent-tint);
  box-shadow: inset 0 0 0 1px var(--accent-tint-border);
}
.shell.rail .expand-btn { display: flex; }
.expand-btn {
  display: none; margin: 0 auto 8px;
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 4px 8px; border-radius: var(--r-ctl);
}
.expand-btn:hover { background: var(--bg-frame); color: var(--secondary); }
.shell.rail .avatar-row { justify-content: center; padding: 6px 0 2px; }

/* ---------- main content ---------- */

.main { flex: 1; overflow-y: auto; background: var(--bg); }
.content { padding: 36px 44px; }
.content.narrow { max-width: 920px; }

.page-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 8px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.012em; flex: 1; }
.page-status { font-size: 12.5px; color: var(--muted); }
.page-hint { font-size: 13px; color: var(--secondary); margin: 0 0 24px; }

/* ---------- cards ---------- */

.card {
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg);
  overflow: hidden;
}
.card + .card { margin-top: 16px; }
.card-head {
  background: var(--bg-head);
  padding: 9px 16px;
  font-size: 12px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--secondary);
  display: flex; align-items: center;
  border-bottom: 1px solid var(--border);
}
.card-head .right { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }

.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; font-size: 13.5px;
  border-bottom: 1px solid var(--border-row);
}
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { background: #f8fafc; }
.row-title { font-weight: 600; color: var(--ink); }
.row-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }

.empty {
  padding: 28px 16px; text-align: center;
  color: var(--muted); font-size: 13px;
}

/* ---------- chips, dots ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--border-form); color: var(--secondary);
  white-space: nowrap;
}
.chip.accent { color: var(--accent); border-color: var(--accent-tint-border); background: var(--accent-tint); }
.chip.mono { font-family: var(--font-mono); font-weight: 400; font-size: 11px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.dot.green { background: var(--success); }
.dot.amber { background: var(--warning); }
.dot.gray  { background: var(--disabled); }

/* ---------- buttons, forms ---------- */

.btn {
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: var(--r-ctl);
  border: 1px solid var(--border-form);
  background: var(--bg); color: var(--body);
  cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn.primary {
  background: var(--accent); border-color: var(--accent);
  color: #fff; box-shadow: var(--shadow-primary);
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:disabled {
  background: var(--bg-frame); border-color: var(--border);
  color: var(--disabled); cursor: default; box-shadow: none;
}

.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--secondary); margin-bottom: 5px;
}
.field input {
  width: 100%; font-family: inherit; font-size: 13.5px;
  padding: 9px 11px; border-radius: var(--r-ctl);
  border: 1px solid var(--border-form);
  color: var(--body); background: var(--bg);
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }

.form-error {
  font-size: 12.5px; color: var(--error);
  background: var(--error-row); border: 1px solid #f0cdc8;
  border-radius: var(--r-ctl); padding: 8px 11px; margin-bottom: 14px;
}

/* ---------- login ---------- */

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg-frame); padding: 24px;
}
.login-card {
  width: 360px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 30px 28px 24px;
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-brand .logo { width: 28px; height: 28px; border-radius: 7px; font-size: 17px; }
.login-brand .wordmark .wm-name { font-size: 17px; }
.login-brand .wordmark .wm-app { font-size: 13.5px; }
.login-sub { font-size: 13px; color: var(--secondary); margin: 0 0 22px; }
.login-support {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-row);
  font-size: 12px; color: var(--muted);
}

/* ---------- placeholder screens ---------- */

.placeholder {
  border: 1px dashed var(--border-form); border-radius: var(--r-card);
  padding: 40px; text-align: center; color: var(--muted); font-size: 13px;
}

/* ---------- batch 2: setup tables (Configure) ---------- */

.nav-child { font-size: 12.5px; padding-left: 30px; }
.shell.rail .nav-child { display: none; }

.table-actions { display: flex; gap: 10px; margin-bottom: 12px; }
.filter-input {
  font-family: inherit; font-size: 13px;
  padding: 7px 11px; border-radius: var(--r-ctl);
  border: 1px solid var(--border-form); color: var(--body);
  min-width: 220px;
}
.filter-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }

.setup-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.setup-table th {
  background: var(--bg-head); text-align: left;
  font-size: 11.5px; font-weight: 700; color: var(--secondary);
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}
.setup-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--border-row);
  vertical-align: top; color: var(--body);
}
.setup-table tr:last-child td { border-bottom: 0; }
.setup-table tbody tr:hover { background: #f8fafc; }
.key-cell { font-weight: 600; color: var(--ink); white-space: nowrap; }
.seq-cell { white-space: nowrap; color: var(--muted); }
.toggle-cell { text-align: center; white-space: nowrap; }
.muted-row td { color: var(--disabled); }
.muted-row .key-cell { color: var(--muted); font-weight: 500; }

.editable { cursor: pointer; }
.editable:hover { box-shadow: inset 0 0 0 1px var(--border-form); border-radius: 4px; }

.cell-ov {
  background: var(--accent-tint);
  box-shadow: inset 2px 0 0 var(--accent);
}

.cell-input, .label-input {
  width: 100%; font-family: inherit; font-size: 13px;
  padding: 4px 6px; border-radius: 5px;
  border: 1px solid var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.icon-btn {
  border: 1px solid var(--border-form); background: var(--bg);
  border-radius: 6px; cursor: pointer; color: var(--secondary);
  font-size: 11px; width: 22px; height: 22px; line-height: 1;
  margin-left: 3px; padding: 0;
}
.icon-btn:hover:not(:disabled) { border-color: var(--muted); color: var(--body); }
.icon-btn:disabled { color: var(--disabled); cursor: default; }

.add-row { display: flex; gap: 10px; margin-top: 14px; }

.label-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.label-cell {
  border: 1px solid var(--border-form); border-radius: var(--r-ctl);
  padding: 7px 12px; font-size: 13px; min-width: 90px;
  color: var(--body); background: var(--bg);
}
.label-cell.cell-ov { border-color: var(--accent-tint-border); }
.label-cell.editing { padding: 0; border: 0; min-width: 140px; }

/* ---------- modal editor ---------- */

.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 26, 32, .35);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  width: 560px; max-width: 100%; background: var(--bg);
  border-radius: var(--r-card); border: 1px solid var(--border);
  padding: 20px; box-shadow: 0 8px 30px rgba(20, 26, 32, .18);
}
.modal-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
.modal-textarea {
  width: 100%; min-height: 140px; resize: vertical;
  font-family: inherit; font-size: 13.5px; line-height: 1.55;
  padding: 10px 12px; border-radius: var(--r-ctl);
  border: 1px solid var(--border-form); color: var(--body);
}
.modal-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.modal-source {
  margin-top: 10px; padding: 9px 12px;
  background: var(--bg-soft); border: 1px solid var(--border-row);
  border-radius: var(--r-ctl);
  font-size: 12px; color: var(--secondary); line-height: 1.5;
  max-height: 110px; overflow-y: auto;
}
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions .grow { flex: 1; }

/* ---------- raw edit ---------- */

.raw-content { padding: 18px 22px; display: flex; flex-direction: column; height: 100%; }
.raw-toolbar { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; }
.raw-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.raw-picker {
  font-family: inherit; font-size: 13px; padding: 6px 10px;
  border-radius: var(--r-ctl); border: 1px solid var(--border-form);
  color: var(--body); background: var(--bg);
}
.raw-count { margin-left: auto; }
.grid-wrap { flex: 1; min-height: 0; width: 100%; height: 100%; }
.raw-key-cell { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* ---------- deals management ---------- */

.btn.small { padding: 4px 10px; font-size: 12px; margin-right: 6px; }
.btn.danger { color: var(--error); border-color: #f0cdc8; }
.btn.danger:hover { background: var(--error-row); border-color: var(--error); }
.actions-cell { white-space: nowrap; text-align: right; }
.chip.status-active { color: var(--success); border-color: #bfe5d4; background: #f0faf5; }
.chip.status-frozen { color: var(--warn-text); border-color: var(--warn-border); background: var(--warn-bg); }
.chip.status-closed { color: var(--secondary); }
.chip.status-dropped { color: var(--muted); border-style: dashed; }

/* ---------- users ---------- */

.chips-cell { max-width: 260px; }
.chip-role { margin: 2px 4px 2px 0; }
.chip-x {
  border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: 12px; padding: 0 0 0 2px; line-height: 1;
}
.chip-x:hover { color: var(--error); }
.chip-add {
  font-family: inherit; font-size: 11.5px; color: var(--secondary);
  border: 1px dashed var(--border-form); border-radius: var(--r-pill);
  background: var(--bg); padding: 2px 8px; margin: 2px 4px 2px 0; cursor: pointer;
}
.deal-assign { display: inline-flex; align-items: center; gap: 4px; }

/* rigor selects stay compact; descriptions live in the tooltip */
.rigor-select { width: 64px; }
/* wide tables scroll inside the card instead of clipping columns */
.card { overflow-x: auto; }

/* ---------- domains grid ---------- */

.tree-cell { display: flex; align-items: flex-start; gap: 6px; padding: 3px 0; line-height: 1.45; }
.tree-pad { flex: 0 0 auto; }
.tree-chev { flex: 0 0 14px; cursor: pointer; color: var(--secondary); font-size: 13px; line-height: 1; margin-top: 3px; text-align: center; user-select: none; }
.tree-chev-open { display: inline-block; transform: rotate(90deg); }
.tree-chev-empty { cursor: default; }
.tree-short { flex: 0 0 auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.tree-text { flex: 1; white-space: normal; overflow-wrap: break-word; min-width: 0; }
.tree-ov { box-shadow: inset 3px 0 0 var(--accent); background: var(--accent-tint); padding-left: 6px; border-radius: 3px; }
.row-excluded { opacity: .45; }
.row-header .tree-text { font-weight: 600; color: var(--ink); }

.mark-btn {
  width: 24px; height: 22px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border-form); background: var(--bg);
  font-size: 11px; line-height: 1; padding: 0;
}
.mark-btn.inc { color: var(--success); }
.mark-btn.exc { color: var(--error); }
.mark-btn.inherited { opacity: .4; border-style: dashed; }
.mark-btn.own { opacity: 1; border-color: currentColor; }
.mark-btn:disabled { cursor: default; }

.domain-pick {
  font-family: var(--font-mono); font-size: 10.5px;
  border: 1px dashed var(--border-form); border-radius: 6px;
  background: var(--bg); color: var(--secondary);
  padding: 2px 4px; max-width: 116px;
}
.domain-pick.own { border-style: solid; border-color: var(--accent-tint-border); color: var(--accent); }
.domain-eff { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }

/* wide modal for the domain manager */
.modal.wide { width: 860px; max-height: 82vh; overflow-y: auto; }

/* grid: adviser context ancestors (structure only, no controls) */
.row-context { opacity: .55; }
.tree-context { color: var(--muted); font-style: italic; }

/* headers-only toggle in the grid toolbar */
.hdr-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--secondary); white-space: nowrap; cursor: pointer; }

/* domain cell: None state and row-level toggle */
.domain-cell-flex { display: flex; align-items: center; gap: 6px; }
.domain-eff.none { color: var(--error); font-style: italic; }

/* ---------- raw edit: add/delete controls (append to meridian.css) ---------- */

.raw-btn {
  font-family: inherit; font-size: 12px; font-weight: 600;
  color: var(--body); background: var(--bg);
  border: 1px solid var(--border-form); border-radius: var(--r-ctl);
  padding: 6px 13px; cursor: pointer;
}
.raw-btn:hover { border-color: #8794a0; }
.raw-btn:disabled { opacity: .45; cursor: default; }
.raw-btn:disabled:hover { border-color: var(--border-form); }
.raw-btn-primary {
  color: #fff; background: #0f6cf2; border-color: #0f6cf2;
}
.raw-btn-primary:hover { background: #0d5ed4; border-color: #0d5ed4; }
.raw-btn-danger {
  color: #fff; background: #c43e2f; border-color: #c43e2f;
}
.raw-btn-danger:hover { background: #a83527; border-color: #a83527; }
.raw-btn-danger-outline { color: #c43e2f; }
.raw-btn-danger-outline:hover:not(:disabled) { border-color: #c43e2f; }

.raw-msg { font-size: 12.5px; max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.raw-msg-error { color: #c43e2f; font-weight: 600; }
.raw-msg-ok { color: #1fa06a; font-weight: 600; }

.raw-dialog-backdrop {
  position: fixed; inset: 0; background: rgba(20, 26, 32, .35);
  display: flex; align-items: center; justify-content: center; z-index: 60;
}
.raw-dialog {
  background: var(--bg); border-radius: 12px; padding: 20px 24px;
  min-width: 340px; max-width: 480px;
  box-shadow: 0 8px 30px rgba(20, 26, 32, .18);
}
.raw-dialog-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.raw-dialog-line { font-size: 13px; color: var(--body); margin: 3px 0; }
.raw-dialog-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- wiki (global, public-site surface, per-deal) ---------- */

.wiki-crumb { margin-bottom: 10px; display: flex; gap: 16px; }
.wiki-crumb a {
  font-size: 12.5px; color: var(--secondary); text-decoration: none;
}
.wiki-crumb a:hover { color: var(--accent); text-decoration: underline; }

.wiki-tools { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.wiki-row { align-items: baseline; gap: 12px; }
.wiki-row .row-title { flex: 1; min-width: 0; }
.wiki-meta {
  font-size: 11.5px; color: var(--muted); margin: 2px 0 18px;
}
.list-row .wiki-meta { margin: 0; }

.wiki-title-input {
  font-size: 20px; font-weight: 700; color: var(--ink);
  flex: 1; min-width: 0; letter-spacing: -0.01em;
}

/* reading view mirrors the public site's typography */
.wiki-article {
  max-width: 62ch; font-size: 15px; line-height: 1.7; color: var(--body);
}
.wiki-article h1 { font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: -0.015em; margin: 1.4em 0 .4em; }
.wiki-article h2 { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; margin: 1.5em 0 .4em; }
.wiki-article h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 1.3em 0 .35em; }
.wiki-article h1:first-child, .wiki-article h2:first-child { margin-top: .2em; }
.wiki-article img { max-width: 100%; border: 1px solid var(--border); border-radius: 8px; }
.wiki-article a { color: var(--accent); }
.wiki-article pre {
  background: #f7f8f9; border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; overflow-x: auto; font-size: 12.5px; line-height: 1.55;
}
.wiki-article code { background: var(--bg-head); border-radius: 4px; padding: 1px 4px; font-size: .88em; }
.wiki-article pre code { background: none; padding: 0; }
.wiki-article blockquote {
  margin: 0; padding: 2px 16px; border-left: 3px solid var(--accent-tint-border);
  color: var(--secondary);
}
.wiki-article table { border-collapse: collapse; font-size: 13.5px; margin: 12px 0; }
.wiki-article th, .wiki-article td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.wiki-article th { background: var(--bg-head); font-size: 11.5px; }
.wiki-article hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* Toast UI container: hand it the Meridian frame */
.wiki-editor { border-radius: 10px; overflow: hidden; }
.wiki-editor .toastui-editor-defaultUI { border: 1px solid var(--border-form); border-radius: 10px; }
.wiki-editor .toastui-editor-defaultUI,
.wiki-editor .toastui-editor-contents { font-family: inherit; }
.wiki-editor .toastui-editor-contents { font-size: 14px; }

/* ---------- slogan & site footer (batch 2026-07-23) ---------- */
/* Brand slogan, always top-right — signed-in shell and the sign-in screen.
   The .content top padding (36px) keeps it clear of every toolbar; on
   narrow viewports it hides instead of colliding or wrapping. */
.shell-slogan {
  position: fixed; top: 11px; right: 18px; z-index: 40;
  font-size: 12.5px; font-weight: 500; color: var(--accent);
  pointer-events: none; user-select: none; white-space: nowrap;
}
@media (max-width: 860px) { .shell-slogan { display: none; } }

/* Legal footer on the sign-in screen (© year is computed client-side). */
.site-footer {
  position: fixed; bottom: 14px; left: 0; right: 0; text-align: center;
  font-size: 12px; color: var(--muted);
}
.site-footer a { color: var(--secondary); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
