/* Nod — the whole look.
   White and black. One accent, and the accent belongs to the studio, not to us.
   Hierarchy comes from size. Outlines instead of fills. Air instead of boxes. */

@font-face {
  font-family: 'Delight';
  src: url('../../fonts/delight-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Delight';
  src: url('../../fonts/delight-medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Basis Mono';
  src: url('../../fonts/basisgrotesquemono-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --ac: #ff2e00;              /* replaced per studio at runtime */
  --ac-ink: #fff;             /* text that sits on the accent */

  --bg: #fff;
  --fg: #000;
  --fg2: #5c5c5c;
  --fg3: #8e8e8e;
  --line: #e3e3e3;
  --line2: #cfcfcf;
  --sunk: #f6f6f6;

  --green: #067647;
  --red:   #c11414;
  --amber: #9a6300;
  --blue:  #17489e;
  --grey:  #8e8e8e;

  --r-sm: 12px;               /* inputs and small controls */
  --r-lg: 20px;               /* cards and panels */
  --r-full: 999px;            /* chips and badges */

  --t-hero: 46px;
  --t-title: 30px;
  --t-head: 20px;
  --t-body: 15px;
  --t-small: 13px;
  --t-tiny: 11px;

  --gap: 20px;
  --pad: 28px;
  --side: 232px;
}

[data-theme='dark'] {
  --bg: #000;
  --fg: #fff;
  --fg2: #a6a6a6;
  --fg3: #6e6e6e;
  --line: #242424;
  --line2: #3a3a3a;
  --sunk: #0d0d0d;

  --green: #35d68a;
  --red:   #ff5a4d;
  --amber: #ffb32e;
  --blue:  #5b9bff;
  --grey:  #6e6e6e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Delight', system-ui, -apple-system, sans-serif;
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; }

/* Numbers, dates, amounts and ids line up in a column. Nothing else. */
.mono, .num { font-family: 'Basis Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }

a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::placeholder { color: var(--fg3); }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }

.muted   { color: var(--fg2); }
.quiet   { color: var(--fg3); }
.hidden  { display: none !important; }
.right   { text-align: right; }
.grow    { flex: 1; min-width: 0; }
.row     { display: flex; align-items: center; gap: 12px; }
.col     { display: flex; flex-direction: column; }
.wrap    { flex-wrap: wrap; }
.truncate{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ shell */

.shell { display: flex; min-height: 100vh; }

.side {
  width: var(--side);
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding: var(--pad) 18px;
  display: flex;
  flex-direction: column;
  gap: 34px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brandmark { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brandmark img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.monogram {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--ac); color: var(--ac-ink);
  display: grid; place-items: center;
  font-size: var(--t-small); letter-spacing: 0.02em;
  flex-shrink: 0;
}
.brandmark b { font-weight: 500; font-size: var(--t-body); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 9px 12px;
  border-radius: var(--r-sm);
  text-decoration: none; color: var(--fg2);
  font-size: var(--t-body);
}
.nav a:hover { color: var(--fg); background: var(--sunk); }
.nav a.on { color: var(--fg); border: 1px solid var(--line2); padding: 8px 11px; }
.nav .tick {
  font-family: 'Basis Mono', monospace; font-size: var(--t-tiny);
  color: var(--ac);
}

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: var(--pad) var(--pad) 0;
  flex-wrap: wrap;
}
.page-h { font-size: var(--t-title); line-height: 1.15; letter-spacing: -0.02em; }
.page-sub { font-size: var(--t-small); color: var(--fg3); margin-top: 2px; }

.body-wrap { padding: var(--pad); display: flex; flex-direction: column; gap: var(--gap); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px;
  border: 1px solid var(--line2);
  border-radius: var(--r-sm);
  background: none;
  font-size: var(--t-small);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .12s, color .12s;
}
.btn:hover { border-color: var(--fg); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--line2); }
.btn.primary { background: var(--ac); border-color: var(--ac); color: var(--ac-ink); }
.btn.primary:hover { opacity: .9; border-color: var(--ac); }
.btn.danger { color: var(--red); border-color: var(--line2); }
.btn.danger:hover { border-color: var(--red); }
.btn.sm { padding: 6px 11px; font-size: var(--t-tiny); }
.btn.icon { padding: 8px; width: 34px; height: 34px; }
.btn.big { padding: 13px 22px; font-size: var(--t-body); border-radius: var(--r-sm); }
.btn.plain { border-color: transparent; }
.btn.plain:hover { border-color: var(--line2); }

.input, .select, textarea.input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line2);
  border-radius: var(--r-sm);
  background: none;
  font-size: var(--t-body);
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--ac); outline: none; }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
.select { appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 15px center, right 10px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat; }
.input.mono { font-family: 'Basis Mono', monospace; }

