/* ==========================================================================
   LapCheck Adaptive Laptop — Precision CSS 3D Architecture
   Pure CSS 3D Illusion • Real Physical Geometry • Multi-Layer Ambient Lighting
   Adaptive Visual Engine • Real-time Hardware Profile Morphing
   Scope: .al-stage wrapper. Works inside Django template (RTL page, LTR stage).
   ========================================================================== */

.al-stage {
  --paper: #f8fafc;
  --paper-2: #ffffff;
  --paper-3: #f1f5f9;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --accent: #2563eb;
  --accent-ink: #1d4ed8;
  --accent-soft: #eff6ff;
  
  --silver: oklch(89% 0.008 240);
  --graphite: oklch(34% 0.015 240);
  --key-light: oklch(24% 0.01 240);
  --key-dark: oklch(15% 0.008 240);
  --bezel: oklch(12% 0.008 240);
  --screen: oklch(14% 0.012 250);
  --screen-ink: oklch(96% 0.005 250);
  --screen-mute: oklch(65% 0.01 240);
  --screen-line: oklch(26% 0.01 240);
  --screen-accent: oklch(74% 0.15 235);
  
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  
  position: relative;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: radial-gradient(ellipse at 50% 25%, #ffffff 0%, #f8fafc 55%, #f1f5f9 100%);
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(460px, 60vh) auto;
  min-height: 560px;
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.07), 0 2px 8px -2px rgba(15, 23, 42, 0.04);
}

.al-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px 0 20px;
  z-index: 10;
  position: relative;
}

.al-readouts {
  display: flex;
  gap: 20px;
  font-family: Vazirmatn, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
}

.al-readouts b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  font-family: Vazirmatn, system-ui, sans-serif;
  margin-top: 1px;
}

.al-bar {
  position: relative;
  display: block;
  height: 2.5px;
  background: var(--line);
  margin-top: 5px;
  overflow: hidden;
  border-radius: 2px;
}

.al-bar i {
  position: absolute;
  inset: 0;
  transform-origin: right;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .12s linear;
}

.al-badge {
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--ink-3);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.al-canvas {
  position: relative;
  min-height: 0;
}

.al-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(226, 232, 240, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 232, 240, 0.7) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 65% 60% at 50% 50%, black 20%, transparent 80%);
  mask-image: radial-gradient(ellipse 65% 60% at 50% 50%, black 20%, transparent 80%);
  pointer-events: none;
}

.al-canvas::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  background: linear-gradient(to bottom, transparent, rgba(241, 245, 249, 0.95));
  pointer-events: none;
}

.al-scene {
  position: absolute;
  inset: 0;
  perspective: 2600px;
  perspective-origin: 50% 22%;
  z-index: 1;
}

@keyframes alIdleFloat {
  0%, 100% {
    transform: scale(var(--stage-scale, 1)) translateY(0px);
  }
  50% {
    transform: scale(var(--stage-scale, 1)) translateY(-4px);
  }
}

.al-rig {
  position: absolute;
  left: 50%;
  top: calc(50% + 28px * var(--stage-scale, 1));
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  transform: scale(var(--stage-scale, 1));
  animation: alIdleFloat 5s ease-in-out infinite;
}

.al-canvas:hover .al-rig {
  animation-play-state: paused;
}

.al-laptop {
  --W: 560px;
  --H: 350px;
  --D: 372px;
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  transform: rotateX(calc(-24deg + var(--tilt-x, 0deg))) rotateY(calc(var(--cam-yaw, 11deg) + var(--tilt-y, 0deg))) scale(var(--laptop-scale, 1));
  --chassis: color-mix(in oklch, var(--silver), var(--graphite) calc(var(--tone, 0.3) * 100%));
  --chassis-dark: color-mix(in oklch, var(--chassis), oklch(20% 0.006 95) 28%);
  --chassis-edge: color-mix(in oklch, var(--chassis), oklch(20% 0.006 95) 18%);
  --keycap: color-mix(in oklch, var(--key-light), var(--key-dark) calc(var(--tone, 0.3) * 100%));
  --acc: color-mix(in oklch, var(--screen-accent), var(--accent) 35%);
  transition: filter 0.3s ease;
}

