/* Marlowe TaaS portal. Colors are tokens on :root, redefined for dark. */
:root {
  color-scheme: light;
  --surface-0: #f6f6f4;
  --surface-1: #ffffff;
  --surface-2: #f0efec;
  --border: #e4e3de;
  --text-primary: #111110;
  --text-secondary: #55544f;
  --text-muted: #7a7972;
  --brand: #292929;
  --brand-ink: #c5f467;
  --accent: #3b5bdb;
  --accent-soft: #e8edff;
  --series-1: #3b5bdb;
  --series-2: #e8590c;
  --series-3: #12a37a;
  --warning-bg: #fff4d6;
  --warning-ink: #6b4a00;
  --critical-ink: #c02626;
  --critical-soft: #fdecec;
  --good-ink: #0d6b2f;
  --good-soft: #e5f6ea;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 2px 8px rgb(0 0 0 / 0.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-0: #0f1012;
    --surface-1: #17181b;
    --surface-2: #1f2024;
    --border: #2c2d32;
    --text-primary: #f1f0ee;
    --text-secondary: #c2c1bb;
    --text-muted: #94938c;
    --brand: #292929;
    --brand-ink: #c5f467;
    --accent: #7b93f5;
    --accent-soft: #1d2440;
    --series-1: #7b93f5;
    --series-2: #f07a3a;
    --series-3: #2fbf93;
    --warning-bg: #3a2e0c;
    --warning-ink: #f2d38a;
    --critical-ink: #f08a8a;
    --critical-soft: #3a1717;
    --good-ink: #7fd49b;
    --good-soft: #13301f;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #0f1012;
  --surface-1: #17181b;
  --surface-2: #1f2024;
  --border: #2c2d32;
  --text-primary: #f1f0ee;
  --text-secondary: #c2c1bb;
  --text-muted: #94938c;
  --brand: #292929;
  --brand-ink: #c5f467;
  --accent: #7b93f5;
  --accent-soft: #1d2440;
  --series-1: #7b93f5;
  --series-2: #f07a3a;
  --series-3: #2fbf93;
  --warning-bg: #3a2e0c;
  --warning-ink: #f2d38a;
  --critical-ink: #f08a8a;
  --critical-soft: #3a1717;
  --good-ink: #7fd49b;
  --good-soft: #13301f;
  --shadow: none;
}

* { box-sizing: border-box; }
/* `hidden` must win over a class's display, such as the operator-only tenant picker's grid. */
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1 { font-size: 22px; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 600; }
h3 { margin: 14px 0 6px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.error { color: var(--critical-ink); }
code { font: 12px ui-monospace, "SF Mono", Menlo, monospace; }

.banner {
  padding: 8px 20px; background: var(--warning-bg); color: var(--warning-ink);
  border-bottom: 1px solid var(--border); font-size: 13px; text-align: center;
}

/* Shell: left navigation and content. */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 18px 14px; background: var(--surface-1); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text-primary); padding: 0 6px; }
.brand:hover { text-decoration: none; }
/* The Marlowe logotype, from the brand kit: the mark green, the wordmark the text colour. */
.brand .logotype { height: 26px; width: auto; flex: none; display: block; }
/* Only the mark sits on a black tile, as on the tab icon; the wordmark is the text colour. */
.brand .logotype .tile { fill: #000000; }
.brand .logotype .mark { fill: #82ce7e; }
.brand .logotype .word { fill: currentColor; }
.brand .name { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }
.brand .product {
  font-size: 11px; font-weight: 600; color: var(--text-secondary); border: 1px solid var(--border);
  border-radius: 999px; padding: 0 7px;
}
.picker { display: grid; gap: 4px; padding: 0 6px; }
.picker label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px;
  color: var(--text-secondary); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text-primary); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav svg { width: 16px; height: 16px; flex: none; }
.nav .section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 12px 10px 4px; }
.who { margin-top: auto; padding: 10px 6px 0; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.who .email { font-weight: 500; overflow-wrap: anywhere; }
.who .row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }

.content { min-width: 0; padding: 26px 32px 64px; max-width: 1180px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.page > .wide { grid-column: 1 / -1; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
  .content { padding: 18px 16px 48px; }
  .page { grid-template-columns: 1fr; }
}

section {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; min-width: 0; box-shadow: var(--shadow);
}
.source { margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.unavailable {
  border: 1px dashed var(--border); border-radius: 8px; padding: 12px;
  color: var(--text-secondary);
}
.unavailable strong { color: var(--text-primary); }

/* Controls. */
button, .button, input, select {
  font: inherit; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface-1); color: var(--text-primary); padding: 7px 11px;
}
button, .button { cursor: pointer; font-weight: 500; }
button:hover { background: var(--surface-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); background: var(--accent); }
button.danger { color: var(--critical-ink); }
button.small { padding: 3px 9px; font-size: 12px; }
button:disabled { opacity: 0.5; cursor: default; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
form.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
form.inline label { display: grid; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.actions { display: flex; gap: 6px; justify-content: flex-end; }

.secret {
  margin-top: 14px; border: 1px solid var(--accent); background: var(--accent-soft);
  border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px;
}
.secret code { font-size: 13px; overflow-wrap: anywhere; color: var(--text-primary); }
.secret .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.notice { margin-top: 10px; padding: 8px 12px; border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
.notice.bad { background: var(--critical-soft); color: var(--critical-ink); }
.notice.good { background: var(--good-soft); color: var(--good-ink); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.tile { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.tile .label { font-size: 12px; color: var(--text-secondary); }
.tile .value { font-size: 22px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.tile.hero .value { font-size: 28px; font-weight: 650; }
.meter {
  display: flex; height: 10px; margin: 14px 0 6px; border-radius: 5px; overflow: hidden;
  background: var(--border); gap: 2px;
}
.meter span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-secondary); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.note { font-size: 12px; color: var(--text-secondary); margin: 10px 0 0; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-weight: 500; color: var(--text-secondary); font-size: 12px; }
th:first-child, td:first-child { text-align: left; }
td.text, th.text { text-align: left; white-space: normal; }
tr.off td { color: var(--text-muted); }
.scroll { overflow-x: auto; }

.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--text-muted); font-size: 11px; }
.tooltip {
  position: fixed; pointer-events: none; z-index: 10; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.15); font-variant-numeric: tabular-nums;
}

.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.checks li { display: flex; gap: 8px; align-items: baseline; }
.checks .mark { font-weight: 600; width: 64px; flex: none; font-size: 12px; }
.checks .pass { color: var(--good-ink); }
.checks .open { color: var(--text-secondary); }
.statement-status { margin: 10px 0 0; }
.statement-steps { margin-top: 14px; }
.statement-steps summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.statement-steps[open] summary { margin-bottom: 8px; }
.pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--border); color: var(--text-secondary);
}
.pill.good { color: var(--good-ink); background: var(--good-soft); border-color: transparent; }
.pill.bad { color: var(--critical-ink); background: var(--critical-soft); border-color: transparent; }
.pill.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

/* Sign-in. */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login {
  width: 100%; max-width: 400px; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 14px;
}
.login .providers { display: grid; gap: 8px; }
.login .providers a {
  display: block; text-align: center; padding: 10px; border-radius: 8px; border: 1px solid var(--border);
  color: var(--text-primary); font-weight: 500;
}
.login .providers a:hover { background: var(--surface-2); text-decoration: none; }
.login .divider { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.login .invite { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; }

/* Pricing: the billing rules. */
.rules { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.rules strong { color: var(--text-primary); }
.tip { border-bottom: 1px dotted currentColor; cursor: help; }
details.about { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
details.about > summary { cursor: pointer; width: max-content; }
details.about > .note:first-of-type, details.about > .source:first-of-type { margin-top: 6px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: flex-end; }
