/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0b1120;
  --bg2:       #111827;
  --surface:   #1a2540;
  --surface2:  #1e2d4a;
  --border:    #2a3f5f;
  --primary:   #c9a84c;
  --primary-h: #b8943e;
  --primary-glow: rgba(201,168,76,.25);
  --success:   #10b981;
  --danger:    #ef4444;
  --warn-bg:   #1f1700;
  --warn-border:#92400e;
  --text:      #e2e8f0;
  --muted:     #7a90b0;
  --radius:    14px;
  --shadow:    0 8px 40px rgba(0,0,0,.45);
  --gold:      #c9a84c;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  direction: rtl;
}

/* ===== Top Nav Bar ===== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,17,32,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.topnav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topnav-logo {
  font-size: 1.15rem;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo-img {
  height: 36px;
  width: auto;
  display: block;
}
.hero-logo {
  height: 210px;
  width: auto;
  margin: 0 auto 4px;
  display: block;
}
.hero-brand {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: .04em;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.hero-brand-sub {
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .18em;
  color: var(--muted);
}
.topnav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== Hero Section ===== */
.hero {
  text-align: center;
  padding: 10px 24px 8px;
  background: radial-gradient(ellipse at 50% 0%, rgba(201,168,76,.12) 0%, transparent 70%);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(201,168,76,.15);
  border: 1px solid rgba(201,168,76,.3);
  color: var(--gold);
  font-size: .78rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 99px;
  margin-bottom: 20px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 16px;
}
.hero h1 span { color: var(--gold); }
.hero-sub {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto 32px;
}

/* ===== Layout ===== */
.container { max-width: 760px; margin: 0 auto; padding: 0 20px 64px; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 0 20px 64px; }

header { text-align: center; margin-bottom: 32px; }
header h1 { font-size: 2rem; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.subtitle { color: var(--muted); font-size: .95rem; line-height: 1.5; }

main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== Banner ===== */
.banner { border-radius: 8px; padding: 12px 16px; font-size: .9rem; line-height: 1.5; }
.banner.warning { background: var(--warn-bg); border: 1px solid var(--warn-border); color: #fbbf24; }

/* ===== Drop Zone ===== */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.02);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--gold);
  background: rgba(201,168,76,.06);
}
.drop-icon { font-size: 3rem; line-height: 1; }
.drop-text { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.drop-sub  { color: var(--muted); font-size: .85rem; }
.drop-limit{ color: var(--muted); font-size: .78rem; margin-top: 4px; }

/* ===== File List ===== */
.file-list { display: flex; flex-direction: column; gap: 10px; }

.file-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface2);
  transition: border-color .2s;
}
.file-item.status-done  { border-color: #065f46; background: rgba(5,150,105,.08); }
.file-item.status-error { border-color: #991b1b; background: rgba(239,68,68,.08); }

/* File item top row */
.fi-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fi-icon { font-size: 1.3rem; flex-shrink: 0; }
.fi-info { flex: 1; min-width: 0; }
.fi-name {
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  color: var(--text);
}
.fi-meta { font-size: .78rem; color: var(--muted); }

.fi-badge {
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}
.fi-badge.queued    { background: rgba(122,144,176,.15); color: var(--muted); }
.fi-badge.processing{ background: rgba(201,168,76,.15);  color: var(--gold); }
.fi-badge.done      { background: rgba(16,185,129,.15);  color: var(--success); }
.fi-badge.error     { background: rgba(239,68,68,.15);   color: var(--danger); }

.btn-remove {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: .95rem; padding: 3px 7px;
  border-radius: 50%; transition: background .15s; flex-shrink: 0;
}
.btn-remove:hover { background: rgba(239,68,68,.15); color: var(--danger); }

/* Progress row */
.fi-progress {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), #e8c76d);
  border-radius: 99px;
  transition: width .4s ease;
}
.progress-bar.indeterminate {
  animation: indeterminate 1.5s infinite ease-in-out;
}
@keyframes indeterminate {
  0%   { margin-right: 100%; width: 0%; }
  50%  { margin-right: 0%;   width: 70%; }
  100% { margin-right: 0%;   width: 100%; }
}
.fi-pct { font-size: .78rem; color: var(--muted); min-width: 32px; text-align: left; }

/* Download action row */
.fi-actions { margin-top: 10px; display: flex; justify-content: flex-end; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--gold);
  color: #0b1120;
  width: 100%;
  font-size: 1.05rem;
  padding: 14px;
  box-shadow: 0 2px 20px var(--primary-glow);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-h);
  box-shadow: 0 4px 28px rgba(201,168,76,.4);
}
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