.fld { display: flex; flex-direction: column; gap: 7px; }
.fld > label { font-size: var(--t-small); color: var(--fg2); }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--r-sm); overflow: hidden; }
.seg button {
  border: none; background: none; cursor: pointer;
  padding: 8px 14px; font-size: var(--t-small); color: var(--fg2);
}
.seg button.on { background: var(--fg); color: var(--bg); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--t-small); }
.switch i {
  width: 38px; height: 22px; border-radius: var(--r-full);
  border: 1px solid var(--line2); position: relative; transition: background .15s, border-color .15s;
}
.switch i::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%; background: var(--fg2); transition: transform .15s, background .15s;
}
.switch.on i { background: var(--ac); border-color: var(--ac); }
.switch.on i::after { transform: translateX(16px); background: #fff; }

/* ------------------------------------------------------------------ chips */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  border: 1px solid currentColor;
  border-radius: var(--r-full);
  font-size: var(--t-tiny);
  white-space: nowrap;
}
.chip .bul { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.grey  { color: var(--grey);  }
.chip.blue  { color: var(--blue);  }
.chip.amber { color: var(--amber); }
.chip.green { color: var(--green); }
.chip.red   { color: var(--red);   }
.chip.solid { background: var(--ac); border-color: var(--ac); color: var(--ac-ink); }

.tag {
  font-family: 'Basis Mono', monospace;
  font-size: var(--t-tiny);
  color: var(--fg3);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  padding: 3px 9px;
}

/* ------------------------------------------------------------------ cards */

.panel { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: var(--t-head); font-weight: 400; letter-spacing: -0.01em; }
.panel-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.panel-body.flush { padding: 0; gap: 0; }

.rows { display: flex; flex-direction: column; }
.row-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
.rows .row-item:last-child { border-bottom: none; }
.row-item.tap { cursor: pointer; }
.row-item.tap:hover { background: var(--sunk); }
.row-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.row-main b { font-weight: 400; font-size: var(--t-body); }
.row-main span { font-size: var(--t-small); color: var(--fg3); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--gap); }
.stat { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; }
.stat .k { font-size: var(--t-small); color: var(--fg2); }
.stat .v { font-family: 'Basis Mono', monospace; font-size: var(--t-hero); line-height: 1.1; letter-spacing: -0.03em; margin: 10px 0 4px; }
.stat .sub { font-size: var(--t-tiny); color: var(--fg3); }

