:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --border:#e5e7eb;
  --primary:#1e40af;
  --primary2:#2563eb;
  --radius:14px;
  --shadow: 0 8px 24px rgba(17,24,39,.08);
  --header-h: 132px;
}

*{box-sizing:border-box}
html{overflow-y: scroll}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.55;
  padding-top: var(--header-h);
}

a{color:inherit;text-decoration:none}
a:hover{opacity:.85}

.container{
  max-width: 950px;
  margin:0 auto;
  padding:16px;
}

.header{
  position: fixed;
  height: 130px;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #fff;
  padding: 14px 16px;
  box-shadow: 0 8px 22px rgba(0,0,0,.10);
}

.header
{
  padding-top: calc(14px + env(safe-area-inset-top));
  height: calc(130px + env(safe-area-inset-top));
}
body
{
  padding-top: calc(var(--header-h) + env(safe-area-inset-top));
}

.header-inner{
  max-width: 950px;
  margin:0 auto;
  margin-bottom: 10px;
}

.header-row{
  display:flex;
  align-items:center;
  gap:12px;
}

.title{
  font-size:1.4rem;
  font-weight:800;
  letter-spacing:.2px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

.pillbar-right{margin-left:auto}

.pillbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding: 8px 12px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  font-size: .95rem;
}

.pill a{
  color:#fff;
  text-decoration:none;
  font-weight:700;
}

.search{
  width:100%;
  padding:14px 14px;
  border-radius: var(--radius);
  border: 0;
  outline: none;
  font-size: 1rem;
}

.grid{
  display:grid;
  gap:10px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 1px 0 rgba(17,24,39,.02);
  font-size: 1.2em;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-width:0;
}

.card--result{
  border-left: 5px solid var(--primary);
}

.song-link{
  display:block;
  width:100%;
  min-width:0;
}

.text{
  font-weight:800;
  line-height:1.25;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

.snippet{
  display:block;
  color:var(--muted);
  margin-top:6px;
  font-size: .95rem;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  max-width: 70ch;
}

.btn{
  border: 0;
  background: var(--primary2);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 800;
  cursor:pointer;
  white-space:nowrap;
}

.btn:active{transform:translateY(1px)}
.btn[disabled]{opacity:.55; cursor:not-allowed}

.notice{
  margin: 12px 0 0;
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--muted);
  box-shadow: 0 1px 0 rgba(17,24,39,.02);
}

/* Drawer (bottom sheet) */
.drawerOverlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  pointer-events:none;
  transition: opacity .16s ease;
  z-index: 10001;
}
.drawerOverlay.show{opacity:1; pointer-events:auto;}

.drawer{
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  transform: translateY(105%);
  transition: transform .22s ease;
  z-index: 10002;
  padding: 0 0 env(safe-area-inset-bottom);
}
.drawer.show{transform: translateY(0);}

.sheet{
  max-width: 950px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow);
  overflow:hidden;
}

.sheetTop{
  padding: 12px 14px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.grab{
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(17,24,39,.12);
  margin: 10px auto 2px;
}

.closeBtn{
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 800;
  cursor:pointer;
}

.sheetBody{
  display:grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 12px 14px 16px;
}

.poster{
  width: 110px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(17,24,39,.03);
  overflow:hidden;
  aspect-ratio: 2/3;
}
.poster img{width:100%; height:100%; object-fit: cover; display:block;}

.movieTitle{
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -.2px;
  margin: 2px 0 6px;
}

.movieActions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.btn--ghost{
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}

.desc{
  grid-column: 1 / -1;
  color: var(--text);
  font-size: .95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

.toast{
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  background: rgba(17,24,39,.92);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  opacity: 0;
  pointer-events:none;
  transition: opacity .18s ease;
  max-width: min(92vw, 540px);
  z-index: 10003;
}
.toast.show{opacity:1}

@media (min-width: 600px){
  .title{font-size:1.6rem}
  .sheetBody{grid-template-columns: 140px 1fr}
  .poster{width:140px}
}

@media (min-width: 900px){
  .container{padding:24px}
}