:root {
  --white: #ffffff;
  --surface: #f4f4f2;
  --surface-strong: #e8e8e5;
  --ink: #111111;
  --muted: #696967;
  --line: #d7d7d3;
  --black: #000000;
}

* { box-sizing: border-box; }
html { background: var(--white); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--white);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.masthead {
  height: 64px;
  padding: 0 clamp(20px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  position: relative;
  z-index: 10;
}
.brand { color: var(--ink); text-decoration: none; font-size: 21px; font-weight: 650; letter-spacing: -.03em; }
.connection { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.connection i { width: 8px; height: 8px; border: 1px solid #8b8b88; border-radius: 50%; background: transparent; }
.connection.connected { color: var(--ink); }
.connection.connected i { border-color: var(--ink); background: var(--ink); }

.connect-stage { min-height: calc(100vh - 64px); display: grid; align-items: center; padding: clamp(32px, 7vw, 96px); }
.connect-panel { width: min(100%, 680px); }
.product-mark { width: 152px; height: 72px; display: flex; align-items: center; gap: 12px; margin-bottom: 42px; }
.product-mark span { width: 36px; height: 1px; background: var(--ink); }
.product-mark b { font-size: 56px; font-weight: 500; line-height: 1; }
.section-label { margin: 0 0 12px; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.connect-panel h1, .page-header h1 { margin: 0; font-size: clamp(48px, 7vw, 84px); font-weight: 500; letter-spacing: -.055em; line-height: .98; }
.lede { max-width: 560px; margin: 28px 0 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.connect-actions { display: flex; gap: 10px; margin-top: 30px; }
.connect-actions button { min-height: 46px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 2px; background: var(--white); color: var(--ink); font-weight: 600; }
.connect-actions button.primary { background: var(--black); color: var(--white); }
.connect-actions button:hover { background: var(--surface); }
.connect-actions button.primary:hover { background: #292929; }
.connect-actions button:focus-visible, .nav-item:focus-visible, .transport button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.support { min-height: 20px; margin-top: 16px; color: var(--ink); font-size: 13px; }

.workspace { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.rail { min-height: calc(100vh - 64px); padding: 32px 22px 24px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; }
.device-identity { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 12px; padding: 0 8px 28px; border-bottom: 1px solid var(--line); }
.device-glyph { width: 38px; height: 38px; display: grid; place-items: center; background: var(--black); color: var(--white); font-weight: 650; }
.device-identity span:last-child { min-width: 0; display: grid; gap: 2px; }
.device-identity small { color: var(--muted); font-size: 11px; }
.device-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.rail nav { display: grid; gap: 2px; padding-top: 22px; }
.nav-item { width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-left: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); text-align: left; font-size: 14px; }
.nav-item:hover { background: var(--surface-strong); color: var(--ink); }
.nav-item.active { border-left-color: var(--ink); color: var(--ink); background: var(--white); font-weight: 650; }
.rail-footer { margin: auto 8px 0; color: var(--muted); font-size: 11px; }

.content { min-width: 0; padding: clamp(30px, 5vw, 72px); }
.page { width: min(100%, 1120px); margin: 0 auto; }
.page-header { margin-bottom: 34px; }
.page-header h1 { font-size: clamp(44px, 6vw, 72px); }
.now-playing { min-height: 380px; display: grid; grid-template-columns: minmax(260px, 38%) 1fr; border: 1px solid var(--black); background: var(--black); color: var(--white); }
.art { min-height: 100%; aspect-ratio: 1; display: grid; place-items: center; border-right: 1px solid #343434; background: #242424; background-position: center; background-size: cover; overflow: hidden; }
.art span { color: #bdbdbd; font-size: 44px; font-weight: 500; letter-spacing: -.05em; }
.track-copy { min-width: 0; padding: clamp(30px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; }
.section-label.light { color: #9f9f9f; }
.track-copy h2 { margin: 0; overflow-wrap: anywhere; font-size: clamp(42px, 6vw, 76px); font-weight: 500; letter-spacing: -.055em; line-height: 1; }
.track-copy > p:not(.section-label) { margin: 12px 0 0; color: #bdbdbd; font-size: 18px; }
.progress { height: 2px; margin: 34px 0 26px; background: #4b4b4b; }
.progress i { display: block; width: 0; height: 100%; background: var(--white); }
.transport { display: flex; gap: 8px; }
.transport button { min-height: 38px; padding: 0 14px; border: 1px solid #6e6e6e; border-radius: 2px; background: transparent; color: var(--white); font-size: 13px; }
.transport button:hover { border-color: var(--white); }
.transport button.play { border-color: var(--white); background: var(--white); color: var(--black); }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-top: 0; }
.quick-grid article { min-width: 0; padding: 20px; border-right: 1px solid var(--line); }
.quick-grid article:last-child { border-right: 0; }
.quick-grid small { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.quick-grid strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }

.settings-list { border-top: 1px solid var(--line); }
.setting-row { min-height: 86px; padding: 16px 2px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.setting-row > span:first-child { display: grid; gap: 5px; }
.setting-row b { font-size: 16px; font-weight: 600; }
.setting-row small { color: var(--muted); line-height: 1.35; }
.setting-control { min-width: 160px; display: flex; justify-content: flex-end; align-items: center; }
.setting-row em { color: var(--muted); font-size: 13px; font-style: normal; }
.setting-row input[type="range"] { width: 180px; accent-color: var(--black); }
.setting-row input[type="checkbox"] { appearance: none; width: 44px; height: 24px; margin: 0; border: 1px solid #989895; border-radius: 12px; background: var(--surface-strong); position: relative; }
.setting-row input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #777; transition: left 160ms ease; }
.setting-row input[type="checkbox"]:checked { border-color: var(--black); background: var(--black); }
.setting-row input[type="checkbox"]:checked::after { left: 23px; background: var(--white); }

@media (max-width: 820px) {
  .workspace { display: block; padding-bottom: 68px; }
  .rail { min-height: 0; padding: 0; border: 0; background: var(--white); display: block; }
  .device-identity, .rail-footer { display: none; }
  .rail nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: 64px; padding: 0 12px; border-top: 1px solid var(--line); background: var(--white); display: flex; gap: 0; overflow-x: auto; }
  .rail nav { scrollbar-width: none; }
  .rail nav::-webkit-scrollbar { display: none; }
  .nav-item { min-width: 78px; height: 63px; padding: 0 10px; border: 0; border-top: 2px solid transparent; text-align: center; font-size: 11px; }
  .nav-item.active { border-top-color: var(--ink); background: var(--white); }
  .content { padding: 28px 22px; }
  .now-playing { min-height: 300px; grid-template-columns: 220px 1fr; }
  .track-copy { padding: 28px; }
  .track-copy h2 { font-size: 42px; }
}

@media (max-width: 560px) {
  .masthead { height: 56px; padding: 0 18px; }
  .connect-stage { min-height: calc(100vh - 56px); padding: 34px 20px; }
  .product-mark { margin-bottom: 30px; }
  .connect-panel h1 { font-size: 48px; }
  .connect-actions { display: grid; }
  .connect-actions button { width: 100%; }
  .workspace { min-height: calc(100vh - 56px); }
  .content { padding: 24px 16px; }
  .page-header { margin-bottom: 24px; }
  .page-header h1 { font-size: 46px; }
  .now-playing { grid-template-columns: 1fr; }
  .art { min-height: auto; border-right: 0; border-bottom: 1px solid #343434; }
  .track-copy { padding: 26px 22px 28px; }
  .track-copy h2 { font-size: 40px; }
  .transport button { flex: 1; padding: 0 8px; font-size: 11px; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-grid article { padding: 15px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .quick-grid article:last-child { border-bottom: 0; }
  .setting-row { min-height: 96px; align-items: flex-start; flex-direction: column; gap: 12px; }
  .setting-control { width: 100%; min-width: 0; justify-content: flex-start; }
  .setting-row input[type="range"] { width: 100%; }
}

@media (min-width: 1500px) {
  .workspace { grid-template-columns: 292px minmax(0, 1fr); }
  .content { padding: 76px; }
  .page { max-width: 1320px; }
  .now-playing { grid-template-columns: 430px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