.empty {
  padding: 56px 24px; text-align: center; color: var(--fg3); font-size: var(--t-small);
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.empty b { font-weight: 400; font-size: var(--t-head); color: var(--fg); letter-spacing: -0.01em; }

.sec-title {
  font-size: var(--t-tiny); color: var(--fg3);
  text-transform: uppercase; letter-spacing: 0.1em;
  padding-bottom: 10px;
}

/* ------------------------------------------------------------------- grid */

.feed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.feed-cell {
  aspect-ratio: 4 / 5;
  background: var(--sunk);
  border: 1px solid var(--line);
  overflow: hidden; position: relative; cursor: pointer;
}
.feed-cell img, .feed-cell video { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-cell.dragging { opacity: .35; }
.feed-cell .n {
  position: absolute; top: 7px; left: 7px;
  font-family: 'Basis Mono', monospace; font-size: 10px;
  background: var(--bg); color: var(--fg);
  border-radius: var(--r-full); padding: 2px 7px;
}
.feed-cell .many {
  position: absolute; top: 7px; right: 7px;
  font-family: 'Basis Mono', monospace; font-size: 10px;
  background: var(--bg); border-radius: var(--r-full); padding: 2px 7px;
}
.feed-cell.blank { display: grid; place-items: center; color: var(--fg3); font-size: var(--t-tiny); }
.feed-cell.unsynced { display: grid; place-items: center; }
.feed-cell.unsynced::after {
  content: 'not uploaded yet';
  color: var(--fg3); font-size: var(--t-tiny); text-align: center; padding: 8px;
}

.profile { display: flex; flex-direction: column; gap: 18px; align-items: center; padding: 30px 20px 24px; }
.profile .ph {
  width: 84px; height: 84px; border-radius: 50%;
  border: 1px solid var(--line2); overflow: hidden;
  display: grid; place-items: center; font-size: var(--t-title); color: var(--fg3);
}
.profile .ph img { width: 100%; height: 100%; object-fit: cover; }
.profile .handle { font-size: var(--t-head); }
.profile .counts { display: flex; gap: 34px; }
.profile .counts div { text-align: center; }
.profile .counts b { display: block; font-family: 'Basis Mono', monospace; font-size: var(--t-head); font-weight: 400; }
.profile .counts span { font-size: var(--t-tiny); color: var(--fg3); }

/* ----------------------------------------------------------------- drawer */

.scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.42);
  opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 40;
}
.scrim.on { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(560px, 100%);
  background: var(--bg);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform .2s ease;
  z-index: 50;
  display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 24px var(--pad) 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: var(--t-title); font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; }
.drawer-body { padding: var(--pad); overflow-y: auto; display: flex; flex-direction: column; gap: 30px; }

/* the stage ladder */
.ladder { display: flex; flex-direction: column; gap: 0; }
.ladder .step {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; font-size: var(--t-small); color: var(--fg3);
  position: relative;
}
.ladder .step i {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid var(--line2); flex-shrink: 0;
}
.ladder .step::before {
  content: ''; position: absolute; left: 4px; top: -8px; height: 16px;
  border-left: 1px solid var(--line);
}
.ladder .step:first-child::before { display: none; }
.ladder .step.done { color: var(--fg2); }
.ladder .step.done i { background: var(--fg2); border-color: var(--fg2); }
.ladder .step.now { color: var(--fg); font-size: var(--t-body); }
.ladder .step.now i { background: var(--ac); border-color: var(--ac); width: 11px; height: 11px; }
.ladder .when { margin-left: auto; font-family: 'Basis Mono', monospace; font-size: var(--t-tiny); color: var(--fg3); }

/* --------------------------------------------------------------- lightbox */

.lb { position: fixed; inset: 0; background: var(--bg); z-index: 60; display: none; flex-direction: column; }
.lb.on { display: flex; }
.lb-top { display: flex; align-items: center; gap: 12px; padding: 16px var(--pad); border-bottom: 1px solid var(--line); }
.lb-stage { flex: 1; display: grid; place-items: center; padding: 22px; min-height: 0; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-foot { border-top: 1px solid var(--line); padding: 18px var(--pad); display: flex; flex-direction: column; gap: 14px; }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--line2); cursor: pointer; }
.dots i.on { background: var(--fg); border-color: var(--fg); }

/* ------------------------------------------------------------------ misc */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  background: var(--fg); color: var(--bg);
  padding: 11px 20px; border-radius: var(--r-full);
  font-size: var(--t-small);
  opacity: 0; pointer-events: none; transition: opacity .16s, transform .16s;
  z-index: 90;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.linkbox { display: flex; gap: 8px; }
.linkbox .input { font-family: 'Basis Mono', monospace; font-size: var(--t-small); }

.bar { height: 3px; background: var(--line); border-radius: var(--r-full); overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; background: var(--ac); }
.bar.done i { background: var(--green); }

