@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/onest-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/onest-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/onest-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/onest-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg-page: #F5F6F8;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F2F4F7;
  --bg-soft-blue: #EAF0FF;
  --bg-drag-over: #EBF0FF;
  --bg-soft-red: #FDECEC;
  --bg-soft-green: #E7F8EF;
  --border: #E4E7EC;
  --border-strong: #D0D5DD;
  --text-primary: #0E1525;
  --text-secondary: #475467;
  --text-muted: #98A2B3;
  --brand: #1D4ED8;
  --brand-hover: #1E40AF;
  --danger: #E5484D;
  --success: #12B76A;
  --amber: #F5B544;
  --shadow-card: 0px 8px 24px rgba(15, 23, 41, 0.06), 0px 1px 2px rgba(15, 23, 41, 0.04);
  --shadow-tab: 0px 1px 3px rgba(13, 20, 38, 0.10);
  --shadow-float: 0px 16px 40px rgba(15, 23, 41, 0.14);
  --shadow-page: 0px 8px 24px rgba(15, 23, 41, 0.08);
  --font-sans: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg-page: #0B111E;
  --bg-surface: #121A2B;
  --bg-subtle: #1B253B;
  --bg-soft-blue: #18294D;
  --bg-drag-over: #1D315C;
  --bg-soft-red: #3A1B22;
  --bg-soft-green: #143627;
  --border: #23304A;
  --border-strong: #324364;
  --text-primary: #F2F5FA;
  --text-secondary: #B4C0D3;
  --text-muted: #7C8BA3;
  --brand: #3B82F6;
  --brand-hover: #2563EB;
  --danger: #F87171;
  --success: #34D399;
  --shadow-card: 0px 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-tab: 0px 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-float: 0px 16px 40px rgba(0, 0, 0, 0.55);
  --shadow-page: 0px 8px 24px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

a { color: inherit; text-decoration: none; }

.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.muted-meta { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.full-w { width: 100%; justify-content: center; }

.icon-12 { width: 12px; height: 12px; flex-shrink: 0; }
.icon-13 { width: 13px; height: 13px; flex-shrink: 0; }
.icon-14 { width: 14px; height: 14px; flex-shrink: 0; }
.icon-16 { width: 16px; height: 16px; flex-shrink: 0; }
.icon-17 { width: 17px; height: 17px; flex-shrink: 0; }
.icon-18 { width: 18px; height: 18px; flex-shrink: 0; }
.icon-20 { width: 20px; height: 20px; flex-shrink: 0; }
.icon-28 { width: 28px; height: 28px; flex-shrink: 0; }

/* Header */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
  flex-shrink: 0;
}

.brand-svg {
  width: 22px;
  height: 22px;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-domain {
  font-weight: 500;
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-muted);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-soft-blue);
  color: var(--brand);
  font-weight: 600;
}

.nav-external {
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--text-primary);
  font-weight: 500;
}

.nav-external:hover {
  border-color: var(--brand);
  background: var(--bg-soft-blue);
  color: var(--brand);
}

.nav-external .ext-arrow {
  color: var(--text-muted);
}

.nav-external:hover .ext-arrow {
  color: var(--brand);
}

.mobile-ext-link {
  color: var(--brand);
  font-weight: 600;
}

.header-spacer { flex: 1; min-width: 8px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-menu-wrap,
.auth-icon-wrap { position: relative; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

.lang-btn:hover { background: var(--bg-subtle); }

.lang-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 176px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-float);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 60;
}

.lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.lang-option:hover { background: var(--bg-subtle); }
.lang-option.active { color: var(--brand); font-weight: 600; background: var(--bg-soft-blue); }
.lang-option.muted { color: var(--danger); }
.lang-check { color: var(--brand); }

.auth-avatar-btn {
  background: var(--bg-soft-blue);
  border-color: rgba(29, 78, 216, 0.25);
  color: var(--brand);
  font-weight: 700;
  font-size: 14px;
}

.auth-user-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  font-size: 13px;
}

.popover-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.mini-pill {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-soft-blue);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
}

.icon-square-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.icon-square-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.mobile-only { display: none; }

