:root {
  --orange: #FF7B25; --orange-light: #FF9B52; --orange-deep: #F05A0A;
  --cream: #FFEDE2; --paper: #FFF8F3; --yellow: #FCD77B;
  --dark: #2E2626; --muted: #7A6E6A; --line: #EADBD1; --red: #C0392B;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Open Sans", system-ui, sans-serif; color: var(--dark); background: var(--paper); }
h1, h2, h3, .brandmark, .tabs button { font-family: "Teko", sans-serif; text-transform: uppercase; letter-spacing: .5px; }
h1 { font-size: 40px; margin: 0 0 8px; line-height: 1; }
h2 { font-size: 30px; margin: 0 0 6px; line-height: 1; }
h3 { font-size: 24px; margin: 0; line-height: 1; }
code { background: var(--cream); padding: 1px 5px; border-radius: 4px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 1.2em; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px;
  background: linear-gradient(135deg, var(--orange-light), var(--orange), var(--orange-deep)); color: #fff; }
.brandmark { font-size: 34px; display: flex; align-items: center; gap: 12px; line-height: 1; }
.brandmark img { height: 26px; width: auto; display: block; }
.brandmark span { opacity: .8; padding-top: 5px; }
.who { font-size: 14px; display: flex; gap: 12px; align-items: center; }
.who button { background: rgba(255,255,255,.2); color: #fff; border: 1px solid #fff; }

.panel { background: #fff; border-radius: 16px; padding: 24px; margin: 32px auto; box-shadow: 0 6px 24px rgba(255,123,37,.08); }
.narrow { max-width: 420px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=time], input[type=search], textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-weight: 400; background: #fff; }
textarea { min-height: 70px; resize: vertical; }
button { font: inherit; font-weight: 700; border: 1px solid var(--line); background: #fff; color: var(--dark);
  padding: 9px 16px; border-radius: 10px; cursor: pointer; }
button.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
button.danger { color: var(--red); border-color: #f1c4bf; }
button:disabled { opacity: .5; cursor: default; }
input:disabled, select:disabled, textarea:disabled { background: var(--paper); color: var(--muted); cursor: not-allowed; }

main { max-width: 1100px; margin: 0 auto; padding: 16px 24px 60px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--line); }
.tabs button { font-size: 24px; border: none; background: none; padding: 6px 14px; border-bottom: 3px solid transparent;
  margin-bottom: -2px; border-radius: 0; color: var(--muted); }
.tabs button.active { color: var(--orange); border-bottom-color: var(--orange); }
.brandbar { margin: 14px 0 20px; display: flex; gap: 10px; align-items: center; font-weight: 600; }
.brandbar select { width: auto; margin: 0; }

.card { background: #fff; border-radius: 14px; padding: 18px; margin-bottom: 16px; box-shadow: 0 4px 16px rgba(255,123,37,.07); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.note { background: var(--cream); padding: 10px 12px; border-radius: 10px; font-size: 14px; }

/* iPhone preview */
.phone { width: 200px; height: 410px; border-radius: 30px; border: 8px solid var(--dark); overflow: hidden; position: relative;
  margin: 10px auto; background: linear-gradient(135deg, var(--orange-light), var(--orange), var(--orange-deep));
  background-size: cover; background-position: center; color: #fff; }
.phone .scrim { position: absolute; inset: 0; background: var(--bg-scrim, linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.15), rgba(0,0,0,.55))); }
.phone .content { position: absolute; inset: 0; padding: 26px 14px; display: flex; flex-direction: column; gap: 4px; }
.phone .big { font-family: Teko, sans-serif; font-size: 54px; line-height: .9; }
.phone .label { font-family: Teko, sans-serif; font-size: 18px; text-transform: uppercase; opacity: .9; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: none; border-radius: 0; font-weight: 600; }
.seg button.on { background: var(--orange); color: #fff; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
th { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }
td select { margin: 0; }
audio { height: 32px; max-width: 220px; }

.prize-preview { border: 2px solid var(--yellow); border-radius: 14px; padding: 12px; max-width: 300px; background: #fff; }
.prize-preview img { width: 100%; height: var(--prize-img, 120px); object-fit: cover; border-radius: 10px; display: block; margin-bottom: 8px; }
.prize-preview .claim { margin-top: 8px; background: var(--orange); color: #fff; text-align: center; padding: 8px; border-radius: 10px; font-weight: 700; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--dark); color: #fff;
  padding: 10px 18px; border-radius: 12px; font-weight: 600; z-index: 9; }
.toast.err { background: var(--red); }

/* Slow actions (SCRUM-128, jobs.js): busy control + activity panel */
button.busy, select.busy, input.busy { cursor: progress; opacity: .8; }
button.busy::before { content: ""; display: inline-block; width: .9em; height: .9em; margin: 0 .45em -.12em 0;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: jobspin .7s linear infinite; }
@keyframes jobspin { to { transform: rotate(360deg); } }
.jobs { position: fixed; right: 16px; bottom: 16px; z-index: 10; display: flex; flex-direction: column; gap: 8px;
  width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.job { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line);
  border-left: 4px solid var(--orange); border-radius: 12px; padding: 10px 12px; box-shadow: 0 6px 20px rgba(46,38,38,.14); font-size: 14px; }
.job.done { border-left-color: #2E9E5B; }
.job.error { border-left-color: var(--red); }
.job.flash { animation: jobflash .5s ease 2; }
@keyframes jobflash { 50% { box-shadow: 0 0 0 4px rgba(255,123,37,.45); } }
.jobicon { flex: none; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff; }
.job.running .jobicon { border: 2px solid var(--orange); border-right-color: transparent; animation: jobspin .7s linear infinite; }
.job.done .jobicon { background: #2E9E5B; }
.job.error .jobicon { background: var(--red); }
.jobmain { flex: 1; min-width: 0; }
.jobmain strong { display: block; overflow-wrap: anywhere; }
.jobstep { color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.job.error .jobstep { color: var(--red); }
.jobbar { height: 6px; background: var(--cream); border-radius: 3px; margin-top: 6px; overflow: hidden; position: relative; }
.jobbar i { display: block; height: 100%; width: 0; background: var(--orange); transition: width .2s; }
.jobbar.indeterminate i { position: absolute; width: 35%; animation: jobslide 1.1s ease-in-out infinite; }
@keyframes jobslide { from { left: -35%; } to { left: 100%; } }
.job:not(.running) .jobbar { display: none; }
.jobfiles { margin-top: 4px; font-size: 12px; color: var(--muted); }
.jobfiles .ok { color: #2E9E5B; }
.jobfiles .bad { color: var(--red); }
.jobactions { display: flex; gap: 6px; flex: none; }
.jobactions:empty { display: none; }

/* Bot Racers */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center;
  justify-content: center; background: var(--orange); color: #fff; font-family: Teko, sans-serif; font-size: 18px; flex: none; }
.avatar.lg { width: 96px; height: 96px; font-size: 44px; }
.switch { position: relative; width: 44px; height: 26px; display: inline-block; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; margin: 0; }
.switch span { position: absolute; inset: 0; background: #d9cfc8; border-radius: 26px; transition: .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%;
  background: #fff; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--orange); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:disabled + span { opacity: .5; cursor: default; }
.bots td:first-child, .bots th:first-child { width: 28px; }
.bots tr.off td { color: var(--muted); }
.bots tr.off .avatar { filter: grayscale(1); opacity: .6; }
.pace { display: flex; gap: 6px; align-items: center; }
.pace input { width: 80px; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: rgba(255,255,255,.22); color: #fff; font-size: 14px; }
.chip .avatar { width: 24px; height: 24px; font-size: 12px; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--orange); }
th.sortable.active { color: var(--orange); }
th.sortable .arrow { font-size: 10px; opacity: .7; }

/* Live Audio schedule (build 18) */
.daystrip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; align-items: center; }
.daystrip button { white-space: nowrap; flex: 0 0 auto; }
.daystrip button.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.daystrip input[type=date] { flex: 0 0 auto; width: auto; }
.schedlist { display: flex; flex-direction: column; gap: 8px; }
.schedrow { display: grid; grid-template-columns: 80px 1fr auto auto auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: var(--cream); }
.schedrow.live { background: #fde8e8; }
.schedrow .when { font-weight: 700; font-size: 18px; }
.small { font-size: 13px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge.live { background: #d33; color: #fff; }
.badge.big { font-size: 15px; padding: 5px 14px; }
.card.onair { border: 2px solid #d33; }
.meter { height: 14px; background: #eee; border-radius: 6px; overflow: hidden; margin: 10px 0; }
.meterfill { height: 100%; width: 0; border-radius: 6px; transition: width .05s; }
@media (max-width: 700px) { .schedrow { grid-template-columns: 64px 1fr; } }
.daystrip input[type=date] { margin-top: 0; padding: 7px 10px; }
.row input[type=search] { margin-top: 0; }
.schedhead { margin: 22px 0 14px; }

/* Schedule a host: race picker (SCRUM-31) */
.pickfilters { display: grid; grid-template-columns: 200px 1fr; gap: 12px; }
@media (max-width: 700px) { .pickfilters { grid-template-columns: 1fr; } }
.pickfilters label { margin: 0; }
.pickhead { font-size: 20px; margin: 18px 0 8px; }
.pickscroll { max-height: 320px; overflow-y: auto; padding: 2px; }
button.pickrow { width: 100%; text-align: left; font-weight: 400; border: 2px solid transparent; grid-template-columns: 80px 1fr auto auto; }
button.pickrow:hover, .slot:hover { border-color: var(--orange-light); }
button.pickrow.picked, .slot.picked { border-color: var(--orange); background: #fff; }
.slotgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; max-height: 210px; overflow-y: auto; padding: 2px; }
.slot { padding: 7px 6px; font-weight: 600; white-space: nowrap; border: 2px solid var(--line); }
.slot.hosted { background: var(--cream); }
.slot .dot { color: var(--orange); font-size: 10px; margin-left: 4px; vertical-align: middle; }
.picksummary { margin: 18px 0 4px; padding: 12px 14px; border: 2px solid var(--orange); border-radius: 12px; background: var(--paper);
  display: flex; flex-direction: column; gap: 4px; }

/* SCRUM-30: styled file picker (a clear call to action instead of the bare browser control). */
.filepick { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 14px 16px; cursor: pointer;
  border: 2px dashed var(--orange); border-radius: 12px; background: var(--cream); color: var(--dark); font-weight: 600; }
.filepick:hover { background: #ffe2cf; }
.filepick input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.filepick .icon { width: 36px; height: 36px; border-radius: 50%; background: var(--orange); color: #fff; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1; }
.filepick .name { font-weight: 400; color: var(--muted); font-size: 13px; }
.fieldhint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 4px; }

/* SCRUM-30: in-app previews of a race card, drawn at the app's real point sizes (iPhone 18 Pro, 402 pt). */
.previews { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 14px; }
.pv { width: 402px; max-width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 16px 20px 20px; }
.pv .pvlabel { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.pv .sechead { display: flex; align-items: center; gap: 10px; font-family: Teko, sans-serif; font-size: 26px; text-transform: uppercase; color: var(--dark); margin-bottom: 8px; }
.pv .sechead::before { content: ""; width: 4px; height: 22px; border-radius: 2px; background: var(--orange); }
.pvcard { position: relative; display: flex; align-items: center; gap: 14px; min-height: 104px; padding: 16px; border-radius: 14px;
  overflow: hidden; background: #fff; color: var(--dark); }
.pvcard.img, .pvhero { background: linear-gradient(135deg, var(--orange-light), var(--orange), var(--orange-deep)); color: #fff; }
.pvbg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.pvcard .pvscrim { position: absolute; inset: 0; background: var(--card-scrim, linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.25), rgba(0,0,0,.55))); }
.pvhero .pvscrim { position: absolute; inset: 0; background: var(--card-scrim, linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.25), rgba(0,0,0,.55))); }
.pvcard .txt, .pvhero .txt { position: relative; flex: 1; min-width: 0; }
.pvcard .nm { font-family: Teko, sans-serif; font-weight: 600; font-size: 24px; line-height: 1.05; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvcard .nm .star { color: var(--orange); font-size: 12px; margin-right: 6px; vertical-align: 3px; }
.pvcard .wh { font-size: 14px; font-weight: 600; }
.pvcard .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvcard.img .sub { color: rgba(255,255,255,.9); }
.pvtag { position: relative; font-family: Teko, sans-serif; font-weight: 600; font-size: 18px; padding: 0 10px; border-radius: 999px; background: var(--cream); color: var(--orange); flex: none; }
.pvhero { position: relative; border-radius: 18px; padding: 20px; overflow: hidden; }
.pvhero .row1 { display: flex; align-items: center; justify-content: space-between; }
.pvhero .kind { font-family: Teko, sans-serif; font-weight: 600; font-size: 18px; padding: 0 10px; border-radius: 999px; background: rgba(255,255,255,.25); }
.pvhero .big { font-family: Teko, sans-serif; font-weight: 600; font-size: 44px; line-height: 1; text-transform: uppercase; margin-top: 8px; }
.pvhero .wh { font-size: 16px; font-weight: 600; margin-top: 2px; }
.pvhero .host { display: inline-block; margin-top: 8px; font-family: Teko, sans-serif; font-weight: 500; font-size: 18px; padding: 0 12px; border-radius: 999px; background: #fff; color: var(--orange); }
.pvhero .starts { font-family: Teko, sans-serif; font-weight: 500; font-size: 20px; opacity: .85; margin-top: 10px; }
.pvhero .cd { font-family: Teko, sans-serif; font-weight: 600; font-size: 44px; line-height: .9; }

/* SCRUM-24: race-screen previews with the app's real UI captured on top. */
.vtools { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 6px 0 14px; }
.vtools select { width: auto; display: inline-block; margin: 0 0 0 6px; }
.vtools label { margin: 0; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.uibadge { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--cream); padding: 3px 8px; border-radius: 999px; }
.phone2 { position: relative; overflow: hidden; border: 7px solid var(--dark); background: linear-gradient(135deg, var(--orange-light), var(--orange), var(--orange-deep)); margin: 8px auto; }
.phone2 .bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.phone2 .scrim { position: absolute; inset: 0; background: var(--bg-scrim, linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.15), rgba(0,0,0,.55))); }
.phone2 .ui { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.phone2 .noui { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-family: Teko, sans-serif; font-size: 22px; text-align: center; padding: 20px; }
.segsmall { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.segsmall button { padding: 3px 10px; font-size: 12px; }
.segsmall button.on { background: var(--dark); color: #fff; border-color: var(--dark); }

/* Visuals cards: centered, aligned across the row (titles, toggles, phones and controls line up). */
.vcard { display: flex; flex-direction: column; align-items: center; text-align: center; }
.vcard h3 { margin-bottom: 14px; }
.vcard .vtoggle { min-height: 30px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.vcard .phone2 { margin: 6px auto 14px; }
.vcard .seg { justify-content: center; }
.vcard .filepick { width: 100%; text-align: left; }
.vcard .vactions { margin-top: auto; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 4px; }
.vcard .vactions .note { margin: 0; }

/* SCRUM-24 part 2: drag / zoom framing. */
.phone2.framable { cursor: grab; touch-action: none; user-select: none; }
.phone2.framable.dragging { cursor: grabbing; }
.phone2 img.bgimg { position: absolute; max-width: none; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.phone2 .safe { position: absolute; border: 2px dashed rgba(255,255,255,.95); box-shadow: 0 0 0 1px rgba(0,0,0,.45); pointer-events: none; }
.framebar { display: flex; align-items: center; gap: 8px; justify-content: center; width: 100%; font-size: 13px; color: var(--muted); }
.framebar input[type=range] { width: 120px; }
.framebar button { padding: 4px 10px; font-size: 12px; }
.warnbadge { font-size: 12px; font-weight: 700; color: #7a4a00; background: var(--yellow); padding: 3px 8px; border-radius: 999px; }

/* Races tab rows: the card image leads (same shape as the app's race card), tiny × controls. */
.racerow { position: relative; display: grid; grid-template-columns: 240px 1fr auto; gap: 16px; align-items: center;
  padding: 12px 40px 12px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.racetile { position: relative; width: 240px; height: 70px; border-radius: 10px; overflow: hidden; cursor: pointer;
  background: #fff center / cover no-repeat; border: 1px solid var(--line); }
.racetile.empty { background: repeating-linear-gradient(135deg, #fff 0 10px, #faf3ee 10px 20px); }
.racetile .hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: #fff; background: rgba(46,38,38,.55); opacity: 0; transition: opacity .15s; }
.racetile.empty .hint { color: var(--muted); background: none; }
.racetile:hover .hint, .racetile.empty:hover .hint { opacity: 1; }
.xbtn { position: absolute; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: none; line-height: 22px;
  font-size: 12px; font-weight: 700; text-align: center; cursor: pointer; }
.racetile .xbtn { top: 5px; right: 5px; background: rgba(0,0,0,.6); color: #fff; z-index: 1; }
.racetile .xbtn:hover { background: rgba(0,0,0,.85); }
.racerow > .xbtn.del { top: 8px; right: 8px; background: transparent; color: var(--muted); }
.racerow > .xbtn.del:hover { background: #f6e1dc; color: var(--red); }
.racerow .what b { font-size: 16px; }
.racerow .meta { display: flex; align-items: center; gap: 8px; }
@media (max-width: 760px) { .racerow { grid-template-columns: 1fr; } .racetile { width: 100%; height: 90px; } }

/* Emails tab */
.emcard { margin-bottom: 14px; }
.emcard.unreg { border: 2px solid #e7a13a; }
.emmeta { display: grid; gap: 4px; margin: 10px 0; }
.emrow { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: 14px; }
.embody { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 18px; align-items: start; margin: 10px 0; }
@media (max-width: 900px) { .embody { grid-template-columns: 1fr; } }
.emframe { width: 100%; height: 560px; border: 1px solid #eadfd8; border-radius: 12px; background: #fff; }
.emtext { white-space: pre-wrap; background: #fff; border: 1px solid #eadfd8; border-radius: 12px; padding: 12px; font: 14px/1.5 "Open Sans", system-ui, sans-serif; margin: 0; }
.emtoggle { display: block; margin-bottom: 6px; }
.emfields table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.emfields th { text-align: left; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid #eadfd8; }
.emfields td { padding: 6px 8px; border-bottom: 1px solid #f3ebe5; vertical-align: top; overflow-wrap: anywhere; }
.emfields code { background: #fff3ea; padding: 2px 6px; border-radius: 6px; font-size: 12.5px; }
.copybtn { margin-left: 6px; padding: 2px 8px; font-size: 12px; }
.emgroup { margin: 26px 0 2px; }
.badge.src.ok { background: #e3f4e6; }
.badge.src.warn { background: #fdf0d8; }
.badge.src.bad { background: #fbe0de; color: #8a1f17; }
.billbanner { padding: 10px 16px; font-size: 14px; background: #fdf0d8; border-bottom: 1px solid rgba(0,0,0,.06); }
.billbanner.bad { background: #fbe0de; color: #8a1f17; }
.tiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 10px 0; }
.tier { border: 1px solid rgba(0,0,0,.1); border-radius: 12px; padding: 14px; background: #fff; }
.tier h3 { margin: 0 0 4px; }
.tier .price { font-size: 22px; font-weight: 700; margin: 6px 0; }
.tier ul { padding-left: 18px; margin: 8px 0; font-size: 14px; }
.warnbox { background: #fdf0d8; border-radius: 10px; padding: 10px 14px; margin: 8px 0; font-size: 14px; }
.chip { display: inline-block; padding: 5px 12px; border-radius: 999px; background: #fff; font-size: 13px; text-decoration: none; color: inherit; border: 1px solid #eadfd8; }
.btnlink { display: inline-block; margin-top: 4px; padding: 8px 14px; border-radius: 10px; background: var(--orange, #FF7B25); color: #fff; font-weight: 600; text-decoration: none; }

/* Notifications tab */
.ntype { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; padding: 14px 0; border-top: 1px solid #f3ebe5; }
.ntype:first-child { border-top: 0; }
.nwording { margin-top: 6px; background: #fff3ea; border-radius: 10px; padding: 8px 10px; }
.nswitches { display: grid; gap: 8px; align-content: start; min-width: 210px; }
.nswitch { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.nannounce { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 20px; margin-bottom: 12px; }
.npreview { margin-top: 8px; background: linear-gradient(160deg,#ff9b52,#f05a0a); border-radius: 18px; padding: 18px 12px; }
.npush { background: rgba(255,255,255,.92); border-radius: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.35; }
.napp { font-size: 11px; color: #7a6e6a; margin-bottom: 2px; text-transform: uppercase; letter-spacing: .5px; }
@media (max-width: 800px) { .ntype, .nannounce { grid-template-columns: 1fr; } }

.kitlinks { display: block; font-size: 14px; margin: 0 0 10px; color: var(--muted); }
.kitlinks a { color: var(--orange-deep, #F05A0A); font-weight: 600; }

/* Brand kit */
.kitgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; }
@media (max-width: 900px) { .kitgrid { grid-template-columns: 1fr; } }
.btnlike { display: inline-block; padding: 8px 14px; border-radius: 10px; border: 1.5px solid var(--orange, #FF7B25); color: var(--orange-deep, #F05A0A); font-weight: 600; cursor: pointer; margin: 0; }
.btnlike input { display: none; }
.btnlink.ghost { background: transparent; color: var(--orange-deep, #F05A0A); border: 1.5px solid var(--orange, #FF7B25); margin-top: 0; }
.kittable { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.kittable th, .kittable td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #f3ebe5; overflow-wrap: anywhere; }
.kittable tr.skip td { color: var(--muted); }

/* AI Lab */
.labgrid { display: flex; gap: 18px; overflow-x: auto; padding: 8px 0; }
.labtile { display: grid; gap: 6px; justify-items: start; }
.labwait { width: 230px; height: 470px; border-radius: 30px; background: #f3ebe5; display: grid; place-items: center; text-align: center; padding: 16px; color: var(--muted); font-size: 14px; }
.labwait.wide { width: 340px; height: 200px; border-radius: 14px; }
.labuse { min-height: 32px; }
.labuse select { max-width: 220px; }
.cuetable td { vertical-align: top; }
.cuelist { display: grid; gap: 4px; min-width: 360px; }
.cueclip { display: flex; align-items: center; gap: 6px; }
.cueclip .cuenum { width: 18px; color: var(--muted); font-size: 13px; }
.cueclip .cuename { flex: 1; font-size: 14px; }
.cueclip audio { height: 28px; width: 180px; }
button.mini { padding: 2px 8px; font-size: 13px; min-height: 0; }
/* Voice Studio */
.vmeter { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.vbar { width: 180px; height: 8px; border-radius: 4px; background: #eee3da; overflow: hidden; }
.vbar span { display: block; height: 100%; background: var(--orange); }
.vcurrent { margin: 4px 0 8px; }
.vpanel { border: 1px solid #eee3da; border-radius: 12px; padding: 12px; margin: 8px 0; display: grid; gap: 8px; }
.vresults { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.vcard { border: 1px solid #eee3da; border-radius: 10px; padding: 10px; display: grid; gap: 6px; align-content: start; }
.vcard audio { width: 100%; height: 32px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
button.chip { padding: 3px 10px; font-size: 13px; border-radius: 999px; min-height: 0; }
.span2 { grid-column: 1 / -1; }
.studio { background: #fff8f2; border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.studiobrief { display: grid; gap: 4px; }
.takes { display: grid; gap: 10px; }
.take { border: 1px solid #eee3da; border-radius: 10px; padding: 10px; background: #fff; display: grid; gap: 6px; }
.take textarea { width: 100%; }
button.gen { margin-left: auto; }

/* ---------- Spacing rhythm (whole admin) ----------
   One vertical scale so nothing sits flush against its neighbor: 6 / 10 / 14 / 20 / 28 px.
   Cards breathe, headings get room above, button rows get room around them, and table
   rows aren't cramped. Later, more specific rules can still tighten a spot on purpose. */
.card { padding: 22px 24px; margin-bottom: 20px; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2 { margin-bottom: 10px; }
.card h3 { margin: 28px 0 10px; }
.card > h3:first-child, .card .row > h3, .card .row > h2 { margin: 0; }
.card p { margin: 0 0 14px; line-height: 1.5; }
.card > .row, .vpanel > .row, .studio > .row, .take > .row, .tab > .row { margin: 14px 0; }
.row { row-gap: 10px; }
label { margin: 14px 0; }
.grid2, .grid3 { column-gap: 20px; row-gap: 6px; }
.fieldhint { margin-top: 6px; line-height: 1.4; }
input[type=range] { display: block; width: 100%; margin-top: 10px; accent-color: var(--orange); }
.note { margin: 14px 0; line-height: 1.5; }
.note ul { margin: 8px 0; padding-left: 20px; }
details { margin: 10px 0; }
details summary { cursor: pointer; }
td, th { padding: 12px 8px; }
td > audio, td > .row { margin: 4px 0; }
.kitlinks { margin: 0 0 14px; }

/* Audio CMS */
.vmeter { margin: 14px 0 6px; }
.vcurrent { margin: 6px 0 12px; }
.vpanel { padding: 16px; gap: 12px; margin: 14px 0; }
.chips { margin: 8px 0 12px; }
.cuelist { gap: 10px; }
.cuelist > .row { margin: 6px 0 0 !important; }
.studio { padding: 18px; gap: 14px; margin: 6px 0 10px; }
.studiobrief { gap: 8px; line-height: 1.5; }
.takes { gap: 14px; }
.take { padding: 14px; gap: 10px; }
.takeresult:not(:empty) { margin-top: 6px; display: grid; gap: 10px; }
/* A row of buttons right after a field, hint or text gets room above it, wherever it sits. */
:is(label, .fieldhint, textarea, p, .note, .warnbadge) + .row:has(> button) { margin-top: 16px; }
button.mini { padding: 5px 12px; border-radius: 8px; }
.badge.soft { background: var(--cream); color: var(--dark); }
/* Race colors */
.phone2 .rolemask { position: absolute; inset: 0; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; pointer-events: none; }
.colorlayout { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(0, 1.4fr); gap: 24px; align-items: start; margin: 12px 0; }
@media (max-width: 980px) { .colorlayout { grid-template-columns: 1fr; } }
.colorgroups { display: grid; gap: 4px; }
.colorgroup h3 { margin: 18px 0 8px !important; font-size: 20px; }
.colorrow { display: grid; grid-template-columns: 40px 86px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.colorrow input[type=color], .colorgroup input[type=color] { width: 40px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.colorrow .hexin { margin: 0; padding: 6px 8px; font-family: ui-monospace, monospace; font-size: 13px; }
.colorrow .same { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-weight: 400; font-size: 13px; }
.colorpreviews { position: sticky; top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; justify-items: center; }
.colorphone { display: grid; justify-items: center; gap: 2px; }
.colorphone .phone2 { margin: 4px auto 8px; transform: scale(.82); transform-origin: top center; margin-bottom: -76px; }

/* Partner portal → Account → Billing: one text size, room between the parts. */
.billcard, .billcard p, .billcard .badge, .billcard dl { font-size: 15px; }
.billcard h2 { margin-bottom: 16px; }
.billdetails .badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.billdetails .badge { padding: 5px 12px; }
.billdetails dl { display: grid; grid-template-columns: max-content 1fr; gap: 12px 28px; margin: 0 0 24px; line-height: 1.4; }
.billdetails dt { color: var(--muted); }
.billdetails dd { margin: 0; }
.billcard .row { margin-top: 4px; }
.billcard .row + p { margin-top: 14px; }

/* Account / Security / Partners (admin and partner portal): every card the same text size,
   with room to breathe. */
:is(#tab-security, #tab-partners) .card { padding-top: 24px; padding-bottom: 24px; }
:is(#tab-security, #tab-partners) :is(.card, .card p, .card label, .card .badge, .card .small, .card .muted, .card li,
  .card button, .card td, .card th, .card input, .card select, .card textarea, .card code, .card pre, .note, .warnbox) { font-size: 15px; }
:is(#tab-security, #tab-partners) .card h2 { margin-bottom: 16px; }
:is(#tab-security, #tab-partners) .card h3 { margin: 6px 0 8px; }
:is(#tab-security, #tab-partners) .card p { line-height: 1.5; margin: 12px 0; }
:is(#tab-security, #tab-partners) .card .row { gap: 10px; margin: 16px 0; }
:is(#tab-security, #tab-partners) .card label { margin-bottom: 14px; }
:is(#tab-security, #tab-partners) .card td, :is(#tab-security, #tab-partners) .card th { padding-top: 12px; padding-bottom: 12px; vertical-align: top; line-height: 1.45; }
:is(#tab-security, #tab-partners) .card td > div + div { margin-top: 4px; }
:is(#tab-security, #tab-partners) .card .badge { padding: 4px 12px; margin: 0 6px 6px 0; }
:is(#tab-security, #tab-partners) .tier { padding: 18px; }
:is(#tab-security, #tab-partners) .tier .price { font-size: 20px; line-height: 1.3; }
:is(#tab-security, #tab-partners) .card td .billdetails dl { margin-bottom: 0; }
:is(#tab-security, #tab-partners) .card td .billdetails .badges { margin-bottom: 12px; }
:is(#tab-security, #tab-partners) .card label.row > input[type=radio] { margin-top: 4px; flex: none; }
:is(#tab-security, #tab-partners) .tier .price, :is(#tab-security, #tab-partners) .tier ul { margin: 10px 0; }

/* SCRUM-95: custom triggers (Audio) and background changes (Visuals) */
.trigsection { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.trigsection:first-of-type { border-top: 0; margin-top: 0; }
.trigtable td:first-child { width: 230px; }
.trigtable .fixedrow td { color: var(--muted); background: #faf6f3; }
.warnlist { color: #7a4a00; display: grid; gap: 4px; max-width: 260px; }
.addtrig { background: var(--cream); border-radius: 10px; padding: 10px 12px; margin-top: 8px; display: grid; gap: 8px; }
.changes { width: 100%; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.changes h4 { margin: 0; }
.changerow { display: flex; gap: 10px; width: 100%; text-align: left; align-items: flex-start; background: #faf6f3; border-radius: 10px; padding: 8px; }
.chthumb { width: 46px; height: 92px; object-fit: cover; border-radius: 8px; background: #ddd; flex: none; }
.changebody { flex: 1; min-width: 0; }
.changes .addtrig { width: 100%; }

/* ---------- Mission Control (SCRUM-100) ---------- */
.mcnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 18px; }
.mcnav button { border-radius: 999px; padding: 6px 16px; font-weight: 600; }
.mcnav button.active { background: var(--dark); border-color: var(--dark); color: #fff; }
.mctiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 14px 0 20px; }
.mctile { background: #fff; border-radius: 14px; padding: 14px 16px 12px; box-shadow: 0 4px 16px rgba(255,123,37,.07); min-width: 0; }
.mclabel { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.mcvalue { font-family: Teko, sans-serif; font-size: 46px; line-height: 1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.mctile .spark { display: block; width: 100%; height: 30px; margin: 4px 0 2px; }
.mcbig { font-family: Teko, sans-serif; font-size: 40px; line-height: 1; }
.mctable { width: 100%; border-collapse: collapse; font-size: 14px; }
.mctable th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.mctable td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.mctable tr.mcbad td { background: #fdf3f2; }
.mcprogress { height: 6px; background: var(--cream); border-radius: 3px; overflow: hidden; min-width: 80px; margin-top: 4px; }
.mcprogress i { display: block; height: 100%; background: var(--orange); }
.mcmeter { position: relative; height: 14px; background: var(--cream); border-radius: 7px; overflow: hidden; margin: 12px 0; }
.mcmeter i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--orange); border-radius: 7px; }
.mcmeter i.fc { background: rgba(255,123,37,.25); }
.mcstack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 6px 0; }
.mclegend { gap: 14px; margin-top: 6px; }
.mclegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.mcbars { position: relative; margin-top: 8px; }
.mcbars svg { display: block; width: 100%; }
.mcbars g:hover rect:not([fill=transparent]) { opacity: .8; }
.mcmax { position: absolute; top: -18px; right: 0; }
.mcaxis { position: relative; height: 18px; margin-top: 4px; }
.mcaxis span { position: absolute; white-space: nowrap; }
.mcslider input[type=range] { flex: 1; margin: 0; accent-color: var(--orange); }
.mcslider input[type=number] { width: 90px; margin: 0; }
.mcheat { display: grid; grid-template-columns: 36px repeat(24, 1fr); gap: 2px; font-size: 11px; align-items: center; }
.mcheat i { display: block; height: 18px; border-radius: 3px; background: #f6efe9; }

/* TV mode: Live view full screen, dark, big numbers (Esc to leave). */
body.mc-tv { background: #141113; }
body.mc-tv .top, body.mc-tv .tabs, body.mc-tv .brandbar, body.mc-tv .mcnav { display: none; }
body.mc-tv main { max-width: none; padding: 28px 40px; color: #f4ece6; }
body.mc-tv .card, body.mc-tv .mctile { background: #211c1e; box-shadow: none; }
body.mc-tv .mcvalue { font-size: 64px; color: #fff; }
body.mc-tv .mctable td, body.mc-tv .mctable th { border-color: #3a3133; }
body.mc-tv .muted, body.mc-tv .mclabel { color: #a89a94; }
body.mc-tv button { background: #2a2426; color: #f4ece6; border-color: #3a3133; }
body.mc-tv .mcmeter, body.mc-tv .mcprogress { background: #3a3133; }
.mcalerts { background: #fdf0d8; border-radius: 12px; padding: 10px 14px; margin: 10px 0; display: grid; gap: 4px; }
body.mc-tv .mcalerts { background: #3a2f1c; }
.mcmap { height: 340px; border-radius: 12px; overflow: hidden; background: var(--cream); margin: 8px 0; }
body.mc-tv .mcmap { height: 46vh; }
.mcfunnel { display: grid; grid-template-columns: 260px 1fr 60px 50px; gap: 12px; align-items: center; margin: 8px 0; }
.mcfunnel .mcprogress { height: 14px; border-radius: 7px; margin: 0; }
.mccohort td.mccell { text-align: center; font-size: 12px; min-width: 46px; }

/* ---------- Race Series (SCRUM-118) ---------- */
.seriesrow { border-top: 1px solid var(--line); padding: 12px 0; }
.seriesrow:first-child { border-top: none; }
.seriesdates { margin: 8px 0 4px; border-left: 3px solid var(--cream); padding-left: 12px; }
.seriesdate { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.seriesdate:last-child { border-bottom: none; }
.seriesform { border: 2px solid var(--cream); border-radius: 14px; padding: 16px 18px; margin: 14px 0; background: var(--paper); }
.seriesform h3 { margin: 18px 0 8px; }
.seriesform h3:first-child { margin-top: 0; }
.seriespreview { background: #fff; border-radius: 10px; padding: 10px 14px; }
.daychip { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; background: #fff; }
.daychip input { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chipx { display: inline-block; background: var(--cream); border-radius: 999px; padding: 3px 10px; font-size: 13px; margin-right: 4px; }
.chipx a { color: var(--red); text-decoration: none; font-weight: 700; }

/* Audio CMS clip library (SCRUM-129) */
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 14px; margin: 8px 0 12px; background: #fff; }
.dropzone.over { border-color: var(--orange); background: var(--cream); }
.matchbox { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 12px; background: var(--paper); }
.matchbox select { max-width: 360px; }

/* Admin → App → Storage clean-up */
.sweeptable { margin-top: 8px; }
.sweeptable td code { overflow-wrap: anywhere; }

/* SCRUM-49: confirm-it's-you dialog */
.confirmdlg { border: none; border-radius: 16px; padding: 22px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(46,38,38,.3); }
.confirmdlg::backdrop { background: rgba(46,38,38,.45); }

/* Runners tab */
.runners-scroll { overflow-x: auto; }
table.runners tr.click { cursor: pointer; }
table.runners tr.click:hover, table.runners tr.click:focus { background: var(--paper); outline: none; }
table.runners td.invited { max-width: 220px; }
.nowrap { white-space: nowrap; }
.who-cell { display: flex; gap: 10px; align-items: center; }
.who-cell .badge { font-size: 11px; padding: 1px 8px; margin-left: 2px; }
.runner-head { display: flex; gap: 18px; align-items: center; margin: 14px 0 18px; }
.runner-head > div { display: grid; gap: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 18px; }
.fact > div:last-child { overflow-wrap: anywhere; }