.al-part {
  position: absolute;
  transform-style: preserve-3d;
}

/* ── Screen Assembly (Upright Lid) ─────────────────────── */
.al-lid {
  left: calc(var(--W) / -2);
  top: calc(var(--H) * -1);
  width: var(--W);
  height: var(--H);
  transform-origin: 50% 100%;
  transform: rotateX(16deg) scaleY(var(--lid-sy, 1));
}

.al-lid-front {
  position: absolute;
  inset: 0;
  border-radius: var(--radius, 14px) var(--radius, 14px) 5px 5px;
  background: var(--chassis);
  box-shadow: 0 0 0 0.5px var(--chassis-dark), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.al-lid-bezel {
  position: absolute;
  inset: 2.5px 2.5px 2px;
  border-radius: calc(var(--radius, 14px) - 2px) calc(var(--radius, 14px) - 2px) 3px 3px;
  background: var(--bezel);
  overflow: hidden;
}

.al-lid-bezel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.015) 30%, transparent 55%);
  pointer-events: none;
  z-index: 5;
}

.al-lid-top {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  height: 6px;
  transform-origin: 50% 0;
  transform: translateZ(-6px) rotateX(90deg);
  background: var(--chassis-edge);
  border-radius: 3px;
}

.al-lid-side {
  position: absolute;
  top: 6px;
  bottom: 0;
  left: 100%;
  width: 6px;
  transform-origin: 0 50%;
  transform: rotateY(90deg);
  background: var(--chassis-dark);
  border-radius: 0 3px 3px 0;
}

.al-display {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--W);
  height: var(--H);
  transform-origin: 0 0;
  transform: var(--t-display);
  background: var(--screen);
  border-radius: 2px;
}

.al-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 20% 0%, oklch(28% 0.03 60), transparent 60%), radial-gradient(100% 80% at 100% 100%, oklch(24% 0.025 200), transparent 55%);
  opacity: calc(0.35 + var(--display-glow, 0) * 0.65);
}

.al-webcam {
  position: absolute;
  left: 50%;
  top: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: oklch(24% 0.01 250);
  box-shadow: 0 0 0 1.5px oklch(20% 0.006 95), inset 1px 1px 0 oklch(40% 0.03 250);
  transform: var(--t-webcam);
}

.al-content {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--W);
  height: var(--H);
  transform-origin: 50% 50%;
  transform: var(--t-content);
  direction: ltr;
}

