/* 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; }

/* custom ticks */
.tick input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 18px; height: 18px; margin: 0; border-radius: 5px; border: 1.5px solid var(--control);
  background: var(--input-bg) center / 14px 14px no-repeat; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.tick input[type="checkbox"]:checked {
  background-color: var(--check); border-color: var(--check);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .tick input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23061523' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

/* 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; }

/* ---------- sign-in ---------- */
.signin {
  position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: max(20px, env(safe-area-inset-top)) clamp(16px, 4vw, 56px) max(16px, 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; }
.signin-scope { font-size: 14px; font-weight: 600; color: var(--muted); }
.signin-grid {
  position: relative; z-index: 1; width: 100%; max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 440px); gap: clamp(24px, 6vw, 96px);
  align-items: center; padding-block: 24px;
}
.hero-stage {
  position: relative; width: 100%; max-width: 600px; justify-self: center;
  aspect-ratio: 0.9; max-height: min(74vh, 660px);
}
.hero-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.7s ease; }
/* Midnight vault: the emblem glows from behind (works for the static logo too) */
.hero-stage::before, .badge3d::before {
  content: ""; position: absolute; left: 50%; top: 34%; width: 118%; aspect-ratio: 1; pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 138, 72, 0.50), rgba(240, 99, 33, 0.20) 45%, rgba(174, 40, 46, 0.07) 72%, rgba(174, 40, 46, 0));
  opacity: 0; transition: opacity 0.8s ease;
}
.badge3d::before { top: 50%; width: 190%; }
:root[data-theme="dark"] .hero-stage::before, :root[data-theme="dark"] .badge3d::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.06); } }
.hero-stage.is-3d canvas { opacity: 1; }
.lockup-static {
  position: absolute; inset: 0; margin: auto; height: 100%; aspect-ratio: 0.9;
  max-width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5.8%;
  transition: opacity 0.7s ease;
}
.hero-stage.is-3d .lockup-static { opacity: 0; }
.lockup-emblem { height: 55.6%; width: auto; }
.lockup-plate {
  container-type: inline-size;
  width: 88%; aspect-ratio: 2.93; background: #FFFFFF; border-radius: 3cqi;
  padding: 6.3cqi; display: flex; flex-direction: column; gap: 2.8cqi;
  box-shadow: 0 18px 40px -24px rgba(6, 21, 35, 0.45);
}
.lockup-word { width: 100%; height: auto; display: block; }
.lockup-band {
  display: grid; place-items: center; height: 7.7cqi; background: var(--orange); color: #FFFFFF;
  font-size: 4.2cqi; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; line-height: 1;
  padding-left: 0.24em;
}
.signin-card { border-radius: 22px; padding: clamp(24px, 3vw, 36px); }
.signin-card h1 { font-size: 30px; letter-spacing: -0.015em; line-height: 1.12; }
.signin-lede { margin: 12px 0 26px; font-size: 16px; color: var(--muted); max-width: 40ch; }
.signin .foot { position: relative; z-index: 1; }

