:root {
  --bg: #090b16;
  --panel: #121628;
  --panel-soft: #171c31;
  --text: #f6f7fb;
  --muted: #9aa3bd;
  --line: rgba(255,255,255,.10);
  --accent: #8b5cf6;
  --accent2: #ec4899;
  --success: #57d38c;
  --danger: #ff6b7a;
  --shadow: 0 24px 70px rgba(0,0,0,.32);
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: radial-gradient(circle at 50% -12%, rgba(139,92,246,.20), transparent 30rem), var(--bg); color: var(--text); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
svg { width: 1.2em; height: 1.2em; fill: currentColor; }
.page-shell { width: min(980px, calc(100% - 32px)); margin: 0 auto; }
.topbar { height: 66px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-size: 16px; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: white; background: linear-gradient(145deg, var(--accent), var(--accent2)); }
.brand-mark svg { width: 17px; height: 17px; }
.top-note { color: #8f98b2; font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; }
.hero { padding: 70px 0 42px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.eyebrow { color: #cbbdff; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
h1 { max-width: 720px; margin: 12px 0 14px; font-size: clamp(40px, 6.2vw, 66px); line-height: 1.03; letter-spacing: -.055em; }
h1 span { background: linear-gradient(100deg, #c6b8ff, #ff91c8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy { max-width: 620px; color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 0 24px; }
.url-card { width: min(820px, 100%); background: rgba(18,22,40,.88); border: 1px solid rgba(255,255,255,.12); border-radius: 20px; padding: 9px; display: grid; grid-template-columns: 1fr auto; gap: 8px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.input-wrap { min-height: 56px; display: flex; align-items: center; gap: 9px; padding: 0 8px 0 14px; background: rgba(255,255,255,.032); border: 1px solid var(--line); border-radius: 13px; }
.input-wrap:focus-within { border-color: rgba(176,144,255,.72); box-shadow: 0 0 0 3px rgba(139,92,246,.12); }
.link-icon { display: grid; place-items: center; color: #aab2c8; }
#instagram-url { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: white; font-size: 15px; }
#instagram-url::placeholder { color: #747d98; }
.paste-button { border: 0; background: #242a43; color: #dce2f5; border-radius: 10px; min-height: 39px; padding: 0 12px; font-weight: 750; }
.paste-button:hover { background: #303754; }
.paste-button:disabled { opacity: .55; cursor: wait; }
.primary-button { border: 0; min-width: 136px; border-radius: 13px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(135deg, #8b5cf6, #d946ef); color: white; font-weight: 800; box-shadow: 0 8px 24px rgba(139,92,246,.22); }
.primary-button:hover { filter: brightness(1.06); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.status { min-height: 22px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.status.error { color: var(--danger); }
.status.ok { color: var(--success); }
.trust-row { margin-top: 16px; display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; color: #8f98b2; font-size: 12px; }
.trust-row b { color: var(--success); }
.hidden { display: none !important; }
.results { width: min(820px, 100%); margin-top: 14px; padding: 16px; text-align: left; border: 1px solid var(--line); border-radius: 20px; background: rgba(15,19,35,.84); box-shadow: 0 18px 48px rgba(0,0,0,.23); }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.result-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-author { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.count-chip { flex: 0 0 auto; background: #202641; border: 1px solid var(--line); color: #c8d0e8; border-radius: 999px; padding: 6px 9px; font-size: 11px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.media-grid.single-result { display: block; }
.media-card { overflow: hidden; border: 1px solid var(--line); background: var(--panel); border-radius: 15px; }
.media-preview { aspect-ratio: 4 / 3; max-height: 230px; background: #070910; position: relative; overflow: hidden; display: grid; place-items: center; }
.media-preview img { width: 100%; height: 100%; object-fit: contain; background: #070910; }
.media-type { position: absolute; top: 8px; left: 8px; padding: 5px 7px; border-radius: 999px; font-size: 9px; font-weight: 850; background: rgba(8,10,20,.78); backdrop-filter: blur(8px); }
.play-badge { position: absolute; inset: 0; margin: auto; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(9,11,22,.68); border: 1px solid rgba(255,255,255,.22); }
.media-body { padding: 11px; }
.media-meta { min-height: 17px; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.download-button { width: 100%; min-height: 42px; border-radius: 10px; display: flex; justify-content: center; align-items: center; gap: 7px; text-decoration: none; color: white; font-size: 13px; font-weight: 800; background: #283252; border: 1px solid rgba(255,255,255,.08); }
.download-button:hover { background: #344064; }
.compact-card { display: grid; grid-template-columns: 170px 1fr; min-height: 142px; }
.compact-card .media-preview { aspect-ratio: auto; height: 142px; max-height: none; }
.compact-card .media-body { display: flex; flex-direction: column; justify-content: center; padding: 16px; }
.compact-card .download-button { margin-top: 2px; }
.compact-note { width: min(820px, 100%); margin: 0 auto 34px; padding: 13px 15px; display: flex; align-items: flex-start; gap: 10px; border-top: 1px solid var(--line); color: #7e879f; }
.notice-icon { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: #202641; color: #cbd3eb; font-size: 11px; font-weight: 900; }
.compact-note p { margin: 0; font-size: 11px; line-height: 1.55; }
footer { min-height: 62px; padding: 17px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 14px; align-items: center; color: #6f7891; font-size: 11px; }
footer span:first-child { color: #dce2f1; font-weight: 800; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.25); border-top-color: white; border-radius: 50%; animation: spin .75s linear infinite; }
.preview-placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(145deg, #15182b, #0b0d18); color: #a8afc7; font-weight: 800; letter-spacing: .12em; }
@keyframes spin { to { transform: rotate(360deg); } }
body.has-result .hero { padding-bottom: 28px; }
@media (max-width: 680px) {
  .page-shell { width: min(100% - 18px, 980px); }
  .topbar { height: 58px; }
  .top-note { display: none; }
  .hero { padding: 46px 0 30px; }
  h1 { font-size: clamp(34px, 11vw, 50px); }
  .hero-copy { font-size: 13px; margin-bottom: 18px; }
  .url-card { grid-template-columns: 1fr; padding: 8px; border-radius: 17px; }
  .input-wrap { min-height: 53px; }
  .primary-button { min-height: 50px; }
  .results { padding: 12px; border-radius: 17px; }
  .result-heading { align-items: flex-start; }
  .result-heading h2 { font-size: 17px; }
  .media-grid { grid-template-columns: 1fr 1fr; }
  .compact-card { grid-template-columns: 112px 1fr; min-height: 120px; }
  .compact-card .media-preview { height: 120px; }
  .compact-card .media-body { padding: 11px; }
  .compact-card .media-meta { margin-bottom: 7px; }
  .trust-row { gap: 12px; }
  .compact-note { margin-bottom: 20px; padding-inline: 8px; }
  footer { min-height: 54px; padding: 14px 0; }
}
@media (max-width: 420px) {
  .paste-button { padding: 0 9px; }
  .media-grid:not(.single-result) { grid-template-columns: 1fr; }
  .compact-card { grid-template-columns: 96px 1fr; }
  .compact-card .media-preview { height: 112px; }
}

/* v0.7.0 — account browser + multi-download */
.mode-switch { width: min(420px, 100%); margin: 0 0 14px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(18,22,40,.76); }
.mode-tab { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: #8f98b2; font-size: 12px; font-weight: 800; }
.mode-tab:hover { color: #dce2f5; background: rgba(255,255,255,.035); }
.mode-tab.active { color: white; background: #252b46; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.mode-panel { width: min(820px, 100%); }
.account-card { width: 100%; }
#account-input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: white; font-size: 15px; }
#account-input::placeholder { color: #747d98; }
.at-icon { width: 20px; font-size: 17px; font-weight: 900; color: #aab2c8; }
.account-results { width: 100%; margin-top: 14px; padding: 16px; text-align: left; border: 1px solid var(--line); border-radius: 20px; background: rgba(15,19,35,.84); box-shadow: 0 18px 48px rgba(0,0,0,.23); }
.account-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 11px; }
.account-heading h2 { margin: 2px 0 0; font-size: 21px; letter-spacing: -.025em; }
.section-kicker { margin: 0; color: #a99af0; font-size: 9px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.selection-tools { min-height: 37px; margin: 0 0 10px; display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.text-button { min-height: 31px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: #bbc3db; font-size: 11px; font-weight: 750; }
.text-button:hover { background: rgba(255,255,255,.05); color: white; }
.text-button:disabled { opacity: .45; cursor: wait; }
.selection-limit { margin-left: auto; color: #747d98; font-size: 10px; }
.account-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.profile-card { position: relative; min-width: 0; aspect-ratio: 4 / 5; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #090b13; color: white; text-align: left; }
.profile-card::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(4,6,12,.62), transparent 34%); }
.profile-card img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .18s ease, opacity .18s ease; }
.profile-card:hover img { transform: scale(1.025); }
.profile-card.selected { border-color: rgba(179,146,255,.92); box-shadow: 0 0 0 2px rgba(139,92,246,.24); }
.profile-card.selected img { opacity: .78; }
.profile-check { position: absolute; z-index: 3; top: 8px; right: 8px; width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; background: rgba(5,7,14,.67); backdrop-filter: blur(7px); color: transparent; }
.profile-check svg { width: 16px; height: 16px; }
.profile-card.selected .profile-check { color: white; background: #8b5cf6; border-color: #bba2ff; }
.profile-type { position: absolute; z-index: 3; left: 8px; top: 8px; padding: 4px 6px; border-radius: 999px; background: rgba(5,7,14,.68); color: #f4f5fb; backdrop-filter: blur(7px); font-size: 8px; font-weight: 850; letter-spacing: .05em; }
.profile-date { position: absolute; z-index: 3; left: 8px; bottom: 8px; color: rgba(255,255,255,.82); font-size: 9px; font-weight: 700; }
.profile-play { position: absolute; z-index: 3; inset: 0; margin: auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(5,7,14,.58); border: 1px solid rgba(255,255,255,.23); color: white; opacity: .9; }
.batch-bar { position: sticky; z-index: 12; bottom: 10px; margin-top: 12px; padding: 9px 9px 9px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid rgba(190,166,255,.25); border-radius: 14px; background: rgba(22,26,46,.94); box-shadow: 0 18px 44px rgba(0,0,0,.36); backdrop-filter: blur(16px); }
.batch-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.batch-copy strong { font-size: 12px; }
.batch-copy span { max-width: 420px; overflow: hidden; color: #8f98b2; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.batch-download-button { min-height: 42px; flex: 0 0 auto; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #8b5cf6, #d946ef); color: white; font-size: 12px; font-weight: 850; }
.batch-download-button:disabled { opacity: .42; cursor: default; }
body.account-mode .hero { padding-bottom: 26px; }

@media (max-width: 760px) {
  .account-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .mode-switch { width: 100%; }
  .account-results { padding: 12px; border-radius: 17px; }
  .account-heading h2 { font-size: 18px; }
  .account-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .profile-card { border-radius: 10px; }
  .profile-check { top: 6px; right: 6px; width: 24px; height: 24px; }
  .profile-type { top: 6px; left: 6px; }
  .profile-date { left: 6px; bottom: 6px; }
  .batch-bar { bottom: 6px; padding: 8px 8px 8px 11px; }
  .batch-download-button { min-height: 40px; padding: 0 11px; }
}
@media (max-width: 480px) {
  .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .selection-limit { display: none; }
  .batch-copy span { max-width: 155px; }
  .batch-download-button span { font-size: 11px; }
}
