:root {
  color-scheme: light;
  --canvas: #f1f4f8;
  --paper: #ffffff;
  --ink: #172337;
  --muted: #738096;
  --line: #e0e6ed;
  --rail: #17243b;
  --rail-muted: #aab7ca;
  --accent: #667fe0;
  --accent-deep: #526bcb;
  --accent-soft: #edf0ff;
  --teal: #4caaa5;
  --gold: #d5a85c;
  --danger: #bd4e59;
  --ok: #31826e;
  --warn-bg: #fff6df;
  --warn: #8a5a00;
  --tile: #12213d;
  --premium: #ae7c2e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #101827; --paper: #192438; --ink: #e7edf6; --muted: #a5b2c5; --line: #2c3a50;
    --rail: #0c1422; --rail-muted: #aab7ca; --accent: #92a4ff; --accent-deep: #aab7ff; --accent-soft: #273252;
    --teal: #62c2bb; --gold: #e0bb75; --danger: #ff828b; --ok: #69cfac; --warn-bg: #392f19; --warn: #ffcf70;
    --tile: #0d1b3a; --premium: #f0b54a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif; }
a { color: var(--accent-deep); }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, white); outline-offset: 3px; }
h1 { margin: 0; font-size: clamp(1.65rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -.035em; }
h2 { margin: 0 0 7px; font-size: 1.1rem; letter-spacing: -.02em; }
p { margin-top: 0; }
code { background: var(--canvas); padding: 2px 6px; border-radius: 5px; }

.admin-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; display: flex; flex-direction: column; width: 232px; padding: 25px 16px 18px; background: var(--rail); color: #f3f6fb; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 32px; color: #f4f6fa; text-decoration: none; font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
.brand strong { display: block; color: #aab8ce; font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #53627a; border-radius: 13px; color: #d5c68f; font-size: 26px; line-height: 1; }
.nav-caption, .eyebrow { margin: 0 0 10px; color: var(--muted); font-size: .75rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.nav-caption { padding: 0 11px; color: #8392a9; }
.nav { display: grid; gap: 5px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 9px; color: var(--rail-muted); text-decoration: none; transition: background .15s ease, color .15s ease; }
.nav a > span { display: grid; place-items: center; width: 20px; font-size: 18px; }
.nav a:hover, .nav a.on { background: #263650; color: #fff; }
.nav a.on { box-shadow: inset 3px 0 #9ba9ff; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #304059; padding-top: 15px; }
.account-link { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; color: #f1f4fa; text-decoration: none; }
.account-link:hover, .account-link.on { background: #263650; }
.account-link strong, .account-link small { display: block; max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-link strong { font-size: 13px; font-weight: 600; }
.account-link small { color: #aab7ca; font-size: 12px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #344969; color: #e5eaff; font-weight: 650; }
.logout { margin: 11px 8px 0; }
button.link { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--rail-muted); cursor: pointer; }
button.link:hover { color: white; }
.admin-shell main { max-width: 1440px; margin-left: 232px; padding: 38px clamp(22px, 4vw, 58px) 30px; }
.login-shell main { max-width: 520px; margin: 0 auto; padding: 24px 18px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.dashboard-head { align-items: end; margin-bottom: 28px; }
.dashboard-head .eyebrow { margin-bottom: 7px; color: var(--accent-deep); }
.dashboard-head .muted { margin: 8px 0 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hint { display: block; margin-top: 5px; color: var(--muted); font-size: .82rem; font-weight: 400; }
.card { margin: 16px 0; padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .12s ease, background .12s ease, border-color .12s ease; }
.button:hover, button:not(:disabled):hover { border-color: #cbd4e1; transform: translateY(-1px); }
.button.primary, button.primary { border-color: var(--accent); background: var(--accent); color: white; }
.button.primary:hover, button.primary:not(:disabled):hover { border-color: var(--accent-deep); background: var(--accent-deep); }
button:disabled { opacity: .58; cursor: not-allowed; }
button.danger { border-color: var(--danger); background: transparent; color: var(--danger); }
.danger-zone { margin-top: 8px; }
.flash { margin: 0 0 15px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.flash.ok { border-color: var(--ok); }
.flash.error, .error { color: var(--danger); }
.flash.warn { border-color: transparent; background: var(--warn-bg); color: var(--warn); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.stat { position: relative; min-height: 154px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.stat-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-deep); font-size: 19px; }
.mix-icon { background: #e8f4f3; color: #398d88; }
.library-icon { background: #f7f0e2; color: #9b752e; }
.live-icon { background: #e8f2ed; color: #43856a; }
.stat strong { display: block; font-size: 1.55rem; line-height: 1.15; letter-spacing: -.04em; }
.stat small { display: block; margin-top: 3px; color: var(--muted); font-size: .85rem; }
.stat a, .stat-note { display: inline-block; margin-top: 10px; font-size: .78rem; font-weight: 600; text-decoration: none; }
.stat a:hover { text-decoration: underline; }
.stat-note { color: var(--ok); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, .85fr); gap: 14px; align-items: stretch; margin-top: 16px; }
.dashboard-grid .card { margin: 0; }
.publish { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; border-left: 4px solid var(--ok); }
.publish.dirty { border-left-color: var(--accent); }
.publish-copy { display: grid; grid-template-columns: 38px 1fr; gap: 14px; }
.publish-copy .eyebrow { margin: 0 0 7px; }
.publish-copy .muted { max-width: 620px; margin: 0; }
.publish-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #e8f2ed; color: var(--ok); font-weight: 700; }
.publish.dirty .publish-mark { background: var(--accent-soft); color: var(--accent-deep); }
.publish form { align-self: flex-end; }
.warn { grid-column: 2; margin: 12px 0 0; padding: 10px 12px 10px 30px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); }
.quick-start h2 { margin-bottom: 16px; }
.quick-start .eyebrow { margin-bottom: 7px; }
.quick-link { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.quick-link > span:nth-child(2) { min-width: 0; flex: 1; }
.quick-link strong, .quick-link small { display: block; }
.quick-link strong { font-size: .9rem; }
.quick-link small { margin-top: 1px; color: var(--muted); font-size: .78rem; }
.quick-link > b { color: var(--muted); font-size: 20px; font-weight: 400; }
.quick-link:hover strong { color: var(--accent-deep); }
.quick-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-deep); font-size: 19px; }
.site-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.site-footer a { text-decoration: none; }
.steps li { margin: 6px 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .75rem; font-weight: 650; letter-spacing: .045em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tr.inactive td { opacity: .58; }
td.actions { text-align: right; white-space: nowrap; }
td audio { width: 220px; height: 34px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--canvas); color: var(--muted); font-size: .78rem; font-weight: 600; }
.pill.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pill.premium { background: color-mix(in srgb, var(--premium) 18%, transparent); color: var(--premium); }
.icon-tile { display: inline-flex; flex-shrink: 0; width: 44px; height: 44px; padding: 6px; border-radius: 10px; background: var(--tile); }
.icon-tile svg { width: 100%; height: 100%; }
.cover { display: block; width: 48px; height: 66px; border-radius: 8px; object-fit: cover; }
.cover-large { display: block; max-width: 220px; margin: 0 0 12px; border-radius: 12px; }
.empty { color: var(--muted); text-align: center; }
.form label { display: block; margin: 0 0 14px; font-weight: 600; }
.form input[type=text], .form input:not([type]), .form input[type=number], .form input[type=password], .form select, .login input { display: block; width: 100%; min-height: 43px; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas); color: var(--ink); }
.form input[type=file] { display: block; max-width: 100%; margin-top: 7px; }
.form .check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.form .checks { padding-top: 22px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.narrow { max-width: 460px; }
fieldset { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
legend { padding: 0 6px; font-weight: 600; }
.icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; }
.form .icon-option { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 !important; padding: 6px; border: 2px solid transparent; border-radius: 10px; font-weight: 400 !important; text-align: center; cursor: pointer; }
.icon-option input { position: absolute; opacity: 0; }
.icon-option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.icon-option:has(input:focus-visible) { outline: 2px solid var(--accent); }
.sound-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) minmax(90px, 160px) 44px; align-items: center; gap: 10px; margin: 6px 0; }
.sound-row select { margin: 0 !important; }
.form-actions { margin-top: 8px; }
.login { max-width: 400px; margin: 10vh auto 0; }
.login h1 { margin-bottom: 5px; }
.login label { display: block; margin: 12px 0; font-weight: 600; }
.login button { width: 100%; margin-top: 8px; }
@media (max-width: 1050px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .sidebar { position: sticky; inset: 0 0 auto; width: auto; height: auto; padding: 10px 13px 9px; }
  .brand { padding: 0 2px 9px; }
  .brand-mark { width: 31px; height: 31px; border-radius: 10px; font-size: 21px; }
  .brand strong { display: inline; margin-left: 5px; font-size: 10px; }
  .nav-caption { display: none; }
  .nav { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .nav a { justify-content: center; gap: 7px; min-height: 39px; padding: 0 5px; font-size: .85rem; }
  .nav a.on { box-shadow: inset 0 -2px #9ba9ff; }
  .sidebar-bottom { display: flex; align-items: center; justify-content: space-between; border: 0; padding: 4px 0 0; }
  .account-link { gap: 7px; padding: 3px 5px; }
  .account-link strong { max-width: 100px; }
  .account-link small { display: none; }
  .avatar { width: 28px; height: 28px; font-size: .85rem; }
  .logout { margin: 0 5px; }
  .admin-shell main { margin: 0; padding: 24px 16px 24px; }
  .dashboard-head { align-items: flex-start; }
  .dashboard-head .button { width: 100%; }
  .card { padding: 17px; }
  .stat { min-height: 142px; padding: 14px; }
  .publish form { align-self: stretch; }
  .publish form button { width: 100%; }
  .sound-row { grid-template-columns: 18px 1fr 44px; }
  .sound-row input[type=range] { grid-column: 2 / 3; }
  td audio { width: 160px; }
}
@media (max-width: 420px) {
  .stats { gap: 9px; }
  .stat { padding: 12px; }
  .site-footer { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
