:root {
  color-scheme: light;
  --ink: #1d302c;
  --muted: #75817c;
  --line: #e3e8e2;
  --paper: #fff;
  --canvas: #f4f5f2;
  --green: #20463d;
  --green-dark: #18372f;
  --lime: #e6f477;
  --soft-green: #eef5ed;
  --shadow: 0 24px 80px rgba(30, 55, 46, .09), 0 3px 12px rgba(30, 55, 46, .04);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(224, 237, 212, .66), transparent 36rem),
    var(--canvas);
  font-size: 15px;
}
button, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(90, 143, 119, .42);
  outline-offset: 3px;
}
.page-shell { width: min(1120px, calc(100% - 56px)); margin: 0 auto; }
.site-header { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(29, 48, 44, .08); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--green); color: var(--lime); font-weight: 800; font-size: 18px; letter-spacing: -.08em; }
.brand-copy { display: grid; gap: 3px; }
.brand-name { font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.brand-caption { color: var(--muted); font-size: 9px; letter-spacing: .16em; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.language-pair-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid #e2e7df; border-radius: 999px; background: rgba(255,255,255,.62); color: #42564d; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.live-dot, .status-dot { width: 7px; height: 7px; display: inline-block; flex: 0 0 7px; border-radius: 50%; background: #6caa71; }
.ui-language-button { min-height: 38px; padding: 0 14px; border: 1px solid #dce4dc; border-radius: 10px; background: rgba(255,255,255,.65); color: var(--green); font-size: 13px; font-weight: 700; cursor: pointer; transition: background .16s, border-color .16s, transform .16s; }
.ui-language-button:hover { background: var(--paper); border-color: #b9c9bd; transform: translateY(-1px); }
.hero { max-width: 720px; margin: 66px auto 34px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 18px; color: #698078; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.eyebrow-line { width: 22px; height: 1px; background: #82a092; }
h1 { margin: 0; color: #1c322c; font-size: clamp(36px, 5.2vw, 60px); line-height: 1.08; letter-spacing: -.055em; font-weight: 700; }
.hero-copy { max-width: 470px; margin: 17px auto 0; color: #6b7972; font-size: 16px; line-height: 1.65; }
.translator-card { padding: 24px; border: 1px solid rgba(34, 69, 58, .08); border-radius: 22px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.language-controls { display: grid; grid-template-columns: minmax(0,1fr) 44px minmax(0,1fr); align-items: end; gap: 16px; margin: 0 0 17px; }
.language-select-wrap { display: grid; gap: 8px; min-width: 0; }
.field-label, .panel-title, .examples-label { color: #819088; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.language-select-wrap select { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfa; color: #31473e; font-weight: 650; cursor: pointer; }
.swap-button { width: 42px; height: 42px; margin-bottom: 2px; border: 1px solid #dce7dd; border-radius: 12px; background: var(--soft-green); color: var(--green); font-size: 21px; cursor: pointer; transition: transform .2s, background .2s; }
.swap-button:hover { transform: rotate(180deg); background: #e3efe2; }
.translation-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.text-panel { min-width: 0; padding: 17px 17px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.source-panel:focus-within, .result-panel:focus-within { border-color: #b8cabe; box-shadow: 0 0 0 3px rgba(104, 156, 126, .08); }
.result-panel { background: #f9fbf8; }
.panel-heading { display: flex; min-height: 24px; align-items: center; justify-content: space-between; gap: 10px; }
.quiet-button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 1px; border: 0; background: transparent; color: #79867f; font-size: 11px; font-weight: 600; cursor: pointer; }
.quiet-button:hover:not(:disabled) { color: var(--green); }
.quiet-button:disabled { color: #b8c0ba; cursor: not-allowed; }
.copy-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
textarea { display: block; width: 100%; min-height: 202px; margin: 12px 0 9px; padding: 5px 0; resize: vertical; border: 0; outline: 0; background: transparent; color: #263b34; font-size: 17px; line-height: 1.7; }
textarea:focus-visible { outline: 0; }
textarea::placeholder { color: #aab4ad; }
#translation-result { color: #334a40; }
.panel-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 20px; color: #9aa49e; font-size: 10px; }
.character-count { font-variant-numeric: tabular-nums; }
.input-hint { text-align: end; }
.result-model { display: inline-flex; align-items: center; gap: 5px; color: #84958b; }
.sparkle { color: #6f9a6e; font-size: 15px; }
.examples-row { display: flex; align-items: center; gap: 14px; margin: 18px 1px 0; }
.examples-label { flex: 0 0 auto; }
.example-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.example-chip { padding: 7px 10px; border: 1px solid #e3e9e3; border-radius: 999px; background: #fbfcfa; color: #63746b; font-size: 11px; cursor: pointer; transition: all .16s; }
.example-chip:hover { border-color: #b8cabd; background: #f2f7f0; color: var(--green); }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding-top: 17px; border-top: 1px solid #edf0eb; }
.status-message { display: flex; align-items: center; gap: 9px; min-height: 20px; margin: 0; color: #819087; font-size: 12px; line-height: 1.5; }
.status-message.is-error { color: #a24e47; }
.status-message.is-error .status-dot { background: #d67a6e; }
.status-message.is-success { color: #4c785c; }
.translate-button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 24px; min-width: 164px; height: 48px; padding: 0 17px; border: 0; border-radius: 11px; background: var(--green); color: #fff; font-size: 13px; font-weight: 750; cursor: pointer; box-shadow: 0 5px 12px rgba(31,70,57,.16); transition: transform .16s, background .16s, box-shadow .16s; }
.translate-button:hover:not(:disabled) { transform: translateY(-1px); background: var(--green-dark); box-shadow: 0 8px 16px rgba(31,70,57,.18); }
.translate-button:disabled { opacity: .7; cursor: wait; }
.translate-button svg { width: 18px; height: 18px; fill: none; stroke: var(--lime); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.translate-button.is-loading svg { animation: nudge .85s ease-in-out infinite alternate; }
@keyframes nudge { to { transform: translateX(4px); } }
.usage-note { display: flex; align-items: flex-start; gap: 10px; max-width: 730px; margin: 18px auto 0; padding: 0 8px; color: #7b8881; font-size: 11px; line-height: 1.65; }
.usage-note p { margin: 0; }
.usage-icon { display: grid; width: 16px; height: 16px; flex: 0 0 16px; place-items: center; margin-top: 1px; border: 1px solid #b4c2b8; border-radius: 50%; color: #7b9082; font-family: Georgia, serif; font-size: 10px; font-weight: 700; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 63px 0 27px; padding-top: 17px; border-top: 1px solid rgba(29, 48, 44, .08); color: #96a19a; font-size: 9px; letter-spacing: .12em; }
.site-footer span:last-child { letter-spacing: .02em; font-size: 10px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

html[dir="rtl"] .language-controls, html[dir="rtl"] .action-row { direction: rtl; }
html[dir="rtl"] .translate-button svg { transform: rotate(180deg); }
html[dir="rtl"] .translate-button.is-loading svg { animation-name: nudge-rtl; }
@keyframes nudge-rtl { to { transform: rotate(180deg) translateX(4px); } }
html[dir="rtl"] .brand-name, html[dir="rtl"] .brand-caption, html[dir="rtl"] .eyebrow, html[dir="rtl"] .field-label, html[dir="rtl"] .panel-title, html[dir="rtl"] .examples-label, html[dir="rtl"] .site-footer { letter-spacing: .02em; }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 32px, 620px); }
  .site-header { height: 74px; }
  .hero { margin: 48px auto 27px; }
  .translator-card { padding: 18px; border-radius: 18px; }
  .translation-panels { grid-template-columns: 1fr; gap: 11px; }
  textarea { min-height: 150px; }
  .result-panel textarea { min-height: 135px; }
  .examples-row { align-items: flex-start; flex-direction: column; gap: 9px; }
  .site-footer { margin-top: 45px; }
}
@media (max-width: 480px) {
  .page-shell { width: calc(100% - 24px); }
  .site-header { height: 68px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 10px; }
  .brand-caption { font-size: 8px; }
  .header-actions { gap: 8px; }
  .language-pair-badge { padding: 7px 8px; font-size: 9px; }
  .ui-language-button { min-height: 34px; padding: 0 10px; font-size: 12px; }
  .hero { margin: 39px auto 23px; }
  .hero-copy { max-width: 320px; font-size: 14px; }
  .translator-card { padding: 14px; }
  .language-controls { grid-template-columns: minmax(0,1fr) 38px minmax(0,1fr); gap: 7px; }
  .language-select-wrap select { height: 43px; padding: 0 8px; font-size: 12px; }
  .field-label { font-size: 8px; }
  .swap-button { width: 36px; height: 38px; font-size: 19px; }
  .text-panel { padding: 14px 13px 11px; }
  textarea { font-size: 16px; }
  .action-row { align-items: stretch; flex-direction: column; gap: 13px; }
  .translate-button { width: 100%; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 8px; margin-top: 37px; }
}

.import-row { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px dashed #cad8cb; border-radius: 12px; background: #f8fbf5; }
.upload-button { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border: 1px solid #cbd9cc; border-radius: 8px; background: #fff; color: var(--green); font-size: 12px; font-weight: 700; cursor: pointer; }
.upload-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.upload-button:disabled { opacity: .55; cursor: wait; }
.import-copy { display: grid; gap: 4px; min-width: 0; color: #859187; font-size: 10px; line-height: 1.5; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #49614f; font-size: 11px; font-weight: 650; }
.local-badge { flex: 0 0 auto; margin-inline-start: auto; padding: 5px 7px; border-radius: 5px; background: #e6efdf; color: #68805d; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.document-help { margin: 8px 3px 15px; color: #8b968d; font-size: 10px; line-height: 1.6; }
.privacy-note { max-width: 810px; margin: 15px 0 0; color: #819087; font-size: 10px; line-height: 1.7; }
.over-limit { color: #a24e47; }
textarea:disabled { opacity: .75; }
@media (max-width: 600px) { .import-row { flex-wrap: wrap; gap: 9px; } .import-copy { flex: 1 1 160px; } .local-badge { margin-inline-start: 0; } .input-hint { max-width: 145px; } }
