/* Kumud's ICICI Automations: the sign-in and the workspace.
   Two looks: ICICI daylight (default) and Midnight vault, switched by data-theme on <html>.
   Grid (desktop, 1440): 240 nav + sheet (1440 - 240 - 8 right inset = 1192), content max 1200 centred
   inside 36px sheet padding; one 20px gap between blocks everywhere. */

@font-face {
  font-family: "Red Hat Text";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../brand/fonts/RedHatText-var.woff2") format("woff2");
}

:root {
  --font: "Red Hat Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* ICICI inks */
  --orange: #F06321;
  --maroon: #AE282E;
  --maroon-deep: #86161F;
  --navy: #004A7F;

  /* ICICI daylight */
  --frame: #EEEDE9;
  --sheet: #FAFAF9;
  --sheet-edge: #E3E2DD;
  --glass: rgba(255, 255, 255, 0.74);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --edge: #E2E5E9;
  --rule: #EAEDF0;
  --control: #C4C9CF;
  --input-bg: #FFFFFF;
  --track: rgba(14, 42, 68, 0.07);
  --active: rgba(255, 255, 255, 0.86);
  --hover: rgba(14, 42, 68, 0.05);
  --ink: #0E2A44;
  --muted: #4A5866;
  --faint: #5F6B77;
  --data: #F06321;
  --primary: #AE282E;
  --primary-hover: #86161F;
  --primary-ink: #FFFFFF;
  --check: #AE282E;
  --focus: #004A7F;
  --focus-ring: rgba(0, 74, 127, 0.22);
  --positive: #1F7A4D;
  --negative: #B42318;
  --pill-q-bg: rgba(14, 42, 68, 0.07);   --pill-q-ink: #3D4B59;
  --pill-run-bg: rgba(0, 74, 127, 0.09); --pill-run-ink: #003D69;
  --pill-ok-bg: #DFF3E7;                 --pill-ok-ink: #0B3B22;
  --pill-held-bg: #FDE9DF;               --pill-held-ink: #7C2A06;
  --pill-bad-bg: #FBE7E5;                --pill-bad-ink: #7A1A12;
  --notice-bg: rgba(240, 99, 33, 0.08);
  --notice-edge: rgba(240, 99, 33, 0.28);
  --notice-ink: #6E2604;
  --chip-on: rgba(0, 74, 127, 0.09);
  --chip-on-ink: #003D69;
  --sheen: rgba(240, 99, 33, 0.09);
  --guilloche-1: rgba(240, 99, 33, 0.16);
  --guilloche-2: rgba(174, 40, 46, 0.10);
  --mark-op: 0.05;
  --shadow-rest: 0 1px 1px rgba(6, 21, 35, 0.03), 0 14px 30px -22px rgba(6, 21, 35, 0.28);
  --shadow-lift: 0 2px 4px rgba(6, 21, 35, 0.04), 0 28px 48px -26px rgba(6, 21, 35, 0.36);
  --shadow-float: 0 12px 32px -8px rgba(6, 21, 35, 0.22), 0 2px 6px rgba(6, 21, 35, 0.06);

  --radius-sheet: 16px;
  --radius-card: 16px;
  --radius-control: 10px;
  --gap: 20px;
  --pad: 24px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  /* Midnight vault */
  --frame: #061523;
  --sheet: #0A1D2F;
  --sheet-edge: #14304A;
  --glass: rgba(17, 42, 66, 0.58);
  --glass-strong: rgba(13, 34, 54, 0.96);
  --edge: #23394F;
  --rule: #1D3247;
  --control: rgba(255, 255, 255, 0.26);
  --input-bg: rgba(255, 255, 255, 0.04);
  --track: rgba(255, 255, 255, 0.09);
  --active: rgba(255, 255, 255, 0.08);
  --hover: rgba(255, 255, 255, 0.05);
  --ink: #EDF2F7;
  --muted: #B3C1CE;
  --faint: #93A5B6;
  --data: #FF7A3D;
  --primary: #F06321;
  --primary-hover: #FF7A3D;
  --primary-ink: #061523;
  --check: #F06321;
  --focus: #7FC0F0;
  --focus-ring: rgba(127, 192, 240, 0.25);
  --positive: #5FD39B;
  --negative: #FF8A80;
  --pill-q-bg: rgba(255, 255, 255, 0.08);   --pill-q-ink: #C9D5E0;
  --pill-run-bg: rgba(127, 192, 240, 0.14); --pill-run-ink: #A9D6F7;
  --pill-ok-bg: rgba(95, 211, 155, 0.14);   --pill-ok-ink: #8BE3B8;
  --pill-held-bg: rgba(240, 99, 33, 0.18);  --pill-held-ink: #FFB48C;
  --pill-bad-bg: rgba(255, 138, 128, 0.15); --pill-bad-ink: #FFB0A8;
  --notice-bg: rgba(240, 99, 33, 0.12);
  --notice-edge: rgba(240, 99, 33, 0.34);
  --notice-ink: #FFCDB3;
  --chip-on: rgba(127, 192, 240, 0.14);
  --chip-on-ink: #CFE8FA;
  --sheen: rgba(255, 160, 110, 0.10);
  --guilloche-1: rgba(240, 99, 33, 0.22);
  --guilloche-2: rgba(174, 40, 46, 0.30);
  --mark-op: 0.07;
  --shadow-rest: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -26px rgba(0, 0, 0, 0.7);
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 32px 60px -28px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(240, 99, 33, 0.10);
  --shadow-float: 0 18px 40px -10px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--frame);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -0.005em; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico-lg { width: 28px; height: 28px; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: rgba(240, 99, 33, 0.22); }
