/* =====================================================================
   Emmak Player — Design System
   Brand: red #D20000, black #000000, white #FFFFFF, neutral greys.
   Mobile-first, no external frameworks, no external fonts.
   ===================================================================== */

:root {
  --red: #D20000;
  --red-dark: #A80000;
  --red-soft: #FDECEC;
  --black: #000000;
  --ink: #141414;
  --ink-2: #3A3A3A;
  --muted: #6B7280;
  --line: #E5E7EB;
  --line-2: #D1D5DB;
  --bg: #FFFFFF;
  --bg-soft: #F7F7F8;
  --bg-softer: #F1F2F4;
  --card: #FFFFFF;
  --ok: #0E7A3C;
  --ok-soft: #E8F6EE;
  --warn: #9A5B00;
  --warn-soft: #FCF3E3;
  --err: #B40000;
  --err-soft: #FCE9E9;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.06);
  --shadow-2: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-3: 0 12px 32px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: 1200px;
  --header-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
main { flex: 1 0 auto; width: 100%; }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(210,0,0,.4); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 1380px; }

.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;
}

/* ------------------------- Typography ------------------------- */
h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.4rem); }
p { margin: 0 0 1em; }
.lead { font-size: 1.125rem; color: var(--ink-2); }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

.section { padding: 56px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 720px; margin: 0 auto 36px; text-align: center; }
.section-head p { color: var(--ink-2); margin: 8px 0 0; }

