:root {
  --navy: #0b1f4d;
  --royal: #1d4ed8;
  --blue: #2563eb;
  --azure: #3b82f6;
  --sky: #38bdf8;
  --ice: #eaf2ff;
  --magenta: #db2777;
  --pink: #ec4899;
  --fuchsia: #d946ef;
  --blush: #fdf0f7;
  --bg: #f4f7fe;
  --panel: #ffffff;
  --panel-2: #f6f8fe;
  --border: #e3e8f6;
  --border-strong: #cfd8ee;
  --text: #0f1b3d;
  --muted: #5d6786;
  --green: #059669;
  --danger: #e11d48;
  /* legacy aliases used in templates */
  --saffron: var(--blue);
  --rose: var(--pink);
  --cyan: var(--blue);
  --gold: var(--magenta);
  --grad: linear-gradient(115deg, #1d4ed8 0%, #3b82f6 28%, #8b5cf6 55%, #d946ef 75%, #ec4899 100%);
  --grad-soft: linear-gradient(135deg, #eaf2ff 0%, #f5edff 50%, #fdf0f7 100%);
  --shadow: 0 14px 40px -30px rgba(11,31,77,.55);
  --font-head: 'Space Grotesk', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.55 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0 0 .5em; letter-spacing: -.01em; color: var(--navy); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-head); font-variant-numeric: tabular-nums; }
code { font-family: var(--font-head); font-weight: 600; color: var(--magenta); background: var(--blush); padding: 1px 7px; border-radius: 6px; }
@keyframes gradShift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

/* shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 256px; flex: none; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { display: flex; gap: 12px; align-items: center; padding: 20px; border-bottom: 1px solid var(--border); background: var(--grad-soft); }
.side-brand strong { display: block; font-family: var(--font-head); font-size: 15px; line-height: 1.2; color: var(--navy); }
.side-brand small { color: var(--magenta); font-size: 12px; font-weight: 600; }
.brand-mark { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--grad); background-size: 200% auto; animation: gradShift 6s ease-in-out infinite alternate; color: #fff; font-size: 18px; box-shadow: 0 8px 18px -8px rgba(217,70,239,.6); }
.side-nav { padding: 12px; flex: 1; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: #8a93b0; padding: 16px 12px 8px; font-weight: 700; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #3a4566; font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s; }
.side-nav a i { width: 18px; text-align: center; color: #8a93b0; transition: color .15s; }
.side-nav a:hover { background: var(--ice); color: var(--blue); }
.side-nav a:hover i { color: var(--blue); }
.side-nav a.active { background: var(--grad); background-size: 200% auto; animation: gradShift 6s ease-in-out infinite alternate; color: #fff; box-shadow: 0 10px 22px -12px rgba(217,70,239,.7); }
.side-nav a.active i { color: #fff; }
.count { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; background: var(--pink); color: #fff; border-radius: 999px; padding: 1px 8px; }
.side-nav a.active .count { background: #fff; color: var(--magenta); }
.side-site { margin: 12px; padding: 12px; border-radius: 10px; border: 1px dashed var(--border-strong); color: var(--muted); text-align: center; font-size: 13.5px; }
.side-site:hover { color: var(--magenta); border-color: var(--pink); background: var(--blush); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 68px; padding: 0 28px; background: rgba(255,255,255,.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--grad); background-size: 200% auto; animation: gradShift 6s ease-in-out infinite alternate; opacity: .8; }
.topbar h1 { font-size: 20px; margin: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: #3a4566; cursor: pointer; font-size: 15px; }
.icon-btn:hover { color: var(--blue); border-color: #bcd0fb; background: var(--ice); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); }
.me { display: flex; align-items: center; gap: 10px; padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--border); }
.me form { margin: 0; }
.me-name { font-weight: 600; color: var(--navy); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700; }
.menu-btn { display: none; }
.content { padding: 28px; max-width: 1400px; width: 100%; }
.side-backdrop { display: none; }
@media (max-width: 960px) {
  .side { position: fixed; z-index: 60; left: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: 20px 0 40px -20px rgba(11,31,77,.3); }
  .side-open .side { transform: none; }
  .side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(11,31,77,.35); }
  .menu-btn { display: inline-grid; }
  .content { padding: 18px 16px; }
  .topbar { padding: 0 16px; }
  .me-name { display: none; }
}

/* cards & grid */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 16.5px; }
.grid { display: grid; gap: 20px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-21 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .g-4 { grid-template-columns: repeat(2, 1fr); } .g-21, .g-3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g-4, .g-2 { grid-template-columns: 1fr; } }
.grid > .card { margin-bottom: 0; }

