/* Shell: the owner's picture of 2026-11-28 (docs/decisions/shell.md). Pages: the stage 1 look, restyled later. Type: IBM Plex Sans and Plex Mono (owner, 2026-11-28; SIL OFL, vendor/fonts/OFL.txt). */
@font-face { font-family: "IBM Plex Sans"; src: url("/vendor/fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/vendor/fonts/IBMPlexSans-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/vendor/fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600; 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; }
:root {
  --bg: #000000; --panel: #0c0d10; --rule: #2c313a; --text: #e8e8e6; --dim: #8d949f; --accent: #7fb3e0;
  --ok: #4fc98a; --warn: #e0a04a; --ok-bg: #173821; --warn-bg: #3a2c14; --critical: #ff7474;
  --tabstrip: #40403e; --tab-text: #c3c5c8; --tab-active: #191919; --tab-fg: #f1f1ef; --badge: #4a4c4f;
  --cmdline: #285fca; --cmdline-edge: #214fa8; --secbar: #000000; --secbar-text: #f4e6e0; --label: #e8a33d; --label-fg: #0f1114;
  --help-bg: #f2c230; --help-fg: #111111; --panel-bar: #23252b;
  --mono: "IBM Plex Mono", Consolas, "DejaVu Sans Mono", monospace;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); display: flex; flex-direction: column; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
.u-legend { color: var(--dim); font-size: 12px; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.spacer { flex: 1; }
[hidden] { display: none !important; }

/* shell: the owner's picture of 2026-11-28 (charcoal, a rounded command box holding the page code, a Ctrl K chip,
   a grey section bar with the security first); the pages below keep their own look for now */
#shell { --sh-bg: #1c1c1e; --sh-row: #202022; --sh-line: #3a3a3c; --sh-box: #161618; --sh-edge: #4a4a4d; --sh-chip: #3a3a3c;
  --sh-text: #f2f2f4; --sh-dim: #a1a1a6; --sh-bar: #262628; --sh-bar-first: #3a3a3d; }
#tabstrip { background: var(--sh-bg); display: flex; align-items: stretch; padding: 0 0 0 8px; min-height: 40px; border-bottom: 1px solid var(--sh-line); }
#tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tab { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; background: transparent; border: 0;
  color: var(--sh-dim); font-size: 15px; white-space: nowrap; cursor: pointer; }
.tab:hover { color: var(--sh-text); }
.tab.active { color: var(--sh-text); background: #252527; }
.tab .badge { min-width: 44px; height: 22px; padding: 0 8px; border-radius: 4px; background: var(--sh-chip); color: var(--sh-text);
  font: 600 12px/22px var(--sans); text-align: center; letter-spacing: .02em; }
.tab .close { background: none; border: 0; color: var(--sh-dim); font-size: 14px; padding: 0 2px 0 6px; }
.tab .close:hover { color: var(--sh-text); }
#tab-new { background: none; border: 0; color: var(--sh-text); font-size: 22px; font-weight: 400; width: 44px; }
#tabstrip .icon { background: none; border: 0; color: var(--sh-text); width: 44px; height: 40px; display: grid; place-items: center; }
#tabstrip .icon:hover { background: #2c2c2e; }
#menu-wrap { position: relative; display: flex; margin-right: 4px; }
#menu { position: absolute; right: 0; top: 42px; z-index: 30; min-width: 230px; background: #2a2a2c; border: 1px solid var(--sh-edge);
  border-radius: 6px; padding: 4px 0; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
#menu #who { color: var(--sh-dim); font-size: 12px; padding: 6px 14px 8px; border-bottom: 1px solid var(--sh-line); margin-bottom: 4px; }
#menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--sh-text); font-size: 14px; padding: 8px 14px; }
#menu button:hover { background: #3a3a3d; }

#cmdrow { background: var(--sh-row); display: flex; align-items: center; gap: 4px; height: 36px; padding: 0 6px; border-bottom: 1px solid var(--sh-line); }
#cmdrow .square { width: 26px; height: 28px; border: 0; border-radius: 4px; background: transparent; color: var(--sh-text);
  font: 400 20px/1 var(--sans); flex: none; }
#cmdrow .square:hover:not(:disabled) { background: #2c2c2e; }
#cmdrow .square:disabled { color: var(--sh-dim); opacity: .45; }
#cmdwrap { position: relative; flex: 0 1 1100px; margin-left: 6px; }
#cmdframe { width: 100%; height: 28px; display: flex; align-items: center; border: 1px solid var(--sh-edge); border-radius: 4px; background: var(--sh-box); }
#cmdframe:focus-within { border-color: #6e6e73; }
#page-title { flex: none; width: 136px; height: 100%; display: flex; align-items: center; background: transparent; border: 0; border-right: 1px solid var(--sh-edge);
  color: var(--sh-text); font: 600 13px var(--sans); padding: 0 12px 0 32px; letter-spacing: .02em; }
#page-title .pt-caret { margin-left: auto; font-size: 10px; color: var(--sh-text); }
#page-title:hover { background: #222224; }
#cmdframe .prompt { color: var(--sh-text); font: 600 13px var(--sans); margin: 0 8px 0 12px; }
#cmd { flex: 1; height: 26px; background: transparent; border: 0; color: var(--sh-text); font: 14px var(--mono); outline: none; caret-color: var(--sh-text); }
#cmd { text-transform: uppercase; }
#cmd::placeholder { color: var(--sh-dim); text-transform: none; }
#cmdframe .chip { flex: none; background: var(--sh-chip); color: var(--sh-text); border-radius: 3px; font: 500 11px/1 var(--sans); padding: 3px 7px; margin-right: 5px; }
#cmd-list { position: absolute; z-index: 20; top: 31px; left: 0; width: 100%; min-width: 420px; max-height: 60vh; overflow-y: auto;
  background: #2a2a2c; border: 1px solid var(--sh-edge); border-radius: 6px; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }
#cmd-list .head { color: var(--sh-dim); font-size: 11px; font-weight: 600; padding: 8px 12px 3px; letter-spacing: .06em; }
#cmd-list .item { display: flex; gap: 14px; align-items: baseline; padding: 7px 12px; cursor: pointer; color: var(--sh-text); }
#cmd-list .item.on, #cmd-list .item:hover { background: #3a3a3d; }
#cmd-list .code { font-family: var(--mono); font-weight: 500; color: var(--sh-text); min-width: 124px; }
#cmd-list .desc { color: var(--sh-dim); font-size: 12px; margin-left: auto; }
#jobs-pill { background: var(--warn-bg); color: var(--warn); font-weight: 600; font-size: 11px; padding: 2px 8px; border-radius: 4px; }
#help { background: transparent; color: var(--sh-text); border: 0; border-radius: 4px; font-weight: 600; font-size: 15px; height: 28px; padding: 0 10px; }
#help:hover { background: #2c2c2e; }

/* the section bar: shown only with a security open */
#secbar { background: var(--sh-bar); border-bottom: 1px solid var(--sh-line); height: 28px; display: flex; align-items: stretch; }
#sec-label { background: linear-gradient(90deg, var(--sh-bar-first), #2f2f31); color: var(--sh-text); font-size: 14px; padding: 0 20px 0 12px;
  display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%;
  border-right: 1px solid var(--sh-edge); }