.noscript { padding: 24px; font-size: 16px; }

/* ---------- depth background: guilloché layers from a securities certificate ---------- */
.depth { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.depth .layer {
  position: absolute;
  transform: translate3d(calc(var(--px, 0) * var(--d, 10px)), calc(var(--py, 0) * var(--d, 10px)), 0);
  transition: transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.depth svg { display: block; width: 100%; height: 100%; overflow: visible; }
.depth path { fill: none; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.layer-rosette { width: 1000px; height: 1000px; right: -320px; bottom: -420px; color: var(--guilloche-1); --d: 22px; }
.layer-rosette2 { width: 600px; height: 600px; left: -250px; top: -270px; color: var(--guilloche-2); --d: 12px; }
.layer-mark { width: 520px; right: 6%; top: 8%; opacity: var(--mark-op); --d: 34px; }
.layer-mark img { width: 100%; height: auto; display: block; }

/* ---------- glass, tilt and sheen ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-rest);
}
.tilt {
  position: relative;
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s ease;
}
.tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 0%), var(--sheen), transparent 62%);
  opacity: 0;
  transition: opacity 0.45s ease;
}
.tilt.is-tilting { transition: transform 0.12s linear, box-shadow 0.4s ease; box-shadow: var(--shadow-lift); }
.tilt.is-tilting::after { opacity: 1; }

/* ---------- buttons, fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-size: 15px; font-weight: 650; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}
.btn:active:not([disabled]) { transform: translateY(1px) scale(0.985); }
.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--primary:hover:not([disabled]) { background: var(--primary-hover); }
.btn--ghost { background: transparent; border-color: var(--control); color: var(--ink); }
.btn--ghost:hover:not([disabled]) { background: var(--hover); border-color: var(--ink); }
.btn--quiet { background: transparent; color: var(--muted); padding: 0 12px; }
.btn--quiet:hover:not([disabled]) { background: var(--hover); color: var(--ink); }
.btn--sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn--wide { width: 100%; }
.btn[disabled] { background: var(--track); color: var(--faint); cursor: not-allowed; border-color: transparent; }
.btn.is-busy { cursor: progress; }
.link { color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--control); text-underline-offset: 3px; background: none; border: 0; padding: 0; }
.link:hover { text-decoration-color: currentColor; }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label, legend { font-size: 14px; font-weight: 650; color: var(--ink); }
input[type="email"], input[type="password"], input[type="text"] {
  height: 46px; width: 100%; padding: 0 14px; border-radius: var(--radius-control);
  border: 1px solid var(--control); background: var(--input-bg); color: var(--ink); font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input[type="email"]:focus, input[type="password"]:focus, input[type="text"]:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); outline: none; }
.input-with-btn { position: relative; }
.input-with-btn input { padding-right: 52px; }
.input-btn { position: absolute; right: 4px; top: 4px; width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.input-btn:hover, .input-btn[aria-pressed="true"] { color: var(--ink); background: var(--hover); }
.form-msg { font-size: 14px; color: var(--muted); }
.form-msg:empty { display: none; }
.form-msg.is-error { color: var(--negative); font-weight: 550; }
.form-msg.is-ok { color: var(--positive); font-weight: 550; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 10px; }

/* theme switch */
.theme-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px;
  border-radius: 999px; border: 1px solid var(--control); background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 600; transition: background-color 0.2s ease;
}
.theme-btn:hover { background: var(--hover); }
.theme-btn .ico-sun { display: none; }
:root[data-theme="dark"] .theme-btn .ico-sun { display: block; }
:root[data-theme="dark"] .theme-btn .ico-moon { display: none; }
.theme-btn--icon { width: 38px; padding: 0; justify-content: center; }

/* ---------- entry: the name in 3D and one passkey field ---------- */
.signin {
  position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: max(18px, env(safe-area-inset-top)) clamp(16px, 4vw, 56px) max(14px, env(safe-area-inset-bottom));
  background: var(--frame);
}
.maybe-signed-in .signin { visibility: hidden; animation: reveal 0s 2.5s forwards; }
@keyframes reveal { to { visibility: visible; } }
.signin-bar { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mark-chip { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 10px; background: #FFFFFF; box-shadow: 0 1px 2px rgba(6, 21, 35, 0.08); }
.mark-chip img { display: block; height: 30px; width: auto; }
.signin-centre {
  position: relative; z-index: 1; width: 100%; max-width: 1000px; margin: 0 auto;
  display: grid; justify-items: center; align-content: center; gap: clamp(18px, 3vh, 30px); padding-block: 16px;
}
.hero-name { display: grid; justify-items: center; gap: 4px; margin: 0; width: 100%; font-size: 16px; font-weight: 600; }
.hero-stage { position: relative; display: block; width: min(940px, 100%); aspect-ratio: 3.3; }
.hero-stage .word-static { position: absolute; left: 50%; top: 50%; width: 86%; height: auto; transform: translate(-50%, -50%); transition: opacity 0.7s ease; }
.hero-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.7s ease; }
.hero-stage.is-3d canvas { opacity: 1; }
.hero-stage.is-3d .word-static { opacity: 0; }
/* Midnight vault: a warm light behind the name (drawn for the static word too) */
.hero-stage::before {
  content: ""; position: absolute; left: 50%; top: 52%; width: 82%; height: 150%; pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 138, 72, 0.42), rgba(240, 99, 33, 0.16) 50%, rgba(174, 40, 46, 0.05) 75%, rgba(174, 40, 46, 0));
  opacity: 0; transition: opacity 0.8s ease;
}
:root[data-theme="dark"] .hero-stage::before { opacity: 1; animation: glow 6s ease-in-out infinite; }
@keyframes glow { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.05); } }
.hero-sub { display: block; font-size: clamp(20px, 2.4vw, 28px); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.passkey { width: min(460px, 100%); border-radius: 20px; padding: 20px 22px 18px; display: grid; gap: 10px; }
.passkey label { font-size: 14px; font-weight: 650; }
.passkey-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.passkey-row .btn { height: 46px; padding: 0 26px; }
.signin .foot { position: relative; z-index: 1; padding-top: 12px; }

/* ---------- the app shell ---------- */
.app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
  height: 100vh; height: 100dvh;
  background: var(--frame);
}
.topbar {
  grid-column: 1 / -1; position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 16px 0 18px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark { width: 24px; height: auto; flex: none; }
.brand-word { height: 24px; width: auto; flex: none; }
.brand-sub { font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap; padding-left: 12px; border-left: 2px solid var(--orange); line-height: 1; }
.topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.delivery { font-size: 13px; color: var(--muted); white-space: nowrap; margin-right: 6px; }
.delivery b { color: var(--ink); font-weight: 600; }
.lock { gap: 6px; }

.nav { grid-row: 2; grid-column: 1; padding: 10px 12px 16px; overflow-y: auto; }
.tablist { display: grid; gap: 4px; }
.tablist [role="tab"] {
  position: relative; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted);
  font-size: 15px; font-weight: 550; text-align: left; transition: background-color 0.2s ease, color 0.2s ease;
}
.tablist [role="tab"]:hover { background: var(--hover); color: var(--ink); }
.tablist [role="tab"][aria-selected="true"] { background: var(--active); color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgba(6, 21, 35, 0.06); }
.tablist [role="tab"][aria-selected="true"] .ico { color: var(--orange); }
.tab-short { display: none; }
.tab-count {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--pill-run-bg); color: var(--pill-run-ink); font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
}