.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--grad); }
.kpi .kpi-icon { position: absolute; right: 18px; top: 18px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; font-size: 17px; }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi strong { display: block; font: 700 30px/1.1 var(--font-head); margin: 8px 0 4px; color: var(--navy); }
.kpi small { color: var(--muted); font-size: 12.5px; }
.ic-saffron { background: var(--ice); color: var(--blue); }
.ic-green { background: var(--blush); color: var(--pink); }
.ic-cyan { background: #e0f2fe; color: #0284c7; }
.ic-rose { background: #f5edff; color: #a21caf; }

.progress { height: 8px; background: #e8ecf8; border-radius: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--grad); border-radius: 8px; }
.cat-row { margin-bottom: 18px; }
.cat-row-top { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 13.5px; }
.cat-row-top strong { color: var(--navy); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; font: 600 13.5px/1.2 'Inter', sans-serif; cursor: pointer; white-space: nowrap; transition: .2s; }
.btn-primary { background: var(--grad); background-size: 200% auto; color: #fff; box-shadow: 0 8px 18px -10px rgba(37,99,235,.7); }
.btn-primary:hover { background-position: 100% 50%; box-shadow: 0 10px 22px -10px rgba(236,72,153,.7); }
.btn-ghost { background: #fff; border-color: var(--border-strong); color: var(--navy); }
.btn-ghost:hover { border-color: var(--azure); color: var(--blue); background: var(--ice); }
.btn-danger { background: #fff1f5; border-color: #fbcfe8; color: var(--danger); }
.btn-danger:hover { background: #ffe4ec; }
.btn-success { background: #ecfdf5; border-color: #a7f3d0; color: var(--green); }
.btn-success:hover { background: #d1fae5; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.inline { display: inline; margin: 0; }

/* forms */
.field { margin-bottom: 16px; }
.field label, .label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #2a3558; }
.input { width: 100%; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--border-strong); background: #fff; color: var(--text); font: 14px 'Inter', sans-serif; }
.input:focus { outline: none; border-color: var(--azure); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.input:disabled { background: var(--panel-2); color: var(--muted); }
textarea.input { min-height: 110px; resize: vertical; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--pink); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.thumb-preview { max-height: 120px; border-radius: 10px; border: 1px solid var(--border); margin-top: 10px; background: #fff; padding: 4px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .input { width: auto; min-width: 150px; }
.toolbar .grow { flex: 1; min-width: 220px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--royal); font-weight: 700; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--grad-soft); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8faff; }
.table .sub { display: block; color: var(--muted); font-size: 12.5px; }
.table img.thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; background: #fff; border: 1px solid var(--border); }
.unread td { background: #fdf6fa; font-weight: 500; }
.unread td:first-child { box-shadow: inset 3px 0 0 var(--pink); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-paid, .pill-confirmed, .pill-yes { background: #dcfce7; color: #047857; }
.pill-pending, .pill-registered { background: var(--blush); color: var(--magenta); }
.pill-failed, .pill-cancelled, .pill-refunded, .pill-no { background: #ffe4ec; color: var(--danger); }
.pill-info { background: var(--ice); color: var(--royal); }

.alert { padding: 13px 16px; border-radius: 12px; margin-bottom: 18px; border: 1px solid; font-weight: 500; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.alert-error { background: #fff1f5; border-color: #fbcfe8; color: #be123c; }
.alert-info { background: var(--ice); border-color: #bfdbfe; color: var(--royal); }

.pagination { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; height: 36px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); background: #fff; font-weight: 600; font-size: 13px; color: var(--navy); }
.pagination a:hover { border-color: var(--azure); color: var(--blue); }
.pagination .cur { background: var(--grad); color: #fff; border-color: transparent; }

.dl { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; color: var(--navy); }
.dl dd a { color: var(--blue); }
@media (max-width: 560px) { .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 10px; } }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty i { font-size: 34px; display: block; margin-bottom: 12px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chart-box { position: relative; height: 280px; }

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(800px circle at 85% 0%, rgba(147,197,253,.55), transparent 60%), radial-gradient(700px circle at 0% 100%, rgba(249,168,212,.5), transparent 60%), var(--bg); }
.login-card { width: min(420px, 100%); padding: 36px; border-radius: 22px; background: rgba(255,255,255,.9); border: 1px solid #fff; backdrop-filter: blur(20px); box-shadow: 0 30px 80px -30px rgba(29,78,216,.45), 0 0 0 1px var(--border); position: relative; overflow: hidden; }
.login-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--grad); background-size: 200% auto; animation: gradShift 5s ease-in-out infinite alternate; }
.login-card .brand-mark { width: 52px; height: 52px; font-size: 24px; border-radius: 15px; margin-bottom: 20px; }
.login-card h1 { font-size: 26px; }

/* banner guide */
.guide { background: var(--grad-soft); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 20px; max-width: 1100px; }
.guide-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.guide-head > i { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--grad); color: #fff; }
.guide-head strong { display: block; color: var(--navy); font-family: var(--font-head); font-size: 16px; }
.guide-head span { color: var(--muted); font-size: 13.5px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.guide-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.guide-card h4 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.guide-card h4 i { color: var(--blue); }
.guide-card ul { margin: 0; padding-left: 18px; color: #3a4566; font-size: 13px; }
.guide-card li { margin-bottom: 5px; }
.zone { position: relative; border-radius: 10px; background: linear-gradient(135deg, #bfdbfe, #e9d5ff 55%, #fbcfe8); margin-bottom: 12px; overflow: hidden; }
.zone b { position: absolute; right: 8px; top: 6px; font: 600 11px var(--font-head); color: var(--navy); background: rgba(255,255,255,.8); padding: 2px 7px; border-radius: 6px; }
.zone-safe { position: absolute; display: grid; place-items: center; border: 2px dashed rgba(219,39,119,.75); background: rgba(255,255,255,.35); border-radius: 6px; }
.zone-safe em { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--magenta); text-transform: uppercase; letter-spacing: .08em; }
.zone-desktop { aspect-ratio: 2 / 1; }
.zone-desktop .zone-safe { left: 6%; top: 18%; bottom: 18%; width: 42%; }
.zone-mobile { aspect-ratio: 4 / 5; max-width: 150px; }
.zone-mobile .zone-safe { left: 7%; right: 7%; bottom: 6%; height: 36%; }
.guide-toggle { margin-bottom: 18px; }
.guide-toggle > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--border-strong); color: var(--royal); font-weight: 600; margin-bottom: 14px; list-style: none; }
.guide-toggle > summary::-webkit-details-marker { display: none; }
.guide-toggle[open] > summary { background: var(--ice); }
.thumb-wide { max-width: 100%; max-height: 180px; }
video.thumb-preview { background: #0b1f4d; padding: 0; }
.guide-card-video { grid-column: 1 / -1; }
.guide-card-video h4 i { color: var(--pink); }
.video-tips { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.video-tips a { color: var(--blue); font-weight: 600; }
@media (max-width: 900px) { .video-tips { grid-template-columns: 1fr; } }
.warn-text { color: var(--magenta) !important; font-weight: 600; }
@media (max-width: 900px) { .guide-grid { grid-template-columns: 1fr; } .zone-desktop { max-width: 360px; } }

/* slider timing + bulk upload */
.g-12 { grid-template-columns: 1fr 1.4fr; }
@media (max-width: 900px) { .g-12 { grid-template-columns: 1fr; } }
.interval-row { display: flex; align-items: center; gap: 12px; }
.interval-row input[type=range] { flex: 1; padding: 0; border: 0; box-shadow: none; height: 6px; border-radius: 6px; background: var(--grad); -webkit-appearance: none; appearance: none; accent-color: var(--pink); }
.interval-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--pink); box-shadow: 0 4px 10px -3px rgba(236,72,153,.6); cursor: pointer; }
.interval-row input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--pink); cursor: pointer; }
.interval-num { width: 84px; flex: none; text-align: center; font-weight: 700; color: var(--royal); }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 26px 16px; border: 2px dashed #b9cbf8; border-radius: 14px; background: var(--grad-soft); cursor: pointer; transition: border-color .2s, box-shadow .2s, background .2s; }
.dropzone:hover, .dropzone.over { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(236,72,153,.1); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone > i { font-size: 30px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dropzone strong { color: var(--navy); }
.dropzone span { color: var(--muted); font-size: 13px; }
.dz-status { font-style: normal; font-size: 13px; font-weight: 600; color: var(--royal); min-height: 1em; }
.dz-status.bad { color: var(--danger); }
.dz-thumbs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.dz-thumbs img { width: 54px; height: 40px; object-fit: cover; border-radius: 6px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(11,31,77,.15); }

/* extra photos grid (route places) */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 8px; }
.img-tile { position: relative; display: block; margin: 0 !important; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #fff; cursor: pointer; }
.img-tile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; transition: opacity .2s; }
.img-tile span { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 12.5px; font-weight: 500; color: var(--danger); }
.img-tile:has(input:checked) img { opacity: .35; }
.img-grid-captions { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.img-tile.has-captions { cursor: default; }
.img-tile.has-captions img { object-fit: contain; background: #f6f8fc; }
.img-caps { display: grid; gap: 6px; padding: 8px 8px 0; }
.img-caps .input { padding: 7px 9px; font-size: 13px; }
.img-tile.has-captions label { cursor: pointer; margin: 0; }
.img-tile.kept { border-color: #6ee7b7; cursor: default; }
.img-tile.kept span { color: var(--green); }
.err-list { margin: 8px 0 6px; padding-left: 20px; font-weight: 400; }
.err-list a { font-weight: 600; text-decoration: underline; }
.img-tile:has(input:checked) { border-color: var(--danger); }

/* race checkboxes (route places) */
.cat-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-check { position: relative; margin: 0 !important; cursor: pointer; }
.cat-check input { position: absolute; opacity: 0; }
.cat-check span { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: #fff; color: var(--navy); font-weight: 500; font-size: 13.5px; transition: .15s; }
.cat-check span small { color: var(--muted); font-weight: 400; }
.cat-check span::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 11px; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: transparent; }
.cat-check input:checked + span { border-color: var(--blue); background: var(--ice); }
.cat-check input:checked + span::before { background: var(--grad); border-color: transparent; color: #fff; }
.cat-check input:focus-visible + span { box-shadow: 0 0 0 3px rgba(59,130,246,.3); }

/* mobile refinements */
@media (max-width: 640px) {
  .input { font-size: 16px; } /* stops iOS zooming into fields */
  .toolbar .input, .toolbar .grow { flex: 1 1 100%; min-width: 0; }
  .card { padding: 16px; border-radius: 14px; }
  .card-head .btn-group { width: 100%; }
  .topbar h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kpi strong { font-size: 26px; }
  .table td, .table th { padding: 10px 12px; }
}

/* scanner */
#reader { border-radius: 14px; overflow: hidden; border: 1px solid var(--border) !important; background: var(--grad-soft); min-height: 60px; }
#reader video { border-radius: 14px; }
.scan-result { border-radius: 14px; padding: 20px; border: 1px solid var(--border); background: var(--panel-2); }
.scan-result.ok { border-color: #6ee7b7; background: #f0fdf7; box-shadow: 0 0 0 4px rgba(16,185,129,.1); }
.scan-result.warn { border-color: #f9a8d4; background: #fff7fb; box-shadow: 0 0 0 4px rgba(236,72,153,.1); }
.scan-result.bad { border-color: #fda4af; background: #fff1f3; box-shadow: 0 0 0 4px rgba(225,29,72,.1); }
.scan-bib { font: 700 56px/1 var(--font-head); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Route Map editor ---------- */
.tabs-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.race-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); font-weight: 500; color: inherit; }
.race-tab small { color: var(--muted); }
.race-tab.active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.rm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.rm-map-card { padding: 0; overflow: hidden; }
#rmMap { height: 640px; cursor: crosshair; }
.rm-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 14px; }
.rm-toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }
.rm-side .card { margin-bottom: 16px; }
.rm-side h3 { font-size: 15.5px; margin: 0 0 12px; }
.rm-more { margin-top: 14px; }
.rm-more summary { cursor: pointer; font-weight: 500; color: var(--blue); }
.rm-cues { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; }
.rm-cues li { display: grid; grid-template-columns: 70px 24px 1fr; gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13.5px; }
.rm-cues li:hover, .rm-cues li.active { background: rgba(37,99,235,.07); }
.rm-cues small { display: block; color: var(--muted); }
.rm-cue-km { font-variant-numeric: tabular-nums; font-weight: 600; }
.rm-pin.rm-pin-sm { width: 22px; height: 22px; border-width: 2px; }
.rm-pin.rm-pin-sm i { font-size: 10px; }
.rm-save .btn { width: 100%; justify-content: center; margin-top: 10px; }
.rm-unsaved { display: block; color: var(--danger); margin-top: 8px; }
@media (max-width: 1100px) { .rm-layout { grid-template-columns: 1fr; } #rmMap { height: 480px; } }

/* ---------- Prize Money editor ---------- */
.pz-editions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0; }
.pz-new { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.pz-new .input { width: auto; min-width: 200px; padding: 8px 12px; }
.pz-toolbar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 6px 0 10px; }
.pz-cols { display: flex; flex-wrap: wrap; gap: 8px; }
.pz-col { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); overflow: hidden; }
.pz-col .input { border: 0; border-radius: 0; width: 150px; padding: 8px 10px; font-weight: 500; }
.pz-col button, .pz-fill button { border: 0; background: transparent; padding: 8px 9px; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; }
.pz-col button:hover, .pz-fill button:hover { background: rgba(37,99,235,.08); color: var(--blue); }
.pz-x { color: var(--danger) !important; }
button.pz-x { border: 0; background: transparent; cursor: pointer; font-size: 18px; padding: 6px 8px; }
.pz-add-col { display: flex; gap: 8px; margin-top: 10px; max-width: 460px; }
.pz-race { border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 16px; background: rgba(37,99,235,.025); }
.pz-race-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 10px; }
.pz-race-name { max-width: 260px; font-weight: 600; font-size: 16px; }
.pz-race-tools { display: flex; gap: 6px; margin-left: auto; }
.pz-scroll { margin-bottom: 10px; }
.pz-table th { white-space: nowrap; font-size: 11.5px; padding: 10px 6px; }
.pz-table td { padding: 4px; }
.pz-table .input { min-width: 92px; padding: 7px 8px; font-variant-numeric: tabular-nums; text-align: right; }
.pz-table .input.is-text { text-align: center; color: var(--magenta); font-weight: 500; }
.pz-table .pz-pos .input { min-width: 90px; text-align: left; font-weight: 600; }
.pz-tools { white-space: nowrap; }
.pz-fill { display: inline-flex; align-items: center; border: 1px dashed var(--border-strong, var(--border)); border-radius: 8px; }
.pz-fill .input { border: 0; min-width: 0; width: 96px; text-align: left; }
.pz-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.pz-footer .btn-primary { margin-left: auto; }
.pz-total strong { font-size: 18px; color: var(--green); }

/* Results → bulk CSV upload help */
.csv-steps { margin: 4px 0 14px; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.csv-cols { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 13px; }
.csv-cols th { text-align: left; font-family: var(--font-head); padding: 6px 10px 6px 0; white-space: nowrap; vertical-align: top; color: var(--blue); }
.csv-cols td { padding: 6px 0; border-bottom: 1px solid var(--border); color: var(--muted); }

/* Results → Announce on home page */
.announce-card { border-left: 4px solid var(--border); }
.announce-card.is-on { border-left-color: var(--green); background: linear-gradient(90deg, rgba(5,150,105,.05), transparent 40%), var(--panel); }
.announce-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.announce-head h3 { margin: 0 0 4px; }
.announce-head h3 i { color: var(--pink); }