.al-sweep {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.al-sweep::before {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: 30%;
  left: -40%;
  background: linear-gradient(100deg, transparent, oklch(100% 0 0 / 0.07), transparent);
  opacity: 0;
}

.al-laptop.is-final .al-sweep::before {
  animation: alSweep 1700ms var(--ease-out) 550ms 1 both;
}

@keyframes alSweep {
  0% { opacity: 0; transform: translateX(0); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateX(560%); }
}

/* ── Hinge Assembly ────────────────────────────────────── */
.al-hinge {
  left: calc(var(--W) / -2);
  top: -7px;
  width: var(--W);
  height: 11px;
  transform: translateZ(1px);
}

.al-hinge-barrel {
  position: absolute;
  top: 0;
  height: 11px;
  width: 78px;
  border-radius: 6px;
  background: linear-gradient(to bottom, var(--chassis-edge), var(--chassis-dark));
  opacity: var(--hinge-basic, 1);
}

.al-hinge-barrel.l { left: 58px; }
.al-hinge-barrel.r { right: 58px; }

.al-hinge-slim {
  position: absolute;
  top: 3px;
  left: 18%;
  right: 18%;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(to bottom, oklch(30% 0.006 95), oklch(18% 0.006 95));
  opacity: var(--hinge-refined, 0);
}

/* ── Base Deck Assembly ────────────────────────────────── */
.al-base {
  left: calc(var(--W) / -2);
  top: 0;
  width: var(--W);
  height: var(--D);
  transform-origin: 50% 0;
  transform: rotateX(90deg);
}

.al-deck {
  position: absolute;
  inset: 0;
  border-radius: 6px 6px var(--radius, 14px) var(--radius, 14px);
  background: var(--chassis);
  overflow: hidden;
  box-shadow: inset 0 0 0 0.5px var(--chassis-dark), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.al-deck::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.al-mat {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.al-mat-plastic {
  opacity: calc(var(--plastic, 1) * 0.55);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.3  0 0 0 0 0.28  0 0 0 0.35 0'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

.al-mat-metal {
  opacity: var(--metal, 0);
  background: repeating-linear-gradient(90deg, oklch(100% 0 0 / 0.035) 0 1px, transparent 1px 3px), linear-gradient(to bottom, oklch(100% 0 0 / 0.16), transparent 45%, oklch(0% 0 0 / 0.07));
}

.al-mat-sheen {
  opacity: var(--sheen, 0);
  background: linear-gradient(115deg, transparent 30%, oklch(100% 0 0 / 0.16) 44%, transparent 58%);
}

.al-edge-front {
  left: 0;
  top: 100%;
  width: 100%;
  height: 40px;
  transform-origin: 50% 0;
  transform: rotateX(-90deg) scaleY(var(--thick-sy, 0.45));
  background: linear-gradient(to bottom, var(--chassis-edge), var(--chassis-dark));
  border-radius: 0 0 var(--radius, 14px) var(--radius, 14px);
}

.al-edge-front::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 1px;
  background: oklch(100% 0 0 / 0.5);
  opacity: var(--edge-hl, 0.3);
}

.al-notch {
  position: absolute;
  left: 50%;
  top: 0;
  width: 74px;
  height: 9px;
  margin-left: -37px;
  border-radius: 0 0 8px 8px;
  background: var(--chassis-dark);
  opacity: 0.5;
}

.al-edge-side {
  left: 100%;
  top: 0;
  width: 40px;
  height: 100%;
  transform-origin: 0 50%;
  transform: rotateY(90deg) scaleX(var(--thick-sy, 0.45));
  background: linear-gradient(to right, var(--chassis-edge), var(--chassis-dark));
  border-radius: 0 6px var(--radius, 14px) 0;
}

.al-edge-left {
  left: 0;
  top: 0;
  width: 40px;
  height: 100%;
  transform-origin: 0 50%;
  transform: rotateY(-90deg) scaleX(var(--thick-sy, 0.45));
  background: linear-gradient(to left, var(--chassis-edge), var(--chassis-dark));
  border-radius: 6px 0 0 var(--radius, 14px);
}

.al-side-io {
  left: 100%;
  top: 0;
  width: 40px;
  height: 100%;
  transform-origin: 0 50%;
  transform: rotateY(90deg) translateX(calc(var(--thick, 18px) / 2 - 20px)) translateZ(0.6px);
}

.al-port {
  position: absolute;
  left: 50%;
  background: oklch(14% 0.006 95);
  opacity: clamp(0, calc(var(--port-count, 3) - var(--i)), 1);
  transform: translateX(-50%) scale(calc(0.6 + 0.4 * clamp(0, calc(var(--port-count, 3) - var(--i)), 1)));
}

.al-port.c { width: 4px; height: 13px; border-radius: 3px; }
.al-port.a { width: 6px; height: 16px; border-radius: 1px; }
.al-port.h { width: 6px; height: 19px; border-radius: 1px 1px 3px 3px; }
.al-port.o { width: 5px; height: 5px; border-radius: 50%; }
.al-port.sd { width: 2px; height: 18px; border-radius: 1px; }

.al-exhaust {
  position: absolute;
  left: 50%;
  top: 16px;
  width: 12px;
  height: 84px;
  margin-left: -6px;
  opacity: var(--rear-exhaust, 0);
  background: repeating-linear-gradient(to bottom, oklch(16% 0.006 95) 0 3px, transparent 3px 6px);
  border-radius: 2px;
}

/* ── Realistic Contact & Ambient Shadows ───────────────── */
.al-ambient {
  left: -8%;
  top: -4%;
  width: 116%;
  height: 112%;
  transform: translateZ(calc(var(--thick, 18px) * -1 - 2px)) scale(var(--shadow-spread, 1));
  background: radial-gradient(closest-side, oklch(25% 0.012 95 / var(--shadow-depth, 0.45)), transparent);
  pointer-events: none;
}

.al-contact {
  left: 1%;
  top: 1%;
  width: 98%;
  height: 100%;
  transform: translateZ(calc(var(--thick, 18px) * -1 - 1px));
  background: oklch(22% 0.01 95 / 0.28);
  border-radius: 20px;
  filter: blur(6px);
}

/* ── Cooling Vents & Speakers ──────────────────────────── */
.al-vents {
  position: absolute;
  top: 14px;
  left: 15%;
  right: 15%;
  height: 20px;
  display: flex;
  justify-content: space-between;
  direction: ltr;
}

.al-vent {
  width: 6px;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(to bottom, oklch(16% 0.006 95), oklch(26% 0.006 95));
  --on: clamp(0, calc(var(--vent-count, 4) - var(--i)), 1);
  opacity: calc(var(--on) * var(--vent-opacity, 0.3));
  transform: scaleX(var(--vent-sx, 1)) scaleY(calc(0.4 + var(--on) * 0.6));
}

.al-speaker {
  position: absolute;
  top: 48px;
  width: 32px;
  height: 150px;
  border-radius: 6px;
  opacity: var(--speaker, 0);
  background-image: radial-gradient(circle, oklch(22% 0.006 95) 0.9px, transparent 1.2px);
  background-size: 5px 5px;
}

.al-speaker.l { left: 16px; }
.al-speaker.r { right: 16px; }

/* ── Precision Chiclet Keyboard ────────────────────────── */
.al-kbd {
  position: absolute;
  top: 46px;
  left: 56px;
  right: 56px;
  height: 152px;
  display: grid;
  grid-template-rows: 0.66fr repeat(5, 1fr);
  direction: ltr;
  padding: 3px;
  border-radius: 6px;
  background: color-mix(in oklch, var(--chassis), oklch(15% 0.006 95) 12%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.al-krow { display: flex; min-height: 0; }
.al-k { flex: var(--w, 1) 1 0; position: relative; min-width: 0; }

.al-cap {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: var(--keycap);
  transform: scale(var(--key-scale, 0.88));
  box-shadow: 0 1px 0 oklch(12% 0.006 95), inset 0 0.5px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 7px;
  font-weight: 500;
  color: oklch(80% 0.008 95);
  overflow: hidden;
  user-select: none;
}

.al-krow.fn .al-cap { font-size: 5.5px; color: oklch(70% 0.008 95); }
.al-cap::after { content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0; }
.al-cap .lg2 { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; }

.al-k.wasd .al-cap::after {
  opacity: calc(var(--kb-perf, 0) * (0.65 + var(--accent-k, 0) * 0.35));
  box-shadow: inset 0 0 0 1px var(--acc), 0 0 8px color-mix(in oklch, var(--acc), transparent 40%);
  background: color-mix(in oklch, var(--acc), transparent 80%);
}
.al-k.wasd .lg2 { opacity: var(--kb-perf, 0); color: var(--acc); font-weight: 600; }

.al-k.mod .al-cap::after,
.al-k.nav .al-cap::after {
  opacity: var(--kb-prod, 0);
  background: oklch(100% 0 0 / 0.1);
  box-shadow: inset 0 -1.5px 0 oklch(100% 0 0 / 0.28);
}
.al-k.mod .lg2,
.al-k.nav .lg2 { opacity: var(--kb-prod, 0); color: oklch(96% 0.01 95); }

.al-k.power .al-cap::before {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: var(--acc);
  opacity: var(--kb-perf, 0);
}

.al-arrows {
  flex: 3 1 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  transform-origin: 50% 100%;
  transform: scale(var(--arrow-scale, 1));
  position: relative;
}
.al-arrows .al-k { flex: none; }
.al-arrows .al-k.left { grid-row: 2; grid-column: 1; }
.al-arrows .al-k.up { grid-row: 1; grid-column: 2; }
.al-arrows .al-k.down { grid-row: 2; grid-column: 2; }
.al-arrows .al-k.right { grid-row: 2; grid-column: 3; }
.al-arrows .al-k .al-cap::after {
  opacity: calc(var(--kb-perf, 0) * 0.8);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--acc), transparent 40%);
}

/* ── Precision Trackpad ────────────────────────────────── */
.al-trackpad {
  position: absolute;
  top: 218px;
  left: 50%;
  width: 252px;
  height: 132px;
  transform-origin: 50% 0;
  transform: var(--t-trackpad);
  border-radius: 10px;
  background: color-mix(in oklch, var(--chassis), oklch(100% 0 0) 6%);
  box-shadow: inset 0 0 0 1px var(--chassis-dark), 0 1px 0 rgba(255, 255, 255, 0.6);
}

.al-trackpad::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px oklch(100% 0 0 / 0.5);
  opacity: calc(var(--edge-hl, 0.3) * 0.6);
}

/* ── Display HUD & Profile UI ──────────────────────────── */
.al-sc {
  position: absolute;
  inset: 0;
  padding: 26px 30px 22px;
  color: var(--screen-ink);
  font-family: Vazirmatn, system-ui, sans-serif;
  direction: rtl;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.al-sc-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-family: Vazirmatn, system-ui, sans-serif;
  color: var(--screen-mute);
}

.al-sc-live {
  display: flex;
  gap: 8px;
  align-items: center;
}

.al-sc-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--screen-accent);
  box-shadow: 0 0 8px var(--screen-accent);
}