#sec-label b { font-weight: 600; margin-right: 12px; letter-spacing: .01em; }
#sec-keys { display: flex; }
.barkey { background: none; border: 0; border-right: 1px solid var(--sh-edge); color: var(--sh-text); font-size: 14px; padding: 0 18px;
  margin: 5px 0; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.barkey:hover { color: #ffffff; background: #2f2f31; }
.barkey .n { font-size: 13px; color: var(--sh-dim); }
#sec-title { color: var(--sh-text); font-size: 14px; padding: 0 14px 0 16px; display: flex; align-items: center; white-space: nowrap;
  border-left: 1px solid var(--sh-edge); margin: 5px 0; }

/* pages */
#page { flex: 1; overflow: auto; padding: 16px 18px 28px; }
#statusline { background: var(--panel); color: var(--dim); font-size: 12px; padding: 3px 10px; min-height: 22px; }
#statusline.err { color: var(--critical); }
body.anon #shell, body.anon #statusline { display: none; }

h1 { font-size: 22px; font-weight: 600; margin: 0 0 2px; }
h2 { font-size: 12px; font-weight: 700; color: var(--accent); margin: 0 0 8px; letter-spacing: .03em; text-transform: uppercase; }
.tags { color: var(--dim); font-family: var(--mono); font-size: 13px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.panel { background: var(--panel); border: 1px solid #1a1d23; padding: 12px 14px; }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span4 { grid-column: span 4; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span3, .span4 { grid-column: span 2; } }
@media (max-width: 640px) { .grid { grid-template-columns: minmax(0, 1fr); } .span2, .span3, .span4 { grid-column: auto; } #page-title, #cmdframe .chip, .barkey .n { display: none; } #cmd-list { min-width: 0; } .barkey { padding: 0 12px; } }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px solid #15181d; }
.row:last-child { border-bottom: 0; }
.row .v { font-family: var(--mono); white-space: nowrap; }
.pos { color: var(--ok); } .neg { color: var(--warn); }
.muted { color: var(--dim); } .small { font-size: 12px; }
.check { color: var(--warn); font-size: 11px; margin-left: 6px; }
.sri { display: flex; gap: 3px; margin: 6px 0 4px; }
.sri span { flex: 1; height: 24px; display: grid; place-items: center; background: #1a1d23; color: var(--dim); font-family: var(--mono); }
.sri span.on { background: var(--accent); color: #0b0d12; font-weight: 700; }
.big { font: 600 26px var(--mono); }
.bar { height: 6px; background: #1a1d23; margin: 2px 0 6px; } .bar i { display: block; height: 100%; background: var(--accent); }
.chart { min-height: 220px; }
.note { color: var(--warn); font-size: 12px; margin: 6px 0 0; }
table.data { border-collapse: collapse; width: 100%; font-size: 13px; }
table.data th, table.data td { padding: 5px 8px; border-bottom: 1px solid #15181d; text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { color: var(--dim); font-weight: 600; }
.scroll { overflow-x: auto; }
form.stack { display: grid; gap: 8px; max-width: 520px; }
label.f { display: grid; gap: 3px; font-size: 12px; color: var(--dim); }
input.f, select.f { background: #111317; border: 1px solid var(--rule); color: var(--text); font: 14px var(--sans); height: 32px; padding: 0 8px; }
button.key { background: var(--cmdline); border: 0; color: #fff; height: 32px; padding: 0 14px; }
button.key.quiet { background: #1a1d23; color: var(--text); border: 1px solid var(--rule); }
.login { max-width: 360px; margin: 12vh auto 0; }
.login h1 { font-size: 26px; margin-bottom: 18px; }
.err { color: var(--critical); }

/* ASKD */
.askd-list { max-width: 980px; display: grid; gap: 10px; margin: 8px 0 12px; max-height: calc(100vh - 330px); overflow-y: auto; padding-right: 6px; }
.askd-q, .askd-a { background: var(--panel); border: 1px solid #1f2329; padding: 10px 14px; }
.askd-q { border-left: 3px solid #4a4a4d; }
.askd-a.err .askd-text { color: var(--critical); }
.askd-who { font: 600 11px var(--sans); color: var(--dim); letter-spacing: .05em; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.askd-tier { background: var(--warn-bg); color: var(--warn); border-radius: 3px; padding: 0 6px; letter-spacing: 0; }
.askd-text { white-space: pre-wrap; line-height: 1.5; }
.askd-sources { margin: 8px 0 0; padding-left: 18px; color: var(--dim); font-size: 12px; }
.askd-cost { color: #5d636d; font-size: 11px; margin-top: 6px; }
.askd-form { max-width: 980px; display: grid; gap: 8px; }
.askd-input { width: 100%; height: auto; min-height: 64px; padding: 8px; resize: vertical; font: 14px/1.45 var(--sans); }
.askd-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* installed as an app with the title-bar overlay: the tab strip sits in the title bar, its empty part drags the window */
@media (display-mode: window-controls-overlay) {
  #tabstrip { padding-left: max(8px, env(titlebar-area-x, 0px)); padding-right: calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw));
    min-height: env(titlebar-area-height, 40px); app-region: drag; -webkit-app-region: drag; }
  #tabstrip button, #tabstrip .tab, #menu { app-region: no-drag; -webkit-app-region: no-drag; }
}

/* the borderless desktop window: window keys in the tab strip, invisible resize edges */
.winkeys { display: flex; align-self: stretch; margin-left: 2px; }
.winkey { width: 46px; background: none; border: 0; color: var(--sh-text, #f2f2f4); font: 400 15px var(--sans); }
.winkey:hover { background: #2c2c2e; }
#win-close:hover { background: #c42b1c; color: #fff; }
.edge { position: fixed; z-index: 100; }
.edge-n, .edge-s { left: 6px; right: 6px; height: 4px; cursor: ns-resize; }
.edge-n { top: 0; } .edge-s { bottom: 0; }
.edge-e, .edge-w { top: 6px; bottom: 6px; width: 4px; cursor: ew-resize; }
.edge-e { right: 0; } .edge-w { left: 0; }
.edge-ne, .edge-nw, .edge-se, .edge-sw { width: 8px; height: 8px; }
.edge-ne { top: 0; right: 0; cursor: nesw-resize; } .edge-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.edge-nw { top: 0; left: 0; cursor: nwse-resize; } .edge-se { bottom: 0; right: 0; cursor: nwse-resize; }
html.desktop #menu-wrap { margin-right: 0; }
/* signed out in the desktop app: only the strip's drag area and window keys, so the window can still be moved and closed */
html.desktop body.anon #shell { display: block; }
html.desktop body.anon #cmdrow, html.desktop body.anon #secbar, html.desktop body.anon #tabs, html.desktop body.anon #tab-new,
html.desktop body.anon #detach, html.desktop body.anon #find, html.desktop body.anon #menu-wrap { display: none; }

/* MSG: colleagues on the left, the conversation on the right; the envelope's count in the tab strip */
#msg-btn { position: relative; background: transparent; color: var(--sh-text); border: 0; border-radius: 4px; width: 36px; height: 28px; display: grid; place-items: center; }
#msg-btn:hover { background: #2c2c2e; }
#msg-count { position: absolute; top: -2px; right: 0; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: #2a62d4; color: #fff; font: 600 10px/15px var(--sans); text-align: center; }
html.desktop body.anon #msg-btn { display: none; }
.msg-wrap { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 12px; max-width: 1180px; height: calc(100vh - 250px); min-height: 320px; }
.msg-side { background: var(--panel); border: 1px solid #1f2329; overflow-y: auto; }
.msg-head { font: 600 11px var(--sans); color: var(--accent, #6fa8dc); letter-spacing: .05em; padding: 10px 12px 6px; }
.msg-person { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid #1f2329; color: inherit; padding: 8px 12px; cursor: pointer; }
.msg-person:hover { background: #16191e; }
.msg-person.on { background: #1b2230; box-shadow: inset 3px 0 0 #2a62d4; }
.msg-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-unread { background: #2a62d4; color: #fff; border-radius: 8px; padding: 0 6px; font: 600 11px/16px var(--sans); align-self: center; }
.msg-last { grid-column: 1 / -1; color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-main { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border: 1px solid #1f2329; padding: 10px 14px; }
.msg-with { font: 600 13px var(--sans); padding-bottom: 8px; border-bottom: 1px solid #1f2329; }
.msg-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 10px 4px; }
.msg { max-width: 72%; padding: 6px 10px; border: 1px solid #262b33; }
.msg.mine { align-self: flex-end; background: #16233a; border-color: #22385c; }
.msg.theirs { align-self: flex-start; background: #15181d; }
.msg-text { white-space: pre-wrap; line-height: 1.45; overflow-wrap: anywhere; }
.msg-text a.isin { font-family: var(--mono); }
.msg-when { color: #5d636d; font-size: 11px; margin-top: 2px; }
.msg-form { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid #1f2329; }
.msg-input { width: 100%; height: auto; min-height: 48px; padding: 8px; resize: vertical; font: 14px/1.45 var(--sans); }

/* discrete scrollbars: thin and dark, brighter only under the pointer */
* { scrollbar-width: thin; scrollbar-color: #2e323a transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2e35; border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #4a505b; background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }

/* USERS */
.users-add { display: grid; gap: 6px; max-width: 420px; }
table.users td { vertical-align: middle; }
table.users tr.dim td { opacity: .55; }
.users-email { font-weight: 600; }
.users-name { width: 180px; height: 24px; margin-top: 3px; font-size: 12px; }
.users-keys { display: flex; gap: 4px; flex-wrap: wrap; }
.pill { border-radius: 3px; padding: 1px 7px; font: 600 11px var(--sans); white-space: nowrap; }
.pill.on { background: #12301f; color: #5fd08a; }
.pill.wait { background: var(--warn-bg); color: var(--warn); }
.pill.off { background: #3a1416; color: #f07a7a; }
.key.danger { color: #f07a7a; }
.otp-box { display: grid; gap: 8px; justify-items: start; }
.otp { font: 600 18px var(--mono); background: #0f1720; border: 1px solid #22385c; padding: 6px 10px; user-select: all; }

/* DATA */
.data-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.data-tile { background: #101216; border: 1px solid #1f2329; padding: 8px 12px; }
.data-tile-t { font: 600 11px var(--sans); color: var(--dim); letter-spacing: .04em; text-transform: uppercase; }
.data-tile-v { font: 600 22px var(--mono); margin: 2px 0; }
.data-tile-s { color: var(--dim); font-size: 12px; }
.data-src { font-weight: 600; }
table.data-sources tr.dim td { opacity: .5; }
table.data-fields td.warn { color: var(--warn); }
.mono { font-family: var(--mono); }
table.data-sources th:nth-child(-n+4), table.data-sources td:nth-child(-n+4),
table.data-fields th:nth-child(6), table.data-fields td:nth-child(6), table.data-jobs th, table.data-jobs td { text-align: left; }
.pill.info { background: #13243b; color: #7fb3e0; }
.pill.idle { background: #23252b; color: #b9bec7; }
