/* Rising Tides release intake.
   Tokens follow Risingtides-dev/brand-kit (colors_and_type.css): Poppins, the
   magenta→purple brand pair, near-black surfaces with a purple undertone. The
   brand colour is spent on the primary action, the mark and current state,
   nothing else. Dark is the designed default; light follows the system. */

@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("fonts/Poppins-Regular.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("fonts/Poppins-Medium.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("fonts/Poppins-SemiBold.woff2") format("woff2"); }

:root {
  color-scheme: dark;

  --bg: oklch(0.145 0.012 300);
  --bg-2: oklch(0.165 0.013 300);       /* wells: inputs, code, pills */
  --surface: oklch(0.19 0.015 300);
  --surface-hover: oklch(0.225 0.018 300);
  --ink: oklch(0.97 0.005 300);
  --ink-2: oklch(0.84 0.01 300);
  --muted: oklch(0.72 0.014 300);
  --faint: oklch(0.56 0.014 300);
  --line: oklch(0.28 0.016 300);
  --line-strong: oklch(0.38 0.02 300);

  --accent: oklch(0.76 0.17 322);         /* links, focus, current state */
  --accent-soft: oklch(0.76 0.17 322 / 0.14);
  --primary: linear-gradient(120deg, oklch(0.56 0.26 330), oklch(0.47 0.25 300));
  --primary-hover: linear-gradient(120deg, oklch(0.61 0.26 330), oklch(0.52 0.25 300));
  --on-primary: #fff;

  --danger: oklch(0.74 0.16 22);
  --danger-bg: oklch(0.26 0.06 22);
  --warn: oklch(0.84 0.13 80);
  --warn-bg: oklch(0.27 0.05 80);
  --ok: oklch(0.8 0.14 158);
  --ok-bg: oklch(0.25 0.05 158);
  --info: oklch(0.8 0.1 250);
  --info-bg: oklch(0.25 0.04 260);

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t: 160ms;

  --z-sticky: 10;
  --z-menu: 30;

  --topbar-h: 60px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: oklch(0.975 0.004 300);
    --bg-2: oklch(0.965 0.006 300);
    --surface: oklch(1 0 0);
    --surface-hover: oklch(0.975 0.006 300);
    --ink: oklch(0.2 0.025 300);
    --ink-2: oklch(0.33 0.02 300);
    --muted: oklch(0.46 0.02 300);
    --faint: oklch(0.6 0.015 300);
    --line: oklch(0.905 0.008 300);
    --line-strong: oklch(0.82 0.012 300);
    --accent: oklch(0.5 0.25 312);
    --accent-soft: oklch(0.5 0.25 312 / 0.09);
    --danger: oklch(0.5 0.19 25);
    --danger-bg: oklch(0.96 0.025 25);
    --warn: oklch(0.5 0.11 70);
    --warn-bg: oklch(0.96 0.04 85);
    --ok: oklch(0.47 0.12 158);
    --ok-bg: oklch(0.96 0.03 158);
    --info: oklch(0.47 0.12 255);
    --info-bg: oklch(0.96 0.02 255);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 24px); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { text-wrap: balance; color: var(--ink); }
