/* SportsEd Solutions brand: navy #002B58, orange #FF6504, Poppins */
:root {
  --navy: #002b58;
  --navy-900: #001a36;
  --navy-700: #0a3d73;
  --orange: #ff6504;
  --orange-600: #e55700;
  --orange-50: #fff1e8;
  --ink: #0f1b2b;
  --muted: #5b6878;
  --line: #e3e8ef;
  --bg: #f5f7fa;
  --white: #fff;
  --danger: #c62828;
  --success: #1b7a43;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 27, 54, .06), 0 8px 24px rgba(0, 27, 54, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
h2 svg { width: 20px; height: 20px; color: var(--orange); }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
code { background: var(--navy); color: #fff; padding: .1em .45em; border-radius: 6px; font-size: .95em; user-select: all; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.strong { font-weight: 600; text-decoration: none; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pad { padding: 2rem 1rem !important; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .18em; font-weight: 800; font-size: .78rem;
  color: var(--orange); margin: 0 0 .5rem;
}
.accent { color: var(--orange); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; font-size: .92rem;
  padding: .7rem 1.2rem; border-radius: 10px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(255, 101, 4, .45); outline-offset: 2px;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-600); }
.btn-primary:disabled { opacity: .7; cursor: progress; }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-outline:hover { border-color: var(--navy); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn-ghost:hover { border-color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger-ghost:hover { background: #fdecec; }
.btn-sm { padding: .4rem .8rem; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: .88rem; color: var(--navy); margin-bottom: 1rem; }
input[type=text], input[type=email], input[type=password], textarea {
  display: block; width: 100%; margin-top: .4rem;
  font: inherit; font-weight: 400; color: var(--ink);
  padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .15s;
}
input:focus, textarea:focus { border-color: var(--navy); outline: none; }
textarea { resize: vertical; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: .3rem; }
fieldset { border: 1.5px solid var(--line); border-radius: 10px; padding: .6rem .9rem .3rem; margin: 0 0 1.2rem; max-height: 220px; overflow: auto; }
legend { font-weight: 600; font-size: .88rem; color: var(--navy); padding: 0 .3rem; }
.check { display: flex; align-items: baseline; gap: .55rem; font-weight: 500; color: var(--ink); margin: .45rem 0; flex-wrap: wrap; }
.check input { accent-color: var(--orange); width: 16px; height: 16px; flex: none; transform: translateY(2px); }
.drop {
  position: relative; display: flex; align-items: center; gap: 1rem;
  border: 2px dashed #c9d3e0; border-radius: 12px; padding: 1.2rem; background: #fafbfd;
  font-weight: 400; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover { border-color: var(--orange); background: var(--orange-50); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop strong { color: var(--navy); word-break: break-all; }

/* ---------- Flash ---------- */
.flash { padding: .85rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .9rem; border-left: 4px solid; }
.flash-error { background: #fdecec; border-color: var(--danger); color: #7d1b1b; }
.flash-success { background: #e9f6ee; border-color: var(--success); color: #134d2c; }
.flash-warning { background: var(--orange-50); border-color: var(--orange); color: #7a3300; }

/* ---------- Auth (login) ---------- */
body.auth { background: #fff; }
body.auth .foot { display: none; }
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(circle at 85% 110%, rgba(255, 101, 4, .35), transparent 45%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-900) 100%);
  padding: 3rem clamp(2rem, 5vw, 5rem);
  display: flex; flex-direction: column; justify-content: space-between; gap: 3rem;
}
.auth-hero::after { /* watermark of the SportsEd shield */
  content: ''; position: absolute; right: 7%; top: 17%; width: min(340px, 42%); aspect-ratio: 233 / 293;
  background: url('/img/shield.svg') center / contain no-repeat; pointer-events: none;
}
.auth-logo { width: 190px; height: auto; }
.auth-copy { max-width: 520px; position: relative; z-index: 1; }
.auth-copy h1 { color: #fff; font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 800; margin-bottom: 1rem; }
.auth-copy .lede { color: rgba(255, 255, 255, .8); font-size: 1.05rem; max-width: 440px; }
.ticks { list-style: none; padding: 0; margin: 1.8rem 0 0; display: grid; gap: .7rem; }
.ticks li { display: flex; align-items: center; gap: .7rem; font-weight: 500; }
.ticks li::before {
  content: ''; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12 4 4 8-8' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
}
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 3rem 1.5rem; }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h2 { font-size: 1.7rem; font-weight: 800; margin-bottom: .3rem; }
.auth-form .muted { margin-bottom: 1.6rem; }
.auth-form .btn { margin-top: .4rem; padding: .85rem; font-size: 1rem; }
.auth-logo-sm { display: none; width: 150px; margin-bottom: 1.5rem; }
.help { font-size: .82rem; color: var(--muted); margin-top: 1.4rem; }

/* ---------- App shell ---------- */
.topbar { background: var(--navy); border-bottom: 4px solid var(--orange); }
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: .6rem 1.5rem;
  display: flex; align-items: center; gap: 2rem;
}
.brand img { display: block; height: 44px; width: auto; }
.nav { display: flex; gap: .3rem; flex: 1; }
.nav a {
  color: rgba(255, 255, 255, .75); text-decoration: none; font-weight: 600; font-size: .92rem;
  padding: .5rem .9rem; border-radius: 8px;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a.on { color: #fff; background: rgba(255, 255, 255, .12); box-shadow: inset 0 -3px 0 var(--orange); }
.signout { display: flex; align-items: center; gap: .8rem; margin: 0; }
.who { color: rgba(255, 255, 255, .7); font-size: .85rem; }
.container { max-width: 1200px; margin: 0 auto; padding: 2.2rem 1.5rem 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.8rem; }
.page-head .muted { max-width: 640px; margin: 0; }
.back { display: inline-block; font-size: .88rem; font-weight: 600; text-decoration: none; margin-bottom: 1rem; color: var(--muted); }
.back:hover { color: var(--navy); }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem; }

/* ---------- Panels & tables ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.panel.flush { padding: 0; overflow-x: auto; }
.panel.narrow { max-width: 460px; }
.panel.danger { border-color: #f3c9c9; }
.pad-h { padding: 1.2rem 1.2rem 0; }
.two-col { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 1.5rem; align-items: start; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  font-weight: 700; padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap;
}
.table td { padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfcfe; }
form.inline { display: inline; margin: 0; }

/* ---------- Library cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.4rem; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.4rem; display: flex; flex-direction: column; position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.card::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--navy), var(--orange)); }
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0, 27, 54, .06), 0 14px 32px rgba(0, 27, 54, .1); }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.pkg-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--orange-50); color: var(--orange); }
.pkg-icon svg { width: 24px; height: 24px; }
.pkg-icon.big { width: 64px; height: 64px; margin-bottom: 1rem; }
.pkg-icon.big svg { width: 34px; height: 34px; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .03em; padding: .25rem .65rem; border-radius: 999px; background: var(--navy); color: #fff; white-space: nowrap; }
.pill-muted { background: #e8edf3; color: var(--muted); }
.desc { color: var(--muted); font-size: .9rem; }
.meta { display: flex; gap: 1.5rem; margin: auto 0 1.2rem; padding-top: .6rem; }
.meta div { display: flex; flex-direction: column; }
.meta dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.meta dd { margin: 0; font-weight: 600; color: var(--navy); font-size: .9rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; flex-wrap: wrap; }
.empty { text-align: center; background: #fff; border: 1px dashed #c9d3e0; border-radius: var(--radius); padding: 3.5rem 1.5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-logo-sm { display: block; }
  .topbar-inner { flex-wrap: wrap; gap: .6rem 1rem; padding: .6rem 1rem; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .signout { margin-left: auto; }
  .who { display: none; }
  .container { padding: 1.5rem 1rem 2.5rem; }
  .page-head { flex-direction: column; align-items: flex-start; }
}

/* ---------- Org logos ---------- */
.org-logo { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.org-mono {
  display: inline-grid; place-items: center; width: 100%; height: 100%;
  background: linear-gradient(150deg, var(--navy), var(--navy-700)); color: #fff;
  font-weight: 800; letter-spacing: .04em; border-radius: 12px; font-size: 1.5rem;
}
.org-mono.sm { font-size: .7rem; border-radius: 6px; }
.org-mono.lg { font-size: 1.6rem; }
.mini-logo {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
.org-cell { display: flex; align-items: center; gap: .8rem; text-decoration: none; }
.check-org { align-items: center; }
.check-org .mini-logo { width: 32px; height: 32px; padding: 3px; }
.check-org input { transform: none; }
.dot { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--muted); }
.dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #c3ccd8; }
.dot-on { color: var(--success); }
.dot-on::before { background: var(--success); }

/* ---------- Homepage ---------- */
body.home { background: var(--bg); }
.home-hero {
  color: #fff; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 90% 120%, rgba(255, 101, 4, .38), transparent 42%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-900) 100%);
  padding: 1.5rem clamp(1rem, 5vw, 4rem) 9rem;
}
.home-hero::after { /* watermark of the SportsEd shield */
  content: ''; position: absolute; right: 5%; top: 120px; width: 320px; aspect-ratio: 233 / 293;
  background: url('/img/shield.svg') center / contain no-repeat; pointer-events: none;
}
@media (max-width: 820px) { .home-hero::after { right: -90px; width: 260px; opacity: .7; } }
.home-bar { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.home-logo { width: 150px; height: auto; display: block; }
.staff-link { color: rgba(255, 255, 255, .7); text-decoration: none; font-size: .85rem; font-weight: 600; display: inline-flex; align-items: center; gap: .35rem; }
.staff-link:hover { color: #fff; }
.staff-link svg, .btn-sm svg { width: 16px; height: 16px; }
.home-copy { max-width: 1200px; margin: 3.5rem auto 0; position: relative; z-index: 1; }
.home-copy h1 { color: #fff; font-size: clamp(2rem, 4.4vw, 3.4rem); font-weight: 800; max-width: 760px; margin-bottom: .8rem; }
.home-copy .lede { color: rgba(255, 255, 255, .8); font-size: 1.08rem; max-width: 560px; }
.home-main { max-width: 1200px; margin: -6rem auto 0; padding: 0 clamp(1rem, 5vw, 4rem) 2rem; position: relative; z-index: 2; box-sizing: content-box; }
.home-panel { background: #fff; border-radius: 20px; box-shadow: 0 2px 4px rgba(0, 27, 54, .05), 0 24px 60px rgba(0, 27, 54, .14); padding: clamp(1.25rem, 3vw, 2.2rem); margin-bottom: 1.5rem; }
.home-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.home-panel-head h2 { font-size: 1.3rem; font-weight: 800; margin: 0; }
.search { position: relative; margin: 0; width: min(320px, 100%); }
.search svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search input { margin: 0; padding-left: 2.5rem; width: 100%; font: inherit; padding-top: .65rem; padding-bottom: .65rem; border: 1.5px solid var(--line); border-radius: 10px; }
.search input:focus { border-color: var(--navy); outline: none; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.org-tile {
  display: flex; flex-direction: column; align-items: center; gap: .9rem;
  padding: 1.4rem 1rem 1.1rem; border: 1.5px solid var(--line); border-radius: 16px;
  text-decoration: none; background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.org-tile:hover, .org-tile:focus-visible { border-color: var(--orange); box-shadow: 0 10px 28px rgba(0, 27, 54, .1); transform: translateY(-3px); }
.org-tile[hidden] { display: none; }
.org-tile-logo { display: grid; place-items: center; width: 100%; height: 96px; }
.org-tile-logo .org-mono { width: 96px; height: 96px; }
.org-tile-name { font-weight: 600; color: var(--navy); text-align: center; font-size: .92rem; line-height: 1.3; }
body.home .foot { padding-top: .5rem; }

/* ---------- Co-branded sign in ---------- */
.auth-form .back { margin-bottom: 1.8rem; }
.cobrand { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.8rem; }
.cobrand-client { display: grid; place-items: center; width: 96px; height: 96px; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.cobrand-x { color: var(--muted); font-size: 1.4rem; font-weight: 300; }
.cobrand-sed { width: 110px; height: auto; }

/* ---------- Library / client headers ---------- */
.lib-head { justify-content: flex-start; align-items: center; gap: 1.4rem; }
.lib-logo { display: grid; place-items: center; width: 96px; height: 96px; flex: none; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.lib-head .btn { margin-left: .4rem; vertical-align: middle; }

/* ---------- Admin forms ---------- */
hr { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0 1.1rem; }
.sub { font-weight: 700; color: var(--navy); margin-bottom: .8rem; }
.drop-sm { padding: .9rem 1rem; margin-bottom: 1rem; }
fieldset.plain { border: 0; padding: 0; max-height: 320px; }
.add-login { padding: 1.2rem; border-top: 1px solid var(--line); background: #fafbfd; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 .8rem; }

@media (max-width: 820px) {
  .home-hero { padding-bottom: 7rem; }
  .home-copy { margin-top: 2.2rem; }
  .org-grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .org-tile { padding: 1rem .6rem .9rem; }
  .org-tile-logo { height: 72px; }
  .org-tile-logo .org-mono { width: 72px; height: 72px; }
  .row3 { grid-template-columns: 1fr; }
  .lib-logo { width: 72px; height: 72px; }
  .lib-head { flex-direction: row; align-items: center; }
}

/* ---------- File previews ---------- */
.thumb { position: relative; overflow: hidden; background: #eef2f7; aspect-ratio: 16 / 10; display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.thumb-tile {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem;
  background:
    radial-gradient(circle at 85% 115%, rgba(255, 101, 4, .35), transparent 55%),
    linear-gradient(155deg, var(--navy) 0%, var(--navy-900) 100%);
  color: var(--orange);
}
.thumb-tile svg { width: 46px; height: 46px; }
.thumb-ext { color: #fff; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; }
.thumb-wait { color: rgba(255, 255, 255, .6); font-size: .72rem; }
/* Card: preview runs edge to edge under the gradient bar */
.card-thumb { margin: -1.4rem -1.4rem 1rem; border-bottom: 1px solid var(--line); }
.card::before { z-index: 1; }
.card-type { margin-bottom: .55rem; }
/* Admin list: small thumbnail next to the name */
.file-cell { display: flex; align-items: center; gap: .85rem; text-decoration: none; }
.thumb.mini { width: 72px; flex: none; border-radius: 8px; border: 1px solid var(--line); }
.thumb.mini .thumb-tile svg { width: 20px; height: 20px; }
.thumb.mini .thumb-ext, .thumb.mini .thumb-wait { display: none; }
.block { display: block; }
/* Admin file page */
.admin-thumb { border-radius: 12px; border: 1px solid var(--line); margin-bottom: .9rem; max-width: 420px; }
.preview-form { margin-top: .4rem; }
.preview-form .drop { margin-bottom: .8rem; }
.thumb-play {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; transform: translate(-50%, -50%);
  border-radius: 50%; background: rgba(0, 27, 54, .72); box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}
.thumb-play::after {
  content: ''; position: absolute; left: 22px; top: 17px;
  border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff;
}
.thumb.mini .thumb-play { width: 22px; height: 22px; }
.thumb.mini .thumb-play::after { left: 8px; top: 6px; border-width: 5px 0 5px 8px; }

/* ---------- Reviews ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
select { font: inherit; padding: .65rem .8rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; width: 100%; margin-top: .4rem; color: var(--ink); }
.pill-orange { background: var(--orange); }
.txt-orange { color: var(--orange-600); }
.row-on td { background: var(--orange-50) !important; }
.rv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }
.rv-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.rv-card-top { display: flex; gap: .4rem; margin-bottom: .9rem; }
.rv-card .btn { margin-top: .6rem; }

/* Player shell: fills the window under the top bar */
body.app-wide .foot { display: none; }
.container-wide { padding: 0; }
.rv { display: flex; flex-direction: column; height: calc(100vh - 70px); height: calc(100dvh - 70px); min-height: 520px; }
.rv-bar { display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rv-back { font-size: 1.3rem; text-decoration: none; color: var(--muted); padding: 0 .3rem; }
.rv-title { display: flex; flex-direction: column; min-width: 0; }
.rv-title b { color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32ch; }
.rv-sub { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .5rem; }
.rv-rounds { display: inline-flex; gap: .25rem; }
.rv-rounds a { font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 99px; background: #e8edf3; color: var(--muted); text-decoration: none; }
.rv-rounds a.on { background: var(--navy); color: #fff; }
.rv-screen { flex: 1; min-width: 160px; display: flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 600; color: var(--ink); background: var(--bg); border-radius: 99px; padding: .4rem .9rem; overflow: hidden; }
.rv-screen span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }
.rv-actions { display: flex; align-items: center; gap: .6rem; }
.rv-main { flex: 1; display: flex; min-height: 0; }
.rv-stage { position: relative; flex: 1; min-width: 0; background: #e9edf2; }
.rv-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.rv-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.is-adding .rv-overlay { pointer-events: auto; cursor: crosshair; background: rgba(0, 43, 88, .06); box-shadow: inset 0 0 0 3px var(--orange); }
.rv-hint { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: .5rem 1rem; border-radius: 99px; font-size: .88rem; font-weight: 500; box-shadow: var(--shadow); pointer-events: none; z-index: 3; }
.rv-hint kbd { font: inherit; background: rgba(255, 255, 255, .18); padding: 0 .35rem; border-radius: 4px; }
.rv-pin {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50% 50% 50% 4px;
  display: grid; place-items: center; font: 700 .8rem 'Poppins', sans-serif; color: #fff; background: var(--orange);
  border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .3); pointer-events: auto; cursor: pointer; padding: 0; z-index: 2;
}
.rv-pin.st-progress { background: var(--navy); }
.rv-pin.st-resolved { background: #7f8b99; opacity: .7; }
.rv-pin-draft { background: var(--orange); pointer-events: none; }
.rv-pin.flash, .rv-c.flash { animation: rvFlash 1.2s ease 2; }
@keyframes rvFlash { 50% { box-shadow: 0 0 0 8px rgba(255, 101, 4, .35); } }
@media (prefers-reduced-motion: reduce) { .rv-pin.flash, .rv-c.flash { animation: none; outline: 3px solid var(--orange); } }
.rv-pop { position: absolute; width: 320px; background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 27, 54, .3); padding: .8rem; z-index: 4; }
.rv-pop textarea { margin: 0; font-size: .92rem; resize: vertical; }
.rv-pop-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .6rem; }
.rv-pop-foot .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-pop-foot > span:last-child { display: flex; gap: .4rem; flex: none; }
.rv-pop.is-saving { opacity: .75; }

/* Comments panel */
.rv-panel { width: 380px; flex: none; display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--line); min-height: 0; }
.panel-closed .rv-panel { display: none; }
.rv-tabs { display: flex; gap: .3rem; padding: .7rem; border-bottom: 1px solid var(--line); }
.rv-tabs button { font: inherit; font-size: .84rem; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: .4rem .8rem; border-radius: 8px; cursor: pointer; }
.rv-tabs button[aria-selected="true"] { background: var(--navy); color: #fff; }
.rv-list { overflow-y: auto; padding: .8rem; flex: 1; }
.rv-empty { color: var(--muted); font-size: .9rem; padding: 1rem .4rem; }
.rv-group h3 { font-size: .8rem; font-weight: 700; color: var(--muted); margin: .4rem .2rem .6rem; display: flex; gap: .5rem; align-items: flex-start; justify-content: space-between; }
.rv-here { white-space: nowrap; flex: none; font-size: .68rem; background: var(--orange-50); color: var(--orange-600); padding: .05rem .45rem; border-radius: 99px; }
.rv-c { border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 10px; padding: .75rem .85rem; margin-bottom: .7rem; background: #fff; font-size: .9rem; }
.rv-c.st-progress { border-left-color: var(--navy); }
.rv-c.st-resolved { border-left-color: #a3adba; background: #fafbfc; }
.rv-c.st-resolved .rv-text { color: var(--muted); }
.rv-c header, .rv-replies header { display: flex; align-items: center; gap: .5rem; font-size: .8rem; }
.rv-c time, .rv-replies time { margin-left: auto; color: var(--muted); font-size: .75rem; }
.rv-num { width: 22px; height: 22px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .72rem; flex: none; }
.st-progress .rv-num { background: var(--navy); }
.st-resolved .rv-num { background: #a3adba; }
.rv-who { font-weight: 600; color: var(--ink); }
.rv-staff { font-size: .66rem; font-weight: 700; background: var(--navy); color: #fff; padding: .05rem .4rem; border-radius: 4px; margin-left: .2rem; }
.rv-text { margin: .45rem 0 .5rem; white-space: pre-wrap; word-break: break-word; }
.rv-shot img { display: block; width: 100%; border-radius: 6px; border: 1px solid var(--line); margin-bottom: .5rem; }
.rv-meta { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.rv-meta select { width: auto; margin: 0; padding: .25rem .5rem; font-size: .8rem; border-radius: 6px; }
.rv-status { font-size: .78rem; font-weight: 600; color: var(--muted); }
.rv-link { font: inherit; font-size: .8rem; font-weight: 600; border: 0; background: none; color: var(--navy); cursor: pointer; padding: 0; text-decoration: underline; }
.rv-del { color: var(--danger); }
.rv-replies { list-style: none; margin: .6rem 0 0; padding: 0 0 0 .7rem; border-left: 2px solid var(--line); display: grid; gap: .5rem; }
.rv-replies p { margin: .2rem 0 0; white-space: pre-wrap; word-break: break-word; }
.rv-reply { display: flex; gap: .4rem; margin-top: .6rem; align-items: flex-end; }
.rv-reply textarea { margin: 0; padding: .45rem .6rem; font-size: .85rem; min-height: 36px; resize: none; overflow: hidden; }
.rv-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--danger); color: #fff; padding: .7rem 1.1rem; border-radius: 10px; z-index: 50; box-shadow: var(--shadow); font-size: .9rem; }

@media (max-width: 900px) {
  .rv { height: auto; }
  .rv-main { flex-direction: column; }
  .rv-stage { height: 62vh; flex: none; }
  .rv-panel { width: auto; border-left: 0; border-top: 1px solid var(--line); max-height: none; }
  .rv-screen { order: 5; flex-basis: 100%; }
}
.import-panel { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; border-left: 4px solid var(--orange); }
.import-panel h2 { margin-bottom: .2rem; }
.import-panel p { margin: 0; max-width: 60ch; }

/* Logos come in every shape. Give each place they appear an explicit size limit
   (percentage limits don't apply inside these grid boxes). */
.org-logo { width: auto; height: auto; object-fit: contain; }
.org-tile-logo .org-logo { max-width: 100%; max-height: 96px; }
.mini-logo .org-logo { max-width: 32px; max-height: 32px; }
.check-org .mini-logo .org-logo { max-width: 26px; max-height: 26px; }
.lib-logo .org-logo { max-width: 76px; max-height: 76px; }
.cobrand-client .org-logo { max-width: 80px; max-height: 80px; }
@media (max-width: 820px) {
  .org-tile-logo .org-logo { max-height: 72px; }
  .lib-logo .org-logo { max-width: 52px; max-height: 52px; }
}
.dot-bad { color: var(--danger); }
.dot-bad::before { background: var(--danger); }
.enq { margin-bottom: 1rem; }
.enq-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.enq-tags { display: flex; gap: .8rem; align-items: center; }
.enq-msg { white-space: pre-wrap; word-break: break-word; border-left: 3px solid var(--orange); padding-left: .9rem; margin-bottom: 1rem; }

/* Arrange order */
.sort-bar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; position: sticky; top: 0; background: var(--bg); padding: .6rem 0; z-index: 2; }
.sort-grid { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; }
.sort-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: .7rem; padding: 1.2rem .8rem .9rem;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; cursor: grab; user-select: none;
}
.sort-item:hover { border-color: var(--navy); }
.sort-item.is-dragging { opacity: .45; border-style: dashed; border-color: var(--orange); }
.sort-item.is-hidden .org-tile-logo { opacity: .45; }
.sort-num { position: absolute; top: .5rem; left: .6rem; font-size: .75rem; font-weight: 700; color: var(--muted); }
.sort-item .org-tile-logo { height: 80px; }
.sort-item .org-tile-logo .org-logo { max-height: 80px; }
.sort-name { font-size: .85rem; font-weight: 600; color: var(--navy); text-align: center; line-height: 1.3; }
.sort-btns { display: flex; gap: .4rem; }
.sort-btns .btn { padding: .2rem .6rem; }
.sort-item img, .sort-item .org-mono { pointer-events: none; -webkit-user-drag: none; }
