:root {
  color-scheme: dark;
  --bg: #0c0d13;
  --panel: #171a24;
  --panel-soft: #202432;
  --border: #303442;
  --ink: #f6f6fb;
  --muted: #acb2c5;
  --accent: #a994ff;
  --accent-strong: #7a5cf0;
  --danger: #ffb5ba;
  --good: #79e5bf;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: var(--accent); }
.hidden { display: none !important; }
.purple { color: var(--accent); }
.shell { display: flex; max-width: 1300px; min-height: 100vh; margin: 0 auto; }
.sidebar { width: 236px; flex: 0 0 236px; height: 100vh; position: sticky; top: 0; background: #13151d; border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 28px 15px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 10px 13px 37px; }
.brand-icon { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; background: var(--accent-strong); border-radius: 14px; font-size: 28px; font-weight: 800; color: white; }
.brand b { font-size: 22px; letter-spacing: -.7px; }
.brand small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.nav-heading { color: #8d93a7; font-weight: 750; font-size: 11px; letter-spacing: 1.5px; margin: 0 15px 12px; }
.nav { display: grid; gap: 8px; }
.nav-item { background: none; border: 1px solid transparent; border-radius: 12px; color: var(--muted); display: flex; align-items: center; gap: 12px; padding: 13px; text-align: left; font-weight: 650; min-height: 48px; }
.nav-item.active, .nav-item:hover { background: #262338; border-color: #46385e; color: var(--ink); }
.nav-symbol { font-size: 21px; width: 24px; text-align: center; }
.sidebar-bottom { margin-top: auto; padding: 15px; font-size: 12px; color: #8e94a7; display: grid; gap: 12px; }
.mini-status { color: var(--muted); }
.pulse { width: 7px; height: 7px; display: inline-block; background: var(--good); border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.sidebar-bottom strong { color: var(--accent); }
.content-area { flex: 1; min-width: 0; }
.topbar { border-bottom: 1px solid var(--border); height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 40px; }
.mobile-brand { display: none; }
.topbar-caption { font-size: 12px; letter-spacing: 1.5px; font-weight: 700; color: var(--muted); }
.top-badge { background: #262038; color: #d3c6ff; border-radius: 99px; font-size: 12px; padding: 6px 12px; }
.content-area main { width: min(820px, 100%); padding: 48px 40px 110px; margin: 0 auto; }
.simple-heading { margin-bottom: 27px; }
.eyebrow { font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: var(--accent); margin-bottom: 10px; }
.simple-heading h1, .inner-title { margin: 0 0 9px; font-size: clamp(30px, 4vw, 39px); line-height: 1.14; letter-spacing: -1.4px; }
.simple-heading p, .page-subtitle { color: var(--muted); margin: 0; max-width: 550px; }
.page-subtitle { margin-bottom: 25px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 20px; }
.padded { padding: 26px; }
.main-panel { box-shadow: 0 15px 55px #0002; }
.field-label { display: block; margin: 0 0 9px; font-size: 13px; font-weight: 700; color: #d8d9e6; }
.url-group { display: flex; gap: 9px; margin-bottom: 15px; }
.url-group input, .solo-input, .select, .lock-card input { background: #0d1018; color: var(--ink); border: 1px solid #44495b; border-radius: 12px; width: 100%; min-width: 0; padding: 14px 15px; font-size: 16px; min-height: 52px; outline: none; }
.url-group input::placeholder, .solo-input::placeholder { color: #9197ab; }
input:focus, select:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px #a994ff25; }
.small-action { flex-shrink: 0; min-height: 48px; border: 1px solid #5b4d80; border-radius: 12px; color: #eee7ff; background: #2c2740; padding: 11px 18px; font-weight: 720; }
.small-action.outlined { min-height: 40px; padding: 8px 13px; font-size: 13px; }
.button { border: 0; border-radius: 13px; min-height: 52px; padding: 13px 19px; font-weight: 750; font-size: 16px; text-decoration: none; display: inline-grid; place-items: center; }
.button.primary { background: var(--accent-strong); color: white; }
.button.primary:not(:disabled):active { background: #8b70fc; }
.button.secondary { background: #35304d; color: #efebff; border: 1px solid #594b7c; }
.button.ghost { background: #242336; color: #e5dbff; border: 1px solid #464057; }
.button.wide { width: 100%; }
.field-block { margin-top: 20px; }
.field-help { font-size: 13px; color: var(--muted); margin: 9px 0 0; line-height: 1.5; }
.find-results { border-top: 1px solid var(--border); margin-top: 21px; padding-top: 20px; }
.analysis-info { display: flex; align-items: center; gap: 12px; padding: 13px; margin-top: 17px; background: #222637; border: 1px solid #3c455e; border-radius: 13px; }
.analysis-thumb, .analysis-fallback { flex-shrink: 0; width: 76px; height: 57px; border-radius: 9px; object-fit: cover; background: #353052; }
.analysis-fallback { display: grid; place-items: center; font-size: 23px; color: #c7b4ff; }
.analysis-text { min-width: 0; }
.analysis-text b { display: block; overflow-wrap: anywhere; line-height: 1.35; font-size: 14px; }
.analysis-text small { font-size: 12px; color: var(--muted); display: block; margin-top: 4px; }
.download-button { margin-top: 20px; }
.error { margin-top: 16px; background: #43232e; color: #ffe2e4; border: 1px solid #85505e; border-radius: 12px; padding: 13px 15px; font-size: 14px; overflow-wrap: anywhere; }
.help-card { margin-top: 17px; display: flex; align-items: flex-start; gap: 13px; padding: 16px; background: #171a24; border: 1px solid #292f3f; border-radius: 14px; }
.help-icon { font-size: 24px; color: var(--accent); line-height: 1; }
.help-card b { display: block; font-size: 14px; }
.help-card p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.advanced-link { display: block; border: 0; background: transparent; font-size: 13px; color: var(--muted); margin: 21px 0; padding: 5px; text-align: left; }
.advanced-link b { color: var(--accent); }
.section-heading { margin: 0 0 20px; display: flex; justify-content: space-between; align-items: center; }
.section-heading h2 { font-size: 20px; margin: 0; }
.section-heading .kicker { display: none; }
.section-decoration { display: none; }
.page > .panel { margin-top: 20px; }
.note { display: flex; align-items: flex-start; gap: 10px; background: #222333; border: 1px solid #3b3f50; border-radius: 13px; padding: 15px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.note-icon { color: var(--accent); font-size: 20px; }
.two-actions { display: flex; gap: 12px; }
.inline-link { border: 0; background: transparent; color: #bdaafa; text-decoration: underline; font-size: 13px; padding: 5px; font-weight: 700; }
.library-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; }
.library-number b { font-size: 26px; }
.library-number span { font-size: 13px; color: var(--muted); margin-left: 10px; }
.clip-list { display: grid; gap: 11px; margin-top: 22px; }
.clip-row { background: #202432; border: 1px solid #353b4c; border-radius: 14px; padding: 15px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.clip-row-symbol { flex: 0 0 41px; width: 41px; height: 41px; background: #3d3159; color: #d8caff; border-radius: 11px; display: grid; place-items: center; }
.clip-row-content { min-width: 0; flex: 1; }
.clip-row-content b { display: block; font-size: 15px; overflow-wrap: anywhere; line-height: 1.35; }
.clip-row-content span { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.clip-buttons { display: flex; gap: 8px; width: 100%; flex-wrap: wrap; }
.clip-buttons button, .clip-buttons a { flex: 1; min-height: 42px; border-radius: 10px; padding: 9px 12px; border: 1px solid #5c4c7e; background: #342849; color: #f3edff; text-align: center; text-decoration: none; font-size: 13px; font-weight: 730; white-space: nowrap; }
.clip-buttons .danger { border-color: #76505d; color: #ffc6cf; background: #38252e; }
.empty-state { text-align: center; display: grid; justify-items: center; gap: 5px; padding: 30px 10px; }
.empty-state span { font-size: 40px; color: var(--accent); }
.empty-state p { margin: 0; font-size: 13px; color: var(--muted); }
.settings-second { margin-top: 16px !important; }
.settings-copy { font-size: 14px; color: var(--muted); }
.settings-copy b { color: var(--ink); }
.success-text { color: var(--good); font-size: 13px; margin-top: 10px; }
.job-toast { position: fixed; z-index: 20; right: 25px; bottom: 24px; width: min(440px, calc(100vw - 30px)); border: 1px solid #6c5a93; background: #232238; box-shadow: 0 22px 70px #000b; border-radius: 16px; padding: 17px; }
.job-header { display: flex; justify-content: space-between; align-items: center; gap: 9px; }
.job-header b { font-size: 16px; }
.job-header span { font-weight: 800; color: #c8b7ff; }
#job-message { color: var(--muted); font-size: 13px; margin: 7px 0 13px; }
.progress-track { height: 8px; border-radius: 99px; background: #11131e; overflow: hidden; }
.progress-fill { width: 0; height: 100%; background: #a994ff; border-radius: 99px; transition: width .25s; }
.job-actions { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 14px; flex-wrap: wrap; }
.job-actions .button { font-size: 13px; min-height: 40px; padding: 8px 13px; }
.modal { z-index: 30; position: fixed; inset: 0; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: #000c; }
.modal-card { z-index: 1; position: relative; width: min(700px, 100%); border: 1px solid #464051; border-radius: 16px; padding: 14px; background: #181a27; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-head b { min-width: 0; overflow-wrap: anywhere; }
.modal-head button { color: white; background: #36304a; border: 0; border-radius: 9px; min-width: 42px; min-height: 42px; }
.modal-card video { width: 100%; max-height: 65vh; background: black; border-radius: 10px; }
.modal-caption { color: var(--muted); font-size: 12px; }
.lock-overlay { background: #0c0d13f2; position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 18px; }
.lock-card { background: #191b27; padding: 24px; border: 1px solid #4d426a; border-radius: 20px; width: min(400px, 100%); }
.lock-card h2 { font-size: 27px; line-height: 1.2; }
.lock-card p { color: var(--muted); }
.lock-card input { margin: 10px 0 14px; }
.bottom-nav { display: none; }
@media (max-width: 760px) {
  body { font-size: 16px; }
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { position: sticky; z-index: 12; top: 0; height: 58px; padding: 0 19px; background: #12141deb; backdrop-filter: blur(16px); }
  .mobile-brand { display: block; font-weight: 800; font-size: 20px; letter-spacing: -.5px; }
  .tiny-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 6px; border-radius: 9px; background: var(--accent-strong); color: white; font-size: 18px; }
  .topbar-caption { display: none; }
  .top-badge { font-size: 11px; padding: 4px 9px; }
  .content-area main { width: 100%; max-width: 560px; padding: 25px 18px calc(110px + var(--safe-bottom)); }
  .simple-heading { margin-bottom: 22px; }
  .simple-heading h1, .inner-title { font-size: 31px; letter-spacing: -.9px; }
  .simple-heading p, .page-subtitle { font-size: 15px; line-height: 1.55; }
  .padded { padding: 19px; }
  .panel { border-radius: 17px; }
  .url-group { display: flex; }
  .url-group input, .solo-input, .select, .lock-card input { font-size: 16px; }
  .small-action { padding: 10px 13px; font-size: 14px; }
  .bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 15; display: flex; justify-content: space-around; padding: 8px 8px calc(8px + var(--safe-bottom)); border-top: 1px solid var(--border); background: #151722f5; backdrop-filter: blur(16px); }
  .bottom-nav button { flex: 1; border: 0; color: #a9afc0; background: none; padding: 4px 6px; min-height: 49px; display: grid; place-items: center; gap: 2px; font-size: 12px; font-weight: 700; }
  .bottom-nav button span { font-size: 22px; line-height: 1; }
  .bottom-nav button.active { color: #d0c2ff; }
  .job-toast { bottom: calc(76px + var(--safe-bottom)); right: 9px; width: calc(100% - 18px); }
}
@media (max-width: 370px) {
  .content-area main { padding-inline: 12px; }
  .padded { padding: 15px; }
  .simple-heading h1 { font-size: 28px; }
  .clip-buttons button, .clip-buttons a { font-size: 12px; padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* v2.1: full-size iPhone layout. Keep system pinch-to-zoom available for accessibility. */
html, body { width: 100%; max-width: 100%; overflow-x: clip; }
button, a { touch-action: manipulation; }
@media (max-width: 760px) {
  body { font-size: 18px; line-height: 1.4; }
  .topbar { height: 58px; padding: 0 16px; }
  .mobile-brand { font-size: 23px; }
  .tiny-mark { width: 32px; height: 32px; }
  .top-badge { font-size: 12px; }
  .content-area main { padding: 14px 12px calc(93px + var(--safe-bottom)); max-width: 540px; }
  .simple-heading { margin-bottom: 14px; }
  .simple-heading .eyebrow { display: none; }
  .simple-heading h1, .inner-title { font-size: 37px; letter-spacing: -1.1px; line-height: 1.12; margin-bottom: 6px; }
  .simple-heading p, .page-subtitle { font-size: 17px; line-height: 1.4; }
  .page-subtitle { margin-bottom: 12px; }
  .page > .panel { margin-top: 12px; }
  .panel { border-radius: 15px; }
  .padded { padding: 15px; }
  .field-label { font-size: 16px; line-height: 1.3; margin-bottom: 9px; }
  .url-group { gap: 7px; margin-bottom: 11px; }
  .url-group input, .solo-input, .select, .lock-card input {
    font-size: 18px; min-height: 58px; padding: 14px 12px; border-radius: 11px;
  }
  .url-group input::placeholder { font-size: 16px; }
  .small-action { font-size: 16px; min-height: 58px; padding: 9px 13px; }
  .button { font-size: 19px; min-height: 59px; border-radius: 12px; }
  .field-help { font-size: 15px; }
  .find-results { margin-top: 14px; padding-top: 13px; }
  .analysis-info { margin-top: 12px; }
  .analysis-text b { font-size: 17px; }
  .analysis-text small { font-size: 14px; }
  .help-card { margin-top: 11px; padding: 11px 12px; gap: 10px; }
  .help-icon { font-size: 22px; }
  .help-card b { font-size: 16px; }
  .help-card p { font-size: 15px; line-height: 1.35; }
  .advanced-link { font-size: 16px; margin: 13px 0; padding: 5px 2px; }
  .error { font-size: 16px; }
  .bottom-nav { padding-top: 6px; padding-bottom: calc(7px + var(--safe-bottom)); }
  .bottom-nav button { min-height: 55px; font-size: 14px; }
  .bottom-nav button span { font-size: 25px; }
  .library-number span { font-size: 15px; }
  .clip-row-content b { font-size: 17px; }
  .clip-row-content span { font-size: 14px; }
  .clip-buttons button, .clip-buttons a { font-size: 15px; min-height: 49px; }
  .note, .settings-copy { font-size: 16px; }
  .lock-card { padding: 17px; }
}
@media (max-width: 370px) {
  .content-area main { padding-inline: 10px; }
  .padded { padding: 12px; }
  .simple-heading h1 { font-size: 34px; }
  .url-group input { padding-inline: 8px; }
  .small-action { padding-inline: 10px; }
  .clip-buttons button, .clip-buttons a { font-size: 14px; }
}