.btn-secondary {
  background: rgba(255,255,255,.07);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,.12); border-color: #3d5577; }

.btn-download {
  background: var(--success);
  color: #fff;
  padding: 13px 32px;
  font-size: 1.05rem;
  box-shadow: 0 2px 16px rgba(16,185,129,.3);
}
.btn-download:hover { background: #059669; }

.btn-sm { padding: 8px 18px; font-size: .88rem; border-radius: 8px; }
.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.btn-outline:hover { background: var(--primary-glow); }

/* ===== Error area ===== */
.error-area { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.error-icon    { font-size: 2.5rem; }
.error-message { color: var(--danger); font-size: .95rem; line-height: 1.5; }

/* ===== Batch actions ===== */
.batch-area {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ===== Nav (old inline nav, kept for compat) ===== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}
.nav h1 { font-size: 1.6rem; margin-bottom: 0; color: var(--gold); }
.nav-auth { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-credits {
  font-size: .82rem; font-weight: 600;
  background: rgba(201,168,76,.15); color: var(--gold);
  padding: 4px 10px; border-radius: 99px;
  border: 1px solid rgba(201,168,76,.25);
  display: flex; align-items: center; gap: 4px;
}
.nav-credits-icon { font-size: 1rem; line-height: 1; }
.nav-account-icon { display: none; }
@media (max-width: 600px) {
  .nav-account-text { display: none; }
  .nav-account-icon { display: inline; font-size: 1.1rem; }
  .nav-account-btn  { padding: 6px 10px; }
}
.logo-link { text-decoration: none; color: inherit; }

/* ===== Auth Card ===== */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  max-width: 440px;
  margin: 0 auto;
}
.auth-title    { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; color: #fff; }
.auth-subtitle { color: var(--muted); font-size: .9rem; margin-bottom: 24px; }
.auth-error {
  background: rgba(239,68,68,.12); color: #fca5a5;
  border: 1px solid rgba(239,68,68,.3);
  border-radius: 8px; padding: 10px 14px;
  font-size: .88rem; margin-bottom: 16px;
}
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .88rem; font-weight: 600; color: var(--muted); }
.form-group input {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: .95rem;
  color: var(--text);
  transition: border-color .2s; outline: none;
  direction: ltr; text-align: right;
}
.form-group input::placeholder { color: #4a6080; }
.form-group input:focus { border-color: var(--gold); background: rgba(255,255,255,.07); }
.form-row { display: flex; align-items: center; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: .88rem; cursor: pointer; color: var(--muted); }
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--gold); }
.auth-footer { text-align: center; margin-top: 20px; font-size: .88rem; color: var(--muted); }
.auth-footer a { color: var(--gold); font-weight: 600; text-decoration: none; }
.auth-success {
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.3);
  color: #6ee7b7;
  padding: 12px 16px; border-radius: 8px;
  margin-bottom: 16px; font-size: .9rem;
}
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0; color: var(--muted); font-size: .85rem;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px;
  background: var(--border);
}
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: rgba(255,255,255,.05); color: var(--text);
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.btn-google:hover { background: rgba(255,255,255,.09); border-color: #3d5577; }

/* ===== Account Card ===== */
.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}
.account-profile { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.avatar-placeholder {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--primary-h));
  color: #0b1120;
  font-size: 1.5rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.profile-name  { font-weight: 700; font-size: 1.05rem; color: #fff; }
.profile-email { font-size: .85rem; color: var(--muted); }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.section-title { font-size: 1rem; font-weight: 700; margin-bottom: 14px; color: var(--gold); }

.credits-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.credit-box {
  flex: 1; min-width: 100px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; text-align: center;
  background: var(--surface2);
  display: flex; flex-direction: column; gap: 4px;
}
.credit-box.paid  { border-color: rgba(16,185,129,.3); background: rgba(16,185,129,.06); }
.credit-box.total { border-color: rgba(201,168,76,.3); background: rgba(201,168,76,.06); }
.credit-number { font-size: 1.8rem; font-weight: 700; color: #fff; }
.credit-label  { font-size: .8rem; font-weight: 600; color: var(--muted); }
.credit-sub    { font-size: .72rem; color: var(--muted); }

.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
}
.history-item.fail { background: rgba(239,68,68,.06); border-color: rgba(239,68,68,.25); }
.hi-icon { font-size: 1.1rem; flex-shrink: 0; }
.hi-info { flex: 1; min-width: 0; }
.hi-name { font-size: .88rem; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.hi-meta { font-size: .75rem; color: var(--muted); }
.empty-history { color: var(--muted); font-size: .9rem; text-align: center; padding: 20px 0; }
.account-actions { display: flex; justify-content: flex-end; }

/* ===== Nav link ===== */
.nav-link {
  font-size: .88rem; font-weight: 600;
  color: var(--muted); text-decoration: none;
  padding: 6px 10px; border-radius: 8px;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--gold); background: rgba(201,168,76,.08); }

/* ===== Pricing ===== */
.pricing-hero { text-align: center; margin: 8px 0 32px; }
.pricing-title    { font-size: 1.6rem; font-weight: 700; margin-bottom: 8px; color: #fff; }
.pricing-subtitle { color: var(--muted); font-size: .95rem; }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  transition: box-shadow .2s, border-color .2s;
}
.plan-card:hover { box-shadow: var(--shadow); border-color: #3d5577; }
.plan-card.popular {
  border-color: var(--gold);
  box-shadow: 0 4px 30px rgba(201,168,76,.2);
}

.popular-badge {
  position: absolute;
  top: -13px;
  right: 50%;
  transform: translateX(50%);
  background: var(--gold);
  color: #0b1120;
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 99px;
  white-space: nowrap;
}

.plan-header { display: flex; flex-direction: column; gap: 6px; }
.plan-name    { font-size: 1rem; font-weight: 700; color: #fff; }
.plan-price   { display: flex; align-items: baseline; gap: 4px; }
.price-amount { font-size: 2rem; font-weight: 800; color: var(--gold); }
.price-period { font-size: .82rem; color: var(--muted); }
.plan-desc    { font-size: .82rem; color: var(--muted); }

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.plan-features li { font-size: .87rem; color: var(--text); }

/* Pricing FAQ */
.pricing-faq { margin-bottom: 40px; }
.pricing-faq-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; color: var(--gold); text-align: center; }
.pfaq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.pfaq-item {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 16px;
}
.pfaq-item strong { font-size: .9rem; display: block; margin-bottom: 6px; color: #fff; }
.pfaq-item p      { font-size: .83rem; color: var(--muted); line-height: 1.6; }

/* ===== Privacy Badge ===== */
.privacy-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16,185,129,.07);
  border: 1px solid rgba(16,185,129,.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .84rem;
  color: #6ee7b7;
  line-height: 1.5;
}
.privacy-icon { font-size: 1rem; flex-shrink: 0; }
.privacy-badge strong { font-weight: 700; }

/* ===== FAQ ===== */
.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-top: 24px;
}
.faq-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 16px;
}
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; }

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 16px 0;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  direction: rtl;
  transition: color .15s;
}
.faq-question:hover { color: var(--gold); }