.sheet {
  grid-row: 2; grid-column: 2; position: relative; min-height: 0;
  margin: 0 8px 8px 0; border-radius: var(--radius-sheet);
  border: 1px solid var(--sheet-edge); background: var(--sheet); overflow: hidden;
}
.sheet-scroll {
  position: absolute; inset: 0; z-index: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 32px clamp(20px, 3vw, 36px) 20px;
  perspective: 1800px;
}
.view { max-width: 1200px; margin: 0 auto; }
.view.turn-in { animation: turn-in 0.44s cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-origin: 50% 20%; }
@keyframes turn-in {
  from { opacity: 0; transform: rotateY(var(--turn, -8deg)) translate3d(var(--shift, -22px), 0, -40px); }
  to { opacity: 1; transform: none; }
}

.title-row { margin-bottom: 24px; }
.title-row h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.015em; }
.title-row h1:focus { outline: none; }
.title-sub { margin-top: 6px; font-size: 15px; color: var(--muted); max-width: 72ch; }
.title-last { margin-top: 4px; font-size: 14px; color: var(--faint); max-width: 90ch; }

/* ---------- cards ---------- */
.card { border-radius: var(--radius-card); padding: var(--pad); margin-bottom: var(--gap); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px 32px; margin-bottom: 20px; }
.card-head h2 { font-size: 19px; }
.card-sub { margin-top: 6px; font-size: 14px; color: var(--muted); max-width: 66ch; }
.card-actions { display: flex; align-items: center; gap: 16px; flex: none; }
.count { font-size: 14px; color: var(--muted); white-space: nowrap; }

