/* Rebuildy console.
   The screenshots carry the colour, so the page itself stays white, black and one blue.
   Blue always means "this is a link". Green, amber and red only ever mark a state. */

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

:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #14161b;
  --ink-2: #4b505b;
  --well: #eef0f3;
  --line: #d6d9df;
  --link: #1a3fd0;
  --ok: #17753f;
  --warn: #8f5200;
  --bad: #bd2617;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

.quiet { color: var(--ink-2); }
.nowrap { white-space: nowrap; }

/* An outside link. The arrow says it opens in a new tab. */
.out::after { content: "\2197"; display: inline-block; margin-left: 3px; font-size: 0.85em; text-decoration: none; }

/* ------------------------------------------------------------------ top */

.top {
  display: flex;
  align-items: baseline;
  gap: 22px;
  padding: 14px var(--gutter) 12px;
  border-bottom: 2px solid var(--ink);
}

.mark {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.top nav { display: flex; gap: 18px; min-width: 0; }

.top nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 3px solid transparent;
}

.top nav a:hover { border-bottom-color: var(--line); }
.top nav a[aria-current="page"] { font-weight: 700; border-bottom-color: var(--ink); }

.top .busy { margin-left: auto; font-size: 14px; }
.top .signout { margin-left: auto; }
.top .busy + .signout { margin-left: 0; }

.linklike {
  font: inherit;
  font-size: 14px;
  color: var(--ink-2);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.linklike:hover { color: var(--ink); }

.foot { padding: 28px var(--gutter) 40px; font-size: 14px; color: var(--ink-2); display: none; }

/* ------------------------------------------------------------------ page */

.page { max-width: 1360px; margin: 0 auto; padding: 26px var(--gutter) 64px; }

.lede { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; max-width: 46ch; }
.lede span { color: var(--ink-2); font-weight: 400; }
.sub { margin-top: 8px; color: var(--ink-2); max-width: 62ch; }

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin: 22px 0 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.picks { display: flex; flex-wrap: wrap; gap: 6px 20px; }

.picks a { color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 3px solid transparent; white-space: nowrap; }
.picks a:hover { border-bottom-color: var(--line); }
.picks a[aria-current="true"] { font-weight: 700; border-bottom-color: var(--ink); }
.picks a small { font-size: 0.85em; color: var(--ink-2); font-weight: 400; margin-left: 2px; }

.bar .right { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }

.find { display: flex; gap: 6px; }

/* ------------------------------------------------------------------ controls */

input[type="text"], input[type="search"], input[type="password"], input:not([type]), select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #8d929c;
  border-radius: 3px;
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
}

textarea { resize: vertical; line-height: 1.4; }
select { width: auto; padding-right: 6px; }

label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 3px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 700;
  line-height: 1.1;
  min-height: 40px;
  padding: 8px 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { background: var(--well); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.solid { background: var(--ink); color: #fff; }
.btn.solid:hover { background: #2d3038; }
.btn.small { min-height: 34px; padding: 5px 10px; font-size: 14px; }
.btn.plain { border-color: transparent; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; padding-left: 6px; padding-right: 6px; }

.btn[aria-pressed="true"] { color: #fff; }
.btn.yes[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); }
.btn.wait[aria-pressed="true"] { background: var(--warn); border-color: var(--warn); }
.btn.no[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); }

/* ------------------------------------------------------------------ state */

.state { display: flex; align-items: baseline; gap: 8px; font-weight: 700; }
.state::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-2); transform: translateY(-1px); }
.state.todo::before { background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); }
.state.ok { color: var(--ok); }
.state.ok::before { background: var(--ok); }
.state.warn { color: var(--warn); }
.state.warn::before { background: var(--warn); }
.state.hold { color: var(--warn); }
.state.hold::before { background: var(--warn); }
.state.bad { color: var(--bad); }
.state.bad::before { background: var(--bad); }

.word-pass, .word-ok, .word-approved, .word-done { color: var(--ok); }
.word-warn, .word-hold, .word-stopped, .word-stopping { color: var(--warn); }
.word-fail, .word-failed { color: var(--bad); }

/* ------------------------------------------------------------------ pairs (the Sites page) */

.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 0 44px; }

.pair { padding: 26px 0 24px; border-bottom: 1px solid var(--line); min-width: 0; }

.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }

.shot {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--well);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  cursor: zoom-in;
}

.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.shot.none { display: grid; place-items: center; color: var(--ink-2); font-size: 14px; cursor: default; }

