:root {
  --page: #faf3e8;
  --shell: #fffdf8;
  --card: rgba(255, 253, 248, 0.92);
  --ink: #263041;
  --muted: #77716a;
  --line: #eadfce;
  --active: #f3e4d6;
  --navy: #273858;
  --sage: #8cad7f;
  --pink: #e8a7b8;
  --shadow: 0 18px 50px rgba(44, 35, 22, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 5%, rgba(255, 255, 255, 0.7), transparent 28rem),
    linear-gradient(115deg, #fbf6ed 0%, #f7eadb 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid rgba(234, 223, 206, 0.8);
  background: rgba(255, 253, 248, 0.62);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #f7dfdf;
  font-size: 1.35rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.14rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.tabbar {
  display: grid;
  gap: 8px;
}

.tabbar button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 16px;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-weight: 750;
}

.tabbar button.active {
  background: var(--active);
}

.version-pill {
  margin-top: auto;
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: white;
  font-size: 0.82rem;
}

.content {
  width: min(100%, 1220px);
  padding: 28px;
}

.topbar {
  min-height: 54px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h2 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 0.95;
}

.ghost-action,
.primary-action,
.data-actions button,
.import-label {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  font-weight: 800;
}

.ghost-action,
.data-actions button,
.import-label {
  color: var(--ink);
  background: white;
}

.ghost-action.danger-action {
  color: #8d2f28;
  border-color: #e7c6bd;
  background: #fff6f3;
}

.primary-action {
  color: white;
  background: var(--navy);
  border-color: var(--navy);
}

.secondary-action {
  color: var(--ink);
  background: #fffdf8;
  border-color: var(--line);
}

.mission-execution-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.mission-execution-actions .primary-action {
  flex: 0 1 220px;
  min-height: 48px;
  font-size: 1rem;
}

.summary-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
}

.summary-check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  font-weight: 800;
}

.summary-check-grid input {
  width: 16px;
  height: 16px;
}

.homework-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbf6;
}

.homework-section[hidden] {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

.hero-card,
.card {
  border: 1px solid rgba(234, 223, 206, 0.9);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: 148px;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 24px;
  align-items: center;
}

.hero-card h3 {
  max-width: 38rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.14;
}

.goal-hero {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
}

.goal-formula {
  min-height: 102px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
  text-align: center;
}

.goal-formula strong {
  color: #2d3c63;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1;
}

.goal-formula span {
  margin-top: 8px;
  color: var(--muted);
}

.hero-note {
  margin: 14px 0 0;
  color: #6d4c16;
  font-weight: 850;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.countdown-grid div {
  min-height: 102px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
}

.countdown-grid strong {
  font-size: 2.65rem;
  line-height: 1;
  color: #2d3c63;
}

.countdown-grid span,
.hidden-count,
.muted,
.soft-copy {
  color: var(--muted);
}

.hidden-count {
  display: none;
}

.hidden-list {
  display: none;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.today-execution-grid {
  grid-template-columns: minmax(420px, 1.2fr) minmax(420px, 1fr);
  align-items: start;
}

.today-execution-grid > .card {
  align-self: start;
}

#resources {
  width: min(96vw, 1500px);
  max-width: 1500px;
  margin: 0 auto;
}

.resources-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.3fr) minmax(620px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.resources-layout > .card {
  min-width: 0;
}

.resources-layout > .card:first-child {
  align-self: start;
}

.resources-layout > .card:last-child {
  min-width: 0;
}

.card {
  padding: 22px;
}

.card-head {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head strong {
  font-size: 1rem;
}

.card-head span {
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--muted);
  background: #f3ebe0;
  font-size: 0.82rem;
  font-weight: 850;
}

.collapsible-card {
  padding: 0;
  overflow: hidden;
}

.collapsible-card summary {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px;
  cursor: pointer;
  list-style: none;
}

.collapsible-card summary::-webkit-details-marker {
  display: none;
}

.collapsible-card summary::after {
  content: "⌄";
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: #f3ebe0;
  font-weight: 900;
}

.collapsible-card[open] summary::after {
  transform: rotate(180deg);
}

.bloom-path-details {
  margin-top: 14px;
}

.bloom-path-details summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: white;
  cursor: pointer;
  list-style: none;
  font-weight: 850;
}

.bloom-path-details summary::-webkit-details-marker {
  display: none;
}

.bloom-path-details summary::after {
  content: "⌄";
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: #f3ebe0;
  font-weight: 900;
}

.bloom-path-details[open] summary::after {
  transform: rotate(180deg);
}

.collapsible-card summary span {
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--muted);
  background: #f3ebe0;
  font-size: 0.82rem;
  font-weight: 850;
}