/* ------------------------- Buttons ------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px;
  border-radius: var(--radius-sm); border: 1.5px solid transparent;
  font: 600 .95rem/1.2 var(--font); cursor: pointer; text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .05s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--red); color: #fff; box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-dark { background: var(--black); color: #fff; }
.btn-dark:hover { background: #222; color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-outline:hover { border-color: var(--red); color: var(--red); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-softer); color: var(--ink); }
.btn-lg { min-height: 52px; padding: 14px 30px; font-size: 1.05rem; border-radius: var(--radius); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn .spin { display: inline-block; animation: rotate 0.9s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }

/* ------------------------- Header / Navigation ------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 120;
  background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header.is-scrolled { box-shadow: var(--shadow-1); }
.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand img { height: 38px; width: auto; }
.brand-name { font-weight: 900; font-size: 1.15rem; color: var(--ink); letter-spacing: -.02em; }
.brand-name span { color: var(--red); }

.nav-desktop { display: none; align-items: center; gap: 4px; margin-left: auto; }
.nav-desktop > .nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px;
  border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 600; font-size: .95rem;
  text-decoration: none; background: none; border: 0; cursor: pointer; font-family: inherit;
}
.nav-link:hover { color: var(--red); background: var(--bg-softer); text-decoration: none; }
.nav-link[aria-expanded="true"] { color: var(--red); }
.nav-link .caret { width: 10px; height: 10px; }
.dropdown {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%) translateY(6px);
  min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-3); padding: 8px; opacity: 0; visibility: hidden;
  transition: opacity .15s ease, transform .15s ease; z-index: 130;
}
.dropdown.align-left { left: 0; transform: translateY(6px); }
.nav-item:hover > .dropdown, .nav-item:focus-within > .dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-item:hover > .dropdown.align-left, .nav-item:focus-within > .dropdown.align-left { transform: translateY(0); }
.dropdown-grid { display: grid; grid-template-columns: repeat(2, minmax(200px, 1fr)); gap: 2px; min-width: 480px; max-width: min(760px, 88vw); max-height: 70vh; overflow: auto; }
.dropdown a {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .92rem;
}
.dropdown a:hover { background: var(--bg-softer); color: var(--red); text-decoration: none; }
.dropdown a .d { font-size: .78rem; font-weight: 400; color: var(--muted); }
.dropdown .dd-title { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 8px 12px 4px; }
.dropdown .dd-title:first-child { padding-top: 2px; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-desktop ~ .header-actions { margin-left: 16px; }
.header-search { display: none; position: relative; }
.header-search input {
  width: 230px; height: 40px; padding: 0 38px 0 14px; border: 1.5px solid var(--line-2);
  border-radius: 999px; font: .9rem var(--font); background: var(--bg-soft); outline: none;
}
.header-search input:focus { border-color: var(--red); background: #fff; }
.header-search button { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border: 0; background: var(--red); color: #fff; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.header-search .sugg {
  position: absolute; top: calc(100% + 8px); right: 0; width: 320px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-3);
  padding: 6px; display: none; max-height: 60vh; overflow: auto;
}
.header-search .sugg.open { display: block; }
.header-search .sugg a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; }
.header-search .sugg a:hover, .header-search .sugg a.active { background: var(--bg-softer); }

.burger {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer;
}
.burger span { display: block; height: 2.5px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Mobile drawer */
.mobile-nav {
  display: block; position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.42);
  opacity: 0; visibility: hidden; transition: opacity .2s ease;
}
.mobile-nav.open { opacity: 1; visibility: visible; }
.mobile-nav-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(400px, 92vw);
  background: #fff; box-shadow: var(--shadow-3); overflow-y: auto; padding: 18px 18px 40px;
  transform: translateX(100%); transition: transform .25s ease;
}
.mobile-nav.open .mobile-nav-panel { transform: translateX(0); }
.mobile-nav-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mobile-nav-close { width: 44px; height: 44px; border: 0; background: var(--bg-softer); border-radius: 50%; font-size: 1.2rem; cursor: pointer; }
.mobile-search { display: flex; gap: 8px; margin-bottom: 16px; }
.mobile-search input { flex: 1; height: 44px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); font: .95rem var(--font); }
.mnav-group { border-top: 1px solid var(--line); padding: 10px 0; }
.mnav-group > button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; min-height: 44px;
  background: none; border: 0; font: 700 1rem var(--font); color: var(--ink); cursor: pointer; text-align: left;
}
.mnav-group > button .chev { transition: transform .2s ease; }
.mnav-group.open > button .chev { transform: rotate(180deg); }
.mnav-links { display: none; padding: 4px 0 8px; }
.mnav-group.open .mnav-links { display: block; }
.mnav-links a { display: flex; flex-direction: column; padding: 9px 8px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; }
.mnav-links a:hover { background: var(--bg-softer); color: var(--red); }
.mnav-links a small { color: var(--muted); font-weight: 400; }

/* ------------------------- Hero ------------------------- */
.hero { position: relative; overflow: hidden; padding: 64px 0 72px; }
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(210,0,0,.10), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(210,0,0,.06), transparent 55%),
    linear-gradient(180deg, #FFFFFF 0%, #FAFAFB 100%);
}
.hero-grid { position: relative; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  background: var(--red-soft); color: var(--red-dark); border-radius: 999px;
  font-size: .82rem; font-weight: 700; margin-bottom: 18px;
}
.hero h1 { margin-bottom: 16px; }
.hero h1 .accent { color: var(--red); }
.hero p.lead { max-width: 640px; margin-bottom: 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 28px; }
.hero-stats .stat { display: flex; flex-direction: column; }
.hero-stats .stat b { font-size: 1.5rem; font-weight: 900; color: var(--ink); }
.hero-stats .stat span { font-size: .85rem; color: var(--muted); }

