@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("../fonts/IBMPlexSansArabic-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("../fonts/IBMPlexSansArabic-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --void: #080b12;
  --surface: #111524;
  --raised: #1b2136;
  --line: #303750;
  --ink: #edf0fa;
  --muted: #a4adc5;
  --accent: #c0afff;
  --teal: #90e3dc;
  --font: "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@property --frame-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--void); color: var(--ink); font: 15px/1.65 var(--font); }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { opacity: .45; cursor: wait; }
button, input, select, textarea, summary { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
::selection { background: #514b7e; color: #fff; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; background: radial-gradient(ellipse at 75% 0%, #29234860, transparent 60%); }
.nebula { position: absolute; width: min(75vw, 1000px); aspect-ratio: 1; border-radius: 50%; opacity: .7; }
.nebula-violet { top: -38%; right: -20%; background: radial-gradient(circle, #8760f532, #6d47b615 40%, transparent 68%); animation: nebula-drift 24s ease-in-out infinite alternate; }
.nebula-blue { bottom: -40%; left: -25%; background: radial-gradient(circle, #4daed52b, #3056a510 40%, transparent 68%); animation: nebula-drift 30s -12s ease-in-out infinite alternate-reverse; }
.star-field { position: absolute; inset: -30px; opacity: .25; background-image: radial-gradient(circle, #d5ceff 1px, transparent 1.5px), radial-gradient(circle, #91c7e6 1px, transparent 1.5px); background-size: 173px 193px, 277px 251px; background-position: 14px 40px, 100px 140px; animation: starlight 12s ease-in-out infinite alternate; }
.shell { max-width: 1280px; margin: auto; padding: 0 52px; position: relative; }
.masthead { position: relative; z-index: 10; min-height: 92px; padding-block: 16px; display: flex; align-items: center; justify-content: space-between; gap: 25px; border-bottom: 1px solid #c0afff18; animation: enter .7s var(--ease) backwards; }
.brand { display: flex; align-items: center; gap: 16px; }
.brand-name { display: block; font-family: var(--font); font-size: 23px; line-height: 1.4; letter-spacing: 4px; }
.brand-caption { display: block; color: var(--muted); font-size: 11px; margin-top: 8px; }
.brand-emblem { width: 39px; height: 39px; border: 1px solid #b9a8e8; border-radius: 50%; position: relative; transform: rotate(-38deg); box-shadow: 0 0 28px #ae8bff18; animation: brand-orbit 24s linear infinite; flex-shrink: 0; }
.brand-emblem::before { content: ""; position: absolute; inset: 10px -8px; border: 1px solid #9895bd; border-radius: 50%; }
.brand-emblem::after { content: ""; position: absolute; width: 5px; height: 5px; background: #e0dfff; border-radius: 50%; right: -6px; top: 12px; box-shadow: 0 0 15px #b6afff66; }
.brand-emblem i { position: absolute; inset: 13px; border-radius: 50%; background: var(--ink); opacity: .8; }
.header-controls { display: flex; align-items: center; gap: 22px; }
.language-toggle { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; padding: 0; border: 1px solid #c0afff24; border-radius: 10px; background: transparent; color: #bdb4d1; font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; transition: background .2s, border-color .2s, color .2s; }
.language-toggle[lang="ar"] { font-size: 18px; }
.language-toggle:hover { background: #c0afff12; border-color: #9d88b9; color: #eee3ff; }
.local-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: #bbd9d8; padding: 8px 12px; border: 1px solid #90e3dc24; border-radius: 30px; background: #90e3dc06; }
.local-badge i { width: 5px; height: 5px; background: var(--teal); border-radius: 50%; box-shadow: 0 0 10px #9bd8cd66; animation: signal 3s ease-in-out infinite; }
.clear-button { display: flex; align-items: center; gap: 9px; color: #d6dbea; border: 1px solid var(--line); background: #111722; border-radius: 9px; padding: 9px 13px; font-size: 12px; transition: border-color .2s, background .2s; }
.clear-button .icon { width: 16px; height: 16px; }
.clear-button:hover { border-color: #5a526e; background: #201c2d; }
kbd { font: 10px var(--font); color: #929ab0; border: 1px solid #ffffff13; padding: 2px 4px; border-radius: 3px; margin-inline-start: 8px; }
.settings { position: relative; z-index: 5; }
.settings summary { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; list-style: none; padding: 10px 4px; min-height: 44px; }
.settings summary::-webkit-details-marker { display: none; }
.settings summary:hover, .settings[open] summary { color: var(--ink); }
.settings summary .icon { width: 17px; height: 17px; transition: transform .35s var(--ease); }
.settings[open] summary .icon { transform: rotate(90deg); }
.settings-menu { position: absolute; top: calc(100% + 14px); inset-inline-end: 0; width: 282px; padding: 20px; background: #171d30; border: 1px solid #555074; border-radius: 18px; box-shadow: 0 18px 60px #0009; animation: settle .25s var(--ease); }
.settings-menu label { font-size: 13px; }
.idle-select { position: relative; margin-top: 9px; }
#idle-time { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid #695981; border-radius: 11px; background: #0e1424; color: #e8defa; text-align: start; font-size: 13px; }
.select-chevron { width: 7px; height: 7px; border-inline-end: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
[dir="rtl"] .select-chevron { transform: rotate(-45deg); }
#idle-time[aria-expanded="true"] .select-chevron { transform: rotate(225deg); }
[dir="rtl"] #idle-time[aria-expanded="true"] .select-chevron { transform: rotate(135deg); }
.idle-options { position: absolute; z-index: 20; inset-inline: 0; top: calc(100% + 6px); padding: 5px; border: 1px solid #75628e; border-radius: 12px; background: #202039; box-shadow: 0 12px 28px #0007; animation: settle .18s var(--ease); }
.idle-options button { position: relative; display: block; width: 100%; min-height: 40px; padding: 9px 12px; padding-inline-end: 30px; border: 0; border-radius: 8px; text-align: start; background: transparent; color: #cfc9df; font-size: 13px; }
.idle-options button:hover, .idle-options button:focus-visible { outline: none; background: #c0afff1f; color: #fff; }
.idle-options button[aria-selected="true"] { color: #ede1ff; background: #b79be626; }
.idle-options button[aria-selected="true"]::after { content: "✓"; position: absolute; inset-inline-end: 11px; color: #b9eadc; }
.settings-menu p { font-size: 12px; color: var(--muted); line-height: 1.75; margin: 13px 0 0; }
.intro { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 18px 0; animation: enter .85s .08s var(--ease) backwards; }
.eyebrow { color: var(--accent); font-size: 11px; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.eyebrow > span:first-child { width: 15px; height: 1px; background: var(--accent); }
h1 { font-size: clamp(27px, 2.6vw, 36px); font-weight: 700; line-height: 1.5; margin: 0; letter-spacing: 0; }
h1 > span:not([data-i18n]) { color: #c5b7ff; background: linear-gradient(110deg, #e6deff 10%, #b49bf3 45%, #91d7e2 75%, #e6deff); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: spectral-flow 14s ease-in-out infinite; }
.intro p { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 6px 0 0; }
.intro-seal { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid #a994e72b; border-radius: 18px; background: linear-gradient(125deg, #b29be80b, #7bc9e308); flex-shrink: 0; }
.seal-mark { display: grid; place-items: center; width: 46px; height: 46px; position: relative; flex-shrink: 0; }
.seal-ring { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #bfa7fa32; stroke-width: 2.2; animation: orbit-travel 16s linear infinite; }
.seal-ring .seal-arc { stroke: #c0afff; stroke-dasharray: 25 75; stroke-linecap: round; }
.seal-ring-inner { inset: 7px; width: calc(100% - 14px); height: calc(100% - 14px); stroke: #90e3dc25; stroke-width: 3; animation-duration: 12s; animation-direction: reverse; }
.seal-ring-inner .seal-arc { stroke: #90e3dc; }
.seal-mark .icon { width: 25px; height: 25px; color: var(--teal); }
.intro-seal div > span { font-size: 14px; display: block; color: #e2e4f3; }
.intro-seal small { color: var(--muted); font-size: 12px; }
/* Paint one rounded frame with native background layers; no XOR mask seam. */
.vault { position: relative; isolation: isolate; border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, conic-gradient(from var(--frame-angle), #383047 0deg 265deg, #685381 295deg, #dfcaff 325deg, #91e3ee 345deg, #383047 360deg) border-box; border-radius: 26px; overflow: hidden; box-shadow: 0 30px 100px #0005; animation: enter .9s .16s var(--ease) backwards, frame-orbit 8s linear infinite; }
.console-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 70px; padding: 10px 24px; border-bottom: 1px solid #bba2f21b; background: linear-gradient(105deg,#24223a,#171c2c 65%,#212039); }
.mode-tabs { display: flex; padding: 5px; border: 1px solid #c0afff1f; background: #0b1020; border-radius: 14px; gap: 5px; }
.mode-tabs button { display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 125px; border: 1px solid transparent; border-radius: 7px; padding: 9px 15px; color: var(--muted); background: transparent; font-size: 13px; transition: background .25s, color .25s, border-color .25s; }
.mode-tabs .icon { width: 17px; height: 17px; }
.mode-tabs button:hover { color: var(--ink); }
.mode-tabs button .icon { transition: transform .3s var(--ease); }
.mode-tabs button:hover .icon { transform: translateY(-2px) rotate(-8deg); }
.mode-tabs button[aria-selected="true"] { color: #f0eaff; background: linear-gradient(120deg,#423454,#292b49); border-color: #c4a9f24d; box-shadow: 0 3px 14px #0004, 0 1px 0 #ffffff0d inset; }
.console-label { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 9px; }
.console-label .icon { width: 14px; height: 14px; color: #a59aba; stroke-width: 1.5; }
.operation-panel { animation: settle .35s ease-out; }
.workspace-grid { display: grid; grid-template-columns: 1.04fr 1fr; }
.composer { padding: 32px; min-width: 0; background: linear-gradient(160deg,#1a1e3000,#b29bf805); }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-kicker { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
h2 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.6; }
.type-picker { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid #c0afff2b; border-radius: 11px; background: #0b1020; flex-shrink: 0; }
.type-picker button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 5px 12px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; white-space: nowrap; transition: background .25s, border-color .25s, color .25s, transform .25s; }
.type-picker button[aria-pressed="true"] { background: #413453; border-color: #bca4eb55; color: #f0e8ff; }
.type-picker button:hover:not(:disabled) { color: #fff; transform: translateY(-1px); }
.type-picker bdi { unicode-bidi: isolate; }
label { display: block; font-size: 12px; margin-bottom: 8px; }
.input-surface { background: #0b101c; border: 1px solid #45435e; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 22px #0002 inset; transition: border-color .3s, box-shadow .3s; }
.input-surface:focus-within { border-color: #b39add; box-shadow: 0 0 0 4px #b6afff0c, 0 0 32px #b6afff08; }
.input-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px 0; color: var(--muted); font-size: 10px; }
.input-caption label { font-size: 11px; margin: 0; color: #b2bbce; }
textarea { display: block; width: 100%; border: 1px solid #2b3243; background: #0b101a; color: var(--ink); border-radius: 8px; padding: 15px 17px; resize: none; min-height: 160px; line-height: 1.9; font-size: 14px; }
textarea::placeholder, input::placeholder { color: #717d96; opacity: 1; }
.input-surface textarea { border: 0; border-radius: 0; min-height: 198px; background: none; outline: none; }
#plain-input { unicode-bidi: plaintext; text-align: start; }
/* With no text, place the caret at the UI's starting edge; writing restores auto bidi. */
#plain-input:placeholder-shown { direction: inherit; unicode-bidi: normal; }
#plain-input[data-empty-line-caret] { caret-color: transparent; }
.empty-line-caret { position: absolute; z-index: 1; width: 1px; background: var(--ink); pointer-events: none; user-select: none; animation: caret-blink 1s steps(1, end) infinite; }
.text-caret-measure, .text-direction-probe { position: fixed; top: 0; left: -100000px; visibility: hidden; pointer-events: none; }
.text-direction-probe { width: 0; height: 0; overflow: hidden; contain: strict; }
.text-caret-measure { margin: 0; border: 0; box-sizing: border-box; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; unicode-bidi: plaintext; text-align: start; }
@keyframes caret-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.text-entry { position: relative; }
/* A sibling hint follows UI direction instead of the textarea's automatic bidi context. */
#plain-input::placeholder { color: transparent; opacity: 0; }
.input-placeholder { position: absolute; inset-block-start: 15px; inset-inline: 17px; color: #717d96; font-size: 14px; line-height: 1.9; direction: inherit; unicode-bidi: isolate; text-align: start; pointer-events: none; user-select: none; }
#plain-input:focus + .input-placeholder,
#plain-input:not(:placeholder-shown) + .input-placeholder { display: none; }
.input-limit { display: block; padding: 0 17px 12px; color: #9aa7c0; font-size: 12px; }
.split-option { display: flex; align-items: center; gap: 13px; padding: 16px 14px; margin: 18px 0; cursor: pointer; border: 1px solid #b9a5f01c; border-radius: 14px; background: #b9a5f005; transition: background .25s, border-color .25s; }
.split-option:hover { background: #b9a5f00b; border-color: #b9a5f04d; }
.split-option:has(input:checked) { background: #b9a5f011; border-color: #b9a5f05c; }
.split-symbol { display: flex; align-items: center; direction: ltr; padding-left: 4px; }
.split-symbol i { display: grid; place-items: center; width: 23px; height: 26px; border: 1px solid #4b4d6b; border-radius: 4px; background: #1c2032; font-size: 10px; font-style: normal; color: #c8c2f8; transform: rotate(-8deg); }
.split-symbol i + i { transform: rotate(10deg); margin-left: -6px; background: #131927; }
.split-copy { flex: 1; }
.split-copy strong { font-weight: 400; font-size: 12px; display: block; }
.split-copy small { color: var(--muted); font-size: 12px; display: block; margin-top: 4px; }
input[type="checkbox"] { accent-color: #b6afff; width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
input[role="switch"] { appearance: none; -webkit-appearance: none; width: 32px; height: 18px; background: #34394b; border: 1px solid #4b5163; border-radius: 20px; position: relative; margin: 0; transition: background .2s, border-color .2s; }
input[role="switch"]::after { content: ""; position: absolute; top: 3px; right: 3px; width: 10px; height: 10px; border-radius: 50%; background: #9aa3b9; transition: transform .2s, background .2s; }
input[role="switch"]:checked { background: #b2aafa; border-color: #b2aafa; }
input[role="switch"]:checked::after { transform: translateX(-14px); background: #242035; }
.primary { position: relative; isolation: isolate; overflow: hidden; color: #19182b; background: linear-gradient(110deg,#bca5ef,#e1d5ff 48%,#aad7ed); border: 1px solid #e0dcff99; border-radius: 13px; min-height: 60px; padding: 13px 17px; font-size: 15px; font-weight: 700; box-shadow: 0 5px 24px #aaa0ff16; transition: transform .3s var(--ease), box-shadow .3s, filter .3s; }
.primary::before { content: ""; position: absolute; z-index: -1; inset: 0; width: 35%; background: linear-gradient(105deg,transparent,#ffffff55,transparent); transform: translateX(-150%) skewX(-18deg); animation: button-sheen 7s ease-in-out infinite; pointer-events: none; }
.primary .action-label { position: relative; z-index: 1; width: 100%; padding: 0 28px; text-align: center; text-shadow: 0 1px 8px #e7deff; }
.primary .action-symbol, .primary .action-arrow { position: absolute; top: calc(50% - 8.5px); z-index: 1; }
.primary .action-symbol { inset-inline-start: 17px; }
.primary .action-arrow { inset-inline-end: 17px; }
.button-code { border-radius: inherit; position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; user-select: none; opacity: .17; mask-image: linear-gradient(90deg,#000, #000 10%,#0002 35%,#0002 65%,#000 90%); transition: opacity .3s; }
.code-stream { position: absolute; left: -30%; width: max-content; white-space: pre; font: 400 11px/1.2 var(--font); font-variant-numeric: tabular-nums; letter-spacing: 2px; color: #252340; animation: code-flow 14s linear infinite; }
.code-stream:nth-child(1) { top: 3px; }
.code-stream:nth-child(2) { top: calc(50% - 6px); animation-duration: 19s; animation-delay: -7s; animation-direction: reverse; }
.code-stream:nth-child(3) { bottom: 3px; animation-duration: 17s; animation-delay: -10s; }
#decrypt .code-stream { animation-direction: reverse; }
#decrypt .code-stream:nth-child(2) { animation-direction: normal; }
.primary:hover .button-code { opacity: .28; }
.primary[data-feedback="working"] .button-code { opacity: .36; }
.primary[data-feedback="working"] .code-stream { animation-duration: 3s; }
.primary[data-feedback="working"] { opacity: 1; cursor: wait; animation: action-processing 1.2s ease-in-out infinite; }
.primary[data-feedback="working"] .action-symbol { animation: rotate 1s linear infinite; }
.primary[data-feedback="working"] .action-arrow { opacity: 0; }
.primary[data-feedback="success"] { background: linear-gradient(110deg,#9fdfcc,#c5f1df,#a9e1e9); border-color: #c6ffec; animation: action-confirm .5s var(--ease); }
.primary[data-feedback="success"] .action-symbol { animation: success-arrive .5s var(--ease); }
.primary[data-feedback="success"] .action-arrow, .primary[data-feedback="error"] .action-arrow { opacity: 0; }
.primary[data-feedback="success"]::after { content: ""; position: absolute; inset: 0; border-radius: 12px; background: #e4fff6; pointer-events: none; animation: confirmation-flash .6s var(--ease) both; }
.primary[data-feedback="error"] { background: linear-gradient(110deg,#edb4c3,#f5d7df); border-color: #f3a7b3; animation: action-error .35s ease-out; }
.primary .icon { width: 17px; height: 17px; }
.primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 5px 25px #b6afff20; transform: translateY(-1px); }
.primary:active:not(:disabled) { transform: translateY(1px); }
.primary .action-arrow { transition: transform .22s; }
.primary:hover .action-arrow { transform: translateX(-4px); }
.wide { width: 100%; display: grid; place-items: center; }
.composer-note { display: flex; justify-content: center; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin: 15px 0 0; }
.composer-note .icon { width: 13px; height: 13px; }
.output-zone { min-width: 0; display: flex; flex-direction: column; border-inline-start: 1px solid #b9a5f022; position: relative; background: radial-gradient(ellipse at 50% 32%,#5b3f822b,transparent 65%), linear-gradient(155deg,#131828,#0c1220); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; flex: 1; padding: 30px 24px; min-height: 498px; }
.vault-dial { width: 230px; height: 230px; position: relative; display: grid; place-items: center; margin-bottom: 28px; }
.vault-dial::before { content: ""; position: absolute; inset: 25px; background: radial-gradient(circle,#b697ff30,transparent 67%); border-radius: 50%; box-shadow: 0 0 60px #8175c310; animation: halo-breathe 6s ease-in-out infinite; }
.vault-dial::after { content: ""; position: absolute; inset: -16px; border: 1px solid #bca5ee0e; border-radius: 50%; }
/* Stationary SVG circles stay vector-rasterized; only the stroke offset moves. */
.dial-orbit, .dial-ticks { position: absolute; overflow: visible; fill: none; }
/* Dash lengths and strokes share SVG coordinates at every responsive size. */
.orbit-outer { inset: 0; width: 100%; height: 100%; stroke-dashoffset: 0; animation: orbit-travel 22s linear infinite; }
.orbit-track { stroke: #9c85bf45; stroke-width: .65; }
.orbit-arc { stroke: #d0b5ff; stroke-width: .65; stroke-dasharray: 25 75; stroke-linecap: round; }
.orbit-satellite { stroke: #e1cdff; stroke-width: 3; stroke-dasharray: .01 99.99; stroke-linecap: round; }
.orbit-inner { inset: 17px; width: calc(100% - 34px); height: calc(100% - 34px); stroke: #79cbd04d; stroke-width: .75; stroke-dasharray: 1 3; stroke-linecap: round; animation: orbit-travel 32s linear infinite reverse; }
.dial-ticks { inset: 32px; width: calc(100% - 64px); height: calc(100% - 64px); stroke: #b5a0d266; stroke-width: 1.5; stroke-dasharray: .2 3.966667; stroke-linecap: round; animation: orbit-travel 80s linear infinite; }
.dial-core { width: 90px; height: 90px; border: 1px solid #af95dc77; border-radius: 28px; display: grid; place-items: center; background: linear-gradient(135deg,#3c2f56,#1b2438); box-shadow: 0 12px 40px #0004,0 1px 0 #e7cfff26 inset; transform: rotate(-5deg); animation: core-float 7s ease-in-out infinite; }
.dial-core .icon { width: 31px; height: 31px; color: #ccc5f5; transform: rotate(5deg); }
.dial-point { position: absolute; width: 4px; height: 4px; background: #c4bced; border-radius: 50%; box-shadow: 0 0 9px #c4bced66; animation: signal 4s ease-in-out infinite; }
.point-a { top: 27px; right: 27px; }
.point-b { bottom: 28px; left: 27px; width: 3px; height: 3px; opacity: .5; }
.empty-kicker { color: #9891b2; font-size: 9px; letter-spacing: 2.2px; margin-bottom: 11px; }
html[lang="ar"] .empty-kicker { letter-spacing: 0; font-size: 11px; }
.empty-state h3 { font-size: 23px; font-weight: 700; margin: 0 0 9px; }
.empty-state p { color: var(--muted); font-size: 14px; line-height: 1.9; margin: 0; }
.empty-divider { height: 1px; width: 28px; background: #44415b; margin: 24px 0 15px; }
.empty-state small { color: #8893ab; font-size: 10px; }
.result { padding: 29px; animation: result-arrive .6s var(--ease) backwards; }
.result > * { animation: settle .5s .08s var(--ease) backwards; }
.result > .key-block, .result > .result-actions { animation-delay: .16s; }
.result-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.result-heading h3 { margin: 0; font-size: 20px; font-weight: 700; }
.result-heading .section-kicker { font-size: 10px; margin-bottom: 3px; color: #a2c9c1; }
.success-icon { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid #9bd8cd38; border-radius: 50%; background: #17322d5c; color: var(--teal); flex-shrink: 0; }
.success-icon .icon { width: 17px; height: 17px; }
.success-icon { animation: success-arrive .65s var(--ease) backwards; }
#encrypted-size { margin-inline-start: auto; font-size: 10px; white-space: nowrap; color: var(--muted); }
.key-notice { font-size: 13px; color: #d4cce8; padding: 14px 16px; border: 1px solid #a899cb38; background: #9b82c50e; border-radius: 12px; line-height: 1.85; margin-bottom: 20px; }
.key-block { margin: 18px 0; }
.key-block > label { font-size: 11px; color: #bec6d9; }
.secret-row { display: flex; align-items: center; overflow: hidden; background: #080d16; background-clip: padding-box; border: 1px solid #394155; border-radius: 10px; padding-inline-end: 4px; }
.secret-row:focus-within { border-color: #b09bcf; }
.secret-row > input[type] { border-radius: 0; background: transparent; }
.secret-row > input:focus, .secret-row > input:focus-visible { outline: none; box-shadow: none; }
input[type="password"], input[type="text"] { width: 100%; min-width: 0; background: transparent; color: #d3d8ed; border: 0; border-radius: 7px; padding: 11px 12px; font-size: 12px; line-height: 1.8; letter-spacing: .5px; }
.secret-row .quiet { flex-shrink: 0; padding: 6px 10px; font-size: 11px; }
.icon-button { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; padding: 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #c6b9e8; transition: background .2s, border-color .2s; }
.icon-button:hover { background: #b6afff15; border-color: #b6afff35; color: #e0dbff; }
.icon-button .icon { width: 17px; height: 17px; }
.quiet { color: #b7b1d9; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 9px 11px; font-size: 12px; transition: background .2s, color .2s; }
.quiet:hover { background: #b6afff0a; color: #e0dbff; }
.key-save { background: #c0afff10; border: 1px solid #b6afff44; border-radius: 9px; padding: 9px 14px; color: #d6cdff; font-size: 13px; margin-top: 10px; transition: background .2s, border-color .2s; }
.key-save:hover { border-color: var(--accent); }
.cipher { font-size: 11px; line-height: 1.9; word-break: break-all; letter-spacing: .5px; }
#cipher-output { min-height: 125px; max-height: 240px; }
#cipher-text-group > label { font-size: 11px; color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 17px; }
.secondary { border: 1px solid #47415e; border-radius: 7px; color: #e1dcf4; background: #292439; padding: 9px 14px; font-size: 12px; transition: background .2s, border-color .2s; }
.secondary:hover { border-color: #9082b0; background: #342c48; }
.console-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 25px; background: #141a2a; border-top: 1px solid #b9a5f01c; min-height: 58px; }
.status-wrap { display: flex; align-items: center; gap: 9px; }
.status-indicator { height: 5px; width: 5px; flex-shrink: 0; background: var(--teal); border-radius: 50%; animation: signal 4s ease-in-out infinite; }
.status { color: #99a6ba; font-size: 11px; overflow-wrap: anywhere; }
.status[data-type="error"] { color: #f3a7b3; }
.status[data-type="success"] { color: #aacfc7; }
body[data-state="error"] .status-indicator { background: #f3a7b3; }
body[data-state="working"] .status-indicator, body[data-state="loading"] .status-indicator { background: var(--accent); animation: pulse 1.25s ease-in-out infinite; }
body[data-state="working"] .dial-core { animation: core-float 7s ease-in-out infinite, breathe 1.2s ease-in-out infinite; }
.self-test { display: flex; align-items: center; gap: 7px; color: var(--muted); background: transparent; border: 0; font-size: 11px; white-space: nowrap; padding: 5px 0; }
.self-test .icon { height: 14px; width: 14px; transition: transform .45s; }
.self-test:hover { color: #c5bfeb; }
.self-test:hover .icon { transform: rotate(-100deg); }
.file-area { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #7c669a; border-radius: 16px; background: radial-gradient(ellipse at 50% 0%,#b99bf011,transparent 70%),#0b101c; min-height: 270px; padding: 28px 17px; text-align: center; transition: border-color .3s; }
.file-area:hover { border-color: #c0afff; }
.upload-icon .icon { animation: upload-float 4s ease-in-out infinite; }
.upload-icon { display: grid; place-items: center; width: 47px; height: 47px; border: 1px solid #b6afff26; color: #bdb3f4; background: #b6afff08; border-radius: 12px; margin-bottom: 17px; }
.file-area label { font-size: 15px; }
.file-area p { font-size: 10px; color: var(--muted); margin: 15px 0 0; }
.file-control { display: flex; align-items: center; gap: 10px; max-width: 100%; min-width: 0; }
.file-choose { flex-shrink: 0; min-height: 38px; padding: 8px 12px; border: 1px solid #776089; border-radius: 9px; background: #30263f; color: #e5d5ff; font-size: 12px; transition: background .2s, border-color .2s; }
.file-choose:hover:not(:disabled) { background: #443350; border-color: #ba9cd8; }
.file-name { min-width: 0; overflow-wrap: anywhere; text-align: start; color: #aeb8cf; font-size: 12px; unicode-bidi: isolate; }
.file-area .file-control { flex-wrap: wrap; justify-content: center; }
.input-key { margin-top: 22px; }
.import-label { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; color: var(--muted); font-size: 10px; margin-top: 9px; }
.import-label .file-control { flex: 1 1 220px; }
.check-row { display: flex; align-items: center; gap: 10px; color: #c4c8d9; font-size: 12px; margin: 15px 0 20px; cursor: pointer; }
.check-row input[type="checkbox"] { appearance: none; -webkit-appearance: none; display: grid; place-items: center; flex-shrink: 0; width: 20px; height: 20px; margin: 0; border: 1px solid #756987; border-radius: 6px; background: #141a28; transition: background .18s, border-color .18s; }
.check-row input[type="checkbox"]::after { content: ""; width: 5px; height: 9px; border: solid #211c31; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg) scale(.6); opacity: 0; transition: transform .18s var(--ease), opacity .18s; }
.check-row input[type="checkbox"]:checked { background: #c5b3ef; border-color: #d2c0fa; }
.check-row input[type="checkbox"]:checked::after { transform: translateY(-1px) rotate(45deg) scale(1); opacity: 1; }
.check-row input[type="checkbox"]:focus-visible { outline: 1px solid #c5b3ef; outline-offset: 3px; }
.check-row input[type="checkbox"]:disabled { opacity: .5; cursor: wait; }
.verified-note { color: var(--muted); font-size: 12px; margin: 0 0 24px; }
.recovered-file { overflow-wrap: anywhere; padding: 24px; background: #131e27; border: 1px solid #395655; border-radius: 10px; color: var(--teal); font-size: 15px; }
#plain-output { min-height: 250px; }
footer { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 20px; padding: 25px 3px 32px; color: #a0a9bf; font-size: 11px; animation: enter .8s .3s var(--ease) backwards; }
footer > span { display: flex; align-items: center; gap: 7px; }
footer .icon { width: 13px; height: 13px; }
.footer-credit { justify-content: center; text-align: center; }
.footer-signature { justify-self: end; }
.footer-wordmark { font-family: var(--font); font-weight: 400; font-size: 9px; line-height: 1.65; letter-spacing: 1.7px; color: #a69bbd; }
.footer-signature i { height: 2px; width: 2px; border-radius: 50%; background: #8a86a1; margin: 0 6px; }
html[dir="ltr"] .action-arrow { scale: -1 1; }
html[dir="ltr"] .primary:hover .action-arrow { transform: translateX(-4px); }

/* Keep corner fills inside borders, including states that reset background. */
:where(button, textarea, input, .local-badge, .intro-seal, .settings-menu,
  .idle-options, .mode-tabs, .type-picker, .input-surface, .split-option,
  .split-symbol i, .dial-core, .success-icon, .key-notice, .secret-row,
  .file-area, .upload-icon, .recovered-file) { background-clip: padding-box !important; }

@keyframes enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes nebula-drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(9%,12%,0) scale(1.12); } }
@keyframes starlight { from { opacity: .16; transform: translateY(0); } to { opacity: .32; transform: translateY(14px); } }
@keyframes brand-orbit { from { transform: rotate(-38deg); } to { transform: rotate(322deg); } }
@keyframes signal { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes spectral-flow { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes frame-orbit { to { --frame-angle: 360deg; } }
@keyframes action-processing { 0%,100% { box-shadow: 0 0 0 0 #bcadff00; } 50% { box-shadow: 0 0 0 4px #bcadff22, 0 0 24px #bcadff22; } }
@keyframes action-confirm { 0% { transform: scale(.98); } 55% { transform: scale(1.012); } 100% { transform: scale(1); } }
@keyframes confirmation-flash { from { opacity: .45; } to { opacity: 0; } }
@keyframes action-error { 25% { transform: translateX(3px); } 75% { transform: translateX(-3px); } }
@keyframes button-sheen { 0%,60% { transform: translateX(-150%) skewX(-18deg); } 90%,100% { transform: translateX(400%) skewX(-18deg); } }
@keyframes code-flow { from { transform: translateX(-8%); } to { transform: translateX(8%); } }
@keyframes halo-breathe { 0%,100% { opacity: .5; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes core-float { 0%,100% { transform: translateY(3px) rotate(-5deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
@keyframes upload-float { 0%,100% { transform: translateY(2px); } 50% { transform: translateY(-3px); } }
@keyframes result-arrive { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes success-arrive { from { opacity: 0; transform: scale(.75) rotate(-20deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes settle { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes orbit-travel { to { stroke-dashoffset: -100; } }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .3; box-shadow: 0 0 10px #b6afff55; } }
@keyframes breathe { 50% { box-shadow: 0 0 35px #b6afff24; border-color: #c5b8ebaa; } }

@media (max-width: 1080px) {
  .shell { padding: 0 30px; }
  .header-controls { gap: 16px; }
  .local-badge { display: none; }
  .composer, .result { padding: 26px; }
  .split-option { gap: 10px; }
  .split-copy small { max-width: 230px; }
  .intro { padding-top: 18px; }
}
@media (max-width: 900px) {
  .shell { max-width: 680px; padding: 0 22px; }
  .masthead { min-height: 80px; }
  .brand-caption { display: none; }
  .brand-name { font-size: 19px; letter-spacing: 3px; }
  .brand-emblem { width: 31px; height: 31px; }
  .brand-emblem::before { inset: 8px -7px; }
  .brand-emblem::after { top: 10px; }
  .brand-emblem i { inset: 11px; }
  .brand { gap: 12px; }
  .header-controls { gap: 15px; }
  .settings summary > span { display: none; }
  kbd { display: none; }
  .clear-button { padding: 9px 10px; font-size: 11px; }
  .intro { padding: 20px 0; }
  .intro-seal { display: none; }
  h1 { font-size: 30px; }
  .workspace-grid { grid-template-columns: 1fr; }
  .output-zone { border-inline-start: 0; border-top: 1px solid #262d3e; }
  .empty-state { min-height: 320px; padding: 32px 20px; }
  .vault-dial { width: 142px; height: 142px; margin-bottom: 20px; }
  .orbit-inner { inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); }
  .dial-ticks { inset: 22px; width: calc(100% - 44px); height: calc(100% - 44px); }
  .dial-core { width: 59px; height: 59px; border-radius: 18px; }
  .dial-core .icon { width: 23px; height: 23px; }
  .point-a { top: 18px; right: 17px; }
  .point-b { bottom: 19px; left: 16px; }
  .empty-state h3 { font-size: 21px; }
  .empty-divider, .empty-state > small { display: none; }
  .console-bar { padding: 16px 22px; }
  .mode-tabs button { min-width: 118px; }
  .console-label { font-size: 10px; }
  .console-footer { padding: 15px 22px; }
  footer { display: flex; flex-wrap: wrap; justify-content: space-between; font-size: 10px; }
  .footer-credit { width: 100%; order: 3; margin-top: 2px; }
  .footer-wordmark { font-size: 9px; letter-spacing: 1px; }
}
@media (max-width: 480px) {
  .shell { padding: 0 16px; }
  .masthead { min-height: 100px; gap: 12px; flex-wrap: wrap; padding-block: 20px; }
  .brand-name { font-size: 17px; }
  .brand-emblem { width: 26px; height: 26px; }
  .brand-emblem::before { inset: 6px -6px; }
  .brand-emblem::after { top: 8px; right: -5px; width: 4px; height: 4px; }
  .brand-emblem i { inset: 9px; }
  .header-controls { gap: 10px; width: 100%; justify-content: flex-start; }
  .settings summary > span { display: inline; }
  .clear-button { padding: 8px; margin-inline-start: auto; }
  .clear-button .icon { display: none; }
  .settings { position: static; }
  .settings-menu { position: absolute; top: calc(100% + 8px); inset-inline: 0; width: auto; max-width: 330px; margin: 0 auto; }
  h1 { font-size: 27px; letter-spacing: 0; }
  .intro p { font-size: 13px; line-height: 1.8; }
  .eyebrow { font-size: 10px; margin-bottom: 10px; }
  .vault { border-radius: 20px; }
  .console-bar { min-height: 75px; padding: 13px 17px; }
  .mode-tabs { width: 100%; }
  .mode-tabs button { width: 50%; min-width: 0; }
  .console-label { display: none; }
  .composer, .result { padding: 23px 18px; }
  h2 { font-size: 21px; }
  .section-head { gap: 10px; }
  .type-picker button { padding: 5px 10px; }
  .split-copy strong { font-size: 12px; }
  .split-copy small { font-size: 12px; }
  .split-symbol { display: none; }
  .primary { font-size: 14px; }
  .composer-note { font-size: 11px; align-items: flex-start; text-align: center; }
  .composer-note .icon { margin-top: 3px; }
  .console-footer { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 20px; }
  .self-test { align-self: flex-end; font-size: 10px; }
  .result-heading h3 { font-size: 18px; }
  .result-heading { gap: 8px; flex-wrap: wrap; }
  #encrypted-size { font-size: 9px; }
  footer { flex-direction: column; align-items: center; gap: 13px; padding-top: 22px; }
}

/* Desktop app frame: the workspace scrolls when necessary, not the whole page. */
@media (min-width: 901px) and (min-height: 600px) {
  body { overflow: hidden; }
  .shell { height: 100dvh; display: flex; flex-direction: column; }
  .masthead { flex: 0 0 92px; }
  main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .intro, footer { flex-shrink: 0; }
  .intro p { white-space: nowrap; }
  .vault { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .console-bar, .console-footer { flex-shrink: 0; }
  .operation-panel { flex: 1; min-height: 0; }
  .workspace-grid { height: 100%; min-height: 0; }
  .composer, .output-zone { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #655778 transparent; }
  .composer, .result { padding: 20px 24px; }
  .input-surface textarea { min-height: 110px; height: clamp(110px, 19dvh, 220px); }
  .file-area { min-height: 180px; }
  .split-option { padding: 11px 12px; margin: 12px 0; }
  .composer-note { margin-top: 10px; }
  .empty-state { min-height: 100%; flex-shrink: 0; padding: 24px; }
  .vault-dial { flex-shrink: 0; width: clamp(130px, 22dvh, 200px); height: clamp(130px, 22dvh, 200px); margin-bottom: 20px; }
  .empty-divider { margin: 15px 0 10px; }
  .console-footer { min-height: 46px; padding: 10px 24px; }
  footer { padding: 14px 3px; }
}
