/* Captain Store dashboards (builder + superadmin): sidebar shell in the
   Captain apps' design language; same tokens as the storefront. */

@font-face { font-family: Manrope; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/static/fonts/manrope-latin.woff2") format("woff2"); 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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Manrope; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/static/fonts/manrope-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/static/fonts/manrope-latin-ext.woff2") format("woff2"); 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; }

:root {
  --background: #f7f7f9; --foreground: #16161a; --card: #ffffff; --muted: #ececf0; --muted-foreground: #63636e;
  --border: #dcdce2; --primary: #16161a; --primary-foreground: #ffffff; --accent: #e60165; --accent-2: #8000db;
  --ring: #e60165; --danger: #b4122f; --success: #166534; --warning: #b45309; --radius: 0.625rem;
  --shadow: 0 1px 2px rgba(22, 22, 26, 0.06); color-scheme: light;
}
[data-theme="dark"] {
  --background: #0a0a0b; --foreground: #fafafa; --card: #151517; --muted: #1f1f22; --muted-foreground: #a0a0aa;
  --border: #2a2a2e; --primary: #ffffff; --primary-foreground: #0a0a0b; --ring: #e60165; --danger: #ff5c7a;
  --success: #35d073; --warning: #fbbf24; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--background); color: var(--foreground);
  font-family: Manrope, -apple-system, "Segoe UI", system-ui, sans-serif; font-size: 0.95rem; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.35rem; }
h2 { font-size: 1.1rem; font-weight: 800; margin: 0 0 0.75rem; }
h3 { font-size: 0.95rem; font-weight: 800; margin: 0 0 0.5rem; }
.muted { color: var(--muted-foreground); }
.small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85em; word-break: break-all; }
.icon { width: 1.125rem; height: 1.125rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: 100%; max-width: 24rem; padding: 2rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.login-card .brand { justify-content: center; margin-bottom: 1rem; }
.login-card p:not(.alert) { color: var(--muted-foreground); margin: 0 0 1.25rem; }
.login-card .alert { margin-bottom: 1rem; text-align: left; }
.login-card .btn { width: 100%; }
.login-card form { display: grid; gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border); }