.mobile-drawer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 10px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-nav-link {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

.mobile-nav-link:hover { background: var(--bg-subtle); }

/* Main Container */
.container {
  max-width: 1248px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Segmented Tabs (Component Tab / Script) */
.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--bg-subtle);
  border-radius: 12px;
}

.seg-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s;
}

.seg-label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-secondary);
}

.seg-hint {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-muted);
}

.seg-tab.active {
  background: var(--bg-surface);
  box-shadow: var(--shadow-tab);
}

.seg-tab.active .seg-label {
  font-weight: 600;
  color: var(--text-primary);
}

.seg-tab.active .seg-hint {
  color: var(--brand);
}

/* Section 1: Converter */
.converter-section {
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.script-bar {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.script-group {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.source-group { padding: 12px 16px; }
.target-group { padding: 12px 16px 12px 24px; }

.swap-circle {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: 0px 2px 6px rgba(15, 23, 41, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  z-index: 2;
  transition: transform 0.15s, color 0.15s, border-color 0.15s;
}

.swap-circle:hover {
  color: var(--brand);
  border-color: var(--brand);
  transform: rotate(180deg);
}

.editors-grid {
  display: flex;
  align-items: stretch;
  min-height: 320px;
}

.editor-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 28px 20px;
  gap: 12px;
  position: relative;
}

.output-pane {
  background: var(--bg-page);
}

.editor-divider {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
}

.mobile-tabs-wrap,
.mobile-swap-row,
.mobile-pane-footer,
.mobile-options-wrap,
.mobile-file-upload {
  display: none;
}

.editor-input-stage,
.editor-output-stage {
  position: relative;
  flex: 1;
  min-height: 215px;
}

.editor-backdrop,
.editor-textarea {
  width: 100%;
  margin: 0;
  padding: 0 36px 4px 0;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  background: transparent;
  overflow: hidden;
}

.editor-backdrop {
  position: relative;
  min-height: 215px;
  pointer-events: none;
  color: var(--text-primary);
  z-index: 1;
}

.output-pane .editor-backdrop {
  padding-right: 0;
  color: var(--text-primary);
  user-select: none;
}

.editor-textarea {
  position: absolute;
  inset: 0;
  height: 100%;
  z-index: 2;
  color: transparent;
  caret-color: var(--text-primary);
}

.editor-textarea::placeholder {
  color: var(--text-muted);
}

.editor-textarea::selection {
  background: rgba(29, 78, 216, 0.18);
}

.output-textarea {
  color: transparent;
  caret-color: transparent;
  padding-right: 0;
}

.diff-char {
  color: var(--brand);
  text-shadow: 0 0 0.35px currentColor;
}

.diff-src-char {
  color: var(--danger);
  text-shadow: 0 0 0.35px currentColor;
}

.spell-err {
  text-decoration: underline;
  text-decoration-color: var(--danger);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.clear-x-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
}

.clear-x-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

/* Inline Spelling Bar */
.inline-spell-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px 8px 10px;
  background: var(--bg-soft-red);
  border-radius: 12px;
  z-index: 3;
}

.spell-bar-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.inline-spell-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.spell-fix-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  border: none;
  background: var(--bg-surface);
  cursor: pointer;
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(15, 23, 41, 0.05);
  transition: transform 0.1s, box-shadow 0.15s;
}

.spell-fix-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15, 23, 41, 0.1);
}

.spell-fix-chip del {
  color: var(--text-muted);
  text-decoration: line-through;
}

.spell-fix-chip .chip-arrow {
  color: var(--text-muted);
  font-size: 11px;
}

.spell-fix-chip strong {
  color: var(--success);
  font-weight: 600;
}

.inline-fix-btn {
  border: none;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}

.inline-fix-btn:hover { text-decoration: underline; }

/* Inline Word Correction Popover */
.word-suggest-popover {
  position: fixed;
  z-index: 90;
  min-width: 220px;
  max-width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-float);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.word-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 6px;
  border-bottom: 1px solid var(--border);
}

