:root{
  --bg1:#f8efea;
  --bg2:#f3e9e4;
  --surface:#fffaf6;
  --surface-2:#fff5f0;
  --border:rgba(205,163,142,.22);
  --text:#3f3029;
  --muted:#7a6258;
  --accent:#df8e7c;
  --accent-strong:#d77a66;
  --shadow: 0 6px 18px rgba(143,92,70,.10);
  --radius:14px;
}

*{ box-sizing:border-box; }
body{
  margin:0; min-height:100vh; color:var(--text);
  font-family: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: linear-gradient(180deg, var(--bg2), var(--bg1));
}

.wrap{
  max-width: 560px;
  margin:0 auto;
  padding: 18px 14px calc(108px + env(safe-area-inset-bottom));
}

.view[hidden]{
  display: none !important;
}

.top{ padding: 18px 6px 14px; }

.top-nav{
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
}

.nav-back{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(205,163,142,.35);
  background: #fff;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.book-picker-trigger{
  width: 42px;
  height: 54px;
  border-radius: 8px;
  border: 0;
  overflow: hidden;
  padding: 0;
  background: transparent;
}

.book-picker-trigger img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.book-picker-sheet{
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.book-preview-wrap{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 12px 0 14px;
}

.book-nav{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(205,163,142,.35);
  background: #fff;
  color: var(--text);
  font-size: 18px;
}

.book-preview-center{
  display: grid;
  justify-items: center;
  gap: 8px;
}

.book-preview-center img{
  width: min(65vw, 260px);
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  border: 0;
  object-fit: contain;
  background: transparent;
  box-shadow: 0 10px 20px rgba(110,70,55,.14);
}

.book-preview-name{
  font-weight: 700;
  color: var(--text);
}

.title{
  text-align: center;
}

h1{ margin:0; font-size: 30px; letter-spacing: .2px; font-weight: 800; }
p{ margin:6px 0 0; color:var(--muted); line-height:1.4; font-size: 15px; }

.top-sticky{
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 10px 4px 12px;
  margin-bottom: 8px;
  background: linear-gradient(180deg, rgba(243,233,228,.98), rgba(243,233,228,.86));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(205,163,142,.2);
}

.chip{
  appearance: none;
  border: 1px solid rgba(205,163,142,.32);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1px;
  box-shadow: 0 4px 10px rgba(143,92,70,.08);
}

.chip.info{
  background: var(--surface-2);
  color: var(--muted);
}

.chip.secondary{
  background: #fff;
}

.top-sticky-noise{
  grid-template-columns: 1fr;
}

.home-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.home-card{
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px 16px;
  text-align: left;
  display: grid;
  gap: 4px;
}

.home-card-title{
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.home-card-sub{
  color: var(--muted);
  font-size: 14px;
}

.grid{ display:grid; gap:14px; margin-top: 12px; }
.card{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}
.card:active{ transform: scale(.985); }

.card.selected{
  border-color: rgba(223,136,120,.48);
  background: #fff8f5;
  box-shadow: 0 8px 20px rgba(223,136,120,.16);
}

.empty-card{
  justify-content: flex-start;
}

.noise-card{
  width: 100%;
  text-align: left;
}

.noise-card .left{
  align-items: flex-start;
}

.noise-actions{
  display: flex;
  align-items: center;
  gap: 8px;
}

.noise-info-btn{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(205,163,142,.42);
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.noise-pink .noise-dot{
  background: linear-gradient(135deg, #d08eb9, #bc72a7);
}

.noise-brown .noise-dot{
  background: linear-gradient(135deg, #b48667, #8e644b);
}

.noise-white .noise-dot{
  background: linear-gradient(135deg, #d8d8dc, #b8b8be);
}

.noise-dot{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.left{ display:flex; gap:12px; align-items:center; min-width:0; }
.cover{
  width:50px; height:50px; border-radius: 12px;
  border:1px solid rgba(210,160,140,.32);
  background-size: cover; background-position:center;
  background-color: rgba(255,255,255,.9);
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}
.meta{ min-width:0; }
.name{ font-weight: 700; font-size: 16px; }
.sub{ color: var(--muted); font-size: 13px; margin-top:4px; }

.badge{
  width:30px; height:30px; border-radius: 999px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid rgba(210,160,140,.35);
  background: #fff;
  color:#8a584a;
  font-weight:700;
  box-shadow: 0 4px 10px rgba(224,164,140,.18);
}

.controls{
  position: sticky;
  bottom: 0;
  z-index: 6;
  margin-top: 16px;
  display:grid;
  gap:10px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(248,239,234,0), rgba(248,239,234,.94) 38%, rgba(248,239,234,1));
  border-top: 1px solid rgba(205,163,142,.28);
  backdrop-filter: blur(10px);
}

.controls-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}

.btn{
  padding: 15px 16px; border-radius: 12px;
  border:1px solid rgba(210,160,140,.38);
  background: #fff;
  color: var(--text); font-weight: 700; font-size: 15px;
  box-shadow: 0 3px 10px rgba(220,140,120,.12);
}

.btn.primary{
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color:#fff;
  border: none;
  box-shadow: 0 8px 18px rgba(215,122,102,.24);
}

.btn.ghost{
  background: rgba(255,255,255,.9);
}

.btn.subtle{
  background: transparent;
  box-shadow:none;
}

.btn:disabled{ opacity:.5; box-shadow:none; }

.now{
  min-height: 22px; color: var(--muted); font-size: 13px; padding: 0 4px;
}

.mixer{
  display: grid;
  gap: 8px;
}

.mixer-row{
  display: grid;
  grid-template-columns: 74px 1fr 44px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.mixer-row strong{
  color: var(--text);
  font-size: 12px;
  text-align: right;
}

.mixer-row input[type="range"]{
  width: 100%;
}

audio{
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0.0001;
  pointer-events: none;
}

.coming-soon-modal[hidden]{
  display: none;
}

.coming-soon-modal{
  position: fixed;
  inset: 0;
  z-index: 40;
}

.coming-soon-backdrop{
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(36, 24, 19, .35);
}

.coming-soon-sheet{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fffaf7;
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(205,163,142,.34);
  padding: 16px 14px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -14px 30px rgba(88, 58, 47, .16);
}

.coming-soon-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.coming-soon-head h2{
  margin: 0;
  font-size: 18px;
}

.coming-soon-x{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(205,163,142,.35);
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.coming-soon-sub{
  margin-top: 6px;
}

.coming-soon-list{
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.coming-soon-list li{
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(205,163,142,.24);
  background: #fff;
}

@media (max-width: 420px){
  h1{ font-size: 26px; }
  .home-grid{ grid-template-columns: 1fr; }
  .top-sticky{
    grid-template-columns: 1fr;
  }
  .wrap{ padding: 14px 12px calc(106px + env(safe-area-inset-bottom)); }
}