/* sources (step one): read-only, what every collection reads */
.sources { columns: 4 210px; column-gap: 32px; }
.src-group { break-inside: avoid; margin-bottom: 20px; }
.src-group-head { display: flex; align-items: baseline; gap: 8px; padding-bottom: 6px; margin-bottom: 4px; font-size: 14px; font-weight: 700; border-bottom: 2px solid var(--orange); }
.src-group-head .n { margin-left: auto; font-weight: 500; color: var(--muted); font-size: 13px; }
.src-list { list-style: none; margin: 0; padding: 0; }
.src { padding: 5px 0; font-size: 14px; line-height: 1.4; color: var(--ink); }
.src-from { color: var(--muted); }
/* step one's launch column: the optional Report 1B picker above Run collection */
.card-head--launch > div:first-child { flex: 1 1 auto; min-width: 0; }
.launch { flex: 0 0 380px; display: grid; gap: 14px; min-width: 0; }
.launch .card-actions { justify-content: flex-end; }
.b1pick { display: grid; gap: 8px; min-width: 0; }
.b1pick-title { font-size: 14px; font-weight: 650; color: var(--ink); }
.drop.drop--sm {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px; text-align: left;
  min-height: 0; padding: 11px 14px; border-radius: 12px;
}
.drop--sm .ico { width: 22px; height: 22px; color: var(--orange); }
.drop-text { display: grid; gap: 1px; min-width: 0; }
.drop--sm .drop-main { font-size: 14px; }
.drop--sm .drop-sub { font-size: 12.5px; }
.picked--sm { min-height: 50px; padding: 6px 6px 6px 14px; }
.picked--sm .dismiss { margin: 0; }
.b1pick-help { font-size: 13px; line-height: 1.45; color: var(--muted); }
.b1pick.is-busy .drop, .b1pick.is-busy .picked { opacity: 0.6; cursor: progress; }
.b1pick.is-busy .dismiss { cursor: progress; }
/* run options (step one): a quiet strip under the head; open, six small fields with their ranges */
.run-opts { margin: -4px 0 22px; border: 1px solid var(--edge); border-radius: 12px; background: var(--input-bg); }
.run-opts > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap;
  min-height: 46px; padding: 8px 12px 8px 14px; border-radius: 12px;
}
.run-opts > summary::-webkit-details-marker { display: none; }
.run-opts > summary:hover { background: var(--hover); }
.run-opts > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.run-opts-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.run-opts-label .ico { width: 18px; height: 18px; color: var(--orange); }
.run-opts-sum { flex: 1 1 280px; min-width: 0; font-size: 13.5px; color: var(--muted); }
.run-opts-sum b { font-weight: 650; color: var(--ink); margin-right: 2px; }
.run-opts.is-changed .run-opts-sum b { color: var(--chip-on-ink); background: var(--chip-on); padding: 1px 7px; border-radius: 999px; }
.run-opts-chev { width: 18px; height: 18px; color: var(--muted); margin-left: auto; transition: transform 0.25s ease; }
.run-opts[open] .run-opts-chev { transform: rotate(180deg); }
.run-opts[open] > summary { border-bottom: 1px solid var(--rule); border-radius: 12px 12px 0 0; }
.run-opts-body { padding: 14px 16px 16px; display: grid; gap: 16px; }
.run-opts-intro { font-size: 13.5px; color: var(--muted); max-width: 80ch; }
.opt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
.opt { display: grid; grid-template-rows: auto auto auto; align-content: start; gap: 6px; min-width: 0; }
.opt > label, .opt > legend { font-size: 14px; font-weight: 650; color: var(--ink); margin: 0; padding: 0; line-height: 1.3; }
.opt input[type="number"], .opt select {
  height: 42px; width: 100%; max-width: 132px; padding: 0 10px 0 12px; border-radius: var(--radius-control);
  border: 1px solid var(--control); background: var(--sheet); color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.opt input[type="number"]:focus, .opt select:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); outline: none; }