p { text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 3px; }
code, .mono { font-family: var(--mono); font-size: 0.88em; }
.mono { overflow-wrap: anywhere; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.hidden { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1:focus, h1:focus-visible { outline: none; }

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

.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  height: var(--topbar-h);
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 28px;
  max-width: 1120px; height: 100%; margin: 0 auto; padding: 0 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap;
}
.brand .mark { width: 26px; height: auto; }
.nav { display: flex; gap: 4px; height: 100%; }
.nav a {
  position: relative; display: inline-flex; align-items: center;
  padding: 0 12px; height: 100%;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: color var(--t) var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  border-radius: 2px 2px 0 0; background: var(--primary);
}
.spacer { flex: 1; }
.role-chip {
  margin-left: -16px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid color-mix(in oklch, var(--accent) 40%, transparent);
  background: var(--accent-soft); color: var(--accent);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
}
.preview-bar {
  padding: 8px 24px; text-align: center; font-size: 13px;
  background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid color-mix(in oklch, var(--warn) 25%, transparent);
}
.preview-bar .link { color: inherit; font-size: inherit; }

.account {
  display: inline-flex; align-items: center; gap: 10px;
  max-width: 280px; padding: 4px 12px 4px 4px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-2); color: var(--ink-2);
  font: 500 13px/1 var(--font); cursor: pointer;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.account:hover { border-color: var(--line-strong); background: var(--surface); }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  font: 600 12px/1 var(--font); text-transform: uppercase;
}
.account .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu {
  position: fixed; inset: auto; top: calc(var(--topbar-h) - 4px);
  right: max(16px, calc((100vw - 1120px) / 2 + 24px));
  margin: 0; min-width: 240px; max-width: calc(100vw - 32px); padding: 6px;
  border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 8px 8px -4px oklch(0 0 0 / 0.25);
}
.menu:popover-open { animation: menu-in 140ms var(--ease); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head .hint { display: block; }
.menu-head strong { display: block; font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.menu-item {
  display: block; width: 100%; padding: 8px 10px;
  border: 0; border-radius: var(--r-sm); background: none;
  color: var(--ink); font: 500 14px/1.3 var(--font); text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover { background: var(--surface-hover); }
.menu-section { padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.menu-section > .hint { display: block; padding: 4px 10px; }
.menu-item.on { color: var(--accent); }
.menu-item.danger { color: var(--danger); }
.release-actions { position: relative; align-self: flex-start; }
.release-actions details { position: relative; }
.release-actions summary {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--muted); cursor: pointer; list-style: none;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.release-actions summary::-webkit-details-marker { display: none; }
.release-actions summary:hover,
.release-actions details[open] summary { color: var(--ink); border-color: var(--line-strong); background: var(--surface-hover); }
.release-actions summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.release-actions summary svg { width: 18px; height: 18px; fill: currentColor; }
.release-actions-panel {
  position: absolute; z-index: 20; top: 44px; right: 0;
  width: min(360px, calc(100vw - 32px)); padding: 6px;
  border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 8px 8px -4px oklch(0 0 0 / 0.25);
  animation: menu-in 140ms var(--ease);
}
.release-actions-panel form { padding: 10px; }
.release-actions-panel .field { margin-bottom: 14px; }
.release-actions-panel .banner { margin: 4px 4px 6px; }
.release-actions-panel .actions { gap: 6px; }
.team { list-style: none; margin: 0; padding: 0; }
.team li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); }
.team li:last-child { border-bottom: 0; }
.team .who { min-width: 0; overflow-wrap: anywhere; font-size: 14.5px; }
.team .sub { display: block; color: var(--muted); font-size: 12.5px; }
.invite { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.invite .primary { margin-top: 25px; }
@media (max-width: 640px) { .invite { grid-template-columns: 1fr; } .invite .primary { margin-top: 0; } }

.page { max-width: 1120px; margin: 0 auto; padding: 40px 24px 120px; }
.narrow { max-width: 800px; margin-left: auto; margin-right: auto; }

@media (max-width: 640px) {
  :root { --topbar-h: 56px; }
  .topbar-inner { gap: 12px; padding: 0 16px; }
  .brand span { display: none; }
  .role-chip { margin-left: -6px; }
  .nav a { padding: 0 10px; }
  .nav a[aria-current="page"]::after { left: 10px; right: 10px; }
  .account { padding: 3px; }
  .account .email { display: none; }
  .page { padding: 28px 16px 120px; }
}

/* ------------------------------------------------------------ type */

.masthead { margin-bottom: 28px; }
.masthead.split { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; }
h1 { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.lede { margin: 8px 0 0; color: var(--muted); max-width: 62ch; }
.byline { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.byline .dot { margin: 0 8px; color: var(--faint); }
.back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px;
  color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none;
}
.back:hover { color: var(--ink); }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 13px; font-weight: 600; }

h2 { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; }
h3 { margin: 0; font-size: 15px; font-weight: 600; }
h4 { margin: 0; font-size: 14px; font-weight: 600; }
.section-note { margin: 4px 0 0; color: var(--muted); font-size: 14px; max-width: 64ch; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; }
.hint.bad, .hint.warn { color: var(--danger); }
.hint.bad:empty { display: none; }
.req { color: var(--accent); font-weight: 600; margin-left: 2px; }

/* ------------------------------------------------------------ surfaces */

section, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 16px;
}
.section-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.section-head > div { flex: 1; min-width: 0; }
.n {
  display: inline-grid; place-items: center; flex: none;
  width: 26px; height: 26px; margin-top: -1px; border-radius: 50%;
  border: 1px solid var(--line-strong); color: var(--ink-2);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) { section, .panel { padding: 18px 16px; border-radius: var(--r); } }

/* ------------------------------------------------------------ fields */

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
.row.copyright { grid-template-columns: 110px 1fr; }
@media (max-width: 640px) { .row, .row.copyright { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; min-width: 0; }
.label { font-size: 13px; font-weight: 500; color: var(--ink-2); }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"],
input[type="date"], select, textarea {
  width: 100%; min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-2); color: var(--ink);
  font: 400 14.5px/1.4 var(--font);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}
textarea { resize: vertical; min-height: 84px; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input[readonly] { color: var(--muted); background: transparent; border-style: dashed; }
input[aria-invalid="true"] { border-color: var(--danger); }
input[type="number"] { font-variant-numeric: tabular-nums; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.6); cursor: pointer; }
@media (prefers-color-scheme: light) { input[type="date"]::-webkit-calendar-picker-indicator { filter: none; } }
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23948fa3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select.unset { color: var(--muted); }
option { color: var(--ink); background: var(--surface); }
::placeholder { color: var(--muted); opacity: 1; }
/* Chrome paints autofilled fields its own blue; keep them on the palette. */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  -webkit-box-shadow: 0 0 0 40px var(--bg-2) inset;
  transition: background-color 9999s;
}

input[type="checkbox"], input[type="radio"] { accent-color: oklch(0.55 0.26 318); width: 16px; height: 16px; margin: 0; flex: none; cursor: pointer; }

/* A file input styled as a drop target: the native control still takes the
   click and the drop, so nothing about how files are read changes. */
.drop {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--r);
  background: var(--bg-2);
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.drop:hover, .drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.drop.has-file { border-style: solid; }
.drop.bad { border-color: var(--danger); }
.drop input[type="file"] { flex: 1; min-width: 0; color: var(--muted); font: 400 13.5px var(--font); cursor: pointer; }
.drop input[type="file"]:focus-visible { outline: none; }
.drop:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="file"]::file-selector-button {
  margin-right: 14px; padding: 7px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font: 500 13px var(--font); cursor: pointer;
  transition: background var(--t) var(--ease);
}
input[type="file"]::file-selector-button:hover { background: var(--surface-hover); }
.drop-icon {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: var(--surface); color: var(--muted);
}
.drop-icon svg { width: 18px; height: 18px; }
.drop.has-file .drop-icon { color: var(--ok); }
.drop.bad .drop-icon { color: var(--danger); }
@media (max-width: 640px) { .drop-icon { display: none; } }

