:root {
  color-scheme: light;
  --ink: #18312b;
  --muted: #687771;
  --green: #17634e;
  --green-dark: #124938;
  --green-soft: #e8f3ed;
  --line: #dce6e0;
  --paper: #fff;
  --canvas: #f4f7f4;
  --amber: #9b6818;
  --amber-soft: #fff5dd;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button { font: inherit; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px max(24px, calc((100vw - 1040px) / 2)); background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--green); color: white; font-size: 13px; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.demo-label { padding: 7px 10px; border-radius: 99px; background: var(--amber-soft); color: var(--amber); font-size: 10px; font-weight: 800; letter-spacing: .07em; }
.page { width: min(100% - 40px, 880px); margin: 34px auto 52px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 24px; align-items: end; margin-bottom: 22px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
h1 { max-width: 650px; margin: 0; font-size: clamp(27px, 5vw, 40px); line-height: 1.14; letter-spacing: -.04em; }
.hero-copy { max-width: 590px; margin: 13px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.hero-stat { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.hero-stat b { display: block; font-size: 25px; letter-spacing: -.04em; }
.hero-stat span { color: var(--muted); font-size: 11px; }
.notice { display: flex; gap: 12px; align-items: flex-start; margin: 20px 0; padding: 14px 16px; border: 1px solid #ead9a7; border-radius: 12px; background: var(--amber-soft); color: #71501b; font-size: 12px; line-height: 1.6; }
.notice-icon { font-weight: 800; }
.layout { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
.card { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 8px 30px rgb(30 56 44 / 4%); }
.card-pad { padding: 22px; }
.card h2 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.02em; }
.subtle { color: var(--muted); font-size: 12px; line-height: 1.6; }
.module { padding: 15px 0; border-top: 1px solid var(--line); }
.module:first-of-type { margin-top: 14px; }
.module h3 { margin: 0 0 7px; font-size: 13px; }
.module p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.module summary { cursor: pointer; list-style: none; }
.module summary::-webkit-details-marker { display: none; }
.module summary::after { float: right; content: "+"; color: var(--green); font-size: 18px; }
.module[open] summary::after { content: "−"; }
.lesson { margin: 12px 0 0; padding: 11px 12px; border-radius: 9px; background: #f5f8f5; }
.lesson h4 { margin: 0 0 5px; font-size: 11px; }
.lesson p { font-size: 11px; }
.side-card { position: sticky; top: 20px; }
.course-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 17px; }
.chip { padding: 6px 9px; border-radius: 99px; background: #f1f5f1; color: #52665d; font-size: 10px; font-weight: 700; }
.button { width: 100%; min-height: 45px; padding: 11px 16px; border: 0; border-radius: 10px; background: var(--green); color: white; cursor: pointer; font-size: 12px; font-weight: 800; transition: background .15s, transform .15s; }
.button:hover { background: var(--green-dark); transform: translateY(-1px); }
.button.secondary { width: auto; border: 1px solid var(--line); background: white; color: var(--ink); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.history { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.history h3 { margin: 0 0 10px; font-size: 12px; }
.history-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; color: var(--muted); font-size: 10px; }
.quiz-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 20px; }
.progress-track { height: 6px; overflow: hidden; border-radius: 9px; background: #e8eee9; }
.progress-value { height: 100%; border-radius: inherit; background: var(--green); transition: width .2s; }
.question-count { color: var(--green); font-size: 11px; font-weight: 800; white-space: nowrap; }
.question-title { margin: 12px 0 18px; font-size: 19px; line-height: 1.4; }
.option { display: flex; gap: 11px; align-items: flex-start; width: 100%; margin: 8px 0; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); cursor: pointer; text-align: left; font-size: 12px; line-height: 1.5; }
.option:hover { border-color: #8fb6a4; background: #f9fcfa; }
.option.selected { border-color: var(--green); background: var(--green-soft); }
.option-mark { display: grid; place-items: center; flex: 0 0 20px; height: 20px; border: 1px solid #bdcdc3; border-radius: 50%; color: var(--green); font-size: 10px; font-weight: 800; }
.quiz-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.quiz-actions .button { width: auto; }
.result-score { display: flex; align-items: center; gap: 15px; margin: 18px 0; padding: 16px; border-radius: 12px; background: var(--green-soft); }
.score-number { color: var(--green); font-size: 30px; font-weight: 800; letter-spacing: -.05em; }
.answer-review { padding: 12px 0; border-top: 1px solid var(--line); }
.answer-review h3 { margin: 0 0 5px; font-size: 12px; }
.answer-review p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.correct-label { color: var(--green); font-weight: 800; }
.wrong-label { color: #a24c3e; font-weight: 800; }
.loading, .empty { padding: 22px; color: var(--muted); font-size: 13px; text-align: center; }
footer { padding: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; }

@media (max-width: 700px) {
  .topbar { padding: 14px 18px; }
  .demo-label { font-size: 9px; }
  .page { width: min(100% - 28px, 500px); margin: 24px auto 36px; }
  .hero { grid-template-columns: 1fr; gap: 15px; }
  .hero-stat { display: none; }
  .layout { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .card-pad { padding: 18px; }
  .quiz-actions { flex-direction: column-reverse; }
  .quiz-actions .button, .button.secondary { width: 100%; }
}

#account-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.nav-button { background: transparent; border: 0; padding: 8px; color: var(--green); cursor: pointer; font: inherit; font-size: 12px; }
.nav-button:hover { background: var(--green-soft); border-radius: 6px; }
.login-card { max-width: 500px; margin: 40px auto; }
.employee-form { margin-top: 20px; display: grid; gap: 14px; }
.employee-form label, .filters label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; }
input, select { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font: inherit; font-size: 13px; }
input:focus, select:focus { outline: 2px solid #8fb6a4; outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.employee-form .checkbox-label { display: flex; align-items: center; gap: 8px; }
.checkbox-label input { width: 18px; min-height: 18px; height: 18px; }
.form-error { color: #a24c3e; margin: 0; font-size: 12px; }
.filters { display: grid; grid-template-columns: minmax(200px, 1fr) 145px 135px auto; gap: 10px; align-items: end; margin: 20px 0; }
.button.compact { width: auto; }
.table-scroll { overflow-x: auto; }
.employee-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.employee-table th, .employee-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.employee-table th { color: var(--muted); font-size: 10px; white-space: nowrap; }
.employee-table small { display: block; color: var(--muted); margin-top: 5px; }
dt { color: var(--muted); font-size: 12px; margin-top: 15px; }
dd { margin: 5px 0 15px; }
.issued-password { font-size: 17px; overflow-wrap: anywhere; background: var(--green-soft); padding: 8px; display: inline-block; }
@media (max-width: 850px) { .topbar { flex-wrap: wrap; } #account-nav { order: 3; width: 100%; } .filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 550px) { .form-grid { grid-template-columns: 1fr; } .quiz-head { flex-wrap: wrap; } .filters { grid-template-columns: 1fr; } }
.assignments-list { margin-bottom: 20px; }
.assignment-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-top: 1px solid var(--line); }
.assignment-row:first-of-type { margin-top: 15px; }
.assignment-row strong { font-size: 13px; }
.assignment-row p { margin: 6px 0 0; }
.assignment-status { font-weight: 700; white-space: nowrap; }
.assignment-status.overdue { color: #a24c3e; }
.assignment-status.completed { color: var(--green); }
.assignment-status.in_progress { color: var(--amber); }
@media (max-width: 550px) { .assignment-row { align-items: flex-start; flex-direction: column; } }
.report-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.report-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.report-stat { background: #f5f8f5; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.report-stat span { display: block; color: var(--muted); font-size: 12px; }
.report-stat strong { display: block; margin-top: 8px; font-size: 28px; }
@media (max-width: 700px) { .report-filters, .report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 450px) { .report-filters { grid-template-columns: 1fr; } }
.catalog-course { padding: 22px 0; border-top: 1px solid var(--line); }
.catalog-course:first-of-type { margin-top: 18px; }
.catalog-course h3 { font-size: 16px; line-height: 1.4; margin: 12px 0; }
.course-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0; list-style: none; counter-reset: step; }
.course-steps li { counter-increment: step; padding: 12px; border-radius: 9px; background: var(--green-soft); font-size: 12px; line-height: 1.5; }
.course-steps li::before { content: counter(step); display: block; font-weight: 800; color: var(--green); margin-bottom: 5px; }
.lesson p + p { margin-top: 10px; }
.course-requirements { padding: 20px 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.6; }
.course-requirements li { margin: 6px 0; }
@media (max-width: 550px) { .course-steps { grid-template-columns: 1fr; } }

.learning-notice { margin-top: 14px; }
.lesson-source { font-size: 11px; color: var(--muted); }
.practice-case { margin: 22px 0; padding: 20px; border: 1px solid #bdcdc3; border-radius: 12px; background: #f5f8f5; }
.practice-case h4 { margin: 8px 0 12px; font-size: 16px; line-height: 1.4; }
.practice-case p { font-size: 13px; line-height: 1.65; }
.practice-question { font-weight: 700; }
.practice-step { color: var(--green); font-weight: 700; }
.practice-feedback { margin: 14px 0; padding: 12px; border-radius: 8px; font-size: 13px; line-height: 1.6; }
.practice-feedback.success { background: var(--green-soft); border-left: 3px solid var(--green); }
.practice-feedback.retry { background: #fff4e1; border-left: 3px solid var(--amber); }
.practice-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.practice-footer .nav-button { flex-shrink: 0; }
.practice-case .option:disabled { opacity: .85; cursor: default; }
@media (max-width: 550px) { .practice-case { padding: 14px; } .practice-footer { align-items: flex-start; flex-direction: column; } }

.answer-choices .option { cursor: pointer; width: 100%; box-sizing: border-box; }
.answer-choices input { flex: 0 0 auto; width: 20px; height: 20px; accent-color: #173f35; }
.answer-choices .option:has(input:checked) { border-color: #173f35; background: #edf7f1; }
.answer-grid { display: grid; gap: 16px; margin: 20px 0; }
.answer-grid label { display: grid; gap: 8px; font-weight: 600; }
.answer-grid select { width: 100%; min-height: 48px; border: 1px solid #b5c7be; border-radius: 10px; padding: 10px; background: white; color: #173f35; font-size: 16px; }
.question-figure { margin: 24px 0; }
.question-figure img { width: 100%; max-width: 840px; height: auto; }
.question-figure figcaption { color: #52685e; font-size: 14px; }

.trainer-jump { display: grid; gap: 8px; margin: 20px 0; }
.trainer-jump select { width: 100%; min-height: 48px; padding: 10px; border: 1px solid #b5c7be; border-radius: 10px; font-size: 16px; }

#extra-attempts-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font: inherit; font-size: 13px; resize: vertical; }
#extra-attempts-form textarea:focus { outline: 2px solid #8fb6a4; outline-offset: 1px; }

.kiosk-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(20,40,32,.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.kiosk-overlay .card { max-width: 540px; max-height: 90vh; overflow: auto; }
.kiosk-overlay button { margin: 6px 6px 0 0; }

[hidden] { display: none !important; }
.mobile-status { width: min(100% - 40px, 880px); margin: 12px auto 0; }
.mobile-status .notice { margin: 8px 0; }
.mobile-status > .nav-button { min-height: 44px; padding: 8px 0; }
.save-status { padding: 10px 12px; border-radius: 8px; background: var(--green-soft); font-size: 13px; margin: 6px 0; }
.save-status[data-state="failed"], .save-status[data-state="unsaved"] { background: var(--amber-soft); color: #71501b; }
.layout > *, .hero > *, .card { min-width: 0; }
.card p, .card h1, .card h2, .card h3, .option, .employee-table td { overflow-wrap: anywhere; }
#install-help p { font-size: 14px; line-height: 1.6; }
button, summary, .option { touch-action: manipulation; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
@media (max-width: 700px) {
  .topbar { gap: 12px; padding-top: max(14px, env(safe-area-inset-top)); }
  #account-nav { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 4px; }
  .nav-button { min-height: 44px; flex-shrink: 0; white-space: nowrap; }
  .mobile-status { width: min(100% - 28px, 500px); }
  .page { margin-top: 16px; }
  input, select, textarea { font-size: 16px !important; min-height: 48px; }
  .checkbox-label { min-height: 44px; }
  .module h3, .module p, .lesson h4, .lesson p, .subtle, .option, .button { font-size: 14px; }
  .module summary { min-height: 44px; padding-right: 24px; position: relative; }
  .module summary::after { position: absolute; right: 0; top: 0; }
  .quiz-head { align-items: flex-start; }
  .quiz-head .quiz-actions { width: 100%; flex-direction: row; flex-wrap: wrap; margin-top: 8px; }
  .quiz-head .quiz-actions .button { flex: 1 1 130px; }
  .question-title { font-size: 21px; }
  .question-count { white-space: normal; }
  .option { padding: 14px; min-height: 48px; }
  .answer-grid label { font-size: 14px; }
  .answer-choices input { min-height: 20px; }
  .kiosk-overlay { padding: 14px; }
  footer { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}
.mobile-status { position: sticky; top: 0; z-index: 50; background: var(--canvas); }
.mobile-status:has(#save-status:not([hidden])) > #install-app { display: none; }
#app { scroll-margin-top: 60px; }