.opt-month { display: flex; gap: 8px; }
.opt-month select { max-width: 104px; }
.opt-hint { font-size: 12.5px; color: var(--faint); }
.opt-note { font-size: 12.5px; font-weight: 600; color: var(--notice-ink); }
.opt-note:empty { display: none; }
.run-opts-foot { display: flex; justify-content: flex-end; }
.sources-loading { display: grid; gap: 4px; column-span: all; }
.skel { display: block; height: 14px; border-radius: 6px; background: var(--track); width: 60%; }
.skel:nth-child(2) { width: 75%; } .skel:nth-child(3) { width: 45%; }
.block-error { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--control); font-size: 14px; color: var(--muted); column-span: all; }

/* the makers (step two, newsletter) */
.maker { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.maker-file { display: grid; gap: 12px; }
.drop {
  display: grid; place-items: center; align-content: center; gap: 8px; text-align: center;
  min-height: 210px; padding: 28px 20px; border-radius: 14px; border: 1.5px dashed var(--control);
  background: var(--input-bg); color: var(--muted); cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}
.drop .ico-lg { color: var(--ink); }
.drop:hover, .drop.is-over { border-color: var(--orange); background: rgba(240, 99, 33, 0.05); }
.drop.is-over { transform: scale(1.01); }
.drop:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.drop-main { font-size: 15px; color: var(--ink); font-weight: 550; }
.drop-main u { text-decoration-color: var(--orange); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.drop-sub { font-size: 13px; }
.picked {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  min-height: 48px; padding: 6px 6px 6px 14px; border-radius: 12px; background: var(--chip-on); color: var(--chip-on-ink);
}
.picked-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; color: var(--ink); }
.picked-size { font-size: 13px; color: var(--muted); white-space: nowrap; }
.maker-opts { display: grid; gap: 18px; align-content: center; }
/* the newsletter's HTML designs: ten ticks in two columns, Select all above */
.designs { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.designs-legend { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; padding: 0; font-size: 14px; font-weight: 650; color: var(--ink); }
.designs-count { font-size: 12.5px; font-weight: 600; color: var(--faint); }
.design-all, .design-chip { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px; border-radius: var(--radius-control); cursor: pointer; font-size: 13.5px; color: var(--ink); line-height: 1.25; }
.design-all { padding-left: 2px; font-weight: 600; min-height: 30px; }
.design-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.design-chip { border: 1px solid var(--rule); background: var(--input-bg); transition: border-color 0.18s ease, background-color 0.18s ease; }
.design-chip:hover { border-color: var(--control); }
.design-chip:has(input:checked) { border-color: var(--focus); background: var(--chip-on); color: var(--chip-on-ink); }
.design-chip:focus-within, .design-all:focus-within { box-shadow: 0 0 0 3px var(--focus-ring); }
.design-chip input, .design-all input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); flex: none; }
.design-n { flex: none; width: 1.4em; text-align: center; font-size: 12px; font-weight: 700; color: var(--faint); }
.design-name { min-width: 0; overflow-wrap: anywhere; }
.design-name em { font-style: normal; color: var(--faint); font-size: 12px; }
.designs-note { font-size: 12.5px; color: var(--faint); margin: 2px 0 0; }
.you-get { font-size: 15px; color: var(--muted); max-width: 44ch; }
.you-get strong { color: var(--ink); font-weight: 650; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--control); font-size: 14px; font-weight: 600; color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.chip span::before {
  content: ""; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid currentColor; opacity: 0.7;
  background: center / 12px 12px no-repeat;
}
.chip input:checked + span { background: var(--chip-on); color: var(--chip-on-ink); border-color: transparent; }
.chip input:checked + span::before {
  opacity: 1; border-color: transparent; background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
}
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip:hover span { border-color: var(--ink); }
.maker-go { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; }
.go-note { font-size: 13px; color: var(--muted); }

