:root {
  --ink: #163630;
  --muted: #647771;
  --paper: #fffefa;
  --canvas: #f2f6f1;
  --brand: #17685c;
  --brand-dark: #104d45;
  --accent: #e99b3e;
  --line: #d8e3de;
  --success: #177552;
  --danger: #a6453b;
  --focus: #145dd7;
  --radius: 18px;
  --shadow: 0 12px 35px rgba(21, 61, 52, .09);
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.skip-link { position: absolute; left: -999px; top: 8px; background: white; padding: 10px; z-index: 20; }
.skip-link:focus { left: 8px; }
.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(18px, 5vw, 64px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--ink); display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px;
  border-radius: 14px; background: var(--brand); color: white; font-size: 1.35rem; font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: .78rem; margin-top: -2px; }
.parent-link { color: var(--brand-dark); font-weight: 750; text-decoration: none; padding: 10px 12px; }
.shell { width: min(780px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 70px; }
.shell.wide { width: min(1100px, calc(100% - 32px)); }
.loading-card, .card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.loading-card { min-height: 250px; display: grid; place-items: center; align-content: center; gap: 14px; }
.spinner { width: 36px; height: 36px; border: 4px solid #d9e7e2; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.eyebrow { color: var(--brand); text-transform: uppercase; letter-spacing: .11em; font-size: .75rem; font-weight: 850; margin: 0 0 7px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 7vw, 3.25rem); line-height: 1.03; letter-spacing: -.045em; margin-bottom: 14px; }
h2 { font-size: clamp(1.35rem, 4vw, 1.8rem); line-height: 1.2; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 610px; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin: 30px 0 38px; }
.day-dot { text-align: center; min-width: 0; }
.day-dot span {
  width: 36px; height: 36px; display: grid; place-items: center; margin: auto; border-radius: 50%;
  background: white; border: 1px solid var(--line); color: var(--muted); font-size: .82rem; font-weight: 800;
}
.day-dot small { display: block; margin-top: 5px; font-size: .63rem; color: var(--muted); overflow: hidden; }
.day-dot.current span { background: var(--brand); color: white; border-color: var(--brand); }
.day-dot.complete span { background: #dff4e8; color: var(--success); }
.day-dot.off span { background: #eee; color: #777; }
.task-list { display: grid; gap: 14px; }
.task-card {
  width: 100%; display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 16px;
  text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  padding: 18px; color: var(--ink); box-shadow: 0 5px 16px rgba(21, 61, 52, .05); cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.task-card:hover { transform: translateY(-2px); border-color: #9ebbb3; }
.task-card:disabled { cursor: default; transform: none; opacity: .7; }
.completed-task { box-shadow: none; background: #f3f7f5; border-color: #dbe7e2; color: var(--muted); padding-block: 13px; }
.completed-task .task-icon { color: var(--success); background: #dff4e8; }
.task-icon { width: 50px; height: 50px; border-radius: 15px; background: #e3f1ed; display: grid; place-items: center; font-size: 1.35rem; }
.task-title { display: block; font-size: 1.08rem; font-weight: 850; }
.task-meta { display: block; color: var(--muted); font-size: .86rem; }
.task-arrow { font-size: 1.4rem; color: var(--brand); }
.progress-track { height: 9px; background: #dfe8e4; border-radius: 99px; overflow: hidden; margin: 13px 0 8px; }
.progress-fill { height: 100%; background: var(--brand); transition: width .25s ease; }
.runner-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.back-button { border: 0; background: transparent; color: var(--brand); font-weight: 800; padding: 10px 0; cursor: pointer; }
.step-count { color: var(--muted); font-size: .85rem; }
.activity-card { padding: clamp(22px, 5vw, 42px); min-height: 390px; }
.phase-pill, .status-pill {
  display: inline-flex; border-radius: 99px; padding: 5px 10px; background: #e7f1ee; color: var(--brand-dark);
  font-size: .72rem; font-weight: 850; text-transform: uppercase; letter-spacing: .07em;
}
.activity-prompt { font-size: clamp(1.3rem, 4vw, 1.8rem); line-height: 1.35; margin: 20px 0 10px; white-space: pre-line; }
.activity-instruction { color: var(--muted); }
.vocabulary-card { min-height: 410px; }
.new-word { font-size: clamp(2.25rem, 8vw, 3.7rem); line-height: 1.05; margin: 24px 0 28px; letter-spacing: -.035em; }
.vocab-label { margin: 20px 0 4px; color: var(--muted); font-size: .78rem; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.vocab-question { margin-top: 26px; }
.vocab-meaning { font-size: clamp(1.35rem, 5vw, 2rem); line-height: 1.35; margin: 4px 0 16px; max-width: 650px; }
.vocab-example { font-size: 1.05rem; color: var(--ink); margin-bottom: 24px; }
.vocab-pattern { display: inline-flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 11px; background: #f0f5f2; font-weight: 800; }
.vocab-pattern span, .feedback-label { display: block; color: var(--muted); font-size: .7rem; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.vocab-correct { font-size: 1.35rem; }
.feedback-label { margin-top: 12px; }
.choices { display: grid; gap: 10px; margin: 24px 0; }
.choice {
  min-height: 56px; text-align: left; padding: 13px 16px; border: 2px solid var(--line); border-radius: 13px;
  background: white; color: var(--ink); cursor: pointer; font-weight: 680;
}
.choice[aria-pressed="true"] { border-color: var(--brand); background: #ecf7f4; }
.answer-input, .answer-area {
  width: 100%; border: 2px solid #b8cac4; border-radius: 13px; padding: 14px 16px; color: var(--ink); background: white;
  margin: 20px 0 8px;
}
.answer-area { min-height: 145px; resize: vertical; }
.confidence { margin: 24px 0 4px; padding: 18px; background: #f5f7f4; border-radius: 14px; }
.confidence legend { font-weight: 850; padding: 0 6px; }
.confidence-options { display: flex; flex-wrap: wrap; gap: 9px; }
.confidence label { border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; background: white; cursor: pointer; }
.confidence input { margin-right: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.button {
  min-height: 50px; padding: 12px 20px; border: 0; border-radius: 13px; background: var(--brand); color: white;
  font-weight: 850; cursor: pointer;
}
.button:hover { background: var(--brand-dark); }
.button.secondary { background: #e6efec; color: var(--brand-dark); }
.button.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.feedback { margin-top: 22px; border-left: 5px solid var(--brand); background: #edf6f2; border-radius: 10px; padding: 15px 17px; }
.feedback.error { border-color: var(--danger); background: #fff0ed; }
.feedback strong { display: block; margin-bottom: 3px; }
.checklist { padding-left: 22px; color: var(--ink); }
[dir="rtl"] { font-family: Tahoma, Arial, sans-serif; text-align: right; }
[dir="rtl"] .feedback { border-left: 0; border-right: 5px solid var(--brand); }
.recording-box { margin: 22px 0; padding: 18px; border: 1px dashed #9ebbb3; border-radius: 14px; }
.recording-box audio { width: 100%; margin-top: 14px; }
.notice { padding: 16px; border-radius: 13px; background: #fff5df; border: 1px solid #ead298; margin: 20px 0; }
.off-card { text-align: center; padding: 60px 25px; }
.off-icon { display: block; font-size: 3rem; margin-bottom: 16px; }
.locked { text-align: center; padding: 50px 24px; }
.complete-screen { text-align: center; padding: 45px 24px; }
.complete-mark { width: 76px; height: 76px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; background: #dff4e8; color: var(--success); font-size: 2rem; font-weight: 900; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 140%); background: var(--ink); color: white; padding: 11px 18px; border-radius: 12px; transition: transform .2s; z-index: 20; }
.toast.show { transform: translate(-50%, 0); }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 25px 0; }
.metric { padding: 22px; }
.metric strong { font-size: 1.8rem; display: block; }
.metric span { color: var(--muted); font-size: .87rem; }
.parent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { padding: 24px; }
.status-list { list-style: none; padding: 0; margin: 0; }
.status-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.empty { color: var(--muted); font-style: italic; }
.parent-tabs { display: flex; gap: 8px; margin: 24px 0; border-bottom: 1px solid var(--line); }
.parent-tabs button { border: 0; background: transparent; color: var(--muted); padding: 12px 14px; font-weight: 800; cursor: pointer; }
.parent-tabs button.active { color: var(--brand); border-bottom: 3px solid var(--brand); }
.parent-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.editor-section { margin: 18px 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfa; }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.editor-grid label, .field { display: grid; gap: 5px; color: var(--muted); font-size: .82rem; font-weight: 750; }
.editor-grid input, .editor-grid textarea, .editor-grid select, .field input, .field textarea, .field select {
  width: 100%; border: 1px solid #b8cac4; border-radius: 9px; padding: 9px 11px; background: white; color: var(--ink);
}
.editor-grid .full { grid-column: 1 / -1; }
.module-editor, .activity-editor { border-left: 4px solid #d6e8e2; padding: 14px; margin: 12px 0; background: white; border-radius: 8px; }
.activity-editor { border-left-color: #ead298; }
.compact-list { display: grid; gap: 8px; }
.compact-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px; border-bottom: 1px solid var(--line); }
.validation-errors { color: var(--danger); }
.advanced-json { width: 100%; min-height: 420px; font-family: ui-monospace, monospace; font-size: .8rem; }
.login-card { max-width: 460px; margin: 50px auto; padding: 32px; }
.upload-label { display: inline-flex; align-items: center; }
.validation-checks { list-style: none; padding: 0; display: grid; gap: 7px; color: var(--success); font-weight: 800; }
.agenda-preview { margin-top: 18px; }
.preview-days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 20px 0; }
.preview-days article { border: 1px solid var(--line); border-radius: 12px; padding: 13px; background: #fafcfb; }
.preview-days h3 { margin-bottom: 5px; }
.preview-days ul { margin: 0; padding-left: 20px; }
.prominent-warning { border: 2px solid #d79a35; }
.version-row > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

@media (max-width: 650px) {
  html { font-size: 16px; }
  .site-header { min-height: 68px; padding: 10px 16px; }
  .brand-mark { width: 41px; height: 41px; }
  .parent-link { font-size: .82rem; }
  .shell { padding-top: 26px; }
  .week-strip { gap: 3px; }
  .day-dot span { width: 32px; height: 32px; }
  .day-dot small { font-size: .56rem; }
  .task-card { grid-template-columns: 44px 1fr auto; padding: 15px; gap: 12px; }
  .task-icon { width: 44px; height: 44px; }
  .summary-grid, .parent-grid, .editor-grid { grid-template-columns: 1fr; }
  .preview-days { grid-template-columns: 1fr 1fr; }
  .editor-grid .full { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; } }