/* ------------------------- Cards & grids ------------------------- */
.grid { display: grid; gap: 20px; }
.grid-tools { grid-template-columns: 1fr; }
.tool-card {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  position: relative; overflow: hidden;
}
.tool-card:hover { border-color: rgba(210,0,0,.45); box-shadow: var(--shadow-2); transform: translateY(-2px); text-decoration: none; }
.tool-card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--red); transform: scaleY(0); transform-origin: top; transition: transform .2s ease;
}
.tool-card:hover::after { transform: scaleY(1); }
.tool-icon {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: var(--radius-sm);
  background: var(--red-soft); color: var(--red); display: grid; place-items: center;
}
.tool-icon svg { width: 24px; height: 24px; }
.tool-card h3 { font-size: 1rem; margin: 0 0 3px; font-weight: 700; }
.tool-card p { font-size: .86rem; color: var(--muted); margin: 0; line-height: 1.45; }
.tool-card .badge-new { position: absolute; top: 12px; right: 12px; background: var(--black); color: #fff; font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; letter-spacing: .04em; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card-pad-lg { padding: 32px; }
.card h3:first-child { margin-top: 0; }

/* Category chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; min-height: 40px;
  border-radius: 999px; border: 1.5px solid var(--line-2); background: #fff;
  font-weight: 600; font-size: .9rem; color: var(--ink-2); text-decoration: none;
}
.chip:hover { border-color: var(--red); color: var(--red); text-decoration: none; }
.chip.active { background: var(--red); border-color: var(--red); color: #fff; }
.chip .cnt { background: var(--bg-softer); border-radius: 999px; padding: 0 8px; font-size: .78rem; color: var(--muted); }
.chip.active .cnt { background: rgba(255,255,255,.22); color: #fff; }

/* ------------------------- Forms ------------------------- */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--ink); }
.field { margin-bottom: 18px; }
.field .help { font-size: .8rem; color: var(--muted); margin-top: 5px; }
.field .err { font-size: .8rem; color: var(--err); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border: 1.5px solid var(--line-2); border-radius: var(--radius-sm);
  font: .95rem var(--font); color: var(--ink); background: #fff; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(210,0,0,.12); }
input[type=range] { width: 100%; accent-color: var(--red); min-height: 32px; padding: 0; border: 0; }
input[type=color] { width: 56px; height: 44px; padding: 4px; border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
.checkbox-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.checkbox-row input { width: 20px; height: 20px; accent-color: var(--red); }
.checkbox-row span { font-weight: 500; }

/* ------------------------- Alerts & toasts ------------------------- */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); font-size: .93rem; margin-bottom: 18px; border: 1px solid; }
.alert-error { background: var(--err-soft); color: var(--err); border-color: rgba(180,0,0,.25); }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(14,122,60,.25); }
.alert-info { background: #EDF2FF; color: #1E3A8A; border-color: rgba(30,58,138,.2); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(154,91,0,.25); }

.toast-region { position: fixed; bottom: 18px; right: 18px; z-index: 400; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, 90vw); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius-sm);
  background: var(--ink); color: #fff; box-shadow: var(--shadow-3); font-size: .9rem;
  animation: toast-in .25s ease;
}
.toast.ok { background: #0B5E30; }
.toast.error { background: #8F0000; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------- Tables ------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.table th { text-align: left; padding: 12px 16px; background: var(--bg-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FAFAFB; }

/* ------------------------- Pagination ------------------------- */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 24px; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px;
  padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  font-weight: 600; color: var(--ink-2); text-decoration: none; font-size: .9rem;
}
.pagination a:hover { border-color: var(--red); color: var(--red); text-decoration: none; }
.pagination .current { background: var(--red); border-color: var(--red); color: #fff; }

/* ------------------------- Breadcrumbs ------------------------- */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .85rem; color: var(--muted); margin: 18px 0; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--red); }
.breadcrumbs .sep { opacity: .5; }
.breadcrumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* ------------------------- Footer ------------------------- */
.site-footer { background: var(--black); color: #B9B9B9; margin-top: auto; }
.footer-grid { display: grid; gap: 32px; padding: 52px 0 36px; }
.footer-brand img { height: 34px; filter:invert(1); margin-bottom: 14px; }
.footer-brand p { font-size: .9rem; color: #9A9A9A; max-width: 300px; }
.footer-col h4 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { color: #B9B9B9; font-size: .92rem; text-decoration: none; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-news { display: flex; gap: 8px; margin-top: 10px; }
.footer-news input { flex: 1; min-width: 0; background: #1A1A1A; border: 1px solid #333; color: #fff; border-radius: var(--radius-sm); }
.footer-news input:focus { border-color: var(--red); box-shadow: none; }
.footer-news button { flex-shrink: 0; width: 44px; min-height: 44px; border: 0; border-radius: var(--radius-sm); background: var(--red); color: #fff; cursor: pointer; display: grid; place-items: center; }
.footer-bottom { border-top: 1px solid #222; padding: 18px 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; font-size: .84rem; color: #8A8A8A; }
.footer-bottom a { color: #B9B9B9; }
.kofi-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  background: var(--red); color: #fff; font-weight: 700; font-size: .88rem; text-decoration: none;
}
.kofi-btn:hover { background: var(--red-dark); color: #fff; text-decoration: none; }

/* ------------------------- Tool page ------------------------- */
.tool-hero { background: linear-gradient(180deg, #FBFBFC, #fff); border-bottom: 1px solid var(--line); padding: 34px 0 30px; }
.tool-hero .tool-title-row { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.tool-hero .tool-icon { width: 60px; height: 60px; border-radius: var(--radius); }
.tool-hero .tool-icon svg { width: 32px; height: 32px; }
.tool-hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 0; }
.tool-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tool-meta .tag { background: var(--bg-softer); border-radius: 999px; padding: 4px 12px; font-size: .78rem; font-weight: 600; color: var(--ink-2); }

.tool-shell { max-width: 860px; margin: 32px auto 0; }
.upload-zone {
  border: 2px dashed var(--line-2); border-radius: var(--radius-lg); background: #FCFCFD;
  padding: 44px 24px; text-align: center; transition: border-color .15s ease, background .15s ease; cursor: pointer;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--red); background: var(--red-soft); }
.upload-zone .uz-icon { width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: grid; place-items: center; }
.upload-zone .uz-icon svg { width: 30px; height: 30px; }
.upload-zone h3 { margin-bottom: 6px; }
.upload-zone p { color: var(--muted); font-size: .9rem; margin: 0; }
.upload-zone .formats { margin-top: 12px; font-size: .8rem; color: var(--muted); }

.file-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.file-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.file-row .ficon { width: 38px; height: 38px; border-radius: 8px; background: var(--bg-softer); display: grid; place-items: center; flex-shrink: 0; }
.file-row .fmeta { flex: 1; min-width: 0; }
.file-row .fname { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .fsize { font-size: .78rem; color: var(--muted); }
.file-row .fact { display: flex; gap: 6px; }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--line-2); background: #fff; border-radius: 8px; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { border-color: var(--err); color: var(--err); }
.icon-btn.move { cursor: grab; }

.progress-track { height: 10px; border-radius: 999px; background: var(--bg-softer); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--red), #F14E4E); border-radius: 999px; transition: width .3s ease; min-width: 8%; }
.status-line { display: flex; align-items: center; gap: 10px; font-size: .92rem; color: var(--ink-2); margin: 12px 0; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.status-dot.run { background: var(--red); animation: pulse 1.2s ease infinite; }
.status-dot.ok { background: var(--ok); }
.status-dot.err { background: var(--err); }
@keyframes pulse { 50% { opacity: .35; } }

.result-box { background: var(--ok-soft); border: 1px solid rgba(14,122,60,.3); border-radius: var(--radius); padding: 22px; }
.result-box h3 { color: var(--ok); margin-bottom: 6px; }
.result-files { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.result-file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.result-file .rf-meta { flex: 1; min-width: 0; }
.result-file .rf-name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-file .rf-size { font-size: .78rem; color: var(--muted); }

.options-panel { margin: 20px 0; }
.opt-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.range-val { font-family: var(--mono); font-weight: 700; color: var(--red); }

/* Waveform */
.wave-wrap { background: #14161A; border-radius: var(--radius); padding: 16px; position: relative; }
.wave-canvas { width: 100%; height: 110px; display: block; cursor: crosshair; }
.wave-time { color: #C9CED6; font-family: var(--mono); font-size: .78rem; display: flex; justify-content: space-between; margin-top: 8px; }
.audio-controls { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.audio-controls button.play-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--red); color: #fff; cursor: pointer; display: grid; place-items: center; }

/* Video preview + region select */
.video-preview-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; }
.video-preview-wrap video { width: 100%; display: block; max-height: 420px; }
.region-overlay { position: absolute; inset: 0; cursor: crosshair; }
.region-box { position: absolute; border: 2px solid var(--red); background: rgba(210,0,0,.18); display: none; }

/* Recorder UI */
.rec-dot { width: 12px; height: 12px; background: var(--red); border-radius: 50%; animation: pulse 1s infinite; display: inline-block; margin-right: 8px; }
.rec-timer { font-family: var(--mono); font-weight: 700; }

/* Camera scanner */
.scanner-cam { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; }
.scanner-cam video { width: 100%; display: block; transform: scaleX(-1); }
.scanner-cam .cam-guide { position: absolute; inset: 12%; border: 2px dashed rgba(255,255,255,.5); border-radius: 12px; pointer-events: none; }
.scan-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; margin-top: 14px; }
.scan-shots .shot { position: relative; border-radius: 8px; overflow: hidden; border: 2px solid var(--line); }
.scan-shots .shot img { width: 100%; display: block; }
.scan-shots .shot button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; }

/* ------------------------- FAQ ------------------------- */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.faq-item summary { padding: 16px 20px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .plus { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-softer); display: grid; place-items: center; font-weight: 800; color: var(--red); transition: transform .2s ease; }
.faq-item[open] summary .plus { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 20px 18px; color: var(--ink-2); }

/* ------------------------- Steps ------------------------- */
.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: 1fr; }
.step { display: flex; gap: 16px; }
.step .n { counter-increment: step; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 800; }
.step .n::before { content: counter(step); }

/* ------------------------- Prose (CMS content) ------------------------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 1em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { border-left: 4px solid var(--red); margin: 1.2em 0; padding: .4em 1.2em; background: var(--bg-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose img { border-radius: var(--radius); }
.prose pre { background: var(--ink); color: #F3F4F6; padding: 18px; border-radius: var(--radius-sm); overflow-x: auto; font-size: .88rem; }

/* ------------------------- Skeletons & empty ------------------------- */
.skeleton { background: linear-gradient(90deg, var(--bg-softer) 25%, #E9EAEC 50%, var(--bg-softer) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty-state .eicon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--bg-softer); display: grid; place-items: center; color: var(--line-2); }

/* ------------------------- Utilities ------------------------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 40px; }
.center { text-align: center; }
.hidden { display: none !important; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--bg-softer); color: var(--ink-2); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-err { background: var(--err-soft); color: var(--err); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ------------------------- Back-to-top ------------------------- */
.to-top {
  position: fixed; right: 18px; bottom: 18px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); color: #fff; border: 0; cursor: pointer; display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .2s ease; z-index: 90;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--red); }

/* ------------------------- Responsive ------------------------- */
@media (min-width: 640px) {
  .grid-tools { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .opt-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid-tools { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 88px 0 96px; }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.4fr; }
  .header-search { display: block; }
}
@media (min-width: 1120px) {
  .nav-desktop { display: flex; }
  .burger { display: none; }
  .mobile-nav { display: none; }
  .grid-tools { grid-template-columns: repeat(4, 1fr); }
}

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

/* ------------------------- Print ------------------------- */
@media print {
  .site-header, .site-footer, .to-top, .toast-region, .tool-shell { display: none !important; }
  body { display: block; }
}