.al-sc-mid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 20px;
  min-height: 0;
}

.al-sc-title-wrap {
  position: relative;
  min-height: 70px;
}

.al-sc-title {
  font-size: 22px;
  line-height: 1.35;
  font-weight: 700;
  margin: 0;
  position: absolute;
  inset: 0 0 auto 0;
  transition: opacity 360ms var(--ease-out), transform 460ms var(--ease-out);
  font-family: Vazirmatn, system-ui, sans-serif;
  color: #ffffff;
}

.al-sc-tags {
  font-size: 12px;
  color: var(--screen-mute);
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  font-family: Vazirmatn, system-ui, sans-serif;
}

.al-sc-tags span + span::before {
  content: "·";
  margin-left: 8px;
  color: var(--screen-line);
}

.al-sc-final {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.75;
}

.al-sc-final li {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
  transition-delay: calc(var(--i) * 110ms + 700ms);
}

.al-laptop.is-final .al-sc-tags { display: none; }
.al-laptop.is-final .al-sc-final { display: block; }
.al-laptop.is-final .al-sc-final li { opacity: 1; transform: none; }

.al-sc-specs {
  border-right: 1px solid var(--screen-line);
  border-left: none;
  padding-right: 16px;
  padding-left: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  font-size: 11px;
  font-family: Vazirmatn, system-ui, sans-serif;
}

