:root {
  color-scheme: dark;
  --page: #080a15;
  --surface: #101428;
  --surface-raised: #141a31;
  --surface-hover: #1a2240;
  --surface-input: #0c1021;
  --border: rgba(164, 174, 229, .14);
  --border-strong: rgba(164, 174, 229, .24);
  --text: #f4f5ff;
  --text-soft: #c8cbea;
  --muted: #9ba2c2;
  --muted-2: #777f9f;
  --violet: #b3a6ff;
  --violet-strong: #8b75ff;
  --cyan: #72e2d8;
  --green: #70dfad;
  --shadow: 0 22px 70px rgba(0, 0, 0, .30);
  --font-ar: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', system-ui, 'Segoe UI', Tahoma, sans-serif;
  --font-en: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: radial-gradient(ellipse at 82% -16%, rgba(78, 61, 166, .22), transparent 43%), radial-gradient(ellipse at 3% 74%, rgba(15, 112, 126, .10), transparent 34%), var(--page);
  color: var(--text);
  font-family: var(--font-ar);
  font-size: 14px;
  line-height: 1.6;
  transition: background-color .22s ease, color .22s ease;
}
body[data-language="en"] { font-family: var(--font-en); }
button, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
::selection { color: #fff; background: rgba(139, 117, 255, .52); }

body[data-theme="light"] {
  color-scheme: light;
  --page: #f4f5ff;
  --surface: #fff;
  --surface-raised: #f5f4ff;
  --surface-hover: #eeedff;
  --surface-input: #fbfbff;
  --border: rgba(67, 69, 132, .14);
  --border-strong: rgba(67, 69, 132, .23);
  --text: #1a1b34;
  --text-soft: #414665;
  --muted: #656c8d;
  --muted-2: #7d84a2;
  --violet: #6555d7;
  --violet-strong: #604de0;
  --cyan: #087f86;
  --green: #17825b;
  --shadow: 0 18px 55px rgba(45, 41, 110, .10);
  background: radial-gradient(ellipse at 82% -16%, rgba(126, 106, 235, .13), transparent 42%), radial-gradient(ellipse at 3% 74%, rgba(33, 178, 172, .08), transparent 34%), var(--page);
}

.ambient { position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(100px); }
.ambient-one { width: min(420px, 100vw); height: min(420px, 100vw); top: -285px; right: 0; opacity: .10; background: #735bff; }
.ambient-two { width: min(340px, 100vw); height: min(340px, 100vw); top: 410px; left: 0; opacity: .055; background: #18c9bd; }
.app-shell { width: min(1100px, calc(100% - 48px)); margin-inline: auto; }

.topbar { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid rgba(161, 146, 255, .26); border-radius: 13px; background: linear-gradient(145deg, rgba(125, 101, 255, .18), rgba(56, 200, 194, .09)); box-shadow: 0 5px 22px rgba(105, 87, 225, .16); }
.brand-mark svg { width: 34px; height: 34px; }
.brand-copy { display: grid; line-height: 1.3; }
.brand-copy strong { font-size: 16px; letter-spacing: -.035em; }
.brand-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.privacy-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); background: rgba(255,255,255,.025); font-size: 10px; white-space: nowrap; }
.privacy-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(112,223,173,.52); }
.language-toggle, .theme-toggle { height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-strong); border-radius: 10px; color: var(--text-soft); background: var(--surface); cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease; }
.language-toggle { min-width: 47px; padding: 0 10px; font-size: 10px; font-weight: 650; letter-spacing: .035em; }
.theme-toggle { width: 36px; }
.language-toggle:hover, .theme-toggle:hover { transform: translateY(-1px); border-color: rgba(166,151,255,.54); color: var(--text); background: var(--surface-hover); }
.icon { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-moon { display: none; }
body[data-theme="light"] .icon-sun { display: none; }
body[data-theme="light"] .icon-moon { display: block; }

main { padding-top: 14px; }
.workspace-intro { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 2px 11px; }
.intro-copy { min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 7px; margin: 0 0 2px; color: var(--muted); font-size: 10px; }
.eyebrow-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px rgba(114,226,216,.55); }
.workspace-intro h1 { margin: 0; font-size: clamp(21px, 2.5vw, 28px); line-height: 1.4; font-weight: 650; letter-spacing: -.035em; }
.headline-accent { color: transparent; background: linear-gradient(96deg, #c0adff 4%, #7de0d4 98%); background-clip: text; -webkit-background-clip: text; }
body[data-theme="light"] .headline-accent { background-image: linear-gradient(96deg, #6451dc 4%, #087f86 98%); }
.intro-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; white-space: nowrap; }

.tools-suite { margin-top: 2px; }
.tool-tabs { min-width: 0; display: flex; flex-wrap: nowrap; align-items: stretch; gap: 8px; padding: 6px; overflow-x: auto; overflow-y: hidden; border: 1px solid var(--border); border-radius: 14px; background: rgba(16,20,40,.78); box-shadow: 0 8px 28px rgba(0,0,0,.09); overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scroll-padding-inline: 12px; scrollbar-color: rgba(164,174,229,.28) transparent; scrollbar-width: thin; touch-action: pan-x pan-y; }
body[data-theme="light"] .tool-tabs { background: rgba(255,255,255,.82); }
.tool-tabs::-webkit-scrollbar { height: 5px; }
.tool-tabs::-webkit-scrollbar-track { margin-inline: 8px; background: transparent; }
.tool-tabs::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(164,174,229,.28); }
.tool-tabs::-webkit-scrollbar-thumb:hover { background: rgba(164,174,229,.48); }
.tool-tab { flex: 0 0 clamp(150px, 22vw, 220px); min-width: 0; max-width: 260px; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 10px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 550; line-height: 1.35; text-align: start; white-space: normal; scroll-snap-align: start; scroll-margin-inline: 6px; cursor: pointer; transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.tool-tab .icon { width: 16px; height: 16px; color: var(--muted-2); }
.tool-tab > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.tool-tab:hover { color: var(--text); background: var(--surface-hover); }
.tool-tab:active { transform: scale(.985); }
.tool-tab[aria-selected="true"] { border-color: rgba(164,146,255,.32); color: var(--text); background: linear-gradient(110deg, rgba(113,91,235,.23), rgba(44,160,162,.10)); box-shadow: inset 0 1px rgba(255,255,255,.06), 0 4px 15px rgba(58,48,127,.12); }
.tool-tab[aria-selected="true"] .icon { color: var(--violet); }
.tab-glyph { width: 20px; height: 20px; flex: 0 0 20px; display: inline-grid; place-items: center; border: 1px solid rgba(155,137,255,.25); border-radius: 7px; color: var(--cyan); background: rgba(120,100,244,.10); font-size: 12px; font-weight: 700; }
.tool-panels { margin-top: 8px; }
.tool-panel { min-height: 73px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(108deg, rgba(17,23,45,.92), rgba(14,20,37,.82)); box-shadow: 0 7px 22px rgba(0,0,0,.075); }
body[data-theme="light"] .tool-panel { background: linear-gradient(108deg, rgba(255,255,255,.96), rgba(246,247,255,.92)); }
.tool-panel[hidden] { display: none !important; }
.tool-panel:not([hidden]) { animation: panel-enter .18s ease-out both; }
@keyframes panel-enter { from { opacity: .45; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.tool-panel-copy { min-width: 0; }
.tool-panel-copy h2 { margin: 0 0 2px; color: var(--text-soft); font-size: 12px; font-weight: 650; }
.tool-panel-copy p { max-width: 670px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.counter-live-badge { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); background: rgba(112,223,173,.045); font-size: 9px; white-space: nowrap; }
.panel-action { flex: 0 0 auto; min-height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid rgba(172,153,255,.36); border-radius: 9px; color: #fff; background: linear-gradient(105deg, #735ce5, #554cd0); box-shadow: 0 4px 14px rgba(88,70,200,.2); font-size: 10px; font-weight: 600; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.panel-action .icon { width: 15px; height: 15px; color: #fff; }
.panel-action:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(88,70,200,.32); }
.panel-action:active { transform: scale(.98); }

.toolbar { min-height: 48px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)) auto repeat(2, minmax(0,.8fr)) auto repeat(2, minmax(0,.7fr)); align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: linear-gradient(90deg, rgba(113,91,235,.075), rgba(32,147,151,.035)); }
.toolbar-button { min-width: 0; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; border: 1px solid transparent; border-radius: 9px; color: var(--text-soft); background: var(--surface-raised); font-size: 10px; font-weight: 550; cursor: pointer; white-space: nowrap; transition: transform .16s ease, border-color .16s ease, color .16s ease, background .16s ease, box-shadow .16s ease; }
.toolbar-button .icon { width: 15px; height: 15px; color: var(--muted); }
.toolbar-button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--border-strong); color: var(--text); background: var(--surface-hover); }
.toolbar-button:active:not(:disabled) { transform: scale(.97); }
.toolbar-button.toolbar-primary { border-color: rgba(172,153,255,.36); color: #fff; background: linear-gradient(105deg, #735ce5, #554cd0); box-shadow: 0 4px 14px rgba(88,70,200,.24); }
.toolbar-button.toolbar-primary .icon { color: #fff; }
.toolbar-button.toolbar-primary:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(88,70,200,.34); }
.toolbar-button.toolbar-utility { background: transparent; }
.toolbar-button.toolbar-utility .icon { color: var(--cyan); }
.toolbar-button:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.toolbar-divider { width: 1px; height: 23px; justify-self: center; background: var(--border-strong); }
.case-mark, .zoom-mark { position: relative; direction: ltr; color: var(--violet); font-family: var(--font-en); font-size: 12px; font-weight: 700; letter-spacing: -.055em; }
.case-mark span { position: absolute; top: -5px; inset-inline-end: -7px; color: var(--cyan); font-size: 8px; }
.case-lower { color: #ee9fc0; }
.zoom-mark { color: var(--cyan); font-size: 12px; letter-spacing: -.04em; }
.zoom-button { padding-inline: 5px; }

.workspace { width: 100%; margin-top: 9px; }
.editor-card { overflow: hidden; border: 1px solid var(--border-strong); border-radius: 15px; background: linear-gradient(145deg, rgba(18,23,45,.98), rgba(12,16,32,.98)); box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.035); transition: border-color .2s ease, box-shadow .2s ease; }
body[data-theme="light"] .editor-card { background: linear-gradient(145deg, #fff, #f9f9ff); }
.editor-card:focus-within { border-color: rgba(157,139,255,.75); box-shadow: 0 0 0 3px rgba(129,108,255,.10), var(--shadow); }
.editor-topline { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 13px; border-bottom: 1px solid var(--border); }
.editor-label { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 11px; font-weight: 550; }
.editor-label h2 { margin: 0; font-size: 11px; font-weight: 600; }
.live-indicator { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(112,223,173,.55); }
.editor-language { padding: 2px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 9px; font-weight: 400; white-space: nowrap; }
.editor-utilities { display: flex; align-items: center; gap: 4px; }
.utility-button, .clear-button { min-height: 29px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; font-size: 10px; cursor: pointer; white-space: nowrap; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
.utility-button .icon, .clear-button .icon { width: 14px; height: 14px; }
.utility-button:hover, .clear-button:hover { color: var(--text); border-color: var(--border); background: var(--surface-hover); }
.clear-button:hover .icon { color: #ff8ca7; }
.utility-button:active, .clear-button:active { transform: scale(.97); }
textarea { display: block; width: 100%; min-height: 225px; max-height: 58vh; resize: vertical; padding: 16px 18px 13px; border: 0; outline: 0; color: var(--text); background: var(--surface-input); font-size: var(--editor-font-size, 16px); line-height: 1.85; caret-color: var(--violet); transition: background .2s ease; }
textarea::placeholder { color: var(--muted-2); opacity: .95; }
textarea:focus-visible { outline: 0; }
.editor-footer { min-height: 36px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 5px 13px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.editor-hint, .save-status { display: inline-flex; align-items: center; gap: 4px; }
kbd { min-width: 17px; height: 17px; display: inline-grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--text-soft); background: var(--surface-raised); font-family: inherit; font-size: 8px; line-height: 1; }
.save-check { color: var(--green); font-size: 12px; }
.stats-strip { min-height: 50px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; align-items: stretch; margin-top: 8px; overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: var(--border); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.stat-item { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 6px 10px; background: var(--surface); }
.stat-label { color: var(--muted); font-size: 10px; white-space: nowrap; }
.stat-item strong { color: var(--text); direction: ltr; unicode-bidi: isolate; font-size: 14px; font-weight: 650; line-height: 1.25; font-variant-numeric: tabular-nums; transition: transform .16s ease; white-space: nowrap; }
.stat-item strong.bump { animation: stat-bump .2s ease; }
.stat-item strong.reading-value { color: var(--violet); font-size: 11px; font-weight: 600; }
@keyframes stat-bump { 50% { transform: translateY(-1px) scale(1.04); } }

.footer { min-height: 51px; margin-top: 13px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.footer strong { color: var(--text-soft); font-weight: 600; }
.footer-separator { padding-inline: 5px; color: var(--violet); }
.footer-local { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.toast { position: fixed; z-index: 10; inset-inline-start: 50%; bottom: 20px; max-width: calc(100vw - 28px); display: flex; align-items: center; gap: 9px; padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: 12px; color: var(--text); background: var(--surface); box-shadow: 0 12px 38px rgba(0,0,0,.32); font-size: 11px; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .2s ease, transform .2s ease; }
html[dir="rtl"] .toast { transform: translate(50%, 10px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
html[dir="rtl"] .toast.show { transform: translate(50%, 0); }
.toast-icon { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #081a15; background: var(--green); font-size: 11px; font-weight: 750; }
.toast.toast-error .toast-icon { color: #fff; background: #d55279; }
.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; }
.noscript { margin: 15px; padding: 11px; border: 1px solid #d55279; border-radius: 9px; color: var(--text); text-align: center; }

@media (max-width: 850px) {
  .app-shell { width: min(100% - 36px, 690px); }
  .topbar { min-height: 65px; }
  .toolbar { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; padding: 7px 8px; }
  .toolbar-divider { display: none; }
  .toolbar-button { min-height: 35px; }
}

@media (max-width: 700px) {
  .workspace-intro { min-height: 0; flex-direction: column; align-items: flex-start; gap: 4px; padding: 7px 2px 11px; }
  .intro-note { max-width: none; margin: 0; white-space: normal; }
  .tool-tabs { flex-wrap: nowrap; gap: 6px; }
  .tool-tab { flex-basis: clamp(150px, 22vw, 220px); max-width: 260px; min-height: 48px; justify-content: flex-start; }
}

@media (max-width: 680px) {
  .tool-tabs { gap: 6px; }
  .tool-tab { flex-basis: calc((100% - 6px) / 2); max-width: none; min-height: 48px; }
}

@media (max-width: 560px) {
  .app-shell { width: calc(100% - 24px); }
  .topbar { min-height: 60px; gap: 8px; }
  .brand { gap: 7px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-mark svg { width: 30px; height: 30px; }
  .brand-copy strong { font-size: 15px; }
  .brand-copy small { font-size: 9px; }
  .topbar-actions { gap: 6px; }
  .privacy-pill { padding: 5px 7px; gap: 5px; font-size: 8px; }
  .privacy-dot { width: 6px; height: 6px; flex-basis: 6px; }
  .language-toggle, .theme-toggle { height: 33px; }
  .language-toggle { min-width: 39px; padding-inline: 7px; font-size: 9px; }
  .theme-toggle { width: 33px; }
  main { padding-top: 8px; }
  .workspace-intro { min-height: 0; align-items: flex-start; gap: 3px; padding: 6px 2px 8px; }
  .eyebrow { font-size: 8px; }
  .workspace-intro h1 { font-size: clamp(18px, 4.6vw, 22px); }
  .intro-note { max-width: none; margin: 0; font-size: 9px; line-height: 1.45; white-space: normal; }
  .tools-suite { margin-top: 0; }
  .tool-tabs { gap: 5px; padding: 5px; border-radius: 12px; }
  .tool-tab { flex-basis: calc((100% - 5px) / 2); max-width: none; min-height: 48px; gap: 7px; padding: 7px 9px; font-size: 9px; }
  .tool-tabs { flex-direction: column; align-items: stretch; gap: 6px; overflow: visible; overflow-x: visible; overflow-y: visible; scroll-snap-type: none; touch-action: auto; }
  .tool-tab { width: 100%; flex: 0 0 auto; max-width: none; min-height: 48px; justify-content: flex-start; padding-inline: 12px; border-color: var(--border); border-radius: 9px; background: rgba(255,255,255,.025); font-size: 10px; white-space: normal; scroll-snap-align: none; }
  .tool-tab .icon { width: 15px; height: 15px; }
  .tab-glyph { width: 18px; height: 18px; flex-basis: 18px; font-size: 11px; }
  .tool-panels { margin-top: 6px; }
  .tool-panel { min-height: 65px; align-items: stretch; flex-direction: column; gap: 8px; padding: 9px 10px; border-radius: 10px; }
  .tool-panel-copy h2 { font-size: 11px; }
  .tool-panel-copy p { font-size: 9px; }
  .counter-live-badge { align-self: flex-start; gap: 5px; padding: 5px 7px; font-size: 8px; }
  .panel-action { align-self: flex-start; min-height: 34px; gap: 5px; padding-inline: 9px; font-size: 9px; }
  .toolbar { width: 100%; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 5px; padding: 6px; border-radius: 9px; }
  .toolbar-button { min-height: 36px; justify-content: flex-start; gap: 6px; padding-inline: 9px; border-radius: 8px; font-size: 9px; }
  .toolbar-button .icon { width: 14px; height: 14px; }
  .workspace { margin-top: 7px; }
  .editor-card { border-radius: 13px; }
  .editor-topline { min-height: 41px; padding-inline: 9px; }
  .editor-label { gap: 6px; font-size: 9px; }
  .editor-label h2 { font-size: 10px; }
  .editor-language { padding: 1px 5px; font-size: 8px; }
  .utility-button, .clear-button { min-height: 28px; padding-inline: 5px; gap: 3px; font-size: 9px; }
  .utility-button .icon, .clear-button .icon { width: 12px; height: 12px; }
  .zoom-mark { font-size: 11px; }
  textarea { min-height: 205px; max-height: 48vh; padding: 13px 12px; line-height: 1.8; }
  .editor-footer { min-height: 33px; gap: 3px 6px; padding: 4px 9px; font-size: 8px; }
  .stats-strip { grid-template-columns: repeat(2, minmax(0,1fr)); min-height: 82px; margin-top: 7px; border-radius: 10px; }
  .stat-item { justify-content: flex-start; gap: 7px; padding: 5px 10px; }
  .stat-label { font-size: 9px; }
  .stat-item strong { font-size: 12px; }
  .stat-item strong.reading-value { font-size: 9px; }
  .footer { min-height: 43px; margin-top: 10px; font-size: 8px; }
  .toast { bottom: 14px; font-size: 10px; }
}

@media (max-width: 370px) {
  .privacy-pill span:last-child { display: none; }
  .workspace-intro { align-items: flex-start; }
  .workspace-intro h1 { font-size: 17px; }
  .intro-note { max-width: none; font-size: 8px; }
  .editor-language { display: none; }
  .tool-tab { gap: 6px; padding-inline: 8px; font-size: 9px; }
  .tool-panel { align-items: flex-start; flex-direction: column; }
  .counter-live-badge { align-self: flex-start; }
  .panel-action { align-self: flex-start; }
  .toolbar-button { font-size: 8px; }
  .toolbar-button .icon { width: 13px; height: 13px; }
  .stat-item { gap: 5px; padding-inline: 7px; }
  .stat-label { font-size: 8px; }
  .stat-item strong { font-size: 11px; }
  .stat-item strong.reading-value { font-size: 8px; }
  .editor-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