/* market overview */
.overview-form { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.ov-window h2 { font-size: 19px; }
.ov-readout { margin-top: 10px; display: flex; align-items: baseline; gap: 10px; }
.ov-n { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.ov-unit { font-size: 18px; font-weight: 600; color: var(--muted); }
.ov-range { margin-top: 6px; font-size: 15px; color: var(--muted); }
#ovMonths { width: 100%; height: 44px; margin: 14px 0 6px; accent-color: var(--orange); cursor: pointer; }
.ov-strip { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; }
.ov-cell { display: grid; gap: 4px; justify-items: center; }
.ov-cell i { display: block; width: 100%; height: 26px; border-radius: 4px; background: var(--track); transition: background-color 0.25s ease, transform 0.25s ease; }
.ov-cell.on i { background: var(--data); }
.ov-cell b { font-size: 11px; font-weight: 500; color: var(--muted); line-height: 1; }
.ov-cell.year b { color: var(--ink); font-weight: 700; }
.ov-opts { display: grid; gap: 22px; padding-top: 4px; }

/* job lists */
.runs-block { margin-top: 32px; }
.block-title { font-size: 17px; margin-bottom: 14px; }
.runs { display: grid; gap: 14px; }
.dismiss { flex: none; width: 32px; height: 32px; margin: -4px -6px 0 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.dismiss:hover { background: var(--hover); color: var(--ink); }
.job-actions { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.job-actions .form-msg { margin: 0; }

.job { border-radius: var(--radius-card); padding: 18px 20px 16px; }
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.job-head > div { min-width: 0; flex: 1; }
.job-title { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.job-meta { margin-top: 3px; font-size: 13px; color: var(--muted); }
.pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px;
  border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--working { background: var(--pill-run-bg); color: var(--pill-run-ink); }
.pill--working::before { animation: pulse 1.4s ease-in-out infinite; }
.pill--sent, .pill--late { background: var(--pill-ok-bg); color: var(--pill-ok-ink); }

@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.75); } }

.job-progress { margin-top: 14px; }
.bar { position: relative; height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > span { position: relative; display: block; height: 100%; width: 0; border-radius: inherit; background: var(--data); transition: width 1.2s linear; overflow: hidden; }
.job[data-status="working"] .bar > span::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
  background: rgba(255, 255, 255, 0.38); transform: translateX(-120%); animation: sheen 1.8s ease-in-out infinite;
}
@keyframes sheen { to { transform: translateX(260%); } }
.job-step { margin-top: 10px; font-size: 14px; color: var(--ink); }
/* a collection's Report 1B result, one line */
.job-1b { margin-top: 8px; display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--ink); }
.job-1b .ico { width: 20px; height: 20px; padding: 2px; border-radius: 50%; stroke-width: 2.4; background: var(--pill-ok-bg); color: var(--pill-ok-ink); }
.job-1b[data-kind="none"] { color: var(--muted); }
.job-1b[data-kind="none"] .ico { background: var(--pill-q-bg); color: var(--pill-q-ink); }
.job-1b[data-kind="bad"] .ico { background: var(--pill-held-bg); color: var(--pill-held-ink); }
.job-done-line { margin-top: 10px; font-size: 13px; color: var(--muted); }
.job-error { margin-top: 12px; font-size: 14px; color: var(--negative); font-weight: 550; }


/* email creator slot */
.mail-root { position: relative; min-height: 320px; }
.mail-wait { display: flex; align-items: center; gap: 12px; padding: 28px; border-radius: var(--radius-card); font-size: 15px; color: var(--muted); }
.mail-wait .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--track); border-top-color: var(--data); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mail-down { padding: 24px; border-radius: var(--radius-card); display: grid; gap: 12px; justify-items: start; }
.mail-down h2 { font-size: 18px; }
.mail-down p { font-size: 15px; color: var(--muted); max-width: 60ch; }