.word-pop-bad {
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
  text-decoration: underline wavy var(--danger);
  text-underline-offset: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-pop-close {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.word-pop-close:hover { background: var(--bg-subtle); color: var(--text-primary); }

.word-pop-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.word-pop-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.word-pop-item:hover {
  background: var(--bg-subtle);
}

.word-pop-item.is-primary {
  background: var(--bg-soft-blue);
  color: var(--brand);
  border-color: rgba(29, 78, 216, 0.18);
}

.word-pop-item.is-primary:hover {
  background: var(--bg-drag-over);
}

.word-pop-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
}

.word-pop-empty {
  padding: 6px 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.word-pop-foot {
  padding-top: 6px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.word-pop-dict-btn {
  border: none;
  background: transparent;
  padding: 4px 6px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.word-pop-dict-btn:hover {
  background: var(--bg-subtle);
  color: var(--brand);
}

/* Editor Footer */
.editor-footer {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--border);
}

.footer-half {
  flex: 1;
  min-width: 0;
  padding: 10px 16px 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.counter-group {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}

.counter-group strong {
  font-weight: 600;
  color: var(--text-primary);
}

.footer-spacer { flex: 1; }

.limit-counter {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.v-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
}

.ghost-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 8px 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.ghost-action-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 14px;
  border-radius: 10px;
  border: none;
  background: var(--brand);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--brand-hover); }

.btn-primary-sm {
  padding: 8px 14px;
  border-radius: 9px;
  border: none;
  background: var(--brand);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-outline:hover { background: var(--bg-subtle); }

.btn-outline-sm {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost-sm {
  padding: 7px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Detailed Spellcheck Drawer */
.spell-drawer {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.spell-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.spell-drawer-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.spell-drawer-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.pill-badge {
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--bg-soft-blue);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}

.spell-drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spell-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-soft-green);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}

.ok-icon { color: var(--success); }

.spell-issues-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.spell-issue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-page);
}

.spell-issue-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 220px;
}

.spell-issue-word {
  font-weight: 600;
  font-size: 14px;
  color: var(--danger);
}

.spell-issue-word.is-2026 { color: var(--brand); }

.spell-issue-ctx {
  font-size: 12px;
  color: var(--text-secondary);
}

.spell-issue-ctx mark {
  background: var(--bg-soft-red);
  color: var(--danger);
  padding: 0 3px;
  border-radius: 4px;
}

.spell-issue-suggs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sugg-pill-btn {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sugg-pill-btn.primary {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--bg-soft-blue);
}

