/* Theme tokens (from the provided shadcn theme), ported to plain CSS. */
@font-face { font-family: Poppins; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/poppins-400.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/poppins-600.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/poppins-700.woff2) format("woff2"); }

:root {
  --background: hsl(0 0% 100%);
  --foreground: hsl(0 0% 3.9216%);
  --card: hsl(0 0% 100%);
  --card-foreground: hsl(0 0% 3.9216%);
  --primary: hsl(47.1937 100% 49.6078%);
  /* The theme's light-mode primary-foreground is near-white, which is unreadable on yellow;
     the dark-mode value (deep brown) is used in both modes for legible buttons. */
  --primary-foreground: hsl(26.6667 88.7324% 13.9216%);
  --secondary: hsl(195.7647 100% 50%);
  --secondary-foreground: hsl(204 100% 97.0588%);
  --muted: hsl(0 0% 96.0784%);
  --muted-foreground: hsl(0 0% 45.098%);
  --accent: hsl(0 0% 96.0784%);
  --accent-foreground: hsl(0 0% 9.0196%);
  --destructive: hsl(357.1429 100% 45.2941%);
  --destructive-foreground: hsl(0 0% 100%);
  --border: hsl(0 0% 89.8039%);
  --input: hsl(0 0% 89.8039%);
  --ring: hsl(0 0% 63.1373%);
  --font-sans: Poppins, ui-sans-serif, sans-serif, system-ui;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 0.625rem;
  --shadow-sm: 3px 3px 3px 0px hsl(0 0% 0% / 0.1), 3px 1px 2px -1px hsl(0 0% 0% / 0.1);
  --shadow-md: 3px 3px 3px 0px hsl(0 0% 0% / 0.1), 3px 2px 4px -1px hsl(0 0% 0% / 0.1);
  --shadow-lg: 3px 3px 3px 0px hsl(0 0% 0% / 0.1), 3px 4px 6px -1px hsl(0 0% 0% / 0.1);
  color-scheme: light;
}

.dark {
  --background: hsl(0 0% 3.9216%);
  --foreground: hsl(0 0% 98.0392%);
  --card: hsl(0 0% 9.0196%);
  --card-foreground: hsl(0 0% 98.0392%);
  --primary: hsl(51.3901 100% 56.2745%);
  --primary-foreground: hsl(26.6667 88.7324% 13.9216%);
  --secondary: hsl(198.5612 100% 72.7451%);
  --secondary-foreground: hsl(203.4783 87.3418% 15.4902%);
  --muted: hsl(0 0% 14.902%);
  --muted-foreground: hsl(0 0% 63.1373%);
  --accent: hsl(0 0% 25.098%);
  --accent-foreground: hsl(0 0% 98.0392%);
  --destructive: hsl(358.8387 100% 69.6078%);
  --destructive-foreground: hsl(0 0% 98.0392%);
  --border: hsl(0 0% 15.6863%);
  --input: hsl(0 0% 20.3922%);
  --ring: hsl(0 0% 45.098%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; border-color: var(--border); }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--ring) 60%, transparent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; text-decoration: none; }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: var(--primary-foreground); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.logo b { color: var(--muted-foreground); font-weight: 600; }
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: var(--radius); color: var(--foreground); width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; }
.theme-toggle:hover { background: var(--accent); }
.theme-toggle .sun { display: none; }
.dark .theme-toggle .sun { display: block; }
.dark .theme-toggle .moon { display: none; }

/* Hero */
.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: clamp(28px, 6vw, 44px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.02em; }
.hero h1 mark { background: none; color: inherit; box-shadow: inset 0 -0.38em 0 var(--primary); }
.hero p { color: var(--muted-foreground); margin: 0 auto; max-width: 620px; font-size: 17px; }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; padding: 0; list-style: none; }
.badges li { font-size: 13px; padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted-foreground); }

/* Tool card */
.tool { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px); box-shadow: var(--shadow-lg); padding: 20px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; min-height: 230px; border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.is-over { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.drop-icon { width: 56px; height: 56px; border-radius: 14px; background: color-mix(in srgb, var(--primary) 18%, transparent); display: grid; place-items: center; }
.drop strong { font-size: 18px; }
.drop small { color: var(--muted-foreground); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; border-radius: var(--radius); border: 1px solid transparent; padding: 12px 22px; cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.btn-primary:hover { filter: brightness(1.04); }
.btn-outline { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn-outline:hover { background: var(--accent); }
.btn-lg { width: 100%; padding: 15px 22px; font-size: 17px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.file-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--muted); border-radius: var(--radius); margin-bottom: 18px; }
.file-row .meta { min-width: 0; flex: 1; }
.file-row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .info { font-size: 13px; color: var(--muted-foreground); }
.link-btn { background: none; border: 0; color: var(--muted-foreground); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; padding: 4px; }

.field { margin-bottom: 18px; }
.field .label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 15px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--muted); padding: 4px; border-radius: var(--radius); margin-bottom: 14px; }
.seg button { font: inherit; font-weight: 600; font-size: 14px; border: 0; border-radius: calc(var(--radius) - 3px); padding: 9px; background: transparent; color: var(--muted-foreground); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 14px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 16%, transparent); font-weight: 600; }
.chip small { color: var(--muted-foreground); font-weight: 400; }
.custom-size { display: inline-flex; align-items: center; gap: 6px; }
.custom-size input { width: 84px; font: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid var(--input); border-radius: var(--radius); background: var(--background); color: var(--foreground); }
select { font: inherit; font-size: 15px; width: 100%; padding: 10px 12px; border: 1px solid var(--input); border-radius: var(--radius); background: var(--background); color: var(--foreground); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; padding-bottom: 10px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.estimate { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius); margin-bottom: 14px; }
.estimate .lbl { font-size: 13px; color: var(--muted-foreground); }
.estimate strong { font-size: 20px; margin: 0 6px 0 8px; }
.estimate .saving { font-size: 13px; padding: 2px 10px; }
.estimate .saving:empty { display: none; }
.estimate .hint { flex-basis: 100%; margin: 0; }
/* Social Bar: sandboxed frame, bottom-right */
.socialbar { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: min(360px, calc(100vw - 32px)); height: 140px; pointer-events: none; }
.socialbar iframe { border: 0; width: 100%; height: 100%; background: transparent; pointer-events: auto; }
.socialbar button { position: absolute; top: -10px; right: -4px; z-index: 1; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); background: var(--background); color: var(--muted-foreground); cursor: pointer; pointer-events: auto; font-size: 14px; line-height: 1; display: grid; place-items: center; }
.hint { font-size: 13px; color: var(--muted-foreground); margin: 8px 0 0; }
.warn { font-size: 14px; color: var(--destructive); margin: 10px 0 0; }