.duo figcaption { margin-top: 7px; line-height: 1.3; min-width: 0; }
.duo figcaption a { font-weight: 700; display: inline-block; padding: 3px 0; }
.duo figcaption .where { display: block; font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pair h2 { margin-top: 14px; font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.pair h2 a { color: var(--ink); text-decoration: none; }
.pair h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.pair .meta { margin-top: 3px; color: var(--ink-2); font-size: 15px; }
.pair .foot-row { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.pair .foot-row .state { margin-right: auto; }
.pair .foot-row a { white-space: nowrap; }

/* ------------------------------------------------------------------ rows (list view, queue, leads, jobs) */

.rows { border-top: 0; }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 6px 28px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.row h2 { font-size: 17px; line-height: 1.25; font-weight: 700; }
.row h2 a { color: var(--ink); text-decoration: none; }
.row h2 a:hover { text-decoration: underline; }
.row .meta { color: var(--ink-2); font-size: 14.5px; }
.row .links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.row .links a { white-space: nowrap; font-weight: 700; }
.row .where { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.row .act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }

.row.with-thumb { grid-template-columns: 132px minmax(0, 1.5fr) minmax(0, 1.2fr) auto; }
.row.with-thumb .shot { aspect-ratio: 16 / 10; }

.empty { padding: 40px 0; color: var(--ink-2); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; }

.facts { margin-top: 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; max-width: 70ch; }

table.plain { border-collapse: collapse; width: 100%; font-size: 15px; }
table.plain th { text-align: left; font-weight: 400; color: var(--ink-2); padding: 6px 12px 6px 0; border-bottom: 1px solid var(--ink); }
table.plain td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plain .num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; }

.cols { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.cols h2 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.cols aside section + section { margin-top: 30px; }

.meter { height: 8px; background: var(--well); margin: 8px 0; }
.meter span { display: block; height: 100%; background: var(--ink); }

details > summary { cursor: pointer; }
details.fold > summary { color: var(--link); text-decoration: underline; text-underline-offset: 3px; list-style: none; padding: 4px 0; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary { color: var(--ink-2); }

.errtext { color: var(--bad); font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; margin-top: 4px; }

/* ------------------------------------------------------------------ one site */

.site-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 32px;
  align-items: end;
  padding: 18px var(--gutter) 14px;
  border-bottom: 1px solid var(--line);
}

.site-head .back { font-size: 14px; color: var(--ink-2); }
.site-head h1 { font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; margin-top: 4px; }
.site-head .meta { color: var(--ink-2); margin-top: 3px; }

.steps { display: flex; align-items: center; gap: 8px; }
.steps .count { color: var(--ink-2); margin-right: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* The two links Sam asked for. Same place on every site. */
.twolinks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; margin-top: 6px; }

.sitelink {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 9px 14px 10px;
  border: 1.5px solid var(--link);
  border-radius: 3px;
  text-decoration: none;
  color: var(--link);
}

.sitelink:hover { background: #eef2ff; }
.sitelink b { font-weight: 700; }
.sitelink span { font-size: 14px; line-height: 1.25; color: var(--ink-2); overflow-wrap: anywhere; }
.sitelink.new { background: var(--link); color: #fff; }
.sitelink.new span { color: #dbe3ff; }
.sitelink.new:hover { background: #12319f; }
.twolinks .others { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-left: 10px; }

.site-body { display: grid; grid-template-columns: minmax(0, 1fr) 400px; align-items: start; }

.stage { min-width: 0; border-right: 1px solid var(--line); }

.stage-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 8px var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.stage-bar .picks button {
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 6px 0;
  cursor: pointer;
  white-space: nowrap;
}

.stage-bar .picks button:hover { border-bottom-color: var(--line); }
.stage-bar .picks button[aria-selected="true"] { font-weight: 700; border-bottom-color: var(--ink); }
.stage-bar .tools { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.stage-bar .tools select { max-width: 220px; min-height: 34px; padding: 4px 6px; font-size: 14px; }
.stage-bar .tools[hidden] { display: none; }

.pane { display: none; }
.pane.on { display: block; }

.board { padding: 18px var(--gutter) 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 18px; }
.board h2 { font-size: 16px; font-weight: 700; }
.board h2 span { font-weight: 400; color: var(--ink-2); }
.board .shot { aspect-ratio: auto; }
.board .shot img { height: auto; object-fit: contain; }
.board .phone { max-width: 250px; }
.board .rowlabel { grid-column: 1 / -1; font-size: 14px; color: var(--ink-2); }
.board .desk-row { order: 1; }
.board .phone-row { order: 2; }
.board .rowlabel.phone-row { margin-top: 14px; }
.board figure h2 { margin-bottom: 6px; }

.frame-shell { background: var(--well); height: calc(100vh - 52px); min-height: 520px; display: flex; justify-content: center; }
.frame-shell iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.frame-shell.phone { padding: 18px 0; }
.frame-shell.phone iframe { width: 390px; max-width: 100%; border: 1px solid var(--line); }

.sheets { background: var(--well); padding: 18px var(--gutter) 40px; display: grid; gap: 18px; justify-items: center; }
.sheets .shot { aspect-ratio: auto; max-width: 820px; background: #fff; }
.sheets .shot img { height: auto; object-fit: contain; }

.letter-note { padding: 12px var(--gutter); display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; border-bottom: 1px solid var(--line); }

.rail { padding: 0 20px 60px; min-width: 0; }
.rail section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.rail section:last-child { border-bottom: 0; }
.rail h2 { font-size: 17px; font-weight: 700; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rail h2 small { font-size: 14px; font-weight: 400; color: var(--ink-2); }

.decide { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px 10px; align-items: center; }
.decide .what { font-weight: 700; }
.decide .choices { display: flex; flex-wrap: wrap; gap: 6px; }
.decide .choices .btn { flex: 1 1 auto; }
.rail .state { margin-bottom: 14px; }

.checks li { padding: 7px 0; border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; padding-top: 0; }
.checks summary { display: flex; justify-content: space-between; gap: 12px; list-style: none; }
.checks summary::-webkit-details-marker { display: none; }
.checks summary b { font-weight: 700; white-space: nowrap; }
.checks .detail { margin-top: 6px; font-size: 14.5px; color: var(--ink-2); }
.checks .detail ul { list-style: disc; padding-left: 18px; margin: 4px 0 8px; }
.checks .detail li { border: 0; padding: 2px 0; overflow-wrap: anywhere; }
.checks .detail strong { color: var(--ink); }

.notes { list-style: disc; padding-left: 18px; font-size: 15px; }
.notes li { padding: 3px 0; overflow-wrap: anywhere; }
.notes li.hard { color: var(--bad); }

.addr-compare { font-size: 15px; margin-bottom: 12px; display: grid; gap: 4px; }
.addr-compare span { color: var(--ink-2); }

.form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.form .wide { grid-column: 1 / -1; }

.again { display: flex; flex-wrap: wrap; gap: 6px; }
.again form { margin: 0; }

.history { font-size: 14.5px; color: var(--ink-2); }
.history li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }

.phonebar { display: none; }

/* ------------------------------------------------------------------ zoom + toast + sign in */

dialog.zoom { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; overflow: auto; }
dialog.zoom::backdrop { background: rgba(10, 12, 16, 0.8); }
dialog.zoom img { max-width: 96vw; height: auto; cursor: zoom-out; background: #fff; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 60;
  max-width: calc(100vw - 32px);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); }

.signin { max-width: 380px; margin: 0 auto; padding: 14vh var(--gutter) 40px; }
.signin .mark { font-size: 30px; display: inline-block; margin-bottom: 26px; }
.signin form { display: grid; gap: 10px; }
.signin .wrong { color: var(--bad); font-weight: 700; margin-bottom: 10px; }

/* ------------------------------------------------------------------ phone */

@media (max-width: 980px) {
  .site-body { grid-template-columns: minmax(0, 1fr); }
  .stage { border-right: 0; }
  .rail { padding: 0 var(--gutter) 90px; border-top: 2px solid var(--ink); }
  .frame-shell { height: 78vh; }
  .cols { grid-template-columns: minmax(0, 1fr); gap: 34px; }
}

@media (max-width: 700px) {
  .top { gap: 16px; padding-top: 12px; }
  .top nav { gap: 14px; }
  .top .signout { display: none; }
  .foot { display: block; }

  .page { padding-top: 20px; }
  .lede { font-size: 23px; }
  .bar .right { margin-left: 0; width: 100%; flex-wrap: nowrap; }
  .bar .right .picks { order: 2; margin: 0; padding: 0; overflow: visible; gap: 14px; }
  .find { flex: 1 1 auto; min-width: 0; }
  .find .btn { display: none; }
  .picks { flex-wrap: nowrap; overflow-x: auto; gap: 18px; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); scrollbar-width: none; }

  .pair { padding: 22px 0 20px; }
  .duo { gap: 8px; }
  .duo figcaption a { padding: 11px 0; }
  .pair .foot-row a { padding: 10px 0; }
  .pair h2 { font-size: 20px; }

  .row, .row.with-thumb { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .row.with-thumb { grid-template-columns: 96px minmax(0, 1fr); column-gap: 12px; }
  .row.with-thumb > .shot { grid-row: span 3; }
  .row.with-thumb > :not(.shot) { grid-column: 2; }
  .row .act { justify-content: flex-start; }
  .row .links a { padding: 6px 0; }

  .site-head { grid-template-columns: minmax(0, 1fr); padding-top: 14px; }
  .site-head h1 { font-size: 23px; }
  .site-head .steps { display: none; }
  .twolinks { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .twolinks .others { grid-column: 1 / -1; margin-left: 0; }
  .twolinks .others a { padding: 6px 0; }

  .stage-bar { gap: 4px 16px; }
  .stage-bar .tools { margin-left: 0; width: 100%; }
  .stage-bar .tools [data-vp] { display: none; }
  .stage-bar .tools select { flex: 1 1 auto; max-width: none; }
  .board { gap: 10px 8px; padding-top: 14px; }
  .board .phone { max-width: none; }
  .board .phone-row { order: 1; }
  .board .desk-row { order: 2; }
  .board .rowlabel.phone-row { margin-top: 0; }
  .board .rowlabel.desk-row { margin-top: 14px; }
  .shot { aspect-ratio: 3 / 4; }
  .board .shot { aspect-ratio: auto; }
  .row.with-thumb .shot { aspect-ratio: 3 / 4; }
  .frame-shell.phone { padding: 0; }

  .toast { bottom: 84px; }
  .sheets { padding: 10px 8px 30px; gap: 10px; }

  .phonebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 8px;
    padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 2px solid var(--ink);
  }

  .phonebar .btn[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }
}