/* Segmented controls and chips: real radios and checkboxes, kept in the
   accessibility tree and the tab order, drawn as the label around them. */
.choices { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.choices legend, .yesno legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-2); color: var(--ink-2);
  font-size: 13.5px; cursor: pointer; user-select: none;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease), color var(--t) var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip input:focus-visible { outline: none; }
.chip.none { border-style: dashed; }
.choices .hint { display: block; margin: 10px 0 0; }

.yesno { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2);
}
.segmented label {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 64px; min-height: 32px; padding: 4px 14px;
  border-radius: var(--r-sm); color: var(--muted);
  font-size: 13.5px; font-weight: 500; cursor: pointer; user-select: none;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.segmented label:hover { color: var(--ink); }
.segmented input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segmented label:has(input:checked) { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--accent) 55%, transparent); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }

.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; min-height: 40px; }

/* ------------------------------------------------------------ buttons */

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }

.primary, .secondary, .ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px;
  border-radius: var(--r);
  font: 600 14px/1 var(--font); text-decoration: none; white-space: nowrap;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), transform 80ms var(--ease);
}
.primary { border: 0; background: var(--primary); color: var(--on-primary); }
.primary:hover:not(:disabled) { background: var(--primary-hover); }
.primary:active:not(:disabled), .secondary:active:not(:disabled) { transform: translateY(1px); }
.primary.lg { min-height: 46px; padding: 0 26px; font-size: 15px; }
.secondary { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 500; }
.secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--faint); }
.secondary.sm, .ghost.sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.ghost { border: 0; background: none; color: var(--muted); font-weight: 500; padding: 0 10px; }
.ghost:hover:not(:disabled) { color: var(--ink); background: var(--surface-hover); }
.ghost.danger:hover:not(:disabled) { color: var(--danger); background: var(--danger-bg); }
.link {
  border: 0; background: none; padding: 0;
  color: var(--accent); font: 500 13px var(--font); text-decoration: underline; text-underline-offset: 3px;
}
.plus { font-size: 17px; font-weight: 400; line-height: 0; }
.primary.busy::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
.primary.busy:disabled { opacity: 0.85; cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ------------------------------------------------------------ banners */

.banner {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid transparent; border-radius: var(--r);
  padding: 12px 16px; margin-bottom: 16px; font-size: 14px;
}
.banner > .body { flex: 1; min-width: 0; }
.banner p { margin: 0; }
.banner ul { margin: 6px 0 0; padding-left: 18px; }
.banner li + li { margin-top: 3px; }
.banner .link { color: inherit; font-size: inherit; font-weight: inherit; text-align: left; }
.banner .close { flex: none; margin: -6px -8px -6px 0; color: inherit; opacity: 0.8; }
.banner .close:hover { opacity: 1; background: color-mix(in oklch, currentColor 12%, transparent); color: inherit; }
.banner.error { background: var(--danger-bg); border-color: color-mix(in oklch, var(--danger) 30%, transparent); color: var(--danger); }
.banner.error li { color: color-mix(in oklch, var(--danger) 45%, var(--ink)); }
.banner.error li::marker { color: var(--danger); }
.banner.error li .link { text-decoration-color: color-mix(in oklch, currentColor 35%, transparent); }
.banner.error li .link:hover { text-decoration-color: currentColor; }
.banner.ok { background: var(--ok-bg); border-color: color-mix(in oklch, var(--ok) 30%, transparent); color: var(--ok); }
.banner.note { background: var(--info-bg); border-color: color-mix(in oklch, var(--info) 25%, transparent); color: var(--ink); }
.banner.note strong { display: block; color: var(--info); font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.banner.test { background: var(--warn-bg); border-color: color-mix(in oklch, var(--warn) 30%, transparent); color: var(--warn); }
.banner:focus-visible { outline-offset: 3px; }

/* ------------------------------------------------------------ sign-in */

.auth { max-width: 400px; margin: 0 auto; padding: max(8vh, 40px) 0 40px; }
.auth > .mark { width: 44px; height: auto; margin-bottom: 28px; }
.auth h1 { font-size: 26px; }
.auth .lede { margin-bottom: 28px; }
.auth form .primary { width: 100%; margin-top: 4px; }
.auth .sent { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.auth .sent h2 { margin-bottom: 6px; }
.auth .sent p { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; }
.auth .sent .banner { margin-bottom: 14px; }
.auth .stack { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.auth .stack > p { margin: 0 0 8px; color: var(--ink-2); }

.boot { display: grid; place-items: center; min-height: 70vh; }
.boot .mark { width: 40px; height: auto; animation: breathe 1.6s var(--ease) infinite alternate; }
@keyframes breathe { from { opacity: 0.35; } to { opacity: 1; } }

/* ------------------------------------------------------------ tables */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  padding: 0 12px 10px; text-align: left;
  color: var(--muted); font-size: 12px; font-weight: 500;
  border-bottom: 1px solid var(--line);
}
td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td .sub { display: block; margin-top: 1px; color: var(--muted); font-size: 13px; }
.dim { color: var(--faint); }

.list-panel { padding: 8px 12px; }
table.releases th { padding-top: 12px; }
table.releases tbody tr { position: relative; transition: background var(--t) var(--ease); }
table.releases tbody tr:hover { background: var(--surface-hover); }
table.releases td:first-child { border-radius: var(--r) 0 0 var(--r); }
table.releases td:last-child { border-radius: 0 var(--r) var(--r) 0; }
table.releases td a { color: var(--ink); font-weight: 500; text-decoration: none; }
/* The whole row opens the release; the title stays the one real link. */
table.releases td a::after { content: ""; position: absolute; inset: 0; }
table.releases td a:focus-visible { outline: none; }
table.releases tr:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
table.releases .when { color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) {
  .list-panel { padding: 4px; }
  table.releases thead { display: none; }
  table.releases tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
    padding: 12px; border-bottom: 1px solid var(--line);
  }
  table.releases tbody tr:last-child { border-bottom: 0; }
  table.releases td { border: 0; padding: 0; border-radius: 0 !important; }
  table.releases td:nth-child(2) { justify-self: end; align-self: start; }
  table.releases td.upc, table.releases td.tracks { display: none; }
  table.releases td.when { grid-column: 1 / -1; font-size: 12.5px; }
}

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink-2);
  font-size: 12.5px; font-weight: 500; white-space: nowrap; line-height: 1.4;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.received { color: var(--muted); }
.pill.working { color: var(--info); border-color: color-mix(in oklch, var(--info) 30%, transparent); background: var(--info-bg); }
.pill.working::before { animation: breathe 1.1s ease-in-out infinite alternate; }
.pill.review { color: var(--accent); border-color: color-mix(in oklch, var(--accent) 35%, transparent); background: var(--accent-soft); }
.pill.attention { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 35%, transparent); background: var(--danger-bg); }
.pill.approved { color: var(--ok); border-color: color-mix(in oklch, var(--ok) 30%, transparent); background: var(--ok-bg); }
.pill.test { color: var(--warn); border-color: color-mix(in oklch, var(--warn) 30%, transparent); background: var(--warn-bg); margin-left: 8px; padding: 0 7px; font-size: 11px; vertical-align: 1px; }
.pill.test::before, .pill.flag::before { display: none; }
.pill.flag { padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 600; color: var(--muted); }