.collapsible-card .mission-list {
  padding: 0 16px 16px;
}

.do-next-card h3 {
  margin-bottom: 10px;
  font-size: clamp(1.85rem, 3vw, 2.45rem);
  line-height: 1.08;
  max-width: 18ch;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#todayNextTaskMeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#todayNextTaskMeta span,
#todayNextTaskMeta strong {
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  color: #4d4437;
  background: #f2eadc;
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 900;
}

#todayNextTaskMeta strong {
  color: white;
  background: var(--navy);
}

#todayNextTaskMeta em {
  flex-basis: 100%;
  color: var(--muted);
  font-style: normal;
  line-height: 1.45;
}

.setup-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 18px;
}

.setup-card h3 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.2;
}

.setup-card p {
  max-width: 48rem;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.do-next-card p,
.bloom-card p,
.progress-card p {
  margin: 0 0 16px;
  line-height: 1.55;
}

.mission-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.mission-summary span {
  border-radius: 999px;
  padding: 7px 10px;
  color: #39445a;
  background: #f2eadc;
  font-size: 0.82rem;
  font-weight: 850;
}

.mission-summary strong {
  color: #6d4c16;
}

.commute-summary {
  display: grid;
  gap: 10px;
}

.commute-summary strong {
  display: block;
  font-size: 1.2rem;
  line-height: 1.25;
}

.commute-summary span {
  color: var(--muted);
  font-weight: 850;
}

.commute-summary div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.commute-summary small {
  border-radius: 999px;
  padding: 6px 10px;
  color: #4d4437;
  background: #f2eadc;
  font-size: 0.82rem;
  font-weight: 900;
}

.commute-summary-card .secondary-action {
  margin-top: 14px;
}

.metric-list,
.weekly-balance {
  display: grid;
  gap: 10px;
}

.metric-list div,
.weekly-row {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.metric-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-list span {
  color: var(--muted);
  font-weight: 800;
}

.metric-list strong {
  color: var(--ink);
  text-align: right;
}

.weekly-row {
  display: grid;
  gap: 10px;
}

.weekly-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.weekly-row span {
  color: var(--muted);
  font-weight: 850;
}

.mini-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee5d8;
}

.mini-progress div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--pink));
}

.bloom {
  min-height: 78px;
  display: grid;
  place-items: center;
  margin: 6px 0 10px;
  font-size: 4.6rem;
}

.bloom-path {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.bloom-step {
  min-height: 52px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.bloom-step.reached {
  background: #f8fbf6;
}

.bloom-step span {
  font-size: 1.35rem;
}

.bloom-step small {
  color: var(--muted);
  font-weight: 850;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee5d8;
  margin-top: 16px;
}

.progress-track div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--pink));
}

.score-grid,
.mode-grid,
.resource-grid,
.energy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.score-card,
.mode-card,
.energy-card,
.mini-card,
.study-card,
.mission-item,
.tracker-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.score-card {
  padding: 12px;
  display: grid;
  gap: 6px;
}

.score-card span,
.score-card small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.score-card input {
  width: 100%;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1.75rem;
  font-weight: 900;
}

.score-card.risk {
  background: #fff8e9;
}

.score-card.ok,
.score-card.strong {
  background: #f8fbf6;
}

.risk-note {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 18px;
  color: #6d4c16;
  background: #fff7df;
  line-height: 1.55;
}

.mission-list,
.tracker-list,
.card-list,
.priority-list,
.sequence-plan,
.toolkit-grid,
.template-bank,
.story-map,
.question-list {
  display: grid;
  gap: 10px;
}

.mission-slot-group {
  display: grid;
  gap: 8px;
}

.mission-slot-group h4,
.mission-list > h4 {
  margin: 10px 0 2px;
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0;
  font-weight: 950;
}

.sequence-day {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.sequence-day div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.sequence-day strong {
  display: block;
}

.sequence-day span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  background: #f3ebe0;
  font-size: 0.78rem;
  font-weight: 850;
}

.sequence-day p {
  margin: 3px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.priority-list div {
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.priority-list strong {
  display: block;
}

.priority-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.mission-item,
.tracker-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
}

.mission-item input,
.tracker-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--sage);
}

.mission-item strong,
.tracker-item strong,
.mini-card strong,
.study-card strong {
  display: block;
}

