/* Portal and admin panel: what the bot's window does not need (sign-in pages, forms, phone width).
   Colours, type, space and motion come only from design/css/tokens.css (D-144, D-141). */

body.scroll { overflow: auto; }
a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: var(--t-12); }

@font-face { font-family: "IBM Plex Mono"; src: url("../design/fonts/plex/IBMPlexMono-Regular.ttf"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../design/fonts/plex/IBMPlexMono-Medium.ttf"); font-weight: 500; font-display: swap; }

/* ---------------------------------------------------------------- sign-in pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s-8) var(--s-4);
  background: radial-gradient(1200px 600px at 50% -10%, rgba(62, 131, 255, .08), transparent 60%), var(--ground); }
.auth-card { width: min(420px, 100%); padding: var(--s-8) var(--s-6) var(--s-6); }
.auth-card .brand { justify-content: center; margin-bottom: var(--s-6); }
.auth-card .brand-name, .doc .brand-name { display: block; } /* the shell hides it below 1240 px; a sign-in card always has room */
.auth-card h1 { text-align: center; margin-bottom: var(--s-2); }
.auth-card .lead { text-align: center; color: var(--ink-2); margin-bottom: var(--s-6); }
.auth-foot { margin-top: var(--s-5); text-align: center; font-size: var(--t-13); color: var(--ink-3); }
.auth-foot a + a::before { content: "·"; margin: 0 var(--s-2); color: var(--ink-3); }

/* ---------------------------------------------------------------- forms */
.form { display: grid; gap: var(--s-4); }
.field { display: grid; gap: 6px; }
.field > span { font-size: var(--t-12); font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: var(--t-12); color: var(--ink-3); }
.field .input, .field .select, .field textarea { width: 100%; }
textarea.input { height: auto; min-height: 96px; padding: var(--s-2) var(--s-3); resize: vertical; line-height: 1.45; font: inherit; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.btn.wide { width: 100%; height: 38px; }
.check { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-13); color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }
.error-text { font-size: var(--t-13); color: var(--bad); min-height: 1em; }
.error-text:empty { display: none; }
.pw { position: relative; }
.pw .input { padding-right: 40px; }
.pw button { position: absolute; right: 4px; top: 4px; width: 26px; height: 26px; display: grid; place-items: center; color: var(--ink-3); border-radius: 6px; }
.pw button:hover { color: var(--ink); background: var(--raised-3); }
.pw svg { width: 15px; height: 15px; }
.cf-turnstile { min-height: 0; }
fieldset.card { margin: 0; padding: 0; min-width: 0; }
input[type="file"].input { height: auto; padding: 6px; color: var(--ink-2); }
input[type="file"].input::file-selector-button { height: 26px; margin-right: var(--s-3); padding: 0 var(--s-3); border-radius: 6px; cursor: pointer;
  background: var(--raised-3); border: 1px solid var(--edge-strong); color: var(--ink); font: 500 var(--t-12) var(--font); }

/* ---------------------------------------------------------------- page layout */
.stack { display: grid; gap: var(--s-4); align-content: start; max-width: 1100px; }
.cols { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.section-title { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-2) 0 0; }
.section-title h2 { flex: 1; }
.notice { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--r-control);
  background: var(--accent-soft); border: 1px solid rgba(62, 131, 255, .35); font-size: var(--t-13); color: var(--ink); }
.notice.warn { background: var(--warn-soft); border-color: rgba(255, 154, 46, .4); }
.notice.bad { background: var(--bad-soft); border-color: rgba(255, 77, 97, .4); }
.notice.ok { background: var(--ok-soft); border-color: rgba(16, 211, 138, .35); }
.notice > svg { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.notice .btn svg, .row .btn svg { width: 15px; height: 15px; }
.empty svg { width: 22px; height: 22px; }
.notice .grow { min-width: 0; }
.notice .grow > b { display: block; margin-bottom: 2px; }

.keybox { display: flex; align-items: center; gap: var(--s-2); padding: 6px 6px 6px var(--s-3); border-radius: var(--r-control);
  background: var(--raised-1); border: 1px solid var(--edge-strong); }
.keybox code { flex: 1; font-size: var(--t-14); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.keybox .btn { height: 28px; padding: 0 var(--s-3); }
.keybox .btn.icon { width: 28px; padding: 0; }

.list { display: grid; }
.list > div { display: flex; align-items: center; gap: var(--s-3); padding: 10px 0; border-top: 1px solid var(--edge); font-size: var(--t-13); }
.list > div:first-child { border-top: 0; }
.list > div > svg { width: 18px; height: 18px; color: var(--ink-3); }
.list .grow small { display: block; color: var(--ink-3); font-size: var(--t-12); }

.pre { white-space: pre-wrap; word-break: break-word; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: var(--t-12);
  background: var(--raised-1); border: 1px solid var(--edge); border-radius: var(--r-control); padding: var(--s-3); max-height: 420px; overflow: auto; }
.progress { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width var(--t-base) var(--ease); }
.table-wrap { overflow-x: auto; }
.table td.actions { white-space: nowrap; text-align: right; }
.table td.actions .btn { height: 28px; padding: 0 10px; }
.clickable { cursor: pointer; }
.center { text-align: center; }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }

/* modal dialog (native <dialog>) */
dialog.modal { padding: 0; border: 1px solid var(--edge-strong); border-radius: var(--r-card); background: var(--raised-2); color: var(--ink);
  box-shadow: var(--shadow-float); width: min(460px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .55); }
dialog.modal .card-body { display: grid; gap: var(--s-4); }

/* ---------------------------------------------------------------- long text (privacy) */
.doc { max-width: 760px; margin: 0 auto; padding: var(--s-8) var(--s-5) 64px; display: grid; gap: var(--s-4); }
.doc h1 { margin-top: var(--s-4); }
.doc h2 { margin-top: var(--s-4); }
.doc p, .doc li { color: var(--ink-2); line-height: 1.6; }
.doc ul { margin: 0; padding-left: 1.2em; display: grid; gap: var(--s-2); }
.doc b { color: var(--ink); font-weight: 600; }
.doc .lead { font-size: var(--t-16); color: var(--ink-2); }

/* ---------------------------------------------------------------- phone width */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .rail { flex-direction: row; align-items: center; overflow-x: auto; padding: var(--s-2) var(--s-3); border-right: 0; border-bottom: 1px solid var(--edge); gap: var(--s-1); }
  .rail .brand { margin: 0 var(--s-2) 0 0; }
  .rail .nav-label, .rail-foot .version { display: none; }
  .rail-foot { margin: 0 0 0 auto; display: flex; }
  .nav { flex: none; }
  .topbar { padding: 0 var(--s-4); height: 52px; }
  .page { padding: var(--s-4); }
  .strip { grid-auto-flow: row; }
  .strip > div + div { border-left: 0; border-top: 1px solid var(--edge); }
  .hbar { grid-template-columns: 110px minmax(0, 1fr) 36px; }
}