.empty { padding: 56px 24px; text-align: center; }
.empty h2 { margin-bottom: 6px; }
.empty p { margin: 0 auto 22px; max-width: 46ch; color: var(--muted); font-size: 14px; }

.skeleton { display: grid; gap: 16px; padding: 18px 12px; }
.skeleton span {
  display: block; height: 14px; border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-2), var(--surface-hover), var(--bg-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton span:nth-child(2n) { width: 72%; }
.skeleton span:nth-child(3n) { width: 86%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

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

.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.progress li { position: relative; padding-top: 14px; color: var(--muted); font-size: 13px; font-weight: 500; }
.progress li::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 2px;
  background: var(--line);
}
.progress li.done { color: var(--ink-2); }
.progress li.done::before { background: var(--primary); }
.progress li.current { color: var(--ink); }
.progress li.current::before { background: linear-gradient(90deg, oklch(0.56 0.26 330) 45%, var(--line) 45%); }
.progress li.delayed { color: var(--warn); }
.progress li.delayed::before { background: var(--warn); }
.status-note { margin: 18px 0 0; color: var(--ink-2); font-size: 14px; max-width: 64ch; }
.status-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.status-row .hint { font-size: 13px; }
@media (max-width: 520px) { .progress li { font-size: 11.5px; } }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px 24px; margin: 0; }
.facts > div { min-width: 0; }
.facts dt { color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.facts dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.facts .wide { grid-column: 1 / -1; }
.facts.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 20px; margin: 12px 0 0; }
.facts.compact dd { font-size: 14px; }
.pending { color: var(--muted); font-size: 13.5px; }
@media (max-width: 640px) {
  .facts, .facts.compact { grid-template-columns: 1fr 1fr; gap: 14px 16px; }
}

