/* UGCLY: one stylesheet for every screen.
   Style: "framed sheet" (dealt by the taste skill, seed 976538877). A tinted frame holds the navigation;
   the work sits on a white sheet with a 1px edge and no shadow. Colour goes on data (scores, the match bar),
   on status pills and on nothing else. The one hue is a zellige green, from the tiles of Fes. */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(/static/fonts/ibm-plex-sans-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(/static/fonts/ibm-plex-sans-500.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(/static/fonts/ibm-plex-sans-600.woff2) format("woff2"); }
/* mono: promo codes, tracking links and IDs only (the sheet allows one job) taste-skill-ignore */
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(/static/fonts/ibm-plex-mono-400.woff2) format("woff2"); } /* taste-skill-ignore */
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(/static/fonts/ibm-plex-mono-500.woff2) format("woff2"); } /* taste-skill-ignore */

:root {
  --ground: #f4f7f6;     /* the frame: one low-chroma step of zellige green */
  --surface: #ffffff;    /* the sheet and its panels */
  --raised: #f2f5f4;     /* a filled well inside the sheet */
  --active: #e6ebe9;     /* the active nav pill */
  --border: #e6e9e8;
  --rule: #eff1f0;
  --control: #cdd1cf;
  --text: #131416;
  --muted: #5b5f5e;
  --faint: #676b6a;
  --primary: #131416; --primary-ink: #ffffff;
  --accent: #17705a;     /* zellige green: data, focus, the selected thing */
  --accent-2: #5fa892;   /* lighter steps of the same hue for the match bar */
  --accent-3: #b4d8cc;
  --positive: #1e7b4f; --negative: #c4242a; --warning: #92400e;
  --pill-positive-bg: #dcfae5; --pill-positive-ink: #04250e;
  --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fffbeb;  --pill-warning-ink: #92400e;
  --pill-neutral-bg: #ebedec;  --pill-neutral-ink: #353736;
  --pill-accent-bg: #e1f1eb;   --pill-accent-ink: #0d4a3b;

  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace; /* taste-skill-ignore */
  --fs-title: 22px; --fs-section: 16px; --fs-kpi: 28px; --fs-body: 14px; --fs-small: 13px;

  --sidebar-width: 228px;
  --sheet-inset: 8px;
  --radius-sheet: 16px; --radius-card: 8px; --radius-control: 6px;
  --gap: 24px; --pad: 32px; --card-pad: 20px;
  --control-height: 32px; --field-height: 38px; --row-height: 48px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font: var(--fs-body)/20px var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, dl, dd, ul, ol { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
table, .n, .num, .kpi-value, .score { font-variant-numeric: tabular-nums; }
code, .code { font-family: var(--mono); font-size: 13px; background: var(--raised); padding: 1px 6px; border-radius: 4px; }
b, strong { font-weight: 600; }

/* ---------- the shell: tinted frame + white sheet ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100svh; }
.sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; padding: 16px 12px; }
.sheet { min-width: 0; margin: var(--sheet-inset) var(--sheet-inset) var(--sheet-inset) 0; background: var(--surface);
         border: 1px solid var(--border); border-radius: var(--radius-sheet); padding: 28px var(--pad) 64px; }

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 0; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand b { display: block; font-size: 15px; line-height: 18px; letter-spacing: 0.01em; }
.brand small { display: block; font-size: 12px; line-height: 16px; color: var(--muted); }

.nav { display: grid; gap: 2px; margin-top: 28px; }
.nav a { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 10px; border-radius: 8px;
         color: var(--muted); transition: background-color 150ms ease, color 150ms ease; }
.nav a:hover { background: var(--active); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--active); color: var(--text); font-weight: 500; }
.nav .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--text); color: #fff; font-size: 12px; line-height: 20px; text-align: center; font-weight: 500; }
.nav-label { margin: 24px 10px 6px; font-size: 12px; color: var(--muted); }
.sidebar .me { margin-top: auto; padding: 12px 10px 4px; display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.sidebar .me .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .me button { justify-self: start; }

.menu-btn, .nav-toggle { display: none; }

/* pages without a sidebar: the business portal, the creator form and the login */
.topbar { height: 56px; display: flex; align-items: center; justify-content: space-between; max-width: 1104px; margin: 0 auto; padding: 0 16px; }
.topbar .brand { padding: 0; }
.topbar .scope { color: var(--muted); font-size: 13px; }
.sheet.solo { max-width: 1088px; margin: 0 auto var(--sheet-inset); }
.sheet.narrow { max-width: 760px; }
.sheet.tiny { max-width: 420px; margin-top: 8vh; padding: 32px; }

/* ---------- title row ---------- */
h1 { font-size: var(--fs-title); line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
h1 .pill { vertical-align: 3px; margin-left: 6px; }
h2 { font-size: var(--fs-section); line-height: 22px; font-weight: 600; margin: 44px 0 12px; }
h3 { font-size: 14px; line-height: 20px; font-weight: 600; margin: 20px 0 8px; }
.sub { color: var(--muted); margin: 6px 0 24px; max-width: 80ch; }
.between { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.between .sub { margin-bottom: 0; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumb a { color: var(--muted); }
.finding { margin: 6px 0 0; color: var(--text); }
.finding b { font-weight: 600; }

/* ---------- KPIs: one container split by hairlines, label over value ---------- */
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--radius-card); }
.kpi { padding: 16px var(--card-pad); min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--border); }
.kpi-label { color: var(--muted); }
.kpi-value { margin-top: 4px; font-size: var(--fs-kpi); line-height: 34px; font-weight: 400; letter-spacing: -0.01em; white-space: nowrap; }
.kpi-value small { font-size: 15px; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-note { margin-top: 2px; font-size: var(--fs-small); color: var(--muted); }
.kpi a { color: inherit; }

/* ---------- layout helpers ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gap); align-items: start; }
.split > * { min-width: 0; }
.split h2:first-child, .rail h2:first-child { margin-top: 0; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); align-items: stretch; }
.row > * { min-width: 0; }
.stack > * + * { margin-top: 16px; }

/* ---------- panels ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad); min-width: 0; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head b { font-size: 15px; }
.well { background: var(--raised); border-radius: var(--radius-card); padding: 16px var(--card-pad); }
.note { background: var(--raised); border-radius: var(--radius-card); padding: 12px 16px; color: var(--text); }
.private { background: var(--raised); border: 0; }
.private-tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px;
               background: var(--pill-warning-bg); color: var(--pill-warning-ink); font-size: 12px; font-weight: 500; white-space: nowrap; vertical-align: 1px; }
.private-tag::before { content: ""; width: 10px; height: 11px; background: currentColor; flex: none;
  -webkit-mask: var(--lock) center / contain no-repeat; mask: var(--lock) center / contain no-repeat; }
:root {
  --hatch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Cpath d='M-1 1l2-2M0 4l4-4M3 5l2-2' stroke='%235fa892' stroke-width='1.4'/%3E%3C/svg%3E");
  --hatch-neg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Cpath d='M-1 1l2-2M0 4l4-4M3 5l2-2' stroke='%23c4242a' stroke-width='1'/%3E%3C/svg%3E");
}
:root { --lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 11'%3E%3Cpath d='M2.5 4.5V3a2.5 2.5 0 0 1 5 0v1.5' fill='none' stroke='black' stroke-width='1.3'/%3E%3Crect x='1' y='4.5' width='8' height='6' rx='1.2'/%3E%3C/svg%3E"); }

/* key-value lists */
.kv { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 8px 20px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- tables: rules and alignment, no bands, numbers right ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 36px; padding: 0 12px; text-align: left; font-weight: 400; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: bottom; padding-bottom: 8px; }
td { padding: 13px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; white-space: nowrap; }
td.who { min-width: 260px; }
td.who > a b { font-weight: 600; }
td .small, td.small { line-height: 18px; }
td.empty-row { color: var(--muted); padding: 20px 0; }

/* ---------- text helpers ---------- */
.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
.reasons { margin: 8px 0 0; padding-left: 16px; color: var(--muted); font-size: var(--fs-small); line-height: 18px; }
.reasons li + li { margin-top: 2px; }

/* ---------- pills: pale tint, dark ink of the same hue, one per row ---------- */
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
        background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); white-space: nowrap; flex: none; vertical-align: 1px; }
.pill.good { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.pill.bad { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.accent { background: var(--pill-accent-bg); color: var(--pill-accent-ink); }

/* ---------- scores: the one hue, on the number itself ---------- */
.score { display: inline-block; min-width: 28px; text-align: right; font-weight: 600; color: var(--accent); }
.score.big { font-size: 22px; line-height: 26px; }
.bar { height: 6px; background: var(--raised); border-radius: 999px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* the match bar: how fit, performance and reliability add up to the match score (0-100 track).
   A predicted performance is hatched: a guess never looks like a measured result. */
.mbar { position: relative; display: flex; gap: 2px; height: 8px; width: 100%; min-width: 120px; margin-top: 6px; background: var(--raised); border-radius: 2px; }
.mbar i { display: block; height: 100%; flex: none; }
.mbar .f { background: var(--accent); }
.mbar .p { background: var(--accent-2); }
.mbar .p.pred { background: #fff var(--hatch) 0 0 / 4px 4px; border: 1px solid var(--accent-2); }
.mbar .r { background: var(--accent-3); }
.mbar .pen { position: absolute; top: 0; height: 100%; background: var(--surface) var(--hatch-neg) 0 0 / 4px 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 8px; border-radius: 2px; display: inline-block; }

/* ---------- forms ---------- */
form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px 20px; }
form.grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 8px; }
input, select, textarea { width: 100%; font: inherit; height: var(--field-height); padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius-control);
                          background: var(--surface); color: var(--text); transition: border-color 150ms ease; }
input:hover, select:hover, textarea:hover { border-color: #aeb3b1; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); flex: none; }
input[type=file] { height: auto; padding: 8px; }
textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 20px; }
.hint { margin-top: 6px; font-size: var(--fs-small); color: var(--muted); }
form .small.muted { margin-top: 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks label { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
details { border: 1px solid var(--border); border-radius: var(--radius-control); padding: 0 14px; background: var(--surface); }
details + details { margin-top: 6px; }
details[open] { padding-bottom: 14px; }
summary { cursor: pointer; font-weight: 500; min-height: 40px; display: flex; align-items: center; }
details[open] > summary { margin-bottom: 8px; }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.fieldset label { font-size: 13px; }

/* ---------- buttons: one filled primary (near-black), the rest outlined or text ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; font: inherit; font-weight: 500;
               border-radius: var(--radius-control); border: 1px solid var(--primary); background: var(--primary); color: var(--primary-ink);
               cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color 150ms ease, border-color 150ms ease, transform 120ms var(--ease-out); }
button:hover, .btn:hover { background: #2e3033; text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button.ghost, .btn.ghost { background: var(--surface); color: var(--text); border-color: var(--control); }
button.ghost:hover, .btn.ghost:hover { background: var(--raised); border-color: #aeb3b1; }
button.danger { background: var(--surface); color: var(--negative); border-color: #e7b9b6; }
button.danger:hover { background: var(--pill-negative-bg); }
button.sm, .btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
button.link { height: auto; padding: 0; border: 0; background: none; color: var(--muted); font-weight: 400; }
button.link:hover { color: var(--text); background: none; text-decoration: underline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions select { width: auto; height: 36px; }
form.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }

/* ---------- lists in the side rail ---------- */
.list { display: grid; }
.list > .item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 0; }
.list > .item + .item { border-top: 1px solid var(--rule); }
.list .item .meta { display: block; font-size: var(--fs-small); color: var(--muted); }
.view-all { display: inline-flex; margin-top: 8px; font-weight: 500; color: var(--text); }

/* empty blocks keep their frame */
.empty { display: grid; gap: 4px; padding: 18px 20px; border: 1px dashed var(--control); border-radius: var(--radius-card); color: var(--muted); }
.empty b { color: var(--text); }

/* business portal: one card per booked creator */
.creator-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.creator-cards .card { margin: 0; }
.creator-cards table td, .creator-cards table th { padding-top: 8px; padding-bottom: 8px; }

/* ---------- phone and tablet: the frame disappears, the sheet becomes the screen ---------- */
@media (max-width: 900px) {
  :root { --pad: 20px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; z-index: 10; height: auto; padding: 0 16px; background: var(--ground);
             display: grid; grid-template-columns: 1fr auto; align-items: center; min-height: 56px; }
  .sidebar .brand { padding: 0; }
  .menu-btn { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border: 1px solid var(--control); border-radius: var(--radius-control);
              background: var(--surface); font-weight: 500; cursor: pointer; margin: 0; }
  .nav-toggle { display: block; position: absolute; opacity: 0; width: 1px; height: 1px; }
  .nav-toggle:focus-visible + .menu-btn { outline: 2px solid var(--accent); outline-offset: 2px; }
  .nav, .nav-label, .sidebar .me { display: none; grid-column: 1 / -1; }
  .nav-toggle:checked ~ .nav { display: grid; margin: 4px 0 8px; }
  .nav-toggle:checked ~ .me { display: grid; padding: 8px 10px 16px; }
  .nav a { height: 44px; }
  .sheet { margin: 0; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; border-bottom: 0; }
  .sheet.solo { margin: 0; }
  .sheet.tiny { margin: 4vh 16px; border-radius: var(--radius-sheet); border-bottom: 1px solid var(--border); padding: 24px 20px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi + .kpi { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .kpi:nth-child(2n) { border-left: 1px solid var(--border); }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi-value { font-size: 24px; line-height: 30px; }
}
@media (max-width: 600px) {
  :root { --pad: 16px; --gap: 16px; --card-pad: 16px; }
  .sheet { padding-top: 20px; }
  .topbar { padding: 0 16px; }
  h2 { margin-top: 36px; }
  .between { align-items: flex-start; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  td.who { min-width: 200px; }
  button, .btn { height: 44px; }
  button.sm, .btn.sm { height: 36px; }
  input, select { height: 44px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; } }
.note.error { background: var(--pill-negative-bg); color: var(--pill-negative-ink); margin-bottom: 16px; }
.history { max-width: 560px; }
.steps { padding-left: 18px; display: grid; gap: 12px; }
.steps li { padding-left: 4px; }
.steps b { font-weight: 600; }
.show-sm { display: none; }
@media (max-width: 600px) { .hide-sm { display: none; } .show-sm { display: inline; } td.who { min-width: 0; } }
.kv code { white-space: nowrap; }
dd .chips { margin-top: -1px; }
.row > .card + .card, .split > .card + .card { margin-top: 0; }
.kv.two { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); }
@media (max-width: 900px) { .kv.two { grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); } }
@media (max-width: 600px) { .kv.two { grid-template-columns: minmax(0, 1fr); } }
form.grid.filters { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