.faq-arrow {
  font-size: 1.3rem;
  color: var(--muted);
  transition: transform .2s ease;
  flex-shrink: 0;
  line-height: 1;
}
.faq-item.open .faq-arrow { transform: rotate(90deg); color: var(--gold); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease, padding .25s ease;
}
.faq-item.open .faq-answer {
  max-height: 200px;
  padding-bottom: 16px;
}
.faq-answer p {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.7;
}
.faq-answer strong { color: var(--text); font-weight: 600; }

/* ===== Features Strip ===== */
.features-strip {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 8px 0 28px;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  color: var(--muted);
}
.feature-item span:first-child { font-size: 1.1rem; }
.feature-item strong { color: var(--text); font-weight: 600; }

/* ===== Privacy Footer ===== */
.privacy-footer {
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  padding: 24px 16px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* ===== Utilities ===== */
.hidden { display: none !important; }

/* ===== Page wrapper (replaces old body padding) ===== */
.page-wrap { padding: 0 0 48px; }

/* ===== Admin ===== */
.admin-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: right; font-size: .88rem; }
th { background: var(--surface2); color: var(--gold); font-weight: 700; border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid rgba(42,63,95,.5); color: var(--text); }
tr:hover td { background: rgba(255,255,255,.02); }

/* ===== Audio Format Selector ===== */
.audio-format-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.format-label {
  font-size: .88rem;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}
.format-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.format-btn {
  background: #f3f4f6;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 16px;
  font-size: .88rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all .15s;
}
.format-btn:hover { border-color: var(--gold); color: #1f2937; }
.format-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #0b1120;
}

