/* Lenci · Design Studio (/design). Builds on studio.css tokens (canvas, panels, energy gradient, Sora / Inter / Cairo) the way
   memory.css does: top bar → shell (left rail on desktop, segmented tabs under the bar on phones) → one panel per tab, each panel a
   two-column workspace (inputs aside, results). Canvases scale with their card (width 100%, intrinsic aspect); transparent images sit
   on a checkerboard. Logical properties throughout, so Arabic (dir=rtl) mirrors without overrides. */
:root {
  --dg: linear-gradient(135deg, #22d3ee 0%, #8b5cf6 55%, #d946ef 100%);
  --dg-h: linear-gradient(90deg, #a5f3fc 0%, #c9b8ff 55%, #f5c2ff 100%);
  --glass: linear-gradient(180deg, rgba(23,23,35,.9), rgba(14,14,22,.94));
  --check: repeating-conic-gradient(rgba(255,255,255,.07) 0 25%, transparent 0 50%) 0 0 / 18px 18px;
  --ok: #86efac; --warn: #fde68a; --bad: #fca5a5;
  --ok-bg: rgba(52,211,153,.14); --warn-bg: rgba(245,176,65,.14); --bad-bg: rgba(248,113,113,.15);
}
html, body { height: auto; min-height: 100%; }
body { overflow: auto; overflow-x: hidden; background: radial-gradient(1100px 650px at 85% -10%, rgba(34,211,238,.09), transparent 60%), radial-gradient(900px 600px at -10% 100%, rgba(217,70,239,.07), transparent 60%), var(--canvas); }
.dg-app { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); min-height: 100vh; height: auto; }
.dg-app .muted, .dg-app .muted * { color: var(--muted); }
.dg-app a.ghost { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.ghost.small, .dg-app .ghost.small { padding: 5px 10px; font-size: 11px; }
.primary.small { padding: 8px 14px; font-size: 11.5px; border-radius: 10px; }
.ghost.danger { color: #fecaca; }
.ghost.danger:hover { border-color: #ef4444; color: #fee2e2; }
button.busy { opacity: .55; cursor: progress; }
.dg-app code { font-family: var(--mono); font-size: 11.5px; direction: ltr; unicode-bidi: isolate; }

/* ----------------------------------------------------------------- top bar */
.dg-brand { text-decoration: none; color: inherit; }
.dg-sep { color: var(--muted); font-size: 18px; line-height: 1; margin-top: -2px; }
.dg-wordmark { font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: -0.02em; line-height: 1; background: var(--dg-h); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dg-pro { color: #bdf3fb; border-color: rgba(34,211,238,.5); background: linear-gradient(180deg, rgba(34,211,238,.14), rgba(139,92,246,.08)); }
.dg-back::before { content: ""; width: 7px; height: 7px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-inline-end: 2px; flex: none; }
[dir="rtl"] .dg-back::before { transform: rotate(-135deg); }
.dg-hint { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: none; margin: 0; padding: 10px 16px; border-radius: 12px; background: rgba(18,18,28,.96); border: 1px solid var(--line-2); color: var(--ink); font-size: 12.5px; max-width: min(92vw, 520px); pointer-events: none; }
.dg-hint.toast { display: block; }

/* ----------------------------------------------------------------- shell + rail */
.dg-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; width: 100%; max-width: 1400px; margin: 0 auto; padding: 22px 24px 70px; min-width: 0; }
.dg-rail { position: sticky; top: 16px; align-self: start; display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--glass); box-shadow: var(--edge), 0 18px 40px rgba(0,0,0,.35); }
.dg-rail-kicker { margin: 4px 8px 10px; font-family: var(--display); font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
[dir="rtl"] .dg-rail-kicker { letter-spacing: 0; }
.dg-tab { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-family: var(--display); font-weight: 600; font-size: 12.5px; text-align: start; transition: background var(--t), color var(--t); }
.dg-tab:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.dg-tab[aria-selected="true"] { color: #fff; background: linear-gradient(135deg, rgba(34,211,238,.26), rgba(139,92,246,.3)); box-shadow: inset 0 0 0 1px rgba(139,92,246,.4), inset 0 1px 0 rgba(255,255,255,.12); }
.dg-tab[aria-selected="true"]::before { content: ""; position: absolute; inset-inline-start: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--dg); }
.dg-tab span { flex: 1 1 auto; min-width: 0; }
.dg-ico { width: 16px; height: 16px; flex: none; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
#tab-mockups .dg-ico { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 4l-5 3 2 4 3-1v10h8V10l3 1 2-4-5-3a4 4 0 0 1-8 0z'/%3E%3C/svg%3E"); }
#tab-designer .dg-ico { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Cpath d='M7 16l3-6 3 6M8.2 13.5h3.6M16 10v6'/%3E%3C/svg%3E"); }
#tab-colorways .dg-ico { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a9 9 0 1 0 0 18c1.7 0 2-1 2-2s-1-2 .5-2.5S21 16 21 12a9 9 0 0 0-9-9z'/%3E%3Ccircle cx='7.5' cy='11' r='1.2'/%3E%3Ccircle cx='10.5' cy='7' r='1.2'/%3E%3Ccircle cx='15.5' cy='7.5' r='1.2'/%3E%3C/svg%3E"); }

/* ----------------------------------------------------------------- main, heads, cards */
.dg-main { min-width: 0; display: grid; gap: 16px; align-content: start; }
.dg-panel { min-width: 0; display: grid; gap: 16px; align-content: start; animation: dgIn .35s var(--ease) both; }
@keyframes dgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dg-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.dg-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.dg-h1 { margin: 0; font-family: var(--display); font-size: 26px; letter-spacing: -.02em; line-height: 1.15; }
.dg-sub { margin: 6px 0 0; max-width: 72ch; font-size: 13.5px; }
.dg-card { min-width: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--glass); box-shadow: var(--edge), 0 14px 34px rgba(0,0,0,.3); padding: 16px 18px; display: grid; gap: 12px; align-content: start; }
.dg-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.dg-card-head > div { min-width: 0; }
.dg-card h2 { margin: 0; font-family: var(--display); font-size: 14.5px; letter-spacing: -.01em; }
.dg-card-head p { margin: 4px 0 0; font-size: 12.5px; }
.dg-card-head .ghost { flex: none; }
.dg-note { margin: 0; font-size: 12px; }
.dg-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(139,92,246,.12); color: var(--ink); font-size: 13px; }
.dg-banner.warn { border-color: rgba(245,176,65,.45); background: var(--warn-bg); }
.dg-banner-text { flex: 1 1 260px; min-width: 0; }

/* two columns: inputs aside, results */
.dg-cols { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 16px; align-items: start; min-width: 0; }
.dg-side, .dg-work { display: grid; gap: 14px; align-content: start; min-width: 0; }
.dg-row { gap: 8px; }
.dg-actions-card { gap: 8px; }
.dg-actions-card .primary, .dg-actions-card > .ghost { width: 100%; justify-content: center; }
.dg-actions-card .dg-note { margin-bottom: 4px; }

/* ----------------------------------------------------------------- inputs */
.dg-field { display: grid; gap: 6px; min-width: 0; }
.dg-field > label { font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
[dir="rtl"] .dg-field > label { letter-spacing: 0; }
.dg-field > label output { font-family: var(--mono); font-size: 11px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.dg-in { width: 100%; min-width: 0; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--ink); font-size: 13px; }
.dg-in:focus { outline: none; border-color: rgba(139,92,246,.7); box-shadow: 0 0 0 3px rgba(139,92,246,.18); }
textarea.dg-in { resize: vertical; min-height: 86px; line-height: 1.45; }
.dg-app input[type="range"] { width: 100%; min-width: 0; margin: 0; accent-color: #a855f7; }
.dg-app input[type="color"] { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: transparent; cursor: pointer; flex: none; }
.dg-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.dg-check input { accent-color: #a855f7; width: 16px; height: 16px; margin: 0; flex: none; }
.dg-chips { gap: 6px; }
.dg-chips .chip { text-transform: none; letter-spacing: .01em; font-size: 11px; padding: 6px 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.dg-chips .chip[disabled] { opacity: .4; cursor: default; }

/* drop zone */
.dg-drop { position: relative; display: grid; place-items: center; min-height: 150px; border: 1.5px dashed rgba(255,255,255,.2); border-radius: 14px; background: var(--check), var(--panel-2); cursor: pointer; overflow: hidden; transition: border-color var(--t), background var(--t); min-width: 0; }
.dg-drop.small { min-height: 112px; }
.dg-drop:hover, .dg-drop.over { border-color: rgba(168,85,247,.8); }
.dg-drop.has { border-style: solid; border-color: rgba(139,92,246,.45); cursor: default; }
.dg-drop-empty { display: grid; justify-items: center; gap: 8px; padding: 16px; text-align: center; color: var(--muted); font-size: 12px; max-width: 100%; overflow-wrap: anywhere; }
.dg-drop.has .dg-drop-empty { display: none; }
.dg-drop-ico { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff5, transparent 40%), var(--dg); opacity: .8; box-shadow: 0 0 18px rgba(139,92,246,.4); }
.dg-drop-img { display: block; width: 100%; max-height: 260px; object-fit: contain; padding: 8px; }

/* product tiles */
.dg-ptiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dg-ptile { position: relative; min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--panel-3); text-align: start; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); transition: border-color var(--t), transform var(--t) var(--ease), box-shadow var(--t); }
.dg-ptile:hover { border-color: rgba(255,255,255,.22); transform: translateY(-2px); }
.dg-ptile canvas { display: block; width: 100%; aspect-ratio: 1; background: #1a1a26; }
.dg-ptile span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 6px 5px; font-family: var(--display); font-size: 9px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: linear-gradient(transparent, rgba(8,8,14,.92) 72%); color: #f4f4f9; text-shadow: 0 1px 2px rgba(0,0,0,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[dir="rtl"] .dg-ptile span { letter-spacing: 0; }
.dg-ptile[aria-pressed="true"] { border-color: transparent; box-shadow: 0 0 0 1.5px #a855f7, 0 0 18px rgba(139,92,246,.4); }
.dg-ptile[aria-pressed="true"] span::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--dg); margin-inline-end: 4px; vertical-align: middle; box-shadow: 0 0 6px #d946ef; }

/* swatches and colour lists */
.dg-swatches, .dg-colour-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.dg-swatch { --sw: #8b5cf6; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: var(--sw); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); flex: none; }
.dg-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px #a855f7; }
.dg-swatch.custom { position: relative; background: conic-gradient(#f87171, #fbbf24, #4ade80, #22d3ee, #a78bfa, #f87171); }
.dg-swatch.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.dg-swatch.custom:focus-within { outline: 2px solid #a78bfa; outline-offset: 2px; } /* the colour input itself is invisible: its wrapper shows the focus ring */
.dg-colour-list { display: flex; flex-wrap: wrap; gap: 6px; }
.dg-colour-item { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 3px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); font-size: 11.5px; max-width: 100%; }
[dir="rtl"] .dg-colour-item { padding: 3px 3px 3px 6px; }
.dg-colour-item i { width: 20px; height: 20px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); flex: none; }
.dg-colour-item code { color: var(--muted); }
.dg-colour-item button { border: 0; background: transparent; color: var(--muted); font-size: 14px; line-height: 1; padding: 0 4px; cursor: pointer; }
.dg-colour-item button:hover { color: #fecaca; }
.dg-colour-row .dg-x { border: 1px solid var(--line-2); background: transparent; color: var(--muted); width: 22px; height: 22px; border-radius: 50%; font-size: 13px; line-height: 1; padding: 0; cursor: pointer; }
.dg-dom-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.dg-dom-swatch { width: 28px; height: 28px; border-radius: 8px; background: var(--sw, #333); border: 1px solid rgba(255,255,255,.2); flex: none; }

/* ----------------------------------------------------------------- results */
.dg-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.dg-results:empty { display: none; }
.dg-mcard { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--glass); box-shadow: var(--edge), 0 12px 30px rgba(0,0,0,.3); overflow: hidden; display: grid; grid-template-rows: auto auto 1fr auto; }
.dg-mcard-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 6px; min-width: 0; }
.dg-mcard-head h3 { margin: 0; font-family: var(--display); font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-family: var(--display); font-size: 10px; font-weight: 700; letter-spacing: .03em; border: 1px solid var(--line-2); background: rgba(255,255,255,.05); color: var(--ink); white-space: nowrap; flex: none; }
.dg-badge.ai { color: #e9d5ff; background: rgba(139,92,246,.18); border-color: rgba(139,92,246,.45); }
.dg-badge.free { color: var(--ok); background: var(--ok-bg); border-color: rgba(52,211,153,.35); }
.dg-mcard canvas, .dg-mcard img.dg-ai-img { display: block; width: 100%; height: auto; background: var(--check), #15151f; }
.dg-mcard-body { display: grid; gap: 8px; padding: 0 10px; }
.dg-ai-slot { position: relative; display: grid; gap: 6px; }
.dg-ai-slot img { border-radius: 10px; border: 1px solid rgba(139,92,246,.4); }
.dg-ai-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dg-mcard-acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 12px; }
.dg-mcard-acts a.ghost, .dg-mcard-acts button { flex: 0 1 auto; }
.dg-empty { position: relative; display: grid; justify-items: center; text-align: center; gap: 10px; padding: 46px 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--glass); overflow: hidden; }
.dg-empty p { margin: 0; max-width: 56ch; color: var(--muted); font-size: 13.5px; }
.dg-empty-orb { width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6, transparent 40%), var(--dg); box-shadow: 0 0 40px rgba(139,92,246,.45), 0 0 90px rgba(34,211,238,.2); opacity: .85; }
.dg-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dg-cover { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10,10,15,.55); backdrop-filter: blur(2px); color: var(--ink); font-family: var(--display); font-size: 12px; }
.dg-spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: #a855f7; animation: dgSpin .9s linear infinite; }
@keyframes dgSpin { to { transform: rotate(360deg); } }

/* the designer's stage and spec */
.dg-stage { position: relative; display: grid; place-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--check), var(--panel-2); min-height: 240px; overflow: hidden; }
.dg-stage canvas { display: block; max-width: 100%; max-height: 72vh; width: auto; height: auto; border-radius: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.dg-stage-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13.5px; padding: 20px; pointer-events: none; }
.dg-stage-empty p { margin: 0; }
.dg-stage.has .dg-stage-empty { display: none; }
.dg-stage:not(.has) canvas { visibility: hidden; max-height: 240px; }
.dg-spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.dg-spec-grid .dg-palette { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.dg-spec-grid .dg-palette label { display: inline-flex; }
/* colourways stage: the preview with the keep-mask layer on top */
.dg-cw-stage { padding: 0; place-items: stretch; }
.dg-cw-stage canvas { max-height: none; border-radius: 18px; box-shadow: none; width: 100%; height: auto; }
.dg-cw-stage #cw-mask { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .9; }
.dg-cw-stage.painting #cw-mask { pointer-events: auto; cursor: crosshair; touch-action: none; }
.dg-cw-stage.painting::after { content: ""; position: absolute; inset: 0; border: 2px solid rgba(248,113,113,.6); border-radius: 18px; pointer-events: none; }

/* sessions */
.dg-session-list { display: grid; gap: 6px; }
.dg-session { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.03); min-width: 0; flex-wrap: wrap; }
.dg-session b { flex: 1 1 140px; min-width: 0; font-family: var(--display); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-session time { color: var(--muted); font-size: 11.5px; flex: none; }
.dg-session .ghost { flex: none; }

/* modals of this page */
.dg-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; max-height: 60vh; overflow: auto; }
.dg-pick-item { padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel-2); cursor: pointer; }
.dg-pick-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.dg-pick-item:hover, .dg-pick-item:focus-visible { border-color: rgba(168,85,247,.8); }
.dg-pick-empty { color: var(--muted); margin: 12px 0 0; }
.dg-session-card { display: grid; gap: 12px; }
.dg-modal-acts { justify-content: flex-end; }
.dg-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 95; display: flex; align-items: center; gap: 12px; max-width: min(92vw, 560px); padding: 10px 12px 10px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(18,18,28,.97); color: var(--ink); font-size: 13px; box-shadow: 0 18px 50px rgba(0,0,0,.55); }
[dir="rtl"] .dg-toast { padding: 10px 16px 10px 12px; }
.dg-toast.show { animation: dgToast .3s var(--ease) both; }
@keyframes dgToast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.dg-toast span { min-width: 0; overflow-wrap: anywhere; }
.dg-toast-act { flex: none; border: 0; border-radius: 9px; padding: 6px 12px; font-family: var(--display); font-weight: 700; font-size: 12px; color: #0d1b26; background: var(--dg-h); text-decoration: none; }

html[lang="ar"] .dg-app .brand .arabic { display: none; } /* the module name is already Arabic: no second copy */

/* ----------------------------------------------------------------- responsive */
@media (max-width: 1100px) { .dg-cols { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); } }
@media (max-width: 900px) {
  .dg-shell { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 0 14px 60px; }
  .dg-rail { position: sticky; top: 0; z-index: 25; flex-direction: row; gap: 2px; margin: 0 -14px; padding: 8px 14px; border-radius: 0; border-width: 0 0 1px; overflow-x: auto; scrollbar-width: none; background: rgba(10,10,15,.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: none; }
  .dg-rail::-webkit-scrollbar { display: none; }
  .dg-rail-kicker { display: none; }
  .dg-tab { width: auto; flex: none; padding: 8px 12px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
  .dg-tab[aria-selected="true"] { background: var(--active); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
  .dg-tab[aria-selected="true"]::before { display: none; }
  .dg-cols { grid-template-columns: minmax(0, 1fr); }
  .dg-h1 { font-size: 22px; }
  #ds-stage { scroll-margin-top: 64px; } /* revealStage() scrolls the fresh design into view below the sticky tab strip */
}
@media (max-width: 560px) {
  .dg-pro, .dg-back span, .dg-nav span, .dg-app .arabic { display: none; }
  .dg-back, .dg-nav { padding: 7px 9px; }
  #nawaa-link::before { content: "✦"; }
  .dg-card { padding: 14px; border-radius: 16px; }
  .dg-results { grid-template-columns: minmax(0, 1fr); }
  .dg-spec-grid { grid-template-columns: minmax(0, 1fr); }
  .dg-ptiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modal { padding: 10px; }
  .dg-pick-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}
@media (max-width: 420px) { .dg-tab { padding: 8px 9px; gap: 7px; } } /* the three tabs fit a 360 px phone; longer languages scroll the strip */
@media (prefers-reduced-motion: reduce) {
  .dg-panel, .dg-toast.show { animation: none !important; }
  .dg-spin { animation-duration: 2s; }
}
