/* Owl Launchpad — "night desk, lit lamp": quiet ink-on-paper UI; amber marks only what is live. */

@font-face { font-family: "Schibsted Grotesk"; font-weight: 400; font-display: swap;
  src: url("fonts/schibsted-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 500; font-display: swap;
  src: url("fonts/schibsted-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 600; font-display: swap;
  src: url("fonts/schibsted-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 700; font-display: swap;
  src: url("fonts/schibsted-grotesk-latin-700-normal.woff2") format("woff2"); }

:root {
  --night: #1D2340;
  --night-2: #2B3359;
  --paper: #F3F4F8;
  --surface: #FFFFFF;
  --lamp: #E8A317;
  --lamp-text: #7A5200;
  --lamp-wash: #FDF3DC;
  --rule: #C9CCD8;
  --rule-soft: #E2E4EC;
  --text: #1D2340;
  --muted: #5B6178;
  --red: #B3261E;
  --red-wash: #FBEAE8;
  --green: #2F7D4F;
  --green-wash: #E6F3EA;
  --blue: #2D5BBF;
  --blue-wash: #E8EEFA;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --sans: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 400 16px/1.55 var(--sans);
}
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--night); }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 31px; font-weight: 700; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 1em; max-width: 72ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar { background: var(--night); color: #fff; }
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 28px; min-height: 60px; flex-wrap: wrap;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.brand-lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 0 4px rgba(232,163,23,.18); }
.brand:hover { color: #fff; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: #C9CEE6; text-decoration: none; padding: 6px 10px; border-radius: var(--radius); font-weight: 500; }
.nav a:hover { color: #fff; background: var(--night-2); }
.nav a[aria-current="page"] { color: #fff; background: var(--night-2); }
.account { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #C9CEE6; }
.account a { color: #C9CEE6; }
.account a:hover { color: #fff; }
.account form { margin: 0; }
.linkbutton { background: none; border: 0; padding: 0; font: inherit; color: #C9CEE6; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkbutton:hover { color: #fff; }

/* ---------- layout ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 32px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.section { margin-top: 40px; }
.section > h2 { padding-bottom: 8px; border-bottom: 1px solid var(--rule); margin-bottom: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 24px; }
footer { max-width: 1120px; margin: 0 auto; padding: 0 24px 32px; color: var(--muted); font-size: 13px; }

/* ---------- flash messages ---------- */
.flashes { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; }
.flash { padding: 12px 16px; border-radius: var(--radius); border-left: 4px solid var(--night); background: var(--surface); }
.flash.error { border-color: var(--red); background: var(--red-wash); }
.flash.success { border-color: var(--green); background: var(--green-wash); }
.flash.info { border-color: var(--blue); background: var(--blue-wash); }

/* ---------- the live version (the one bold thing) ---------- */
.live { padding: 8px 0 32px; border-bottom: 1px solid var(--rule); }
.live-label { display: flex; align-items: center; gap: 10px; color: var(--lamp-text); font-weight: 600; margin: 0 0 4px; }
.lamp { width: 12px; height: 12px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 0 5px rgba(232,163,23,.2); flex: none; }
.live-version { font-size: clamp(44px, 8vw, 72px); font-weight: 700; letter-spacing: -.03em; line-height: 1; margin: 6px 0 14px; overflow-wrap: anywhere; }
.live-meta { color: var(--muted); margin: 0 0 16px; }
.live-notes { max-width: 72ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.live-empty { padding: 24px 0 32px; border-bottom: 1px solid var(--rule); }

/* ---------- release line (timeline) ---------- */
.line { list-style: none; margin: 0; padding: 0; }
.line li { position: relative; padding: 0 0 22px 32px; }
.line li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 2px; background: var(--rule-soft); }
.line li:last-child::before { display: none; }
.line .dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--rule); background: var(--paper); }
.line li.is-live .dot { border-color: var(--lamp); background: var(--lamp); box-shadow: 0 0 0 4px rgba(232,163,23,.2); }
.line li.is-failed .dot { border-color: var(--red); }
.line li.is-building .dot { border-color: var(--blue); }
.line .v { font-weight: 600; font-size: 18px; text-decoration: none; color: var(--text); margin-right: 8px; }
.line .v:hover { text-decoration: underline; }
.line .when { color: var(--muted); font-size: 14px; }
.line .note { color: var(--muted); font-size: 14px; margin: 2px 0 0; max-width: 60ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- status chips ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 2px 10px 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--rule-soft); color: var(--muted); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.live { background: var(--lamp-wash); color: var(--lamp-text); }
.status.live::before { background: var(--lamp); }
.status.failed { background: var(--red-wash); color: var(--red); }
.status.building, .status.queued, .status.running, .status.pending { background: var(--blue-wash); color: var(--blue); }
.status.applied { background: var(--green-wash); color: var(--green); }
.status.building::before, .status.running::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- tables ---------- */
.table-wrap { position: relative; overflow-x: auto; background: var(--surface); border: 1px solid var(--rule-soft); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 13px; background: #FAFBFD; }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; }
td .sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.empty { padding: 32px 16px; color: var(--muted); }

/* ---------- definition list ---------- */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0 0 24px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.hash { font-family: var(--mono); font-size: 13px; }

/* ---------- forms ---------- */
form.stack { display: grid; gap: 18px; max-width: 560px; align-content: start; }
label { font-weight: 600; display: block; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 14px; display: block; margin-top: 4px; }
input[type=text], input[type=password], input[type=file], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px;
}
input[type=file] { padding: 8px; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--night); outline: none; box-shadow: 0 0 0 3px rgba(232,163,23,.35); }
.code-input { font-size: 28px; letter-spacing: .3em; font-weight: 600; text-align: center; max-width: 240px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; width: 18px; height: 18px; flex: none; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; margin: 0; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--sans); padding: 12px 18px; border-radius: var(--radius);
  border: 1px solid var(--night); background: var(--night); color: #fff; cursor: pointer; text-decoration: none;
}
.button:hover { background: var(--night-2); color: #fff; }
.button.secondary { background: var(--surface); color: var(--night); border-color: var(--rule); }
.button.secondary:hover { border-color: var(--night); background: var(--surface); color: var(--night); }
.button.danger { background: var(--red); border-color: var(--red); }
.button.danger:hover { background: #8F1D17; }
.button.small { padding: 7px 12px; font-size: 14px; }
.button[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- logs & code ---------- */
.log, .code {
  font: 13px/1.6 var(--mono); background: #151A30; color: #DDE2F3; border-radius: var(--radius);
  padding: 16px 18px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0;
}
.log { max-height: 560px; min-height: 120px; }
.log.tall { max-height: 720px; }
textarea.editor { font: 14px/1.6 var(--mono); min-height: 420px; white-space: pre; overflow-wrap: normal; overflow-x: auto; tab-size: 4; }
form.stack.wide { max-width: 980px; }
h1 code { font-size: .8em; }
.code { max-height: 480px; white-space: pre; }
.code.wrap { white-space: pre-wrap; }
.code.full { max-height: none; }
.log-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.callout { padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--rule-soft); border-left: 4px solid var(--lamp); }
.callout.danger { border-left-color: var(--red); }
.callout code, .facts code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }

/* ---------- sign-in pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--night); }
.auth-box { width: 100%; max-width: 420px; background: var(--surface); border-radius: 10px; padding: 36px 32px; }
.auth-box .brand { color: var(--night); margin-bottom: 24px; }
.auth-box h1 { font-size: 25px; }
.auth-box form.stack { max-width: none; }
.auth-box .button { width: 100%; }
.qr { width: 200px; height: 200px; margin: 8px 0 12px; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { font-family: var(--mono); font-size: 15px; letter-spacing: .05em; background: var(--paper); padding: 8px 10px; border-radius: var(--radius); overflow-wrap: anywhere; }
.steps { padding-left: 20px; margin: 0 0 20px; }
.steps li { margin-bottom: 6px; }

/* ---------- one-time secret box ---------- */
.reveal { padding: 18px 20px; border-radius: var(--radius); background: var(--lamp-wash); border: 1px solid #F1D08A; margin-bottom: 24px; }
.people-actions { gap: 8px; }
.reveal .secret { background: var(--surface); display: inline-block; margin: 6px 8px 6px 0; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .topbar-inner { padding: 10px 16px; gap: 10px; }
  .nav { order: 3; flex-basis: 100%; }
  main { padding: 24px 16px 48px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
  th, td { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .status.building::before, .status.running::before { animation: none; }
}

/* ---------- 2.0: apps list, app header + tabs ---------- */
.crumb { margin: 0 0 4px; font-size: 14px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--night); text-decoration: underline; }
.app-head { margin-bottom: 28px; }
.app-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.app-head h1 { margin: 0 0 4px; }
.app-head p { margin: 0; }
.app-address { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.app-address a { font-weight: 500; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 20px; border-bottom: 1px solid var(--rule); }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--night); }
.tabs a[aria-current="page"] { color: var(--night); border-bottom-color: var(--lamp); }
.page-head h2 { margin: 0; font-size: 24px; }

.app-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--rule-soft); border-radius: var(--radius); }
.app-row { display: grid; grid-template-columns: 16px minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--rule-soft); }
.app-row:last-child { border-bottom: 0; }
.app-lamp { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--rule); }
.app-row.is-running .app-lamp { border-color: var(--lamp); background: var(--lamp); box-shadow: 0 0 0 4px rgba(232,163,23,.2); }
.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-name { font-size: 18px; font-weight: 600; color: var(--text); text-decoration: none; }
.app-name:hover { text-decoration: underline; }
.app-link { font-size: 14px; overflow-wrap: anywhere; }
.app-version .v { font-weight: 600; display: block; }
.app-version .sub { display: block; color: var(--muted); font-size: 13px; }
.empty-state { padding: 40px 0; max-width: 60ch; }

.disclosure { margin-top: 16px; }
.disclosure > summary { cursor: pointer; font-weight: 600; color: var(--blue); padding: 6px 0; }
.disclosure[open] > summary { margin-bottom: 12px; }
.disclosure > .stack, .disclosure > form { margin-top: 4px; }
input.mono, textarea.mono { font-family: var(--mono); font-size: 14px; }
.callout ol, .callout ul { padding-left: 20px; margin: 8px 0 0; }
.callout ul ul { margin-top: 4px; }
.callout li { margin-bottom: 6px; }
p.callout { max-width: none; }

@media (max-width: 820px) {
  .app-row { grid-template-columns: 16px minmax(0, 1fr); row-gap: 6px; }
  .app-row > .app-version, .app-row > .app-state, .app-row > .app-role { grid-column: 2; }
}

/* ---------- 3.0: web address field, requests, connection ---------- */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.addr { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.addr:focus-within { border-color: var(--night); box-shadow: 0 0 0 3px rgba(232,163,23,.35); }
.addr input[type=text] { border: 0; border-radius: 0; flex: 1; min-width: 6ch; }
.addr input[type=text]:focus { box-shadow: none; }
.addr-part { display: flex; align-items: center; padding: 0 12px; color: var(--muted); background: #FAFBFD; white-space: nowrap; }
.addr-part:first-child { border-right: 1px solid var(--rule-soft); }
.addr-part:last-child { border-left: 1px solid var(--rule-soft); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.badge { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--lamp); color: var(--night); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.requests { margin-top: 0; margin-bottom: 40px; }
.request-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.request { background: var(--surface); border: 1px solid var(--rule-soft); border-left: 4px solid var(--lamp); border-radius: var(--radius); padding: 16px 20px; }
.request-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.request-head strong { font-size: 17px; }
.request-note { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.request-approve { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto; gap: 12px; align-items: end; margin-top: 14px; }
.request-approve label { font-size: 14px; }
.request-approve.with-db { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr) auto; }
.request-decline { margin-top: 8px; }
.request-decline > summary { font-size: 14px; color: var(--red); }
.request-decline form.stack { max-width: 480px; }
.request > form { margin: 8px 0 0; }
.request .linkbutton { color: var(--blue); font-size: 14px; }
.request .linkbutton:hover { color: var(--night); }
.list-title { padding-bottom: 8px; border-bottom: 1px solid var(--rule); margin-bottom: 16px; }
.steps-list { padding-left: 20px; margin: 0 0 16px; max-width: 72ch; }
.steps-list li { margin-bottom: 10px; }
.steps-list code, .page-head code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 820px) {
  .two, .request-approve, .request-approve.with-db { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .addr-part:first-child { display: none; }
  .addr-part { padding: 0 8px; font-size: 14px; }
}
