:root {
  --bg: #0f1419;
  --surface: #1a2129;
  --surface-2: #232c36;
  --border: #2e3945;
  --text: #ece8e1;
  --muted: #8b97a3;
  --accent: #ff4655;
  --link: #ff4655;
  --good: #3ecf8e;
  --bad: #f5a524;
  --danger: #ff4655;
  --pastel: #a8e6bf;
  --pastel-text: #1e3a2a;
  --radius: 10px;
  --hover: #2d3844;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1rem 0 .4rem; }
header { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.brand { color: var(--text); font-weight: 700; letter-spacing: .02em; }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--accent); margin-right: .5rem; transform: rotate(45deg); }
nav { display: flex; gap: 1rem; align-items: center; }
nav form { margin: 0; }
.who { color: var(--muted); }
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.narrow { max-width: 420px; margin: 2rem auto; }
.grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; align-items: start; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .grid, .two { grid-template-columns: 1fr; } }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small, small { font-size: .85em; }
.lead { font-size: 1.1rem; margin: 0 0 .5rem; }
.good h3 { color: var(--good); }
.bad h3 { color: var(--bad); }
.good ul, .bad ul { margin: 0; padding-left: 1.1rem; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .45rem 0; border-bottom: 1px solid var(--border); }
ul.plain li:last-child { border-bottom: 0; }
ul.items { list-style: none; padding: 0; margin: 0; }
ul.items li { display: flex; gap: .6rem; align-items: flex-start; padding: .4rem 0; }
ul.items li form { margin: 0; }
ul.items li.done > span { color: var(--muted); text-decoration: line-through; }
.check { width: 22px; height: 22px; flex: none; border: 2px solid var(--muted); border-radius: 5px; background: transparent; color: var(--bg); padding: 0; font-size: 14px; line-height: 18px; text-align: center; cursor: pointer; display: inline-block; }
.check.on { background: var(--good); border-color: var(--good); }
details summary { cursor: pointer; color: var(--muted); margin-top: .75rem; }
.stack { display: flex; flex-direction: column; gap: .75rem; margin-bottom: .75rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--muted); }
input, select, textarea { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: .55rem .65rem; font: inherit; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button, .button { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: .6rem 1rem; font: inherit; font-weight: 600; cursor: pointer; display: inline-block; }
button.secondary, .button.secondary { background: var(--hover); color: var(--text); border: 1px solid var(--border); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button.link { background: none; color: var(--muted); padding: 0; font-weight: 400; }
.button:hover { text-decoration: none; }
.alert { padding: .7rem 1rem; border-radius: 6px; margin: 0 0 1rem; }
.alert.error { background: #3a1a1e; color: #ffb3ba; }
.alert.ok { background: #13332a; color: #9ff0c9; }
.alert.info { background: #1b2a3a; color: #a9cdf5; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: .85rem; }
.rank-row { display: flex; align-items: baseline; gap: .75rem; margin-bottom: .5rem; }
.rr { font-size: 1.2rem; font-weight: 600; }
.rank .button { margin-top: .5rem; }
.badge { display: inline-block; padding: .35rem .8rem; border-radius: 999px; font-weight: 700; font-size: 1.2rem; background: var(--surface-2); border: 2px solid currentColor; }
.badge.small { font-size: .8rem; padding: .15rem .55rem; border-width: 1px; }
.tier-unranked { color: #8b97a3; }
.tier-iron { color: #9a9a9a; }
.tier-bronze { color: #c08a5a; }
.tier-silver { color: #d6dde3; }
.tier-gold { color: #f0c24b; }
.tier-platinum { color: #4fc3c9; }
.tier-diamond { color: #c38df2; }
.tier-ascendant { color: #3ecf8e; }
.tier-immortal { color: #ff6b81; }
.tier-radiant { color: #fff3a8; }
.button.discord { background: #5865f2; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.narrow .button.discord { width: 100%; }
.divider { text-align: center; color: var(--muted); font-size: .85rem; margin: 1rem 0; border-bottom: 1px solid var(--border); line-height: 0; }
.divider span { background: var(--surface); padding: 0 .6rem; }
.alert.row-between { display: flex; }
.new-activity { color: var(--danger); font-size: .85rem; font-weight: 600; }
button.slot { background: var(--pastel); color: var(--pastel-text); font-weight: 600; margin: 0 .35rem .35rem 0; }
button.slot:hover { filter: brightness(1.08); }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill.ok { background: #13332a; color: #9ff0c9; }
.pill.warn { background: #3d2f12; color: #f5a524; }
.dd { position: relative; }
.ddbtn { background: transparent; color: var(--accent); padding: .45rem .8rem; border-radius: 6px; font-weight: 600; }
.dd:hover .ddbtn, .dd:focus-within .ddbtn { background: var(--hover); color: var(--accent); }
.ddmenu { display: none; position: absolute; top: 100%; left: 0; min-width: 190px; padding: .35rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; z-index: 10; flex-direction: column; box-shadow: 0 8px 20px #0006; }
.dd:hover .ddmenu, .dd:focus-within .ddmenu { display: flex; }
.ddmenu a { color: var(--muted); padding: .5rem .75rem; border-radius: 6px; white-space: nowrap; }
.ddmenu a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.brandwrap { display: flex; align-items: center; gap: .75rem; }
.viewtag { color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
@media print {
  body { background: #fff; color: #000; }
  header, .noprint { display: none !important; }
  .printonly { display: block !important; margin: 0 0 1rem; color: #000; }
  main { max-width: none; padding: 0; }
  .card, .tile2 { background: #fff; border: 1px solid #ccc; color: #000; }
  .money { color: #0a7a3c; }
  h1, h2, td, th { color: #000; }
  th, td { border-bottom: 1px solid #ddd; }
}
.actions { display: flex; gap: .75rem; align-items: center; margin-top: .3rem; font-size: .85rem; }
.actions form { margin: 0; }
.actions button.link { color: var(--accent); }
.chatlog { max-height: 360px; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; padding: .6rem; background: var(--surface-2); border-radius: 8px; margin-bottom: .75rem; }
.bubble { max-width: 85%; padding: .45rem .75rem; border-radius: 10px; background: var(--border); word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; }
.bubble .meta { font-size: .72rem; opacity: .75; margin-bottom: .1rem; }

/* Smooth, subtle hover and press effects */
a, button, .button, input, select, textarea, .card, .tile, .tile2, .slotpick span, .sched .blk, .ddmenu a, .ddbtn, tbody tr {
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease, opacity .18s ease, filter .18s ease;
}
button:hover, .button:hover { background: #ff6573; transform: translateY(-1px); box-shadow: 0 6px 16px #ff465540; text-decoration: none; }
button:active, .button:active { transform: translateY(0); box-shadow: none; filter: brightness(.95); }
button.secondary:hover, .button.secondary:hover { background: var(--hover); box-shadow: 0 6px 16px #0005; }
button.danger:hover { background: #ff465522; box-shadow: none; }
button.link:hover { background: none; color: var(--text); transform: none; box-shadow: none; }
.actions button.link:hover { color: #ff6573; }
.button.discord:hover { background: #6f7bf7; box-shadow: 0 6px 16px #5865f255; }
button.slot:hover { background: #bff0d2; filter: none; box-shadow: 0 6px 16px #a8e6bf40; }
.slotpick span:hover { opacity: 1; transform: translateY(-1px); }
.sched .blk:hover { filter: brightness(1.25); }
a:hover { color: #ff7a86; text-decoration: none; }
.ddmenu a:hover, nav a:hover { text-decoration: none; }
.card:hover, .tile:hover, .tile2:hover { border-color: #3d4a59; }
tbody tr:hover { background: #ffffff08; }
input:hover, select:hover, textarea:hover { border-color: #43505e; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } button:hover, .button:hover { transform: none; } }

/* Light theme when the browser asks for it */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #eceff3;
    --border: #d6dbe2;
    --text: #1c2229;
    --muted: #5d6874;
    --accent: #e23447;
    --link: #d12a3c;
    --good: #148a56;
    --bad: #b86e00;
    --danger: #d12a3c;
    --pastel: #b9ecce;
    --pastel-text: #14452c;
    --hover: #e1e5ea;
    color-scheme: light;
  }
  .alert.error { background: #fde6e9; color: #a3202f; }
  .alert.ok { background: #def5e9; color: #146c42; }
  .alert.info { background: #e3ecfb; color: #234a8f; }
  .pill.ok { background: #def5e9; color: #146c42; }
  .pill.warn { background: #fdf0d2; color: #9a5d00; }
  .new-activity { color: var(--accent); }
  .tier-silver { color: #7c8791; }
  .tier-gold { color: #b8860b; }
  .tier-radiant { color: #b09a00; }
  .tier-unranked { color: #6b7782; }
  .tier-iron { color: #707070; }
  .tier-platinum { color: #1b8f96; }
  button, .button { color: #fff; }
  button.secondary, .button.secondary { color: var(--text); }
  button.link { color: var(--muted); }
  button.danger { color: var(--danger); }
  button.slot { color: var(--pastel-text); }
  button.secondary:hover, .button.secondary:hover { box-shadow: 0 6px 16px #0002; }
  a:hover { color: #b81f31; }
  .card:hover, .tile:hover, .tile2:hover { border-color: #b8c0ca; }
  tbody tr:hover { background: #00000008; }
  input:hover, select:hover, textarea:hover { border-color: #aeb7c2; }
  .bubble.me { color: #fff; }
  .ddmenu { box-shadow: 0 8px 20px #0002; }
  .money { color: var(--good); }
}

.viewtabs { display: inline-flex; gap: 2px; margin-left: .75rem; padding: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; vertical-align: middle; }
.viewtabs a { padding: .25rem .7rem; border-radius: 6px; color: var(--muted); font-size: .8rem; font-weight: 600; transition: background .15s, color .15s; }
.viewtabs a:hover { color: var(--text); background: var(--hover); }
.viewtabs a.on { background: var(--accent); color: #fff; }

.viewbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .45rem .9rem; margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; }
.viewbar .viewpick { display: inline-flex; flex-direction: row; align-items: center; gap: .5rem; margin: 0; font-size: .9rem; white-space: nowrap; text-align: left; }
.viewbar select { width: auto; min-width: 9rem; padding: .3rem .6rem; margin: 0; }
.viewbar a { margin-left: auto; }

.setupimg { max-width: 100%; max-height: 320px; border-radius: 8px; border: 1px solid var(--border); margin-top: .5rem; }
.infocard h2 { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.infocard p { margin: .4rem 0; word-break: break-all; }

.assess { border: 1px solid var(--border); border-radius: 10px; padding: 1rem; background: var(--surface-2); }
.assess[hidden] { display: none; }
.assess h3 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: .75rem 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.chip { margin: 0; }
.chip[hidden] { display: none; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span { display: inline-block; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: .85rem; transition: background .15s, border-color .15s; }
.chip span:hover { background: var(--hover); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.maprow { display: grid; grid-template-columns: 6rem 1fr; align-items: center; gap: .5rem; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }

[hidden] { display: none !important; }

.tzrow { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tzrow select { flex: 1; min-width: 12rem; }

.agentgroups { display: flex; flex-direction: column; gap: .6rem; margin-top: .5rem; }
.agentgroup h4 { margin: 0 0 .25rem; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.agentgroup .chips { margin-top: 0; }

.msgdrops details.msgdrop { border-bottom: 1px solid var(--border, #2a3340); padding: .6rem 0; }
.msgdrops details.msgdrop:last-child { border-bottom: 0; }
.msgdrops summary { cursor: pointer; }
.msgdrops .chatlog { max-height: 260px; overflow-y: auto; margin: .6rem 0; }

.deleterow { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.deleterow label.inline { display: flex; flex-direction: row; align-items: center; gap: .5rem; margin: 0; }
.deleterow input[type=checkbox] { width: auto; margin: 0; padding: 0; border: 0; outline: none !important; box-shadow: none !important; }

/* tick boxes are small and never get the red input outline */
input[type=checkbox] { width: auto; padding: 0; border: 0; margin: 0; }
input[type=checkbox]:focus, input[type=checkbox]:focus-visible { outline: none !important; box-shadow: none !important; border: 0; }
.checks label.inline { display: inline-flex; flex-direction: row; align-items: center; gap: .4rem; margin-right: 1rem; }

.pastebox { margin: .25rem 0 .75rem; }
.pastebox summary { cursor: pointer; }
.pastebox label { margin-top: .5rem; }

.card.focus ul.items li { font-size: 1.1rem; padding: .55rem 0; }
.card.focus > h2 { font-size: 1.4rem; }
.card.focus hr { border: 0; border-top: 1px solid var(--border, #2a3340); margin: 1rem 0 .6rem; }
.card.focus details > summary { cursor: pointer; }

.row-btns { display: inline-flex; gap: .6rem; align-items: center; }


/* Live rank + live stats panels */
.card.rank { background: linear-gradient(160deg, var(--surface-2), var(--surface) 60%); position: relative; overflow: hidden; }
.card.rank::before, .card.livestats::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); }
.card.livestats { position: relative; overflow: hidden; }
.card.rank h2, .card.livestats h2 { display: flex; align-items: center; gap: .5rem; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.card.rank h2 .pill, .card.livestats h2 .pill { margin-left: auto; font-size: .65rem; letter-spacing: .06em; opacity: .85; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: .6rem; margin-top: .75rem; }
.stattile { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .6rem .7rem; }
.stattile .muted { display: block; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.stattile strong { display: block; margin-top: .15rem; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.livedot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(62,207,142,.2); }

/* Premium pass: type, depth, motion */
h1, h2, h3, .brand { font-family: Rajdhani, Inter, system-ui, sans-serif; }
h1 { font-size: 2rem; letter-spacing: .01em; }
h2 { font-size: 1.25rem; letter-spacing: .02em; }
.card { padding: 1.5rem; margin-bottom: 1.25rem; box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.28); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; animation: rise .35s ease both; }
.card:hover { transform: translateY(-2px); border-color: #3c4a59; box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 30px rgba(0,0,0,.38); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.button, button { transition: transform .12s ease, filter .15s ease, background .15s ease; }
.button:hover, button:hover { filter: brightness(1.08); }
.button:active, button:active { transform: scale(.97); }
input[type=checkbox] { transition: transform .12s ease; }
input[type=checkbox]:active { transform: scale(.85); }
.emblem { width: 2.6rem; height: 2.6rem; flex: none; filter: drop-shadow(0 0 8px currentColor); }
.rank-row { align-items: center; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.5rem 1.75rem; margin-bottom: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: radial-gradient(120% 140% at 0% 0%, rgba(255,70,85,.16), transparent 55%), var(--surface); animation: rise .35s ease both; }
.hero h1 { margin: 0; font-size: 2.4rem; }
.hero .eyebrow { margin: 0; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.hero-side { display: flex; align-items: center; gap: .75rem; text-align: right; }
.ring { --pct: 0; width: 3.6rem; height: 3.6rem; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--good) calc(var(--pct) * 1%), var(--surface-2) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-size: .8rem; font-weight: 600; }
.empty { text-align: center; padding: 1rem 0; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .card, .hero { animation: none; } .card:hover { transform: none; } }

.rankname { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.rankname strong { font-family: Rajdhani, Inter, sans-serif; font-size: 1.7rem; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.rankname .muted { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.rank-row .rr { margin-left: auto; font-size: .85rem; color: var(--muted); white-space: nowrap; }

/* Action-item checkbox: green hover/glow, never the red button style */
button.check:hover { background: transparent; border-color: var(--good); box-shadow: 0 0 10px rgba(62,207,142,.35); transform: none; filter: none; }
button.check.on:hover { background: var(--good); border-color: var(--good); box-shadow: 0 0 10px rgba(62,207,142,.5); }
button.check:active { transform: scale(.9); box-shadow: none; }

/* Starting point / assessment panel */
.assess { position: relative; overflow: hidden; }
.assess::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); }
.assess-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.assess-head .eyebrow { margin: 0 0 .15rem; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.assess-head .emblem { width: 3.2rem; height: 3.2rem; }
.assess-meta { margin-left: auto; display: flex; gap: .4rem; flex-wrap: wrap; }
.assess .statgrid { margin: 1rem 0; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.apanel { margin-top: 1rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: rgba(0,0,0,.12); }
.apanel h4 { margin: 0 0 .5rem; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.apanel p { margin: 0; }
.chips-out { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { display: inline-block; padding: .25rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 500; background: var(--surface-2); border: 1px solid var(--border); }
.tag.soft { color: var(--muted); }
.vchip { padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; border: 1px solid var(--border); color: var(--muted); }
.vchip.ok { color: var(--good); border-color: rgba(62,207,142,.4); }
.goals { margin: 0; padding: 0; list-style: none; }
.goals li { position: relative; padding: .3rem 0 .3rem 1.25rem; }
.goals li::before { content: ""; position: absolute; left: 0; top: .85rem; width: .45rem; height: .45rem; background: var(--accent); transform: rotate(45deg); }

.plan-count { margin: 0 0 .6rem; font-size: 1rem; }
.plan-count strong { font-family: Rajdhani, Inter, sans-serif; font-size: 2rem; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #ff8a95); transition: width .4s ease; }

.emblem.photo { filter: drop-shadow(0 2px 8px rgba(0,0,0,.5)); object-fit: contain; }

.peakrow { display: flex; align-items: center; gap: .75rem; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.peakrow .emblem { width: 1.9rem; height: 1.9rem; filter: none; }
.peakrow strong { display: block; font-family: Rajdhani, Inter, sans-serif; font-size: 1.15rem; letter-spacing: .03em; text-transform: uppercase; line-height: 1.1; }

.detected { padding: .8rem 1rem; border: 1px solid var(--accent); border-radius: 8px; background: rgba(255,70,85,.08); }
.detected p { margin: 0 0 .5rem; }
.detected label.inline { display: flex; flex-direction: row; align-items: center; gap: .5rem; margin: 0; }
.detected input[type=checkbox] { width: auto; margin: 0; }

/* Rank emblems: fixed square slot so every rank (Radiant included) sits on the same centre line */
.emblem { display: block; width: 2.6rem; height: 2.6rem; flex: none; object-fit: contain; }
.rank-row { gap: .85rem; }
.rankname { justify-content: center; }
.rankname strong { line-height: 1; }
.peakrow .emblem { width: 2rem; height: 2rem; }
.peakrow > div { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.peakrow strong { white-space: nowrap; }

.delta { display: block; margin-top: .1rem; font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }

/* Act history table */
.actscroll { overflow-x: auto; margin: .25rem 0 .5rem; }
.acttable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acttable th { text-align: left; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: .4rem .75rem .4rem 0; border-bottom: 1px solid var(--border); }
.acttable td { padding: .55rem .75rem .55rem 0; border-bottom: 1px solid var(--border); }
.acttable tbody tr:first-child td { font-weight: 600; }

.refreshstats { margin: 0 0 .75rem; text-align: right; }
.refreshstats button { width: auto; }

.acttable td.actgroup { font-weight: 600; white-space: nowrap; }
.acttable tr.newgroup td { border-top: 1px solid var(--border); }

.welcome { max-width: 640px; margin: 0 auto; }
.tutorial { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(0, 0, 0, .65); }
.tutorial[hidden] { display: none; }
.tutorial-box { max-width: 460px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 1.25rem 1.4rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; }
.tutorial-box li { margin-bottom: .75rem; }

.studentmeta { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.studentmeta .tag { font-size: .72rem; padding: .1rem .5rem; }
.tag.ok { color: #7ee2a8; border-color: rgba(126, 226, 168, .35); background: rgba(126, 226, 168, .08); }
.tutorial-foot { display: flex; flex-direction: column; align-items: center; gap: .9rem; margin-top: 1.25rem; }
.tutorial-foot .tutcheck { display: flex; flex-direction: row; align-items: center; gap: .6rem; margin: 0; cursor: pointer; }
.tutorial-foot .tutcheck input { width: auto; margin: 0; }
.tutorial-foot button { min-width: 8rem; }
.tutorial-foot button:disabled { opacity: .45; cursor: not-allowed; }

.nextbooking { margin-top: .5rem; }
.nextbooking .eyebrow { margin: 0 0 .15rem; }
.slotblock { display: block; }
.slotblock .slotdate, .slotblock .slottime { display: block; }
.slotblock .slottime { margin-top: .3rem; }
.slotblock .slotdate { font-size: 1.25rem; font-family: Rajdhani, Inter, sans-serif; }
.nextbooking .row-btns { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }

.pastebox { padding: 1.4rem 1rem; text-align: center; color: var(--muted, #98a2b3); border: 2px dashed var(--border); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.pastebox:hover, .pastebox:focus { outline: none; border-color: var(--accent); background: rgba(255, 70, 85, .06); }
.pastebox.got { border-style: solid; border-color: #3fb97a; }
.pastebox kbd { padding: .05rem .4rem; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); font-size: .8rem; }
.filebtn { flex-wrap: wrap; display: flex; flex-direction: row; align-items: center; gap: .6rem; }
.filebtn input { width: auto; min-width: 0; max-width: 100%; }
.bug-fixed, .bug-wontfix { opacity: .7; }
.bug select { width: auto; }

.settinghead { margin: 1.5rem 0 .5rem; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.settinggrid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
a.settingtile { display: block; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.settingtile:hover { border-color: var(--accent); transform: translateY(-2px); }
a.settingtile h2 { margin: 0; font-size: 1rem; }
a.settingtile p { margin: .4rem 0 0; }

nav > a, nav .ddbtn { padding: .45rem .8rem; font-weight: 600; }
nav > a:hover { background: var(--hover); border-radius: 6px; }

/* ---- Phones and tablets ---- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, video { max-width: 100%; height: auto; }
input, select, textarea { max-width: 100%; }
@media (max-width: 900px) {
  header { flex-wrap: wrap; gap: .5rem .75rem; padding: .7rem 1rem; }
  nav { flex-wrap: wrap; gap: .25rem .5rem; justify-content: flex-start; }
  .brandwrap { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  main { padding: 1rem .75rem 2.5rem; }
  h1 { font-size: 1.35rem; }
  .card { padding: 1rem; }
  header { align-items: flex-start; }
  nav { width: 100%; }
  nav > a, nav .ddbtn { padding: .4rem .55rem; }
  .ddmenu { left: 0; right: auto; max-width: calc(100vw - 1.5rem); }
  .who { width: 100%; order: 10; }
  /* 16px inputs stop iPhones zooming in when a field is tapped */
  input, select, textarea { font-size: 16px; }
  button, .button { min-height: 44px; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .hero { flex-direction: column; align-items: flex-start; }
  .tutorial-box { padding: 1rem; }
  .settinggrid { grid-template-columns: 1fr; }
  .row-btns { flex-wrap: wrap; }
}

/* ---- VOD review ---- */
.vodlayout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.vodframe { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.vodframe iframe, .vodframe #ytplayer { position: absolute; inset: 0; width: 100%; height: 100%; }
.vodnew textarea { width: 100%; margin: .5rem 0; }
.vodlist { margin-top: 1rem; }
.vodnote { display: flex; gap: .6rem; align-items: baseline; padding: .5rem 0; border-top: 1px solid var(--border); }
.vodjump { min-height: 0; padding: .15rem .5rem; font-variant-numeric: tabular-nums; flex: none; }
.vodtext { flex: 1; cursor: pointer; white-space: pre-wrap; word-break: break-word; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0 .25rem; min-height: 0; }
@media (max-width: 800px) { .vodlayout { grid-template-columns: 1fr; } .vodnote { flex-wrap: wrap; } }

/* ---- Collapsible management cards on the coach's student page ---- */
.manage > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin: 0; color: inherit; cursor: pointer; }
.manage > summary::-webkit-details-marker { display: none; }
.manage > summary h2 { margin: 0; }
.manage > summary::after { content: '▾'; color: var(--muted); }
.manage[open] > summary::after { content: '▴'; }
.manage[open] > summary { margin-bottom: .75rem; }
.manage > summary .muted { margin-left: auto; }

/* ---- Left sidebar navigation on wide screens (top bar stays on phones and tablets) ---- */
nav a.on { background: var(--hover); border-radius: 6px; }
@media (min-width: 1000px) {
  body.side { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
  body.side > header { grid-column: 1; position: sticky; top: 0; height: 100vh; flex-direction: column; align-items: stretch; justify-content: flex-start; flex-wrap: nowrap; gap: 0; padding: 1.1rem .8rem; border-bottom: 0; border-right: 1px solid var(--border); overflow-y: auto; }
  body.side > main { grid-column: 2; width: 100%; padding: 1.5rem 2rem 3rem; }
  body.side .brandwrap { flex-direction: column; align-items: flex-start; gap: .9rem; margin-bottom: 1.1rem; padding: 0 .4rem; }
  body.side nav { flex: 1; flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: .1rem; width: auto; }
  body.side nav > a, body.side .ddmenu a { display: block; padding: .5rem .8rem; border-radius: 6px; font-weight: 600; }
  body.side .ddmenu a { color: var(--accent); white-space: normal; }
  body.side nav > a:hover, body.side .ddmenu a:hover { background: var(--hover); color: var(--accent); }
  body.side nav a.on { background: var(--hover); box-shadow: inset 3px 0 0 var(--accent); }
  body.side .dd { display: block; }
  body.side .ddbtn { display: block; width: 100%; text-align: left; pointer-events: none; cursor: default; background: none; color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; padding: .9rem .8rem .25rem; }
  body.side .ddbtn small { display: none; }
  body.side .ddmenu { display: flex; position: static; min-width: 0; padding: 0; background: none; border: 0; box-shadow: none; }
  body.side .who { width: auto; order: 0; margin-top: auto; padding: .8rem .8rem .2rem; }
  body.side nav form { padding: 0 .4rem; }
}
@media (min-width: 1000px) {
  body.side .viewtabs { width: 100%; display: flex; }
  body.side .viewtabs a { flex: 1; text-align: center; white-space: nowrap; padding-left: .4rem; padding-right: .4rem; font-size: .85rem; }
  body.side nav form { padding: 0 .8rem; }
  body.side nav form .link { padding: 0; }
}
@media (min-width: 1000px) {
  body.side .dd:hover .ddbtn, body.side .dd:focus-within .ddbtn { background: none; color: var(--muted); }
}

.vodbar { margin-top: .5rem; }
.vodlayout.cinema { grid-template-columns: minmax(0, 1fr) 340px; }
.vodlayout.cinema .vodframe { max-width: calc(85vh * 16 / 9); }
.vodlayout.cinema .vodnotes { position: sticky; top: 1rem; max-height: 88vh; overflow-y: auto; }
body.vodcinema main { max-width: none; }
@media (max-width: 800px) { .vodlayout.cinema { grid-template-columns: 1fr; } .vodlayout.cinema .vodnotes { position: static; max-height: none; } }
@media (min-width: 1000px) {
  body.vodcinema.side { grid-template-columns: minmax(0, 1fr); }
  body.vodcinema.side > header { display: none; }
  body.vodcinema.side > main { grid-column: 1; }
}
.vodlayout.cinema { grid-template-columns: minmax(0, 1fr) 320px; }

.vodlayout { align-items: start; }
.vodnotes { display: flex; flex-direction: column; overflow: hidden; }
.vodnotes .vodlist { flex: 1; min-height: 0; overflow-y: auto; margin-top: .75rem; }
.vodlayout.cinema .vodnotes { position: static; max-height: none; }
@media (max-width: 800px) { .vodnotes { overflow: visible; } .vodnotes .vodlist { overflow: visible; } }