/* ---------- shell ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: 15.5rem; flex: none; display: flex; flex-direction: column; gap: 0.15rem;
  padding: 1.1rem 0.8rem; border-right: 1px solid var(--border); background: var(--card);
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 0.55rem; padding: 0.2rem 0.5rem 1.1rem; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }
.brand img { width: 2rem; height: 2rem; border-radius: 0.5rem; }
.brand .sub { display: block; font-size: 0.72rem; font-weight: 600; color: var(--muted-foreground); letter-spacing: 0; }
.nav-items { display: flex; flex-direction: column; gap: 0.3rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 2.75rem; padding: 0.5rem 0.9rem;
  border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--muted-foreground);
  font-weight: 600; font-size: 0.92rem; text-align: left; text-decoration: none; cursor: pointer;
}
.nav-item:hover { background: var(--muted); color: var(--foreground); }
.nav-item.active { background: var(--muted); color: var(--foreground); border-color: var(--border); }
.nav-item .badge { margin-left: auto; }
.sidebar .spacer { flex: 1; }
.sidebar-user { display: flex; align-items: center; gap: 0.55rem; padding: 0.7rem 0.6rem 0.2rem; border-top: 1px solid var(--border); margin-top: 0.5rem; cursor: pointer; border-radius: 0; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; }
.sidebar-user:hover .u-name { color: var(--accent); }
.avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 0.85rem; }
.sidebar-user > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.u-name { display: block; font-size: 0.85rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-sub { display: block; font-size: 0.72rem; color: var(--muted-foreground); }
.content { flex: 1; min-width: 0; }
.content-inner { max-width: 66rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head p { margin: 0; color: var(--muted-foreground); }
.topbar { display: none; }

/* ---------- buttons, badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 2.75rem; padding: 0 1.1rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); font-weight: 700; font-size: 0.9rem;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--muted); }
.btn-primary { color: #fff; border-color: transparent; background: linear-gradient(0deg, var(--accent) 0%, var(--accent-2) 100%); }
.btn-primary:hover { filter: brightness(1.12); background: linear-gradient(0deg, var(--accent) 0%, var(--accent-2) 100%); }
.btn-danger { color: var(--danger); }
.btn-sm { min-height: 2.75rem; padding: 0 0.75rem; font-size: 0.82rem; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; filter: none; }
.icon-btn { width: 2.75rem; height: 2.75rem; padding: 0; border-radius: 50%; }
.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.74rem; font-weight: 700; background: var(--muted); color: var(--muted-foreground); white-space: nowrap; }
.badge-draft { background: var(--muted); }
.badge-moderation { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
.badge-published { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.badge-rejected { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.badge-dot::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.85rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
a.card { text-decoration: none; display: block; }
a.card:hover, .card.clickable:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 10%, transparent); }
.card-row { display: flex; align-items: flex-start; gap: 0.8rem; }
.thumb.round { border-radius: 50%; }
.thumb { width: 3rem; height: 3rem; border-radius: 0.75rem; flex: none; object-fit: cover; background: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--muted-foreground); }
.card-title { font-weight: 800; letter-spacing: -0.01em; }
.card-sub { font-size: 0.82rem; color: var(--muted-foreground); margin-top: 0.15rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.8rem; flex-wrap: wrap; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; text-align: left; cursor: pointer; min-height: 7rem; }
.choice .icon { width: 1.6rem; height: 1.6rem; color: var(--accent); }
.choice.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.empty { padding: 3rem 1rem; text-align: center; color: var(--muted-foreground); border: 1px dashed var(--border); border-radius: var(--radius); }

/* ---------- forms ---------- */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; align-content: start; }
.field label, .field > .lbl { font-size: 0.85rem; font-weight: 700; }
.field .hint { font-size: 0.8rem; color: var(--muted-foreground); margin: 0; }
.field input[type="text"], .field input[type="url"], .field input[type="email"], .field select, .field textarea {
  width: 100%; min-height: 2.75rem; padding: 0.55rem 0.8rem; background: var(--background); border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 0.15rem);
}
.field textarea { resize: vertical; min-height: 6rem; }
.field textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.82rem; min-height: 14rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--ring); outline-offset: 1px; }
.req::after { content: " *"; color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.radios { display: grid; gap: 0.4rem; }
.radios label, .check { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 0.15rem); cursor: pointer; font-size: 0.9rem; }
.radios label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.radios input, .check input { margin-top: 0.25rem; }
.radios small { display: block; color: var(--muted-foreground); font-size: 0.8rem; }
/* Long unbreakable bits (URLs in <code>, script names) must wrap, otherwise the flex row widens the page on phones. */
.radios label > span, .check > span { min-width: 0; }
.radios code, .check code, .field small code, .hint code { overflow-wrap: anywhere; word-break: break-all; }
.section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }
.lang-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.lang-tab { min-height: 2.75rem; padding: 0 0.8rem; border: 1px solid var(--border); border-radius: 999px; background: transparent; font-size: 0.8rem; font-weight: 700; color: var(--muted-foreground); cursor: pointer; }
.lang-tab.active { background: var(--muted); color: var(--foreground); }
.lang-tab.filled::after { content: ""; display: inline-block; width: 0.4rem; height: 0.4rem; margin-left: 0.35rem; border-radius: 50%; background: var(--success); }
.media-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.media-item { position: relative; width: 7rem; }
.media-item img { width: 7rem; height: 7rem; object-fit: cover; border-radius: 0.75rem; border: 1px solid var(--border); background: var(--muted); display: block; }
.media-item.wide, .media-item.wide img { width: 11.2rem; }
.media-item.wide img { height: 7rem; }
.media-item.tile, .media-item.tile img, .upload.tile { width: 11rem; }
.media-item.tile img { height: 7rem; }
.upload.tile { height: 7rem; }
.media-item.round img, .upload.round { border-radius: 50%; }
.media-item .remove { position: absolute; top: -0.4rem; right: -0.4rem; width: 1.75rem; height: 1.75rem; padding: 0; border-radius: 50%; background: var(--card); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.media-item .remove .icon { width: 0.9rem; height: 0.9rem; }
.upload { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem; width: 7rem; height: 7rem; border: 1px dashed var(--border); border-radius: 0.75rem; color: var(--muted-foreground); font-size: 0.78rem; cursor: pointer; text-align: center; padding: 0.4rem; }
.upload.wide { width: 11.2rem; }
.upload:hover { border-color: var(--accent); color: var(--foreground); }
.upload input { display: none; }
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--background) 92%, transparent); backdrop-filter: blur(8px); padding: 0.75rem 0; border-top: 1px solid var(--border); display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; z-index: 5; }
.alert { padding: 0.75rem 0.9rem; border-radius: calc(var(--radius) - 0.15rem); font-size: 0.88rem; font-weight: 600; margin: 0; }
.alert-error { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.alert-success { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.alert-warning { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.alert-info { color: var(--foreground); background: var(--muted); font-weight: 500; }
.alert ul { margin: 0.4rem 0 0; padding-left: 1.2rem; font-weight: 500; }
.copy-box { display: flex; gap: 0.5rem; align-items: center; }
.copy-box .mono { flex: 1; padding: 0.55rem 0.8rem; background: var(--background); border: 1px solid var(--border); border-radius: calc(var(--radius) - 0.15rem); overflow-wrap: anywhere; }
pre.code { margin: 0; padding: 0.9rem 1rem; background: var(--background); border: 1px solid var(--border); border-radius: calc(var(--radius) - 0.15rem); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem; overflow: auto; white-space: pre; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted-foreground); background: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.filters { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters select, .filters input { min-height: 2.75rem; padding: 0 0.75rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 0.15rem); background: var(--card); }

/* ---------- builders (superadmin) ---------- */
.search-box { display: flex; align-items: center; gap: 0.5rem; flex: 1; max-width: 26rem; min-height: 2.75rem; padding: 0 0.75rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 0.15rem); background: var(--card); color: var(--muted-foreground); }
.search-box:focus-within { outline: 2px solid var(--ring); outline-offset: 1px; }
.search-box input { flex: 1; min-width: 0; min-height: 2.6rem; border: 0; padding: 0; background: transparent; color: var(--foreground); outline: none; }
.b-list { display: grid; gap: 0.85rem; }
.b-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; }
.b-who { min-width: 0; }
.b-email { overflow-wrap: anywhere; }
.b-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.75rem 1.25rem; margin: 0.9rem 0 0; }
.b-meta dt { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted-foreground); margin-bottom: 0.2rem; }
.b-meta dd { margin: 0; font-size: 0.88rem; overflow-wrap: anywhere; }
.b-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.b-note { margin: 0.75rem 0 0; }
.switch { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; cursor: pointer; font-weight: 700; font-size: 0.88rem; }
.switch input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 2.6rem; height: 1.5rem; margin: 0; border: 1px solid var(--border); border-radius: 999px; background: var(--muted); cursor: pointer; transition: background-color 0.15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.switch input:checked { background: var(--accent); border-color: transparent; }
.switch input:checked::after { transform: translateX(1.1rem); }
.switch input:disabled { opacity: 0.55; cursor: progress; }
.switch input:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---------- tree (sections) ---------- */
.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0.25rem 0 0.25rem 1.25rem; padding-left: 0.75rem; border-left: 1px dashed var(--border); }
.tree-node { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.5rem; min-height: 2.5rem; padding: 0.2rem 0.4rem; border-radius: 0.5rem; }
.tree-node:hover { background: var(--muted); }
.tree-node .title { font-weight: 700; cursor: pointer; }
.tree-node .kind { font-size: 0.72rem; }
.tree-node .open, .tree-node .proj { margin-left: auto; }
.tree-node .proj + .open { margin-left: 0; }
.tree-node .title { overflow-wrap: anywhere; min-width: 0; }
.tree-detail { margin: 0.25rem 0 0.5rem 1.6rem; padding: 0.6rem 0.8rem; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) - 0.15rem); font-size: 0.85rem; }
.tree-detail table { width: 100%; border-collapse: collapse; }
.tree-detail td { padding: 0.2rem 0.4rem 0.2rem 0; vertical-align: top; }

