/* SILINT shell: the Registry direction (ADR 0014 decision 4). Day mode as the
   canvas has it; night mode on neutral near-black with cobalt where the canvas
   had white: heavy rules, selected states, tags. Tokens first, then the frame,
   then the pages. Archivo is the typeface; the system stack stands in until the
   OFL files are vendored. */

:root {
  --font: "Archivo", "Archivo Variable", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --bg: #f4f3ef;
  --surface: #ffffff;
  --ink: #141414;
  --muted: #5f5e5a;
  --rule: #d8d5cd;
  --rule-heavy: #141414;
  --accent: #1f3fcf;
  --accent-ink: #ffffff;
  --tag-bg: #ebeefb;
  --tag-ink: #1f3fcf;
  --danger: #a3261f;
  --banner-public: #6b6b66;
  --banner-internal: #3a3f4a;
  --banner-confidential: #1f3fcf;
  --banner-cui: #7a1f3d;
  --banner-ink: #ffffff;
  --shadow: 0 1px 0 rgba(20, 20, 20, 0.06);
  --radius: 4px;
  --compact: 32px;
  --comfortable: 52px;
}

:root[data-theme="dark"] {
  --bg: #0f1012;
  --surface: #16171a;
  --ink: #e9e7e1;
  --muted: #9b9b94;
  --rule: #2b2c31;
  --rule-heavy: #4f7cff;
  --accent: #4f7cff;
  --accent-ink: #0b0c0f;
  --tag-bg: #1a2442;
  --tag-ink: #9cb4ff;
  --danger: #ff7b73;
  --banner-public: #3b3c40;
  --banner-internal: #2a3344;
  --banner-confidential: #2f55d6;
  --banner-cui: #8c2a4a;
  --banner-ink: #ffffff;
  --shadow: none;
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 14px; }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 22px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
.small-text { font-size: 12px; }
.center-text { text-align: center; margin-top: 15vh; }
.noscript { margin: 3em; font-family: var(--font); }