.track-list { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.track-list > li { counter-increment: t; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 0 10px; padding: 20px 0; border-top: 1px solid var(--line); }
.track-list > li:first-child { border-top: 0; padding-top: 4px; }
.track-list > li:last-child { padding-bottom: 0; }
.track-list > li::before {
  content: counter(t); color: var(--faint); font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums; line-height: 1.6;
}
.track-list > li > * { grid-column: 2; }
.track-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.track-head strong { font-weight: 600; font-size: 15px; }
.track-head .sub { color: var(--muted); font-size: 14px; }
.player { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.player audio { flex: 1; min-width: 240px; height: 36px; }
.artwork-panel { display: flex; gap: 20px; align-items: center; }
.artwork-panel img {
  width: 120px; height: 120px; object-fit: cover; flex: none;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-2);
}
.artwork-panel h2 { margin-bottom: 2px; }
.artwork-panel .hint { margin: 0 0 12px; }
.lyrics { margin-top: 14px; }
.lyrics summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  color: var(--accent); font-size: 13.5px; font-weight: 500;
}
.lyrics summary::-webkit-details-marker { display: none; }
.lyrics summary::before { content: "›"; display: inline-block; transition: transform var(--t) var(--ease); }
.lyrics[open] summary::before { transform: rotate(90deg); }
.lyrics p {
  margin: 10px 0 0; padding: 14px 16px; max-height: 360px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2);
  color: var(--ink-2); font-size: 14px; line-height: 1.7; white-space: pre-wrap;
}
.lyrics-input { min-height: 180px; line-height: 1.6; }
.splits { margin-top: 16px; font-size: 13.5px; }
.splits th { padding: 0 12px 8px 0; }
.splits td { padding: 9px 12px 9px 0; }
.splits td:first-child { font-weight: 500; }
@media (max-width: 640px) {
  .splits thead { display: none; }
  .splits tr { display: grid; grid-template-columns: 1fr auto; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .splits tr:last-child { border-bottom: 0; }
  .splits td { border: 0; padding: 0; }
  .splits td:nth-child(2), .splits td:nth-child(3) { grid-column: 1; color: var(--muted); font-size: 12.5px; }
  .splits td.num { grid-row: 1; grid-column: 2; }
}

/* ------------------------------------------------------------ the form */

.form-layout { display: grid; grid-template-columns: minmax(0, 800px); justify-content: center; column-gap: 56px; }
@media (min-width: 1140px) {
  .form-layout { grid-template-columns: 170px minmax(0, 800px); }
  .form-layout > .masthead { grid-column: 2; }
  .form-layout > .rail { grid-column: 1; grid-row: 2; }
  .form-layout > .form-main { grid-column: 2; grid-row: 2; }
}
.rail { display: none; }
@media (min-width: 1140px) {
  .rail { display: block; position: sticky; top: calc(var(--topbar-h) + 32px); align-self: start; }
  .rail ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
  .rail button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    margin-left: -1px; padding: 7px 0 7px 14px;
    border: 0; border-left: 2px solid transparent; background: none;
    color: var(--muted); font: 500 13.5px/1.3 var(--font); text-align: left;
    transition: color var(--t) var(--ease), border-color var(--t) var(--ease);
  }
  .rail button:hover { color: var(--ink); }
  .rail button[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); }
  .rail .k { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12px; width: 10px; }
}
.form-main { min-width: 0; }
.form-main > section { scroll-margin-top: calc(var(--topbar-h) + 20px); }

