:root {
  --bg: #0d0f14;
  --card: #161a23;
  --card-border: #232936;
  --text: #eef1f6;
  --muted: #9aa3b2;
  --accent: #e1306c;
  --accent-soft: rgba(225, 48, 108, 0.14);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.14);
  --blue: #3b82f6;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  min-height: 100vh;
  padding-bottom: 48px;
}
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  background: rgba(13, 15, 20, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 34px; height: 34px; color: var(--accent); }
.brand h1 { font-size: 19px; font-weight: 700; letter-spacing: 0.2px; }
.sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.goal {
  display: flex; align-items: center; gap: 6px;
  background: var(--green-soft); color: var(--green);
  border: 1px solid rgba(34,197,94,0.35);
  padding: 7px 12px; border-radius: 999px;
  font-weight: 700; font-size: 14px;
}
.goal svg { width: 18px; height: 18px; }
.goal.done-full { background: var(--green); color: #06210f; border-color: var(--green); }
main { max-width: 640px; margin: 0 auto; padding: 16px 14px 0; }
.section-head { margin: 6px 2px 12px; }
.section-head h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.count {
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px;
}
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.cards { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px;
}
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.card-title { font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.card-date { font-size: 11px; color: var(--muted); margin-top: 3px; }
.ig-link {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px;
  color: var(--accent); font-size: 12.5px; font-weight: 600; text-decoration: none;
  border: 1px solid rgba(225,48,108,0.4); padding: 6px 10px; border-radius: 8px;
}
.ig-link svg { width: 14px; height: 14px; }
.audio-row {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--muted);
  margin-bottom: 10px;
}
.audio-row svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--accent); }
.audio-row .audio-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caption-box {
  background: #0b0d12;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
  max-height: 150px; overflow-y: auto;
  margin-bottom: 10px;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; border-radius: 10px;
  padding: 10px 14px; font-size: 13.5px; font-weight: 700;
  cursor: pointer; text-decoration: none;
  transition: transform 0.08s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 16px; height: 16px; }
.btn-download { background: var(--blue); color: #fff; }
.btn-copy { background: #232936; color: var(--text); border: 1px solid var(--card-border); }
.btn-done { background: var(--green); color: #06210f; }
.btn-undo { background: transparent; color: var(--muted); border: 1px solid var(--card-border); font-weight: 600; }
.done-toggle {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--text);
  font-size: 16px; font-weight: 700; cursor: pointer;
  padding: 14px 2px;
}
.done-toggle svg { width: 18px; height: 18px; color: var(--muted); transition: transform 0.2s ease; }
.done-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
#doneSection { margin-top: 18px; border-top: 1px solid var(--card-border); }
#doneSection .card { opacity: 0.75; }
.empty {
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.empty svg { width: 52px; height: 52px; color: var(--green); margin-bottom: 12px; }
.empty p { font-size: 15px; }
.hidden { display: none !important; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #1d2330; color: var(--text);
  border: 1px solid var(--card-border);
  padding: 11px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  z-index: 50; white-space: nowrap;
}