.note {
  border: 1px solid var(--line2); border-radius: var(--r-lg);
  padding: 16px 18px; font-size: var(--t-small); color: var(--fg2);
  display: flex; flex-direction: column; gap: 6px;
}
.note b { color: var(--fg); font-weight: 400; font-size: var(--t-body); }

.drop {
  border: 1px dashed var(--line2); border-radius: var(--r-lg);
  padding: 34px 20px; text-align: center; color: var(--fg3);
  font-size: var(--t-small); cursor: pointer;
}
.drop.over { border-color: var(--ac); color: var(--ac); }

/* ------------------------------------------------------------- onboarding */

.solo { min-height: 100vh; display: grid; place-items: center; padding: 26px 20px; }
.solo-box { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 20px; }
.solo h1 { font-size: var(--t-hero); font-weight: 400; letter-spacing: -0.035em; line-height: 1.05; }
.solo .lede { font-size: var(--t-head); color: var(--fg2); letter-spacing: -0.01em; line-height: 1.35; }
.steps { display: flex; gap: 5px; }
.steps i { height: 2px; flex: 1; background: var(--line); border-radius: var(--r-full); }
.steps i.on { background: var(--ac); }

/* The one screen where the button must never fall below the fold, so this
   list stays tighter than the rest of the app. */
.picks { display: flex; flex-direction: column; gap: 7px; }
.pick {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 12px 16px;
  border: 1px solid var(--line2); border-radius: var(--r-sm);
  background: none; cursor: pointer;
}
.pick:hover { border-color: var(--fg); }
.pick.on { border-color: var(--ac); }
.pick > span { display: block; min-width: 0; }
.pick b { font-weight: 400; font-size: var(--t-body); color: var(--fg); display: block; }
.pick b + span { font-size: var(--t-small); color: var(--fg3); }

.swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line2); cursor: pointer; }
.swatch.on { box-shadow: inset 0 0 0 3px var(--bg); border-width: 2px; border-color: var(--fg); }

/* ---------------------------------------------------------- client screen */

.client-page { max-width: 720px; margin: 0 auto; padding: 0 20px 80px; }
.client-head {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 46px 0 34px; text-align: center;
}
.client-head .mark { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; }
.client-head h1 { font-size: var(--t-title); font-weight: 400; letter-spacing: -0.02em; }
.client-head p { font-size: var(--t-small); color: var(--fg3); }

.tl { display: flex; flex-direction: column; }
.tl-group { padding-top: 30px; }
.tl-group > .sec-title { border-bottom: 1px solid var(--line); }

.ask { display: flex; gap: 9px; padding-top: 4px; flex-wrap: wrap; }

/* ------------------------------------------------------- mobile top bar */

/* Hidden until the sidebar cannot fit. Then it is the only navigation. */
.mobile-bar { display: none; }
.side-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.42);
  opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 29;
}

@media (max-width: 860px) {
  :root { --pad: 20px; --gap: 16px; --t-hero: 38px; --t-title: 25px; }

  .mobile-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px var(--pad);
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    position: sticky; top: 0; z-index: 28;
    padding-top: max(10px, env(safe-area-inset-top));
  }
  .mobile-bar .brandmark b { font-size: var(--t-small); }

  .shell { flex-direction: column; }

  /* A proper drawer, off to the left until asked for. */
  .side {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(280px, 84vw); height: 100vh;
    border-right: 1px solid var(--line);
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 30;
    padding-top: max(var(--pad), env(safe-area-inset-top));
  }
  .side.on { transform: none; }
  .side-scrim.on { opacity: 1; pointer-events: auto; }

  .nav a { padding: 11px 12px; }
  .nav a.on { padding: 10px 11px; }

  .topbar { padding: var(--pad) var(--pad) 0; }
  .fld-row { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
  .stats { grid-template-columns: 1fr; }

  /* Row content stacks rather than squeezing every chip onto one line. */
  .row-item { flex-wrap: wrap; gap: 8px 10px; }
  .panel-head { flex-wrap: wrap; }
}

@media print {
  .side, .topbar, .btn, .drawer, .scrim { display: none !important; }
}
