:root {
  color-scheme: light;
  --ink: #20243a;
  --muted: #8b91a6;
  --soft-ink: #596079;
  --line: #edf0f7;
  --paper: #ffffff;
  --canvas: #f7f8fc;
  --blue: #5968ef;
  --blue-dark: #4756dd;
  --blue-pale: #f0f2ff;
  --mint: #22a98b;
  --shadow: 0 20px 62px rgba(39, 48, 100, .075), 0 2px 9px rgba(39, 48, 100, .035);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-width: 320px; min-height: 100svh; color: var(--ink); background: var(--canvas); }
button, textarea, input { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid rgba(89, 104, 239, .34); outline-offset: 3px; }
button { -webkit-tap-highlight-color: transparent; }
.app-shell { max-width: 1170px; margin: 0 auto; padding: 0 44px; }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(41, 50, 87, .065); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; color: var(--blue); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-name { font-size: 23px; letter-spacing: -1.25px; font-weight: 750; }
.brand-period, .title-period { color: var(--blue); }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.privacy-pill { min-height: 34px; display: flex; gap: 7px; align-items: center; color: #7f859a; font-size: 11px; font-weight: 600; letter-spacing: .01em; }
.privacy-dot, .status-dot { width: 7px; height: 7px; display: inline-block; flex: 0 0 auto; border-radius: 50%; background: #47bd95; box-shadow: 0 0 0 3px rgba(71, 189, 149, .1); }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 14px; background: transparent; color: #747b91; cursor: pointer; transition: background .2s ease, color .2s ease, transform .2s ease; }
.icon-button:hover { color: var(--blue); background: #eef0fa; }
.icon-button:active, .mini-button:active, .favorite-button:active { transform: scale(.95); }
.icon-button svg { width: 20px; height: 20px; }
.main-content { max-width: 795px; margin: 0 auto; }
.intro { padding: 56px 0 25px 4px; }
.eyebrow, .dialog-eyebrow { display: flex; align-items: center; gap: 9px; margin: 0; color: #878da5; font-size: 10px; line-height: 1.4; font-weight: 700; letter-spacing: .17em; }
.eyebrow-line { width: 20px; height: 1.5px; border-radius: 2px; background: #8590f7; }
h1 { max-width: 650px; margin: 15px 0 7px; color: #242840; font-size: clamp(43px, 6.8vw, 64px); line-height: .99; font-weight: 710; letter-spacing: -.064em; }
.mobile-break { display: none; }
.intro-copy { margin: 13px 0 0; color: #878da1; font-size: 15px; line-height: 1.55; }
.translator-card { padding: 0 27px 24px; overflow: hidden; border: 1px solid rgba(58, 70, 125, .075); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.language-bar { display: grid; grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr); align-items: center; min-height: 74px; border-bottom: 1px solid var(--line); }
.language-select { min-width: 0; height: 49px; display: flex; align-items: center; gap: 10px; padding: 0 8px; border: 0; border-radius: 12px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; transition: background .18s; }
.language-select:hover { background: #f7f8fc; }
.target-language { padding-left: 15px; }
.language-code { min-width: 35px; display: inline-grid; place-items: center; color: var(--blue); font-size: 10px; line-height: 1; font-weight: 800; letter-spacing: .09em; }
.source-language .language-code { min-width: 44px; color: #8e93a4; }
.language-name { min-width: 0; overflow: hidden; font-size: 14px; line-height: 1.35; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.chevron { width: 15px; height: 15px; margin-left: auto; color: #a0a5b7; flex: 0 0 auto; }
.swap-button { width: 38px; height: 38px; display: grid; place-items: center; justify-self: center; padding: 0; border: 1px solid #e9ebf4; border-radius: 13px; color: #707793; background: #fff; cursor: pointer; transition: background .22s, color .22s, transform .35s; }
.swap-button:hover { color: var(--blue); background: var(--blue-pale); transform: rotate(180deg); }
.swap-button:active { transform: scale(.93); }
.swap-button svg { width: 18px; height: 18px; }
.text-panels { display: grid; grid-template-columns: 1fr 1fr; }
.text-panel { min-width: 0; min-height: 219px; padding: 20px 5px 13px; display: flex; flex-direction: column; }
.source-panel { padding-right: 24px; }
.result-panel { padding-left: 26px; }
.panel-meta { min-height: 15px; display: flex; align-items: center; gap: 8px; }
.panel-label { color: #a0a5b5; font-size: 9px; line-height: 1.2; letter-spacing: .14em; font-weight: 750; }
.detected-label { overflow: hidden; color: #5573ac; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
textarea { width: 100%; min-height: 130px; flex: 1; resize: none; border: 0; outline: 0; padding: 17px 0 10px; color: #30344b; background: transparent; font-size: 16px; line-height: 1.72; font-weight: 430; }
textarea::placeholder { color: #bdc1cf; opacity: 1; }
textarea:focus-visible { outline: 0; }
.panel-footer { min-height: 31px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.source-tools { display: flex; align-items: center; gap: 4px; }
.source-tools-right { justify-content: flex-end; }
.mini-button { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; color: #8b91a6; background: transparent; cursor: pointer; transition: background .18s, color .18s, transform .16s; }
.mini-button:hover { color: var(--blue); background: #f2f3ff; }
.mini-button svg { width: 18px; height: 18px; }
.clear-button { visibility: hidden; opacity: 0; transition: all .18s; }
.source-panel.has-text .clear-button { visibility: visible; opacity: 1; }
.character-count { color: #adb2c0; font-size: 10px; white-space: nowrap; }
.voice-button.is-listening { color: #ef5b70; background: #fff0f2; animation: listen-pulse 1.25s infinite; }
@keyframes listen-pulse { 50% { box-shadow: 0 0 0 6px rgba(239, 91, 112, .13); } }
.panel-divider { width: 1px; min-height: 174px; position: absolute; left: 50%; top: 24px; bottom: 23px; display: flex; align-items: center; justify-content: center; background: #edf0f6; }
.text-panels { position: relative; }
.divider-orbit { width: 9px; height: 9px; z-index: 1; border: 2px solid #fff; border-radius: 50%; background: #c9cffa; box-sizing: content-box; }
.result-panel { min-height: 219px; }
.result-status { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: #a0a5b4; font-size: 10px; }
.result-status .status-dot { width: 5px; height: 5px; background: #aab0bf; box-shadow: none; }
.result-status.is-loading { color: #6774e5; }
.result-status.is-loading .status-dot { background: #6774e5; animation: status-pulse .9s infinite; }
@keyframes status-pulse { 50% { opacity: .3; } }
.result-status.is-error { color: #d65e6e; }
.result-status.is-error .status-dot { background: #d65e6e; }
.result-text { min-height: 140px; flex: 1; padding: 17px 0 9px; overflow-wrap: anywhere; color: #343850; font-size: 16px; line-height: 1.72; white-space: pre-wrap; }
.result-text.is-empty { color: #bdc1cf; }
.result-text.is-error { color: #bd5968; font-size: 14px; line-height: 1.62; }
.result-footer { margin-top: auto; }
.result-actions { gap: 7px; }
.copy-button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 1px solid #e9ebf4; border-radius: 10px; color: #58617f; background: #fff; font-size: 10px; font-weight: 620; cursor: pointer; transition: all .18s ease; }
.copy-button:hover { color: var(--blue); border-color: #d9defa; background: #f6f7ff; }
.copy-button svg { width: 15px; height: 15px; }
.copy-button.copied { border-color: #cbeadd; color: #228362; background: #f2fbf6; }
.translate-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.favorite-button { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 1px solid #eceef4; border-radius: 15px; color: #8e94a8; background: #fff; cursor: pointer; transition: all .2s ease; }
.favorite-button:hover, .favorite-button[aria-pressed="true"] { border-color: #f0dba8; color: #dfa91f; background: #fffbef; }
.favorite-button[aria-pressed="true"] svg { fill: #f6c84b; }
.favorite-button svg { width: 19px; height: 19px; }
.translate-button { min-height: 51px; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 17px; border: 0; border-radius: 15px; color: #fff; background: linear-gradient(100deg, #6270f3, #5362e5); box-shadow: 0 8px 16px rgba(85, 100, 228, .19); font-size: 14px; font-weight: 640; cursor: pointer; transition: transform .18s, box-shadow .18s, filter .18s; }
.translate-button:hover { box-shadow: 0 11px 22px rgba(85, 100, 228, .27); filter: brightness(1.025); transform: translateY(-1px); }
.translate-button:active { transform: scale(.985); }
.translate-button:disabled { opacity: .7; cursor: progress; }
.translate-button-copy { display: inline-flex; align-items: center; gap: 10px; }
.translate-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.14); }
.translate-icon svg { width: 17px; height: 17px; }
.button-arrow { width: 18px; height: 18px; opacity: .8; }
.under-card-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 19px; color: #9399aa; font-size: 11px; text-align: center; }
.sparkle { color: #7d88ee; font-size: 13px; }
.quick-pairs { margin: 48px 0 36px; padding: 20px 4px 0; border-top: 1px solid rgba(41, 50, 87, .065); }
.quick-pairs-head { display: flex; align-items: center; justify-content: space-between; color: #9ca1b0; font-size: 9px; letter-spacing: .14em; font-weight: 750; }
.history-link { display: inline-flex; align-items: center; gap: 7px; padding: 6px 0 6px 8px; border: 0; color: #7882d1; background: transparent; font-size: 11px; font-weight: 600; letter-spacing: 0; cursor: pointer; }
.history-link:hover { color: var(--blue-dark); }
.favorite-chips { min-height: 49px; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding-top: 11px; }
.empty-favorites { color: #a7acba; font-size: 12px; }
.favorite-chip { min-height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid #eceef5; border-radius: 10px; color: #606781; background: rgba(255,255,255,.68); font-size: 11px; font-weight: 600; cursor: pointer; transition: border-color .18s, background .18s, color .18s; }
.favorite-chip:hover { border-color: #dce0fa; color: var(--blue); background: #f3f4ff; }
.favorite-chip svg { width: 13px; height: 13px; color: #dbb34a; fill: #f5d77e; }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; padding: 12px 0 calc(24px + env(safe-area-inset-bottom)); color: #a8adbb; font-size: 10px; text-align: center; }
.site-footer a { color: #888fac; text-decoration: none; }
.site-footer a:hover { color: var(--blue); }
.footer-separator { color: #ccd0da; }
.sr-only { width: 1px; height: 1px; position: absolute; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
dialog { color: var(--ink); }
.picker-dialog, .history-dialog { width: min(100% - 30px, 480px); max-width: 480px; max-height: min(760px, 88svh); margin: auto; padding: 21px 23px 15px; overflow: hidden; border: 1px solid rgba(50, 59, 106, .08); border-radius: 25px; background: #fff; box-shadow: 0 24px 80px rgba(27, 34, 68, .22); }
dialog::backdrop { background: rgba(30, 36, 59, .33); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: backdrop-in .18s ease both; }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.sheet-handle { display: none; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; }
.dialog-eyebrow { margin: 2px 0 6px; font-size: 9px; }
.dialog-header h2 { margin: 0; font-size: 23px; line-height: 1.2; letter-spacing: -.04em; }
.close-dialog { width: 36px; height: 36px; border: 1px solid #eef0f5; border-radius: 12px; }
.close-dialog svg { width: 18px; height: 18px; }
.search-box { height: 47px; display: flex; align-items: center; gap: 10px; margin: 19px 0 11px; padding: 0 12px; border: 1px solid #e9ebf3; border-radius: 13px; background: #fafbfe; }
.search-box:focus-within { border-color: #bfc6f6; box-shadow: 0 0 0 3px rgba(89, 104, 239, .08); }
.search-box svg { width: 18px; height: 18px; flex: 0 0 auto; color: #989eb0; }
.search-box input { width: 100%; height: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.search-box input:focus-visible { outline: 0; }
.search-box input::placeholder { color: #aeb3c2; }
.search-box kbd { flex: 0 0 auto; color: #b3b8c7; font-size: 10px; font-family: inherit; }
.language-list { max-height: min(52svh, 455px); overflow: auto; overscroll-behavior: contain; scrollbar-color: #d9ddef transparent; scrollbar-width: thin; }
.language-option { width: 100%; min-height: 53px; display: flex; align-items: center; gap: 11px; padding: 7px 10px; border: 0; border-radius: 11px; color: #4d536b; background: #fff; text-align: left; cursor: pointer; transition: background .13s; }
.language-option:hover, .language-option:focus-visible { background: #f5f6fc; }
.language-option[aria-selected="true"] { background: #f1f3ff; }
.language-option[aria-selected="true"] .option-name { color: var(--blue); font-weight: 650; }
.option-code { width: 36px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: #848ba7; background: #f3f4f8; font-size: 9px; letter-spacing: .035em; font-weight: 750; }
.language-option[aria-selected="true"] .option-code { color: #5362da; background: #e4e8ff; }
.option-name { flex: 1; font-size: 13px; line-height: 1.35; }
.option-check { width: 17px; height: 17px; color: var(--blue); opacity: 0; }
.language-option[aria-selected="true"] .option-check { opacity: 1; }
.no-language-match { padding: 25px 8px; color: #959bae; font-size: 13px; text-align: center; }
.history-toolbar { display: flex; align-items: center; justify-content: space-between; margin: 22px 1px 9px; color: #858ba0; font-size: 11px; font-weight: 600; }
.history-toolbar button { padding: 7px 2px 7px 10px; border: 0; color: #a2a7b6; background: transparent; font-size: 11px; cursor: pointer; }
.history-toolbar button:hover { color: #cf5967; }
.history-list { max-height: min(56svh, 510px); overflow: auto; overscroll-behavior: contain; }
.history-entry { position: relative; padding: 14px 34px 14px 13px; border: 1px solid #eff0f5; border-radius: 13px; background: #fff; cursor: pointer; }
.history-entry + .history-entry { margin-top: 8px; }
.history-entry:hover { border-color: #dde1f5; background: #fafbff; }
.history-languages { margin-bottom: 7px; color: #8188a0; font-size: 10px; font-weight: 650; }
.history-original, .history-translation { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; font-size: 12px; line-height: 1.55; }
.history-original { color: #8c91a3; }
.history-translation { margin-top: 4px; color: #343950; }
.history-delete { width: 28px; height: 28px; position: absolute; top: 10px; right: 9px; display: grid; place-items: center; border: 0; border-radius: 9px; color: #aab0bd; background: transparent; cursor: pointer; }
.history-delete:hover { color: #cc5d6b; background: #fff0f2; }
.history-delete svg { width: 15px; height: 15px; }
.history-empty { padding: 45px 12px; color: #999fb1; font-size: 13px; text-align: center; }
.toast { max-width: calc(100% - 34px); position: fixed; z-index: 20; left: 50%; bottom: calc(21px + env(safe-area-inset-bottom)); padding: 11px 16px; transform: translate(-50%, 14px); border: 1px solid rgba(255,255,255,.12); border-radius: 13px; color: #fff; background: rgba(38, 43, 68, .93); box-shadow: 0 8px 30px rgba(28, 33, 62, .2); font-size: 12px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
body.dialog-open { overflow: hidden; }
@media (min-width: 700px) { .app-shell { padding-inline: 54px; } }
@media (max-width: 620px) {
  body { background: #f7f8fc; }
  .app-shell { max-width: 520px; padding-inline: 20px; }
  .topbar { height: 67px; }
  .brand { gap: 8px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand-name { font-size: 21px; }
  .topbar-actions { gap: 7px; }
  .privacy-pill { gap: 6px; font-size: 10px; }
  .topbar-actions > .icon-button { width: 37px; height: 37px; }
  .intro { padding: 37px 1px 20px; }
  .eyebrow { font-size: 9px; }
  h1 { margin-top: 13px; font-size: clamp(43px, 11.9vw, 56px); line-height: .99; letter-spacing: -.067em; }
  .mobile-break { display: initial; }
  .intro-copy { margin-top: 9px; font-size: 13px; }
  .translator-card { padding: 0 17px 17px; border-radius: 21px; }
  .language-bar { min-height: 67px; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); }
  .language-select { height: 45px; gap: 6px; padding-inline: 4px; }
  .target-language { padding-left: 5px; }
  .language-code { min-width: 30px; font-size: 9px; }
  .source-language .language-code { min-width: 37px; }
  .language-name { font-size: 12px; }
  .chevron { width: 13px; height: 13px; }
  .swap-button { width: 34px; height: 34px; border-radius: 12px; }
  .swap-button svg { width: 16px; height: 16px; }
  .text-panels { grid-template-columns: minmax(0, 1fr); }
  .text-panel { min-height: 188px; padding-top: 16px; padding-bottom: 10px; }
  .source-panel { padding-right: 2px; }
  .result-panel { min-height: 185px; padding: 16px 2px 10px; }
  .panel-divider { width: auto; height: 1px; position: static; display: flex; align-items: center; justify-content: center; background: #edf0f6; }
  .divider-orbit { width: 7px; height: 7px; }
  textarea { min-height: 119px; padding-top: 13px; padding-bottom: 7px; font-size: 15px; line-height: 1.65; }
  .result-text { min-height: 112px; padding-top: 13px; font-size: 15px; line-height: 1.65; }
  .panel-footer { min-height: 29px; }
  .mini-button { width: 32px; height: 32px; }
  .copy-button { min-height: 32px; }
  .translate-row { padding-top: 14px; gap: 11px; }
  .favorite-button { width: 45px; height: 47px; border-radius: 14px; }
  .translate-button { min-height: 49px; border-radius: 14px; }
  .under-card-note { margin: 14px 5px 0; font-size: 10px; line-height: 1.55; }
  .quick-pairs { margin-top: 33px; padding-top: 16px; }
  .favorite-chips { gap: 7px; }
  .site-footer { padding-top: 8px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); font-size: 9px; }
  .picker-dialog, .history-dialog { width: 100%; max-width: none; max-height: min(83svh, 760px); position: fixed; bottom: 0; left: 0; margin: 0; padding: 9px 20px calc(13px + env(safe-area-inset-bottom)); border: 0; border-radius: 23px 23px 0 0; box-shadow: 0 -10px 40px rgba(27,34,68,.12); animation: sheet-up .24s cubic-bezier(.2,.8,.2,1) both; }
  .sheet-handle { width: 36px; height: 4px; display: block; margin: 0 auto 17px; border-radius: 10px; background: #dadee8; }
  .language-list { max-height: calc(83svh - 172px); }
  .history-list { max-height: calc(83svh - 169px); }
  .search-box { margin-top: 15px; }
}
@media (max-width: 365px) {
  .app-shell { padding-inline: 15px; }
  .privacy-pill { font-size: 9px; }
  .translator-card { padding-inline: 13px; }
  .language-select { gap: 4px; }
  .language-name { font-size: 11px; }
  .language-code { min-width: 26px; font-size: 8px; }
  .source-language .language-code { min-width: 34px; }
  .chevron { width: 12px; }
  .quick-pairs-head { font-size: 8px; }
}
@keyframes sheet-up { from { transform: translateY(15px); opacity: .8; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