/* Section 2: Files (Variant C+) */
.files-section {
  padding-top: 72px;
  padding-bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.files-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.files-toolbar {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.file-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 330px;
  min-width: 0;
}

.file-badge-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.file-badge-box.is-empty {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.file-badge-box.is-ready {
  background: var(--bg-soft-blue);
  color: var(--brand);
}

.file-badge-box.is-error {
  background: var(--bg-soft-red);
  color: var(--danger);
}

.file-ext-text {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.file-done-dot {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--success);
  border: 2px solid var(--bg-surface);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-done-dot svg { width: 10px; height: 10px; }

.file-slot-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.file-slot-copy strong {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-slot-copy strong.is-muted { color: var(--text-muted); }

.file-slot-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.file-slot-sub.is-loading { color: var(--brand); font-weight: 600; }
.file-slot-sub.is-error { color: var(--danger); font-weight: 500; }

.remove-file-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.remove-file-btn:hover { background: var(--bg-subtle); color: var(--text-primary); }

.file-target-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.target-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.file-actions-slot {
  width: 330px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.split-download-wrap { position: relative; }

.split-download {
  display: inline-flex;
  gap: 1px;
  background: var(--bg-surface);
  border-radius: 10px;
  overflow: hidden;
  transition: opacity 0.15s;
}

.split-download.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.split-main-btn,
.split-format-btn {
  border: none;
  background: var(--brand);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.split-main-btn {
  padding: 11px 14px 11px 16px;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.split-format-btn {
  padding: 11px 10px 11px 12px;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}

.split-main-btn:hover,
.split-format-btn:hover,
.split-format-btn.open {
  background: var(--brand-hover);
}

/* Format Dropdown Menu (State 5) */
.format-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-float);
  padding: 8px 6px 6px;
  z-index: 50;
}

.format-menu-head {
  padding: 0 0 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.format-menu-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.format-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px 9px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.format-item-btn:hover,
.format-item-btn.active {
  background: var(--bg-page);
}

.format-item-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.format-item-badge.is-docx { background: var(--bg-soft-blue); color: var(--brand); }
.format-item-badge.is-pdf { background: var(--bg-soft-red); color: var(--danger); }
.format-item-badge.is-xlsx { background: var(--bg-soft-green); color: var(--success); }

.format-item-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.format-item-copy strong { font-size: 14px; font-weight: 600; }
.format-item-copy span { font-size: 12px; color: var(--text-muted); }

.format-item-check { color: var(--brand); }

.format-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.format-menu-copy {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 8px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.format-menu-copy:hover { background: var(--bg-page); }

/* Files Body (540px) */
.files-body {
  height: 540px;
  position: relative;
}

.file-dropzone {
  margin: 24px;
  height: calc(100% - 48px);
  border-radius: 18px;
  background: var(--bg-soft-blue);
  border: 1.5px dashed var(--brand);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  cursor: pointer;
  transition: background 0.15s, border-style 0.15s, border-width 0.15s;
}

.file-dropzone.drag-over {
  background: var(--bg-drag-over);
  border-style: solid;
  border-width: 2px;
}

.doc-stack-illustration {
  width: 220px;
  height: 120px;
  position: relative;
}

.mini-doc {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(15, 23, 41, 0.10);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-pdf {
  width: 84px;
  height: 98px;
  left: 24px;
  top: 14px;
  transform: rotate(-8deg);
}

.doc-txt {
  width: 84px;
  height: 98px;
  left: 112px;
  top: 14px;
  transform: rotate(8deg);
}

.doc-docx {
  width: 72px;
  height: 90px;
  left: 74px;
  top: 6px;
  z-index: 2;
}

.mini-tag {
  align-self: flex-start;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.tag-pdf { background: var(--bg-soft-red); color: var(--danger); }
.tag-txt { background: var(--bg-subtle); color: var(--text-secondary); }
.tag-docx { background: var(--bg-soft-blue); color: var(--brand); }

.mini-line {
  height: 4px;
  border-radius: 2px;
  background: var(--bg-subtle);
}

.mini-line.w1, .mini-line.w2, .mini-line.w3 { width: 100%; }
.mini-line.w4 { width: 60%; }

.upload-badge-circle {
  position: absolute;
  left: 128px;
  top: 74px;
  width: 34px;
  height: 34px;
  border-radius: 17px;
  background: var(--brand);
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(15, 23, 41, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.file-dropzone h3 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-align: center;
}

.file-dropzone.drag-over h3 { color: var(--brand); }

.file-dropzone p {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
}

.dropzone-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
}

.or-divider span {
  width: 80px;
  height: 1px;
  background: var(--border-strong);
}

.or-divider em {
  font-style: normal;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.primary-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px 14px 24px;
  border-radius: 12px;
  border: none;
  background: var(--brand);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(15, 23, 41, 0.18);
  cursor: pointer;
}

.primary-cta-btn:hover { background: var(--brand-hover); }

.paste-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-muted);
}

.paste-hint kbd {
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
}

.format-badges-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding-top: 4px;
}

.format-badges-row span {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Preview Area (States 3 & 4) */
.preview-area {
  height: 100%;
  background: var(--bg-subtle);
  padding: 24px 32px 0;
  display: flex;
  align-items: stretch;
  gap: 24px;
  position: relative;
}

.preview-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-col-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.script-pill {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.script-pill.is-accent {
  background: var(--bg-soft-blue);
  color: var(--brand);
}

.diff-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.diff-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--brand);
  display: inline-block;
}

.a4-page {
  flex: 1;
  background: var(--bg-surface);
  border-radius: 6px 6px 4px 4px;
  box-shadow: var(--shadow-page);
  padding: 36px 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-primary);
}

.a4-page.zoom-75 { font-size: 10.5px; padding: 28px 32px; }
.a4-page.zoom-125 { font-size: 15.5px; padding: 42px 48px; }

.a4-page p {
  margin: 0;
  text-align: justify;
  white-space: pre-wrap;
  word-break: break-word;
}

.a4-page p.is-h1 {
  font-size: 1.2em;
  font-weight: 700;
  text-align: center;
}

.a4-page p.is-h2 {
  font-size: 1.05em;
  font-weight: 600;
  text-align: center;
}

.diff-hl {
  color: var(--brand);
  font-weight: 600;
}

.sync-scroll-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: var(--shadow-tab);
}

.sync-scroll-btn.active {
  color: var(--brand);
  border-color: var(--brand);
}

/* Skeleton lines for State 3 */
.skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sk-line {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-subtle);
}

.sk-line.title { height: 11px; width: 65%; align-self: center; }
.sk-line.sub { height: 10px; width: 50%; align-self: center; }
.sk-line.full { width: 100%; }
.sk-line.med { width: 78%; }
.sk-line.short { width: 45%; }

/* State 3 Floating Progress Card */
.progress-floating-card {
  position: absolute;
  right: 52px;
  top: 132px;
  width: 380px;
  max-width: calc(100% - 48px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-float);
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 15;
}

.progress-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.spin-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--bg-soft-blue);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.progress-pct {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand);
}

.progress-bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
  transition: width 0.25s ease;
}