/* ===== Image Preview ===== */
.fi-thumb {
  width: 44px; height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #e5e7eb;
}
.merge-toggle-wrap {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 14px;
}
.merge-toggle-label {
  display: flex; align-items: center; gap: 10px;
  font-size: .88rem; color: #166534; cursor: pointer; font-weight: 600;
}
.merge-toggle-label input { accent-color: var(--gold); width: 16px; height: 16px; }

/* ===== PDF Warning Box ===== */
.pdf-warning-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .84rem;
  color: #92400e;
  line-height: 1.5;
}

/* ===== Conversion Tabs ===== */
.conv-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 0 0 24px;
  border-bottom: none;
}
.conv-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #f3f4f6;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 10px 6px;
  font-size: .82rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}
.conv-tab:hover { background: #e9eaec; color: #374151; }
.conv-tab.active {
  background: #fef9ec;
  border-color: var(--gold);
  color: var(--gold);
}
.tab-short { display: none; }
.tab-icon  { display: block; font-size: 1.4rem; }

/* Mobile tabs — 3-column grid */
@media (max-width: 600px) {
  .conv-tabs {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 16px;
  }
  .conv-tab {
    padding: 8px 4px;
    font-size: .72rem;
    border-radius: 10px;
  }
  .tab-full  { display: none; }
  .tab-short { display: inline; }
}
.conv-panel { display: flex; flex-direction: column; gap: 16px; }

/* ===== PDF Tools ===== */
.pdftool-modes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pdftool-mode-btn {
  flex: 1 1 auto;
  padding: 10px 18px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  font-size: .9rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.pdftool-mode-btn:hover  { border-color: var(--gold); color: var(--gold); }
.pdftool-mode-btn.active { border-color: var(--gold); background: #fef9ec; color: var(--gold); }

.pdftool-section { display: flex; flex-direction: column; gap: 14px; }

/* Split options */
.split-options { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.split-radio   { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: #374151; cursor: pointer; }
.split-radio input { accent-color: var(--gold); width: 16px; height: 16px; }
.split-range   { display: flex; align-items: center; gap: 8px; padding: 6px 0 0 24px; flex-wrap: wrap; }
.split-num-input  { width: 64px; padding: 5px 8px; border: 1px solid #d1d5db; border-radius: 7px; font-size: .9rem; text-align: center; }
.split-text-input { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 7px; font-size: .9rem; width: 200px; }
.split-page-info  { font-size: .8rem; color: #9ca3af; }
.split-download-links { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }

/* Compress levels */
.compress-levels {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.compress-lvl-btn {
  flex: 1 1 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 10px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: .9rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all .15s;
}
.compress-lvl-btn span { font-size: .75rem; font-weight: 400; color: #9ca3af; }
.compress-lvl-btn:hover  { border-color: var(--gold); }
.compress-lvl-btn.active { border-color: var(--gold); background: #fef9ec; color: var(--gold); }
.compress-lvl-btn.active span { color: var(--gold); }

.compress-size-info {
  padding: 10px 14px;
  background: #f0fdf4;
  border-radius: 8px;
  font-size: .88rem;
  color: #166534;
}

/* ── Merge cards ── */
.merge-hint {
  font-size: .82rem;
  color: #9ca3af;
  text-align: center;
  padding: 2px 0 4px;
}
.merge-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.merge-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: grab;
  transition: border-color .15s, box-shadow .15s;
  user-select: none;
}
.merge-card:active  { cursor: grabbing; }
.merge-card.dragging { opacity: .4; }
.merge-card.drag-over { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.2); }
.merge-card-thumb {
  width: 56px;
  min-width: 56px;
  height: 76px;
  border-radius: 6px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.merge-card-thumb canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.merge-card-thumb .thumb-placeholder { font-size: 1.8rem; }
.merge-card-info { flex: 1; min-width: 0; }
.merge-card-name { font-size: .88rem; font-weight: 600; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.merge-card-meta { font-size: .76rem; color: #9ca3af; margin-top: 2px; }
.merge-card-order { font-size: 1.1rem; font-weight: 700; color: var(--gold); min-width: 24px; text-align: center; }
.merge-card-remove { background: none; border: none; color: #d1d5db; font-size: 1rem; cursor: pointer; padding: 4px; border-radius: 6px; }
.merge-card-remove:hover { color: #ef4444; background: #fee2e2; }
.merge-drag-handle { color: #d1d5db; font-size: 1.1rem; cursor: grab; }

/* ── Split page grid ── */
.split-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: #6b7280;
  font-size: .9rem;
}
.split-spinner {
  width: 20px; height: 20px;
  border: 2px solid #e5e7eb;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.split-pages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px 2px;
}
.split-page-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  border-radius: 8px;
  padding: 6px 4px;
  border: 2px solid transparent;
  transition: border-color .15s, background .15s;
}
.split-page-card:hover { background: #fef9ec; }
.split-page-card.in-range { background: #fef9ec; border-color: var(--gold); }
.split-page-card.selected { background: #fef9ec; border-color: var(--gold); }
.split-page-card.selected .split-page-num::after { content: " ✓"; }
.split-page-canvas {
  width: 100%;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  display: block;
  background: #fff;
}
.split-page-num {
  font-size: .72rem;
  color: #6b7280;
  font-weight: 600;
}
.split-more-pages {
  grid-column: 1 / -1;
  text-align: center;
  font-size: .8rem;
  color: #9ca3af;
  padding: 6px;
}
.split-hint-text { font-size: .75rem; color: #9ca3af; margin-right: 6px; }
.split-no-preview {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 1rem;
  color: #6b7280;
  padding: 20px;
  background: #f9fafb;
  border-radius: 10px;
}

/* ── Compress file info ── */
.compress-file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .88rem;
}
.compress-file-name { color: #374151; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.compress-orig-size { color: var(--gold); font-weight: 700; white-space: nowrap; }
.compress-lvl-btn small { font-size: .72rem; color: #6b7280; margin-top: 2px; display: block; }
.compress-lvl-btn.active small { color: var(--gold); }

/* ── Compress size bar ── */
.compress-size-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f9fafb;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: .85rem;
}
.compress-bar-row { display: flex; align-items: center; gap: 10px; }
.compress-bar-label { width: 50px; color: #6b7280; font-size: .78rem; flex-shrink: 0; text-align: left; }
.compress-bar-track { flex: 1; height: 10px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.compress-bar-fill  { height: 100%; border-radius: 99px; transition: width .5s ease; }
.compress-bar-fill.before { background: #9ca3af; }
.compress-bar-fill.after  { background: #22c55e; }
.compress-bar-size  { width: 70px; font-size: .78rem; color: #374151; font-weight: 600; text-align: left; }

@media (max-width: 600px) {
  .split-pages-grid { grid-template-columns: repeat(3, 1fr); max-height: 300px; }
  .merge-card-thumb { width: 44px; min-width: 44px; height: 60px; }
  .compress-bar-label { width: 36px; }
  .compress-bar-size  { width: 56px; }
}

/* ===== Light Section ===== */
.light-section {
  background: #fff;
}
.light-section .features-strip {
  border-color: #e5e7eb;
}
.light-section .feature-item {
  color: #6b7280;
}
.light-section .feature-item strong {
  color: #111827;
}
.light-section main {
  background: #fff;
  border-color: #e5e7eb;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.light-section .drop-zone {
  border-color: #d1d5db;
  background: #f9fafb;
}
.light-section .drop-zone:hover,
.light-section .drop-zone.dragover {
  border-color: var(--gold);
  background: rgba(201,168,76,.06);
}
.light-section .drop-text { color: #111827; }
.light-section .drop-sub  { color: #6b7280; }
.light-section .drop-limit{ color: #9ca3af; }
.light-section .file-item {
  background: #f9fafb;
  border-color: #e5e7eb;
}
.light-section .file-item.status-done  { background: rgba(5,150,105,.06); border-color: #6ee7b7; }
.light-section .file-item.status-error { background: rgba(239,68,68,.06); border-color: #fca5a5; }
.light-section .fi-name { color: #111827; }
.light-section .fi-meta { color: #6b7280; }
.light-section .progress-bar-track { background: rgba(0,0,0,.08); }
.light-section .btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}
.light-section .btn-secondary:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}
.light-section .faq {
  background: #fff;
  border-color: #e5e7eb;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.light-section .faq-item     { border-color: #e5e7eb; }
.light-section .faq-title    { color: var(--gold); }
.light-section .faq-question { color: #111827; }
.light-section .faq-answer p { color: #6b7280; }
.light-section .faq-answer strong { color: #374151; }
.light-section .faq-arrow    { color: #9ca3af; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
  main { padding: 24px 16px; }
  .hero h1 { font-size: 1.8rem; }
  .auth-card { padding: 28px 20px; }
  .features-strip { gap: 18px; }
  .topnav { padding: 0 16px; }
}