/* -- frame -------------------------------------------------------------------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; height: 28px;
  color: var(--banner-ink); background: var(--banner-internal);
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.banner-public { background: var(--banner-public); }
.banner-internal { background: var(--banner-internal); }
.banner-customer_confidential { background: var(--banner-confidential); }
.banner-cui { background: var(--banner-cui); }
.banner-none { background: var(--banner-public); }
.banner-tenant { font-weight: 500; letter-spacing: 0.04em; text-transform: none; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; height: 52px;
  border-bottom: 2px solid var(--rule-heavy);
  background: var(--surface);
}
.top-left, .top-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wordmark { font-weight: 700; letter-spacing: 0.18em; color: var(--ink); font-size: 14px; }
.wordmark:hover { text-decoration: none; }
.crumb { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb::before { content: "/"; margin-right: 14px; color: var(--rule); }
.who { color: var(--muted); font-size: 13px; }
.top-link { font-size: 13px; color: var(--ink); }
.theme { background: none; border: 1px solid var(--rule); color: var(--ink); border-radius: var(--radius); width: 28px; height: 28px; cursor: pointer; font: inherit; }
.main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 24px 48px; }
.foot { display: flex; justify-content: space-between; padding: 12px 24px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 12px; letter-spacing: 0.06em; }

/* -- cards, forms, lists --------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--rule-heavy);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.card.wide { max-width: 720px; }
.signin { width: 360px; max-width: 100%; margin: 14vh auto 0; display: flex; flex-direction: column; gap: 10px; }
.wordmark-big { font-size: 22px; letter-spacing: 0.22em; font-weight: 700; margin: 0 0 18px; text-align: center; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
input[type="email"], input[type="text"], input[type="number"], input[type="datetime-local"], select, textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 0 12px; height: 44px; width: 100%;
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; height: 40px; padding: 0 16px; margin-top: 6px;
  border: 1px solid var(--rule-heavy); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none;
}
.button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button.small { height: var(--compact); padding: 0 12px; margin: 0; font-size: 13px; }
.button.danger { color: var(--danger); border-color: var(--danger); }
.button.tiny { height: 24px; padding: 0 8px; margin: 0; font-size: 12px; font-weight: 500; }
.button:disabled { opacity: 0.6; cursor: wait; }
.button:hover { text-decoration: none; filter: brightness(1.05); }
.notice { padding: 10px 12px; border-radius: var(--radius); font-size: 14px; }
.notice-error { color: var(--danger); border: 1px solid var(--danger); }
.notice-muted { color: var(--muted); background: var(--bg); }
.notice-ok { color: var(--ink); border: 1px solid var(--rule-heavy); background: var(--surface); }
.notice.flash { margin: 0 0 14px; }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.list li { display: flex; align-items: center; gap: 12px; min-height: var(--comfortable); padding: 6px 0; border-bottom: 1px solid var(--rule); }
.row-link, .row-text { flex: 1; font-weight: 500; color: var(--ink); }
.tag {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--tag-ink); background: var(--tag-bg); border-radius: 2px; padding: 2px 6px; white-space: nowrap;
}
.tag-env { background: transparent; border: 1px solid var(--rule); color: var(--muted); }
.tag-handling-customer_confidential { background: var(--banner-confidential); color: var(--banner-ink); }
.tag-handling-cui { background: var(--banner-cui); color: var(--banner-ink); }
.tag-handling-internal { background: var(--banner-internal); color: var(--banner-ink); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 14px 0 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-all; }

/* -- the picker ----------------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool {
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 124px;
  padding: 18px; background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--rule-heavy);
  border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow);
}
.tool:hover { text-decoration: none; border-color: var(--accent); border-top-color: var(--accent); }
.tool.locked { color: var(--muted); border-top-color: var(--rule); }
.tool-name { font-size: 17px; font-weight: 600; }
.tool-meta { display: flex; flex-wrap: wrap; gap: 6px; }

/* -- compact scan tables, for the admin pages and tools -------------------------- */
.scan-wrap { overflow-x: auto; border-bottom: 1px solid var(--rule); }
table.scan { width: 100%; border-collapse: collapse; font-size: 13px; }
table.scan th { text-align: left; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; color: var(--muted); border-bottom: 2px solid var(--rule-heavy); padding: 0 8px; height: var(--compact); white-space: nowrap; }
table.scan td { border-bottom: 1px solid var(--rule); padding: 0 8px; height: var(--compact); white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
table.scan tbody tr:hover td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
table.scan td.col-actions { text-align: right; overflow: visible; }
table.scan .actions { display: inline-flex; align-items: center; gap: 6px; }
table.scan select.tiny { height: 24px; width: auto; padding: 0 6px; font-size: 12px; }

/* -- the admin pages and the console: tabs, a panel, toolbars, comfortable forms -- */
.admin-head { display: flex; align-items: baseline; gap: 14px; }
.admin-head h1 { margin: 0; }
.admin-head .top-link { margin-left: auto; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 18px 0 20px; border-bottom: 2px solid var(--rule-heavy); }
.tab { display: inline-block; padding: 8px 12px; font-size: 13px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.panel > .intro { max-width: 760px; font-size: 14px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 14px 0 10px; font-size: 13px; }
.toolbar select.tiny { height: 28px; width: auto; padding: 0 8px; font-size: 13px; }
.toolbar .inline { display: inline-flex; align-items: center; gap: 8px; }
.toolbar .inline input { height: 28px; width: auto; padding: 0 8px; font-size: 13px; }
.tool-link { font-size: 13px; }
.toolbar input[type="search"] { height: 28px; width: 220px; padding: 0 8px; font-size: 13px; }
.finder { display: flex; flex-wrap: wrap; gap: 8px; }
.finder input { flex: 1 1 160px; }
.finder select { flex: 1 1 100%; }
.form { margin-top: 24px; max-width: 640px; display: flex; flex-direction: column; gap: 14px; }
.form h2 { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field .hint { font-size: 12px; color: var(--muted); }
.field.check { flex-direction: row; align-items: center; gap: 10px; min-height: var(--comfortable); }
.field.check input { width: 16px; height: 16px; margin: 0; }
.form-actions { display: flex; gap: 10px; }
.form .button { margin-top: 0; }
.slot:empty { display: none; }

@media (max-width: 640px) {
  .top, .banner, .foot { padding-left: 16px; padding-right: 16px; }
  .main { padding: 20px 16px 40px; }
  .crumb, .who { display: none; }
}
