/* Puente — warm editorial classroom */
:root {
  --paper: #F3EEE4;
  --paper-deep: #E8E0D2;
  --ink: #1A1714;
  --ink-soft: #4A433C;
  --muted: #7A7268;
  --line: #D4CBBA;
  --teal: #0E5C58;
  --teal-deep: #0A4542;
  --teal-soft: #D7E8E6;
  --terra: #C45C3E;
  --terra-soft: #F3DDD6;
  --gold: #C4A36A;
  --white: #FFFbf5;
  --shadow: 0 18px 40px rgba(26, 23, 20, 0.08);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -80px, rgba(14, 92, 88, 0.08), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal); }

.app {
  max-width: 720px;
  min-height: 100%;
  margin: 0 auto;
  padding: 16px 16px 36px;
  position: relative;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.mark {
  width: 42px;
  height: 42px;
  flex: none;
}

.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand-sub {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

.icon-btn {
  border: 1px solid var(--line);
  background: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.03em; margin: 0; }
h1 { font-size: 34px; line-height: 1.12; }
h2 { font-size: 24px; line-height: 1.2; }
.lede { color: var(--ink-soft); margin: 10px 0 0; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--teal-soft);
  color: var(--teal-deep);
}
.chip.terra { background: var(--terra-soft); color: #8A3A26; }
.chip.quiet { background: var(--paper-deep); color: var(--ink-soft); }

.btn {
  border: 0;
  background: var(--teal);
  color: #f6fffe;
  border-radius: 14px;
  padding: 13px 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.btn:hover { background: var(--teal-deep); }
.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.terra { background: var(--terra); color: #fffaf7; }
.btn.terra:hover { background: #a84b31; }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.choice, .goal {
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 14px;
  padding: 14px 14px;
}
.choice strong, .goal strong { display: block; font-weight: 650; }
.choice span, .goal span { color: var(--muted); font-size: 14px; }
.choice.selected, .goal.selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 92, 88, 0.16);
  background: #f4faf9;
}

label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input[type="text"], input[type="password"] {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 12px;
  padding: 12px 12px;
}

.hero-mark { width: 86px; height: 86px; margin: 18px auto 8px; display: block; }

.progress-rail {
  height: 6px;
  background: var(--paper-deep);
  border-radius: 99px;
  overflow: hidden;
}
.progress-rail > i {
  display: block;
  height: 100%;
  background: var(--teal);
  width: 0;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}
.stat b { display: block; font-family: var(--serif); font-size: 22px; }
.stat span { color: var(--muted); font-size: 12px; }

.lesson-card {
  display: grid;
  gap: 6px;
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 16px;
  padding: 14px;
}
.lesson-card .meta { color: var(--muted); font-size: 13px; }
.lesson-card.done { opacity: 0.72; }

.phrase {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.ipa { font-family: var(--mono); color: var(--muted); font-size: 13px; }
.meaning { color: var(--ink-soft); font-size: 16px; }

.dialogue {
  display: grid;
  gap: 8px;
}
.bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--paper-deep);
}
.bubble.you { margin-left: auto; background: var(--teal-soft); }
.bubble small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }

.nav {
  position: sticky;
  bottom: 8px;
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  background: rgba(243, 238, 228, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px;
}
.nav button {
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 10px 6px;
  font-size: 13px;
  color: var(--ink-soft);
}
.nav button.active { background: var(--white); color: var(--ink); font-weight: 650; }

.hidden { display: none !important; }
.center { text-align: center; }
.tiny { font-size: 13px; color: var(--muted); }
.ok { color: var(--teal-deep); font-weight: 650; }
.bad { color: var(--terra); font-weight: 650; }

.wave {
  display: flex;
  gap: 4px;
  height: 28px;
  align-items: end;
  justify-content: center;
}
.wave i {
  width: 4px;
  background: var(--teal);
  border-radius: 4px;
  height: 8px;
  animation: pulse 1s ease-in-out infinite;
}
.wave i:nth-child(2) { animation-delay: .15s; }
.wave i:nth-child(3) { animation-delay: .3s; }
.wave i:nth-child(4) { animation-delay: .45s; }
@keyframes pulse {
  0%, 100% { height: 8px; opacity: .45; }
  50% { height: 26px; opacity: 1; }
}

.screen { animation: in .28s ease; }
@keyframes in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.running {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.folio { color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.page-sheet {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 22px 20px 28px;
  box-shadow: var(--shadow);
  min-height: 520px;
}
.kicker {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 8px;
}
.ex-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--terra);
  letter-spacing: 0.08em;
  margin: 0 0 6px;
}
.rule-box {
  background: var(--paper);
  border-left: 3px solid var(--teal);
  padding: 12px 14px;
  margin: 14px 0;
}
.rule-box ul { margin: 8px 0 0; padding-left: 18px; }
.howto { padding-left: 20px; }
.howto li { margin: 8px 0; }
.toc { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 8px; }
.toc-row {
  width: 100%;
  display: flex;
  gap: 12px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 4px;
  padding: 12px;
}
.toc-row strong { display: block; font-family: var(--serif); font-size: 20px; }
.toc-row em { display: block; color: var(--muted); font-style: italic; font-size: 14px; }
.toc-row small { display: block; color: var(--ink-soft); margin-top: 4px; }
.toc-row.locked { opacity: 0.5; }
.toc-num {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--teal);
  width: 42px;
  flex: none;
}
table.lex {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 8px;
  font-size: 15px;
}
table.lex th, table.lex td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 8px 6px;
  vertical-align: top;
}
table.lex th { color: var(--muted); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.word {
  border: 0;
  background: none;
  padding: 0;
  color: var(--teal-deep);
  font-weight: 650;
  text-align: left;
}
.drill {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--line);
}
.drill .n { color: var(--muted); width: 1.4em; }
.drill input {
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  min-width: 72px;
  width: 88px;
  padding: 2px 4px;
  text-align: center;
}
.line {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  padding: 8px 2px;
  margin-top: 6px;
}
.drill-block { border: 0; padding: 10px 0 14px; margin: 0; }
.radio { display: block; margin: 6px 0; }
.pool { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tile {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 4px;
  padding: 6px 10px;
}
.tile.ghost { color: var(--muted); }
.tile:disabled { opacity: .35; cursor: default; }
.storage-warn {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px 16px;
  background: var(--terra);
  color: var(--white);
  font-size: 14px;
  text-align: center;
}
.built {
  min-height: 36px;
  border-bottom: 1px solid var(--ink);
  padding: 6px 2px;
  font-family: var(--serif);
  font-size: 20px;
}
.ghost { color: var(--muted); font-family: var(--sans); font-size: 14px; }
.pager {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.pager .btn { flex: 1; }
.key { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.score {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 10px 12px;
  margin: 10px 0 14px;
  font-size: 15px;
}
.score.pass { border-color: var(--teal); background: var(--teal-soft); }
.score.fail { border-color: var(--terra); background: var(--terra-soft); }
.subhead {
  font-family: var(--serif);
  font-size: 18px;
  margin: 18px 0 6px;
  color: var(--teal-deep);
}
.level-block h2 { margin-bottom: 4px; }
.examples span { color: var(--ink-soft); }

.app.wide { max-width: 1100px; }
.wrap { flex-wrap: wrap; }
.table-wrap { overflow: auto; border: 1px solid var(--line); background: var(--white); }
.gradebook { width: 100%; border-collapse: collapse; font-size: 14px; }
.gradebook th, .gradebook td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.gradebook th { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.gradebook tr.ready { background: #f4faf9; }
.gradebook tr.late { background: var(--terra-soft); }
.assign-grid { display: grid; grid-template-columns: 1fr; gap: 4px; max-height: 280px; overflow: auto; border: 1px solid var(--line); padding: 8px; background: var(--white); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.linkish { border: 0; background: none; padding: 0; color: var(--teal); font-weight: 650; }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-family: var(--mono); font-size: 12px; background: var(--white); }
input.paper { width: 70px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
@media (min-width: 760px) {
  .app.wide { max-width: 1100px; }
  .assign-grid { grid-template-columns: 1fr 1fr; }
}
  body { background: #e7dfd0; }
  .app {
    max-width: 760px;
    margin: 24px auto;
    background: transparent;
    border: 0;
    min-height: calc(100% - 48px);
    padding: 0 12px 36px;
    box-shadow: none;
  }
}

/* Sign-in tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); }
.tab {
  border: 0;
  background: none;
  padding: 10px 14px;
  font-weight: 650;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: var(--teal-deep); border-bottom-color: var(--teal); }
input[type="date"], select {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 12px;
  padding: 10px 12px;
}

/* Messages */
.notice {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid var(--teal);
  background: var(--teal-soft);
  border-radius: 12px;
  font-size: 15px;
}

/* Student practice panel on the index */
.practice-panel {
  margin-bottom: 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.practice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.practice-card strong { display: block; }
.practice-card small { color: var(--muted); }

/* Strengths and weaknesses */
.mastery-cols { display: grid; grid-template-columns: 1fr; gap: 8px 24px; }
@media (min-width: 720px) { .mastery-cols { grid-template-columns: 1fr 1fr; } }
.mastery-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; font-size: 15px; }
.mastery-list small { color: var(--muted); }
.lv {
  display: inline-block;
  min-width: 46px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}
.lv-strong { background: var(--teal-soft); color: var(--teal-deep); }
.lv-mid { background: #F4EAD2; color: #7A5A1C; }
.lv-weak { background: var(--terra-soft); color: #8A3A26; }
.lv-few { background: var(--paper-deep); color: var(--muted); }
.gradebook.mastery td:not(:first-child), .gradebook.mastery th:not(:first-child) { text-align: center; }

/* Teacher desk */
.class-code {
  display: grid;
  gap: 2px;
  margin: 14px 0;
  padding: 12px 16px;
  border: 1px dashed var(--teal);
  border-radius: 12px;
  background: var(--white);
}
.class-code span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.class-code b { font-family: var(--mono); font-size: 30px; letter-spacing: .12em; color: var(--teal-deep); }
.class-code small { color: var(--muted); }
.assign-box { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.assign-box summary { font-weight: 650; cursor: pointer; }
.check.weak { color: #8A3A26; font-weight: 650; }

/* ---------- curriculum revision: units, exams, corrections, WhatsApp, curriculum map */
details.level-block { margin: 18px 0; border-top: 1px solid var(--line); padding-top: 14px; }
details.level-block > summary { list-style: none; cursor: pointer; }
details.level-block > summary::-webkit-details-marker { display: none; }
details.level-block > summary h2::after { content: " ▸"; color: var(--muted); font-size: 16px; }
details.level-block[open] > summary h2::after { content: " ▾"; }
.toc-row.checkpoint { background: var(--teal-soft); }
.toc-row.checkpoint .toc-num { font-size: 12px; }
.toc-row.passed strong::after { content: " ✓"; color: var(--teal); }

.how-sec { margin: 18px 0; }
.how-sec h2 { font-size: 22px; margin-bottom: 6px; }
.how-sec p { margin: 6px 0; }

.next-step { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; margin: 10px 0; border-radius: 12px; background: var(--teal-soft); }
.next-step small { display: block; color: var(--teal-deep); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.announce { margin: 8px 0 12px; display: grid; gap: 8px; }
.announce p { margin: 0; padding: 10px 12px; border-left: 4px solid var(--gold); background: var(--white); border-radius: 8px; }
.announce small { display: block; color: var(--muted); font-size: 12px; }

.mistakes { list-style: none; padding: 0; display: grid; gap: 8px; }
.mistakes li { padding: 8px 10px; background: var(--terra-soft); border-radius: 10px; }
.mistakes s { color: #8A3A26; }
.mistakes small { display: block; color: var(--ink-soft); margin-top: 2px; }

.reading { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0; font-size: 18px; line-height: 1.6; }
.reading h3 { font-family: var(--serif); margin: 0 0 6px; }
.write-list { padding-left: 20px; display: grid; gap: 14px; }
.write-list textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; background: var(--white); }
.write-list details { margin-top: 6px; }
.write-list .model { margin: 6px 0 0; }

.progress-bar { height: 6px; background: var(--paper-deep); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.progress-bar span { display: block; height: 100%; background: var(--teal); }
.from { color: var(--ink-soft); }

.result { text-align: center; padding: 18px; border-radius: 14px; margin: 12px 0; }
.result.pass { background: var(--teal-soft); }
.result.fail { background: var(--terra-soft); }
.result .big { font-family: var(--serif); font-size: 52px; margin: 0; line-height: 1; }
.result p { margin: 6px 0; }
.corrections { padding-left: 0; list-style: none; display: grid; gap: 10px; }
.correction { padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--terra); border-radius: 10px; background: var(--white); }
.correction p { margin: 3px 0; }
.correction .q .n { color: var(--muted); }
.correction .yours s { color: #8A3A26; }
.correction .right b { color: var(--teal-deep); }
.correction .why { color: var(--ink-soft); font-size: 14px; }
.blank { letter-spacing: .1em; color: var(--muted); }

.teacher-note { margin-top: 14px; padding: 10px 12px; border: 1px dashed var(--gold); border-radius: 10px; font-size: 14px; }
.teacher-note summary { font-weight: 650; cursor: pointer; color: var(--ink-soft); }
.teacher-note dt { font-weight: 650; margin-top: 6px; }
.teacher-note dd { margin: 0; }
.teacher-note ul { margin: 2px 0; padding-left: 18px; }
.bank-list { padding-left: 22px; display: grid; gap: 8px; font-size: 15px; }
.bank-list .why { display: block; color: var(--muted); }

.wa-list { list-style: none; padding: 0; display: grid; gap: 6px; }
.wa-list li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.wa-list li.sent { opacity: .7; }
.wa-list small { color: var(--muted); }
.wa-list .btn { text-decoration: none; }
.wa-mini { display: inline-block; margin-left: 6px; font-size: 12px; color: #1f7a4d; }
.assign-box textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; background: var(--white); }
.unit-pick { margin: 6px 0; }
.unit-pick summary { cursor: pointer; font-weight: 600; }

.map-unit { margin: 26px 0; }
.map-unit h2 small { color: var(--muted); font-size: 15px; font-style: italic; }
.gradebook.curriculum td { font-size: 13px; min-width: 110px; }
.gradebook.curriculum td:first-child { min-width: 0; }
.gradebook.curriculum tr.checkpoint { background: var(--teal-soft); }
.gradebook.curriculum details summary { cursor: pointer; font-size: 12px; color: var(--teal); }
.exam-log { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.exam-log summary { cursor: pointer; }

@media print {
  .running, .pager, .notice, button.btn, .btn { display: none !important; }
  .app, .app.wide { max-width: none; }
  .page-sheet { box-shadow: none; border: 0; }
  .gradebook.curriculum td { font-size: 10px; }
}