/* ---------- read-only project view (superadmin) ---------- */
.field input[readonly], .field textarea[readonly] { background: color-mix(in srgb, var(--muted) 45%, var(--background)); cursor: default; }
.field select:disabled, .radios input:disabled, .check input:disabled { cursor: default; }
.radios label:has(input:disabled), .check:has(input:disabled) { cursor: default; }
.lang-tab[disabled] { cursor: default; }
.media-empty { display: inline-flex; align-items: center; justify-content: center; width: 7rem; height: 7rem; padding: 0.4rem; border: 1px dashed var(--border); border-radius: 0.75rem; color: var(--muted-foreground); font-size: 0.78rem; text-align: center; }
.media-empty.wide { width: 11.2rem; }
.media-empty.tile { width: 11rem; }
.media-empty.round { border-radius: 50%; }
.media-item.fallback img { opacity: 0.55; border-style: dashed; }
.prose.desc-preview { max-width: none; padding: 0.9rem 1rem; background: var(--background); border: 1px solid var(--border); border-radius: calc(var(--radius) - 0.15rem); }
.desc-preview > :last-child { margin-bottom: 0; }
.desc-preview h2 { margin-top: 0.5rem; }
pre.code.wrap { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 24rem; }
.html-preview summary { display: flex; align-items: center; min-height: 2.75rem; padding: 0 0.8rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 0.15rem); cursor: pointer; font-weight: 700; font-size: 0.88rem; list-style-position: inside; }
.html-preview summary::-webkit-details-marker { margin-right: 0.4rem; }
.html-preview[open] summary { margin-bottom: 0.5rem; }
.pub-urls { margin-top: 1rem; }
.page-head p .badge, .b-meta dd .badge { white-space: normal; }
.pub-urls .lbl { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted-foreground); margin-bottom: 0.3rem; }
.pub-urls ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.25rem; }
.pub-urls li { display: flex; gap: 0.5rem; align-items: baseline; min-width: 0; }
.pub-urls li b { flex: none; width: 1.8rem; font-size: 0.8rem; }
.pub-urls li a { min-width: 0; overflow-wrap: anywhere; }
.pub-urls p { margin: 0; }