.tracks { list-style: none; margin: 0 0 4px; padding: 0; }
.track { padding: 24px 0 8px; border-top: 1px solid var(--line); }
.track:first-child { border-top: 0; padding-top: 0; }
.track-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.track-bar h3 { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.tn {
  display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px;
  border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line);
  font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2);
}
.track-bar .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-bar .title.dim { color: var(--muted); font-weight: 500; }
.profile-note { margin: -6px 0 14px; }
.profile-actions { margin-top: 8px; }
.more { margin: -4px 0 18px; }
.more > summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  color: var(--accent); font-size: 13.5px; font-weight: 500;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: "+"; width: 12px; text-align: center; }
.more[open] > summary::before { content: "−"; }
.more[open] > summary { margin-bottom: 14px; }
.subhead { margin: 10px 0 4px; }
.subhead + .hint { display: block; margin: 0 0 14px; max-width: 64ch; }

.writer-list { display: grid; gap: 10px; margin-bottom: 12px; }
.writer {
  display: grid; gap: 0 12px; align-items: start;
  grid-template-columns: minmax(0, 1fr) 96px 32px;
  grid-template-areas: "name share x" "role role ." "pub pub .";
  padding: 14px 10px 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2);
}
.writer input, .writer select { background: var(--surface); }
.writer > :nth-child(1) { grid-area: name; }
.writer > :nth-child(2) { grid-area: role; }
.writer > :nth-child(3) { grid-area: pub; }
.writer > :nth-child(4) { grid-area: share; }
.writer > :nth-child(5) { grid-area: x; }
.writer .field { margin-bottom: 14px; }
.writer .x { margin-top: 29px; }
@media (min-width: 700px) {
  .writer {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1.25fr) 84px 32px;
    grid-template-areas: "name role pub share x";
  }
}
.x {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--faint);
  transition: color var(--t) var(--ease), background var(--t) var(--ease);
}
.x svg { width: 14px; height: 14px; }
.x:hover:not(:disabled) { color: var(--danger); background: var(--danger-bg); }

