:root {
  color-scheme: light;
  --milk: #fff9f6;
  --rose: #994461;
  --rose-hover: #873753;
  --ink: #41232f;
  --muted: #775763;
  --line: #ead6dd;
  --blush: #f4dce3;
  --panel: #fff9f8e6;
  --green: #386857;
  --green-wash: #e8f0e9;
  --amber: #865a2f;
  --amber-wash: #f7ebdc;
  --blue: #4c627c;
  --blue-wash: #eaf0f6;
  --danger: #9b4150;
  --danger-wash: #fae6e8;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  --bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing:border-box; }
[hidden] { display:none !important; }
html { min-height:100%; -webkit-text-size-adjust:100%; scroll-padding-bottom:calc(75px + var(--bottom)); }
body { margin:0; min-height:100vh; color:var(--ink); background:#f1e3e8; font:15px/1.45 var(--ui); }
button, input { font:inherit; }
button { color:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent; }
button:disabled { opacity:.48; cursor:default; }
button:focus-visible, input:focus-visible { outline:2px solid var(--rose); outline-offset:3px; }
h1, h2, h3, p { margin:0; }
.num { font-variant-numeric:tabular-nums lining-nums; font-feature-settings:"tnum","lnum"; letter-spacing:-.025em; }
[data-icon] { display:inline-grid; place-items:center; flex:none; vertical-align:middle; }
[data-icon] > svg { width:1.2em; height:1.2em; display:block; }

.phone-shell {
  margin:auto; width:min(100%, 480px); min-height:100vh; min-height:100dvh; position:relative;
  background:radial-gradient(ellipse at 93% 2%, #f0d9e1 0%, transparent 43%),
             linear-gradient(145deg,#fffbf8 0%,#fcf0f2 50%,#f8e9ee 100%);
  padding-inline:max(19px,env(safe-area-inset-left,0px)) max(19px,env(safe-area-inset-right,0px));
  padding-bottom:calc(87px + var(--bottom));
}
.masthead { min-height:calc(54px + env(safe-area-inset-top,0px)); padding-top:env(safe-area-inset-top,0px); display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid #b273882d; }
.masthead img { display:block; width:124px; height:auto; }
.connection-tag, .live-tag, .status-pill { display:inline-flex; align-items:center; justify-content:center; gap:7px; border-radius:999px; font-size:.77rem; font-weight:650; white-space:nowrap; }
.connection-tag { border:1px solid #fff9f5cf; background:#fff9f5b9; min-height:36px; padding:0 11px; color:#475f53; }
.connection-tag b { font-weight:650; }
.connection-tag span, .live-tag i { width:6px; height:6px; border-radius:50%; background:#6e9b84; flex:none; }
.connection-tag[data-status=offline] { color:var(--amber); }
.connection-tag[data-status=offline] span { background:#b48555; }
.page-title { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:15px 0 11px; }
.page-title h1 { font:600 clamp(1.38rem,6.15vw,1.65rem)/1.19 var(--serif); letter-spacing:.025em; color:#4d2936; }
.page-title h1:focus { outline:0; }
.live-tag { padding:4px 10px; background:#f3f0e7; color:#426452; }
.live-tag[data-status=offline] { color:var(--muted); background:#f0e1e7; }
.live-tag[data-status=offline] i { background:#ab8997; }
.panel { border:1px solid #fffafa; border-radius:22px; background:var(--panel); box-shadow:0 3px 13px #8545600a; }
.timer { position:relative; isolation:isolate; overflow:hidden; padding:15px 15px 14px; background:linear-gradient(155deg,#fffcf8 8%,#fff5f5 54%,#fae8ef); }
.timer::before { content:""; position:absolute; left:-17%; right:-17%; height:125px; bottom:-88px; z-index:-1; border-radius:49% 49% 0 0; background:#eed0dc6b; }
.timer-meta { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.timer-meta h2 { display:flex; align-items:center; gap:7px; color:#773c53; font-size:.875rem; font-weight:650; }
.timer-meta h2 [data-icon] { color:var(--rose); }
.timer-meta > span { color:#80445b; font-size:.76rem; font-weight:600; padding:3px 9px; border-radius:999px; background:#f3dfe8; }
.timer-value { text-align:center; font-weight:550; font-size:clamp(2.65rem,13.8vw,4.15rem); line-height:1.15; margin:11px 0 16px; color:#602c43; letter-spacing:-.055em; }
.timer-actions { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.timer-actions .btn { min-height:44px; font-size:.83rem; font-weight:600; border-radius:10px; padding:6px 8px; }
.timer-actions .btn.primary { background:#9e566f; box-shadow:none; }
.btn { border:1px solid transparent; padding:9px 10px; border-radius:12px; min-height:44px; display:inline-flex; justify-content:center; align-items:center; gap:7px; font-size:.875rem; font-weight:650; line-height:1.25; }
.btn.primary { background:var(--rose); color:#fffaf9; box-shadow:inset 0 1px 0 #cd7c95; }
.btn.primary:hover:not(:disabled) { background:var(--rose-hover); }
.btn.secondary { background:#fff9f8dc; color:#80435a; border-color:#e7c8d5; }
.btn.secondary:hover:not(:disabled) { background:#f9e6ed; }
.btn:active:not(:disabled) { transform:translateY(1px); }
.btn.wide { width:100%; margin-top:10px; }
.offline-notice { gap:8px; align-items:center; display:flex; color:#734528; background:#fff3e3; border:1px solid #ebd8c1; border-radius:12px; padding:9px 11px; margin-bottom:10px; font-size:.8125rem; }

.metrics { display:grid; grid-template-columns:.9fr 1.2fr 1fr; margin-top:10px; padding:13px 3px; border-radius:18px; text-align:center; background:#fff9f8c7; }
.metrics div + div { border-left:1px solid var(--line); }
.metrics span, .usage span { display:block; color:var(--muted); font-size:.75rem; }
.metrics strong { display:block; font-size:clamp(.96rem,5vw,1.24rem); font-weight:650; margin-top:2px; white-space:nowrap; }
.metrics .money { color:#873e58; }
.voice { margin-top:14px; padding:14px 14px 4px; }
.section-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.section-head h2 { display:flex; align-items:center; gap:8px; font-size:1rem; font-weight:680; }
.heading-icon { color:var(--rose); }
.status-pill { color:var(--muted); background:#f1e4e9; min-height:24px; padding:2px 8px; }
.status-pill.good, .good.status-pill { color:var(--green); background:var(--green-wash); }
.status-pill.wait, .wait.status-pill { color:var(--amber); background:var(--amber-wash); }
.status-pill.alert, .alert.status-pill { color:var(--danger); background:var(--danger-wash); }
.now-playing { margin:11px 0 8px; display:grid; grid-template-columns:38px minmax(0,1fr) auto; gap:9px; align-items:center; }
.play-illustration { display:grid; place-items:center; width:36px; height:36px; color:var(--rose); background:#f6e1e9; border-radius:10px; font-size:1.13rem; }
.play-label { min-width:0; }
.play-label span { display:block; color:var(--muted); font-size:.72rem; }
.play-label strong { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:.86rem; font-weight:650; }
#playing-time { font-size:.76rem; color:var(--muted); white-space:nowrap; }
.play-progress { height:3px; overflow:hidden; background:#f0dce5; border-radius:3px; }
.play-progress span { display:block; height:100%; width:38%; background:#b16883; border-radius:3px; }
.voice-actions { display:grid; grid-template-columns:repeat(3,1fr); gap:0; margin-top:5px; }
.voice-actions button { background:none; border:0; color:#803c57; font-weight:650; font-size:.79rem; min-height:44px; padding:7px 2px; display:flex; justify-content:center; align-items:center; gap:6px; border-radius:10px; }
.voice-actions button:hover:not(:disabled) { background:#f8e8ee; }
.voice-actions button:active:not(:disabled) { background:#f0d4e0; }
.latest-heading { margin:15px 0 4px; }
.text-btn { border:0; padding:5px 0 5px 8px; background:none; color:var(--rose); display:flex; align-items:center; gap:2px; min-height:35px; font-size:.79rem; font-weight:650; }
.latest-item { padding:3px 10px; border:1px solid #fff8f7; border-radius:14px; background:#fff8f6bf; }

.tabbar {
  position:fixed; z-index:5; bottom:0; left:50%; transform:translateX(-50%); width:min(100%,480px);
  padding:6px max(12px,env(safe-area-inset-right,0px)) calc(7px + var(--bottom)) max(12px,env(safe-area-inset-left,0px));
  display:grid; grid-template-columns:repeat(4,1fr); gap:4px;
  background:#fff9f7; box-shadow:0 -4px 19px #73425413; border-top:1px solid #eedce4;
}
.tabbar button { border:0; background:none; position:relative; isolation:isolate; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:3px; min-height:50px; color:#755865; font-size:.74rem; font-weight:600; }
.tabbar [data-icon] { font-size:1.04rem; }
.tabbar button[aria-current=page] { color:#8e3f5d; }
.tabbar button[aria-current=page]::before { content:""; position:absolute; inset:4px 10px; border-radius:11px; background:#f6e6ed; z-index:-1; }
.tabbar button:hover:not([aria-current]) { background:#fbf0f3; }

.section-note { color:#765461; background:#fff7f4; padding:9px 10px; border-radius:12px; font-size:.83rem; margin-bottom:12px; }
.segments { display:flex; gap:4px; background:#f1dce5; border:1px solid #e7d0da; border-radius:13px; padding:4px; }
.segments button { border:0; display:flex; align-items:center; justify-content:center; gap:7px; color:#744557; font-size:.88rem; min-height:39px; flex:1; border-radius:9px; background:transparent; }
.segments button[aria-pressed=true] { background:#fff9f7; color:#793952; box-shadow:0 1px 3px #73395215; font-weight:650; }
#queue-count { color:var(--muted); }
.filters { display:flex; flex-wrap:wrap; gap:5px; margin:10px 0 9px; }
.filters button { padding:6px 9px; line-height:1; min-height:37px; border:1px solid transparent; background:transparent; color:#744d60; border-radius:999px; font-size:.79rem; }
.filters button[aria-pressed=true] { background:#fff9f7; border-color:#e6c9d7; color:#853953; font-weight:650; }
.event-list { padding:1px 12px; border-radius:18px; }
.event-row, .list-row { min-width:0; display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:10px; align-items:center; padding:10px 0; }
.event-row + .event-row, .list-row + .list-row { border-top:1px solid #ecdce2; }
.row-icon, .event-icon { width:33px; height:33px; border-radius:9px; background:#f5e3eb; color:#994f6e; display:grid; place-items:center; }
.row-icon > svg, .event-icon > svg { width:18px; height:18px; }
.event-icon.gift { color:#9a6740; background:#f8eddf; }
.event-icon.entry { color:var(--green); background:var(--green-wash); }
.event-icon.voice { color:#655877; background:#eee8f5; }
.event-row strong, .list-row strong { display:block; font-size:.87rem; font-weight:650; overflow-wrap:anywhere; }
.event-row p, .list-row small { display:block; color:var(--muted); font-size:.84rem; margin-top:2px; overflow-wrap:anywhere; }
.event-row time, .secondary-text { color:var(--muted); font-size:.76rem; white-space:nowrap; }
.event-row time { align-self:start; margin-top:2px; }
.latest-item .event-row { padding:7px 0; }
.list-panel { margin-top:10px; padding:11px 13px; border-radius:17px; }
.list-panel > .section-head { min-height:29px; margin-bottom:4px; }
.list-panel .list-row { min-height:51px; }
.row-button { width:100%; text-align:left; border:0; background:none; }
.row-button:hover { color:var(--rose); }
.empty { color:var(--muted); text-align:center; font-size:.85rem; padding:18px 8px; }
.monitor-summary { display:flex; align-items:center; gap:12px; padding:13px 14px; color:#3b6655; background:linear-gradient(120deg,#f7f9f0,#edf2e9); border-color:#fbfcf4; }
.monitor-summary > [data-icon] { width:39px; height:39px; border-radius:10px; font-size:1.14rem; background:#e2eee2; }
.monitor-summary h2 { font-size:1rem; }
.monitor-summary p { font-size:.80rem; margin-top:3px; color:#5e6b60; }
.monitor-summary[data-status=offline] { color:var(--amber); background:#fcf1e3; }
.monitor-summary[data-status=offline] > [data-icon] { background:#f4e4cf; }
.usage { display:grid; grid-template-columns:1fr 1fr; padding:8px 0 2px; }
.usage div + div { border-left:1px solid var(--line); padding-left:13px; }
.usage strong { display:block; font-size:1.2rem; font-weight:650; color:#70364e; }
.switch { appearance:none; width:40px; height:26px; margin:0; border:1px solid #d6b9c5; border-radius:99px; cursor:pointer; background:#ebd9e1; position:relative; }
.switch::before { content:""; position:absolute; left:3px; top:3px; width:18px; height:18px; border-radius:50%; background:white; box-shadow:0 1px 3px #6c365c26; }
.switch:checked { background:#a45470; border-color:#a45470; }
.switch:checked::before { left:17px; }

.sheet { border:1px solid #fffdfa; border-radius:23px; width:min(410px,calc(100% - 28px)); max-height:calc(100dvh - 20px - var(--bottom)); margin: auto auto calc(14px + var(--bottom)); background:linear-gradient(145deg,#fffaf6,#fbedf0); color:var(--ink); padding:0; box-shadow:0 18px 55px #50293643; }
.sheet::backdrop { background:#4c243a58; }
.sheet form { padding:16px; }
.sheet header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; }
.sheet h2 { font:650 1.33rem/1.3 var(--serif); }
.icon-btn { display:grid; place-items:center; background:#f4e3eb; border:0; border-radius:12px; width:40px; height:40px; color:#7c4056; }
.sheet p, .sheet li { color:#6c4c5b; font-size:.895rem; }
.sheet p + p { margin-top:8px; }
.sheet ol { margin:7px 0 0; padding-left:1.3em; }
.sheet li + li { margin-top:7px; }
.sheet footer { display:flex; gap:9px; margin-top:15px; }
.sheet footer > button { flex:1; }
.adjust-buttons { display:grid; grid-template-columns:repeat(2,1fr); gap:7px; margin:12px 0; }
.adjust-buttons button[aria-pressed=true] { background:#f5dbe7; border-color:#c784a0; color:#71354e; }
.adjust-preview { display:flex; align-items:center; justify-content:space-between; padding:9px 10px; border-radius:9px; background:#f3e4ed; }
.adjust-preview strong { font-size:1.15rem; }
.pair-code { display:block; letter-spacing:.22em; font-size:1.32rem; margin-block:7px; color:#793952; }
.list-panel button:focus-visible { outline-offset:1px; }
.toast { position:fixed; z-index:12; bottom:calc(70px + var(--bottom)); left:50%; transform:translateX(-50%); max-width:calc(100% - 34px); width:max-content; background:#642d46; color:#fffaf6; box-shadow:0 5px 14px #552d4333; border-radius:13px; padding:10px 15px; font-size:.87rem; pointer-events:none; }

@media (min-width:600px) {
  .phone-shell { box-shadow:0 0 75px #6a3b581a; }
}
@media (max-width:345px) {
  .phone-shell { padding-inline:13px; }
  .voice { padding-inline:10px; }
  .voice-actions button { gap:3px; }
  .play-label strong { font-size:.79rem; }
  .filters { gap:2px; }
  .filters button { padding-inline:7px; }
}
@media (prefers-reduced-motion:no-preference) {
  .btn, .filters button, .tabbar button, .voice-actions button { transition:background-color .16s, color .16s; }
  .switch::before { transition:left .14s; }
}
