/* ── Left controls panel ─────────────────────────────────────── */
.controls { display: flex; flex-direction: column; }
.controls-section {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
}
.controls-section:last-child { border-bottom: none; }
.controls-header { gap: 6px; }
.controls-header h1 {
  font-size: 20px;
  font-weight: 400;
  margin: 0;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: .01em;
}
.controls-header h1::before {
  content: '\2726';
  color: var(--gold);
  font-size: 14px;
  margin-right: 9px;
  vertical-align: 3px;
  text-shadow: 0 0 9px rgba(238,198,127,.55);
}
.controls-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* ── Drop zone ───────────────────────────────────────────────── */
.drop {
  position: relative;
  border: 1px dashed rgba(238,198,127,0.18);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 18px;
  cursor: pointer;
  background:
    radial-gradient(ellipse 65% 70% at 50% 28%, rgba(238,198,127,.05), transparent 70%),
    var(--gold-light);
  transition: border-color .2s, background .2s;
  gap: 8px;
}
/* scanner-frame corner ticks */
.drop::before {
  content: '';
  position: absolute; inset: 7px;
  pointer-events: none;
  background:
    linear-gradient(var(--gold) 0 0) 0    0    / 15px 2px,
    linear-gradient(var(--gold) 0 0) 0    0    / 2px 15px,
    linear-gradient(var(--gold) 0 0) 100% 0    / 15px 2px,
    linear-gradient(var(--gold) 0 0) 100% 0    / 2px 15px,
    linear-gradient(var(--gold) 0 0) 0    100% / 15px 2px,
    linear-gradient(var(--gold) 0 0) 0    100% / 2px 15px,
    linear-gradient(var(--gold) 0 0) 100% 100% / 15px 2px,
    linear-gradient(var(--gold) 0 0) 100% 100% / 2px 15px;
  background-repeat: no-repeat;
  opacity: .4;
  transition: opacity .25s, inset .25s;
}
.drop:hover, .drop.drag {
  border-color: rgba(238,198,127,0.45);
  background:
    radial-gradient(ellipse 65% 70% at 50% 28%, rgba(238,198,127,.09), transparent 70%),
    rgba(238,198,127,0.1);
}
.drop:hover::before, .drop.drag::before { opacity: 1; inset: 4px; }
.drop input { display: none; }
.drop-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  background: rgba(238,198,127,0.1);
  border: 1px solid var(--gold-border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
  transition: transform .25s, box-shadow .25s;
}
.drop-icon svg { width: 22px; height: 22px; color: var(--gold); }
.drop:hover .drop-icon, .drop.drag .drop-icon {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(238,198,127,.18);
}
.drop:hover .drop-icon svg, .drop.drag .drop-icon svg {
  animation: drop-arrow 1s ease-in-out infinite;
}
@keyframes drop-arrow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2.5px); }
}
.drop-title { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.drop-sub   { font-size: 12px; color: var(--muted); }
.drop-file  { font-size: 13px; font-weight: 500; color: var(--gold); word-break: break-all; }

/* ── Form controls ───────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.modal-box .field + .field { margin-top: 14px; }
.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

select,
textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"] {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--panel-2);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
textarea { resize: vertical; }
select {
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23eec67f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 34px;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s;
}
select:hover { border-color: var(--gold-border); }
select option { background: var(--panel-2); color: var(--ink); }
select:focus,
textarea:focus,
input:focus {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px rgba(238,198,127,0.08);
}

/* ── Buttons ─────────────────────────────────────────────────── */
button {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  color: var(--ink-2);
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.09);
  color: var(--ink);
}
button.primary {
  background: var(--gold);
  color: #050c18;
  border-color: var(--gold);
  font-weight: 600;
  justify-content: center;
  letter-spacing: .02em;
  position: relative;
  overflow: hidden;
  transition: background .18s, border-color .18s, transform .18s, box-shadow .18s;
}
button.primary:hover:not(:disabled) {
  background: var(--gold-h);
  border-color: var(--gold-h);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(238,198,127,.18);
}
button.primary:active:not(:disabled) { transform: translateY(0); }
/* shine sweep on hover */
button.primary::after {
  content: ''; position: absolute; top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
button.primary:hover:not(:disabled)::after { transition: left .55s ease; left: 130%; }
button.full     { width: 100%; }
button.btn-add  { flex-shrink: 0; height: 38px; }
button:disabled { opacity: .35; cursor: not-allowed; }

/* ── Status banner ───────────────────────────────────────────── */
.status {
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.5;
  display: none;
}
.status.info  {
  background: var(--gold-light); border: 1px solid var(--gold-border); color: var(--gold);
  position: relative; overflow: hidden;
}
/* soft gold sheen sweeping across in-progress messages */
.status.info::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 32%, rgba(238,198,127,.13) 50%, transparent 68%);
  background-size: 220% 100%;
  animation: status-sheen 2.4s linear infinite;
  pointer-events: none;
}
@keyframes status-sheen {
  from { background-position: 190% 0; }
  to   { background-position: -90% 0; }
}
.status.error { background: var(--bad-bg);     border: 1px solid var(--bad-border);  color: var(--bad); }
.status.ok    { background: var(--ok-bg);      border: 1px solid var(--ok-border);   color: var(--ok);  }
.status.warn  { background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.3); color: #f59e0b; }

/* ── Doc-type badge ──────────────────────────────────────────── */
.doc-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(238,198,127,0.1);
  border: 1px solid var(--gold-border);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gold);
  margin-top: 10px;
}

