:root{font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;color:#19263d;background:#f8faff;font-synthesis:none;-webkit-font-smoothing:antialiased;--ink:#17233c;--muted:#8993a6;--line:#e7ebf2;--blue:#4d55e8;--blue-dark:#313bd2;--shadow:0 23px 70px rgba(41,55,99,.075)}
*{box-sizing:border-box}html{min-height:100%;scroll-behavior:smooth}body{min-height:100vh;margin:0;position:relative}button,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.43}button:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid rgba(92,103,242,.3);outline-offset:3px}svg{height:21px;width:21px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.page-bg{position:absolute;inset:0 0 auto;z-index:-1;height:760px;pointer-events:none;overflow:hidden;background:radial-gradient(ellipse at 50% -40%,#e3e8ff 0%,transparent 67%)}.glow{position:absolute;border-radius:50%;filter:blur(60px);opacity:.43}.glow-a{width:290px;height:290px;top:190px;left:-180px;background:#e3dcff}.glow-b{width:330px;height:330px;top:160px;right:-170px;background:#caeef4}.app-shell{max-width:1164px;margin:0 auto;padding:0 30px}.topbar{display:flex;align-items:center;justify-content:space-between;min-height:104px;border-bottom:1px solid rgba(220,226,239,.85);gap:20px}.brand{display:flex;align-items:center;gap:12px;color:var(--ink);text-decoration:none}.brand-mark{width:43px;height:43px;background:linear-gradient(135deg,#5d6bf8,#3e46be);box-shadow:0 8px 20px #5860ee38;color:white;border-radius:14px;display:grid;place-items:center}.brand-mark svg{width:27px;height:27px;stroke-width:2.1}.brand-text{font-size:20px;font-weight:800;letter-spacing:-.7px;line-height:1;white-space:nowrap}.brand-text>span{color:#5661e6}.brand-text small{display:block;font-size:10px;letter-spacing:1.5px;color:#a1a9b6;font-weight:800;margin-top:7px;text-transform:uppercase}.online-pill{font-size:12px;font-weight:700;color:#6d778b;display:flex;align-items:center;gap:9px;background:white;border:1px solid #edf0f6;border-radius:100px;padding:11px 16px;box-shadow:0 4px 16px #45538408}.live-dot{background:#19b98b;border-radius:50%;height:7px;width:7px;box-shadow:0 0 0 4px #def8ef}.pill-separator{color:#b1b8c5}.intro{text-align:center;margin:61px auto 38px;max-width:660px}.eyebrow{font-size:10px;font-weight:850;letter-spacing:2.5px;color:#5764e7;display:flex;align-items:center;justify-content:center;gap:10px}.eyebrow-dot{background:#6b73ef;width:6px;height:6px;border-radius:50%}.intro h1{font-size:clamp(37px,5.25vw,60px);line-height:1.15;letter-spacing:-3.1px;margin:16px 0 14px;font-weight:790;color:#15213b}.intro h1 em{font-style:normal;background:linear-gradient(100deg,#4b57e6,#9498ed);background-clip:text;color:transparent}.intro p{font-size:15px;line-height:1.8;color:#8390a5;margin:0 auto;max-width:530px}.workbench{display:grid;grid-template-columns:minmax(0,1fr) 34px minmax(0,1fr);align-items:center;gap:12px}.source-panel{background:#fff;min-width:0;border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow);padding:22px;align-self:stretch;display:flex;flex-direction:column;min-height:460px}.panel-header,.result-head{display:flex;justify-content:space-between;align-items:center;gap:8px}.panel-language{display:flex;align-items:center;gap:11px;min-width:0}.language-icon{width:40px;height:40px;display:grid;place-items:center;border-radius:12px;font-size:14px;font-weight:850;flex-shrink:0}.fa-icon{color:#555fe0;background:#eaedff;font-size:17px}.en-icon{color:#197bb1;background:#e4f3fd}.el-icon{color:#089b7e;background:#dff9ef}.panel-language h2{font-size:16px;color:var(--ink);margin:0;font-weight:780;letter-spacing:-.3px}.native-language{font-size:12px;font-weight:550;color:#8e98aa;margin-left:4px}.language-subtitle{color:#a6aebe;font-size:11px;margin-top:5px}.icon-button{background:transparent;border:1px solid transparent;height:37px;width:37px;display:grid;place-items:center;border-radius:11px;color:#8691a4;transition:background .2s,color .2s,border-color .2s}.icon-button:hover:not(:disabled){background:#f0f3ff;color:var(--blue)}.soft-button{border-color:#eef1f7;background:#fbfcff}.icon-button svg{width:19px;height:19px}.source-panel textarea{background:transparent;border:0;outline:0;resize:vertical;display:block;min-height:222px;max-height:450px;width:100%;padding:32px 2px 6px;font-family:Tahoma,"Noto Naskh Arabic","Geeza Pro",Arial,sans-serif;font-size:22px;line-height:1.85;color:#27354c;flex:1}.source-panel textarea::placeholder{color:#b5bdca}.source-panel textarea:focus{outline:0}.source-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0 21px;border-bottom:1px solid #edf0f6}.text-button{border:0;background:transparent;padding:0;display:inline-flex;align-items:center;gap:7px;color:#6470e9;font-size:12px;font-weight:700}.text-button svg{width:17px;height:17px}.text-button:hover{text-decoration:underline}.char-count{font-size:11px;color:#abb3c0;white-space:nowrap}.source-actions{display:flex;gap:10px;padding-top:20px}.mic-button,.translate-button{height:47px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;gap:9px;font-size:13px;font-weight:760;transition:transform .15s,box-shadow .15s}.mic-button{flex:0 1 43%;border:1px solid #e6eaf4;background:white;color:#5b657a}.mic-button:hover:not(:disabled){background:#f9faff}.mic-button.recording{color:#cc3651;border-color:#ffc9d4;background:#fff4f7;animation:pulse 1.6s infinite}.mic-button.recording svg{stroke:#da3855}.mic-button svg,.translate-button svg{width:17px;height:17px}.translate-button{flex:1;min-width:0;color:white;border:1px solid #4e58df;background:linear-gradient(116deg,#6872f6,#4550d4);box-shadow:0 10px 19px #515ce52b}.translate-button:hover:not(:disabled){box-shadow:0 12px 22px #515ce547;transform:translateY(-1px)}.translate-button svg{margin-left:auto;margin-right:8px}.keyhint{text-align:center;font-size:10px;color:#b0b8c7;margin-top:13px}.keyhint kbd{font:inherit;background:#f1f3f8;color:#7c8595;border-radius:4px;padding:2px 4px}.connector{display:flex;align-items:center;justify-content:center;z-index:1}.connector>span{width:43px;height:43px;display:grid;place-items:center;color:#6872ed;border:1px solid #e3e8fc;border-radius:50%;background:#fff;box-shadow:0 5px 17px #4b57bb15}.connector svg{height:20px;width:20px}.results-panel{min-width:0;align-self:stretch;display:flex;flex-direction:column;gap:15px}.result-card{background:white;border:1px solid var(--line);border-radius:19px;box-shadow:var(--shadow);min-height:221px;padding:20px 21px;display:flex;flex-direction:column}.result-actions{display:flex;align-items:center;gap:1px}.result-body{margin:20px 0 0;min-height:69px;flex:1;font-size:16px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;color:#23314c}.result-body.empty{font-size:13px;color:#b0bac9;font-style:italic}.result-body.loading{font-size:13px;color:#8791a6}.result-body.error{font-size:13px;color:#c94a61}.result-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;padding-top:11px;margin-top:13px;border-top:1px solid #f1f3f8}.result-status{font-size:10px;color:#a5afbf}.result-status.success{color:#16a17f}.result-status.failure{color:#d75667}.locale-label{color:#aab3c2;font-size:10px;font-weight:800;letter-spacing:1px}.utility-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:17px 3px 0}.utility-bar p{margin:0;display:flex;align-items:center;gap:8px;font-size:11px;color:#9099aa}.message-dot{height:6px;width:6px;border-radius:50%;background:#20ba91;flex-shrink:0}.utility-bar p.error .message-dot{background:#d95e70}.utilities{display:flex;gap:17px}.small-action{font-size:11px;color:#778398;white-space:nowrap;border:0;background:transparent;display:inline-flex;align-items:center;gap:6px;padding:4px}.small-action:hover:not(:disabled){color:#515ce8}.small-action svg{width:15px;height:15px}.feature-row{display:grid;grid-template-columns:repeat(3,1fr);margin:73px auto 72px;gap:25px;max-width:950px}.feature{display:flex;gap:13px;align-items:center;justify-content:center}.feature-icon{background:#eef0ff;width:42px;height:42px;border-radius:12px;color:#5b66e1;display:grid;place-items:center;flex-shrink:0}.feature-icon svg{width:20px;height:20px}.feature strong,.feature small{display:block}.feature strong{font-size:12px;color:#3b4760}.feature small{color:#a0a9ba;font-size:11px;margin-top:5px}.footer{border-top:1px solid #e9ecf4;min-height:86px;display:flex;align-items:center;justify-content:space-between;gap:14px;color:#a3adbd;font-size:11px}.footer strong{color:#6d7590}.footer a{color:#7783ac;text-decoration:none}.footer a:hover{text-decoration:underline}.footer-dot{margin:0 6px;color:#d5dbe7}.toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,18px);background:#14213e;color:white;border-radius:12px;padding:12px 17px;box-shadow:0 13px 35px #1e2c4859;font-size:12px;opacity:0;pointer-events:none;transition:opacity .24s,transform .24s;z-index:10;max-width:min(420px,calc(100vw - 36px));text-align:center}.toast.show{opacity:1;transform:translate(-50%,0)}@keyframes pulse{50%{box-shadow:0 0 0 6px #f26a7f1a}}@media (max-width:790px){.app-shell{padding:0 19px}.topbar{min-height:83px}.intro{margin:44px auto 34px}.intro h1{letter-spacing:-2.5px}.workbench{grid-template-columns:minmax(0,1fr)}.source-panel{min-height:375px;padding:21px}.source-panel textarea{min-height:170px;max-height:350px}.connector{height:0;overflow:visible}.connector>span{transform:rotate(90deg);width:36px;height:36px}.result-card{min-height:174px}.result-body{min-height:45px}.feature-row{margin:52px 0;gap:16px}.feature{flex-direction:column;align-items:flex-start;justify-content:flex-start}.feature-icon{height:36px;width:36px}.footer{line-height:1.7}}@media(max-width:510px){.app-shell{padding:0 16px}.online-pill{font-size:0;gap:0;padding:11px}.live-dot{height:8px;width:8px}.pill-separator{display:none}.brand-text{font-size:18px}.intro{margin-top:35px}.intro h1{font-size:38px;letter-spacing:-2px}.intro p{font-size:13px}.workbench{gap:15px}.source-panel{padding:17px;border-radius:19px}.source-panel textarea{font-size:20px}.result-card{padding:17px}.feature-row{grid-template-columns:1fr;gap:17px;margin:42px 0}.feature{flex-direction:row}.footer{flex-direction:column;align-items:flex-start;justify-content:center;padding:22px 0;gap:4px}.utility-bar{align-items:flex-start;flex-direction:column;gap:15px}.utilities{align-self:flex-end}.keyhint{font-size:9px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
/* Translation direction controls, added in v1.1 */
.language-switcher{display:flex;align-items:center;justify-content:center;gap:10px;margin:-7px 0 28px;flex-wrap:wrap}
.direction-label{font-size:12px;color:#818ca0;font-weight:700;margin-right:4px}
.mode-tab{display:flex;align-items:center;gap:8px;min-height:41px;border:1px solid #e1e6f1;border-radius:12px;padding:8px 15px;background:#fff;color:#68758c;box-shadow:0 3px 12px rgba(27,45,88,.025);transition:border-color .2s,background .2s,transform .2s}
.mode-tab strong{font-size:14px;font-weight:780}.mode-tab span{font-size:11px;font-weight:650}.mode-tab.is-active{background:#eef0ff;color:#4753dc;border-color:#aeb7ff;box-shadow:0 3px 13px rgba(69,80,205,.1)}
.mode-tab:hover{transform:translateY(-1px);border-color:#aeb7ff}.direction-hint{font-size:11px;font-weight:650;color:#6c7790;padding-left:7px}
@media(max-width:510px){.language-switcher{gap:8px;margin-top:0;margin-bottom:22px}.direction-label{width:100%;text-align:center;margin-right:0}.mode-tab{flex:1 1 118px;justify-content:center}.direction-hint{width:100%;text-align:center;padding:2px 0 0}.source-panel .panel-header .native-language{display:block;margin:3px 0 0}.source-panel .panel-language h2{font-size:15px}}

/* v1.2: Audio help appears only when a matching speech voice is unavailable */
.speech-help[hidden]{display:none!important}
.speech-help{display:flex;gap:16px;align-items:flex-start;margin:22px 3px 0;background:#f9faff;border:1px solid #dbe1ff;border-radius:17px;padding:20px 19px;box-shadow:0 6px 20px rgba(51,61,136,.04)}
.speech-help-icon{display:grid;place-items:center;background:#e8edff;border-radius:13px;width:43px;height:43px;flex-shrink:0;font-size:21px}
.speech-help-content{flex:1;min-width:0}
.speech-help h2{font-size:15px;font-weight:800;color:#243252;margin:0 0 7px}
.speech-help p{color:#65728c;font-size:12px;line-height:1.7;margin:0 0 12px}
.speech-help-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
.speech-action{font-family:inherit;font-size:12px;font-weight:700;background:#fff;color:#515ed7;border:1px solid #c9d0f7;border-radius:9px;padding:10px 12px;display:inline-flex;text-decoration:none;cursor:pointer;min-height:39px;align-items:center;justify-content:center}
.speech-action.primary{background:#5360dc;border-color:#5360dc;color:#fff}
.speech-action:hover{filter:brightness(.97)}
.speech-help-link{font-size:12px;color:#5b67db;text-decoration:underline;padding:6px 2px}
.speech-help small{font-size:10px;line-height:1.6;color:#8691a4;display:block}
.speech-dismiss{font-size:24px;line-height:1;font-weight:400;cursor:pointer;color:#8c96a9;background:transparent;border:0;padding:0 3px;margin-left:auto}
@media(max-width:510px){.speech-help{padding:16px 12px;gap:10px}.speech-help-icon{width:33px;height:33px;font-size:17px}.speech-help-actions{align-items:stretch;flex-direction:column}.speech-action,.speech-help-link{width:100%;text-align:center}.speech-help h2{font-size:14px}}

/* FarsiBridge v2.1: natural Persian voice selection */
.voice-picker{display:flex;justify-content:space-between;align-items:center;gap:16px;max-width:840px;margin:0 auto 22px;padding:13px 17px;background:#fff;border:1px solid #e1e5f1;border-radius:14px;box-shadow:0 3px 13px #1b2d5808}
.voice-picker strong{font-size:13px;color:#263653;display:block}.voice-picker small{display:block;font-size:11px;color:#8c97aa;margin-top:3px}
.voice-picker select{min-width:220px;max-width:100%;border:1px solid #d7ddf0;border-radius:10px;color:#34436a;padding:10px 12px;font:600 12px inherit;font-size:12px;background:#f8f9ff;cursor:pointer}
@media(max-width:510px){.voice-picker{align-items:stretch;flex-direction:column;gap:10px}.voice-picker select{width:100%;min-width:0}}