/* ---------- 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; }
.badge3d { position: relative; width: 42px; height: 42px; flex: none; display: grid; place-items: center; }
.badge3d .badge-static { width: 34px; height: auto; transition: opacity 0.5s ease; }
.badge3d canvas { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); opacity: 0; transition: opacity 0.6s ease; }
.badge3d.is-3d canvas { opacity: 1; }
.badge3d.is-3d .badge-static { opacity: 0; }
.brand-text { display: grid; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.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; }
.who { display: grid; text-align: right; line-height: 1.2; padding: 0 4px 0 8px; }
.who-name { font-size: 14px; font-weight: 650; }
.who-role { font-size: 12px; color: var(--muted); }
.signout { gap: 6px; }
.live-runs {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 0; background: var(--pill-run-bg); color: var(--pill-run-ink); font-size: 13px; font-weight: 650;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--data); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.75); } }
.account-btn {
  display: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--control);
  background: var(--active); color: var(--ink); font-weight: 700; font-size: 15px; place-items: center;
}
.account-menu {
  position: absolute; right: 12px; top: 58px; width: min(320px, calc(100vw - 24px));
  display: grid; gap: 14px; padding: 18px; border-radius: 16px;
  background: var(--glass-strong); border: 1px solid var(--edge); box-shadow: var(--shadow-float);
}
.account-who { display: grid; }
.account-who strong { font-size: 16px; }
.account-who span, .account-delivery { font-size: 13px; color: var(--muted); }
.account-delivery b { color: var(--ink); }
.account-menu .btn { justify-self: start; padding-left: 10px; }

.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; }
.signin .layer-mark { display: none; }

/* ---------- 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); }
.todo { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--chip-on); color: var(--ink); font-size: 14px; }
.todo strong { display: block; font-weight: 650; margin-bottom: 4px; }
.todo ul { margin: 0; padding-left: 18px; }
.todo li { margin: 2px 0; }
.todo p { margin: 0; }
.todo .todo-from { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.card-head .todo { max-width: 66ch; }
.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, 1fr) minmax(0, 1.15fr); gap: 28px; align-items: start; }
.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: 22px; }

.tpl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tpl { position: relative; display: grid; gap: 10px; justify-items: center; padding: 14px 10px 12px; border-radius: 14px; border: 1.5px solid var(--edge); background: var(--input-bg); cursor: pointer; transition: border-color 0.2s ease, transform 0.2s ease; }
.tpl:hover { transform: translateY(-2px); }
.tpl input { position: absolute; opacity: 0; pointer-events: none; }
.tpl:has(input:checked) { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.tpl:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.tpl-name { font-size: 14px; font-weight: 600; text-align: center; line-height: 1.25; }
.tpl:has(input:checked) .tpl-name { font-weight: 700; }
.tpl-face { position: relative; display: block; width: 58px; height: 74px; border-radius: 5px; overflow: hidden; }
.tpl-face i { position: absolute; left: 8px; right: 8px; height: 4px; border-radius: 2px; }
.tpl-face--classic { background: #FFFFFF; box-shadow: inset 0 0 0 1px #D8D6D0, inset 0 10px 0 #F06321; }
.tpl-face--classic i { background: #D5D9DE; }
.tpl-face--classic i:nth-child(1) { top: 20px; background: #AE282E; right: 22px; }
.tpl-face--classic i:nth-child(2) { top: 32px; }
.tpl-face--classic i:nth-child(3) { top: 42px; right: 18px; }
.tpl-face--vault { background: #0B2338; box-shadow: inset 0 0 0 1px #1E3B57; }
.tpl-face--vault i { background: #36536E; }
.tpl-face--vault i:nth-child(1) { top: 14px; background: #F06321; right: 26px; }
.tpl-face--vault i:nth-child(2) { top: 28px; }
.tpl-face--vault i:nth-child(3) { top: 38px; right: 20px; }
.tpl-face--both { background: none; overflow: visible; }
.tpl-face--both b { position: absolute; width: 44px; height: 58px; }
.tpl-face--both b:first-child { left: 0; top: 0; }
.tpl-face--both b:last-child { right: 0; bottom: 0; }
.tpl-face--both i { left: 6px; right: 6px; }

.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); }

.tick { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 14px; }
.tick input { margin-top: 2px; }
.tick b { font-weight: 650; display: block; }
.tick-sub { display: block; color: var(--muted); }
.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-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.block-head h2 { font-size: 17px; }
.jobs { display: grid; gap: 14px; }
.jobs-empty { padding: 16px 18px; border-radius: 12px; border: 1px dashed var(--control); font-size: 14px; color: var(--muted); }

.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--queued { background: var(--pill-q-bg); color: var(--pill-q-ink); }
.pill--running { background: var(--pill-run-bg); color: var(--pill-run-ink); }
.pill--running::before { animation: pulse 1.4s ease-in-out infinite; }
.pill--done { background: var(--pill-ok-bg); color: var(--pill-ok-ink); }
.pill--held { background: var(--pill-held-bg); color: var(--pill-held-ink); }
.pill--failed { background: var(--pill-bad-bg); color: var(--pill-bad-ink); }

.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="running"] .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[data-status="queued"] .bar > span { width: 4% !important; opacity: 0.5; }
.job-step { margin-top: 9px; display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.job-step .pct { font-weight: 700; min-width: 3.4ch; }
.job-step .step { color: var(--muted); }
.job-done-line { margin-top: 10px; font-size: 13px; color: var(--muted); }
.notice { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--notice-bg); border: 1px solid var(--notice-edge); color: var(--notice-ink); font-size: 14px; }
.job-error { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; color: var(--negative); font-weight: 550; }

.files-head { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-top: 16px; }
.files-head h4 { font-size: 14px; font-weight: 650; }
.files-head h4 .num { color: var(--muted); font-weight: 500; }
.file-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); column-gap: 32px; }
.file-list li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 56px; padding: 7px 0; border-top: 1px solid var(--rule); }
.file-list .ico { color: var(--muted); width: 18px; height: 18px; }
.file-text { display: grid; gap: 1px; min-width: 0; }
.file-name { font-size: 14px; overflow-wrap: anywhere; line-height: 1.35; }
.file-meta { font-size: 13px; color: var(--muted); white-space: nowrap; line-height: 1.35; }
.dl { gap: 6px; }
.dl .ico { color: currentColor; }
.job-mail { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.job-mail .ico { width: 16px; height: 16px; }
.job-files .form-msg { margin-top: 8px; }

/* runs filter */
.filter { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--track); margin-bottom: 20px; max-width: 100%; }
.filter button { height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.filter button .num { color: var(--faint); font-weight: 500; margin-left: 2px; }
.filter button:hover { color: var(--ink); }
.filter button[aria-checked="true"] { background: var(--active); color: var(--ink); box-shadow: 0 1px 3px rgba(6, 21, 35, 0.10); }
.conn-msg { margin-bottom: 14px; font-size: 14px; color: var(--muted); }

/* 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; top: 76px; 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; }
}
@media (max-width: 900px) {
  .who, .signout, .topbar-right > .theme-btn { display: none; }
  .account-btn { display: grid; }
  .signin-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: 520px; padding-block: 12px; }
  .hero-stage { max-height: none; height: clamp(220px, 40vh, 380px); aspect-ratio: auto; max-width: 100%; }
}

/* ---------- 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-text span { display: none; }
  .brand-text strong { font-size: 15px; }
  .badge3d { width: 36px; height: 36px; }
  .badge3d .badge-static { width: 30px; }
  .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(5, 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; }
  .tpl-grid { gap: 8px; }
  .tpl { padding: 12px 6px 10px; }
  .tpl-name { font-size: 13px; }
  .job { padding: 16px; }
  .file-list li { grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; }
  .file-list .dl { width: 44px; height: 44px; padding: 0; }
  .file-list .dl span { display: none; }
  .layer-rosette2 { display: none; }
  .filter { display: flex; flex-wrap: nowrap; overflow-x: auto; border-radius: 14px; scrollbar-width: none; }
  .filter::-webkit-scrollbar { 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)); }
  .signin-card h1 { font-size: 26px; }
  .signin-lede { margin: 10px 0 20px; font-size: 15px; }
  .signin-scope { font-size: 13px; }
}

/* ---------- 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="running"] .bar > span::after, .pulse, .pill--running::before, .mail-wait .spin { animation: none; }
  :root[data-theme="dark"] .hero-stage::before, :root[data-theme="dark"] .badge3d::before { animation: none; }
  .tpl:hover, .drop.is-over { transform: none; }
  .toast, .toast.is-leaving { animation: none; }
  .hero-stage canvas, .lockup-static, .badge3d canvas, .badge3d .badge-static { transition: none; }
}
