:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef5f1;
  --ink: #1b2623;
  --muted: #63716c;
  --line: #dce4df;
  --brand: #126b5a;
  --brand-2: #184f8a;
  --accent: #d95d39;
  --gold: #c89b2c;
  --danger: #b73b46;
  --ok: #238359;
  --shadow: 0 16px 45px rgba(32, 46, 41, 0.12);
  --radius: 8px;
  --sidebar: 260px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(18, 107, 90, 0.07), rgba(217, 93, 57, 0.05) 48%, rgba(24, 79, 138, 0.07)),
    var(--bg);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

noscript {
  display: block;
  padding: 24px;
  text-align: center;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(320px, 0.9fr) minmax(380px, 1.1fr);
}

.auth-visual {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 42px;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(12, 66, 58, 0.94), rgba(18, 107, 90, 0.86)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900' viewBox='0 0 900 900'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.22'%3E%3Cpath d='M82 164h268M82 224h392M82 284h214M82 344h330M82 404h250'/%3E%3Cpath d='M560 142c72 18 124 82 124 158 0 91-74 165-165 165-84 0-153-63-164-143'/%3E%3Cpath d='M500 192h170M500 248h142M500 304h112M164 590h572M164 648h420M164 706h510'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.12'%3E%3Crect x='96' y='520' width='172' height='236' rx='18'/%3E%3Crect x='314' y='498' width='172' height='258' rx='18'/%3E%3Crect x='532' y='540' width='172' height='216' rx='18'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.brand-lockup,
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.brand-mark.dark {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--brand);
}

.auth-copy {
  max-width: 520px;
}

.auth-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 8vw, 86px);
  line-height: 0.95;
  letter-spacing: 0;
}

.auth-copy p {
  max-width: 440px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.65;
}

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

.auth-metric {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.auth-metric strong {
  display: block;
  font-size: 22px;
}

.auth-metric span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.auth-panel-wrap {
  display: grid;
  min-height: 100vh;
  align-items: center;
  padding: 42px;
}

.auth-panel {
  width: min(100%, 470px);
  margin: 0 auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-panel h2,
.view-head h1,
.section-title,
.card h3 {
  margin: 0;
  letter-spacing: 0;
}

.auth-panel h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.muted {
  color: var(--muted);
}

.tabs,
.segmented,
.pay-methods {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.tabs {
  margin: 24px 0;
}

.tab-button,
.segment-button,
.pay-button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab-button.active,
.segment-button.active,
.pay-button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(24, 38, 35, 0.08);
}

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

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

.field label {
  color: #3c4945;
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: 0;
  padding: 10px 12px;
}

.field textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(18, 107, 90, 0.13);
}

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

.primary,
.secondary,
.ghost,
.danger {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-weight: 800;
  text-decoration: none;
}

.primary {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.secondary {
  border: 1px solid rgba(24, 79, 138, 0.2);
  background: #e9f0f8;
  color: var(--brand-2);
}

.ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.danger {
  border: 1px solid rgba(183, 59, 70, 0.3);
  background: #fff0f1;
  color: var(--danger);
}

.social-login-list {
  display: grid;
  gap: 12px;
  margin: 24px 0 14px;
}

.social-button {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-weight: 900;
}

.social-button.kakao {
  border: 1px solid #f2d200;
  background: #fee500;
  color: #181600;
}

.social-button.google {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #1f2a27;
}

.social-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: inherit;
  font-size: 14px;
  font-weight: 950;
}

.auth-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.message {
  display: none;
  padding: 12px;
  border-radius: var(--radius);
  background: #e9f6ef;
  color: var(--ok);
  font-size: 14px;
  font-weight: 700;
}

.message.show {
  display: block;
}

.message.error {
  background: #fff0f1;
  color: var(--danger);
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  padding: 22px;
}

.sidebar .brand-lockup,
.sidebar .auth-brand {
  color: var(--ink);
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-button {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  text-align: left;
  font-weight: 800;
}

.nav-button span {
  color: #98a49f;
  font-size: 12px;
  font-weight: 800;
}

.nav-button.active,
.nav-button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.user-chip {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.user-chip strong {
  font-size: 15px;
}

.user-chip small {
  color: var(--muted);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 244, 0.88);
  padding: 16px 28px;
  backdrop-filter: blur(12px);
}

.topbar-title {
  display: grid;
  gap: 2px;
}

.topbar-title strong {
  font-size: 17px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-pill {
  min-width: 44px;
}

.content {
  width: min(100%, 1260px);
  margin: 0 auto;
  padding: 28px;
}

.view {
  display: grid;
  gap: 22px;
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.view-head h1 {
  font-size: clamp(28px, 4vw, 42px);
}

.view-head p {
  max-width: 660px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

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

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

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

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

.card,
.panel,
.quiz-box,
.book-card,
.cart-panel,
.score-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(32, 46, 41, 0.07);
}

.card,
.panel,
.quiz-box,
.cart-panel,
.score-table-wrap {
  padding: 18px;
}

.metric-card {
  display: grid;
  min-height: 120px;
  align-content: space-between;
  gap: 14px;
}

.metric-card strong {
  font-size: clamp(28px, 4vw, 42px);
}

.metric-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.metric-card.word {
  border-top: 4px solid var(--brand);
}

.metric-card.sentence {
  border-top: 4px solid var(--accent);
}

.metric-card.problem {
  border-top: 4px solid var(--brand-2);
}

.metric-card.shop {
  border-top: 4px solid var(--gold);
}

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

.quick-action {
  display: grid;
  min-height: 116px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  text-align: left;
}

.quick-action strong {
  font-size: 17px;
}

.quick-action span {
  color: var(--muted);
  font-size: 13px;
}

.section-title {
  font-size: 20px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.setup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pill,
.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
}

.pill {
  background: var(--surface-2);
  color: var(--brand);
}

.status-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.status-pill.ok {
  border-color: rgba(35, 131, 89, 0.25);
  background: #e9f6ef;
  color: var(--ok);
}

.status-pill.warn {
  border-color: rgba(200, 155, 44, 0.28);
  background: #fff7dc;
  color: #8a6512;
}

.quiz-word {
  margin: 4px 0 6px;
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 900;
  letter-spacing: 0;
}

.quiz-example {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.choice-button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  text-align: left;
  font-weight: 800;
}

.choice-button:hover {
  border-color: var(--brand);
}

.choice-button.correct {
  border-color: rgba(35, 131, 89, 0.4);
  background: #e9f6ef;
  color: var(--ok);
}

.choice-button.wrong {
  border-color: rgba(183, 59, 70, 0.34);
  background: #fff0f1;
  color: var(--danger);
}

.result-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}

.history-item:last-child {
  border-bottom: 0;
}

.history-item strong {
  display: block;
}

.history-item span {
  color: var(--muted);
  font-size: 13px;
}

.sentence-text,
.passage {
  border-left: 4px solid var(--brand);
  background: var(--surface-2);
  padding: 16px;
  color: #293632;
  line-height: 1.8;
}

.sentence-text {
  font-size: 20px;
  font-weight: 750;
}

.passage {
  white-space: pre-line;
}

.answer-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  padding: 16px;
}

.answer-panel h4 {
  margin: 0 0 8px;
}

.self-score {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

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

.type-button {
  display: grid;
  gap: 5px;
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  text-align: left;
}

.type-button.active,
.type-button:hover {
  border-color: rgba(24, 79, 138, 0.34);
  background: #e9f0f8;
}

.type-button strong {
  font-size: 15px;
}

.type-button span {
  color: var(--muted);
  font-size: 12px;
}

.progress-bar {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
}

.progress-fill {
  width: var(--value, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.chart-list {
  display: grid;
  gap: 14px;
}

.chart-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 54px;
  gap: 10px;
  align-items: center;
}

.chart-row strong {
  font-size: 14px;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.score-table th,
.score-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.score-table th {
  color: var(--muted);
  font-size: 13px;
}

.score-table tr:last-child td {
  border-bottom: 0;
}

.book-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.book-card {
  overflow: hidden;
}

.book-cover,
.book-cover-img {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 5;
  place-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  text-align: center;
}

.book-cover-img {
  object-fit: cover;
}

.book-cover {
  padding: 22px;
}

.book-cover strong {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.18;
}

.book-cover span {
  display: inline-block;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.cover-0 {
  background:
    linear-gradient(145deg, rgba(18, 107, 90, 0.92), rgba(24, 79, 138, 0.86)),
    radial-gradient(circle at 26% 22%, rgba(255, 255, 255, 0.34), transparent 28%);
}

.cover-1 {
  background:
    linear-gradient(145deg, rgba(217, 93, 57, 0.92), rgba(18, 107, 90, 0.82)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0 2px, transparent 2px 18px);
}

.cover-2 {
  background:
    linear-gradient(145deg, rgba(24, 79, 138, 0.92), rgba(200, 155, 44, 0.82)),
    linear-gradient(0deg, rgba(255, 255, 255, 0.18), transparent 44%);
}

.book-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.book-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.book-title-row h3 {
  font-size: 18px;
}

.book-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.book-price strong {
  font-size: 22px;
}

.book-price del {
  color: #96a19d;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  border-radius: 999px;
  background: var(--surface-2);
  color: #52605b;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.cart-panel {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 14px;
}

.cart-items {
  display: grid;
  gap: 10px;
}

.cart-item {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.cart-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.cart-item-top,
.cart-total,
.checkout-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-weight: 900;
}

.cart-total,
.checkout-total {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 18px;
  font-weight: 900;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

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

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.summary-row:last-child {
  border-bottom: 0;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px dashed #cbd6d0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 22px;
  bottom: 22px;
  display: none;
  max-width: min(420px, calc(100vw - 44px));
  border: 1px solid rgba(18, 107, 90, 0.24);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--ink);
  padding: 14px 16px;
  font-weight: 800;
}

.toast.show {
  display: block;
}

@media (max-width: 1120px) {
  .grid.cols-4,
  .quick-actions,
  .type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-layout,
  .checkout-layout,
  .split {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
  }
}

@media (max-width: 880px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 430px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

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

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

  .topbar {
    position: static;
  }

  .grid.cols-2,
  .grid.cols-3,
  .book-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .auth-panel-wrap,
  .auth-visual,
  .content,
  .topbar,
  .sidebar {
    padding: 18px;
  }

  .auth-metrics,
  .field-row,
  .choice-grid,
  .self-score,
  .nav,
  .grid.cols-4,
  .quick-actions,
  .type-grid {
    grid-template-columns: 1fr;
  }

  .view-head,
  .topbar,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .score-table-wrap {
    overflow-x: auto;
  }
}

/* Project INTER refresh */
:root {
  --bg: #f2f0ed;
  --surface: #ffffff;
  --surface-2: #f4efe9;
  --ink: #10100f;
  --muted: #756f68;
  --line: #ddd6ce;
  --brand: #ff8238;
  --brand-2: #0f0f10;
  --accent: #c58ac4;
  --gold: #d6a947;
  --shadow: 0 22px 55px rgba(24, 19, 16, 0.13);
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(242, 240, 237, 0.95)),
    var(--bg);
}

.sidebar {
  background: rgba(17, 16, 15, 0.94);
  border-right: 0;
  color: #ffffff;
}

.sidebar .auth-brand {
  color: #ffffff;
}

.brand-mark.dark {
  border-color: rgba(255, 255, 255, 0.18);
  background: #ff8238;
  color: #11100f;
}

.nav-button {
  color: rgba(255, 255, 255, 0.64);
}

.nav-button span {
  color: rgba(255, 255, 255, 0.34);
}

.nav-button.active,
.nav-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-bottom {
  border-top-color: rgba(255, 255, 255, 0.13);
}

.user-chip small {
  color: rgba(255, 255, 255, 0.6);
}

.topbar {
  flex-wrap: wrap;
  border-bottom-color: rgba(17, 16, 15, 0.12);
  background: #fffaf4;
  box-shadow: 0 10px 28px rgba(24, 19, 16, 0.08);
  color: #11100f;
}

.topbar-title {
  min-width: 0;
}

.topbar-title strong,
.topbar-title .muted {
  color: #11100f;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.storage-badge {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid rgba(17, 16, 15, 0.13);
  border-radius: 8px;
  background: #11100f;
  color: #ffffff;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.top-actions .ghost {
  background: #ffffff;
  color: #11100f;
}

.top-actions .primary {
  color: #11100f;
}

.primary {
  border-color: #ff8238;
  background: #ff8238;
  color: #11100f;
}

.secondary {
  border-color: #11100f;
  background: #11100f;
  color: #ffffff;
}

.ghost {
  border-color: rgba(17, 16, 15, 0.14);
  background: rgba(255, 255, 255, 0.74);
  color: #11100f;
}

.card,
.panel,
.quiz-box,
.score-table-wrap {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 42px rgba(24, 19, 16, 0.09);
}

.brand-hero {
  position: relative;
  display: grid;
  min-height: 520px;
  align-items: end;
  overflow: hidden;
  border-radius: 8px;
  background: #050505;
  box-shadow: var(--shadow);
}

.brand-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.78));
}

.brand-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
  padding: clamp(24px, 5vw, 54px);
  color: #ffffff;
}

.brand-hero-copy .eyebrow {
  color: #ffb077;
}

.brand-hero-copy h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.96;
}

.brand-hero-copy p {
  max-width: 600px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.home-rich-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
}

.home-info-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 220px;
  border: 1px solid rgba(17, 16, 15, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 18px 42px rgba(24, 19, 16, 0.08);
}

.home-info-panel.dark {
  border-color: rgba(255, 255, 255, 0.12);
  background: #11100f;
  color: #ffffff;
}

.home-info-panel.dark p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.74);
}

.home-info-panel h2,
.home-info-panel p {
  margin: 0;
}

.home-info-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.7;
}

.source-board {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 20px;
  align-items: center;
  border: 1px solid rgba(17, 16, 15, 0.1);
  border-radius: 8px;
  background: #ffffff;
  padding: clamp(18px, 3vw, 30px);
  box-shadow: 0 18px 42px rgba(24, 19, 16, 0.08);
}

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

.source-count-grid article {
  display: grid;
  gap: 4px;
  min-height: 96px;
  align-content: center;
  border-radius: 8px;
  background: #f4efe9;
  padding: 14px;
  text-align: center;
}

.source-count-grid strong {
  color: #ff8238;
  font-size: 34px;
  line-height: 1;
}

.source-count-grid span {
  color: #11100f;
  font-size: 13px;
  font-weight: 900;
}

.local-save-note {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255, 130, 56, 0.3);
  border-radius: 8px;
  background: #fff7ef;
  padding: 16px 18px;
}

.local-save-note strong {
  flex: 0 0 auto;
  color: #11100f;
}

.local-save-note span {
  color: var(--muted);
  line-height: 1.6;
}

.shop-view {
  gap: 28px;
}

.shop-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 28px;
  align-items: center;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 130, 56, 0.16), rgba(197, 138, 196, 0.18)),
    #11100f;
  color: #ffffff;
  padding: clamp(22px, 4vw, 48px);
  box-shadow: var(--shadow);
}

.shop-hero-copy h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 0.98;
}

.shop-subtitle {
  margin: 12px 0 0;
  color: #ffb077 !important;
  font-weight: 900;
}

.shop-hero-copy p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
  line-height: 1.75;
}

.shop-cover-frame {
  justify-self: center;
  width: min(100%, 360px);
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
}

.shop-cover-frame img {
  display: block;
  width: 100%;
  border-radius: 6px;
}

.hero-price strong {
  color: #ffffff;
  font-size: clamp(32px, 5vw, 52px);
}

.purchase-strip,
.lecture-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: 8px;
  padding: clamp(18px, 3vw, 30px);
  box-shadow: 0 16px 40px rgba(24, 19, 16, 0.08);
}

.purchase-strip {
  border: 1px solid rgba(255, 130, 56, 0.26);
  background: #fff7ef;
}

.lecture-band {
  border: 1px solid rgba(17, 16, 15, 0.12);
  background: #11100f;
  color: #ffffff;
}

.lecture-band .eyebrow {
  color: #ffb077;
}

.lecture-band h2,
.lecture-band p {
  margin: 0;
}

.lecture-band p {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
}

.book-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.book-feature {
  display: grid;
  min-height: 126px;
  align-content: space-between;
  border: 1px solid rgba(17, 16, 15, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 18px;
}

.book-feature span {
  color: #ff8238;
  font-size: 13px;
  font-weight: 900;
}

.book-feature strong {
  font-size: 20px;
  line-height: 1.35;
}

.book-detail-copy {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.book-copy-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid rgba(17, 16, 15, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: clamp(18px, 3vw, 26px);
  box-shadow: 0 18px 42px rgba(24, 19, 16, 0.08);
}

.book-copy-panel.wide {
  grid-column: 1 / -1;
}

.book-copy-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

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

.clean-list li {
  position: relative;
  border-radius: 8px;
  background: #f4efe9;
  padding: 12px 12px 12px 32px;
  color: #11100f;
  font-weight: 800;
  line-height: 1.55;
}

.clean-list li::before {
  position: absolute;
  top: 17px;
  left: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff8238;
  content: "";
}

.clean-list.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.book-detail-gallery {
  display: grid;
  gap: 18px;
}

.detail-image-stack {
  display: grid;
  gap: 18px;
}

.detail-image-card {
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #11100f;
  box-shadow: var(--shadow);
}

.detail-image-card img {
  display: block;
  width: 100%;
}

@media (max-width: 1120px) {
  .shop-hero {
    grid-template-columns: 1fr;
  }

  .home-rich-grid,
  .source-board,
  .book-feature-grid,
  .book-detail-copy {
    grid-template-columns: 1fr;
  }

  .clean-list.compact,
  .source-count-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .brand-hero {
    min-height: 430px;
  }

  .brand-hero-copy h1,
  .shop-hero-copy h1 {
    font-size: 40px;
  }

  .purchase-strip,
  .lecture-band,
  .local-save-note,
  .topbar,
  .top-actions,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions > *,
  .hero-actions > * {
    width: 100%;
  }

  .source-count-grid,
  .clean-list.compact {
    grid-template-columns: 1fr;
  }
}

/* Editorial award-board redesign */
:root {
  --award-cream: #f2f0ea;
  --award-paper: #fbfaf6;
  --award-black: #181818;
  --award-ink: #202020;
  --award-muted: #74716a;
  --award-teal: #082525;
  --award-teal-2: #0f3c3d;
  --award-mint: #77d2c1;
  --award-orange: #f07954;
  --award-yellow: #ead67a;
  --award-blue: #58b9ca;
}

body {
  background: var(--award-cream);
  color: var(--award-ink);
}

.app-shell {
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  background: var(--award-black);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.sidebar .brand-lockup {
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding-bottom: 18px;
}

.brand-mark.dark {
  border: 0;
  background: #ffffff;
  color: #111111;
}

.nav {
  gap: 10px;
}

.nav-button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.94);
  font-size: 15px;
}

.nav-button span {
  min-width: 58px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.82);
  padding: 4px 8px;
  text-align: center;
}

.nav-button.active,
.nav-button:hover {
  border-color: var(--award-mint);
  background: var(--award-mint);
  color: #081615;
}

.nav-button.active span,
.nav-button:hover span {
  background: #081615;
  color: #ffffff;
}

.sidebar-bottom {
  border-top-color: rgba(255, 255, 255, 0.14);
}

.user-chip strong {
  color: #ffffff;
}

.user-chip small {
  color: rgba(255, 255, 255, 0.72);
}

.sidebar-bottom .ghost {
  width: 100%;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.topbar {
  min-height: 70px;
  border-bottom: 1px solid #dedbd2;
  background: var(--award-paper);
  box-shadow: none;
}

.topbar-title strong {
  font-size: 22px;
  letter-spacing: 0;
}

.storage-badge {
  background: var(--award-black);
  color: #ffffff;
}

.content {
  width: 100%;
  max-width: 1500px;
}

.brand-hero {
  position: relative;
  grid-template-columns: 1fr;
  min-height: auto;
  align-items: center;
  border-radius: 0;
  background:
    radial-gradient(circle at 72% 22%, rgba(119, 210, 193, 0.22), transparent 30%),
    radial-gradient(circle at 15% 82%, rgba(240, 121, 84, 0.16), transparent 28%),
    linear-gradient(135deg, rgba(8, 37, 37, 0.99), rgba(3, 19, 19, 0.98));
}

.brand-hero img {
  display: none;
}

.brand-hero::after {
  display: none;
}

.brand-hero-copy {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  align-content: center;
  max-width: none;
  min-height: 560px;
  padding: clamp(28px, 5vw, 76px);
  background: transparent;
}

.brand-hero-copy h1 {
  max-width: 760px;
  font-size: clamp(46px, 6vw, 96px);
  line-height: 0.95;
}

.brand-hero-copy p {
  max-width: 690px;
}

.hero-score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 30px;
}

.score-ring {
  --ring-color: var(--award-mint);
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #0b2222 58%, transparent 60%),
    conic-gradient(var(--ring-color) calc(var(--score) * 1%), rgba(255, 255, 255, 0.22) 0);
  color: #ffffff;
}

.score-ring.word {
  --ring-color: var(--award-orange);
}

.score-ring.sentence {
  --ring-color: var(--award-yellow);
}

.score-ring.problem {
  --ring-color: var(--award-blue);
}

.score-ring strong {
  align-self: end;
  font-size: 30px;
  line-height: 1;
}

.score-ring strong::after {
  content: "%";
  font-size: 13px;
}

.score-ring.total strong::after {
  content: "";
}

.score-ring span {
  align-self: start;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.view-head,
.home-info-panel,
.panel,
.quiz-box,
.score-table-wrap,
.book-copy-panel {
  border-radius: 0;
  background: var(--award-paper);
  box-shadow: none;
}

.view-head {
  border: 1px solid #dedbd2;
  padding: clamp(20px, 3vw, 34px);
}

.metric-card,
.quick-action,
.book-feature {
  border-radius: 0;
  box-shadow: none;
}

.quick-action {
  min-height: 150px;
  border-color: #dedbd2;
  background: var(--award-paper);
}

.quick-action:hover {
  border-color: var(--award-black);
  background: #ffffff;
}

.quiz-box {
  border: 1px solid #dedbd2;
  padding: clamp(22px, 4vw, 42px);
}

.panel {
  border: 1px solid #dedbd2;
}

.choice-button,
.type-button {
  border-radius: 0;
  border-color: #d9d5ca;
  background: #ffffff;
}

.choice-button:hover,
.type-button:hover,
.type-button.active {
  border-color: var(--award-black);
  background: #ece8dd;
}

.answer-panel {
  border-radius: 0;
  border-color: rgba(8, 37, 37, 0.22);
  background: #edf5f2;
}

.primary,
.secondary,
.ghost,
.danger {
  border-radius: 999px;
}

.shop-hero {
  grid-template-columns: minmax(360px, 0.95fr) minmax(320px, 0.75fr);
  border-radius: 0;
  background: var(--award-paper);
  color: var(--award-ink);
}

.shop-hero-copy h1 {
  color: #111111;
}

.shop-subtitle,
.shop-hero-copy .eyebrow {
  color: #111111 !important;
  letter-spacing: 0.42em;
}

.shop-hero-copy p {
  color: var(--award-muted);
}

.shop-cover-frame {
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: 0 34px 70px rgba(0, 0, 0, 0.16);
}

.shop-cover-frame img,
.detail-image-card,
.detail-image-card img {
  border-radius: 0;
}

.hero-price strong {
  color: #111111;
}

.purchase-strip,
.lecture-band {
  border-radius: 0;
  box-shadow: none;
}

.lecture-band {
  background: var(--award-black);
}

.book-feature-grid,
.book-detail-copy {
  gap: 18px;
}

.book-feature,
.book-copy-panel {
  border-color: #dedbd2;
}

.sentence-text,
.passage {
  border-radius: 0;
  background: #f5f2ea;
  color: #202020;
}

.field textarea,
.field input,
.field select {
  border-radius: 0;
}

@media (max-width: 1120px) {
  .brand-hero,
  .shop-hero {
    grid-template-columns: 1fr;
  }

  .brand-hero-copy {
    grid-column: 1;
    grid-row: 1;
    min-height: 480px;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

/* Installable mobile app layer */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  overscroll-behavior-y: contain;
}

.compact {
  min-height: 38px;
  padding: 9px 12px;
}

.app-install-card {
  position: fixed;
  z-index: 80;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: grid;
  width: min(420px, calc(100vw - 36px));
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(255, 130, 56, 0.35);
  background: rgba(16, 16, 15, 0.94);
  color: #ffffff;
  padding: 14px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.app-install-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.app-install-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.5;
}

.app-install-actions {
  display: flex;
  gap: 8px;
}

.is-standalone body {
  background: #f2f0ed;
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .app-shell {
    display: block;
  }

  .main {
    min-height: 100vh;
  }

  .sidebar {
    position: fixed;
    z-index: 70;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    height: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-right: 0;
    border-bottom: 0;
    background: rgba(16, 16, 15, 0.96);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -18px 42px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(18px);
  }

  .sidebar .brand-lockup,
  .sidebar-bottom {
    display: none;
  }

  .nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(74px, 1fr);
    grid-template-columns: none;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-button {
    min-height: 58px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.86);
    padding: 8px 6px;
    text-align: center;
    white-space: nowrap;
  }

  .nav-button span {
    color: rgba(255, 255, 255, 0.48);
    font-size: 10px;
  }

  .nav-button.active,
  .nav-button:hover {
    background: #ff8238;
    color: #10100f;
  }

  .nav-button.active span,
  .nav-button:hover span {
    color: rgba(16, 16, 15, 0.62);
  }

  .topbar {
    position: sticky;
    top: 0;
    min-height: auto;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
    background: rgba(242, 240, 237, 0.92);
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .top-actions .storage-badge {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .top-actions .primary,
  .top-actions .ghost {
    width: 100%;
    justify-content: center;
  }

  .content {
    padding: 16px;
  }

  .brand-hero-copy {
    min-height: 520px;
    padding: 28px 18px;
  }

  .brand-hero-copy h1 {
    font-size: clamp(42px, 14vw, 74px);
  }

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

  .score-ring {
    width: 118px;
    height: 118px;
    justify-self: center;
  }

  .quick-action,
  .card,
  .book-feature,
  .book-copy-panel,
  .purchase-strip,
  .lecture-band {
    min-width: 0;
  }

  .app-install-card {
    right: 12px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    grid-template-columns: 1fr;
  }

  .app-install-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
