:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --card: #fff;
  --text: #000;
  --secondary: rgba(60, 60, 67, .6);
  --sep: rgba(60, 60, 67, .29);
  --accent: #fa243c;
  --fill: #e5e5ea;
  --tab: calc(49px + env(safe-area-inset-bottom));
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.25;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
#app { min-height: 100dvh; background: var(--bg); padding-bottom: var(--tab); }
.num { font-variant-numeric: tabular-nums; }
.screen { padding-top: env(safe-area-inset-top); }

.nav { display: flex; align-items: center; min-height: 44px; padding: 0 16px; gap: 12px; }
.nav h1 { flex: 1; margin: 0; font-size: 17px; font-weight: 600; text-align: center; }
.large { font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: .01em; margin: 0; padding: 2px 16px 10px; }
.link, .nav button.link { background: none; border: 0; color: var(--accent); font-size: 17px; padding: 8px 0; }
.link[disabled], .nav button.link[disabled] { color: rgba(60, 60, 67, .3); }
.link.strong { font-weight: 600; }
.nav .spacer { width: 64px; }

.player { padding: 18px 20px 0; }
.art {
  width: min(100%, 360px); aspect-ratio: 1; margin: 0 auto;
  border-radius: 12px;
  background: linear-gradient(165deg, #ff4d63 0%, #fa243c 46%, #b01028 100%);
  box-shadow: 0 16px 36px rgba(120, 10, 24, .28);
  display: grid; place-items: center;
}
.art.live { background: linear-gradient(165deg, #ff7a45, #fa243c 55%, #8c1020); }
.art-svg { width: 42%; height: 42%; }
.song { margin-top: 22px; min-width: 0; }
.song h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song p { margin: 3px 0 0; font-size: 20px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scrub { margin-top: 18px; }
.bar { height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--accent); }
.times { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--secondary); }
.transport { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 8px 0 4px; }
.tbtn { width: 48px; height: 48px; border: 0; background: transparent; display: grid; place-items: center; color: var(--text); padding: 0; }
.tbtn.big { width: 64px; height: 64px; }
.tbtn svg { width: 28px; height: 28px; fill: currentColor; }
.tbtn.big svg { width: 42px; height: 42px; }
.tbtn.stop svg { width: 18px; height: 18px; }

.section { margin: 28px 32px 7px; font-size: 13px; color: var(--secondary); }
.footnote { margin: 7px 32px 0; font-size: 13px; color: var(--secondary); }
.group { margin: 8px 16px 0; background: var(--card); border-radius: 10px; overflow: hidden; }
.cell {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px;
  padding: 11px 16px; background: transparent; border: 0; text-align: left; position: relative; color: inherit;
}
.cell + .cell::before, .group > .cell:first-child + .cell::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--sep); }
.cell-main { flex: 1; min-width: 0; }
.cell-title, .cell-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-title { font-size: 17px; }
.cell-sub { margin-top: 2px; font-size: 15px; color: var(--secondary); }
.cell-trail { color: var(--secondary); font-size: 15px; flex: none; }
.cell.playing .cell-title { color: var(--accent); }
.chev { width: 8px; height: 8px; border-right: 1.6px solid #c7c7cc; border-top: 1.6px solid #c7c7cc; transform: rotate(45deg); flex: none; margin-left: 4px; }
.idx { width: 22px; flex: none; color: var(--secondary); font-size: 15px; text-align: right; }
.cell.playing .idx { color: var(--accent); }

.switch { justify-content: space-between; }
.switch input, .ios {
  appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px;
  background: #e9e9eb; position: relative; flex: none; margin: 0; transition: background .2s;
}
.switch input::after, .ios::after {
  content: ""; position: absolute; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  top: 2px; left: 2px; box-shadow: 0 2px 6px rgba(0, 0, 0, .22); transition: transform .2s;
}
.switch input:checked, .ios:checked { background: var(--accent); }
.switch input:checked::after, .ios:checked::after { transform: translateX(20px); }

.field-cell { display: block; padding: 8px 16px 10px; }
.field-cell span, .k { display: block; font-size: 13px; color: var(--secondary); margin-bottom: 4px; }
.field-cell input, .field-cell select, .bare {
  width: 100%; border: 0; background: transparent; padding: 0; min-height: 28px; font-size: 17px; outline: none;
}
.select-cell select { margin-left: auto; max-width: 60%; border: 0; background: transparent; font-size: 17px; color: var(--secondary); text-align: right; }

.action { color: var(--accent); justify-content: center; font-size: 17px; }
.action.danger { color: var(--accent); }
.mini { width: 32px; height: 32px; border: 0; background: transparent; color: var(--secondary); font-size: 18px; padding: 0; }
.mini.danger { color: var(--accent); font-size: 22px; line-height: 1; }

.note { margin: 12px 16px 0; padding: 10px 14px; border-radius: 10px; background: #fff; font-size: 15px; color: var(--secondary); }
.note.live { color: var(--accent); }
.note.warn { color: #8a5300; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: var(--tab); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(249, 249, 249, .86);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid rgba(0, 0, 0, .15);
}
.tabs button {
  border: 0; background: transparent; color: #8e8e93;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: 10px; font-weight: 500; letter-spacing: .01em; padding-top: 4px;
}
.tabs button[aria-current="page"] { color: var(--accent); }
.tabs svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 20; display: flex; align-items: flex-end; }
.panel {
  width: 100%; max-height: 92dvh; overflow: auto; background: var(--bg);
  border-radius: 12px 12px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.grab { width: 36px; height: 5px; border-radius: 3px; background: #c7c7cc; margin: 8px auto 0; }
.days { display: flex; gap: 6px; padding: 4px 0 2px; }
.days button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--fill); font-size: 13px; font-weight: 600; }
.days button.on { background: var(--accent); color: #fff; }

.login {
  min-height: 100dvh; padding: calc(48px + env(safe-area-inset-top)) 0 32px;
  display: flex; flex-direction: column;
}
.login .art { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 10px 24px rgba(120, 10, 24, .22); margin-bottom: 18px; }
.login .art-svg { width: 52%; height: 52%; }
.login h1 { padding: 0; text-align: center; }
.login .footnote { text-align: center; margin-top: 6px; }
.login .ios-go { margin: 22px 16px 0; height: 50px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 600; }

.empty { color: var(--secondary); text-align: center; padding: 22px 16px; font-size: 15px; }
.toasts { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab) + 10px); z-index: 30; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: rgba(30, 30, 30, .92); color: #fff; border-radius: 14px; padding: 12px 14px; text-align: center; font-size: 15px; }
.toast.bad { background: #fa243c; }
.warn { color: var(--accent); font-size: 13px; text-align: center; margin: 8px 32px 0; }
.waiting { padding: 24px 16px; }
.waiting h1 { padding-left: 0; }