.writers-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.writers-foot .actions { gap: 8px; }
.total { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meter { position: relative; width: 72px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.meter > span { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--muted); transition: width 220ms var(--ease), background var(--t) var(--ease); }
.total.full { color: var(--ok); }
.total.full .meter > span { background: var(--ok); }
.total.off { color: var(--danger); }
.total.off .meter > span { background: var(--danger); }

.credit-list { display: grid; margin-bottom: 4px; }
.credit { grid-template-columns: 1fr 1fr 32px; gap: 0 12px; }
.credit .x { margin-top: 29px; }
@media (max-width: 640px) {
  .credit { grid-template-columns: 1fr 32px; }
  .credit > :nth-child(2) { grid-row: 2; }
}
.group + .group { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.group > h3 { margin-bottom: 12px; }

.consent {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  font-size: 14px; color: var(--ink-2); cursor: pointer;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.consent input { width: 18px; height: 18px; margin-top: 2px; }
.consent:hover { border-color: var(--line-strong); }
.consent:has(input:checked) { border-color: color-mix(in oklch, var(--accent) 50%, var(--line)); color: var(--ink); }
.consent:has(input[aria-invalid="true"]) { border-color: var(--danger); }
.consent-wrap { margin-bottom: 16px; }
.consent-wrap .hint.bad { margin: 8px 0 0; }

.submitbar {
  position: sticky; bottom: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 8px; padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in oklch, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.submitbar .hint { margin: 0; max-width: 46ch; }
@media (max-width: 640px) {
  .submitbar { flex-direction: column-reverse; align-items: stretch; text-align: center; gap: 6px; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .submitbar .primary { width: 100%; }
  .submitbar .hint { font-size: 12px; max-width: none; }
}

/* ------------------------------------------------------------ receipt */

.receipt { padding: 32px; }
.receipt .tick {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px;
  border-radius: 50%; background: var(--ok-bg); color: var(--ok);
}
.receipt .tick svg { width: 22px; height: 22px; }
.receipt h2 { font-size: 22px; letter-spacing: -0.015em; margin-bottom: 6px; }
.receipt > p { margin: 0; color: var(--ink-2); max-width: 60ch; }
.receipt .facts { margin: 24px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.receipt .next { margin-top: 20px; color: var(--muted); font-size: 13.5px; }
@media (max-width: 640px) { .receipt { padding: 22px 18px; } }

/* ------------------------------------------------------------ review */

.tabs { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); max-width: 100%; overflow-x: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 32px; padding: 0 14px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--muted); font: 500 13.5px var(--font); white-space: nowrap;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.on { background: var(--surface-hover); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tab .count {
  min-width: 20px; padding: 1px 6px; border-radius: 999px; text-align: center;
  background: var(--bg); color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.tab.on .count { background: var(--accent-soft); color: var(--accent); }

.review-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 32px; align-items: start; }
.review-bar dl { margin: 0; display: grid; gap: 14px; }
.review-bar dt { color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.review-bar dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.review-bar dd .dot { margin: 0 6px; color: var(--faint); }
.runner {
  padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink-2); font-family: var(--mono); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap;
}
.review-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: 260px; }
.review-actions .hint { margin: 0; }
.review-actions p { margin: 0; font-size: 14px; }
@media (max-width: 720px) { .review-bar { grid-template-columns: 1fr; } .review-actions { width: auto; } }

.edit-track { padding-top: 22px; margin-top: 6px; border-top: 1px solid var(--line); }
.edit-track > h3 { margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
section > .submitbar { margin: 8px -24px -24px; padding: 14px 24px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg); background: var(--surface); }
@media (max-width: 640px) { section > .submitbar { margin: 8px -16px -18px; padding: 14px 16px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
