/* Translation bar and settings panel. Capture overlays below are unchanged. */
.terminal-translation{display:inline-flex;align-items:center;flex-wrap:wrap;gap:0;position:relative;max-width:100%;min-width:0;min-height:36px;padding:3px;border:1px solid #e6edf5;border-radius:12px;background:rgba(255,255,255,.9);color:#334155;font-size:12px;z-index:30;isolation:isolate;box-shadow:0 1px 2px rgba(15,23,42,.04)}
.terminal-translation button{font:inherit;cursor:pointer;white-space:nowrap}
.terminal-translation .tt-toggle,.terminal-translation .tt-select,.terminal-translation .tt-original,.terminal-translation .tt-details-button,.terminal-translation .tt-language,.terminal-translation .tt-global-status{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:30px;min-height:30px;margin:0;padding:0 10px;border:0;border-radius:9px;background:transparent;box-shadow:none;color:#3f3f46;font-size:12px;font-weight:600;line-height:1}
.terminal-translation .tt-select,.terminal-translation .tt-language,.terminal-translation .tt-global-status,.terminal-translation .tt-original,.terminal-translation .tt-details-button{margin-left:2px}
.terminal-translation .tt-toggle b{font-weight:650}
.terminal-translation .tt-switch{position:relative;display:block;width:28px;height:16px;border-radius:999px;background:#d4d4d8}
.terminal-translation .tt-switch::after{position:absolute;content:"";left:2px;top:2px;width:12px;height:12px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.2);transition:transform .15s ease}
.terminal-translation .tt-toggle[aria-checked="true"]{background:#0f172a;color:#fff}
.terminal-translation .tt-toggle[aria-checked="true"] .tt-switch{background:#2563eb}
.terminal-translation .tt-toggle[aria-checked="true"] .tt-switch::after{transform:translateX(12px)}
.terminal-translation .tt-toggle:hover{background:#f4f7fb}
.terminal-translation .tt-toggle[aria-checked="true"]:hover{background:#1e293b}
.terminal-translation .tt-caret{width:10px;height:6px;background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%2394a3b8' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/10px 6px no-repeat}
.terminal-translation .tt-select:hover,.terminal-translation .tt-language:hover,.terminal-translation .tt-original:hover,.terminal-translation .tt-details-button:hover{background:#f4f7fb}
.terminal-translation .tt-language{gap:6px;padding-right:8px;color:#71717a;font-weight:600}
.terminal-translation .tt-language{position:relative}
.terminal-translation .tt-source-native{position:absolute;width:1px;height:1px;margin:0;padding:0;border:0;opacity:0;pointer-events:none}
.terminal-translation .tt-lang-button{height:30px;padding:0;border:0;background:transparent;color:#1e2329;font-weight:650}
.terminal-translation .tt-lang-menu{position:fixed;z-index:220;display:flex;flex-direction:column;gap:2px;overflow:auto;padding:8px;border:1px solid #e6edf5;border-radius:14px;background:#fff;box-shadow:0 24px 48px -28px rgba(15,23,42,.55)}
.terminal-translation .tt-lang-menu button{display:flex;align-items:center;width:100%;min-height:42px;padding:0 14px;border:0;border-radius:10px;background:transparent;color:#1e2329;font-size:15px;font-weight:600;text-align:left}
.terminal-translation .tt-lang-menu button:hover{background:#f4f7fb}
.terminal-translation .tt-lang-menu button[aria-selected="true"]{background:#e6f4ff;color:#005bc4}
.terminal-translation .tt-target{display:inline-flex;align-items:center;gap:6px;color:#71717a;font-weight:600}
.terminal-translation .tt-target::before{content:"→";color:#94a3b8;font-weight:500}
.terminal-translation .tt-global-status{justify-content:flex-start;max-width:min(240px,36vw);padding:0 8px;color:#71717a;font-weight:550}
.terminal-translation .tt-global-status>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2}
.terminal-translation .tt-global-status>i{display:block;flex:0 0 auto;width:6px;height:6px;border-radius:50%;background:#a1a1aa}
.terminal-translation .tt-global-status[data-busy="true"]>i{width:10px;height:10px;border:2px solid currentColor;border-right-color:transparent;background:none;animation:tt-spin .9s linear infinite}
.terminal-translation .tt-global-status[data-tone="busy"]{color:#005bc4;background:#e6f4ff}
.terminal-translation .tt-global-status[data-tone="success"]{color:#047857;background:#ecfdf5}
.terminal-translation .tt-global-status[data-tone="error"]{color:#b91c1c;background:#fef2f2}
.tt-panel-status[data-tone="busy"]{color:#005bc4;background:#e6f4ff}
.tt-panel-status[data-tone="success"]{color:#047857;background:#ecfdf5}
.tt-panel-status[data-tone="error"]{color:#b91c1c;background:#fef2f2}
.terminal-translation .tt-original[aria-pressed="true"]{background:#e6f4ff;color:#005bc4}
.terminal-translation .tt-details-button{color:#006fee;font-weight:650}
.terminal-translation [hidden],.tt-panel-status[hidden]{display:none!important}
.terminal-translation button:focus-visible,.terminal-translation input:focus-visible,.terminal-translation select:focus-visible{outline:2px solid #006fee;outline-offset:2px}
.terminal-translation.is-on{border-color:#d7e6f8}
.terminal-translation.is-error{border-color:#fecaca}
.terminal-translation .tt-popover{position:fixed;left:12px;top:80px;z-index:150;display:flex;flex-direction:column;width:min(420px,calc(100vw - 24px));overflow:auto;overscroll-behavior:contain;padding:0;border:1px solid #e6edf5;border-radius:16px;background:#fff;box-shadow:0 24px 48px -28px rgba(15,23,42,.55),0 0 0 1px rgba(15,23,42,.03);line-height:1.5;text-align:left;box-sizing:border-box}
.terminal-translation .tt-popover-head{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 14px 12px;border-bottom:1px solid #eef2f7;background:#fff}
.terminal-translation .tt-popover-head strong{font-size:15px;font-weight:700;color:#1e2329}
.terminal-translation .tt-popover-head button{display:inline-grid;place-items:center;width:28px;height:28px;border:0;border-radius:9px;background:#f4f7fb;color:#64748b;font-size:18px;line-height:1}
.terminal-translation .tt-popover-head button:hover{background:#e8eef6;color:#1e2329}
.terminal-translation .tt-popover-body{display:flex;flex-direction:column;gap:10px;padding:12px 14px 14px}
.terminal-translation .tt-help{margin:0;color:#94a3b8;font-size:12px;line-height:1.55}
.terminal-translation .tt-help-foot{padding-top:2px;border-top:1px solid #f1f5f9;color:#94a3b8;font-size:11px;line-height:1.6}
.terminal-translation .tt-language-note{display:grid;gap:3px;margin:0;padding:10px 12px;border:1px solid #e6edf5;border-radius:12px;background:linear-gradient(180deg,#f8fbff 0%,#fff 100%)}
.terminal-translation .tt-language-note strong{font-size:13px;font-weight:700;color:#1e2329}
.terminal-translation .tt-language-note small{font-size:12px;color:#71717a;line-height:1.55}
.terminal-translation .tt-screen-options{display:grid;gap:6px;margin:0}
.terminal-translation .tt-screen-choice{display:flex;align-items:center;gap:10px;min-height:48px;padding:8px 12px;border:1px solid #e6edf5;border-radius:12px;background:#fff;cursor:pointer}
.terminal-translation .tt-screen-choice:hover{border-color:#d7e6f8;background:#f8fbff}
.terminal-translation .tt-screen-choice:has(input:checked){background:#f3f9ff;border-color:#9ecbf7;box-shadow:inset 3px 0 0 #006fee}
.terminal-translation .tt-screen-choice>input{flex:0 0 auto;width:16px;height:16px;margin:0;accent-color:#006fee}
.terminal-translation .tt-choice-copy{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:8px;row-gap:2px;flex:1}
.terminal-translation .tt-choice-copy strong{font-size:13px;font-weight:650;color:#1e2329}
.terminal-translation .tt-choice-state{justify-self:end;padding:0;border-radius:0;background:transparent;color:#94a3b8;font-size:12px;font-weight:550;line-height:1.3;white-space:nowrap}
.terminal-translation .tt-choice-state[data-tone="busy"]{color:#005bc4}
.terminal-translation .tt-choice-state[data-tone="success"]{color:#047857}
.terminal-translation .tt-choice-state[data-tone="error"]{color:#b91c1c}
.terminal-translation .tt-choice-copy small{grid-column:1 / -1;font-size:11px;color:#94a3b8;line-height:1.4}
.terminal-translation .tt-choice-copy small:empty{display:none}
.terminal-translation .tt-selection-actions{display:flex;justify-content:flex-end;gap:8px;margin:0}
.terminal-translation .tt-selection-actions button,.terminal-translation .tt-retry{border:1px solid #e6edf5;border-radius:9px;padding:0 12px;color:#334155;background:#fff;font-size:12px;font-weight:650;min-height:30px}
.terminal-translation .tt-selection-actions button:hover{border-color:#b9dcff;background:#f3f9ff;color:#005bc4}
.terminal-translation .tt-model{margin:0;padding:8px 10px;border-radius:10px;background:#f8fafc;color:#64748b;font-size:12px;line-height:1.45}
.terminal-translation .tt-detail-summary{white-space:pre-line;margin:0;padding:8px 10px;border-radius:10px;background:#f8fafc;color:#64748b;font-size:12px;line-height:1.6}
.terminal-translation .tt-detail-summary:empty{display:none}
.terminal-translation .tt-retry{align-self:flex-start;color:#b91c1c;border-color:#fecaca;background:#fff}
.terminal-translation .tt-retry:hover{background:#fef2f2;color:#991b1b}
.terminal-translation .tt-dual{display:flex;gap:8px;align-items:center;min-height:42px;margin:0;padding:0 12px;border:1px solid #e6edf5;border-radius:12px;background:#fff;font-size:13px;font-weight:650;color:#1e2329}
.terminal-translation .tt-dual input{width:16px;height:16px;margin:0;accent-color:#006fee}
.phone-stage-head.tt-screen-head{display:flex;align-items:center;flex-wrap:nowrap;column-gap:8px;row-gap:0;height:52px}
.phone-stage-head.tt-screen-head>strong{display:inline-flex;gap:6px;align-items:center;min-width:0}
.tt-screen-number{display:inline-grid;place-items:center;flex:0 0 auto;width:20px;height:20px;border-radius:6px;background:#e7eef8;color:#334155;font-size:12px;line-height:1;font-weight:750}
.tt-panel-status{flex:0 1 auto;box-sizing:border-box;max-width:34%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:18px;padding:4px 8px;border-radius:999px;font-size:12px;font-weight:650;color:#475569;background:#f1f5f9}
.tt-panel-status[hidden]{display:none}
.phone-screen>.tt-layer{position:absolute;inset:0;z-index:8;overflow:hidden;pointer-events:none!important;user-select:none;contain:layout style paint}
.tt-layer *{pointer-events:none!important}
.tt-layer .tt-label{position:absolute;display:block;box-sizing:border-box;line-height:1.3;padding:1px 4px;border:1px solid #dae5f0;border-radius:4px;background:#fffffff5;color:#0b2540;box-shadow:0 1px 3px #10253d18;font-family:system-ui,"Microsoft YaHei",sans-serif;font-weight:500;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:3em;letter-spacing:0;text-align:left}
@keyframes tt-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.terminal-translation .tt-global-status[data-busy="true"]>i{animation:none}.terminal-translation .tt-switch::after{transition:none}}
@media(max-width:720px){.terminal-translation .tt-toggle,.terminal-translation .tt-select,.terminal-translation .tt-details-button{padding:0 8px}.terminal-translation .tt-language select{max-width:88px}.terminal-translation .tt-global-status{max-width:calc(100vw - 48px)}}