.mission-item strong {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mission-item small,
.tracker-item small,
.mini-card span,
.study-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.45;
}

.mission-kind {
  margin-top: 0 !important;
  color: #7a5a20 !important;
  font-size: 0.74rem !important;
  font-weight: 950;
  text-transform: uppercase;
}

.mission-reason {
  color: #5f6a58 !important;
}

.mission-engine-details {
  margin-top: 8px;
}

.mission-engine-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.mission-engine-details div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.mission-engine-details small {
  margin-top: 0;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f4eee5;
  font-size: 0.72rem;
}

.mission-item.done,
.tracker-item.done {
  opacity: 0.62;
}

.mission-item.done strong,
.tracker-item.done strong {
  text-decoration: line-through;
}

.sleep-check-card[open] {
  border-color: #d8c6aa;
  background: #fffaf2;
}

.sleep-check-card summary span {
  color: #7a5a20;
  font-size: 0.78rem;
  font-weight: 950;
}

.sleep-check-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.sleep-check-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.sleep-bulk-actions,
.sleep-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sleep-bulk-actions button,
.sleep-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 10px;
  color: var(--ink);
  background: white;
  font-weight: 900;
}

.sleep-mission-list {
  display: grid;
  gap: 8px;
}

.sleep-mission-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.sleep-mission-row small,
.sleep-mission-row span {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.sleep-mission-row small {
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.sleep-mission-row strong {
  display: block;
  margin: 2px 0;
  color: var(--ink);
  line-height: 1.25;
}

.reading-passage-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.reading-passage-card.done {
  background: #f8fbf6;
}

.reading-passage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.reading-passage-head div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.reading-passage-head strong {
  font-size: 1.05rem;
}

.reading-passage-head span,
.reading-fields span,
.reading-review span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.reading-passage-head label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 850;
}

.reading-passage-head input {
  width: 18px;
  height: 18px;
  accent-color: var(--sage);
}

.reading-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.reading-fields label,
.reading-review {
  display: grid;
  gap: 6px;
}

.reading-fields input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  color: var(--ink);
  background: #fffdf8;
}

.reading-review textarea {
  min-height: 76px;
  border-radius: 14px;
  background: #fffdf8;
}

.continue-panel,
.review-card,
.type-row,
.vocab-summary div,
.center-book,
.center-test {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.continue-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
}

.continue-panel strong,
.continue-panel span {
  display: block;
}

.continue-panel span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 850;
}

.continue-panel small {
  display: block;
  max-width: 420px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.center-list,
.vocab-summary {
  display: grid;
  gap: 10px;
}

.center-book,
.center-test {
  overflow: hidden;
}

.center-book summary,
.center-test summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.center-book summary::-webkit-details-marker,
.center-test summary::-webkit-details-marker {
  display: none;
}

.center-test {
  margin: 0 12px 10px;
  background: #fffdf8;
}

.center-unit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.center-unit {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  color: var(--ink);
  background: white;
  text-align: left;
}

.center-unit.done {
  background: #f8fbf6;
}

.center-unit.review {
  background: #fff8e9;
}

.center-unit span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.review-card,
.type-row,
.vocab-summary div {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.review-card span,
.type-row span,
.vocab-summary span {
  display: block;
  color: var(--muted);
  font-weight: 850;
}

.review-card button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 10px;
  color: var(--ink);
  background: #fffdf8;
  font-weight: 850;
}

.detail-shell {
  display: grid;
  gap: 16px;
}

.detail-card-focus {
  outline: 3px solid rgba(154, 185, 124, 0.5);
  outline-offset: 4px;
}

.detail-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.detail-title span {
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: #f3ebe0;
  font-size: 0.82rem;
  font-weight: 850;
}

.manual-resource-note {
  display: grid;
  gap: 6px;
  border: 1px solid #e4d6c6;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff8e9;
}

.manual-resource-note span {
  color: var(--muted);
  line-height: 1.55;
}

.completed-center-summary {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fbf6;
}

.completion-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  color: #315239;
  background: #dfead8;
  font-size: 0.8rem;
  font-weight: 950;
}

.completed-center-summary small {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.completed-center-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 1.2rem;
}

.summary-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-chip-row span {
  border-radius: 999px;
  padding: 6px 10px;
  color: #4d4437;
  background: #f2eadc;
  font-size: 0.84rem;
  font-weight: 900;
}

.completed-center-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.completed-center-summary .secondary-action {
  width: fit-content;
}

.detail-grid,
.type-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid label,
.type-input-grid label,
.detail-section {
  display: grid;
  gap: 7px;
}

.detail-grid input,
.type-input-grid input,
.detail-section input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
}

.wide-field {
  grid-column: 1 / -1;
}

.type-input-grid label {
  grid-template-columns: 1fr 76px 76px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.type-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.type-name > span {
  min-width: 0;
}

.type-help {
  position: relative;
  flex: 0 0 auto;
}

.type-help summary {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff8e9;
  font-size: 0.78rem;
  font-weight: 950;
  cursor: pointer;
  list-style: none;
}

.type-help summary::-webkit-details-marker {
  display: none;
}

.type-help p {
  position: absolute;
  left: 0;
  top: 28px;
  z-index: 4;
  width: min(280px, 70vw);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffdf8;
  box-shadow: var(--shadow);
  font-size: 0.84rem;
  line-height: 1.55;
}

.reason-grid,
.unknown-word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reason-grid label,
.unknown-word-list button,
.completion-panel button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--ink);
  background: white;
  font-size: 0.85rem;
  font-weight: 850;
}

input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  flex: 0 0 18px;
  margin: 0;
  padding: 0 !important;
  accent-color: var(--sage);
}

.detail-section label:has(> input[type="checkbox"]),
.detail-grid label:has(> input[type="checkbox"]),
.reason-grid label:has(> input[type="checkbox"]),
.writing-form label:has(> input[type="checkbox"]),
.vocab-form label:has(> input[type="checkbox"]),
.resource-form label:has(> input[type="checkbox"]),
.compact-form label:has(> input[type="checkbox"]),
.rating-grid label:has(> input[type="checkbox"]),
.card label:has(> input[type="checkbox"]):not(.mission-item):not(.tracker-item) {
  width: fit-content;
  max-width: 100%;
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 30px;
  line-height: 1.3;
  text-align: left;
}

.completion-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fbf6;
}

.completion-panel:empty {
  display: none;
}

.mission-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.mission-item .mission-actions {
  grid-column: 2;
  justify-content: flex-start;
}

.weekly-coach-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.weekly-coach-list li {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) 1fr;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.weekly-coach-list li:last-child {
  border-bottom: 0;
}

.weekly-coach-list strong {
  color: var(--ink);
}

.weekly-coach-list span {
  color: var(--muted);
  line-height: 1.45;
}

.mission-actions button,
.card-actions button,
.add-vocab-action,
.vocab-filters button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 10px;
  color: var(--ink);
  background: #fffdf8;
  font-size: 0.8rem;
  font-weight: 850;
}

.mission-actions button:disabled {
  opacity: 0.42;
}

.add-vocab-action {
  width: fit-content;
}

.vocab-form,
.resource-form,
.vocab-filters,
.resource-filters {
  display: grid;
  gap: 10px;
}

.vocab-form input,
.vocab-form select,
.resource-form input,
.resource-form select,
.resource-filters input,
.resource-filters select,
.vocab-filters input,
.vocab-filters select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
}

.vocab-form label,
.resource-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 850;
}

.resource-import-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffaf1;
}

.resource-import-panel small {
  color: var(--muted);
  line-height: 1.45;
  font-weight: 800;
}

.resource-import-panel code {
  color: var(--ink);
  font-weight: 950;
}

.vocab-action-status {
  min-height: 20px;
  color: #6d4c16;
  font-weight: 900;
}

.vocab-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions .danger-mini-action {
  border-color: #e4b5aa;
  color: #8a2d20;
  background: #fff4f1;
}

.vocab-auto-panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffaf1;
}

.vocab-auto-panel strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.vocab-auto-panel p,
.vocab-auto-panel small {
  display: block;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 800;
}

.vocab-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.vocab-suggestion-grid span {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: white;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.vocab-suggestion-grid strong {
  margin: 3px 0 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.dictionary-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 0;
}

.dictionary-links-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  margin-right: 2px;
}

.dictionary-links a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.dictionary-links a:hover {
  border-color: #d7a85d;
  color: #9a5c1c;
}

.vocab-list,
.resource-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.resource-skill-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdf8;
}

.compact-resource-group {
  background: #fffaf1;
}

.compact-resource-group .resource-topic-group {
  border-top: 0;
  padding-top: 0;
}

.resource-group-head,
.resource-topic-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resource-group-head strong {
  font-size: 1rem;
}

.resource-group-head span,
.resource-topic-group summary span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.resource-topic-group {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.resource-topic-group summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--ink);
}

.resource-topic-list {
  display: grid;
  grid-template-columns: minmax(min(100%, 520px), 1fr);
  gap: 10px;
  margin-top: 10px;
}

.vocab-card,
.resource-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(156px, auto);
  gap: 12px;
  align-items: start;
  width: 100%;
  min-width: min(100%, 520px);
  max-width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.resource-card > div:first-child,
.vocab-card > div:first-child {
  min-width: 0;
}

.resource-card strong,
.resource-card span,
.resource-card small,
.resource-card p {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.resource-card .card-actions {
  max-width: 230px;
  justify-content: flex-end;
}

.resource-card .card-actions button {
  white-space: nowrap;
}

.vocab-card.mastered {
  background: #f8fbf6;
}

.vocab-card span,
.resource-card span,
.vocab-card small,
.resource-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.vocab-card p,
.resource-card p {
  margin: 8px 0 0;
  color: var(--ink);
  line-height: 1.45;
}

.resource-viewer-modal {
  width: min(1180px, 96vw);
  max-width: min(1180px, 96vw);
}

.resource-viewer-body {
  min-height: 72vh;
}

.resource-preview-frame {
  width: 100%;
  min-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.pdf-frame {
  min-height: 76vh;
}

.resource-pdf-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf1;
}

.resource-pdf-toolbar button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 10px;
  color: var(--ink);
  background: white;
  font-weight: 900;
}

.resource-pdf-toolbar strong {
  min-width: 52px;
  color: var(--ink);
  text-align: center;
}

.resource-viewer-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.resource-preview-image {
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 14px;
  background: white;
}

.resource-note-preview {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.mode-card {
  min-height: 108px;
  padding: 15px;
  text-align: left;
}

.energy-card {
  min-height: 94px;
  padding: 15px;
  text-align: left;
}

.mode-card.active,
.energy-card.active {
  background: var(--active);
}

.mode-card span,
.energy-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.mini-card,
.study-card {
  padding: 14px;
}

.template-bank {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.template-card,
.question-card,
.story-row {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.template-card {
  padding: 15px;
}

.template-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.writing-hero {
  margin-bottom: 16px;
}

.writing-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.writing-summary-card {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.writing-summary-card strong {
  color: var(--ink);
  font-size: 1.45rem;
}

.writing-summary-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.writing-core-grid {
  display: grid;
  gap: 14px;
}

.writing-core-card summary {
  cursor: pointer;
}

.writing-core-card summary span {
  min-width: 34px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #ead8ba;
  border-radius: 999px;
  padding: 3px 9px;
  color: #8f6d3c;
  background: #fff8ea;
  font-size: 0.78rem;
  font-weight: 900;
}

.compact-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 14px;
}

.compact-form textarea,
.compact-form button,
.compact-form label {
  grid-column: span 2;
}

.writing-filter-row {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 260px);
  gap: 10px;
  margin-top: 14px;
}

.writing-filter-row input,
.writing-filter-row select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.writing-selectors,
.writing-form {
  display: grid;
  gap: 10px;
}

.writing-selectors {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.writing-form {
  margin-bottom: 14px;
}

.writing-selectors select,
.writing-form input,
.writing-form select,
.writing-form textarea {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  font: inherit;
  font-weight: 750;
}

.writing-form textarea {
  padding: 10px 12px;
  resize: vertical;
}

.writing-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 850;
}

.writing-type-map,
.writing-list,
.mastery-grid {
  display: grid;
  gap: 10px;
}

.writing-type-chip {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.writing-type-chip.active,
.rating-row button.active {
  border-color: #d7a85d;
  background: #fff4dc;
  color: #8f561c;
}

.mastery-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--muted);
  font-weight: 900;
}

.rating-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.rating-row button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 900;
}

.writing-item,
.assistant-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.writing-item.favorite {
  background: #fffaf1;
}

.writing-item.fixed {
  opacity: 0.72;
}

.writing-item strong,
.assistant-section strong {
  display: block;
  color: var(--ink);
  line-height: 1.35;
}

.writing-item p,
.assistant-section p {
  margin: 8px 0 0;
  color: var(--ink);
  line-height: 1.45;
}

.writing-item small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.writing-item button {
  min-height: 30px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 10px;
  color: var(--ink);
  background: #fffdf8;
  font-size: 0.8rem;
  font-weight: 850;
}

.assistant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.engine-current-inputs,
.engine-ranking,
.engine-history,
.engine-rules {
  display: grid;
  gap: 10px;
}

.engine-current-inputs article,
.engine-ranking article,
.engine-history article,
.engine-rules p {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
}

.engine-current-inputs article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.engine-current-inputs span,
.engine-ranking span,
.engine-history span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.engine-history p,
.engine-rules p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.vocab-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.vocab-dashboard-grid article,
.topic-stat-card,
.vocab-mini-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
}

.topic-stat-card summary {
  display: grid;
  gap: 5px;
  cursor: pointer;
}

.vocab-dashboard-grid strong {
  display: block;
  color: #2d3c63;
  font-size: 1.35rem;
}

.vocab-dashboard-grid span,
.topic-stat-card span,
.topic-stat-card small,
.vocab-mini-card span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.vocab-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: 10px;
}

.vocab-dashboard-summary {
  display: grid;
  gap: 8px;
}

.vocab-dashboard-summary span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 850;
}

.study-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.study-stats-grid article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fffdf8;
}

.study-stats-grid span,
.study-stats-grid small {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.vocab-review-sections,
.topic-grid,
.vocab-mini-list {
  display: grid;
  gap: 10px;
}

.review-bucket {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
  overflow: hidden;
}

.review-bucket summary {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
}

.vocab-mini-list {
  padding: 0 12px 12px;
}

.seen-in {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.seen-in summary {
  cursor: pointer;
  font-weight: 850;
}

.seen-in p {
  margin: 8px 0 0;
}

.category-word-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  margin-top: 12px;
  padding-right: 4px;
}

.category-word-list article {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  background: #f7f0e6;
}

.category-word-list strong {
  color: #2d3c63;
}

.category-word-list span,
.category-word-list small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.speaking-hero {
  align-items: stretch;
}

.speaking-stats {
  min-width: 280px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.speaking-stats div {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 98px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.speaking-stats strong {
  color: #2d3c63;
  font-size: 2rem;
  line-height: 1;
}

.speaking-stats span {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 850;
}

.practice-question {
  min-height: 176px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf2;
  margin-bottom: 14px;
}

.practice-question > span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  margin-bottom: 8px;
}

.practice-question strong {
  display: block;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.4;
}

.practice-question p {
  margin: 10px 0 0;
  color: #6d4c16;
  line-height: 1.45;
}

.speaking-recorder {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdf8;
}

.speaking-recorder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.speaking-recorder-head div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.speaking-recorder-head strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.speaking-recorder-head span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  font-weight: 800;
}

#speakingRecordingDuration {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  color: #6d4c16;
  background: #f7ead8;
  font-size: 0.82rem;
  font-weight: 900;
}

.speaking-recorder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.speaking-recorder audio {
  width: 100%;
}

.speaking-recorder textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  background: white;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 14px;
}

.filter-chip,
.filter-bar select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink);
  background: white;
  font-weight: 850;
}

.filter-chip.active {
  background: var(--active);
}

.question-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
}

.question-card strong {
  display: block;
  line-height: 1.4;
}

.question-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row small {
  border-radius: 999px;
  padding: 5px 8px;
  color: #49556b;
  background: #f1eadf;
  font-size: 0.74rem;
  font-weight: 850;
}

.story-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  flex-wrap: wrap;
  cursor: grab;
}

.story-row span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 850;
}

.story-row small,
.follow-up-line,
.mock-test-panel p {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.mini-chip.danger {
  color: #8f2f24;
  border-color: #f0c8be;
  background: #fff4f0;
}

.story-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.story-editor-grid label {
  display: grid;
  gap: 6px;
}

.story-editor-grid .wide-field {
  grid-column: 1 / -1;
}

.story-editor-grid textarea,
.story-editor-grid input,
.story-editor-grid select {
  width: 100%;
}

@media (max-width: 760px) {
  .story-editor-grid {
    grid-template-columns: 1fr;
  }
}

.coverage-panel,
.recommended-stories,
.story-compare,
.story-heatmap,
.mock-test-panel {
  display: grid;
  gap: 10px;
}

.coverage-number {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fffdf8;
}

.coverage-number strong {
  color: #2d3c63;
  font-size: 1.45rem;
}

.coverage-number span,
.uncovered-list span,
.recommendation-row span,
.compare-card span,
.heatmap-row span,
.mock-section span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.uncovered-list {
  display: grid;
  gap: 7px;
  max-height: 180px;
  overflow: auto;
}

.uncovered-list span,
.compare-card,
.recommendation-row,
.heatmap-row,
.mock-section {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
}

.recommendation-row,
.heatmap-row {
  display: grid;
  gap: 10px;
}

.story-compare.hidden {
  display: none;
}

.compare-card,
.mock-section {
  display: grid;
  gap: 6px;
}

.expression-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-chip {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  color: #39445a;
  background: #f2eadc;
  font-size: 0.75rem;
  font-weight: 850;
  cursor: pointer;
}

.mini-chip.mastered {
  color: #2e6047;
  background: #dfeee2;
}

.speaking-feedback-form {
  display: grid;
  gap: 10px;
}

.speaking-feedback-form select,
.speaking-feedback-form textarea {
  width: 100%;
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rating-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.mock-section span {
  display: block;
}

.mock-section small {
  display: inline-block;
  margin-left: 6px;
  color: #a87349;
}

.word-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.word-cloud span {
  border-radius: 999px;
  padding: 8px 11px;
  color: #39445a;
  background: #f2eadc;
  font-size: 0.9rem;
  font-weight: 750;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  color: var(--ink);
  background: white;
  line-height: 1.55;
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.engine-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.setup-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.setup-mode-switch button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--muted);
  background: white;
  font-weight: 850;
}

.setup-mode-switch button.active {
  color: white;
  background: var(--navy);
  border-color: var(--navy);
}

.capacity-builder {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf4;
}

.capacity-builder[hidden] {
  display: none;
}

.setup-card [hidden] {
  display: none !important;
}

.capacity-builder summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
}

.capacity-builder summary span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.capacity-builder .engine-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 16px 16px;
}

.capacity-estimate {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.capacity-estimate article {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: white;
}

.capacity-estimate strong {
  display: block;
  margin-bottom: 6px;
}

.today-lock-summary {
  display: grid;
  gap: 6px;
  border-radius: 16px;
  color: var(--ink);
}

.today-lock-summary:not(:empty) {
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: #f3ebe0;
}

.today-lock-summary span,
.today-lock-summary small {
  color: var(--muted);
  font-weight: 750;
}

.quick-replan-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.quick-replan-row small {
  color: var(--muted);
  font-weight: 750;
}

.quick-replan-modal {
  width: min(560px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(41, 35, 29, 0.28);
}

.quick-replan-modal::backdrop {
  background: rgba(20, 16, 12, 0.42);
}

.quick-replan-modal form,
.quick-replan-fields {
  display: grid;
  gap: 14px;
}

.quick-replan-plan {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: white;
}

.quick-replan-plan p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.quick-replan-plan p::before {
  content: "• ";
}

.quick-replan-modal label {
  display: grid;
  gap: 8px;
}

.quick-replan-modal label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.quick-replan-workflow-modal {
  width: min(720px, calc(100vw - 28px));
  max-height: min(86vh, 860px);
  overflow: auto;
  padding: 26px;
  background: #fffdf8;
}

.quick-replan-workflow-modal::backdrop {
  background: rgba(20, 16, 12, 0.58);
  backdrop-filter: blur(2px);
}

.quick-replan-workflow-modal .card-head {
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.quick-replan-workflow-modal .card-head > div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.quick-replan-workflow-modal .card-head strong {
  font-size: 1.22rem;
  line-height: 1.2;
}

.quick-replan-workflow-modal .card-head span {
  display: block;
  width: fit-content;
  max-width: 100%;
  border-radius: 10px;
  padding: 6px 10px;
  color: #6d6861;
  background: #f8efe3;
  font-size: 0.86rem;
  line-height: 1.35;
  white-space: normal;
}

.quick-replan-workflow-modal label {
  display: grid;
  gap: 8px;
}

.quick-replan-workflow-modal select,
.quick-replan-workflow-modal input {
  min-height: 46px;
  background: white;
}

.quick-replan-workflow-modal .quick-replan-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fffaf1;
}

.quick-replan-workflow-modal .quick-replan-fields:empty {
  display: none;
}

.quick-replan-workflow-modal .quick-replan-fields .muted {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: white;
}

.quick-replan-workflow-modal .capacity-estimate {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
}

.quick-replan-workflow-modal .capacity-estimate article {
  min-height: 78px;
  background: white;
}

.quick-replan-workflow-modal .quick-replan-plan {
  background: white;
}

.teacher-debrief-modal {
  width: min(780px, calc(100vw - 28px));
  max-height: min(86vh, 900px);
  overflow: auto;
  padding: 26px;
  background: #fffdf8;
}

.teacher-debrief-modal::backdrop {
  background: rgba(20, 16, 12, 0.58);
  backdrop-filter: blur(2px);
}

.teacher-debrief-modal .card-head {
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.teacher-debrief-modal .card-head > div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.teacher-debrief-modal .card-head strong {
  font-size: 1.22rem;
  line-height: 1.2;
}

.teacher-debrief-modal .card-head span {
  display: block;
  width: fit-content;
  max-width: 100%;
  border-radius: 10px;
  padding: 6px 10px;
  color: #6d6861;
  background: #f8efe3;
  font-size: 0.86rem;
  line-height: 1.35;
  white-space: normal;
}

.teacher-debrief-modal .summary-check-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.teacher-debrief-modal .summary-check-grid label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 64px;
  padding: 14px 16px;
  border-radius: 14px;
  background: white;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.teacher-debrief-modal .summary-check-grid input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
}

.teacher-debrief-modal .homework-section {
  background: #fffaf1;
}

.teacher-debrief-modal textarea {
  min-height: 150px;
  background: white;
}

@media (max-width: 720px) {
  .quick-replan-workflow-modal .quick-replan-fields,
  .quick-replan-workflow-modal .capacity-estimate {
    grid-template-columns: 1fr;
  }
}

.engine-form label,
.confidence-control {
  display: grid;
  gap: 8px;
}

.engine-form span,
.confidence-control > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.engine-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.engine-output {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.engine-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.engine-preview article,
.change-log p {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fffdf8;
}

.engine-preview span,
.change-log p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.confidence-control div {
  display: flex;
  gap: 6px;
}

.confidence-control button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: white;
  font-weight: 900;
}

.confidence-control button.active {
  border-color: #9ab97c;
  background: #eef6e8;
}

.change-log {
  display: grid;
  gap: 8px;
}

.import-label {
  display: inline-flex;
  align-items: center;
}

.import-label input {
  display: none;
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(232, 167, 184, 0.35);
  outline-offset: 2px;
}

@media (max-width: 1160px) {
  .today-execution-grid {
    grid-template-columns: 1fr;
  }

  .resources-layout {
    grid-template-columns: 1fr;
  }

  #resources {
    width: 100%;
    max-width: none;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tabbar {
    display: flex;
    overflow-x: auto;
  }

  .tabbar button {
    width: auto;
    flex: 0 0 auto;
  }

  .version-pill {
    display: none;
  }

  .content {
    padding: 18px;
  }

  .hero-card,
  .goal-hero,
  .grid.two {
    grid-template-columns: 1fr;
  }

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

  .writing-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .compact-form,
  .engine-form,
  .capacity-builder .engine-form,
  .capacity-estimate,
  .study-stats-grid,
  .writing-filter-row {
    grid-template-columns: 1fr;
  }

  .compact-form textarea,
  .compact-form button,
  .compact-form label {
    grid-column: span 1;
  }

  .speaking-stats {
    min-width: 0;
  }

  .question-card {
    grid-template-columns: 1fr;
  }

  .setup-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .countdown-grid {
    width: min(100%, 320px);
  }
}

@media (max-width: 620px) {
  .sidebar {
    padding: 14px 12px 8px;
  }

  .brand {
    grid-template-columns: 32px 1fr;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 12px;
  }

  .tabbar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 5;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 253, 248, 0.94);
    box-shadow: var(--shadow);
  }

  .tabbar button {
    min-height: 40px;
    padding: 0 12px;
  }

  .writing-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content {
    padding: 14px 10px 100px;
  }

  .topbar {
    margin-bottom: 16px;
  }

  .topbar h2 {
    font-size: 2rem;
  }

  .hero-card,
  .card {
    border-radius: 22px;
    padding: 16px;
  }

  .hero-card h3 {
    font-size: 1.45rem;
  }

  .score-grid,
  .mode-grid,
  .energy-grid,
  .resource-grid,
  .reading-fields,
  .engine-form,
  .engine-preview,
  .center-unit-grid,
  .detail-grid,
  .type-input-grid {
    grid-template-columns: 1fr;
  }

  .type-input-grid label {
    grid-template-columns: 1fr;
  }

  .mission-item {
    grid-template-columns: 28px 1fr;
  }

  .vocab-card,
  .resource-card {
    grid-template-columns: 1fr;
  }

  .resource-card .card-actions {
    max-width: none;
    justify-content: flex-start;
  }

  .mission-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .card-actions {
    justify-content: flex-start;
  }
}