.progress-stages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.stage-dot {
  width: 20px;
  height: 20px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stage-row.done .stage-dot {
  background: var(--bg-soft-green);
  border-color: var(--bg-soft-green);
  color: var(--success);
}

.stage-row.done .stage-dot::after { content: '✓'; font-size: 11px; font-weight: 700; }

.stage-row.active .stage-dot {
  background: var(--bg-soft-blue);
  border-color: var(--brand);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

.stage-row.pending .stage-name { color: var(--text-muted); }
.stage-row.active .stage-name { font-weight: 600; }
.stage-meta { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.stage-row.active .stage-meta { color: var(--brand); }

.progress-card-foot {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.cancel-red-btn {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* State 7 Error View */
.file-error-view {
  height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.error-circle-icon {
  width: 64px;
  height: 64px;
  border-radius: 32px;
  background: var(--bg-soft-red);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-error-view h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.error-reason {
  margin: 0;
  max-width: 460px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.error-cta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.other-reasons-box {
  width: 460px;
  max-width: 100%;
  background: var(--bg-page);
  border-radius: 12px;
  padding: 14px 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.other-reasons-box strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.other-reasons-box ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* State 6 Toast */
.download-toast {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: #0E1525;
  color: #FFFFFF;
  border-radius: 14px;
  padding: 12px 16px 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 41, 0.25);
  z-index: 30;
}

.toast-check {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: var(--success);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.toast-copy strong { font-size: 14px; font-weight: 600; }
.toast-copy span { font-size: 12px; color: #98A2B3; }

.toast-sep {
  width: 1px;
  height: 28px;
  background: #475467;
}

.toast-action {
  border: none;
  background: transparent;
  color: #EAF0FF;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.toast-close {
  border: none;
  background: transparent;
  color: #98A2B3;
  cursor: pointer;
  display: inline-flex;
  padding: 4px;
}

/* Files Bottom Bar */
.files-bottom-bar {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  gap: 16px;
  border-top: 1px solid var(--border);
}

.files-bottom-bar.result-bar { padding: 12px 20px; }

.bottom-lock-note,
.bottom-sample-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.sample-link-btn {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
}

.sample-link-btn:hover { text-decoration: underline; }

.muted-link {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-arrow-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.page-arrow-btn:disabled { opacity: 0.4; cursor: default; }

.page-indicator {
  font-size: 13px;
  font-weight: 600;
}

.zoom-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.zoom-btn:hover { background: var(--bg-subtle); }

.result-stats {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.spell-ok-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 20px;
  background: var(--bg-soft-green);
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
}

.spell-ok-pill.has-issues {
  background: var(--bg-soft-red);
  color: var(--danger);
}

/* Section 3: Features */
.features-grid {
  padding: 72px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-soft-blue);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.feature-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1248px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-link-btn {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.footer-link-btn:hover { color: var(--brand); }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 21, 37, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-float);
}

.modal-card.compact { max-width: 520px; }

.modal-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-sub { margin: 4px 0 0; font-size: 13px; color: var(--text-secondary); }

.modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 14px;
  line-height: 1.55;
}

.modal-body pre {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  font-size: 12px;
  overflow-x: auto;
}

.modal-notice {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-soft-blue);
  color: var(--brand);
  font-size: 13px;
  font-weight: 500;
}

.modal-step { display: flex; flex-direction: column; gap: 10px; }
.step-head { display: flex; align-items: center; gap: 8px; }
.step-head h4 { margin: 0; font-size: 15px; font-weight: 600; }

.step-badge {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-soft-blue);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
}

.auth-panel {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-panel p { margin: 0; font-size: 13px; color: var(--text-secondary); }
.auth-panel.is-ok { flex-direction: row; align-items: center; justify-content: space-between; }

.plans-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.plan-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-card.active {
  border-color: var(--brand);
  background: var(--bg-soft-blue);
}

.plan-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}

.plan-card p { margin: 0; font-size: 12px; color: var(--text-secondary); }

.provider-row {
  display: flex;
  gap: 8px;
}

.provider-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.provider-btn.active {
  border-color: var(--brand);
  background: var(--bg-soft-blue);
  color: var(--brand);
}

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-foot-btns { display: flex; gap: 8px; }

/* Responsive Tablet & Mobile (390px) */
@media (max-width: 1120px) {
  .header-inner { gap: 16px; }
  .nav-item { padding: 7px 9px; font-size: 13px; }
}

@media (max-width: 980px) {
  .files-toolbar { flex-wrap: wrap; }
  .file-slot, .file-actions-slot { width: auto; flex: 1; }
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .header-inner { height: 60px; padding: 0 16px; gap: 10px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .brand-svg { width: 19px; height: 19px; }
  .brand-name { font-size: 19px; }
  .brand-domain, .header-nav, .lang-menu-wrap, #themeToggle { display: none; }
  .mobile-only { display: inline-flex; }

  .container { padding: 0 16px; }
  .converter-section { padding-top: 16px; }

  .script-bar, .editor-footer, .editor-divider { display: none; }

  .editors-grid { flex-direction: column; min-height: 0; }
  .editor-pane { padding: 14px 14px 12px; }

  .mobile-tabs-wrap { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .mobile-tabs-wrap .segmented { width: max-content; }
  .mobile-tabs-wrap .seg-tab { padding: 8px 12px; }

  .editor-input-stage, .editor-output-stage { min-height: 150px; }
  .editor-backdrop { min-height: 150px; }
  .editor-backdrop, .editor-textarea { font-size: 17px; line-height: 1.6; padding-right: 0; }
  .clear-x-btn { display: none; }

  .mobile-swap-row {
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 12px;
    background: linear-gradient(to bottom, var(--bg-surface) 50%, var(--bg-page) 50%);
  }

  .swap-line { flex: 1; height: 1px; background: var(--border); }

  .mobile-swap-circle {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    border: none;
    background: var(--amber);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }

  .mobile-pane-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
  }

  .mobile-counts {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
  }

  .mobile-spell-link {
    border: none;
    background: transparent;
    padding: 0;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--danger);
    cursor: pointer;
  }

  .mobile-footer-btns {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-options-wrap {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
  }

  .mobile-options-btn {
    width: 100%;
    padding: 12px 14px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
  }

  .mobile-options-body {
    padding: 0 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .files-section { padding-top: 24px; padding-bottom: 32px; gap: 10px; }
  .section-header h2 { font-size: 20px; }

  .files-card.is-idle { display: none; }
  .mobile-file-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-radius: 16px;
    background: var(--bg-soft-blue);
    border: 1.5px dashed var(--brand);
    color: var(--brand);
    text-align: center;
  }

  .mobile-file-upload.hidden-mobile { display: none; }
  .mobile-file-upload strong { color: var(--text-primary); font-size: 16px; }
  .mobile-file-upload span { color: var(--text-secondary); font-size: 12px; }

  .files-body { height: auto; min-height: 420px; }
  .preview-area { flex-direction: column; padding: 16px; }
  .sync-scroll-btn { display: none; }
  .a4-page { max-height: 280px; padding: 20px; }
  .progress-floating-card { position: static; width: 100%; margin-top: 12px; }

  .features-grid { grid-template-columns: 1fr; padding: 32px 0; }
  .plans-grid { grid-template-columns: 1fr; }
}