.progress-wrap { text-align: center; padding: 10px 0; }
.progress { height: 12px; background: var(--muted); border-radius: 999px; overflow: hidden; margin: 14px 0 10px; }
.progress > div { height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .3s; }
.progress-wrap .pct { font-size: 32px; font-weight: 700; }
.progress-wrap .eta { color: var(--muted-foreground); font-size: 14px; }

.result-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; text-align: center; margin-bottom: 16px; }
.result-head .size { font-size: 22px; font-weight: 700; }
.result-head .lbl { font-size: 13px; color: var(--muted-foreground); }
.saving { display: inline-block; background: var(--secondary); color: var(--secondary-foreground); font-weight: 700; padding: 4px 12px; border-radius: 999px; font-size: 14px; }
.result video { width: 100%; max-height: 360px; background: #000; border-radius: var(--radius); margin-bottom: 16px; }
.result .actions { display: grid; gap: 10px; }

.alert { padding: 14px 16px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--destructive) 40%, transparent); background: color-mix(in srgb, var(--destructive) 8%, transparent); margin-bottom: 14px; font-size: 15px; }

.privacy-note { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 13px; color: var(--muted-foreground); margin: 14px 0 0; text-align: center; }

/* Ads */
.ad { display: flex; flex-direction: column; align-items: center; margin: 22px auto; }
.ad-label { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 6px; }
.ad iframe { border: 0; display: block; max-width: 100%; }
/* 160x600 side rails: only on screens wide enough to leave the content untouched. */
.rail { position: fixed; top: 88px; z-index: 5; display: flex; flex-direction: column; align-items: center; }
.rail iframe { border: 0; display: block; }
.rail-left { left: calc(50% - 460px - 196px); }
.rail-right { right: calc(50% - 460px - 196px); }
@media (max-width: 1359px) { .rail { display: none !important; } }

/* Content */
.content { padding: 36px 0 10px; }
.content h2 { font-size: clamp(22px, 4vw, 28px); line-height: 1.25; margin: 44px 0 14px; letter-spacing: -0.01em; }
.content h3 { font-size: 18px; margin: 26px 0 8px; }
.content p, .content li { color: color-mix(in srgb, var(--foreground) 82%, var(--muted-foreground)); }
.content ul, .content ol { padding-left: 22px; }
.content li { margin-bottom: 6px; }
.steps { list-style: none; padding: 0 !important; display: grid; gap: 12px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 0; }
.steps li::before { content: counter(step); width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: var(--primary-foreground); font-weight: 700; display: grid; place-items: center; }
.steps strong { display: block; color: var(--foreground); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cards > div { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--card); }
.cards h3 { margin-top: 0; }
.cards p { margin: 0; font-size: 15px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 10px 0; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { background: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }

.faq details { border: 1px solid var(--border); border-radius: var(--radius); padding: 0 16px; margin-bottom: 8px; background: var(--card); }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--muted-foreground); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 14px; }

.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; padding: 0; list-style: none; }
.related a { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: 15px; background: var(--card); }
.related a:hover { border-color: var(--primary); }

.breadcrumb { font-size: 13px; color: var(--muted-foreground); padding-top: 16px; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 56px; padding: 28px 0 40px; font-size: 14px; color: var(--muted-foreground); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--foreground); }
.site-footer button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.site-footer button:hover { text-decoration: underline; color: var(--foreground); }

/* Consent banner */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 560px; margin: 0 auto; background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow-lg); padding: 16px; }
.consent p { margin: 0 0 12px; font-size: 14px; }
.consent .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.consent .btn { padding: 10px 14px; }

.legal { padding: 30px 0; }
.legal h1 { font-size: 32px; }

[hidden] { display: none !important; }

@media (max-width: 560px) {
  .tool { padding: 14px; }
  .row2 { grid-template-columns: 1fr; }
  .hero { padding-top: 28px; }
  .result-head .size { font-size: 18px; }
}