.al-sc-specs .h {
  font-size: 10px;
  color: var(--screen-mute);
  margin-bottom: 2px;
  font-weight: 700;
}

.al-sc-specs .r {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.al-sc-specs .r span:first-child { color: var(--screen-mute); }
.al-sc-specs .r b { font-weight: 600; transition: color 400ms; }
.al-sc-specs .r b.flash { color: var(--screen-accent); }

.al-sc-bot {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  font-size: 10px;
  font-family: Vazirmatn, system-ui, sans-serif;
  color: var(--screen-mute);
  border-top: 1px solid var(--screen-line);
  padding-top: 10px;
  min-height: 40px;
}

.al-ind {
  display: grid;
  gap: 6px;
  transform: translateY(calc((1 - var(--o)) * 6px));
  opacity: var(--o);
}

.al-ind-perf { --o: var(--ind-perf, 0); }
.al-ind-gpu { --o: var(--ind-gpu, 0); }
.al-ind-bat { --o: var(--ind-battery, 0); }
.al-ind-disp { --o: var(--ind-display, 0); }
.al-ind-color { --o: var(--ind-color, 0); }

.al-meter { display: flex; gap: 2px; }
.al-meter i {
  width: 7px;
  height: 9px;
  background: var(--screen-ink);
  border-radius: 1px;
  opacity: calc(0.18 + 0.82 * clamp(0, calc(var(--lvl) * 10 - var(--i)), 1));
}

.al-ind-bat .al-meter { --lvl: var(--battery-level, 0.6); }
.al-ind-perf .al-meter { --lvl: calc(0.35 + var(--accent-k, 0) * 0.6); }
.al-ind-perf .al-meter i { background: var(--screen-accent); }

.al-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--screen-ink);
}