/* ── Page cards ──────────────────────────────────────────────── */
.pages { display: flex; flex-direction: column; }
.page-card { border-bottom: 1px solid var(--line); }
.page-card:last-child { border-bottom: none; }
.page-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.page-card-head .page-num { font-weight: 600; color: var(--ink-2); }
.page-card-body { display: grid; grid-template-columns: minmax(200px, 30%) 1fr; }
.scan-col {
  padding: 14px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.scan-col img {
  display: block; width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255,255,255,0.03);
}
.no-scan {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.text-col { padding: 14px; overflow: auto; max-height: 480px; }
.col-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}
pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
}
.translating-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
}
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(238,198,127,0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* rotating script glyphs while a page translates: अ → க → త → A */
.glyph-cycle {
  position: relative;
  width: 18px; height: 18px; flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 15px; line-height: 18px;
  color: var(--gold);
  text-align: center;
}
.glyph-cycle span {
  position: absolute; inset: 0;
  opacity: 0;
  text-shadow: 0 0 10px rgba(238,198,127,.45);
  animation: glyph-turn 3.2s ease-in-out infinite;
}
.glyph-cycle span:nth-child(2) { animation-delay: .8s; }
.glyph-cycle span:nth-child(3) { animation-delay: 1.6s; }
.glyph-cycle span:nth-child(4) { animation-delay: 2.4s; }
@keyframes glyph-turn {
  0%        { opacity: 0; transform: translateY(7px) scale(.75); }
  7%, 20%   { opacity: 1; transform: translateY(0) scale(1); }
  27%, 100% { opacity: 0; transform: translateY(-7px) scale(.75); }
}

/* ── Correction form ─────────────────────────────────────────── */
.corr-form {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.corr-form details summary {
  cursor: pointer;
  font-size: 11.5px;
  color: var(--muted);
  user-select: none;
  font-weight: 500;
}
.corr-form details summary:hover { color: var(--ink-2); }
.corr-form .row { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.corr-form input {
  flex: 1; min-width: 110px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--ink);
  background: rgba(255,255,255,0.04);
  outline: none;
}
.corr-form input:focus { border-color: var(--gold-border); }
.corr-form button.save { font-size: 12px; padding: 7px 11px; }
.corr-saved { font-size: 11.5px; color: var(--ok); display: none; font-weight: 500; }

/* ── Terminology panel ───────────────────────────────────────── */
.term-panel-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  display: flex; align-items: center; gap: 10px;
}
.term-panel-head h3 { margin: 0; font-size: 14px; font-weight: 400; }
.term-panel-head p  { margin: 0; font-size: 12px; color: var(--muted); }
.term-panel-body { padding: 16px 20px; display: grid; gap: 12px; }
.term-list { display: grid; gap: 4px; }
.term-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: rgba(255,255,255,0.02);
}
.term-src  { flex: 1; color: var(--muted); }
.term-arr  { color: var(--muted); font-size: 12px; }
.term-dest { flex: 1; font-weight: 500; }
.no-terms  { font-size: 13px; color: var(--muted); padding: 4px 0; }
.del-btn {
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 16px; padding: 0 4px;
  line-height: 1; transition: color .1s;
}
.del-btn:hover { color: var(--bad); }

/* ── Header right (shared across all pages) ──────────────────── */
.hdr-right { display: flex; align-items: center; gap: 10px; }
.nav-links  { display: flex; align-items: center; gap: 2px; }
.nav-link {
  font-size: 12px; color: var(--muted); padding: 4px 9px;
  border-radius: 5px; text-decoration: none; cursor: pointer;
  transition: color .15s, background .15s; white-space: nowrap;
}
.nav-link:hover  { color: var(--gold); background: var(--gold-light); }
.nav-link.active { color: var(--gold); background: var(--gold-light); }
.nav-sep      { width: 1px; height: 16px; background: var(--line); margin: 0 2px; flex-shrink: 0; }
.nav-username { font-size: 12px; color: var(--muted); white-space: nowrap; }
.btn-hdr {
  padding: 4px 12px; border-radius: 6px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-size: 12px; font-family: inherit; cursor: pointer;
  transition: border-color .15s, color .15s; white-space: nowrap;
  display: inline-flex; align-items: center; text-decoration: none;
}
.btn-hdr:hover { border-color: var(--gold); color: var(--gold); }
.btn-help {
  width: 26px; height: 26px; padding: 0; border-radius: 50%;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  border-color: var(--gold-border); color: var(--gold);
  justify-content: center;
}
.btn-help:hover { background: var(--gold-light); border-color: var(--gold); color: var(--gold); }

/* ── Toggle switch ───────────────────────────────────────────── */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 0; border-top: 1px solid var(--line);
}
.toggle-row .field-label { color: var(--ink); font-size: 12px; }
.toggle-hint {
  display: block; font-size: 11px; color: #8fa4bc;
  margin-top: 2px; font-family: 'Poppins', sans-serif; font-weight: 400;
}
.toggle-switch {
  position: relative; display: inline-block;
  width: 40px; height: 22px; flex-shrink: 0; cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-knob {
  position: absolute; inset: 0; border-radius: 22px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line);
  transition: background .2s, border-color .2s;
}
.toggle-knob::after {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--muted); transition: transform .2s, background .2s;
}
.toggle-switch input:checked + .toggle-knob {
  background: var(--gold-light); border-color: var(--gold-border);
}
.toggle-switch input:checked + .toggle-knob::after {
  transform: translateX(18px); background: var(--gold);
}

/* ── Secondary button ────────────────────────────────────────── */
button.secondary {
  background: transparent;
  color: var(--ink-2);
  border-color: rgba(255,255,255,0.15);
  font-weight: 500;
  justify-content: center;
  letter-spacing: .02em;
}
button.secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.25);
  color: var(--ink);
}