/* ---------- docs ---------- */
.docs-nav { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.docs-nav a { text-decoration: none; display: inline-flex; align-items: center; }
.prose { max-width: 46rem; overflow-wrap: anywhere; }
.prose h2 { margin: 1.75rem 0 0.6rem; font-size: 1.15rem; }
.prose h3 { margin: 1.25rem 0 0.4rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 0.9rem; }
.prose li { margin-bottom: 0.3rem; }
.prose code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85em; background: var(--muted); padding: 0.1rem 0.3rem; border-radius: 0.3rem; }
.prose pre { margin: 0 0 1rem; padding: 0.9rem 1rem; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) - 0.15rem); overflow: auto; font-size: 0.8rem; }
.prose pre code { background: none; padding: 0; }
/* Wide reference tables scroll inside themselves on phones. */
.prose table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 0.88rem; margin-bottom: 1rem; }
.prose table th, .prose table td { min-width: 8rem; }
.prose th, .prose td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--muted-foreground); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; top: 1rem; transform: translateX(-50%); z-index: 100; padding: 0.7rem 1rem; background: var(--foreground); color: var(--background); border-radius: var(--radius); font-weight: 600; font-size: 0.9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); max-width: calc(100vw - 2rem); }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  #app { flex-direction: column; }
  .sidebar { position: static; height: auto; width: 100%; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 0.3rem; padding: 0.6rem 0.75rem; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0.2rem 0.4rem; }
  .brand .sub { display: none; }
  .nav-items { flex-direction: row; flex-wrap: wrap; order: 3; width: 100%; }
  .nav-item { width: auto; }
  .sidebar .spacer { display: none; }
  .sidebar-user { margin: 0 0 0 auto; padding: 0.2rem; border: 0; width: auto; }
  .sidebar-user .u-name, .sidebar-user .u-sub { display: none; }
  .content-inner { padding: 1.25rem 1rem 3rem; }
  .two { grid-template-columns: 1fr; }
}
.b-flags { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