.al-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.al-ind-color .al-chip::before {
  border: 0;
  width: 24px;
  height: 8px;
  border-radius: 1px;
  background: linear-gradient(90deg, oklch(65% 0.14 30), oklch(78% 0.13 95), oklch(68% 0.12 160), oklch(62% 0.12 250), oklch(60% 0.14 320));
}

/* ── Stage Footer HUD ──────────────────────────────────── */
.al-foot {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 6px;
  padding: 0 18px 14px 18px;
}

.al-cause {
  display: flex;
  min-height: 28px;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-family: Vazirmatn, system-ui, sans-serif;
}

.al-cause .pill {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 999px;
  padding: 2px 10px;
  animation: alPop .46s var(--ease-out) both;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.al-profile {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-top: 1px solid var(--line-strong);
  padding-top: 10px;
  font-family: Vazirmatn, system-ui, sans-serif;
  direction: rtl;
}

.al-profile .lbl {
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
}

.al-profile .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

@keyframes alPop {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ── Compact Stage (Narrow Screens) ────────────────────── */
.al-laptop.compact .al-krow.fn,
.al-laptop.compact .al-krow.num,
.al-laptop.compact .al-speaker,
.al-laptop.compact .al-sc-specs { display: none; }

.al-laptop.compact .al-kbd { grid-template-rows: repeat(4, 1fr); }
.al-laptop.compact .al-sc-mid { grid-template-columns: 1fr; }
.al-laptop.compact .al-sc { padding: 30px 32px; }
.al-laptop.compact .al-sc-title { font-size: 24px; }

/* ── Consultation Form Elements ────────────────────────── */
.al-form {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
}

.al-opt {
  cursor: pointer;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease, transform .12s ease;
}

.al-opt:hover {
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.al-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.al-opt.on,
.al-opt:has(input:checked) {
  border-color: #2563eb !important;
  background-color: #f8faff !important;
  box-shadow: 0 0 0 1px #2563eb, 0 1px 3px rgba(37, 99, 235, 0.08) !important;
}

.al-opt:has(input:focus-visible) {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.al-opt.on .border-slate-300,
.al-opt:has(input:checked) .border-slate-300 {
  border-color: #2563eb !important;
  background-color: #2563eb !important;
  box-shadow: inset 0 0 0 2px #ffffff !important;
}

.al-opt-pill.on,
.al-opt-pill:has(input:checked) {
  border-color: #0f172a !important;
  background: #0f172a !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px -1px rgba(15, 23, 42, 0.2) !important;
}

.al-opt-pill.on .mut,
.al-opt-pill:has(input:checked) .mut { color: #cbd5e1 !important; }

/* Modern Web Standards: Auto-sizing textarea without JS */
#al-notes {
  field-sizing: content;
  min-height: 58px;
}

/* Modern Web Standards: Gentle form validation feedback after interaction */
#al-full-name:user-invalid,
#al-phone:user-invalid,
#al-captcha:user-invalid {
  border-color: #ef4444;
  background-color: #fef2f2;
}

@keyframes alShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.al-shake {
  animation: alShake 0.35s ease-in-out;
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.al-step { display: none; }
.al-step.on { display: flex; }

.al-navbtn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 0 20px;
  font-weight: 700;
  transition: transform .15s, background .2s, opacity .2s, box-shadow .2s;
}

.al-navbtn:active { transform: scale(.98); }
.al-navbtn:disabled { cursor: not-allowed; opacity: .45; }

@media (max-width: 900px) {
  .al-stage {
    grid-template-rows: auto 1fr;
    min-height: 250px;
    max-height: 285px;
    border-radius: 18px;
  }
  .al-canvas {
    min-height: 200px;
  }
  .al-rig {
    top: calc(50% + 18px * var(--stage-scale, 1));
  }
  .al-topbar {
    padding: 10px 14px 0 14px;
    gap: 8px;
  }
  .al-readouts {
    gap: 10px;
    font-size: 9px;
  }
  .al-readouts b {
    font-size: 11px;
  }
  .al-badge {
    display: none;
  }
  .al-readouts .hide-m { display: none; }
  .al-foot {
    display: none;
  }
  .al-form {
    border-radius: 18px;
    box-shadow: 0 4px 15px -3px rgba(15, 23, 42, 0.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .al-laptop *, .al-laptop *::before, .al-laptop *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}
