:root {
  --ink: #171713;
  --cream: #f3eedf;
  --paper: #fbf8ef;
  --surface: #fff;
  --panel: #e9e4d7;
  --inverse-text: #fff;
  --topbar: rgba(243, 238, 223, .92);
  --muted: #737268;
  --line: rgba(23, 23, 19, .16);
  --green: #bdd9b5;
  --green-dark: #8cbd80;
  --pink: #f0aeb6;
  --lavender: #beb7dd;
  --yellow: #f2d985;
  --shadow: 8px 8px 0 var(--ink);
  --font: "Arial Narrow", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --ink: #f3eedf;
  --cream: #10120f;
  --paper: #181b16;
  --surface: #20241d;
  --panel: #22271f;
  --inverse-text: #151712;
  --topbar: rgba(16, 18, 15, .94);
  --muted: #aaa99f;
  --line: rgba(243, 238, 223, .18);
  --green: #8dbb82;
  --green-dark: #a8d29e;
  --pink: #dd8f9a;
  --lavender: #9e96c4;
  --yellow: #d9bd60;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--font); min-height: 100vh; overflow-x: hidden; transition: background-color .22s ease, color .22s ease; }
body::before { content: ""; position: fixed; inset: 0; z-index: -2; background-image: linear-gradient(rgba(23,23,19,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(23,23,19,.045) 1px, transparent 1px); background-size: 28px 28px; }
html[data-theme="dark"] body::before { background-image: linear-gradient(rgba(243,238,223,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(243,238,223,.045) 1px, transparent 1px); }
.noise { pointer-events: none; position: fixed; inset: 0; opacity: .035; z-index: 20; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E"); }
button, input, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; stroke-linejoin: miter; }
.hidden { display: none !important; }
.brutal-card { background: var(--paper); border: 2px solid var(--ink); box-shadow: var(--shadow); transition: background-color .22s ease, border-color .22s ease; }
.eyebrow { margin: 0 0 10px; font: 500 11px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.eyebrow > span:first-child { display: inline-grid; place-items: center; width: 25px; height: 25px; margin-right: 8px; border: 1.5px solid var(--ink); background: var(--yellow); font-size: 10px; }
.muted { color: var(--muted); }
.status-dot { display: inline-block; width: 8px; height: 8px; background: #4f9f55; border-radius: 50%; box-shadow: 0 0 0 3px rgba(79,159,85,.16); }

.topbar { height: 82px; padding: 0 max(28px, calc((100vw - 1240px) / 2)); border-bottom: 2px solid var(--ink); display: flex; align-items: center; background: var(--topbar); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; letter-spacing: -.04em; text-decoration: none; }
.brand-mark { width: 31px; height: 31px; border: 2px solid var(--ink); display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 4px; transform: rotate(-2deg); background: var(--pink); }
.brand-mark span { background: var(--ink); }
.brand-mark span:last-child { height: 65%; align-self: end; }
.privacy-pill { margin-left: 24px; border-left: 1px solid var(--line); padding-left: 24px; color: var(--muted); font: 500 9px var(--mono); letter-spacing: .1em; }
.privacy-pill span { display: inline-block; width: 6px; height: 6px; background: #59975c; border-radius: 50%; margin-right: 7px; }
.desktop-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-link { text-decoration: none; padding: 29px 17px 27px; border-bottom: 3px solid transparent; font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.nav-link:hover, .nav-link.active { border-bottom-color: var(--ink); }
.avatar-button { width: 38px; height: 38px; margin-left: 10px; border: 1.5px solid var(--ink); background: var(--lavender); box-shadow: 3px 3px 0 var(--ink); font-weight: 800; }
.theme-toggle { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1.5px solid var(--ink); background: var(--surface); box-shadow: 3px 3px 0 var(--ink); color: var(--ink); }
.theme-toggle:hover { background: var(--yellow); }
.theme-icon { width: 18px; height: 18px; }
.theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }
.theme-toggle > span { display: none; }
.login-theme-toggle { position: fixed; top: max(22px, env(safe-area-inset-top)); right: max(22px, env(safe-area-inset-right)); z-index: 2; width: auto; min-width: 44px; padding: 0 12px; grid-template-columns: auto auto; gap: 8px; }
.login-theme-toggle > span { display: block; font: 600 8px var(--mono); letter-spacing: .08em; }
.mobile-menu, .mobile-drawer { display: none; }

main { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.view { display: none; }
.view.active-view { display: block; animation: fade-in .3s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(5px); } }
.hero { min-height: 440px; padding: 88px 6% 68px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: end; gap: 80px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.hero h1, .page-header h1 { margin: 14px 0 0; font-size: clamp(70px, 9vw, 126px); line-height: .78; letter-spacing: -.075em; font-weight: 800; }
.hero h1 em, .page-header h1 em { font-family: Georgia, serif; font-weight: 400; color: transparent; -webkit-text-stroke: 1.8px var(--ink); }
.hero-copy { padding: 0 5% 5px 0; }
.hero-copy > p { font-size: 20px; line-height: 1.55; letter-spacing: -.025em; max-width: 450px; margin: 0 0 35px; }
.providers { display: flex; align-items: center; }
.provider { width: 39px; height: 39px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 50%; margin-left: -5px; font-weight: 800; background: var(--surface); }
.provider:first-child { margin-left: 0; }
.provider.youtube { background: var(--pink); font-size: 12px; }
.provider.instagram { background: var(--yellow); font-size: 22px; }
.provider.tiktok { background: var(--lavender); font-size: 18px; }
.provider-label { margin-left: 15px; font: 9px/1.5 var(--mono); color: var(--muted); letter-spacing: .08em; }
.provider-label strong { color: #438248; }

.input-card, .result-card, .job-card, .loading-card { position: relative; margin: 0 6% 95px; }
.input-card { padding: 54px 62px 58px; }
.input-card { margin-bottom: 28px; }
.batch-card { position: relative; margin: 0 6% 95px; padding: 34px 38px; }
.batch-card .card-index { background: var(--pink); }
.batch-heading { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.batch-heading h2 { margin: 0 0 8px; font-size: 25px; letter-spacing: -.04em; }
.batch-heading p:last-child { margin: 0; max-width: 590px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.batch-toggle { min-width: 150px; min-height: 48px; border: 1.5px solid var(--ink); background: var(--surface); box-shadow: 3px 3px 0 var(--ink); font: 700 9px var(--mono); letter-spacing: .07em; }
.batch-toggle span { margin-left: 10px; font-size: 17px; }
.batch-form { position: relative; margin-top: 28px; padding-top: 27px; border-top: 1.5px solid var(--ink); }
.batch-form textarea { width: 100%; min-height: 150px; resize: vertical; border: 2px solid var(--ink); border-radius: 0; outline: 0; padding: 16px 18px; background: var(--surface); color: var(--ink); font: 12px/1.7 var(--mono); box-shadow: 4px 4px 0 var(--ink); }
.batch-form textarea:focus { box-shadow: 6px 6px 0 var(--pink); }
.batch-count { margin: 10px 0 18px; text-align: right; color: var(--muted); font: 8px var(--mono); letter-spacing: .08em; }
.batch-count.count-error { color: #bd5a55; }
.batch-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.batch-options label { font: 500 8px var(--mono); letter-spacing: .08em; }
.batch-options select { width: 100%; height: 45px; margin-top: 8px; font-size: 11px; }
.batch-form .button { min-height: 56px; }
.batch-status { margin-top: 28px; padding-top: 27px; border-top: 1.5px solid var(--ink); }
.batch-status-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.batch-status-head h3 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.batch-status-head > strong { font: 500 30px var(--mono); }
.batch-status .progress-track { height: 10px; margin: 22px 0; }
.batch-items { display: grid; gap: 8px; }
.batch-item { min-height: 64px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 120px auto; align-items: center; gap: 13px; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); }
.batch-item-index { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--ink); background: var(--cream); font: 8px var(--mono); }
.batch-item h4 { margin: 0 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.batch-item p { margin: 0; color: var(--muted); font: 8px var(--mono); text-transform: uppercase; }
.batch-item-progress { display: flex; align-items: center; gap: 8px; }
.batch-item-progress i { flex: 1; height: 5px; background: var(--panel); }
.batch-item-progress i span { display: block; height: 100%; background: var(--green-dark); }
.batch-item-progress strong { width: 34px; text-align: right; font: 8px var(--mono); }
.batch-item a, .batch-item button { border: 0; background: transparent; font: 700 8px var(--mono); letter-spacing: .06em; text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }
.batch-error { border-color: #b55b55; }
.batch-error .batch-item-index { background: #e3a09c; color: #171713; }
.batch-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 18px; color: var(--muted); font: 8px var(--mono); }
.card-index { position: absolute; top: -2px; left: -2px; width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--yellow); font: 500 13px var(--mono); }
.input-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 30px; }
.input-heading h2, .loading-card h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.route-indicator { font: 500 9px var(--mono); color: var(--muted); letter-spacing: .08em; }
.route-indicator .status-dot { width: 6px; height: 6px; margin-right: 7px; }
.url-shell { height: 72px; display: flex; align-items: center; border: 2px solid var(--ink); background: var(--surface); box-shadow: 4px 4px 0 rgba(23,23,19,.14); }
.url-shell:focus-within { box-shadow: 5px 5px 0 var(--ink); }
.link-icon { width: 22px; margin: 0 16px 0 22px; }
.url-shell input { min-width: 0; flex: 1; height: 100%; border: 0; outline: 0; font-size: 15px; background: transparent; }
.url-shell input::placeholder { color: #9b998f; }
.paste-button { align-self: stretch; width: 108px; border: 0; border-left: 1.5px solid var(--ink); background: var(--cream); font: 500 10px var(--mono); letter-spacing: .08em; }
.paste-button svg { width: 17px; vertical-align: middle; margin-right: 6px; }
.paste-button:hover { background: var(--yellow); }
.clear-button { width: 50px; align-self: stretch; border: 0; border-left: 1px solid var(--line); background: var(--surface); font-size: 24px; }
.input-meta { display: flex; gap: 24px; padding: 12px 4px 0; color: var(--muted); font: 9px var(--mono); letter-spacing: .07em; }
.input-meta span::before { content: "·"; margin-right: 8px; color: var(--ink); }
.advanced { margin-top: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.advanced summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 18px 4px; font-size: 13px; font-weight: 700; cursor: pointer; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary svg { width: 18px; vertical-align: middle; margin-right: 10px; }
.advanced .plus { font: 20px var(--mono); transition: transform .2s; }
.advanced[open] .plus { transform: rotate(45deg); }
.advanced-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 5px 0 20px; }
.advanced-grid label { font: 500 9px var(--mono); letter-spacing: .08em; }
select { appearance: none; border: 1.5px solid var(--ink); border-radius: 0; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23171713' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat calc(100% - 14px) center; padding: 0 38px 0 13px; }
html[data-theme="dark"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23f3eedf' stroke-width='1.5'/%3E%3C/svg%3E"); }
.advanced-grid select { width: 100%; height: 43px; margin-top: 8px; font-size: 12px; }
.button { min-height: 58px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 2px solid var(--ink); border-radius: 0; box-shadow: 5px 5px 0 var(--ink); font: 700 12px var(--mono); letter-spacing: .08em; text-decoration: none; transition: transform .12s, box-shadow .12s; }
.button:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.button:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--ink); }
.button:disabled { opacity: .55; cursor: wait; }
.button-green { background: var(--green); }
.button-pink { background: var(--pink); }
.button-dark { background: var(--ink); color: var(--inverse-text); box-shadow: 5px 5px 0 var(--lavender); }
.button-green, .button-pink, .card-index, .provider.youtube, .provider.instagram, .provider.tiktok, .health-icon { color: #171713; }
.analyze-button { width: 100%; margin-top: 30px; padding: 0 22px; justify-content: space-between; }
.button-label { display: flex; align-items: center; gap: 10px; margin: auto; }
.button-label svg { width: 20px; }
.button-code { font-size: 10px; opacity: .65; }
.full-width { width: 100%; }

.error-banner { margin: -60px 6% 88px; border: 2px solid var(--ink); background: #f5c4bf; color: #171713; padding: 18px 50px 18px 20px; position: relative; box-shadow: 5px 5px 0 var(--ink); }
.error-banner strong { display: block; font-size: 14px; margin-bottom: 4px; }
.error-banner span { font-size: 13px; }
.error-banner button { position: absolute; top: 9px; right: 12px; border: 0; background: transparent; font-size: 23px; }
.error-banner.history-error { margin: 0 0 22px; }
.loading-card { padding: 36px 45px; display: grid; grid-template-columns: auto 1fr; gap: 25px; align-items: center; }
.scan-graphic { width: 62px; height: 62px; border: 2px solid var(--ink); display: flex; gap: 4px; align-items: end; padding: 9px; background: var(--lavender); }
.scan-graphic span { flex: 1; background: var(--ink); animation: scan .8s ease-in-out infinite alternate; }
.scan-graphic span:nth-child(1) { height: 35%; }
.scan-graphic span:nth-child(2) { height: 80%; animation-delay: -.25s; }
.scan-graphic span:nth-child(3) { height: 55%; animation-delay: -.5s; }
@keyframes scan { to { height: 95%; } }
.loading-line { grid-column: 1/-1; height: 5px; background: var(--panel); overflow: hidden; }
.loading-line span { display: block; width: 35%; height: 100%; background: var(--ink); animation: loading 1.2s infinite ease-in-out; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(390%); } }

.result-card { padding: 36px; }
.result-card .card-index { background: var(--lavender); }
.result-grid { display: grid; grid-template-columns: 44% 1fr; gap: 36px; padding-bottom: 36px; border-bottom: 2px solid var(--ink); }
.media-preview { min-height: 270px; position: relative; border: 2px solid var(--ink); background: #c9c3b3; overflow: hidden; }
.media-preview img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.media-preview::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 65%, rgba(0,0,0,.55)); }
.preview-overlay { position: absolute; inset: auto 12px 12px; display: flex; justify-content: space-between; z-index: 1; }
.preview-overlay span { background: var(--ink); color: var(--inverse-text); padding: 7px 9px; font: 500 9px var(--mono); }
.preview-overlay .source-badge { background: var(--pink); color: var(--ink); border: 1px solid var(--ink); }
.media-details { display: flex; flex-direction: column; align-items: flex-start; padding: 12px 8px 4px 0; }
.media-details .eyebrow { color: #4d824c; }
.media-details .status-dot { margin-left: 6px; width: 6px; height: 6px; }
.media-details h2 { margin: 4px 0 8px; font-size: clamp(25px, 3vw, 42px); line-height: 1.05; letter-spacing: -.05em; max-width: 570px; }
.creator { margin: 0; color: var(--muted); font-size: 14px; }
.media-stats { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); margin: auto 0 22px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.media-stats span { padding-left: 18px; border-left: 1px solid var(--line); }
.media-stats span:first-child { padding-left: 0; border: 0; }
.media-stats small, .download-summary small { display: block; margin-bottom: 6px; color: var(--muted); font: 500 8px var(--mono); letter-spacing: .09em; }
.media-stats strong { font-size: 13px; }
.media-details > a { font: 600 10px var(--mono); letter-spacing: .08em; text-underline-offset: 5px; }
.configuration { padding: 12px 0 0; }
.config-section { padding: 30px 0; border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: center; margin-bottom: 20px; }
.section-title > span:first-child { width: 30px; height: 30px; border: 1.5px solid var(--ink); display: grid; place-items: center; margin-right: 14px; background: var(--cream); font: 500 9px var(--mono); }
.section-title .eyebrow { margin-bottom: 3px; font-size: 8px; color: var(--muted); }
.section-title h3 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.section-title .native-only { margin-left: auto; font: 500 8px var(--mono); padding: 6px 8px; border: 1px solid var(--line); color: var(--muted); }
.segment-control { display: grid; grid-template-columns: repeat(3, 1fr); border: 1.5px solid var(--ink); }
.segment-control button { height: 55px; border: 0; border-left: 1.5px solid var(--ink); background: var(--surface); font-weight: 700; font-size: 13px; }
.segment-control button:first-child { border-left: 0; }
.segment-control button.active { color: var(--inverse-text); background: var(--ink); }
.segment-control svg { width: 20px; margin-right: 8px; vertical-align: middle; }
.quality-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.quality-button { min-height: 66px; border: 1.5px solid var(--ink); background: var(--surface); padding: 8px; }
.quality-button strong, .quality-button small { display: block; }
.quality-button strong { font-size: 15px; }
.quality-button small { margin-top: 4px; color: var(--muted); font: 8px var(--mono); text-transform: uppercase; }
.quality-button.active { background: var(--ink); color: var(--inverse-text); box-shadow: 3px 3px 0 var(--pink); }
.quality-button.active small { color: #d3d0c9; }
.toggle-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.toggle-row, .select-row { min-height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border: 1px solid var(--line); background: var(--surface); }
.toggle-row strong, .toggle-row small, .select-row strong, .select-row small { display: block; }
.toggle-row strong, .select-row strong { font-size: 12px; }
.toggle-row small, .select-row small { margin-top: 4px; font-size: 10px; color: var(--muted); }
.toggle-row input { position: absolute; opacity: 0; }
.toggle-row i { width: 38px; height: 20px; border: 1.5px solid var(--ink); background: #d7d4cb; position: relative; transition: background .2s; }
.toggle-row i::after { content: ""; width: 14px; height: 14px; position: absolute; top: 2px; left: 2px; background: var(--ink); transition: left .2s; }
.toggle-row input:checked + i { background: var(--green); }
.toggle-row input:checked + i::after { left: 19px; }
.select-row select { height: 38px; min-width: 110px; font: 500 10px var(--mono); }
.download-summary { margin: 34px -36px -36px; padding: 26px 36px; border-top: 2px solid var(--ink); background: var(--panel); display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 20px; }
.download-summary strong { font-size: 15px; }
.download-summary .button { min-width: 250px; }

.job-card { padding: 42px; }
.job-top { display: flex; justify-content: space-between; align-items: flex-start; }
.job-top h2 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.job-percent { font: 500 48px/1 var(--mono); letter-spacing: -.08em; }
.progress-track { height: 14px; border: 2px solid var(--ink); margin: 32px 0 20px; padding: 2px; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--lavender); transition: width .35s; }
.job-footer { display: flex; justify-content: space-between; font: 500 9px var(--mono); color: var(--muted); }
.text-button { border: 0; background: transparent; font: 600 9px var(--mono); text-decoration: underline; text-underline-offset: 4px; }
.ready-actions { margin-top: 30px; padding-top: 25px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 24px; }
.ready-actions .button { flex: 1; }
.ready-actions > span { max-width: 230px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.promise-strip { margin: 0 6% 100px; display: grid; grid-template-columns: repeat(3,1fr); border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.promise-strip > div { padding: 28px 24px; border-left: 1px solid var(--line); }
.promise-strip > div:first-child { border: 0; }
.promise-strip span { display: block; color: var(--muted); font: 9px var(--mono); margin-bottom: 14px; }
.promise-strip strong { font: 600 10px var(--mono); letter-spacing: .06em; }
.promise-strip p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.page-view { padding: 70px 6% 100px; }
.page-header { display: grid; grid-template-columns: 1fr 360px; gap: 50px; align-items: end; margin-bottom: 70px; }
.page-header h1 { font-size: clamp(68px, 8vw, 108px); }
.page-header > p { margin: 0 0 5px; font-size: 17px; line-height: 1.6; }
.history-toolbar { min-width: 0; padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) 190px 120px; gap: 12px; margin-bottom: 38px; }
.search-box { height: 50px; display: flex; align-items: center; border: 1.5px solid var(--ink); background: var(--surface); }
.search-box svg { width: 18px; margin: 0 12px; }
.search-box input { min-width: 0; width: 100%; height: 100%; border: 0; outline: 0; }
.history-toolbar select { border: 1.5px solid var(--ink); }
.history-toolbar .button { min-height: 50px; font-size: 9px; box-shadow: 3px 3px 0 var(--lavender); }
.history-list { min-width: 0; display: grid; gap: 14px; }
.history-item { min-width: 0; display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(90px, auto) minmax(72px, auto) minmax(82px, auto); gap: 18px; align-items: center; padding: 20px; background: var(--paper); border: 1.5px solid var(--ink); }
.history-provider { width: 40px; height: 40px; display: grid; place-items: center; border: 1.5px solid var(--ink); background: var(--pink); font-weight: 800; }
.history-main { min-width: 0; }
.history-item h3 { min-width: 0; margin: 0 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.history-item p { margin: 0; color: var(--muted); font: 9px var(--mono); }
.history-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item .state { font: 600 9px var(--mono); text-transform: uppercase; }
.history-item .state::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; background: #ca9c50; border-radius: 50%; }
.history-item .state.ready::before { background: #5c9a5f; }
.history-item .state.failed::before { background: #bd5a55; }
.history-measure small { display: none; }
.history-measure strong { font-weight: 500; }
.history-action { justify-self: end; }
.history-action a, .history-action button { display: inline-flex; align-items: center; gap: 7px; font: 700 9px var(--mono); text-underline-offset: 4px; }
.history-action button { border: 0; background: transparent; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.history-action button[disabled] { opacity: .55; cursor: progress; }
.empty-state { padding: 65px 25px; text-align: center; box-shadow: 6px 6px 0 var(--ink); }
.empty-state > span { display: inline-grid; place-items: center; width: 56px; height: 56px; border: 2px solid var(--ink); background: var(--lavender); font: 24px var(--mono); }
.empty-state h2 { margin: 18px 0 6px; }
.empty-state p { margin: 0; color: var(--muted); }
.health-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 42px; }
.health-card { padding: 28px; min-height: 205px; }
.health-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1.5px solid var(--ink); margin-bottom: 32px; font: 20px var(--mono); }
.health-icon.green { background: var(--green); }.health-icon.lavender { background: var(--lavender); }.health-icon.pink { background: var(--pink); }
.health-card h2 { margin: 0 0 7px; font-size: 26px; }
.health-card > p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.provider-panel { margin-bottom: 42px; padding: 32px; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; padding-bottom: 24px; border-bottom: 1.5px solid var(--ink); }
.panel-heading h2 { margin: 0; font-size: 25px; }
.panel-heading > span { color: var(--muted); font: 9px var(--mono); }
.provider-row { display: grid; grid-template-columns: 1fr 140px 120px; align-items: center; padding: 20px 4px; border-bottom: 1px solid var(--line); }
.provider-row:last-child { border: 0; }
.provider-row strong { font-size: 14px; }
.provider-row span { color: var(--muted); font: 9px var(--mono); }
.provider-row .healthy { color: #47804a; }
.security-card { display: grid; grid-template-columns: 1.5fr 1fr; gap: 60px; padding: 40px; background: var(--ink); color: var(--inverse-text); box-shadow: 8px 8px 0 var(--pink); }
.security-card h2 { font-size: 35px; margin: 0 0 12px; }
.security-card p { color: var(--muted); line-height: 1.7; font-size: 13px; margin: 0; }
.security-list { display: grid; gap: 12px; align-content: center; }
.security-list span { border: 1px solid #54544d; padding: 12px; font: 9px var(--mono); }

footer { max-width: 1240px; margin: 0 auto; min-height: 120px; border-top: 2px solid var(--ink); display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; padding: 0 28px; }
footer > p { text-align: center; font: 500 9px var(--mono); color: var(--muted); letter-spacing: .1em; }
footer > button { justify-self: end; border: 0; background: transparent; font: 600 9px var(--mono); text-decoration: underline; text-underline-offset: 5px; }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 25px; }
.login-card { min-width: 0; width: min(100%, 470px); padding: 45px; }
.brand-large { margin-bottom: 60px; font-size: 24px; }
.brand-large .brand-mark { width: 38px; height: 38px; }
.login-card h1 { margin: 8px 0 18px; font-size: 50px; letter-spacing: -.06em; line-height: .95; }
.login-card > .muted { font-size: 14px; margin-bottom: 32px; }
.field-label { display: block; margin-bottom: 8px; font: 500 9px var(--mono); letter-spacing: .1em; }
.login-input { width: 100%; height: 52px; margin-bottom: 20px; border: 2px solid var(--ink); border-radius: 0; outline: 0; padding: 0 16px; background: var(--surface); color: var(--ink); }
.password-row { height: 56px; border: 2px solid var(--ink); display: flex; background: var(--surface); }
.password-row input { background: transparent; color: var(--ink); }
.password-row input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0 16px; }
.icon-button { width: 54px; border: 0; border-left: 1px solid var(--line); background: transparent; }
.icon-button svg { width: 20px; }
.form-error { min-height: 19px; color: #a53b36; font-size: 11px; }
.login-card .button { margin-top: 5px; }
.secure-note { margin-top: 30px; text-align: center; color: var(--muted); font: 9px var(--mono); }
.secure-note .status-dot { width: 6px; height: 6px; margin-right: 6px; }

.profile-layout { display: grid; grid-template-columns: minmax(300px, .75fr) minmax(0, 1.25fr); gap: 28px; align-items: start; }
.profile-form, .profile-panel { min-width: 0; padding: 30px; }
.profile-form { display: grid; gap: 19px; }
.profile-form .panel-heading { margin-bottom: 4px; }
.profile-form label { color: var(--muted); font: 500 8px var(--mono); letter-spacing: .09em; }
.profile-form input { width: 100%; height: 48px; margin-top: 8px; border: 1.5px solid var(--ink); border-radius: 0; outline: 0; padding: 0 13px; background: var(--surface); color: var(--ink); font: 14px var(--font); }
.profile-form input:focus { box-shadow: 3px 3px 0 var(--pink); }
.profile-form-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.profile-form .form-error { margin: -8px 0; }
.profile-list { display: grid; }
.profile-row { min-width: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px 15px; align-items: center; padding: 20px 2px; border-bottom: 1px solid var(--line); }
.profile-row:last-child { border-bottom: 0; }
.profile-disabled { opacity: .58; }
.profile-avatar { width: 42px; height: 42px; display: grid; place-items: center; grid-row: 1 / span 2; border: 1.5px solid var(--ink); background: var(--pink); font-weight: 800; }
.profile-identity { min-width: 0; }
.profile-identity h3 { margin: 0 0 4px; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.profile-identity p { margin: 0; color: var(--muted); font: 8px var(--mono); }
.profile-state { font: 600 8px var(--mono); }
.profile-state::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #bd5a55; }
.profile-state.active::before { background: #5c9a5f; }
.profile-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 7px; }
.profile-actions button, .owner-badge { min-height: 34px; padding: 0 10px; border: 1px solid var(--ink); background: var(--surface); color: var(--ink); font: 600 7px var(--mono); }
.owner-badge { display: inline-flex; align-items: center; background: var(--green); }
.profile-actions .danger-action { border-color: #bd5a55; color: #bd5a55; }

@media (max-width: 850px) {
  .desktop-nav, .privacy-pill { display: none; }
  .topbar { height: calc(70px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
  .mobile-menu { margin-left: auto; display: grid; place-items: center; width: 42px; height: 42px; border: 1.5px solid var(--ink); background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
  .mobile-menu svg { width: 22px; }
  .mobile-drawer { position: fixed; inset: calc(70px + env(safe-area-inset-top)) 0 auto; z-index: 9; background: var(--ink); padding: 16px max(20px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); transform: translateY(-130%); visibility: hidden; pointer-events: none; transition: transform .25s, visibility 0s .25s; display: grid; box-shadow: 0 8px 0 var(--pink); }
  .mobile-drawer.open { transform: translateY(0); visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .mobile-drawer a, .mobile-drawer button { min-height: 52px; color: var(--inverse-text); text-align: left; text-decoration: none; border: 0; border-bottom: 1px solid rgba(127,127,120,.4); background: transparent; padding: 16px 4px; font: 600 12px var(--mono); }
  .mobile-drawer .drawer-theme { display: flex; align-items: center; justify-content: space-between; }
  .mobile-drawer .drawer-theme strong { color: var(--pink); font: 600 10px var(--mono); text-transform: uppercase; }
  main { padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); }
  .hero { min-height: auto; padding: 62px 8px 55px; grid-template-columns: 1fr; gap: 42px; border: 0; }
  .hero h1 { font-size: clamp(68px, 24vw, 105px); }
  .hero-copy { padding: 0; }
  .hero-copy > p { font-size: 16px; }
  .input-card, .batch-card, .result-card, .job-card, .loading-card { margin: 0 4px 70px; }
  .input-card { padding: 48px 20px 28px; }
  .input-card { margin-bottom: 20px; }
  .batch-card { padding: 42px 20px 24px; }
  .batch-heading { display: block; }
  .batch-toggle { width: 100%; margin-top: 20px; }
  .batch-options { grid-template-columns: 1fr; }
  .batch-form textarea { min-height: 180px; font-size: 16px; }
  .batch-item { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .batch-item-progress { grid-column: 2 / -1; width: 100%; }
  .batch-actions { gap: 16px; }
  .input-heading { display: block; }
  .route-indicator { display: inline-block; margin-top: 14px; }
  .url-shell { height: auto; min-height: 62px; flex-wrap: wrap; }
  .link-icon { margin-left: 14px; }
  .url-shell input { height: 60px; width: calc(100% - 55px); flex: none; font-size: 16px; }
  .paste-button { width: 100%; height: 43px; border-left: 0; border-top: 1.5px solid var(--ink); }
  .clear-button { position: absolute; right: 22px; height: 60px; border: 0; }
  .input-meta { flex-wrap: wrap; gap: 8px 15px; }
  .advanced summary { min-height: 54px; }
  .advanced-grid { grid-template-columns: 1fr; }
  .button-code { display: none; }
  .error-banner { margin: -42px 4px 65px; }
  .loading-card { padding: 28px 20px; }
  .result-card { padding: 18px; padding-top: 50px; }
  .result-grid { grid-template-columns: 1fr; gap: 22px; }
  .media-preview { min-height: 205px; }
  .media-details { min-height: 320px; }
  .media-stats { margin-top: 32px; }
  .segment-control { grid-template-columns: 1fr; }
  .segment-control button { min-height: 54px; border-left: 0; border-top: 1.5px solid var(--ink); }
  .segment-control button:first-child { border-top: 0; }
  .quality-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-button { min-height: 72px; }
  .toggle-grid { grid-template-columns: 1fr; }
  .download-summary { position: static; margin: 28px -10px -10px; padding: 18px 14px max(18px, env(safe-area-inset-bottom)); grid-template-columns: 1fr 1fr; border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
  .download-summary .button { min-width: 0; grid-column: 1/-1; }
  .job-card { padding: 30px 20px; }
  .job-top h2 { font-size: 23px; }
  .job-percent { font-size: 33px; }
  .ready-actions { flex-direction: column; align-items: stretch; }
  .ready-actions .button { min-height: 64px; }
  .ready-actions > span { max-width: none; text-align: center; }
  .promise-strip { margin: 0 4px 75px; grid-template-columns: 1fr; }
  .promise-strip > div { border-left: 0; border-top: 1px solid var(--line); }
  .page-view { padding: 55px 4px 80px; }
  .page-header { grid-template-columns: 1fr; gap: 35px; margin-bottom: 48px; }
  .page-header h1 { font-size: clamp(65px, 21vw, 95px); }
  .history-toolbar { grid-template-columns: 1fr; }
  .history-toolbar select { min-height: 50px; padding: 0 38px 0 12px; background-color: var(--surface); }
  .history-item { grid-template-columns: 40px minmax(0, 1fr); gap: 10px 14px; align-items: start; padding: 18px; }
  .history-provider { grid-column: 1; grid-row: 1 / span 2; }
  .history-main { grid-column: 2; }
  .history-item h3 { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
  .history-meta { white-space: normal; line-height: 1.55; }
  .history-item .state { grid-column: 2; }
  .history-measure { grid-column: 2; display: flex; align-items: baseline; gap: 9px; }
  .history-measure small { display: inline; color: var(--muted); font: 7px var(--mono); letter-spacing: .08em; }
  .history-measure strong { color: var(--ink); font-size: 10px; }
  .history-action { grid-column: 1 / -1; width: 100%; justify-self: stretch; margin-top: 5px; }
  .history-action a, .history-action button { display: flex; width: 100%; min-height: 44px; justify-content: space-between; padding: 0 13px; border: 1.5px solid var(--ink); background: var(--pink); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); text-decoration: none; }
  .health-grid { grid-template-columns: 1fr; }
  .provider-row { grid-template-columns: 1fr auto; gap: 8px; }
  .provider-row span:nth-child(2) { display: none; }
  .security-card { grid-template-columns: 1fr; gap: 35px; padding: 28px; }
  .profile-layout { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr auto; padding: 35px max(20px, env(safe-area-inset-right)) max(35px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); gap: 30px; }
  footer > p { display: none; }
}

@media (max-width: 480px) {
  :root { --shadow: 5px 5px 0 var(--ink); }
  .brand { font-size: 18px; }
  .brand-mark { width: 29px; height: 29px; }
  .hero { padding-top: 48px; gap: 34px; }
  .hero h1 { font-size: clamp(62px, 22vw, 88px); }
  .hero-copy > p { margin-bottom: 26px; }
  .input-heading h2, .loading-card h2 { font-size: 24px; }
  .input-card { padding-inline: 16px; }
  .batch-card { padding-inline: 16px; }
  .batch-status-head > strong { font-size: 25px; }
  .batch-item { padding-inline: 9px; gap: 9px; }
  .input-meta { gap: 7px 10px; }
  .input-meta span { font-size: 8px; }
  .result-card { padding-inline: 14px; }
  .media-preview { min-height: 185px; }
  .media-details { min-height: 0; padding-bottom: 10px; }
  .media-stats { margin-bottom: 24px; }
  .media-stats span { padding-left: 10px; }
  .media-stats strong { font-size: 11px; }
  .config-section { padding: 25px 0; }
  .section-title { align-items: flex-start; }
  .section-title .native-only { font-size: 7px; }
  .toggle-row, .select-row { min-height: 72px; }
  .download-summary strong { font-size: 12px; }
  .download-summary small { font-size: 7px; }
  .download-summary .button { min-height: 62px; }
  .job-card { padding-inline: 16px; }
  .job-top { gap: 12px; }
  .job-top h2 { font-size: 20px; }
  .page-header > p { font-size: 15px; }
  .history-item { padding: 15px 12px; gap: 10px 12px; }
  .provider-panel { padding: 22px 18px; }
  .profile-form, .profile-panel { padding: 22px 18px; }
  .profile-row { grid-template-columns: 42px minmax(0, 1fr); }
  .profile-state { grid-column: 2; }
  .profile-actions { grid-column: 1 / -1; }
  .profile-actions button { min-height: 44px; flex: 1 1 120px; }
  .panel-heading h2 { font-size: 21px; }
  .login-view { min-height: 100dvh; padding: 78px 14px max(22px, env(safe-area-inset-bottom)); }
  .login-card { padding: 36px 22px; }
  .brand-large { margin-bottom: 48px; }
  .login-card h1 { font-size: 43px; }
  .login-theme-toggle { top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