/* toasts */
.toasts { position: fixed; z-index: 60; right: 16px; bottom: 20px; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
  padding: 14px 12px 14px 16px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--edge);
  box-shadow: var(--shadow-float); font-size: 14px; animation: toast-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.toast strong { display: block; font-size: 15px; }
.toast span { color: var(--muted); }
.toast button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.toast button:hover { background: var(--hover); color: var(--ink); }
.toast.is-leaving { animation: toast-out 0.25s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translate3d(0, -10px, 0) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translate3d(0, -6px, 0); } }

/* footer */
.foot { padding: 28px 0 6px; font-size: 12.5px; color: var(--muted); text-align: center; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- tablet: tabs move under the top bar ---------- */
@media (max-width: 1099px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 60px auto minmax(0, 1fr); }
  .nav { grid-row: 2; grid-column: 1; padding: 0 12px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .tablist { display: flex; gap: 2px; }
  .tablist[aria-orientation] { flex-direction: row; }
  .tablist [role="tab"] { height: 46px; border-radius: 0; flex: none; padding: 0 12px; }
  .tablist [role="tab"][aria-selected="true"] { background: transparent; box-shadow: inset 0 -2px 0 var(--orange); }
  .tablist [role="tab"]:hover { background: transparent; }
  .sheet { grid-row: 3; grid-column: 1; margin: 0 8px 8px; }
  .delivery { display: none; }
  .maker { grid-template-columns: minmax(0, 1fr); }
  .drop { min-height: 150px; }
  .overview-form { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .opt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* the launch block goes under the heading: the picker, then the count and Run collection under it */
  .card-head--launch { flex-direction: column; align-items: stretch; }
  .launch { flex: none; width: 100%; max-width: 560px; }
  .launch .card-actions { justify-content: space-between; }
}
@media (max-width: 900px) {
  .lock span { display: none; }
  .lock { width: 40px; padding: 0; }
}

/* ---------- phone: one region, tabs at the bottom ---------- */
@media (max-width: 699px) {
  .app { display: block; height: auto; min-height: 100dvh; }
  .topbar { position: sticky; top: 0; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 14px; background: var(--frame); }
  .brand { gap: 9px; }
  .brand-word { height: 21px; }
  .brand-sub { font-size: 13px; padding-left: 9px; }
  .nav {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 4px 6px max(6px, env(safe-area-inset-bottom));
    background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--edge); overflow: visible;
  }
  .tablist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
  .tablist [role="tab"] {
    flex-direction: column; justify-content: center; gap: 3px; height: 56px; padding: 0 2px;
    border-radius: 12px; font-size: 12px; font-weight: 600; text-align: center;
  }
  .tablist [role="tab"][aria-selected="true"] { box-shadow: none; background: var(--active); }
  .tab-long { display: none; }
  .tab-short { display: inline; }
  .tab-count { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; margin: 0; }
  .sheet { margin: 0; border: 0; border-radius: 0; overflow: visible; min-height: calc(100dvh - 56px); }
  .sheet-scroll { position: relative; inset: auto; overflow: visible; padding: 20px 16px calc(88px + env(safe-area-inset-bottom)); }
  .title-row h1 { font-size: 23px; }
  .title-row { margin-bottom: 18px; }
  .card { padding: 18px; }
  .card-head { flex-direction: column; gap: 14px; }
  .card-actions { width: 100%; justify-content: space-between; }
  .sources { columns: 1; }
  .src-group { margin-bottom: 14px; }
  .src-list { display: flex; flex-wrap: wrap; column-gap: 0.35em; padding-top: 4px; }
  .src { padding: 1px 0; }
  .src:not(:last-child)::after { content: ","; }
  .src-from { display: none; }
  .job { padding: 16px; }
  .run-opts { margin: -2px 0 18px; }
  .run-opts > summary { padding: 8px 10px 8px 12px; }
  .run-opts-sum { order: 3; flex-basis: 100%; }
  .run-opts-body { padding: 12px 12px 14px; }
  .opt-grid { gap: 14px 14px; }
  .opt--month { grid-column: 1 / -1; }
  .layer-rosette2 { display: none; }
  .ov-cell b { font-size: 10.5px; }
  .ov-strip { gap: 2px; }
  .ov-n { font-size: 36px; }
  .layer-rosette { width: 620px; height: 620px; right: -260px; bottom: -200px; }
  .layer-mark { display: none; }
  .toasts { top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .mark-chip img { height: 26px; }
  .hero-stage { aspect-ratio: 2.6; }
  .hero-stage .word-static { width: 92%; }
  .passkey { padding: 18px; }
  .passkey-row { grid-template-columns: minmax(0, 1fr); }
  .passkey-row .btn { width: 100%; }
}

/* ---------- reduced motion: content stays, travel goes ---------- */
@media (prefers-reduced-motion: reduce) {
  .tilt, .tilt.is-tilting { transform: none !important; transition: box-shadow 0.2s ease; }
  .tilt::after { display: none; }
  .depth .layer { transform: none !important; transition: none; }
  .view.turn-in { animation: none; }
  .bar > span { transition: none; }
  .job[data-status="working"] .bar > span::after, .pill--working::before, .mail-wait .spin { animation: none; }
  .run-opts-chev { transition: none; }
  :root[data-theme="dark"] .hero-stage::before { animation: none; }
  .drop.is-over { transform: none; }
  .toast, .toast.is-leaving { animation: none; }
  .hero-stage canvas, .hero-stage .word-static { transition: none; }
}
.runs-block--step { margin: 0 0 28px; }
