:root {
  --black: #080909;
  --surface: #111212;
  --surface-2: #191817;
  --gold: #d4af37;
  --gold-light: #efc55c;
  --bronze: #b87333;
  --red: #b22222;
  --red-light: #e23434;
  --green: #23b34b;
  --text: #f4f1ea;
  --muted: #aaa59d;
  --line: rgba(212,175,55,.58);
  --shadow: 0 28px 80px rgba(0,0,0,.62);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body { margin: 0; min-height: 100vh; color: var(--text); font-family: "Segoe UI", Arial, sans-serif; background: radial-gradient(circle at 50% 18%, #272a2c 0, #151719 36%, #070808 100%); }
button, input { font: inherit; }
button { color: inherit; }
.prototype-shell { min-height: 100vh; display: grid; place-items: center; padding: 36px 20px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

.app-window { position: relative; isolation: isolate; width: min(1120px, 95vw); overflow: hidden; border: 1px solid var(--gold); border-radius: 28px; background: radial-gradient(circle at 50% 45%, rgba(184,115,51,.08), transparent 45%), linear-gradient(135deg, #090a0a, #151616 48%, #080909); box-shadow: var(--shadow), inset 0 0 80px rgba(255,255,255,.018); }
.app-window::before, .app-window::after { content: "❦\A❧\A❦"; white-space: pre; position: absolute; z-index: -1; color: var(--bronze); opacity: .17; font-family: Georgia, serif; font-size: 72px; line-height: 1.9; }
.app-window::before { left: -22px; top: 115px; transform: rotate(-14deg); }
.app-window::after { right: -20px; bottom: 22px; transform: rotate(164deg); }
.main-window { z-index:1000; width:min(clamp(640px,56.25vw,900px),calc(100vw - 18px)); aspect-ratio:4/3; height:auto; min-height:0; display:grid; grid-template-rows:10.7% 81.1% 8.2%; border-color:#4c4c4c; border-radius:12px; container-type:inline-size; transition:width .22s ease; }
.main-window.is-maximized { width:min(900px,calc(100vw - 18px)); }
.main-window::before, .main-window::after { content:""; display:block; width:23cqw; height:23cqw; opacity:.16; border:1px solid var(--bronze); border-radius:48% 52% 45% 55%; background:repeating-radial-gradient(circle at 20% 25%,transparent 0 8px,rgba(184,115,51,.28) 9px 10px); }
.main-window::before { left:-12cqw; top:5cqw; }
.main-window::after { right:-11cqw; bottom:1cqw; }
.main-titlebar { z-index:2; display:flex; align-items:center; justify-content:space-between; padding-left:1.9cqw; background:linear-gradient(90deg,#090a0a,#101111); border-bottom:1px solid #242424; }
.app-identity { display:flex; align-items:center; gap:1.4cqw; }
.app-identity h1 { margin:0; font-size:2.1cqw; font-weight:500; letter-spacing:.01em; }
.app-icon { width:4.1cqw; height:4.1cqw; overflow:hidden; border:1px solid var(--gold); border-radius:.65cqw; background:#050505; }
.app-icon img { width:100%; height:100%; object-fit:cover; object-position:center 57%; mix-blend-mode:screen; }
.native-controls { align-self:stretch; display:flex; }
.native-controls button { width:5.3cqw; min-width:38px; border:0; background:transparent; color:#eee; font-size:2.2cqw; cursor:pointer; }
.native-controls button:hover { background:#292929; }
.native-controls button:active { background:#3a3a3a; transform:translateY(1px); }
.native-controls button:focus-visible, .footer-utilities button:focus-visible, .main-action:focus-visible, .main-window .preset-card:focus-visible { outline:2px solid var(--gold-light); outline-offset:2px; }
.native-controls .window-close { width:5.8cqw; background:linear-gradient(135deg,#9c151c,#d92d35); font-size:3.2cqw; }
.native-controls .window-close:hover { background:#e52f38; }
.main-design { z-index:1; display:grid; grid-template-rows:35% 8% 31% 5% 21%; padding:0 3.4cqw; }
.center-brand { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:0; text-align:center; }
.center-brand > img { width:23cqw; height:8.4cqw; object-fit:cover; object-position:center 58%; mix-blend-mode:screen; filter:saturate(.95) contrast(1.08); }
.brand-title-row { width:72%; display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:2.4cqw; margin-top:.4cqw; }
.brand-title-row span { height:1px; background:linear-gradient(90deg,transparent,var(--gold)); }
.brand-title-row span:last-child { background:linear-gradient(90deg,var(--gold),transparent); }
.brand-title-row h2 { margin:0; color:#f1dfae; font:4cqw Georgia,"Times New Roman",serif; text-shadow:0 1px 13px rgba(212,175,55,.22); white-space:nowrap; }
.center-brand p { margin:.25cqw 0 0; color:#c1783d; font-size:1.75cqw; }
.main-preset-heading { width:55%; justify-self:center; gap:1.5cqw; margin:0; }
.main-preset-heading h2 { font-size:1.65cqw; white-space:nowrap; }
.main-window .preset-cards { gap:1.5cqw; }
.main-window .preset-card { min-height:0; height:100%; display:grid; grid-template-columns:34% 66%; grid-template-rows:1fr; padding:1.25cqw 1.05cqw; border-radius:2cqw; }
.main-window .preset-card:hover { transform:translateY(-2px); }
.main-window .preset-card:active { transform:translateY(1px) scale(.992); }
.main-window .preset-card[aria-checked="true"] { border:2px solid var(--gold-light); background:radial-gradient(circle at 50% 45%,rgba(212,175,55,.18),transparent 68%),rgba(20,19,17,.9); box-shadow:0 0 0 1px rgba(178,34,34,.7),0 0 24px rgba(212,175,55,.45),inset 0 0 34px rgba(212,175,55,.08); }
.main-speaker { width:100%; height:100%; color:var(--gold-light); align-self:center; }
.preset-card.high .main-speaker { color:var(--red-light); }
.main-card-copy { align-self:center; display:grid; gap:.35cqw; text-align:left; min-width:0; }
.main-window .preset-name { min-height:0; display:block; text-align:left; font-size:2.05cqw; line-height:1.12; }
.main-window .preset-volume { font:2.85cqw Georgia,serif; }
.main-segments { display:flex; gap:.38cqw; margin-top:.45cqw; }
.main-segments i { width:1.05cqw; height:.55cqw; border-radius:.18cqw; background:#343434; }
.main-segments i.on { background:var(--gold-light); box-shadow:0 0 5px rgba(212,175,55,.25); }
.preset-card.high .main-segments i.on { background:var(--red-light); }
.main-window .selected-check { top:12px; right:12px; width:30px; height:30px; border-width:1px; font-size:18px; transform:none; background:linear-gradient(135deg,#cc2c35,#83151a); }
.main-divider { width:58%; height:100%; margin:0 auto; gap:1.2cqw; }
.main-divider span { font-size:1.8cqw; }
.main-window .main-actions { width:76%; max-width:none; height:100%; align-items:center; gap:2.5cqw; }
.main-action { height:72%; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:1.25cqw; padding:0 1.8cqw; border:1px solid var(--gold); border-radius:1.5cqw; background:linear-gradient(135deg,#181818,#0e0f0f); color:var(--gold-light); cursor:pointer; text-align:left; transition:.18s ease; }
.main-action:hover { transform:translateY(-1px); box-shadow:0 0 19px rgba(212,175,55,.24); }
.main-action:active { transform:translateY(1px) scale(.994); box-shadow:inset 0 0 18px rgba(212,175,55,.14); }
.main-action > span:nth-child(2) { display:grid; gap:.2cqw; }
.main-action strong { font-size:1.9cqw; font-weight:500; }
.main-action small { color:#c2763c; font-size:1.3cqw; }
.main-action b { font-size:2.5cqw; font-weight:400; }
.main-window .spotify-logo { width:3.9cqw; height:3.9cqw; }
.main-window .button-icon { width:3.9cqw; text-align:center; font-size:3.7cqw; }
.main-footer { z-index:2; display:flex; align-items:center; justify-content:space-between; padding:0 2.4cqw; background:linear-gradient(90deg,#111212,#181919); border-top:1px solid #202020; }
.footer-utilities { display:flex; gap:1.4cqw; }
.footer-utilities button { width:3.2cqw; height:3.2cqw; display:grid; place-items:center; border:1.5px solid var(--gold-light); border-radius:50%; background:#151515; color:var(--gold-light); font:600 1.8cqw Georgia,serif; cursor:pointer; }
.footer-utilities button:hover { color:white; box-shadow:0 0 12px rgba(212,175,55,.35); }
.footer-utilities button:active { transform:translateY(1px); background:#28241b; }
.brand-header { position: relative; min-height: 190px; display: grid; grid-template-columns: 210px 1fr 210px; align-items: start; padding: 28px 38px 4px; }
.header-logo { width: 178px; height: 95px; object-fit: cover; object-position: center 58%; mix-blend-mode: screen; filter: saturate(.95) contrast(1.08); }
.title-lockup { text-align: center; padding-top: 14px; }
.sound-wave { display: block; color: var(--red-light); font-size: 31px; letter-spacing: 4px; line-height: 1; transform: scaleY(1.25); }
.title-lockup h1, .title-lockup h2 { margin: 19px 0 0; color: var(--gold-light); font-family: Georgia, "Times New Roman", serif; font-weight: 400; line-height: 1.05; text-shadow: 0 1px 12px rgba(212,175,55,.2); }
.title-lockup h1 { font-size: clamp(39px, 5vw, 59px); }
.title-lockup h2 { font-size: clamp(36px, 4.5vw, 54px); }
.window-controls { justify-self: end; display: flex; gap: 8px; }
.brand-header > .window-control { justify-self: end; }
.window-control { width: 42px; height: 42px; border: 0; border-radius: 8px; background: transparent; color: var(--gold-light); font-size: 30px; cursor: pointer; transition: .18s ease; }
.window-control:hover { background: rgba(212,175,55,.12); color: white; }
.utility-control { width: 28px; height: 28px; margin-top: 7px; border: 1px solid rgba(212,175,55,.65); border-radius: 50%; font: 600 14px Georgia,serif; }
.window-close:hover { background: var(--red); }
.main-content { padding: 0 82px 38px; }
.ornament-heading { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 26px; margin: 0 0 38px; }
.ornament-heading span, .ornament-divider::before, .ornament-divider::after { height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament-heading span:last-child, .ornament-divider::after { background: linear-gradient(90deg, var(--gold), transparent); }
.ornament-heading h2 { margin: 0; color: var(--gold); font-size: 25px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; }
.ornament-divider { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 28px 0; color: var(--gold); }
.ornament-divider span { font: 26px Georgia,serif; }
.title-divider { width: 64%; margin: -30px auto 16px; }

.preset-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.preset-card { position: relative; min-height: 326px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 24px; border: 1.5px solid var(--gold); border-radius: 25px; color: var(--text); background: radial-gradient(circle at 50% 45%, rgba(212,175,55,.08), transparent 60%), rgba(15,15,15,.78); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.preset-card:hover { transform: translateY(-3px); box-shadow: 0 12px 35px rgba(212,175,55,.18); }
.preset-card[aria-checked="true"] { border: 3px solid var(--red-light); box-shadow: 0 0 0 2px var(--gold), 0 0 28px rgba(212,175,55,.52), inset 0 0 40px rgba(178,34,34,.14); }
.preset-art { width: 112px; height: 86px; color: var(--gold-light); margin-bottom: 24px; }
.preset-card[aria-checked="true"] .preset-art { color: var(--red-light); }
.selected-check { position:absolute; top:12px; right:12px; z-index:5; width:30px; height:30px; display:grid; place-items:center; border:2px solid var(--gold); border-radius:50%; background:#211111; color:var(--gold-light); font-size:18px; transform:none; box-shadow:0 0 17px rgba(212,175,55,.5); }
.preset-name { min-height: 58px; display: grid; place-items: center; text-align: center; font-size: 25px; }
.preset-volume { color: var(--gold-light); font: 43px Georgia,serif; }
.preset-card[aria-checked="true"] .preset-volume { color: var(--red-light); }
.card-volume { width: 100%; display: flex; align-items: center; gap: 9px; margin-top: 25px; color: var(--gold-light); }
.mini-rail { flex: 1; height: 8px; overflow: visible; border: 1px solid rgba(212,175,55,.35); border-radius: 8px; background: #222; }
.mini-rail i { display: block; position: relative; height: 100%; width: var(--level); border-radius: inherit; background: linear-gradient(90deg, var(--gold-light), var(--gold)); }
.mini-rail i::after { content:""; position:absolute; right:-7px; top:50%; width:15px; height:15px; transform:translateY(-50%); border-radius:50%; background:var(--gold-light); }
.preset-card[aria-checked="true"] .mini-rail i { background: var(--red-light); }
.main-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; max-width: 760px; margin: 0 auto; }

.button { min-height: 50px; padding: 11px 24px; border: 1.5px solid var(--gold); border-radius: 11px; background: linear-gradient(135deg, #171818, #111); color: var(--text); cursor: pointer; transition: .18s ease; }
.button:hover { color: var(--gold-light); box-shadow: 0 0 16px rgba(212,175,55,.22); }
.button:active { transform: translateY(1px); }
.button-large { min-height: 72px; display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 24px; }
.button-primary { border-color: var(--red-light); background: linear-gradient(135deg, #c51f29, #6d1419); color: var(--gold-light); box-shadow: 0 0 18px rgba(212,175,55,.32); }
.button-primary:hover { color: white; box-shadow: 0 0 28px rgba(212,175,55,.52); }
.button-outline { background: rgba(10,10,10,.6); }
.button-compact { min-height: 46px; padding: 9px 16px; white-space: nowrap; }
.button-icon { color: var(--gold-light); font-size: 34px; }
.spotify-logo { width: 45px; height: 45px; display: block; object-fit: contain; }
.spotify-config-logo { width: 26px; height: 26px; object-fit: contain; flex: 0 0 auto; }

.modal-layer { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: start center; padding: 28px; overflow: auto; background: rgba(0,0,0,.74); backdrop-filter: blur(6px); }
.modal-window { animation: enter .18s ease-out; }
.modal-window .brand-header { min-height: 145px; padding-top: 20px; }
@keyframes enter { from { opacity:0; transform:scale(.98) translateY(8px); } }
.settings-window { width: min(1100px, 96vw); }
.modal-content { position: relative; padding: 0 72px 42px; }
.settings-content { display: grid; gap: 15px; }
.settings-window .settings-content { gap: 10px; padding-bottom: 26px; }
.settings-window .setting-row { min-height: 55px; }
.settings-window .config-card { padding: 10px 16px; }
.settings-window .config-title-row { margin-bottom: 8px; }
.settings-window input, .settings-window .button-compact, .settings-window .icon-button { min-height: 42px; height: 42px; }
.settings-window .preset-row { min-height: 48px; }
.settings-window .preset-management { padding-top: 10px; padding-bottom: 8px; }
.settings-window .ornament-divider { height: 24px; margin: 10px 0; }
.settings-window .settings-actions .button { min-height: 46px; }
.settings-block, .config-card { border: 1.5px solid var(--gold); border-radius: 18px; background: rgba(15,15,14,.74); padding: 15px 20px; }
.application-block { padding: 0 20px; }
.setting-row { min-height: 65px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; border-bottom: 1px solid rgba(212,175,55,.22); }
.setting-row:last-child { border: 0; }
.setting-icon { color: var(--gold-light); font-size: 28px; }
.setting-row label { font-size: 18px; }
.toggle { width: 67px; height: 36px; position: relative; padding: 0; border: 1.5px solid var(--gold); border-radius: 22px; background: #171717; cursor: pointer; }
.toggle span { position: absolute; left: 6px; top: 5px; width: 24px; height: 24px; border-radius: 50%; background: #806b30; transition: .18s ease; }
.toggle[aria-checked="true"] span { left: 35px; background: var(--gold-light); box-shadow: 0 0 13px rgba(239,197,92,.6); }
.config-title-row { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.config-title-row h3, .preset-management > h3 { margin:0; color:var(--gold); font-size:18px; font-weight:500; text-transform:uppercase; letter-spacing:.04em; }
.status-pill { padding:5px 12px; border:1px solid currentColor; border-radius:20px; font-size:14px; }
.status-pill.success { color:var(--green); background:rgba(35,179,75,.08); }
.config-controls { display:flex; align-items:center; gap:10px; }
input[type="text"], input[type="url"], input[type="number"] { width:100%; min-height:50px; border:1.5px solid var(--gold); border-radius:10px; padding:10px 15px; background:linear-gradient(135deg,#1a1a19,#111); color:var(--text); outline:none; }
input:focus { border-color:var(--gold-light); box-shadow:0 0 0 3px rgba(212,175,55,.12); }
input[readonly] { color:#8b8882; border-color:rgba(212,175,55,.28); }
.icon-button, .table-action { flex:0 0 auto; width:50px; height:50px; border:1.5px solid var(--gold); border-radius:10px; background:#151515; color:var(--gold-light); font-size:23px; cursor:pointer; }
.inline-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:10px; }
.preset-management { padding-bottom:13px; }
.preset-list { display:grid; gap:7px; margin:12px 0; }
.preset-row { min-height:55px; display:grid; grid-template-columns:45px minmax(160px,1fr) 70px minmax(150px,1fr) auto auto auto; align-items:center; gap:10px; padding:5px 8px; border:1px solid rgba(212,175,55,.55); border-radius:10px; }
.row-art { width:38px; height:34px; color:var(--gold-light); }
.preset-row.high .row-art, .preset-row.high .row-volume { color:var(--red-light); }
.row-name { font-size:17px; }
.row-volume { color:var(--gold-light); font:27px Georgia,serif; }
.segmented-bar { height:18px; background:repeating-linear-gradient(90deg,#2b2925 0 5px,transparent 5px 9px); }
.segmented-bar i { display:block; height:100%; width:var(--level); background:repeating-linear-gradient(90deg,var(--gold) 0 5px,transparent 5px 9px); }
.preset-row.high .segmented-bar i { background:repeating-linear-gradient(90deg,var(--red-light) 0 5px,transparent 5px 9px); }
.default-pill { padding:4px 10px; border:1px solid var(--gold); border-radius:18px; color:var(--gold-light); font-size:11px; text-transform:uppercase; }
.table-action { width:42px; height:42px; }
.table-action.delete { color:var(--red-light); border-color:var(--red); }
.table-action:disabled { opacity:.25; cursor:not-allowed; }
.add-preset-button { display:block; width:47%; margin:10px auto 0; }
.settings-actions { display:flex; justify-content:center; }
.settings-actions .button { min-width:390px; }

.modal-layer > .modal-window { grid-area:1 / 1; }
.settings-child-overlay { position:fixed; inset:0; z-index:3000; display:flex; align-items:center; justify-content:center; padding:32px; overflow:auto; background:rgba(0,0,0,.42); backdrop-filter:blur(2px); }
.preset-form-window { z-index:3; border:1px solid #9b6817; border-radius:14px; background:radial-gradient(circle at 52% 44%,rgba(255,255,255,.045),transparent 48%),linear-gradient(135deg,#0b0c0c,#131414 58%,#090a0a); box-shadow:0 0 0 1px rgba(239,197,92,.12),0 20px 65px rgba(0,0,0,.88),0 0 24px rgba(212,175,55,.12); }
.add-preset-modal { position:relative; width:min(390px,calc(100vw - 48px)); max-width:420px; height:auto; max-height:calc(100vh - 64px); overflow-y:auto; overflow-x:hidden; }
.preset-form-titlebar { position:sticky; top:0; z-index:2; height:48px; display:grid; grid-template-columns:49px 1fr 48px; align-items:center; border-bottom:1px solid rgba(212,175,55,.2); background:linear-gradient(90deg,#0c0d0d,#171717,#101111); }
.preset-form-titlebar h2 { margin:0; color:var(--gold-light); font-size:20px; font-weight:600; }
.preset-form-mark { display:grid; place-items:center; color:var(--gold-light); font:25px Georgia,serif; text-shadow:0 0 10px rgba(212,175,55,.34); }
.preset-form-close { width:36px; height:36px; justify-self:center; border:0; border-radius:7px; background:transparent; color:#eee; font-size:25px; cursor:pointer; }
.preset-form-close:hover { background:rgba(178,34,34,.72); color:white; }
.preset-form { display:grid; gap:12px; padding:18px 23px 20px; }
.preset-field { display:grid; gap:4px; }
.preset-field > label { color:var(--text); font-size:13px; font-weight:600; }
.preset-form input[type="text"],.preset-form input[type="number"] { min-height:38px; height:38px; padding:6px 10px; border-width:1px; border-radius:7px; font-size:12.5px; }
.volume-editor { min-height:40px; display:grid; grid-template-columns:18px 1fr 34px 72px; align-items:center; gap:5px; color:var(--text); font-size:12px; }
.edit-preset-modal .volume-editor { grid-template-columns:18px 1fr 34px 72px 18px; }
.percent-symbol { color:var(--gold-light); font-size:15px; text-align:center; }
input[type="range"] { width:100%; accent-color:var(--gold-light); }
.preset-form .number-input { text-align:center; color:var(--gold-light); font-size:16px; }
.checkbox-row { display:flex; align-items:center; gap:9px; font-size:12.5px; cursor:pointer; }
.checkbox-row input { appearance:none; width:20px; height:20px; flex:0 0 auto; border:1.5px solid var(--gold); border-radius:4px; background:#111; }
.checkbox-row input:checked::after { content:"✓"; height:100%; display:grid; place-items:center; color:var(--gold-light); font-size:16px; }
.default-preset-area { display:grid; gap:3px; }
.default-preset-area small { margin-left:29px; color:var(--muted); font-size:10.5px; line-height:1.3; }
.test-card { min-height:44px; display:grid; grid-template-columns:130px 1fr; align-items:center; gap:10px; padding:2px 0; border-top:1px solid rgba(212,175,55,.2); border-bottom:1px solid rgba(212,175,55,.2); }
.test-card p { margin:0; color:var(--muted); font-size:10.5px; line-height:1.3; }
.test-volume-button { min-height:40px; height:40px; padding:6px 9px; color:var(--gold-light); font-size:12.5px; }
.form-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding-left:76px; }
.form-actions.single { grid-template-columns:minmax(240px,360px); justify-content:center; }
.preset-form .form-actions .button { min-height:42px; height:42px; padding:6px 10px; font-size:14px; }
.preset-add-button { border-color:var(--gold-light); background:linear-gradient(135deg,var(--gold-light),#b87b1f); color:#090909; box-shadow:0 0 15px rgba(212,175,55,.3); }
.preset-add-button:hover { color:#090909; filter:brightness(1.08); box-shadow:0 0 20px rgba(212,175,55,.42); }
.field-error { margin:0; color:#ff6464; font-size:12px; }
.edit-preset-modal { width:min(400px,calc(100vw - 48px)); max-width:430px; max-height:calc(100vh - 64px); }
.edit-preset-modal .preset-form { gap:13px; padding:20px 24px 22px; }

.historical-log-modal { width:min(610px,calc(100vw - 48px)); max-width:650px; height:min(420px,calc(100vh - 64px)); max-height:470px; display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--gold); border-radius:18px; background:radial-gradient(circle at 70% 20%,rgba(184,115,51,.07),transparent 34%),linear-gradient(135deg,#0a0b0b,#151515 55%,#090a0a); box-shadow:0 24px 80px rgba(0,0,0,.88),0 0 24px rgba(212,175,55,.12); }
.history-titlebar { flex:0 0 64px; display:grid; grid-template-columns:72px 1fr 58px; align-items:center; border-bottom:1px solid rgba(212,175,55,.38); background:linear-gradient(90deg,#101111,#171716,#0e0f0f); }
.history-title-icon { display:grid; place-items:center; color:var(--gold-light); font-size:38px; }
.history-titlebar h2 { margin:0; color:var(--gold-light); font:27px Georgia,serif; }
.history-close { width:40px; height:40px; justify-self:center; border:0; border-radius:8px; background:transparent; color:#eee; font-size:28px; cursor:pointer; }
.history-close:hover { color:white; background:rgba(178,34,34,.7); }
.history-body { flex:1; min-height:0; display:grid; grid-template-rows:34px minmax(0,1fr) 60px; padding:10px 16px 12px; }
.history-column-headings,.history-row { display:grid; grid-template-columns:54px 185px minmax(0,1fr); align-items:center; }
.history-column-headings strong { color:var(--gold-light); font-size:14px; font-weight:600; }
.historical-log-list { min-height:0; overflow-y:auto; padding-right:5px; scrollbar-color:var(--gold-dark,#8f6114) #151515; scrollbar-width:thin; }
.history-row { min-height:57px; margin-bottom:5px; border:1px solid #28251d; border-radius:8px; background:linear-gradient(90deg,#121313,#181818,#121313); }
.history-category-icon { width:34px; height:34px; display:grid; place-items:center; justify-self:center; border:1px solid var(--gold-light); border-radius:50%; color:var(--gold-light); font-size:17px; }
.history-row time { color:var(--gold-light); font-size:13px; }
.history-row p { margin:0 9px 0 0; color:var(--text); font-size:12.5px; line-height:1.35; }
.history-music .history-category-icon { color:var(--red-light); border-color:var(--red-light); }
.history-empty { grid-row:2; display:grid; place-content:center; gap:5px; color:var(--muted); text-align:center; }
.history-empty strong { color:var(--text); font-weight:500; }
.history-footer { grid-row:3; display:grid; place-items:end center; border-top:1px solid rgba(212,175,55,.25); margin-top:8px; }
.history-close-button { width:210px; min-height:43px; height:43px; padding:7px 14px; color:var(--gold-light); font-size:15px; }

.help-window { width:min(900px,96vw); }
.help-language { display:flex; align-items:center; justify-content:space-between; margin-bottom:15px; color:var(--gold); }
.language-buttons { display:flex; gap:8px; }
.language-button[aria-pressed="true"] { background:var(--gold); color:#080808; }
.help-scroll { max-height:500px; overflow:auto; padding:4px 20px 4px 4px; }
.help-guide { line-height:1.62; color:#ddd9d0; }
.help-guide section { border:1px solid rgba(212,175,55,.32); border-radius:12px; padding:10px 18px; margin:10px 0; background:rgba(15,15,15,.55); }
.help-guide h3 { color:var(--gold-light); margin:4px 0; }
.help-intro { color:var(--gold-light); font-size:18px; }
.about-window { width:min(700px,95vw); }
.about-content { text-align:center; }
.about-logo { width:220px; height:105px; object-fit:cover; object-position:center 57%; mix-blend-mode:screen; }
.about-content h3 { margin:15px 0 3px; color:var(--gold-light); font:34px Georgia,serif; }
.about-version, .about-label, .about-studio, .about-disclaimer { color:var(--muted); }
.about-divider { width:70%; height:1px; margin:22px auto; background:linear-gradient(90deg,transparent,var(--gold),transparent); }
.about-developer { color:var(--gold-light); font:28px Georgia,serif; margin:5px 0; }
.about-disclaimer { font-size:12px; }
.dialog-window { width:min(500px,92vw); border-radius:18px; }
.dialog-window::before,.dialog-window::after { display:none; }
.dialog-header { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:15px; padding:20px 20px 0; }
.dialog-header h2 { color:var(--gold-light); font:24px Georgia,serif; }
.dialog-icon { width:45px; height:45px; display:grid; place-items:center; border-radius:50%; background:#3d6d43; font-weight:700; font-size:25px; }
.dialog-icon.warning { background:#ba8a28; color:#101010; }
.dialog-icon.danger { background:var(--red); }
.dialog-content { padding:5px 25px 25px; }
.dialog-content p { line-height:1.55; color:#d7d2ca; }
.dialog-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:10px; }
.destructive { border-color:var(--red-light); background:linear-gradient(135deg,#c9232c,#71131a); }
.toast-region { position:fixed; z-index:100; right:24px; bottom:24px; display:grid; gap:10px; }
.toast { max-width:390px; padding:14px 18px; border:1px solid var(--gold); border-radius:10px; background:#171717; box-shadow:0 12px 30px rgba(0,0,0,.5); }

.ornament-divider::before, .ornament-divider::after { content:""; }
.main-window .main-preset-heading { margin:0; gap:1.5cqw; }
.main-window .main-divider { width:58%; height:100%; margin:0 auto; gap:1.2cqw; }
.main-window .main-divider span { width:auto; font-size:1.8cqw; }

/* Readable Settings modal: sized against the 720 x 540 application canvas. */
.modal-layer:has(.settings-window) { place-items:center; padding:20px; }
.settings-window { width:min(640px,calc(100vw - 40px)); max-width:680px; height:min(500px,calc(100vh - 40px)); max-height:530px; min-height:0; display:grid; grid-template-rows:64px minmax(0,1fr); align-self:center; border-radius:16px; box-shadow:0 0 0 1px rgba(239,197,92,.3),0 22px 70px rgba(0,0,0,.82); container-type:inline-size; }
.settings-window::before,.settings-window::after { display:none; }
.settings-titlebar { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:14px; padding:0 20px 0 24px; border-bottom:1px solid rgba(212,175,55,.42); background:linear-gradient(90deg,#0d0e0e,#151411); }
.settings-titlebar h2 { margin:0; color:var(--gold-light); font:600 28px/1 "Segoe UI",Arial,sans-serif; }
.settings-gear { color:var(--gold-light); font-size:34px; line-height:1; }
.settings-close { width:44px; height:44px; border:0; background:transparent; color:var(--gold-light); font-size:30px; cursor:pointer; }
.settings-close:hover { color:white; background:rgba(178,34,34,.4); border-radius:7px; }
.settings-close:active { transform:translateY(1px); }
.settings-window .settings-content { min-height:0; overflow-y:auto; overflow-x:hidden; display:grid; align-content:start; gap:18px; padding:20px 24px 24px; scrollbar-color:var(--gold) #151515; }
.settings-window .settings-block,.settings-window .config-card { margin:0; padding:16px 18px; border-width:1px; border-radius:12px; background:linear-gradient(135deg,rgba(22,22,20,.96),rgba(9,10,10,.94)); }
.settings-window .application-block { padding:8px 14px 6px; }
.settings-window .setting-row { min-height:68px; grid-template-columns:42px minmax(0,1fr) auto; gap:16px; padding:4px 8px; border-radius:9px; cursor:pointer; }
.settings-window .setting-row:hover { border-color:rgba(239,197,92,.7); background:rgba(212,175,55,.06); box-shadow:0 0 14px rgba(212,175,55,.1); }
.settings-window .setting-row:focus-visible { outline:3px solid var(--gold-light); outline-offset:2px; }
.settings-window .settings-label { font-size:16px; line-height:1.35; }
.settings-window .setting-icon { width:34px; height:34px; display:grid; place-items:center; border:1px solid rgba(212,175,55,.58); border-radius:50%; color:var(--gold-light); font-size:18px; }
.settings-saved-feedback { min-height:18px; margin:3px 8px 0; color:var(--gold-light); font-size:13px; text-align:right; }
.toggle-control { min-width:102px; min-height:44px; display:flex; align-items:center; justify-content:flex-end; gap:10px; padding:6px 2px 6px 8px; border:1px solid transparent; border-radius:9px; background:transparent; cursor:pointer; }
.toggle-control:hover { border-color:rgba(239,197,92,.7); box-shadow:0 0 12px rgba(212,175,55,.14); }
.toggle-control:focus-visible { outline:3px solid var(--gold-light); outline-offset:3px; }
.toggle-state-label { width:32px; color:#a0a0a0; font-size:14px; font-weight:700; text-align:center; }
.toggle-track { width:56px; height:30px; position:relative; flex:0 0 auto; border:1px solid #666; border-radius:999px; background:#2b2c2c; transition:.16s ease; }
.toggle-thumb { width:24px; height:24px; position:absolute; top:2px; left:3px; border-radius:50%; background:#b8b8b8; transition:transform .16s ease,background .16s ease; }
.toggle-control[data-state="off"] .toggle-track { border-color:#666; background:#2b2c2c; }
.toggle-control[data-state="off"] .toggle-thumb { transform:translateX(0); background:#b8b8b8; }
.toggle-control[data-state="off"] .toggle-state-label { color:#a0a0a0; }
.toggle-control[data-state="on"] .toggle-track { border-color:#f0c866; background:linear-gradient(180deg,#e0b84b,#b88622); box-shadow:0 0 10px rgba(212,175,55,.22); }
.toggle-control[data-state="on"] .toggle-thumb { transform:translateX(25px); background:#fff; }
.toggle-control[data-state="on"] .toggle-state-label { color:#f0c866; }
.settings-window .config-title-row { min-height:30px; margin:0 0 10px; gap:10px; }
.settings-window .config-title-row h3 { font-size:19px; text-transform:none; white-space:nowrap; }
.settings-window .spotify-config-logo { width:26px; height:26px; }
.playlist-icon { color:var(--gold-light); font-size:22px; }
.settings-window .status-pill { padding:3px 8px; font-size:12px; }
.settings-window .config-controls { display:grid; gap:8px; }
.settings-window .spotify-controls { grid-template-columns:minmax(0,1fr) 62px 62px; }
.settings-window .playlist-controls { grid-template-columns:minmax(0,1fr) 102px; }
.settings-window input { min-width:0; min-height:44px; height:44px; padding:8px 12px; border-radius:8px; font-size:14px; }
.settings-window .spotify-controls input,.settings-window .playlist-controls input { grid-column:1; grid-row:1; }
.labeled-icon-button { min-height:44px; display:grid; place-items:center; gap:0; padding:3px 6px; border:1px solid var(--gold); border-radius:8px; background:#151515; color:var(--gold-light); cursor:pointer; }
.labeled-icon-button b { font-size:17px; line-height:1; font-weight:400; }
.labeled-icon-button span { font-size:12px; }
.spotify-controls .labeled-icon-button:nth-of-type(1),.playlist-controls .edit-link-button { grid-column:2; grid-row:1; }
.spotify-controls .labeled-icon-button:nth-of-type(2) { grid-column:3; grid-row:1; }
.settings-window .search-spotify-button { grid-column:1 / span 2; grid-row:2; justify-self:start; min-height:42px; height:42px; padding:6px 14px; border-radius:8px; font-size:14px; }
.settings-window .paste-link-button { grid-column:1; grid-row:2; justify-self:start; min-height:42px; height:42px; padding:6px 14px; border-radius:8px; font-size:14px; }
.settings-window .save-link-button { grid-column:2; grid-row:2; min-width:100px; min-height:42px; height:42px; padding:6px 14px; border-radius:8px; font-size:14px; }
.settings-window .save-link-button,.settings-window .add-preset-button { background:linear-gradient(135deg,var(--gold-light),#b87b1f); border-color:var(--gold-light); color:#090909; box-shadow:0 0 12px rgba(212,175,55,.22); }
.settings-window .save-link-button:hover,.settings-window .add-preset-button:hover { color:#090909; filter:brightness(1.08); }
.settings-window .inline-actions { margin-top:4px; }
.settings-window .preset-management { padding:0; border:0; background:transparent; }
.preset-section-title { min-height:50px; display:flex; flex-direction:column; justify-content:center; padding-left:7px; }
.preset-section-title h3 { margin:0; color:var(--gold-light); font-size:19px; font-weight:600; }
.preset-section-title small { color:var(--bronze); font-size:13px; margin-left:16px; }
.settings-window .preset-list { gap:7px; margin:4px 0 10px; }
.settings-window .preset-row { min-height:64px; grid-template-columns:38px minmax(120px,1fr) 48px minmax(82px,110px) 60px 42px 42px; gap:7px; padding:5px 8px; border-radius:9px; }
.settings-window .row-speaker { width:32px; height:32px; color:var(--gold-light); }
.settings-window .preset-row.high .row-speaker { color:var(--red-light); }
.settings-window .row-name { font-size:15px; line-height:1.2; }
.settings-window .row-volume { font-size:16px; }
.settings-window .segmented-bar { height:12px; background:repeating-linear-gradient(90deg,#302f2c 0 5px,transparent 5px 8px); }
.settings-window .segmented-bar i { background:repeating-linear-gradient(90deg,var(--gold-light) 0 5px,transparent 5px 8px); }
.settings-window .default-pill { padding:3px 6px; font-size:12px; text-align:center; }
.settings-window .table-action { width:42px; height:42px; min-height:42px; border-radius:8px; font-size:16px; }
.settings-window .add-preset-button { width:100%; min-height:44px; height:44px; margin:0; padding:7px 14px; border-radius:8px; font-size:15px; }
.settings-window .settings-actions { display:block; }
.settings-window .settings-actions .button { width:100%; min-width:0; min-height:44px; height:44px; padding:7px 14px; border-radius:8px; font-size:15px; }

@media (max-width:600px) {
  .settings-window .settings-content { padding:14px 16px 18px; gap:14px; }
  .settings-window .setting-row { grid-template-columns:38px minmax(0,1fr); }
  .settings-window .toggle-control { grid-column:2; justify-self:end; }
  .settings-window .preset-row { grid-template-columns:34px minmax(105px,1fr) 44px 72px 42px 42px; }
  .settings-window .default-pill { display:none; }
}

@media (max-width: 850px) {
  .brand-header { min-height:160px; grid-template-columns:125px 1fr 125px; padding-inline:20px; }
  .header-logo { width:120px; height:72px; }
  .main-content,.modal-content { padding-inline:28px; }
  .preset-cards { gap:13px; }
  .preset-card { min-height:280px; padding-inline:10px; }
  .preset-name { font-size:20px; }
  .preset-row { grid-template-columns:35px 1fr 60px 90px auto auto; }
  .preset-row .default-pill { display:none; }
  .config-controls { flex-wrap:wrap; }
  .config-controls input { flex-basis:70%; }
}
@media (max-width: 650px) {
  .prototype-shell { padding:10px; }
  .app-window { width:100%; border-radius:18px; }
  .brand-header { grid-template-columns:1fr auto; min-height:150px; }
  .header-logo { display:none; }
  .title-lockup { grid-column:1; text-align:left; }
  .window-controls,.brand-header>.window-control { grid-column:2; grid-row:1; }
  .title-lockup h1,.title-lockup h2 { font-size:34px; }
  .preset-cards { grid-template-columns:1fr; }
  .preset-card { min-height:235px; }
  .main-actions,.form-actions { grid-template-columns:1fr; }
  .modal-layer { padding:6px; }
  .settings-child-overlay { padding:20px; }
  .add-preset-modal { width:min(390px,calc(100vw - 40px)); max-height:calc(100vh - 40px); }
  .preset-form { gap:10px; padding:14px 18px 16px; }
  .form-actions { padding-left:52px; }
}

/* Revised 720 × 540 Main Panel */
.main-window { width:min(720px,calc(100vw - 24px)); aspect-ratio:4/3; grid-template-rows:44px 1fr; border:1px solid var(--gold); border-radius:17px; background:radial-gradient(circle at 50% 40%,rgba(212,175,55,.045),transparent 44%),#080909; box-shadow:0 24px 70px rgba(0,0,0,.65); }
.main-window.is-maximized { width:min(820px,calc(100vw - 18px)); }
.main-window::before,.main-window::after { width:19cqw; height:35cqw; opacity:.2; border:0; border-radius:0; background:repeating-radial-gradient(circle at 32% 24%,transparent 0 9px,rgba(184,115,51,.3) 10px 11px); }
.main-window::before { left:-9cqw; top:12cqw; transform:rotate(-15deg); }
.main-window::after { right:-8cqw; bottom:-3cqw; transform:rotate(18deg); }
.main-titlebar { padding-left:2.1cqw; background:rgba(10,11,11,.96); border-bottom:1px solid rgba(212,175,55,.14); }
.app-identity { gap:1.1cqw; }
.app-identity h1 { font-size:1.55cqw; color:#c8c5be; }
.app-icon { width:3.2cqw; height:3.2cqw; border-radius:.55cqw; }
.native-controls button { width:4.6cqw; min-width:32px; color:var(--gold-light); font-size:1.8cqw; }
.native-controls .window-close { width:5cqw; background:transparent; color:var(--gold-light); font-size:2.7cqw; }
.native-controls .window-close:hover { background:var(--red); color:white; }
.main-design { display:grid; grid-template-rows:118px 34px 230px 28px 74px; padding:0 24px 8px; }
.main-brand-area { position:relative; display:grid; grid-template-columns:170px 1fr 145px; align-items:center; min-width:0; }
.main-brand-logo { width:132px; height:58px; object-fit:cover; object-position:center 57%; mix-blend-mode:screen; filter:saturate(.95) contrast(1.08); }
.main-title-lockup { align-self:center; text-align:center; }
.main-sound-wave { display:block; color:var(--red-light); font-size:18px; letter-spacing:3px; line-height:1; transform:scaleY(1.2); }
.main-title-lockup h2 { margin:10px 0 0; color:var(--gold-light); font:36px/1 Georgia,"Times New Roman",serif; text-shadow:0 1px 13px rgba(212,175,55,.2); white-space:nowrap; }
.main-utilities { display:flex; justify-content:flex-end; gap:14px; align-self:start; padding-top:20px; }
.main-utilities button { width:48px; min-height:54px; display:grid; place-items:center; gap:2px; border:0; background:transparent; color:var(--gold-light); cursor:pointer; }
.main-utilities button span { width:30px; height:30px; display:grid; place-items:center; border:1.5px solid currentColor; border-radius:50%; font:600 19px Georgia,serif; }
.main-utilities button small { color:#c89433; font-size:11px; }
.main-utilities button:hover { color:white; filter:drop-shadow(0 0 6px rgba(212,175,55,.45)); }
.main-utilities button:active { color:var(--gold); filter:none; transform:translateY(1px); }
.main-utilities button:focus-visible { outline:2px solid var(--gold-light); outline-offset:2px; border-radius:8px; }
.main-preset-heading { width:74%; align-self:center; margin:0 auto; gap:14px; }
.main-preset-heading h2 { color:#c9882f; font-size:16px; letter-spacing:.12em; text-transform:uppercase; white-space:nowrap; }
.main-window .preset-cards { min-width:0; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; padding:0 38px; overflow:visible; }
.main-window .preset-card { position:relative; min-width:178px; min-height:0; height:218px; display:grid; grid-template-columns:1fr; grid-template-rows:52px 30px 39px 30px; place-items:center; align-content:center; gap:2px; padding:42px 16px 9px; overflow:visible; border:1px solid #b77a21; border-radius:17px; background:radial-gradient(circle at 50% 38%,rgba(255,255,255,.045),transparent 54%),#111212; color:var(--text); }
.main-window .preset-card:hover { transform:translateY(-2px); border-color:var(--gold-light); box-shadow:0 8px 22px rgba(212,175,55,.14); }
.main-window .preset-card[aria-checked="true"] { border:2px solid var(--red-light); background:radial-gradient(circle at 50% 45%,rgba(178,34,34,.13),transparent 66%),#151313; box-shadow:0 0 0 1px var(--gold),0 0 22px rgba(212,175,55,.42); }
.main-preset-art { width:64px; height:48px; color:var(--gold-light); margin:0; }
.main-window .preset-card.high .main-preset-art { color:var(--red-light); }
.main-window .preset-name { min-height:0; display:block; align-self:center; font-size:17px; line-height:1.08; white-space:nowrap; }
.main-window .preset-volume { color:var(--gold-light); font:31px/1 Georgia,serif; }
.main-window .preset-card.high .preset-volume { color:var(--red-light); }
.main-window .preset-card[aria-checked="true"]:not(.high) .preset-volume { color:var(--gold-light); }
.main-window .selected-check { top:12px; right:12px; z-index:5; width:30px; height:30px; border:2px solid var(--gold); font-size:18px; background:#211111; transform:none; }
.main-volume-indicator { width:100%; display:grid; grid-template-columns:28px 1fr; align-items:center; gap:6px; color:var(--gold-light); }
.card-speaker { width:27px; height:27px; color:inherit; }
.main-volume-indicator > i { height:6px; overflow:visible; border:1px solid rgba(212,175,55,.45); border-radius:7px; background:#252525; }
.main-volume-indicator > i > b { display:block; position:relative; height:100%; border-radius:inherit; background:var(--gold-light); }
.main-volume-indicator > i > b::after { content:""; position:absolute; right:-5px; top:50%; width:10px; height:10px; transform:translateY(-50%); border-radius:50%; background:var(--gold-light); }
.preset-card.high .main-volume-indicator > i > b,.preset-card.high .main-volume-indicator > i > b::after { background:var(--red-light); }
.main-divider { width:62%; height:100%; margin:0 auto; gap:10px; }
.main-divider span { font-size:19px; }
.main-window .main-actions { width:66%; height:100%; display:grid; grid-template-columns:1fr 1fr; align-items:center; gap:16px; margin:0 auto; }
.main-action { height:52px; display:flex; align-items:center; justify-content:center; gap:15px; padding:0 18px; border:1px solid var(--gold); border-radius:11px; background:#111212; color:var(--text); text-align:center; }
.main-action strong { font-size:17px; font-weight:500; }
.main-window .spotify-logo { width:31px; height:31px; }
.main-window .button-icon { width:auto; color:var(--gold-light); font-size:31px; }
.main-action:disabled { opacity:.42; cursor:not-allowed; }

@media (max-width:680px) {
  .main-design { grid-template-rows:22cqw 6cqw 41cqw 5cqw 13cqw; padding-inline:3.2cqw; }
  .main-brand-area { grid-template-columns:23cqw 1fr 21cqw; }
  .main-brand-logo { width:19cqw; height:8cqw; }
  .main-title-lockup h2 { font-size:5cqw; }
  .main-utilities { gap:1cqw; padding-top:2.5cqw; }
  .main-utilities button { width:7cqw; min-height:8cqw; }
  .main-utilities button span { width:4.5cqw; height:4.5cqw; font-size:2.7cqw; }
  .main-utilities button small { font-size:1.65cqw; }
  .main-window .preset-cards { gap:2cqw; padding-inline:3cqw; }
  .main-window .preset-card { min-width:26cqw; height:39cqw; grid-template-rows:8cqw 5cqw 6cqw 5cqw; padding:5.8cqw 2cqw 1.4cqw; }
  .main-preset-art { width:9cqw; height:6.8cqw; }
  .main-window .preset-name { font-size:2.7cqw; }
  .main-window .preset-volume { font-size:5cqw; }
  .main-window .selected-check { top:12px; right:12px; width:30px; height:30px; font-size:18px; }
  .main-action { height:9cqw; }
  .main-action strong { font-size:2.6cqw; }
}

@media (prefers-reduced-motion:reduce) {
  .main-window *, .modal-window { animation:none!important; transition:none!important; }
}

/* Compact About panel */
.modal-layer[data-modal="about"] { place-items:center; }
.about-window { position:relative; width:min(500px,calc(100vw - 48px)); max-width:540px; height:min(360px,calc(100vh - 48px)); max-height:400px; display:grid; grid-template-rows:60px 16px minmax(0,1fr) 54px; overflow:hidden; border:1px solid var(--gold); border-radius:16px; background:radial-gradient(circle at 75% 28%,rgba(212,175,55,.045),transparent 38%),#0a0b0b; box-shadow:0 22px 70px rgba(0,0,0,.85),0 0 18px rgba(212,175,55,.13); }
.about-window::before,.about-window::after { content:"❦\A❧"; position:absolute; z-index:0; white-space:pre; color:var(--bronze); font:34px/1.2 Georgia,serif; opacity:.16; pointer-events:none; }
.about-window::before { left:-5px; top:-4px; }
.about-window::after { right:-5px; bottom:-5px; transform:rotate(180deg); }
.about-titlebar { position:relative; z-index:1; display:grid; grid-template-columns:1fr 46px; align-items:center; padding:0 14px 0 24px; }
.about-titlebar h2 { margin:0; color:var(--gold-light); font-size:23px; font-weight:600; }
.about-close { width:38px; height:38px; border:0; border-radius:8px; background:transparent; color:#eee; font-size:28px; line-height:1; cursor:pointer; }
.about-close:hover { background:var(--red); color:#fff; }
.about-close:focus-visible,.about-primary:focus-visible { outline:2px solid #fff0b7; outline-offset:2px; }
.about-title-divider { position:relative; z-index:1; display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:9px; margin:0 82px; color:var(--gold-light); }
.about-title-divider span { height:1px; background:linear-gradient(90deg,transparent,var(--gold)); }
.about-title-divider span:last-child { background:linear-gradient(90deg,var(--gold),transparent); }
.about-title-divider b { font-size:18px; font-weight:400; }
.about-layout { position:relative; z-index:1; min-height:0; display:grid; grid-template-columns:180px 1fr; gap:12px; padding:6px 20px 3px; }
.about-brand { display:grid; place-items:center; min-width:0; }
.about-logo { width:174px; height:104px; object-fit:cover; object-position:center 57%; mix-blend-mode:screen; filter:saturate(.96) contrast(1.08); }
.about-details { min-width:0; align-self:center; }
.about-details h3 { margin:0; color:var(--gold-light); font-size:23px; font-weight:600; }
.about-version { margin:2px 0 5px; color:var(--gold-light); font-size:15px; }
.about-description { margin:0; padding:5px 0; border-top:1px solid rgba(212,175,55,.25); color:var(--text); font-size:12px; line-height:1.25; }
.about-info-row { min-height:38px; display:grid; grid-template-columns:39px 1fr; align-items:center; border-top:1px solid rgba(212,175,55,.18); }
.about-developer-row { min-height:42px; }
.about-info-row p { margin:0; color:var(--text); font-size:12.5px; line-height:1.2; }
.about-info-row p strong { display:block; margin-top:2px; color:var(--gold-light); font-size:14px; }
.about-info-icon { width:30px; height:30px; display:grid; place-items:center; border:1px solid var(--gold-dark); border-radius:8px; color:var(--gold-light); font-size:21px; }
.windows-icon { font-size:25px; }
.about-spotify-row { min-height:32px; border-top:0; }
.about-spotify-row img { width:25px; height:25px; object-fit:contain; }
.about-spotify-row p { color:var(--muted); font-size:11.5px; }
.about-footer { position:relative; z-index:1; display:grid; place-items:center; }
.about-primary { width:178px; min-height:43px; height:43px; padding:7px 18px; border-color:var(--gold-light); background:linear-gradient(135deg,#f0c25a,#b77617); color:#10100d; font-size:16px; font-weight:600; box-shadow:0 0 12px rgba(212,175,55,.25); }
.about-primary:hover { color:#080808; filter:brightness(1.08); box-shadow:0 0 18px rgba(212,175,55,.4); }

@media (max-width:560px), (max-height:430px) {
  .about-window { width:min(500px,calc(100vw - 28px)); height:min(360px,calc(100vh - 28px)); grid-template-rows:58px 16px minmax(0,1fr) 54px; }
  .about-titlebar { padding-left:18px; }
  .about-titlebar h2 { font-size:20px; }
  .about-title-divider { margin-inline:58px; }
  .about-layout { grid-template-columns:minmax(135px,36%) 1fr; gap:9px; padding:5px 18px 3px; }
  .about-logo { width:min(154px,100%); height:92px; }
  .about-details h3 { font-size:20px; }
  .about-version { font-size:14px; margin-bottom:5px; }
  .about-description { padding:5px 0; font-size:12px; }
  .about-info-row { min-height:37px; grid-template-columns:37px 1fr; }
  .about-info-icon { width:28px; height:28px; font-size:19px; }
  .about-info-row p { font-size:11px; }
  .about-info-row p strong { font-size:12.5px; }
  .about-spotify-row p { font-size:10.5px; }
  .about-primary { min-height:40px; height:40px; }
}

/* Topic-based Help & User Guide */
.modal-layer[data-modal="help"] { place-items:center; }
.help-window.help-modal { position:relative; width:min(620px,calc(100vw - 48px)); max-width:660px; height:min(440px,calc(100vh - 64px)); max-height:480px; display:grid; grid-template-rows:68px minmax(0,1fr) 58px; overflow:hidden; border:1px solid var(--gold); border-radius:17px; background:radial-gradient(circle at 75% 30%,rgba(212,175,55,.04),transparent 40%),#090a0a; box-shadow:0 24px 76px rgba(0,0,0,.88),0 0 20px rgba(212,175,55,.12); }
.help-window.help-modal::before { content:"❦\A❧\A❦"; position:absolute; left:-8px; bottom:-5px; white-space:pre; color:var(--bronze); font:36px/1.08 Georgia,serif; opacity:.16; pointer-events:none; }
.help-titlebar { position:relative; z-index:1; display:grid; grid-template-columns:54px minmax(185px,1fr) 210px 44px; align-items:center; padding:0 12px; border-bottom:1px solid rgba(212,175,55,.18); background:#0d0e0e; }
.help-book-icon { width:37px; height:37px; display:grid; place-items:center; border:1px solid var(--gold-dark); border-radius:8px; color:var(--gold-light); font-size:26px; }
.help-titlebar h2 { margin:0; color:var(--gold-light); font-size:22px; font-weight:600; white-space:nowrap; }
.help-language-tabs { height:38px; display:grid; grid-template-columns:1fr 1.4fr; border:1px solid var(--gold-dark); border-radius:10px; overflow:hidden; }
.help-language-tabs button { min-width:0; border:0; border-right:1px solid rgba(212,175,55,.25); background:#111212; color:var(--text); font-size:12px; cursor:pointer; }
.help-language-tabs button:last-child { border-right:0; }
.help-language-tabs button[aria-selected="true"] { background:linear-gradient(135deg,#f0c25a,#b77617); color:#111; font-weight:600; }
.help-close { width:36px; height:36px; justify-self:end; border:0; border-radius:8px; background:transparent; color:#eee; font-size:27px; cursor:pointer; }
.help-close:hover { background:var(--red); color:white; }
.help-body { position:relative; z-index:1; min-height:0; display:grid; grid-template-columns:190px minmax(0,1fr); }
.help-topic-nav { min-height:0; display:grid; align-content:start; gap:6px; padding:12px; border-right:1px solid rgba(212,175,55,.28); }
.help-topic-nav button { min-height:50px; display:grid; grid-template-columns:38px 1fr; align-items:center; gap:8px; padding:7px 10px; border:1px solid rgba(212,175,55,.22); border-radius:9px; background:#0d0e0e; color:var(--text); text-align:left; cursor:pointer; }
.help-topic-nav button > span { color:var(--gold-light); font-size:23px; text-align:center; }
.help-topic-nav button > img { width:25px; height:25px; justify-self:center; object-fit:contain; }
.help-topic-nav button b { font-size:12.5px; font-weight:500; line-height:1.2; }
.help-topic-nav button:hover { border-color:var(--gold); background:#17150f; }
.help-topic-nav button[aria-selected="true"] { border-color:var(--gold-light); background:linear-gradient(90deg,rgba(183,118,23,.48),rgba(90,59,15,.25)); color:var(--gold-light); box-shadow:inset 0 0 18px rgba(212,175,55,.1); }
.help-topic-nav button:focus-visible,.help-language-tabs button:focus-visible,.help-close:focus-visible,.help-primary:focus-visible,.help-topic-content:focus-visible { outline:2px solid #fff0b7; outline-offset:-2px; }
.help-topic-content { min-height:0; overflow-y:auto; padding:16px 22px 14px; color:var(--text); scrollbar-color:var(--gold-dark) #111; scrollbar-width:thin; }
.help-topic-content h3 { margin:0 0 6px; color:var(--gold-light); font-size:21px; font-weight:600; }
.help-topic-intro { margin:0 0 12px; color:#d8d4ce; font-size:12.5px; line-height:1.4; }
.help-steps { display:grid; }
.help-steps section { min-height:55px; display:grid; grid-template-columns:32px 1fr 38px; align-items:center; gap:8px; border-bottom:1px solid rgba(212,175,55,.18); }
.help-steps section > i { width:25px; height:25px; display:grid; place-items:center; border-radius:50%; background:linear-gradient(135deg,#f0c25a,#b77617); color:#15110a; font-style:normal; font-weight:700; }
.help-steps h4,.help-problems h4 { margin:0; color:var(--gold-light); font-size:13.5px; font-weight:600; }
.help-steps p,.help-problems p,.help-note p { margin:3px 0 0; color:var(--muted); font-size:11.5px; line-height:1.3; }
.help-steps em { display:grid; place-items:center; color:var(--gold-light); font-size:23px; font-style:normal; }
.help-steps em img { width:26px; height:26px; object-fit:contain; }
.help-note { display:grid; grid-template-columns:35px 1fr; align-items:center; gap:8px; margin-top:12px; padding:9px 12px; border:1px solid rgba(212,175,55,.5); border-radius:9px; background:#0d0e0e; }
.help-note > span { color:var(--gold-light); font-size:24px; }
.help-note strong { color:var(--gold-light); font-size:12.5px; }
.help-note > p { margin:0; }
.help-items { display:grid; gap:7px; margin:10px 0 0; padding:0; list-style:none; }
.help-items li { position:relative; padding:8px 10px 8px 28px; border-bottom:1px solid rgba(212,175,55,.18); color:#d8d4ce; font-size:12px; line-height:1.35; }
.help-items li::before { content:"✓"; position:absolute; left:7px; color:var(--gold-light); font-weight:700; }
.help-problems { display:grid; gap:7px; }
.help-problems section { padding:8px 11px; border:1px solid rgba(212,175,55,.22); border-radius:8px; background:#0d0e0e; }
.help-problems h4 { color:#efb63e; }
.help-footer { position:relative; z-index:1; display:grid; place-items:center; border-top:1px solid rgba(212,175,55,.14); }
.help-primary { width:176px; min-height:42px; height:42px; padding:7px 18px; border-color:var(--gold-light); background:linear-gradient(135deg,#f0c25a,#b77617); color:#10100d; font-size:15px; font-weight:600; box-shadow:0 0 12px rgba(212,175,55,.22); }
.help-primary:hover { color:#080808; filter:brightness(1.08); }

@media (max-width:600px) {
  .help-window.help-modal { width:min(620px,calc(100vw - 28px)); height:min(440px,calc(100vh - 28px)); grid-template-rows:62px minmax(0,1fr) 52px; }
  .help-titlebar { grid-template-columns:42px minmax(130px,1fr) 178px 38px; padding-inline:9px; }
  .help-book-icon { width:31px; height:31px; font-size:22px; }
  .help-titlebar h2 { font-size:18px; }
  .help-language-tabs { height:34px; }
  .help-language-tabs button { font-size:10.5px; }
  .help-body { grid-template-columns:155px minmax(0,1fr); }
  .help-topic-nav { padding:9px; gap:5px; }
  .help-topic-nav button { min-height:45px; grid-template-columns:31px 1fr; padding:5px 7px; }
  .help-topic-nav button b { font-size:11px; }
  .help-topic-content { padding:13px 15px 10px; }
}

@media (max-width:470px) {
  .help-titlebar { grid-template-columns:36px 1fr 35px; }
  .help-titlebar h2 { font-size:17px; }
  .help-language-tabs { position:absolute; left:50px; right:48px; top:47px; z-index:2; }
  .help-window.help-modal { grid-template-rows:88px minmax(0,1fr) 50px; }
  .help-body { grid-template-columns:1fr; grid-template-rows:68px minmax(0,1fr); }
  .help-topic-nav { grid-template-columns:repeat(5,1fr); gap:3px; padding:6px; border-right:0; border-bottom:1px solid rgba(212,175,55,.28); }
  .help-topic-nav button { min-width:0; min-height:54px; grid-template-columns:1fr; grid-template-rows:25px 1fr; gap:1px; padding:3px; text-align:center; }
  .help-topic-nav button b { font-size:8.5px; }
  .help-topic-nav button > span { font-size:19px; }
  .help-topic-nav button > img { width:21px; height:21px; }
}

/* Dedicated mobile composition: normal document flow, never a scaled desktop canvas. */
@media (max-width:600px) {
  html,body { width:100%; max-width:100%; overflow-x:hidden; }
  body { min-height:100dvh; font-size:15px; }
  .prototype-shell { width:100%; min-height:100dvh; display:block; padding:8px; }

  .main-window,.main-window.is-maximized {
    width:100%;
    max-width:none;
    height:auto;
    min-height:calc(100dvh - 16px);
    aspect-ratio:auto;
    display:grid;
    grid-template-rows:56px auto;
    border-radius:14px;
    container-type:normal;
    overflow:hidden;
  }
  .main-window::before,.main-window::after { display:none; }
  .main-titlebar { min-width:0; padding-left:10px; }
  .app-identity { min-width:0; gap:9px; }
  .app-icon { width:34px; height:34px; flex:0 0 auto; border-radius:6px; }
  .app-identity h1 { min-width:0; overflow:hidden; font-size:15px; line-height:1.2; text-overflow:ellipsis; white-space:nowrap; }
  .native-controls { flex:0 0 auto; }
  .native-controls button,.native-controls .window-close { width:40px; min-width:40px; min-height:44px; font-size:22px; }
  .native-controls .window-close { font-size:27px; }

  .main-design { min-width:0; display:flex; flex-direction:column; gap:14px; padding:16px 12px 20px; }
  .main-brand-area { min-width:0; display:grid; grid-template-columns:78px minmax(0,1fr) auto; grid-template-rows:auto auto; align-items:start; gap:7px 8px; }
  .main-brand-logo { grid-column:1; grid-row:1; width:76px; height:43px; }
  .main-title-lockup { grid-column:1 / -1; grid-row:2; width:100%; text-align:center; }
  .main-sound-wave { font-size:16px; letter-spacing:2px; }
  .main-title-lockup h2 { margin-top:7px; font-size:clamp(24px,8vw,34px); line-height:1.08; white-space:normal; }
  .main-utilities { grid-column:3; grid-row:1; align-self:start; gap:6px; padding:0; }
  .main-utilities button { width:48px; min-height:48px; gap:1px; }
  .main-utilities button span { width:28px; height:28px; font-size:18px; }
  .main-utilities button small { font-size:14px; line-height:1; }

  .main-preset-heading { width:100%; min-height:34px; margin:2px 0; gap:10px; }
  .main-preset-heading h2 { font-size:15px; letter-spacing:.1em; }
  .main-window .preset-cards { width:100%; min-width:0; display:grid; grid-template-columns:minmax(0,1fr); gap:12px; padding:0; overflow:visible; }
  .main-window .preset-card {
    width:100%;
    min-width:0;
    height:112px;
    min-height:112px;
    grid-template-columns:58px minmax(0,1fr) 72px;
    grid-template-rows:34px 28px;
    place-items:stretch;
    align-items:center;
    align-content:center;
    gap:6px 10px;
    padding:16px 50px 16px 14px;
    overflow:visible;
    border-radius:15px;
    text-align:left;
  }
  .main-preset-art { grid-column:1; grid-row:1 / 3; width:52px; height:52px; place-self:center; }
  .main-window .preset-name { grid-column:2; grid-row:1; min-width:0; align-self:end; overflow:hidden; font-size:18px; line-height:1.15; text-align:left; text-overflow:ellipsis; white-space:nowrap; }
  .main-window .preset-volume { grid-column:3; grid-row:1; align-self:end; justify-self:end; font-size:30px; text-align:right; }
  .main-volume-indicator { grid-column:2 / 4; grid-row:2; width:100%; grid-template-columns:1fr; gap:0; align-self:center; }
  .main-volume-indicator .card-speaker { display:none; }
  .main-volume-indicator > i { height:7px; }
  .main-window .selected-check { top:10px; right:10px; width:30px; height:30px; font-size:18px; }
  .main-divider { display:none; }
  .main-window .main-actions { width:100%; height:auto; display:grid; grid-template-columns:1fr; gap:12px; margin:2px 0 0; }
  .main-action { width:100%; min-height:52px; height:52px; font-size:16px; }
  .main-action strong { font-size:16px; }
  .main-window .spotify-logo { width:30px; height:30px; }
  .main-window .button-icon { font-size:29px; }

  .modal-layer,.settings-child-overlay { align-items:center; justify-content:center; place-items:center; padding:12px; overflow:auto; }
  .modal-layer > .modal-window,.settings-child-overlay > .modal-window { width:100%; max-width:100%; max-height:calc(100dvh - 24px); }

  .settings-window {
    width:100%;
    max-width:100%;
    height:calc(100dvh - 24px);
    max-height:calc(100dvh - 24px);
    grid-template-rows:58px minmax(0,1fr);
    container-type:normal;
  }
  .settings-titlebar { padding:0 8px 0 15px; }
  .settings-titlebar h2 { font-size:26px; }
  .settings-gear { font-size:29px; }
  .settings-window .settings-content { padding:14px 12px 18px; gap:14px; }
  .settings-window .settings-block,.settings-window .config-card { padding:13px 12px; }
  .settings-window .setting-row { grid-template-columns:38px minmax(0,1fr); gap:8px 12px; min-height:96px; }
  .settings-window .toggle-control { grid-column:2; justify-self:end; }
  .settings-window .settings-label { font-size:15px; }
  .settings-window .spotify-controls { grid-template-columns:minmax(0,1fr) 58px 58px; }
  .settings-window .playlist-controls { grid-template-columns:minmax(0,1fr) 94px; }
  .settings-window .preset-row { grid-template-columns:34px minmax(0,1fr) 46px 42px 42px; gap:6px; }
  .settings-window .segmented-bar,.settings-window .default-pill { display:none; }
  .settings-window .row-name { font-size:15px; }
  .settings-window .row-volume { font-size:16px; }

  .add-preset-modal,.edit-preset-modal,.preset-form-window {
    width:100%;
    max-width:100%;
    max-height:calc(100dvh - 24px);
    overflow-y:auto;
    overflow-x:hidden;
  }
  .preset-form-titlebar { height:54px; grid-template-columns:44px 1fr 48px; }
  .preset-form-titlebar h2 { font-size:19px; }
  .preset-form-close { width:44px; height:44px; }
  .preset-form { gap:13px; padding:16px; }
  .preset-field > label,.checkbox-row,.test-volume-button { font-size:14px; }
  .preset-form input[type="text"],.preset-form input[type="number"] { min-height:44px; height:44px; font-size:14px; }
  .volume-editor { min-height:48px; grid-template-columns:18px minmax(0,1fr) 32px 64px; font-size:14px; }
  .edit-preset-modal .volume-editor { grid-template-columns:18px minmax(0,1fr) 32px 64px 16px; }
  .default-preset-area small,.test-card p { font-size:14px; }
  .default-preset-area small { margin-left:29px; }
  .test-card { grid-template-columns:1fr; gap:8px; padding:10px 0; }
  .test-card p br { display:none; }
  .form-actions,.form-actions.single { grid-template-columns:1fr 1fr; gap:8px; padding-left:0; }
  .preset-form .form-actions .button { min-width:0; min-height:44px; height:44px; font-size:15px; }

  .historical-log-modal {
    width:100%;
    max-width:100%;
    height:min(560px,calc(100dvh - 24px));
    max-height:calc(100dvh - 24px);
  }
  .history-titlebar { flex-basis:58px; grid-template-columns:52px 1fr 48px; }
  .history-title-icon { font-size:30px; }
  .history-titlebar h2 { font-size:23px; }
  .history-close { width:44px; height:44px; }
  .history-body { grid-template-rows:0 minmax(0,1fr) 56px; padding:8px 9px 10px; }
  .history-column-headings { display:none; }
  .history-row { min-height:82px; grid-template-columns:44px minmax(0,1fr); grid-template-rows:auto auto; gap:2px 7px; padding:8px 5px; }
  .history-category-icon { grid-column:1; grid-row:1 / 3; }
  .history-row time { grid-column:2; grid-row:1; font-size:14px; }
  .history-row p { grid-column:2; grid-row:2; margin:0; font-size:14px; }
  .history-close-button { width:100%; min-height:44px; }

  .about-window {
    width:100%;
    max-width:100%;
    height:min(560px,calc(100dvh - 24px));
    max-height:calc(100dvh - 24px);
    grid-template-rows:58px 16px minmax(0,1fr) 58px;
  }
  .about-window::before,.about-window::after { display:none; }
  .about-titlebar { padding:0 8px 0 16px; }
  .about-titlebar h2 { font-size:22px; }
  .about-close { width:44px; height:44px; }
  .about-title-divider { margin-inline:34px; }
  .about-layout { grid-template-columns:1fr; gap:8px; padding:8px 16px 12px; overflow-y:auto; }
  .about-logo { width:156px; height:82px; }
  .about-details h3 { font-size:22px; }
  .about-description,.about-info-row p,.about-spotify-row p { font-size:14px; line-height:1.35; }
  .about-info-row p strong { font-size:15px; }
  .about-primary { min-height:44px; height:44px; }

  .help-window.help-modal {
    width:100%;
    max-width:100%;
    height:calc(100dvh - 24px);
    max-height:calc(100dvh - 24px);
    grid-template-rows:100px minmax(0,1fr) 56px;
  }
  .help-window.help-modal::before { display:none; }
  .help-titlebar { position:relative; grid-template-columns:40px minmax(0,1fr) 44px; grid-template-rows:54px 42px; padding:0 8px; }
  .help-book-icon { grid-column:1; grid-row:1; width:34px; height:34px; font-size:23px; }
  .help-titlebar h2 { grid-column:2; grid-row:1; font-size:20px; white-space:normal; }
  .help-close { grid-column:3; grid-row:1; width:44px; height:44px; }
  .help-language-tabs { position:static; grid-column:1 / -1; grid-row:2; width:100%; height:38px; }
  .help-language-tabs button { font-size:14px; }
  .help-body { grid-template-columns:1fr; grid-template-rows:auto minmax(0,1fr); }
  .help-topic-nav { grid-template-columns:1fr 1fr; gap:6px; padding:8px; border-right:0; border-bottom:1px solid rgba(212,175,55,.28); }
  .help-topic-nav button { min-width:0; min-height:44px; grid-template-columns:30px 1fr; grid-template-rows:1fr; gap:7px; padding:6px 8px; text-align:left; }
  .help-topic-nav button:last-child { grid-column:1 / -1; }
  .help-topic-nav button b { font-size:14px; }
  .help-topic-nav button > span { font-size:20px; }
  .help-topic-nav button > img { width:22px; height:22px; }
  .help-topic-content { padding:14px 15px 12px; }
  .help-topic-content h3 { font-size:20px; }
  .help-topic-intro,.help-steps p,.help-problems p,.help-note p,.help-items li { font-size:14px; }
  .help-steps h4,.help-problems h4,.help-note strong { font-size:15px; }
  .help-primary { width:calc(100% - 24px); min-height:44px; height:44px; font-size:16px; }

  .dialog-window {
    width:100%;
    max-width:100%;
    max-height:calc(100dvh - 24px);
    overflow-y:auto;
  }
  .dialog-header { position:sticky; top:0; z-index:2; padding:14px 14px 4px; background:#111212; }
  .dialog-header h2 { font-size:22px; }
  .dialog-content { padding:6px 16px 16px; }
  .dialog-content p { font-size:15px; }
  .dialog-actions { display:grid; grid-template-columns:1fr; }
  .dialog-actions .button { width:100%; min-height:48px; font-size:16px; }

  .toast-region { left:12px; right:12px; bottom:12px; }
  .toast { max-width:none; font-size:14px; }
}
