:root {
  --ink: #172026;
  --muted: #66727c;
  --line: #d8e0e6;
  --soft: #f4f7f9;
  --panel: #ffffff;
  --green: #14b58f;
  --green-dark: #0b8068;
  --red: #d92828;
  --blue: #3967d6;
  --amber: #c98016;
  --shadow: 0 18px 45px rgba(23, 32, 38, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: #eef3f6;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  background: #18222b;
  color: #fff;
}

.brand {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #062d27;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.18;
}

.brand p {
  margin: 6px 0 0;
  color: #b9c6ce;
  font-size: 13px;
  line-height: 1.35;
}

.mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.mode-button {
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  color: #d8e0e6;
  background: transparent;
  cursor: pointer;
}

.mode-button.active {
  color: #062d27;
  background: var(--green);
  font-weight: 800;
}

.step-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.step-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.step-item.active {
  border-color: var(--green);
  background: rgba(20, 181, 143, 0.14);
}

.step-item.done .step-index {
  color: #062d27;
  background: var(--green);
}

.step-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #c7d3da;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.step-item strong {
  display: block;
  font-size: 14px;
}

.step-item span:last-child {
  display: block;
  margin-top: 3px;
  color: #b9c6ce;
  font-size: 12px;
}

.score-card {
  margin-top: auto;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.score-card span {
  color: #b9c6ce;
  font-size: 12px;
  text-transform: uppercase;
}

.score-card strong {
  display: block;
  margin: 6px 0 12px;
  font-size: 28px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.progress-fill {
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 180ms ease;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace-header h2 {
  margin: 0;
  font-size: 28px;
}

.status-pill {
  min-width: 150px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.status-pill.success {
  border-color: rgba(20, 181, 143, 0.45);
  color: var(--green-dark);
}

.status-pill.warning {
  border-color: rgba(201, 128, 22, 0.45);
  color: var(--amber);
}

.training-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.85fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.visual-panel,
.task-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.visual-panel {
  padding: 14px;
}

.screen-frame {
  position: relative;
  overflow: auto;
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 116px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.screen-frame img {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
}

.hotspot {
  position: absolute;
  display: none;
  width: 52px;
  height: 52px;
  border: 3px solid var(--red);
  border-radius: 999px;
  background: rgba(217, 40, 40, 0.12);
  box-shadow: 0 0 0 9px rgba(217, 40, 40, 0.13);
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.hotspot.visible {
  display: block;
}

.hotspot:focus-visible {
  outline: 4px solid rgba(57, 103, 214, 0.4);
  outline-offset: 4px;
}

.task-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
}

.task-copy {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 13px;
}

.task-number {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #e7fbf6;
  color: var(--green-dark);
  font-weight: 900;
}

.task-copy h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
}

.task-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.task-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.check-row {
  color: #31404a;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.check-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--green);
}

.feedback {
  border-radius: 8px;
  padding: 12px;
  line-height: 1.4;
  background: #fff6e8;
  color: #6b3d00;
}

.feedback.success {
  background: #e7fbf6;
  color: #075646;
}

.feedback.error {
  background: #fff0f0;
  color: #9d1717;
}

.action-row {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.ghost-button,
.primary-button {
  min-height: 44px;
  border-radius: 7px;
  border: 1px solid var(--line);
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.ghost-button {
  background: #fff;
  color: var(--ink);
}

.primary-button {
  border-color: var(--green);
  background: var(--green);
  color: #062d27;
}

.primary-button.done {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.primary-button:disabled {
  border-color: var(--line);
  background: #dfe7ec;
  color: #7b8790;
  cursor: not-allowed;
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .training-grid {
    grid-template-columns: 1fr;
  }

  .screen-frame {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .workspace-header {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-header h2 {
    font-size: 23px;
  }

  .screen-frame img {
    min-width: 680px;
  }

  .action-row {
    grid-template-columns: 1fr;
  }
}
