@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/plex-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/plex-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/fonts/plex-arabic-600.woff2") format("woff2");
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/fonts/plex-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --ink: #18302d;
  --ink-2: #354743;
  --muted: #687a76;
  --surface: #ffffff;
  --page: #f2f6f5;
  --soft: #f7faf9;
  --line: #dce5e3;
  --line-strong: #c5d2cf;
  --accent: #007469;
  --accent-deep: #016c60;
  --accent-soft: #e6f4f1;
  --danger: #bf4128;
  --danger-soft: #fbede9;
  --success: #016c60;
  --success-soft: #e6f4f1;
}

* { box-sizing: border-box; }

html {
  background: var(--page);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea { font: inherit; }

button,
select,
summary,
input[type="checkbox"] { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(0, 116, 105, .18);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.boot {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 24px;
  place-content: center;
  background: var(--surface);
  text-align: center;
}

.boot strong { font-size: 1.25rem; font-weight: 600; }
.boot p { max-width: 310px; margin: 12px 0 0; color: var(--muted); font-size: .8rem; }

.boot-track {
  width: 220px;
  height: 3px;
  margin: 18px auto 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.boot-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: right;
  animation: load 650ms ease-out both;
}

@keyframes load { from { transform: scaleX(0); } }

.app { min-height: 100vh; padding-bottom: 28px; }

.topbar {
  display: flex;
  width: min(100% - 32px, 720px);
  min-height: 74px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}

.wordmark > img {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: contain;
}

.wordmark strong { font-size: 1rem; font-weight: 600; }
.boot-logo { display: block; width: 96px; height: 96px; margin: 0 auto 8px; object-fit: contain; }
.course-code { color: var(--muted); font-size: .76rem; }

.progress {
  position: relative;
  isolation: isolate;
  display: grid;
  width: min(100% - 32px, 680px);
  margin: 0 auto 14px;
  grid-template-columns: repeat(4, 1fr);
}

.progress::before {
  position: absolute;
  z-index: -1;
  top: 13px;
  right: 12.5%;
  left: 12.5%;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.progress > span {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #9199a5;
  font-size: .65rem;
}

.progress i {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--page);
  font-style: normal;
}

.progress span.done,
.progress span.current { color: var(--ink); }
.progress span.done i { border-color: var(--accent); background: var(--accent); color: white; }
.progress span.current i { border: 2px solid var(--accent); background: white; color: var(--accent); font-weight: 600; }

.shell {
  width: min(100% - 32px, 680px);
  min-height: 420px;
  margin: 0 auto;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 14px 40px rgba(23, 32, 51, .05);
}

.screen { display: none; }
.screen.active { display: block; animation: reveal 180ms ease-out both; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: .73rem;
  font-weight: 600;
}

.welcome-screen h1 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(1.8rem, 7vw, 2.55rem);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.3;
}

.lead {
  max-width: 560px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.8;
}

.application-summary {
  display: grid;
  margin: 30px 0 22px;
  border-block: 1px solid var(--line);
  grid-template-columns: repeat(3, 1fr);
}

.application-summary > div { padding: 16px 12px; }
.application-summary > div + div { border-right: 1px solid var(--line); }
.application-summary dt { margin-bottom: 5px; color: var(--muted); font-size: .68rem; }
.application-summary dd { margin: 0; color: var(--ink); font-size: .8rem; font-weight: 600; }

.connection-note {
  display: flex;
  margin-bottom: 24px;
  padding: 13px 14px;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #cfe1da;
  border-radius: 9px;
  background: var(--success-soft);
  color: #355f52;
}

.connection-note > span {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: .67rem;
}

.connection-note p { margin: 0; font-size: .74rem; line-height: 1.65; }
.connection-note strong { font-weight: 600; }

.action {
  display: inline-flex;
  width: auto;
  min-width: 220px;
  min-height: 50px;
  padding: 11px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  transition: background 120ms ease, opacity 120ms ease, transform 120ms ease;
}

.action.primary { background: var(--accent); color: white; }
.action.primary b { color: #cce7e2; font-size: 1rem; font-weight: 400; }
.action:hover:not(:disabled) { background: var(--accent-deep); }
.action:active:not(:disabled) { transform: translateY(1px); }
.action:disabled { cursor: not-allowed; opacity: .36; }

.screen-head {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.screen-head h1,
.screen-head h2,
.done-screen h2,
.dashboard-head h1 {
  margin: 0;
  font-size: clamp(1.55rem, 6vw, 2rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.35;
}

.screen-head > p:last-child {
  max-width: 580px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.7;
}

.required { color: var(--danger); font-size: .85rem; font-weight: 600; }
.field-row { display: grid; gap: 16px; }
.identity-row { align-items: start; }
.contact-row { align-items: start; }
.contact-row .field > span { min-height: 22px; }

.field {
  position: relative;
  display: grid;
  margin-bottom: 18px;
  gap: 7px;
}

.field > span {
  display: flex;
  min-height: 20px;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-size: .78rem;
  font-weight: 600;
}

.field > span small { margin-right: auto; color: var(--muted); font-size: .66rem; font-weight: 400; }

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  outline: 0;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input,
.field select { min-height: 50px; padding: 11px 13px; }
.field textarea { min-height: 132px; padding: 12px 13px 28px; line-height: 1.75; resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 116, 105, .09); }

.field input::placeholder,
.field textarea::placeholder { color: #9ba3ae; }

.phone-control {
  display: grid;
  min-height: 50px;
  overflow: hidden;
  grid-template-columns: 112px minmax(0, 1fr);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.phone-control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 116, 105, .09);
}

.phone-control select,
.phone-control input {
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.country-code-control {
  display: grid;
  min-width: 0;
  align-items: center;
  grid-template-columns: 24px minmax(0, 1fr);
  padding-left: 9px;
  border-right: 1px solid var(--line);
}

.country-code-control img {
  width: 24px;
  height: 18px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(23, 32, 51, .1);
  object-fit: cover;
}

.phone-control select {
  padding: 10px 5px;
  direction: ltr;
  font-size: .76rem;
  text-align: left;
}

.phone-control input { padding: 10px 13px; }
.phone-control select:focus,
.phone-control input:focus { border-color: transparent; box-shadow: none; }

.telegram-field details { margin-top: -2px; }

.telegram-field summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: .67rem;
  font-weight: 600;
  list-style: none;
}

.telegram-field summary::-webkit-details-marker { display: none; }
.telegram-field summary i { display: grid; width: 17px; height: 17px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: .6rem; font-style: normal; }
.telegram-field details p { margin: 8px 0 0; padding: 10px 12px; border-radius: 7px; background: var(--accent-soft); color: #355f59; font-size: .68rem; line-height: 1.6; }

.laptop-field {
  display: flex;
  margin: 2px 0 19px;
  padding: 13px;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--soft);
  cursor: pointer;
}

.laptop-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.laptop-field > i { position: relative; width: 21px; height: 21px; flex: 0 0 auto; border: 1px solid #929aa5; border-radius: 5px; background: white; }
.laptop-field input:checked + i { border-color: var(--accent); background: var(--accent); }
.laptop-field input:checked + i::after { position: absolute; top: 2px; left: 6px; width: 6px; height: 11px; border-right: 2px solid white; border-bottom: 2px solid white; content: ""; transform: rotate(45deg); }
.laptop-field > span { display: grid; gap: 2px; }
.laptop-field b { font-size: .77rem; font-weight: 600; }
.laptop-field small { color: var(--muted); font-size: .65rem; }
.motivation-field { margin-bottom: 21px; }
.counter { position: absolute; bottom: 8px; left: 11px; color: var(--muted); font-size: .64rem; }
.counter b { font-weight: 400; }
.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-message,
.submit-error {
  margin: 15px 0;
  padding: 11px 13px;
  border: 1px solid #e1d3a6;
  border-radius: 8px;
  background: #fff9e8;
  color: #685c33;
  font-size: .74rem;
  line-height: 1.65;
}

.form-message.error,
.submit-error { border-color: #eccfd2; background: var(--danger-soft); color: #853b41; }
.form-message.success { border-color: #c9e0d8; background: var(--success-soft); color: #2b654f; }

.challenge-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--soft);
}

.challenge-labels { display: flex; margin-bottom: 8px; justify-content: space-between; color: var(--muted); font-size: .62rem; }

.gear-lab {
  position: relative;
  direction: ltr;
  display: grid;
  width: 100%;
  max-width: 360px;
  min-height: 205px;
  margin: 0 auto;
  overflow: hidden;
  padding: 42px 12px 30px;
  align-items: center;
  grid-template-columns: 60px 1fr 60px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background:
    linear-gradient(rgba(0, 116, 105, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 116, 105, .045) 1px, transparent 1px),
    white;
  background-size: 24px 24px;
}

.shaft-line { position: absolute; top: 49%; right: 34px; left: 34px; height: 1px; border-top: 1px dashed #b6c0cb; }

.fixed-unit { position: relative; z-index: 2; display: grid; justify-items: center; }
.motor-unit { transform: translateX(45px); }
.target-unit { transform: translateX(-45px); }
.fixed-unit small { position: absolute; top: 76px; color: var(--muted); font-size: .61rem; white-space: nowrap; }
.motion-arrow { position: absolute; top: -35px; color: var(--accent); font-family: system-ui, sans-serif; font-size: 1.45rem; line-height: 1; }
.target-arrow { color: var(--ink); }

.gear,
.gear-piece i,
.bridge-gear {
  position: relative;
  display: block;
  border-radius: 50%;
  color: #687789;
  background:
    radial-gradient(circle, white 0 14%, currentColor 15% 22%, white 23% 40%, currentColor 41% 54%, transparent 55%),
    repeating-conic-gradient(currentColor 0 10deg, transparent 10deg 18deg);
}

.gear-fixed { width: 60px; height: 60px; }
.gear-blue { color: var(--accent); }
.gear-target { color: var(--ink); }

.gear-bridge {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  min-height: 105px;
  align-items: center;
  justify-content: center;
}

.empty-peg { width: 10px; height: 10px; margin: 0 9%; border: 1px solid #9aa5b1; border-radius: 50%; background: white; }
.bridge-gear { flex: 0 0 auto; }
.bridge-gear + .bridge-gear { margin-left: -10px; }
.bridge-gear:nth-child(even) { --gear-phase: 9deg; transform: rotate(var(--gear-phase)); }
.bridge-large { width: 156px; height: 156px; }
.bridge-medium { width: 78px; height: 78px; }
.bridge-small { width: 52px; height: 52px; }

.gear-lab.motor-cw .gear-blue,
.gear-lab.motor-cw .bridge-gear:nth-child(even),
.gear-lab.motor-cw.output-same .gear-target,
.gear-lab.motor-ccw .bridge-gear:nth-child(odd),
.gear-lab.motor-ccw.output-opposite .gear-target { animation: spin 850ms linear infinite; }
.gear-lab.motor-ccw .gear-blue,
.gear-lab.motor-ccw .bridge-gear:nth-child(even),
.gear-lab.motor-ccw.output-same .gear-target,
.gear-lab.motor-cw .bridge-gear:nth-child(odd),
.gear-lab.motor-cw.output-opposite .gear-target { animation: spin-reverse 850ms linear infinite; }
@keyframes spin {
  from { transform: rotate(var(--gear-phase, 0deg)); }
  to { transform: rotate(calc(var(--gear-phase, 0deg) + 360deg)); }
}
@keyframes spin-reverse {
  from { transform: rotate(var(--gear-phase, 0deg)); }
  to { transform: rotate(calc(var(--gear-phase, 0deg) - 360deg)); }
}

.parts-head { display: flex; margin: 18px 0 8px; align-items: center; justify-content: space-between; gap: 12px; }
.parts-head span { font-size: .73rem; font-weight: 600; }
.parts-head small { color: var(--muted); font-size: .61rem; }

.gear-tray {
  direction: ltr;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(6, 1fr);
}

.gear-piece {
  display: grid;
  min-width: 0;
  min-height: 82px;
  padding: 8px 3px 6px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--muted);
  transition: border-color 120ms ease, background 120ms ease;
}

.gear-piece i { color: #59697a; }
.gear-piece-large i { width: 43px; height: 43px; }
.gear-piece-medium i { width: 35px; height: 35px; }
.gear-piece-small i { width: 27px; height: 27px; }
.gear-piece span { align-self: end; font-size: .55rem; }
.gear-piece.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.gear-piece.selected i { color: var(--accent); }
.gear-piece:disabled { cursor: not-allowed; opacity: .48; }

.attempts-line { display: flex; margin-top: 16px; align-items: center; justify-content: space-between; color: var(--muted); font-size: .68rem; }
.attempts-line > div { display: flex; gap: 6px; }
.attempts-line i { width: 26px; height: 5px; border-radius: 999px; background: var(--line); }
.attempts-line i.used { background: var(--ink); }
.attempts-line i.success { background: var(--success); }
.challenge-card + .attempts-line ~ .action { margin-top: 4px; }

.program-card { padding: 16px; }

.program-grid {
  direction: ltr;
  display: grid;
  width: min(100%, 360px);
  margin: 0 auto;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--line);
  grid-template-columns: repeat(4, 1fr);
}

.program-grid.crashed { animation: shake 220ms ease-in-out; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.program-cell {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  background: white;
}

.program-cell.blocked { background: repeating-linear-gradient(135deg, #edf0f3 0 7px, #dfe4e9 7px 8px); }

.program-robot,
.program-goal {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  font-family: system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
}

.program-robot { background: var(--accent); color: white; box-shadow: 0 3px 8px rgba(0, 116, 105, .22); }
.program-goal { border: 2px solid var(--ink); background: white; color: var(--ink); font-size: .85rem; }

.program-legend {
  direction: rtl;
  display: flex;
  width: min(100%, 360px);
  margin: 0 auto;
  padding: 9px 2px 0;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: .59rem;
}

.program-legend span { display: inline-flex; align-items: center; gap: 5px; }
.program-legend i { width: 10px; height: 10px; border-radius: 2px; }
.legend-robot { background: var(--accent); }
.legend-block { background: #dfe4e9; }
.legend-goal { border: 2px solid var(--ink); }

.command-builder { margin-top: 18px; padding-top: 2px; border-top: 1px solid var(--line); }
.command-palette { direction: ltr; display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); }

.command-palette button {
  display: grid;
  min-height: 68px;
  padding: 8px;
  place-items: center;
  gap: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.command-palette button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.command-palette button:disabled { cursor: not-allowed; opacity: .45; }
.command-palette b { color: var(--accent); font-family: system-ui, sans-serif; font-size: 1.35rem; }
.command-palette span { font-size: .64rem; }

.sequence-head { display: flex; margin: 17px 0 8px; align-items: center; justify-content: space-between; color: var(--ink-2); font-size: .7rem; font-weight: 600; }
.sequence-head small { color: var(--muted); font-size: .63rem; font-weight: 400; }
.sequence-head small b { font-weight: 600; }

.command-sequence {
  direction: ltr;
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(5, 1fr);
}

.command-slot {
  display: grid;
  min-width: 0;
  min-height: 58px;
  padding: 4px 2px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: rgba(255,255,255,.65);
  color: #a1a9b3;
  font-family: system-ui, sans-serif;
  font-size: .6rem;
}

.command-slot.filled { border-style: solid; border-color: #b8d1cc; background: var(--accent-soft); color: var(--accent); }
.command-slot.filled:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.command-slot small { justify-self: start; color: var(--muted); font-size: .48rem; }
.command-slot b { font-size: 1.05rem; line-height: 1; }
.command-slot span { font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: .53rem; }

.inline-actions { display: flex; margin-top: 17px; align-items: center; justify-content: flex-start; gap: 12px; }
.quiet-button { min-height: 42px; padding: 8px 10px; border: 0; background: transparent; color: var(--accent); font-size: .7rem; font-weight: 600; }
.quiet-button:hover { text-decoration: underline; }
.action.compact { min-height: 48px; }
#submitButton { margin-top: 15px; }
.submit-error strong { font-size: .78rem; font-weight: 600; }
.submit-error p { margin: 4px 0; font-size: .72rem; }
.submit-error small { font-size: .65rem; }

.done-screen { padding: 32px 0 12px; text-align: center; }
.done-check { display: grid; width: 56px; height: 56px; margin: 0 auto 20px; place-items: center; border-radius: 50%; background: var(--success-soft); color: var(--success); font-size: 1.45rem; font-weight: 600; }
.done-screen > p:not(.eyebrow) { max-width: 500px; margin: 12px auto 0; color: var(--muted); font-size: .82rem; line-height: 1.75; }
.ticket { display: grid; width: min(100%, 280px); margin: 26px auto 14px; padding: 15px; gap: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.ticket small { color: var(--muted); font-size: .65rem; }
.ticket strong { color: var(--accent); font-family: system-ui, sans-serif; font-size: 1.1rem; font-weight: 600; letter-spacing: .07em; }
.screenshot-note { color: var(--muted); font-size: .64rem; }

footer { display: flex; width: min(100% - 32px, 680px); min-height: 64px; margin: 0 auto; align-items: center; justify-content: space-between; color: var(--muted); }
footer span { color: var(--ink); font-size: .75rem; font-weight: 600; }
footer small { font-size: .64rem; }

/* Admin */
.admin-page { background: var(--page); color: var(--ink); }
.admin-topbar { display: flex; width: min(100% - 32px, 1180px); min-height: 74px; margin: 0 auto; align-items: center; justify-content: space-between; }
.admin-shell { width: min(100% - 32px, 1180px); margin: 0 auto; padding: 22px 0 60px; }
.admin-login { width: min(100%, 430px); margin: 42px auto 0; padding: 30px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 14px 40px rgba(23, 32, 51, .05); text-align: center; }
.lock-mark { display: grid; width: 50px; height: 50px; margin: 0 auto 18px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); letter-spacing: .12em; }
.admin-login h1 { margin: 0; font-size: 1.65rem; font-weight: 600; }
.admin-login > p:not(.eyebrow):not(.overline) { margin: 9px 0 22px; color: var(--muted); font-size: .76rem; line-height: 1.7; }
.overline { margin: 0 0 8px; color: var(--accent); font-size: .72rem; font-weight: 600; }
.dark-field { text-align: right; }
.dark-field > span { color: var(--ink-2); }
.dark-field input { background: white; color: var(--ink); }
.quiet-button.light { color: var(--muted); }

.dashboard-head { display: flex; margin-bottom: 22px; align-items: end; justify-content: space-between; gap: 20px; }
.dashboard-head h1 { font-size: clamp(1.8rem, 6vw, 2.5rem); }
.dashboard-head > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: .74rem; }
.download-button { display: inline-flex; min-height: 46px; padding: 10px 15px; align-items: center; justify-content: center; border-radius: 8px; background: var(--accent); color: white; font-size: .72rem; font-weight: 600; text-decoration: none; }

.stats-grid { display: grid; margin-bottom: 13px; gap: 10px; grid-template-columns: repeat(4, 1fr); }
.stats-grid article { display: grid; min-height: 96px; padding: 14px; align-content: space-between; border: 1px solid var(--line); border-radius: 9px; background: white; }
.stats-grid span { color: var(--muted); font-size: .65rem; }
.stats-grid b { color: var(--ink); font-family: system-ui, sans-serif; font-size: 1.75rem; font-weight: 600; }
.applicants-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: white; }
.panel-tools { display: flex; padding: 12px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.panel-tools input { width: min(100%, 420px); min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: white; color: var(--ink); outline: 0; }
.panel-tools input:focus { border-color: var(--accent); }
.panel-tools > span { flex: 0 0 auto; color: var(--muted); font-size: .67rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 1000px; border-collapse: collapse; color: var(--ink-2); font-size: .71rem; text-align: right; }
th, td { padding: 13px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); color: var(--muted); font-size: .62rem; font-weight: 600; }
td strong, td small, td span { display: block; }
td strong { color: var(--ink); font-weight: 600; }
td small { margin-top: 5px; color: var(--muted); line-height: 1.55; }
.motivation-cell { max-width: 290px; line-height: 1.6; }
.result-tag { width: fit-content; margin-bottom: 5px; padding: 4px 7px; border-radius: 5px; background: var(--danger-soft); color: var(--danger); font-size: .6rem; font-weight: 600; }
.result-tag.good { background: var(--success-soft); color: var(--success); }
.empty-admin { padding: 60px 20px; color: var(--muted); text-align: center; }

@media (min-width: 640px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  form > .action { margin-right: auto; }
}

@media (max-width: 700px) {
  .shell { padding: 26px 22px; }
  .application-summary { grid-template-columns: 1fr; }
  .application-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .application-summary > div + div { border-top: 1px solid var(--line); border-right: 0; }
  .application-summary dt { margin: 0; }
  .gear-tray { grid-template-columns: repeat(3, 1fr); }
  .gear-piece { min-height: 76px; }
  .dashboard-head { align-items: stretch; flex-direction: column; }
  .download-button { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-tools { align-items: stretch; flex-direction: column; }
  .panel-tools input { width: 100%; }
}

@media (max-width: 430px) {
  .topbar, .progress, .shell, footer, .admin-topbar, .admin-shell { width: min(100% - 20px, 680px); }
  .topbar { min-height: 64px; }
  .wordmark > img { width: 44px; height: 44px; }
  .course-code { max-width: 160px; text-align: left; }
  .shell { padding: 24px 17px; border-radius: 11px; }
  .action { width: 100%; min-width: 0; }
  .challenge-card { padding: 12px; }
  .gear-lab { width: min(100%, 238px); min-height: 190px; padding-inline: 8px; grid-template-columns: 58px 1fr 58px; }
  .gear-bridge { justify-content: flex-start; }
  .bridge-gear:first-child { margin-left: -8px; }
  .bridge-gear + .bridge-gear { margin-left: -6px; }
  .gear-fixed { width: 53px; height: 53px; }
  .motor-unit, .target-unit { transform: none; }
  .fixed-unit small { top: 69px; }
  .bridge-large { width: 130px; height: 130px; }
  .bridge-medium { width: 66px; height: 66px; }
  .bridge-small { width: 44px; height: 44px; }
  .parts-head { align-items: flex-start; flex-direction: column; gap: 2px; }
  .program-card { padding: 11px; }
  .program-grid { gap: 2px; }
  .program-robot, .program-goal { width: 34px; height: 34px; }
  .command-sequence { gap: 4px; }
  .command-slot { min-height: 54px; }
  .inline-actions { align-items: stretch; flex-direction: column-reverse; }
  .quiet-button { align-self: center; }
  footer small { text-align: left; }
}

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