
@font-face { font-family: "IBM Plex Sans"; font-weight: 100 700; font-display: swap; src: url(/fonts/ibm-plex-sans-latin.056e4e2459.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 100 700; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-ext.ae1d854fef.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 400 900; font-display: swap; src: url(/fonts/schibsted-grotesk-latin.e3b56e9051.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 400 900; font-display: swap; src: url(/fonts/schibsted-grotesk-latin-ext.f5df746dbc.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f6f3ee;
  --bg-raise: #ece8e1;
  --card: #fbf9f6;
  --line: #dcd6cc;
  --text: #16181d;
  --muted: #55524c;
  --faint: #6b655f;
  --accent: #2446c4;
  --accent-hi: #1b3799;
  --sun: #ffd23f;
  --live: #1f9a4f;
  --danger: #b42318;
  --ink: #16181d;
  --on-ink: #f3f1ec;
  --display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 60rem; margin-inline: auto; padding-inline: 1.25rem; }

/* Header */
.top { border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.brand { display: flex; align-items: baseline; gap: 0.625rem; text-decoration: none; }
.brand { white-space: nowrap; }
.brand strong { font-family: var(--display); font-weight: 700; font-size: 1.1875rem; letter-spacing: -0.03em; }
.brand span { font-size: 0.875rem; color: var(--faint); }
.top-actions { display: flex; align-items: center; gap: 1rem; font-size: 0.9375rem; color: var(--muted); }
.top-actions a { text-decoration: none; }
.top-actions a:hover { color: var(--text); }

main { padding-block: 2.5rem 4rem; }
@media (max-width: 600px) {
  .top-name, .brand span { display: none; }
}

/* Type */
.page-title { font-size: clamp(1.75rem, 4vw, 2.25rem); margin-bottom: 0.375rem; }
.sub { color: var(--muted); }
.section-title { font-size: 1.25rem; margin-bottom: 1rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 0.875rem; }
/* Read out by screen readers, not shown */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.page-lead { margin-bottom: 2rem; }
.after-form { margin-top: 1.5rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 1.5rem; }
.section-gap { margin-top: 3rem; }
.head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }

/* Cards and layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; }
.stack > * + * { margin-top: 1.5rem; }
.grid-2 { display: grid; gap: 1.5rem; }
@media (min-width: 800px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  border: 0;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.btn:hover { background: var(--accent-hi); }
.btn-quiet { background: transparent; color: var(--muted); padding-inline: 0; }
.btn-quiet:hover { background: transparent; color: var(--text); }
.btn-small { padding: 0.45rem 0.75rem; font-size: 0.875rem; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }

/* Forms */
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.3rem; }
.field label { font-size: 0.875rem; font-weight: 500; }
.field .hint { font-size: 0.8125rem; color: var(--faint); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], textarea, select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 1rem;
}
textarea { resize: vertical; min-height: 6rem; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36, 70, 196, 0.15); }
.row { display: grid; gap: 1.1rem; }
@media (min-width: 640px) { .row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Notices */
.notice { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1.5rem; font-size: 0.9375rem; }
.notice-ok { background: #e6f4ea; color: #14532d; }
.notice-error { background: #fdecea; color: var(--danger); }
.notice-warn { background: #fff4cc; color: #6b5200; }
.notice-warn a { color: inherit; font-weight: 600; }

/* Auth pages */
.auth { max-width: 26rem; margin: 3rem auto 0; }
.auth .page-title { margin-bottom: 0.5rem; }
.auth .sub { margin-bottom: 1.75rem; }

/* Stage tracker, mirrors "How it works" on the main site */
.stages { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.stage { position: relative; padding-top: 1rem; font-size: 0.875rem; color: var(--faint); }
.stage::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--line); }
.stage-num { display: block; font-family: var(--display); font-weight: 700; font-size: 0.75rem; }
.stage-name { font-family: var(--display); font-weight: 600; font-size: 0.9375rem; }
.stage.is-done { color: var(--muted); }
.stage.is-done::before { background: var(--ink); }
.stage.is-current { color: var(--text); }
.stage.is-current::before { background: var(--accent); }
.stage.is-current .stage-num { color: var(--accent); }
.live-note { margin-top: 1.25rem; color: var(--live); font-family: var(--display); font-weight: 600; }

.facts { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.facts dt { font-size: 0.8125rem; color: var(--faint); }
.facts dd { margin: 0.1rem 0 0; font-weight: 500; }
.status-note { margin-top: 1.25rem; padding: 0.875rem 1rem; background: var(--bg-raise); border-radius: 6px; }

/* Revisions */
.list { list-style: none; padding: 0; }
.list > li { padding-block: 1rem; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.rev-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 0.35rem; }
.rev-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.tag { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 0.75rem; font-weight: 600; font-family: var(--display); }
.tag-open { background: var(--bg-raise); color: var(--muted); }
.tag-in_progress { background: #e3e9fb; color: var(--accent); }
.tag-done { background: #e6f4ea; color: #14532d; }
.tag-out_of_scope { background: #fff4cc; color: #6b5200; }
.rev-status { display: flex; align-items: center; gap: 0.75rem; }
.rev-delete { font-size: 0.8125rem; color: var(--muted); }
.rev-delete:hover { color: var(--danger); }
.rev-status-form { display: flex; gap: 0.5rem; align-items: center; }
.rev-status-form select { width: auto; padding: 0.35rem 0.5rem; font-size: 0.875rem; }

/* Messages */
.thread-empty { margin-bottom: 1.25rem; }
.thread-wrap { position: relative; margin-bottom: 1.25rem; }
.thread-latest {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 4px 12px -6px rgba(22, 24, 29, 0.35);
  cursor: pointer;
  transition: border-color 150ms ease;
}
.thread-latest:hover { border-color: var(--accent); color: var(--accent); }
.thread-latest svg { width: 1rem; height: 1rem; }
.thread-latest[hidden] { display: none; }
[hidden] { display: none !important; }
/* Fixed-height thread that scrolls; column-reverse keeps it pinned to the latest message */
.thread {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.875rem;
  max-height: 22rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.25rem 0.5rem 0.25rem 0;
  border-bottom: 1px solid var(--line);
}
.thread:focus-visible { outline-offset: 4px; }
.msg { max-width: 85%; }
.msg-mine { align-self: flex-end; text-align: right; }
.msg-meta { font-size: 0.8125rem; color: var(--faint); margin-bottom: 0.2rem; }
.msg-body { display: inline-block; padding: 0.6rem 0.85rem; border-radius: 10px; background: var(--bg-raise); text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-mine .msg-body { background: var(--accent); color: #fff; }

/* Admin tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th { text-align: left; font-weight: 500; font-size: 0.8125rem; color: var(--faint); padding: 0 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line); }
.table td { padding: 0.75rem 0.75rem 0.75rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.flags { display: flex; flex-direction: column; gap: 0.2rem; }
.flag { color: var(--accent); font-weight: 600; font-size: 0.875rem; }

/* Breadcrumb */
.breadcrumb { margin-bottom: 1rem; font-size: 0.875rem; color: var(--faint); }
.breadcrumb ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.breadcrumb li + li::before { content: "›"; margin-right: 0.35rem; }
.breadcrumb a { text-decoration: none; color: var(--muted); }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 0.2em; }

/* Project cards */
.cards { display: grid; gap: 1.25rem; }
@media (min-width: 800px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.project-card { display: block; text-decoration: none; transition: border-color 150ms ease, box-shadow 150ms ease; }
.project-card:hover { border-color: var(--accent); box-shadow: 0 6px 18px -12px rgba(22, 24, 29, 0.35); }
.project-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
.project-card-head .section-title { margin-bottom: 1rem; }
.project-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--muted); }
.project-card-open { margin-left: auto; color: var(--accent); font-weight: 600; font-family: var(--display); }

/* Billing (admin only) */
.section-title .faint { margin-left: 0.5rem; font-family: var(--sans); font-weight: 400; letter-spacing: 0; }
.billing-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1.5rem; }
@media (min-width: 700px) { .billing-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.billing-summary > div { padding: 0.875rem 1rem; border-radius: 6px; background: var(--bg-raise); }
.billing-summary dt { font-size: 0.8125rem; color: var(--faint); }
.billing-summary dd { margin: 0.15rem 0 0; font-family: var(--display); font-weight: 600; font-size: 1.25rem; }
.billing-summary .is-owed dd { color: var(--accent); }
.billing-sub { font-size: 1rem; }
.billing-forms { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.billing-payments { margin-top: 1.5rem; }
.totals { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-top: 0.35rem; color: var(--muted); }
.totals strong { color: var(--text); font-weight: 600; }

/* Project tabs */
.tabs { display: flex; gap: 1.5rem; margin: -0.75rem 0 2rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: 0.5rem 0 0.75rem; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 0.9375rem; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.billing-head { margin-bottom: 1rem; align-items: baseline; }
.billing-head .section-title { margin-bottom: 0; }

/* Statement (invoice style) */
.statement { max-width: 46rem; margin-inline: auto; padding: clamp(1.5rem, 4vw, 2.75rem); background: #fff; }
.statement-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; padding-bottom: 1.75rem; border-bottom: 2px solid var(--ink); }
.statement-from { display: grid; gap: 0.1rem; color: var(--muted); font-size: 0.9375rem; }
.statement-from strong { color: var(--text); font-family: var(--display); font-size: 1.25rem; letter-spacing: -0.02em; }
.statement-title { text-align: right; }
.statement-title h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.statement-title dl { display: grid; gap: 0.15rem; font-size: 0.9375rem; }
.statement-title dl div { display: flex; justify-content: flex-end; gap: 0.75rem; }
.statement-title dt { color: var(--faint); }
.statement-title dd { margin: 0; }
.statement-billto { padding-block: 1.5rem; }
.statement-billto h2 { font-size: 0.75rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-bottom: 0.4rem; }
.statement-billto p { display: grid; gap: 0.1rem; }
.statement-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.statement-table th { text-align: left; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); padding: 0 0 0.6rem; border-bottom: 1px solid var(--line); }
.statement-table td { padding: 0.85rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.statement-table td + td, .statement-table th + th { padding-left: 1rem; }
.statement-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.statement-payment td { color: var(--muted); }
.statement-table td:nth-child(2) { white-space: nowrap; }
.statement-totals { display: grid; gap: 0.4rem; width: min(100%, 18rem); margin: 1.25rem 0 0 auto; font-variant-numeric: tabular-nums; }
.statement-totals div { display: flex; justify-content: space-between; gap: 1rem; }
.statement-totals dt { color: var(--muted); }
.statement-totals dd { margin: 0; }
.statement-due { margin-top: 0.35rem; padding-top: 0.6rem; border-top: 2px solid var(--ink); font-family: var(--display); font-weight: 700; font-size: 1.125rem; }
.statement-due dt { color: var(--text); }
/* The display font makes tabular figures space the decimal point like a digit */
.statement-due dd { font-variant-numeric: normal; }
.statement-monthly { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.75rem; padding: 0.875rem 1rem; border-radius: 6px; background: var(--bg-raise); font-variant-numeric: tabular-nums; }
.statement-monthly span { color: var(--muted); }
.statement-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .statement-title { text-align: left; } .statement-title dl div { justify-content: flex-start; } }

/* Printing a statement: just the paper */
@media print {
  body { background: #fff; }
  .top, .breadcrumb, .tabs, .notice, .no-print { display: none !important; }
  main { padding: 0; }
  .statement { max-width: none; border: 0; padding: 0; }
}

/* History and security */
.history { list-style: none; padding: 0; font-size: 0.9375rem; }
.history li { display: grid; gap: 0.1rem; padding-block: 0.65rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.history li:first-child { border-top: 0; padding-top: 0; }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-bottom: 1.25rem; }
.qr { display: block; width: 14rem; height: 14rem; margin: 0.5rem 0 1rem; }
.totp-key { display: inline-block; padding: 0.35rem 0.6rem; border: 1px dashed var(--line); border-radius: 6px; background: #fff; font-family: ui-monospace, Menlo, monospace; font-size: 0.9375rem; letter-spacing: 0.04em; user-select: all; overflow-wrap: anywhere; }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 0.5rem 2rem; margin: 1rem 0 1.5rem; padding: 1rem 1.25rem; border: 1px dashed var(--line); border-radius: 6px; background: #fff; font-family: ui-monospace, Menlo, monospace; font-size: 1rem; list-style: none; }
.steps-list { padding-left: 1.25rem; display: grid; gap: 0.35rem; margin-bottom: 1.25rem; }
.setup-lead { max-width: 40rem; margin-bottom: 1.25rem; }

/* Client summary on the admin client page */
.client-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; color: var(--muted); }

.invite-link { display: block; padding: 0.75rem; border: 1px dashed var(--line); border-radius: 6px; background: #fff; font-family: ui-monospace, Menlo, monospace; font-size: 0.875rem; overflow-wrap: anywhere; user-select: all; }
.empty { padding: 1.5rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }
