:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --card: #f7f8fb;
  --ink: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --soft: #f1f3f4;
  --blue: #1a73e8;
  --blue-dark: #1558b0;
  --green: #188038;
  --yellow: #f9ab00;
  --red: #d93025;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  cursor: pointer;
  font-weight: 760;
  min-height: 48px;
  padding: 0 18px;
  touch-action: manipulation;
}

button:hover {
  background: var(--blue-dark);
}

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

button.secondary {
  background: #e8f0fe;
  color: var(--blue-dark);
}

button.danger {
  background: #fce8e6;
  color: var(--red);
}

button.ghost {
  min-height: 38px;
  padding: 0 14px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  letter-spacing: 0;
  line-height: 0.98;
}

h2 {
  font-size: 22px;
  letter-spacing: 0;
  line-height: 1.15;
}

h3 {
  font-size: 17px;
  letter-spacing: 0;
  line-height: 1.25;
}

.shell {
  margin: 0 auto;
  max-width: 860px;
  padding: calc(18px + env(safe-area-inset-top)) 14px calc(96px + env(safe-area-inset-bottom));
  width: 100%;
}

.app-header {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.app-logo {
  border-radius: 12px;
  flex: 0 0 auto;
  height: 42px;
  width: 42px;
}

.brand-lockup p {
  display: none;
}

.eyebrow {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.subtitle {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
  margin-top: 8px;
  max-width: 640px;
}

.status {
  align-self: start;
  background: transparent;
  border: 1px solid rgba(218, 220, 224, 0.9);
  border-radius: 999px;
  color: var(--muted);
  display: inline-block;
  font-size: 10px;
  font-weight: 750;
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
  padding: 6px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cert-link {
  align-self: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
  justify-self: start;
  padding: 9px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.tabbar {
  align-items: center;
  background: rgba(247, 248, 251, 0.92);
  border: 1px solid rgba(218, 220, 224, 0.8);
  border-radius: 999px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  box-shadow: none;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, 1fr);
  left: 14px;
  padding: 6px;
  position: fixed;
  right: 14px;
  z-index: 30;
  backdrop-filter: blur(18px);
}

.tabbar [data-tab="lab"] {
  display: none;
}

.tab {
  background: transparent;
  color: var(--muted);
  border-radius: 14px;
  min-height: 48px;
  padding: 0 10px;
  width: 100%;
}

.tab:hover,
.tab.active {
  background: #e8f0fe;
  color: var(--blue-dark);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.quiz-active {
  background: var(--card);
}

.quiz-active .shell {
  max-width: none;
  padding: calc(14px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
}

.quiz-active .app-header,
.quiz-active .tabbar,
.quiz-active .journey-switcher,
.quiz-active .home-card,
.quiz-active #activeTitle,
.quiz-active #activeSummary,
.quiz-active .metrics,
.quiz-active .actions {
  display: none;
}

.quiz-active .learn-grid {
  max-width: none;
}

.quiz-active .panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.quiz-active .quiz-area {
  min-height: auto;
}

.quiz-active .question-card {
  background: var(--card);
  border-radius: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  min-height: auto;
  padding: 8px 2px calc(14px + env(safe-area-inset-bottom));
}

.quiz-result-active .home-card {
  display: none;
}

.quiz-result-active .learn-grid {
  max-width: 760px;
}

.quiz-result-active .focus-panel {
  padding: 0;
}

.quiz-result-active .quiz-area {
  margin-top: 0;
}

.learn-grid,
.notes-grid,
.quiz-history-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  margin: 0 auto;
  min-width: 0;
}

.learn-grid {
  max-width: 760px;
}

.panel {
  background: var(--card);
  border: 0;
  border-radius: 0;
  min-width: 0;
  padding: 16px;
}

.main-panel,
.detail-panel {
  min-height: 0;
  min-width: 0;
}

.focus-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 14px;
  padding: 0;
}

.compat-hidden {
  display: none;
}

.panel-header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.back-button {
  background: transparent;
  color: var(--blue-dark);
  font-size: 14px;
  min-height: 0;
  padding: 0 0 10px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.icon-button {
  background: var(--soft);
  color: var(--ink);
  min-height: 42px;
  padding: 0;
  width: 42px;
}

.add-note-button {
  color: var(--blue-dark);
  font-size: 24px;
  line-height: 1;
}

.note-menu {
  position: relative;
}

.note-menu[hidden] {
  display: none;
}

.note-menu summary {
  align-items: center;
  background: var(--soft);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-weight: 850;
  height: 42px;
  justify-content: center;
  list-style: none;
  width: 42px;
}

.note-menu summary::-webkit-details-marker {
  display: none;
}

.note-menu button {
  box-shadow: 0 12px 28px rgba(60, 64, 67, 0.18);
  position: absolute;
  right: 0;
  top: 48px;
  white-space: nowrap;
  z-index: 20;
}

.study-controls {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 10px;
  overflow: hidden;
}

.journey-switcher,
.focus-switcher {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

.journey-switcher label,
.focus-switcher label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.focus-switcher {
  border-top: 1px solid var(--line);
  margin-top: 0;
}

.focus-switcher[hidden] {
  display: none;
}

.study-controls select {
  background-color: transparent;
  border: 0;
  border-radius: 0;
  font-size: 16px;
  max-width: 100%;
  min-height: 28px;
  min-width: 0;
  padding: 0 28px 0 0;
  width: 100%;
}

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

.backup-box {
  display: none;
  border: 1px dashed var(--line);
  border-radius: 18px;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
}

.backup-box strong {
  display: block;
  font-size: 14px;
}

.backup-box p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  margin-top: 4px;
}

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

.backup-actions button {
  min-height: 40px;
  padding-inline: 14px;
}

.stack-panel .notes-list {
  display: flex;
  margin: 0 -2px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scroll-snap-type: x mandatory;
}

.stack-panel .note-card {
  flex: 0 0 min(78vw, 280px);
  scroll-snap-align: start;
}

.note-card,
.history-row {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  min-height: 0;
  padding: 14px;
  text-align: left;
  width: 100%;
}

.note-card {
  align-items: flex-start;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.history-row {
  display: block;
}

.note-card-copy {
  display: block;
  min-width: 0;
}

.note-status-dot {
  background: #bdc1c6;
  border-radius: 999px;
  height: 10px;
  margin-top: 3px;
  width: 10px;
}

.note-status-dot.ready {
  background: var(--green);
}

.note-status-dot.pending {
  animation: status-pulse 1.2s ease-in-out infinite;
  background: var(--blue);
}

.note-status-dot.saved {
  background: var(--yellow);
}

.note-status-dot.error {
  background: var(--red);
}

.note-row {
  display: block;
}

.note-row.active .note-card {
  background: #eef3ff;
  border-color: #c9d8ff;
}

.note-card strong,
.history-row strong {
  display: block;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.note-card-copy > span,
.history-row small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.3;
  margin-top: 5px;
}

.history-limit {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  padding: 4px 2px;
  text-align: center;
}

.note-understanding {
  align-self: center;
  color: var(--blue-dark);
  font-size: 15px;
  line-height: 1;
}

.library-panel .panel-header {
  align-items: center;
}

.library-panel .panel-header h2,
.editor-panel .panel-header h2 {
  font-size: 28px;
}

.home-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
  padding: 0;
}

.home-overview {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  max-width: 100%;
  min-width: 0;
}

.home-copy {
  align-content: start;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.home-copy h2 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.home-copy .muted {
  color: var(--muted);
  display: block;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.25;
  max-width: 100%;
}

.home-label {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.status-banner {
  align-items: flex-start;
  background: #e8f0fe;
  border: 1px solid #aecbfa;
  border-radius: 18px;
  color: var(--blue-dark);
  display: flex;
  gap: 10px;
  padding: 12px;
}

.status-banner[hidden] {
  display: none;
}

.status-banner strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.status-banner p {
  color: #3c4043;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  margin-top: 3px;
}

.status-dot {
  animation: status-pulse 1.2s ease-in-out infinite;
  background: var(--blue);
  border-radius: 999px;
  flex: 0 0 auto;
  height: 10px;
  margin-top: 3px;
  width: 10px;
}

@keyframes status-pulse {
  0%, 100% {
    opacity: 0.35;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.home-progress {
  background: var(--soft);
  border: 0;
  border-radius: 24px;
  align-content: center;
  display: grid;
  gap: 4px;
  justify-items: start;
  min-height: 112px;
  min-width: 0;
  padding: 18px;
  width: 176px;
}

.home-progress > div > span {
  display: block;
  font-size: 40px;
  font-weight: 850;
  line-height: 1;
}

.home-progress p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.home-progress p span {
  display: inline;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.actions,
.result-actions,
.form-actions,
.quiz-nav {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 18px;
}

.home-card > .actions {
  align-items: stretch;
  flex-direction: row;
  justify-content: stretch;
  margin: 2px 0 0;
}

.home-card > .actions button {
  min-width: 0;
  width: 100%;
}

.home-card > .actions .secondary {
  min-width: 108px;
}

.learner-report {
  background: var(--soft);
  border-radius: 20px;
  display: grid;
  gap: 8px;
  padding: 16px;
}

.learner-report[hidden] {
  display: none;
}

.learner-report > strong {
  color: var(--blue-dark);
  font-size: 14px;
  line-height: 1.2;
}

.learner-report p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.42;
}

.cert-readiness {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  display: block;
  padding: 14px 0 0;
}

.cert-readiness[hidden] {
  display: none;
}

.minimal-readiness {
  display: grid;
  gap: 10px;
  grid-template-columns: 0.7fr 1.3fr;
}

.minimal-readiness div {
  min-width: 0;
}

.minimal-readiness span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.minimal-readiness strong {
  color: var(--ink);
  display: block;
  font-size: 16px;
  line-height: 1.2;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cert-readiness-head {
  align-items: end;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.cert-readiness-head strong,
.cert-readiness-head b {
  color: var(--ink);
  display: block;
  font-size: 22px;
  line-height: 1;
}

.cert-readiness-head span,
.cert-readiness p,
.cert-domain small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.cert-domain {
  display: grid;
  gap: 5px;
}

.cert-domain > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.cert-domain-track {
  background: #e8eaed;
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
}

.cert-domain-track i {
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: inherit;
  display: block;
  height: 100%;
}

.focus-panel > .actions {
  margin-top: 0;
}

.actions button,
.result-actions button,
.form-actions button,
.quiz-nav button {
  max-width: 100%;
  width: 100%;
}

.quiz-area {
  display: grid;
  gap: 12px;
}

.empty,
.error {
  background: var(--soft);
  border-radius: 18px;
  color: var(--muted);
  font-weight: 650;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 16px;
}

.error {
  color: #a33a2d;
}

.prep-line,
.grading-state {
  align-items: flex-start;
  background: #e8f0fe;
  border: 1px solid #aecbfa;
  border-radius: 18px;
  color: var(--blue-dark);
  display: flex;
  gap: 10px;
  padding: 12px;
}

.prep-line strong,
.grading-state strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.prep-line > div,
.grading-state > div {
  min-width: 0;
  width: 100%;
}

.prep-line p,
.grading-state p {
  color: #3c4043;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  margin-top: 3px;
}

.grading-state {
  background: var(--soft);
  border-color: var(--line);
  color: var(--ink);
}

.prep-progress {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.prep-progress > div:first-child {
  align-items: baseline;
  display: flex;
  gap: 6px;
}

.prep-progress > div:first-child span:first-child {
  color: var(--blue-dark);
  font-size: 18px;
  font-weight: 850;
  line-height: 1;
}

.prep-progress > div:first-child span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.prep-progress-track {
  background: rgba(26, 115, 232, 0.14);
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
}

.prep-progress-track span {
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 300ms ease;
}

.question-card,
.result-card,
.attempt-card {
  background: var(--soft);
  border-radius: 20px;
  padding: 16px;
}

.skeleton-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  display: grid;
  gap: 18px;
  padding: 18px;
}

.skeleton-header,
.skeleton-footer {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.skeleton-footer {
  align-items: flex-start;
  display: grid;
  justify-content: stretch;
}

.skeleton-footer strong {
  color: var(--ink);
  font-size: 15px;
}

.skeleton-footer span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.skeleton-line,
.skeleton-pill,
.skeleton-option {
  animation: skeleton-pulse 1.15s ease-in-out infinite;
  background: linear-gradient(90deg, #eef1f6 0%, #f8fafd 45%, #eef1f6 100%);
  background-size: 220% 100%;
  border-radius: 999px;
  display: block;
}

.skeleton-line {
  height: 14px;
  width: 52%;
}

.skeleton-line.tiny {
  width: 88px;
}

.skeleton-line.title {
  height: 34px;
  width: 76%;
}

.skeleton-line.wide {
  height: 18px;
  width: 92%;
}

.skeleton-pill {
  height: 28px;
  width: 96px;
}

.skeleton-options {
  display: grid;
  gap: 10px;
}

.skeleton-option {
  border-radius: 16px;
  height: 58px;
  width: 100%;
}

@keyframes skeleton-pulse {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.question-topline {
  align-items: flex-start;
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
  line-height: 1.25;
  margin-bottom: 8px;
}

.question-topline span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-rationale {
  background: #e8f0fe;
  border: 1px solid #aecbfa;
  border-radius: 16px;
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
  padding: 12px;
}

.quiz-rationale strong {
  color: var(--blue-dark);
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1.2;
}

.quiz-rationale span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.trap-callout {
  background: #fef7e0;
  border: 1px solid #fdd663;
  border-radius: 14px;
  color: #5f4500;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  margin: 0 0 12px;
  padding: 10px 12px;
}

.hierarchy {
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

.question-source {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.2;
  margin: -2px 0 8px;
}

.question-meta-line {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 760;
  gap: 6px;
  line-height: 1.25;
  margin: -2px 0 12px;
}

.question-meta-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt {
  font-size: 22px;
  font-weight: 850;
  line-height: 1.2;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}

.quiz-active .prompt {
  font-size: clamp(24px, 7vw, 36px);
  margin: 8px 0 22px;
}

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

.quiz-active .choices {
  align-content: start;
  gap: 12px;
  padding-bottom: 16px;
}

.choice {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  line-height: 1.25;
  min-height: 54px;
  text-align: left;
  white-space: normal;
  width: 100%;
}

.quiz-active .choice {
  border-radius: 18px;
  font-size: 17px;
  min-height: 64px;
  padding: 16px;
}

.choice.selected {
  background: #e8f0fe;
  border-color: var(--blue);
}

.result-card h2,
.session-heading h2 {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 8px;
}

.next-quiz-status {
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
}

.next-quiz-status.ready {
  background: #e6f4ea;
  border-color: #a8dab5;
}

.next-quiz-status.preparing {
  background: #e8f0fe;
  border-color: #aecbfa;
}

.next-quiz-status .status-dot {
  flex: 0 0 auto;
  margin-top: 3px;
}

.next-quiz-status.ready .status-dot {
  background: var(--green);
}

.next-quiz-status strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.next-quiz-status p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  margin-top: 3px;
}

.memory-evidence {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 12px;
}

.memory-evidence strong {
  color: var(--blue-dark);
  font-size: 13px;
}

.memory-evidence span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.memory-evidence em {
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
  line-height: 1.35;
}

.evidence-pills {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.evidence-pills small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.evidence-pills span {
  background: #e8f0fe;
  border-radius: 999px;
  color: var(--blue-dark);
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  padding: 5px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-pills .missed {
  background: #fce8e6;
  color: var(--red);
}

.evidence-pills .mastered {
  background: #e6f4ea;
  color: var(--green);
}

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

.manual-note-fields {
  display: grid;
  gap: 10px;
}

.manual-note-fields[hidden] {
  display: none;
}

.note-coach-box {
  background: #e8f0fe;
  border: 1px solid #aecbfa;
  border-radius: 18px;
  color: var(--blue-dark);
  display: grid;
  gap: 8px;
  padding: 14px 16px;
}

.note-coach-box[hidden] {
  display: none;
}

.note-coach-box strong {
  font-size: 14px;
}

.note-coach-box ul {
  color: var(--ink);
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.note-coach-box li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

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

.source-chooser[hidden] {
  display: none;
}

.source-option {
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--muted);
  display: grid;
  gap: 3px;
  min-height: 70px;
  padding: 10px;
  text-align: left;
}

.source-option.active {
  background: #e8f0fe;
  border-color: #aecbfa;
  color: var(--blue-dark);
}

.source-option span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.source-option small {
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.math-box,
.book-box,
.cert-box {
  background: #fef7e0;
  border: 1px solid #fdd663;
  border-radius: 18px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.book-box {
  background: #e6f4ea;
  border-color: #a8dab5;
}

.cert-box {
  background: transparent;
  border-color: var(--line);
  gap: 14px;
  padding: 0;
}

.math-box[hidden],
.book-box[hidden],
.cert-box[hidden] {
  display: none;
}

.math-box strong,
.book-box strong,
.cert-box strong {
  color: #8a5a00;
  font-size: 13px;
}

.book-box strong {
  color: var(--green);
}

.cert-box strong {
  color: var(--ink);
}

.math-box p,
.book-box p,
.cert-box p {
  color: #3c4043;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.cert-hero {
  background: #eef3ff;
  border: 1px solid #d9e4ff;
  border-radius: 20px;
  display: grid;
  gap: 6px;
  padding: 16px;
}

.cert-hero span {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.cert-hero strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.08;
}

.cert-hero p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  margin: 0;
}

.cert-section-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .02em;
  margin: 2px 0 -4px;
  text-transform: uppercase;
}

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

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

.math-template-card,
.book-template-card,
.cert-template-card {
  background: var(--bg);
  border: 1px solid #fdd663;
  border-radius: 14px;
  color: var(--ink);
  display: grid;
  gap: 4px;
  min-height: 0;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.book-template-card {
  border-color: #a8dab5;
}

.cert-template-card {
  border-color: var(--line);
}

.popular-cert-card {
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  display: grid;
  gap: 3px;
  min-height: 68px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.popular-cert-card:hover,
.popular-cert-card.active,
.cert-template-card.active {
  background: #e8f0fe;
  border-color: #8ab4f8;
}

.cert-template-card.primary-cert {
  background: var(--card);
  border-color: #d6d9de;
  min-height: 132px;
}

.cert-template-card.primary-cert:hover {
  border-color: var(--blue);
}

.cert-template-card b {
  color: var(--blue-dark);
  font-size: 24px;
  line-height: 1;
}

.cert-template-card em {
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  margin-top: 2px;
}

.cert-template-card.custom-cert {
  background: transparent;
  grid-column: 1 / -1;
  min-height: 0;
}

.math-template-card span,
.book-template-card span,
.cert-template-card span,
.popular-cert-card span {
  font-size: 14px;
  font-weight: 850;
}

.math-template-card small,
.book-template-card small,
.cert-template-card small,
.popular-cert-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.summary-box {
  background: #e8f0fe;
  border: 1px solid #aecbfa;
  border-radius: 18px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.summary-box[hidden] {
  display: none;
}

.summary-box span {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 850;
}

.summary-box p {
  color: #3c4043;
  font-size: 14px;
  line-height: 1.4;
}

.wiki-box {
  background: var(--soft);
  border: 0;
  border-radius: 18px;
  display: none;
  gap: 12px;
  margin-top: 6px;
  padding: 12px;
}

.note-editor-new .wiki-box:not([hidden]) {
  display: grid;
}

.wiki-box[open] {
  background: #e8f0fe;
}

.wiki-box summary {
  align-items: center;
  color: var(--blue-dark);
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 800;
  justify-content: space-between;
  list-style: none;
}

.wiki-box summary::-webkit-details-marker {
  display: none;
}

.wiki-box summary small {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 850;
}

.wiki-box[open] summary {
  margin-bottom: 10px;
}

.wiki-search,
.wiki-result {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.wiki-results {
  display: grid;
  gap: 8px;
}

.wiki-result {
  align-items: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
}

.wiki-result p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 4px;
}

input,
select,
textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  outline: none;
  padding: 13px;
  width: 100%;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
  font-weight: 750;
  min-height: 48px;
  overflow: hidden;
  padding-right: 34px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

textarea {
  min-height: 260px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
}

.history-row {
  align-items: flex-start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.history-row b {
  color: var(--blue-dark);
  font-size: 22px;
  line-height: 1;
}

.session-detail {
  display: grid;
  gap: 14px;
}

.attempt-card {
  border-left: 4px solid var(--yellow);
}

.attempt-card.correct {
  border-left-color: var(--green);
}

.attempt-card h3 {
  margin-bottom: 12px;
}

dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

dl div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 4px;
  text-transform: uppercase;
}

dd {
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 420px) {
  .shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .panel {
    border-radius: 20px;
    padding: 14px;
  }

  .app-header {
    margin-bottom: 12px;
  }

  .prompt {
    font-size: 20px;
  }
}

@media (max-width: 759px) {
  .shell {
    padding-top: calc(8px + env(safe-area-inset-top));
  }

  .home-card {
    background: transparent;
    border: 0;
    border-radius: 0;
    align-content: start;
    box-shadow: none;
    gap: 12px;
    min-height: 0;
    padding: 0;
  }

  .home-overview {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .home-copy h2 {
    font-size: 25px;
    line-height: 1.08;
    max-width: 100%;
  }

  .home-copy .muted {
    font-size: 14px;
    max-height: calc(1.38em * 3);
    min-height: calc(1.38em * 3);
    -webkit-line-clamp: 3;
  }

  .home-progress {
    background: transparent;
    border-top: 1px solid var(--line);
    border-radius: 0;
    display: flex;
    align-items: end;
    gap: 14px;
    min-height: auto;
    padding: 14px 0 0;
  }

  .home-progress > div > span {
    font-size: 36px;
  }

  .home-progress > .muted {
    font-size: 13px;
    line-height: 1.15;
    margin: 0 0 6px;
    white-space: nowrap;
  }

  .app-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .brand-lockup {
    gap: 8px;
  }

  .app-logo {
    border-radius: 10px;
    height: 34px;
    width: 34px;
  }

  h1 {
    font-size: 30px;
  }

  .subtitle {
    display: none;
  }

  .status {
    font-size: 9px;
    max-width: 24vw;
    padding: 4px 7px;
  }

  .cert-link {
    font-size: 12px;
    padding: 8px 10px;
  }

  .study-controls {
    border-radius: 20px;
  }

  .journey-switcher,
  .focus-switcher {
    gap: 4px;
    padding: 11px 12px;
  }

  .journey-switcher label,
  .focus-switcher label {
    font-size: 10px;
  }

  .study-controls select {
    font-size: 14px;
    min-height: 28px;
  }

  .actions {
    margin: 2px 0 0;
  }

  .home-card > .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .home-card > .actions button {
    width: 100%;
  }

  .actions button {
    min-height: 54px;
  }

  .status-banner {
    border-radius: 16px;
  }

  .notes-grid {
    align-items: start;
  }

  .library-editor .library-panel {
    display: none;
  }

  body:not(.library-editor) .editor-panel {
    display: none;
  }

  .library-panel,
  .editor-panel {
    border: 0;
    border-radius: 0;
    padding: 4px 0 0;
  }

  .notes-grid {
    gap: 0;
  }

  .library-panel .panel-header,
  .editor-panel .panel-header {
    padding-inline: 2px;
  }

  .library-panel .panel-header {
    margin-bottom: 12px;
  }

  .library-panel .panel-header h2,
  .editor-panel .panel-header h2 {
    font-size: 24px;
    line-height: 1.08;
  }

  .library-panel .panel-header .muted,
  .editor-panel .panel-header .muted {
    font-size: 13px;
    margin-top: 3px;
  }

  .note-card,
  .history-row {
    border-radius: 16px;
    padding: 18px;
  }

  .source-chooser {
    grid-template-columns: 1fr;
  }

  .source-option {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 56px;
  }

  .source-option small {
    text-align: right;
  }

  textarea {
    min-height: 46vh;
  }

  body:not(.history-detail) .quiz-history-layout .detail-panel {
    display: none;
  }

  .history-detail .quiz-history-layout .history-panel {
    display: none;
  }

  .quiz-history-layout .history-panel,
  .quiz-history-layout .detail-panel {
    border: 0;
    border-radius: 0;
    padding: 4px 0 0;
  }

  .quiz-active .shell {
    padding: calc(10px + env(safe-area-inset-top)) 16px calc(10px + env(safe-area-inset-bottom));
  }

  .quiz-active .question-card {
    padding-top: 4px;
  }

  .quiz-active .prompt {
    font-size: clamp(24px, 7vw, 32px);
    margin: 8px 0 18px;
  }

  .quiz-active .choices {
    gap: 10px;
    padding-bottom: 8px;
  }

  .quiz-active .choice {
    min-height: 58px;
    padding: 14px 16px;
  }

  .quiz-nav {
    background: var(--bg);
    margin: 6px -2px 0;
    padding-top: 8px;
  }

  .quiz-nav .muted {
    display: none;
  }
}

@media (min-width: 760px) {
  .shell {
    padding: 28px 18px 56px;
  }

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

  h1 {
    font-size: 48px;
  }

  .app-logo {
    height: 58px;
    width: 58px;
  }

  .subtitle {
    font-size: 18px;
  }

  .tabbar {
    background: #eef1f6;
    border: 0;
    box-shadow: none;
    display: inline-flex;
    left: auto;
    margin: 26px 0 16px;
    padding: 4px;
    position: static;
    right: auto;
    width: auto;
  }

  .tab {
    min-height: 38px;
    padding-inline: 18px;
    width: auto;
  }

  .back-button {
    display: none;
  }

  .quiz-active .shell {
    max-width: 900px;
    padding: 28px 18px;
  }

  .quiz-active .question-card {
    min-height: calc(100vh - 56px);
    padding: 22px 10px;
  }

  .actions,
  .result-actions,
  .form-actions,
  .quiz-nav {
    align-items: center;
    flex-direction: row;
  }

  .actions button,
  .result-actions button,
  .form-actions button,
  .quiz-nav button {
    width: auto;
  }

  .wiki-search {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .wiki-result {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (min-width: 980px) {
  .shell {
    width: min(960px, calc(100vw - 32px));
  }

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

  .quiz-history-layout {
    grid-template-columns: 340px minmax(0, 1fr);
  }

  .notes-grid {
    grid-template-columns: 340px minmax(0, 1fr);
  }

  .main-panel,
  .detail-panel {
    min-height: 560px;
  }

  .stack-panel .notes-list {
    display: grid;
    margin: 0;
    overflow: visible;
    padding: 0;
  }

  .stack-panel .note-card {
    flex-basis: auto;
  }

  textarea {
    min-height: 320px;
  }
}

/* QuizLoop certification redesign */
:root {
  --bg: #f8fafd;
  --card: #ffffff;
  --ink: #202124;
  --muted: #5f6368;
  --line: #dfe3ea;
  --soft: #f1f4f9;
  --blue: #1a73e8;
  --blue-dark: #185abc;
  --green: #188038;
  --yellow: #fbbc04;
  --red: #d93025;
}

body {
  background:
    radial-gradient(circle at top left, rgba(66, 133, 244, 0.10), transparent 280px),
    linear-gradient(180deg, #fbfcff 0%, #f5f7fb 100%);
}

.shell {
  max-width: 1080px;
}

.app-header {
  margin-bottom: 14px;
}

.brand-lockup {
  gap: 14px;
}

.brand-lockup > div {
  min-width: 0;
}

.brand-lockup p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  margin-top: 4px;
}

.app-logo {
  border-radius: 14px;
  height: 46px;
  width: 46px;
}

h1 {
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: 0;
}

.tabbar {
  border: 1px solid rgba(223, 227, 234, 0.88);
}

.tab {
  font-weight: 850;
}

.learn-grid {
  max-width: 920px;
}

.panel {
  background: transparent;
}

.home-card,
.library-panel,
.editor-panel,
.history-panel,
.detail-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(223, 227, 234, 0.92);
  border-radius: 30px;
  padding: 22px;
}

.focus-panel {
  gap: 16px;
}

.study-controls {
  border: 1px solid var(--line);
  border-radius: 22px;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  padding: 0;
}

.study-controls:has(.focus-switcher[hidden]) {
  grid-template-columns: 1fr;
}

.journey-switcher,
.focus-switcher {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 14px 16px;
}

.journey-switcher {
  border-right: 1px solid var(--line);
}

.study-controls:has(.focus-switcher[hidden]) .journey-switcher {
  border-right: 0;
}

.focus-switcher {
  border-top: 0;
}

.study-controls label {
  color: var(--blue-dark);
}

.study-controls select {
  font-size: 15px;
  font-weight: 850;
}

.home-overview {
  align-items: end;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
}

.home-label {
  align-self: start;
  background: #e8f0fe;
  border-radius: 999px;
  color: var(--blue-dark);
  display: inline-flex;
  font-size: 12px;
  line-height: 1;
  padding: 8px 10px;
  width: fit-content;
}

.home-copy h2 {
  font-size: clamp(38px, 6vw, 62px);
  letter-spacing: 0;
  line-height: 0.98;
}

.home-copy .muted {
  color: #4d535c;
  font-size: 17px;
  line-height: 1.45;
  max-width: 640px;
}

.home-progress {
  background: var(--soft);
  border: 0;
  border-radius: 26px;
  min-height: 210px;
  padding: 22px;
}

.home-progress > div > span {
  font-size: clamp(54px, 8vw, 78px);
  letter-spacing: 0;
}

.home-progress p {
  font-size: 14px;
  font-weight: 760;
}

.home-progress > .muted {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 14px;
}

.home-card > .actions {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.home-card > .actions button {
  min-height: 58px;
}

.home-card > .actions #startQuizButton {
  font-size: 18px;
}

button.secondary {
  background: #eef3ff;
  color: var(--blue-dark);
}

.cert-readiness {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 16px;
}

.readiness-dashboard {
  display: grid;
  gap: 14px;
}

.readiness-hero {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(116px, 0.42fr);
}

.readiness-hero > div {
  background: var(--soft);
  border-radius: 22px;
  min-width: 0;
  padding: 16px;
}

.readiness-hero span,
.readiness-hero small,
.readiness-summary span,
.readiness-next span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.readiness-hero strong {
  color: var(--ink);
  display: block;
  font-size: clamp(46px, 8vw, 70px);
  letter-spacing: 0;
  line-height: 0.92;
  margin-top: 8px;
}

.readiness-hero b {
  color: var(--blue-dark);
  display: block;
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1;
  margin: 18px 0 8px;
}

.readiness-hero p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
  margin: 8px 0 0;
}

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

.readiness-summary > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  min-width: 0;
  padding: 12px;
}

.readiness-summary b {
  color: var(--ink);
  display: block;
  font-size: 13px;
  line-height: 1.25;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readiness-next {
  background: #e8f0fe;
  border-radius: 20px;
  padding: 14px;
}

.readiness-next span {
  color: var(--blue-dark);
}

.readiness-next p {
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.35;
  margin: 6px 0 0;
}

.readiness-domains {
  display: grid;
  gap: 10px;
}

.readiness-domain {
  display: grid;
  gap: 7px;
}

.readiness-domain > div {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

.readiness-domain span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readiness-domain b {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
}

.readiness-domain i {
  background: #e4e8ef;
  border-radius: 999px;
  display: block;
  height: 7px;
  overflow: hidden;
}

.readiness-domain em {
  background: linear-gradient(90deg, var(--blue), #34a853);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.cert-domain-list {
  gap: 12px;
}

.cert-domain {
  gap: 7px;
}

.cert-domain > span {
  font-size: 14px;
}

.cert-domain-track {
  height: 8px;
}

.status-banner,
.prep-line,
.grading-state {
  border-radius: 22px;
}

.notes-grid,
.quiz-history-layout {
  gap: 18px;
}

.panel-header {
  align-items: center;
}

.library-panel .panel-header h2,
.editor-panel .panel-header h2,
.history-panel .panel-header h2,
.detail-panel .panel-header h2 {
  font-size: 30px;
}

.note-card,
.history-row {
  background: var(--card);
  border-color: var(--line);
  border-radius: 22px;
  min-height: 84px;
  padding: 16px;
}

.note-card:hover,
.history-row:hover,
.note-row.active .note-card {
  background: #f7faff;
  border-color: #b8cdfb;
}

.note-status-dot {
  height: 11px;
  width: 11px;
}

.note-card strong,
.history-row strong {
  font-size: 16px;
}

.note-card-copy > span,
.history-row small {
  font-size: 13px;
}

.note-understanding,
.history-row b {
  align-self: center;
  background: #e8f0fe;
  border-radius: 999px;
  color: var(--blue-dark);
  font-size: 15px;
  padding: 7px 9px;
}

.cert-box {
  gap: 18px;
}

.cert-hero {
  background: #f7faff;
  border-color: #d8e4ff;
  border-radius: 26px;
  padding: 20px;
}

.cert-hero strong {
  font-size: 24px;
}

.cert-template-card,
.popular-cert-card {
  border-radius: 20px;
  min-height: 86px;
  padding: 15px;
}

.cert-template-card.primary-cert {
  min-height: 146px;
}

.cert-template-card b {
  font-size: 30px;
}

.custom-cert {
  border-style: dashed;
}

input,
select,
textarea {
  border-radius: 22px;
}

.manual-note-fields input {
  min-height: 56px;
}

.manual-note-fields textarea {
  line-height: 1.45;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
}

.form-actions button {
  width: 100%;
}

.question-card {
  background: transparent;
  padding: 0;
}

.question-topline {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.hierarchy {
  background: #e8f0fe;
  border-radius: 999px;
  color: var(--blue-dark);
  display: inline-flex;
  font-size: 12px;
  line-height: 1;
  margin-bottom: 16px;
  max-width: 100%;
  overflow: hidden;
  padding: 8px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt {
  font-size: clamp(24px, 4vw, 38px);
  letter-spacing: 0;
  line-height: 1.08;
}

.choices {
  gap: 12px;
}

.choice {
  background: var(--card);
  border-radius: 20px;
  font-weight: 760;
  min-height: 64px;
  padding: 16px 18px;
}

.choice:hover,
.choice.selected {
  background: #e8f0fe;
  border-color: var(--blue);
  color: var(--blue-dark);
}

.quiz-nav {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.auto-advance-label {
  align-self: flex-start;
  background: #e8f0fe;
  border: 1px solid #d2e3fc;
  border-radius: 999px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
  padding: 7px 11px;
}

.quiz-nav button {
  min-width: 138px;
}

.result-card,
.attempt-card,
.skeleton-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px;
}

.result-card h2,
.session-heading h2 {
  color: var(--blue-dark);
  font-size: 64px;
}

.next-quiz-status,
.memory-evidence {
  border-radius: 22px;
}

.lab-panel {
  max-width: 1180px;
}

.lab-content {
  display: grid;
  gap: 18px;
}

.lab-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 700;
  gap: 10px;
}

.lab-meta span {
  background: var(--soft);
  border-radius: 999px;
  padding: 8px 12px;
}

.lab-exams {
  display: grid;
  gap: 18px;
}

.lab-exam-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  display: grid;
  gap: 18px;
  padding: 22px;
}

.lab-exam-head,
.lab-columns {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.9fr);
}

.lab-exam-head h3 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 0.98;
  margin: 4px 0 8px;
}

.lab-exam-head span,
.lab-question-list small,
.lab-domain-row small,
.lab-empty {
  color: var(--muted);
  font-weight: 700;
}

.lab-score {
  align-self: stretch;
  background: var(--soft);
  border-radius: 24px;
  display: grid;
  justify-items: start;
  padding: 18px;
}

.lab-score b {
  font-size: 44px;
  line-height: 1;
}

.lab-score.good b,
.lab-score-strip .good {
  color: #188038;
}

.lab-score.warn b,
.lab-score-strip .warn {
  color: #b06000;
}

.lab-score.bad b,
.lab-score-strip .bad {
  color: #b3261e;
}

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

.lab-metrics div,
.lab-domain-row {
  background: var(--soft);
  border-radius: 18px;
  padding: 14px;
}

.lab-metrics b {
  display: block;
  font-size: 26px;
}

.lab-metrics span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.lab-columns section {
  min-width: 0;
}

.lab-columns h4,
.lab-details summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.lab-domain-list,
.lab-pill-list,
.lab-score-strip {
  display: grid;
  gap: 8px;
}

.lab-domain-row {
  display: grid;
  gap: 4px;
}

.lab-domain-row span {
  font-weight: 900;
}

.lab-domain-row b {
  font-size: 22px;
}

.lab-pill-list,
.lab-score-strip {
  display: flex;
  flex-wrap: wrap;
}

.lab-pill-list span,
.lab-score-strip span {
  background: var(--soft);
  border-radius: 999px;
  font-weight: 900;
  padding: 9px 12px;
}

.lab-details {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.lab-details summary {
  cursor: pointer;
  list-style: none;
}

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

.lab-queue-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.lab-queue-head span {
  background: #e8f0fe;
  border-radius: 999px;
  color: var(--blue);
  font-weight: 900;
  padding: 8px 12px;
}

.lab-question-list {
  counter-reset: lab-question;
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lab-question-list li {
  background: var(--soft);
  border-radius: 18px;
  counter-increment: lab-question;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.lab-question-list li::before {
  color: var(--blue);
  content: counter(lab-question);
  font-weight: 950;
}

.lab-question-list li > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.lab-question-list strong {
  font-size: 14px;
}

.lab-question-list p {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
}

.lab-question-list.compact p {
  font-size: 14px;
}

.session-detail {
  min-width: 0;
}

.attempt-card {
  border-left-width: 6px;
}

dl div {
  background: var(--soft);
  border: 0;
}

@media (max-width: 759px) {
  body {
    background: var(--bg);
  }

  .shell {
    padding: calc(12px + env(safe-area-inset-top)) 18px calc(98px + env(safe-area-inset-bottom));
  }

  .app-header {
    align-items: flex-start;
    margin-bottom: 14px;
  }

  .brand-lockup p {
    display: none;
  }

  .app-logo {
    height: 34px;
    width: 34px;
  }

  h1 {
    font-size: 32px;
  }

  .home-card,
  .library-panel,
  .editor-panel,
  .history-panel,
  .detail-panel,
  .lab-panel {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
  }

  .study-controls {
    background: var(--card);
    grid-template-columns: 1fr;
  }

  .journey-switcher,
  .focus-switcher {
    padding: 12px 14px;
  }

  .journey-switcher {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .home-copy h2 {
    font-size: clamp(34px, 10vw, 46px);
    overflow-wrap: normal;
    word-break: normal;
  }

  .home-copy .muted {
    font-size: 16px;
    max-height: none;
    min-height: 0;
    -webkit-line-clamp: 4;
  }

  .home-progress {
    align-items: end;
    display: block;
    min-height: 0;
    padding: 16px;
  }

  .home-progress > div > span {
    font-size: 48px;
  }

  .home-progress > .muted {
    border-top: 1px solid var(--line);
    margin: 12px 0 0;
    padding-top: 12px;
    white-space: normal;
  }

  .home-card > .actions {
    grid-template-columns: 1fr;
  }

  .home-card > .actions .secondary {
    display: none;
  }

  .cert-readiness,
  .learner-report,
  .prep-line,
  .grading-state,
  .empty,
  .error {
    border-radius: 22px;
  }

  .readiness-summary,
  .cert-template-grid,
  .popular-cert-grid,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .cert-template-card.primary-cert {
    min-height: 122px;
  }

  .note-card,
  .history-row {
    min-height: 82px;
    padding: 16px;
  }

  .quiz-active .shell {
    padding: calc(12px + env(safe-area-inset-top)) 18px calc(14px + env(safe-area-inset-bottom));
  }

  .quiz-active .question-card {
    min-height: calc(100vh - 26px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .quiz-active .question-topline {
    grid-template-columns: 1fr;
    margin-top: 2px;
  }

  .quiz-active .question-topline span {
    white-space: normal;
  }

  .quiz-active .question-topline span:first-child {
    color: var(--ink);
  }

  .quiz-active .prompt {
    font-size: clamp(28px, 8vw, 42px);
    margin: 12px 0 22px;
  }

  .quiz-active .choices {
    gap: 12px;
  }

  .quiz-active .choice {
    min-height: 64px;
  }

  .quiz-nav {
    background: transparent;
    margin: auto 0 0;
    padding-top: 14px;
  }

  .tabbar {
    border-radius: 24px;
    padding: 7px;
  }

  .tab {
    font-size: 15px;
    min-width: 0;
    padding: 0 8px;
  }

  .lab-exam-card {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
  }

  .lab-exam-head,
  .lab-columns,
  .lab-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 759px) {
  .home-overview {
    align-items: start;
    grid-template-columns: 1fr;
  }
}

@media (min-width: 760px) {
  .tabbar {
    border-radius: 999px;
  }

  .learn-grid,
  .notes-grid,
  .quiz-history-layout {
    margin-top: 6px;
  }

  .quiz-active .question-card {
    align-content: start;
    display: grid;
    min-height: calc(100vh - 64px);
    padding: 10px 0;
  }

  .quiz-active .quiz-nav {
    margin-top: 18px;
  }
}

/* Minimal product surface */
#learnerReportButton {
  display: none;
}

.app-header {
  margin-bottom: 22px;
}

.home-card {
  gap: 20px;
}

.study-controls {
  border: 1px solid rgba(218, 220, 224, 0.85);
  border-radius: 24px;
  overflow: hidden;
}

.journey-switcher,
.focus-switcher {
  background: transparent;
}

.home-copy {
  gap: 8px;
}

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

.home-progress {
  box-shadow: none;
}

.cert-readiness {
  margin-top: 0;
}

.question-card,
.result-card,
.attempt-card,
.skeleton-card {
  box-shadow: none;
}

@media (max-width: 759px) {
  h1 {
    font-size: 29px;
  }

  .shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  .app-header {
    margin-bottom: 18px;
  }

  .study-controls {
    border-radius: 22px;
  }

  .home-overview {
    gap: 14px;
  }

  .home-copy h2 {
    font-size: 40px;
  }

  .home-copy .muted {
    max-height: none;
    min-height: 0;
  }

  .home-progress {
    background: var(--soft);
    border: 0;
    border-radius: 22px;
    display: grid;
    gap: 2px;
    padding: 16px;
  }

  .home-progress > div > span {
    font-size: 44px;
  }

  .home-progress > .muted {
    border: 0;
    margin: 0;
    padding: 0;
  }

  .minimal-readiness {
    grid-template-columns: 1fr;
  }

  .home-card > .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tabbar {
    border-radius: 999px;
  }
}

/* Minimal exam-prep surface */
:root {
  --bg: #f6f7f9;
  --card: #f6f7f9;
  --ink: #1f2328;
  --muted: #6b7280;
  --line: rgba(31, 35, 40, 0.12);
  --soft: #eceff3;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #188038;
  --yellow: #f9ab00;
  --red: #d93025;
}

html,
body {
  background: var(--bg);
}

body {
  background-image: none;
}

button {
  box-shadow: none;
  font-weight: 780;
}

.shell {
  max-width: 780px;
  padding-top: calc(22px + env(safe-area-inset-top));
}

.app-header {
  margin-bottom: 16px;
}

.brand-lockup {
  gap: 10px;
}

.app-logo {
  border-radius: 0;
  height: 34px;
  width: 34px;
}

h1 {
  font-size: clamp(30px, 6vw, 44px);
  line-height: 1;
}

.tabbar {
  background: rgba(246, 247, 249, 0.92);
  border-color: rgba(31, 35, 40, 0.10);
  box-shadow: none;
  gap: 2px;
  margin: 0 auto;
  max-width: 520px;
}

.tab {
  border-radius: 999px;
  color: var(--muted);
  font-size: 15px;
  min-height: 44px;
}

.tab:hover,
.tab.active {
  background: #e7efff;
  color: var(--blue-dark);
}

.learn-grid,
.notes-grid,
.quiz-history-layout {
  max-width: 780px;
}

.home-card,
.library-panel,
.editor-panel,
.history-panel,
.detail-panel,
.lab-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.focus-panel,
.home-card {
  gap: 18px;
}

.study-controls {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: none;
  grid-template-columns: 1fr 1fr;
}

.journey-switcher,
.focus-switcher {
  background: transparent;
  padding: 14px 16px;
}

.study-controls label {
  color: var(--muted);
  font-size: 10px;
}

.study-controls select {
  color: var(--ink);
  font-size: 15px;
  font-weight: 780;
}

.home-overview {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 144px;
}

.home-label {
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  padding: 0;
}

.home-copy h2 {
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1.02;
}

.home-copy .muted {
  color: var(--muted);
  font-size: 15px;
  font-weight: 680;
  line-height: 1.35;
  max-width: 42rem;
}

.home-progress {
  background: transparent;
  border-left: 1px solid var(--line);
  border-radius: 0;
  min-height: 0;
  padding: 4px 0 4px 20px;
  width: auto;
}

.home-progress > div > span {
  font-size: 42px;
}

.home-progress p,
.home-progress > .muted {
  color: var(--muted);
  font-size: 13px;
}

.home-card > .actions {
  margin-top: 8px;
}

.home-card > .actions #startQuizButton,
.result-actions button,
.form-actions button {
  border-radius: 18px;
  min-height: 56px;
}

.cert-readiness {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.minimal-readiness {
  background: transparent;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 92px minmax(0, 1fr);
  padding-top: 16px;
}

.minimal-readiness div {
  background: transparent;
  border: 0;
  padding: 0;
}

.minimal-readiness span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 760;
  margin-bottom: 4px;
  text-transform: none;
}

.minimal-readiness strong {
  color: var(--ink);
  display: block;
  font-size: 16px;
  font-weight: 820;
  line-height: 1.2;
}

.note-card,
.history-row,
.source-option,
.attempt-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: none;
}

.history-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.history-row small,
.history-limit {
  color: var(--muted);
}

.panel-header h2 {
  font-size: 30px;
  line-height: 1.05;
}

.panel-header .muted {
  color: var(--muted);
  font-size: 14px;
}

.question-card {
  background: var(--bg);
  border: 0;
  border-radius: 0;
  padding: 0;
}

.question-topline {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.question-meta-line {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 18px;
}

.prompt {
  font-size: clamp(25px, 5vw, 36px);
  line-height: 1.12;
  margin-bottom: 24px;
}

.choice {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  justify-content: flex-start;
  min-height: 64px;
  padding: 16px;
  text-align: left;
}

.choice:hover,
.choice.selected {
  background: #e7efff;
  border-color: rgba(37, 99, 235, 0.55);
  color: var(--blue-dark);
}

.quiz-nav {
  color: var(--muted);
  flex-direction: row;
  font-size: 13px;
  justify-content: space-between;
  margin-top: 18px;
}

.result-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.result-score {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}

.skeleton-card,
.compact-prep {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: none;
}

@media (max-width: 759px) {
  .shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  .app-header {
    margin-bottom: 14px;
  }

  .study-controls {
    border-radius: 20px;
    grid-template-columns: 1fr;
  }

  .journey-switcher {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .home-overview {
    grid-template-columns: 1fr;
  }

  .home-copy h2 {
    font-size: 42px;
  }

  .home-progress {
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-template-columns: auto 1fr;
    justify-items: start;
    padding: 16px 0 0;
    width: 100%;
  }

  .home-progress > div > span {
    font-size: 48px;
  }

  .minimal-readiness {
    grid-template-columns: 1fr;
  }

  .question-topline {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .choice {
    min-height: 58px;
  }
}

/* Final readiness dashboard overrides */
.cert-readiness .readiness-dashboard {
  display: grid;
  gap: 14px;
}

.cert-readiness .readiness-hero {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(112px, 0.42fr);
}

.cert-readiness .readiness-hero > div,
.cert-readiness .readiness-summary > div {
  background: var(--soft);
  border: 0;
  border-radius: 22px;
  min-width: 0;
  padding: 16px;
}

.cert-readiness .readiness-hero span,
.cert-readiness .readiness-hero small,
.cert-readiness .readiness-summary span,
.cert-readiness .readiness-next span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  text-transform: uppercase;
}

.cert-readiness .readiness-hero strong {
  color: var(--ink);
  display: block;
  font-size: clamp(46px, 8vw, 70px);
  line-height: 0.92;
  margin-top: 8px;
}

.cert-readiness .readiness-hero b {
  color: var(--blue-dark);
  display: block;
  font-size: 30px;
  line-height: 1;
  margin: 18px 0 8px;
}

.cert-readiness .readiness-hero p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
  margin: 8px 0 0;
}

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

.cert-readiness .readiness-summary b {
  color: var(--ink);
  display: block;
  font-size: 13px;
  line-height: 1.25;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cert-readiness .readiness-next {
  background: #e8f0fe;
  border-radius: 20px;
  padding: 14px;
}

.cert-readiness .readiness-next span {
  color: var(--blue-dark);
}

.cert-readiness .readiness-next p {
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.35;
  margin: 6px 0 0;
}

.cert-readiness .readiness-domains {
  display: grid;
  gap: 10px;
}

.cert-readiness .readiness-domain {
  display: grid;
  gap: 7px;
}

.cert-readiness .readiness-domain > div {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

.cert-readiness .readiness-domain span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cert-readiness .readiness-domain b {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
}

.cert-readiness .readiness-domain i {
  background: #e4e8ef;
  border-radius: 999px;
  display: block;
  height: 7px;
  overflow: hidden;
}

.cert-readiness .readiness-domain em {
  background: linear-gradient(90deg, var(--blue), #34a853);
  border-radius: inherit;
  display: block;
  height: 100%;
}

@media (max-width: 759px) {
  .cert-readiness .readiness-hero,
  .cert-readiness .readiness-summary {
    grid-template-columns: 1fr 1fr;
  }

  .cert-readiness .readiness-hero strong {
    font-size: 46px;
  }
}

/* QuizLoop certification redesign */
:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --card: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --surface-3: #e8eef8;
  --ink: #15171c;
  --muted: #626a78;
  --line: rgba(21, 23, 28, 0.12);
  --soft: #eef2f7;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #188038;
  --yellow: #f9ab00;
  --red: #d93025;
  --focus-ring: rgba(37, 99, 235, 0.28);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --card: #111827;
  --surface: #111827;
  --surface-2: #172033;
  --surface-3: #1f2a44;
  --ink: #f4f7fb;
  --muted: #9aa4b2;
  --line: rgba(226, 232, 240, 0.12);
  --soft: #172033;
  --blue: #6aa3ff;
  --blue-dark: #9cc2ff;
  --green: #57c783;
  --yellow: #facc15;
  --red: #ff8a80;
  --focus-ring: rgba(106, 163, 255, 0.35);
}

html,
body {
  background: var(--bg);
}

body {
  color: var(--ink);
  transition: background-color 180ms ease, color 180ms ease;
}

button,
select,
input,
textarea {
  color: var(--ink);
}

button {
  background: var(--blue);
  color: #fff;
}

button:hover {
  background: var(--blue-dark);
}

:root[data-theme="dark"] button {
  color: #07111f;
}

button.secondary,
.theme-toggle,
.icon-button,
.note-menu summary {
  background: var(--surface-2);
  color: var(--ink);
}

button.secondary:hover,
.theme-toggle:hover,
.icon-button:hover,
.note-menu summary:hover {
  background: var(--surface-3);
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
.tab:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.shell {
  max-width: 880px;
  padding: calc(22px + env(safe-area-inset-top)) 18px calc(94px + env(safe-area-inset-bottom));
}

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

.brand-lockup {
  min-width: 0;
}

.app-logo {
  height: 32px;
  width: 32px;
}

h1 {
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 860;
}

.theme-toggle {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
}

.theme-toggle span {
  font-size: 16px;
  line-height: 1;
}

.theme-toggle strong {
  font-size: 13px;
  font-weight: 780;
}

.tabbar {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.10);
  gap: 4px;
  padding: 5px;
}

:root[data-theme="dark"] .tabbar {
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
}

.tab {
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  min-height: 42px;
}

.tab:hover,
.tab.active {
  background: var(--surface-2);
  color: var(--blue-dark);
}

.learn-grid,
.notes-grid,
.quiz-history-layout {
  max-width: 880px;
}

.panel,
.home-card,
.library-panel,
.editor-panel,
.history-panel,
.detail-panel,
.lab-panel,
.result-score,
.skeleton-card,
.compact-prep,
.learner-report,
.note-card,
.history-row,
.source-option,
.attempt-card,
.cert-template-card,
.popular-cert-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.home-card,
.library-panel,
.editor-panel,
.history-panel,
.detail-panel,
.lab-panel {
  padding: 18px;
}

.focus-panel,
.main-panel {
  background: transparent;
  border: 0;
  padding: 0;
}

.study-controls {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  gap: 0;
}

.journey-switcher,
.focus-switcher {
  background: transparent;
  border: 0;
  border-radius: 0;
}

.journey-switcher {
  border-right: 1px solid var(--line);
}

.study-controls label,
.cert-readiness .readiness-hero span,
.cert-readiness .readiness-hero small,
.cert-readiness .readiness-summary span,
.cert-readiness .readiness-next span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 830;
}

.study-controls select {
  color: var(--ink);
}

.home-overview {
  gap: 18px;
}

.home-label {
  color: var(--blue-dark);
  font-weight: 820;
}

.home-copy h2 {
  font-size: clamp(34px, 7vw, 54px);
  letter-spacing: 0;
  max-width: 11ch;
}

.home-copy .muted {
  color: var(--muted);
  font-size: 15px;
}

.home-progress {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.home-progress > div > span {
  font-size: 42px;
}

.home-card > .actions {
  display: flex;
  gap: 10px;
}

.home-card > .actions #startQuizButton,
.result-actions button,
.form-actions button {
  border-radius: 12px;
  min-height: 54px;
}

.cert-readiness {
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 16px;
}

.cert-readiness .readiness-hero,
.cert-readiness .readiness-summary {
  gap: 10px;
}

.cert-readiness .readiness-hero > div,
.cert-readiness .readiness-summary > div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.cert-readiness .readiness-hero strong {
  font-size: clamp(44px, 8vw, 66px);
}

.cert-readiness .readiness-hero b {
  color: var(--blue-dark);
}

.cert-readiness .readiness-next {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cert-readiness .readiness-next p {
  color: var(--ink);
}

.cert-readiness .readiness-domain i {
  background: var(--surface-3);
}

.cert-readiness .readiness-domain span {
  color: var(--ink);
}

.cert-readiness .readiness-domain em {
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.panel-header h2 {
  font-size: clamp(28px, 5vw, 38px);
}

.note-card,
.history-row {
  align-items: center;
}

.note-card:hover,
.history-row:hover,
.note-card.active {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
}

.note-card strong,
.history-row strong {
  color: var(--ink);
}

.history-row b {
  color: var(--blue-dark);
}

.question-card {
  background: var(--bg);
}

.prompt {
  color: var(--ink);
  font-size: clamp(26px, 5vw, 42px);
  max-width: 24ch;
}

.question-topline,
.question-meta-line,
.quiz-nav {
  color: var(--muted);
}

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

.choice:hover,
.choice.selected {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
  color: var(--blue-dark);
}

.result-card {
  color: var(--ink);
}

.next-quiz-status,
.memory-evidence,
.summary-box,
.note-coach-box,
.empty,
.grading-state,
.cert-box,
.backup-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

input,
textarea {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
}

@media (min-width: 760px) {
  .tabbar {
    bottom: 18px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(520px, calc(100vw - 36px));
  }
}

@media (max-width: 759px) {
  .shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .app-header {
    align-items: flex-start;
  }

  .theme-toggle strong {
    display: none;
  }

  .theme-toggle {
    min-height: 36px;
    padding: 0 11px;
  }

  .home-card,
  .library-panel,
  .editor-panel,
  .history-panel,
  .detail-panel,
  .lab-panel {
    padding: 0;
  }

  .panel,
  .home-card,
  .library-panel,
  .editor-panel,
  .history-panel,
  .detail-panel,
  .lab-panel {
    background: transparent;
    border: 0;
  }

  .study-controls {
    grid-template-columns: 1fr;
  }

  .journey-switcher {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .home-overview {
    grid-template-columns: 1fr;
  }

  .home-copy h2 {
    max-width: 10ch;
  }

  .home-progress {
    align-items: center;
    display: flex;
    justify-content: space-between;
  }

  .home-progress > div > span {
    font-size: 44px;
  }

  .home-card > .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .cert-readiness .readiness-summary {
    grid-template-columns: 1fr 1fr;
  }

  .cert-readiness .readiness-hero {
    grid-template-columns: minmax(0, 1fr) minmax(104px, 0.52fr);
  }
}

/* Final product polish: certification workspace layout */
@media (min-width: 900px) {
  .shell {
    max-width: 1180px;
    padding: calc(30px + env(safe-area-inset-top)) 28px 72px;
  }

  .app-header {
    margin: 0 auto 22px;
    max-width: 1080px;
  }

  .brand-lockup {
    gap: 14px;
  }

  .app-logo {
    height: 34px;
    width: 34px;
  }

  h1 {
    font-size: clamp(36px, 4vw, 50px);
  }

  .theme-toggle {
    min-height: 36px;
    padding: 0 13px;
  }

  .tabbar {
    bottom: auto;
    left: auto;
    margin: 0 auto 28px;
    max-width: 360px;
    position: static;
    right: auto;
    transform: none;
    width: 100%;
  }

  .tab {
    min-height: 40px;
  }

  .learn-grid,
  .notes-grid,
  .quiz-history-layout {
    margin-inline: auto;
    max-width: 1080px;
  }

  .quiz-history-layout {
    align-items: stretch;
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  }

  .history-panel,
  .detail-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    min-height: 560px;
    padding: 22px;
  }

  .history-panel .panel-header {
    margin-bottom: 16px;
  }

  .history-panel .panel-header h2,
  .detail-panel h2 {
    font-size: 28px;
    line-height: 1.05;
  }

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

  .history-row {
    border-radius: 14px;
    gap: 14px;
    min-height: 78px;
    padding: 15px 16px;
    text-align: left;
  }

  .history-row strong {
    display: block;
    font-size: 16px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .history-row small {
    display: block;
    font-size: 12px;
    line-height: 1.25;
    margin-top: 4px;
  }

  .history-row b {
    align-self: center;
    border-radius: 999px;
    font-size: 14px;
    min-width: 56px;
    padding: 8px 10px;
    text-align: center;
  }

  .session-detail {
    align-content: start;
    min-height: 100%;
  }

  .history-empty-state {
    align-content: center;
    display: grid;
    gap: 14px;
    min-height: 420px;
  }

  .history-empty-state span {
    color: var(--blue-dark);
    font-size: 12px;
    font-weight: 850;
  }

  .history-empty-state p {
    max-width: 32rem;
  }

  .history-empty-state button {
    justify-self: start;
  }

  .attempt-list {
    display: grid;
    gap: 12px;
  }
}

:root[data-theme="dark"] .tab {
  color: color-mix(in srgb, var(--muted) 72%, white);
}

:root[data-theme="dark"] .tab:hover,
:root[data-theme="dark"] .tab.active {
  color: #dbeafe;
}

/* Product container cleanup */
.brand-lockup p,
.theme-toggle strong {
  display: none;
}

.theme-toggle {
  border-radius: 999px;
  width: 40px;
}

.home-card {
  display: grid;
  gap: 18px;
}

.home-overview {
  align-items: start;
}

.home-copy h2 {
  max-width: 16ch;
}

.home-progress {
  display: grid;
  gap: 8px;
}

.cert-readiness {
  border-top: 1px solid var(--line);
  margin-top: 0;
  padding-top: 16px;
}

.cert-readiness .readiness-dashboard {
  gap: 12px;
}

.cert-readiness .readiness-hero {
  display: none;
}

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

.cert-readiness .readiness-summary > div,
.cert-readiness .readiness-next {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 0 0;
}

.cert-readiness .readiness-domains {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.note-status-dot {
  display: none;
}

.note-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.note-card-copy strong,
.history-row strong {
  max-width: 100%;
}

.note-card-copy span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-understanding,
.history-row b {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--blue-dark);
}

.choice,
.quiz-active .choice,
:root[data-theme="dark"] .choice,
:root[data-theme="dark"] .quiz-active .choice {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.choice:hover,
.choice.selected,
:root[data-theme="dark"] .choice:hover,
:root[data-theme="dark"] .choice.selected {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--blue) 62%, var(--line));
  color: var(--ink);
}

.quiz-active .question-card {
  margin: 0 auto;
  max-width: 760px;
  width: 100%;
}

.quiz-active .prompt {
  max-width: 18ch;
}

.quiz-active .quiz-nav {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

@media (min-width: 900px) {
  .home-overview {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  }

  .home-progress {
    align-self: stretch;
  }

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

@media (max-width: 759px) {
  .shell {
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .home-copy h2 {
    font-size: clamp(34px, 11vw, 46px);
    max-width: 12ch;
  }

  .home-progress {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    padding: 14px 0 0;
  }

  .cert-readiness .readiness-summary {
    grid-template-columns: 1fr;
  }

  .cert-readiness .readiness-next {
    display: none;
  }

  .quiz-active .prompt {
    font-size: clamp(30px, 10vw, 46px);
    max-width: 15ch;
  }

  .quiz-active .choice {
    min-height: 62px;
  }
}
