:root {
  --brand: #6f95c2;
  --brand-dark: #244f7d;
  --brand-deep: #102f52;
  --ink: #102f52;
  --muted: #4e6d8d;
  --line: #9bcdea;
  --paper: #ffffff;
  --soft: #f2faff;
  --soft-strong: #c1e8ff;
  --mint: #dcf8ef;
  --yellow: #fff5c9;
  --pink: #ffe7ef;
  --shadow: 0 16px 34px rgba(16, 47, 82, 0.16);
  --button-shadow: 0 10px 22px rgba(16, 47, 82, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

html {
  background: #c1e8ff;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 12% 8%, rgba(193, 232, 255, 0.92) 0 120px, transparent 121px),
    radial-gradient(circle at 88% 20%, rgba(125, 160, 202, 0.22) 0 96px, transparent 97px),
    radial-gradient(circle at 8% 72%, rgba(46, 91, 136, 0.1) 0 74px, transparent 75px),
    linear-gradient(180deg, #e8f7ff 0%, #d9f0fc 46%, #c1e8ff 100%);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.hidden {
  display: none !important;
}

.app-shell {
  width: min(100%, 460px);
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: rgba(235, 247, 255, 0.94);
  border-left: 1px solid rgba(125, 160, 202, 0.28);
  border-right: 1px solid rgba(125, 160, 202, 0.28);
  position: relative;
  padding-bottom: 108px;
  overflow: hidden;
}

.app-shell,
.main-app,
main,
.view,
.view > *,
.topbar > *,
.section-head > * {
  min-width: 0;
}

p,
h1,
h2,
strong,
span {
  overflow-wrap: anywhere;
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(46, 91, 136, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 91, 136, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 9px 9px, rgba(125, 160, 202, 0.12) 0 2px, transparent 2.5px);
  background-size: 24px 24px;
}

.auth-view {
  min-height: 100vh;
  display: none;
  padding: 56px 20px 24px;
}

.auth-view.active {
  display: grid;
  align-content: center;
  gap: 20px;
}

.brand-block {
  padding: 0 4px;
}

.brand-block h1 {
  max-width: 340px;
}

.brand-block p:last-child {
  max-width: 360px;
  color: var(--muted);
  line-height: 1.65;
}

.auth-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(89, 186, 243, 0.22);
  border-radius: 28px;
  background: rgba(225, 242, 253, 0.96);
  box-shadow: var(--shadow);
}

.proof-flow { display: flex; align-items: center; gap: 5px; overflow-x: auto; }
.proof-flow span { flex: 0 0 auto; padding: 7px 8px; border-radius: 9px; background: rgba(255,255,255,.12); font-size: 10px; font-weight: 800; }
.proof-flow b { color: #9bcdea; }

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 5px;
  border-radius: 999px;
  background: var(--soft);
}

.auth-tab {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-tab.active {
  background: var(--paper);
  color: var(--brand-dark);
  box-shadow: 0 8px 18px rgba(46, 91, 136, 0.13);
}

.auth-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: calc(28px + env(safe-area-inset-top)) 20px 14px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--brand-dark);
  font-weight: 900;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 25px;
  line-height: 1.2;
}

h2 {
  font-size: 19px;
  line-height: 1.25;
  margin-bottom: 12px;
}

.view {
  display: none;
  padding: 16px 16px 20px;
}

.view.active {
  display: block;
}

#meView,
#achievementsView,
#securityView {
  padding-top: calc(28px + env(safe-area-inset-top));
}

.profile-strip,
.upload-panel,
.today-hero,
.goal-panel,
.insight-card,
.daily-card,
.settings-panel,
.study-card,
.stat-tile,
.pack-card {
  border: 1px solid rgba(89, 186, 243, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.today-hero {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 14px;
  padding: 20px;
  margin-bottom: 16px;
  background: linear-gradient(145deg, var(--paper), var(--soft-strong));
}

.today-hero h2 { margin-bottom: 7px; font-size: 23px; }
.today-hero p { color: var(--muted); line-height: 1.55; margin-bottom: 0; }
.today-hero .full-width-button, .today-meta { grid-column: 1 / -1; }
.today-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 800; }
.today-progress { grid-column: 1 / -1; padding: 12px 13px; border-radius: 16px; background: rgba(255, 255, 255, .72); border: 1px solid rgba(89, 186, 243, .18); }
.today-progress > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.today-progress span { color: var(--muted); font-size: 12px; font-weight: 800; }
.today-progress strong { font-size: 13px; }

.mastery-ring {
  --mastery: 0%;
  width: 88px; height: 88px; border-radius: 50%; padding: 9px;
  display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at center, var(--paper) 55%, transparent 57%), conic-gradient(var(--brand-dark) var(--mastery), var(--line) 0);
}
.mastery-ring strong { font-size: 21px; }
.mastery-ring span { font-size: 10px; color: var(--muted); }

.goal-panel { padding: 18px; margin-bottom: 16px; }
.goal-form { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.goal-form input, .goal-form select, .field-label select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 13px; padding: 0 11px; background: var(--paper); color: var(--ink); }
.goal-form #goalTitle, .goal-form button { grid-column: 1 / -1; }
.date-field { position: relative; min-width: 0; }
.date-field > span { position: absolute; z-index: 1; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink); pointer-events: none; }
.date-field.has-value > span { display: none; }
.date-field input { position: relative; z-index: 0; }
.date-field:not(.has-value) input { color: transparent; }
.date-field:not(.has-value) input::-webkit-datetime-edit { color: transparent; }
.goal-list { display: grid; gap: 8px; margin-top: 12px; }
.goal-chip { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 14px; background: var(--soft); }
.goal-chip div { display: grid; gap: 3px; }
.goal-chip small, .empty-inline { color: var(--muted); }
.goal-chip button { border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.field-label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 800; }

.confidence-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 12px; }
.confidence-actions p { grid-column: 1 / -1; text-align: center; color: var(--muted); margin: 0 0 2px; font-weight: 800; }
.confidence-actions button { min-height: 62px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); font-weight: 900; }
.confidence-actions button:first-of-type { background: var(--pink); }
.confidence-actions button:nth-of-type(3), .confidence-actions button:nth-of-type(4) { background: var(--mint); }
.confidence-actions small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 700; }
.source-proof { margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: var(--soft); color: var(--muted); font-size: 13px; }
.source-proof p { margin: 9px 0 0; line-height: 1.6; }
.insight-card { padding: 18px; margin: 16px 0; }
.insight-card p { color: var(--muted); line-height: 1.55; }
.diagnosis-overview { margin-top: 0; background: linear-gradient(145deg, var(--paper), var(--soft)); }
.diagnosis-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.diagnosis-metrics > div { min-height: 70px; display: grid; align-content: center; gap: 4px; padding: 11px 12px; border: 1px solid rgba(89, 186, 243, .2); border-radius: 15px; background: rgba(255,255,255,.72); }
.diagnosis-metrics > div:first-child { background: var(--soft-strong); }
.diagnosis-metrics span { color: var(--muted); font-size: 11px; font-weight: 800; }
.diagnosis-metrics strong { color: var(--brand-deep); font-size: 20px; }
.diagnosis-overview .section-head > span { padding: 4px 9px; border-radius: 999px; background: var(--soft-strong); color: var(--brand-deep); font-size: 11px; font-weight: 900; }
.diagnosis-help-row { display: flex; justify-content: flex-end; margin-top: 12px; }
.diagnosis-help-button { font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.explanation-dialog { width: min(calc(100% - 28px), 430px); max-height: min(82vh, 720px); overflow: auto; border: 0; border-radius: 24px; padding: 18px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 70px rgba(15, 73, 112, .25); }
.explanation-dialog::backdrop { background: rgba(15, 40, 60, .42); backdrop-filter: blur(3px); }
.dialog-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.calculation-list { display: grid; gap: 9px; margin: 8px 0 16px; }
.calculation-list article { padding: 12px 13px; border-radius: 15px; background: var(--soft); }
.calculation-list strong { color: var(--brand-deep); font-size: 14px; }
.calculation-list p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.progress-section, .forgetting-section { margin: 20px 0; }
.knowledge-progress-list, .forgetting-list { display: grid; gap: 10px; }
.knowledge-progress-item, .forgetting-item { padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 8px 20px rgba(46, 91, 136, .08); }
.progress-title, .progress-detail { display: flex; justify-content: space-between; gap: 12px; }
.progress-title { margin-bottom: 9px; }
.progress-title span { color: var(--brand-dark); font-weight: 900; }
.progress-detail { margin-top: 8px; color: var(--muted); font-size: 12px; }
.progress-detail.secondary { margin-top: 5px; font-size: 10px; opacity: .82; }
#learningInsights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#learningInsights article { min-height: 108px; display: grid; align-content: center; gap: 5px; padding: 14px; border: 1px solid rgba(36, 79, 125, .22); border-radius: 16px; background: linear-gradient(145deg, #edf8ff, #c1e8ff); }
#learningInsights article span { color: var(--muted); font-size: 12px; font-weight: 800; }
#learningInsights article strong { color: var(--brand-deep); font-size: 24px; }
#learningInsights article p { margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.curve-note { margin: -4px 0 13px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.forgetting-item { display: grid; grid-template-columns: 1fr 72px; gap: 12px; align-items: center; }
.forgetting-main { display: grid; gap: 6px; min-width: 0; }
.forgetting-main strong { line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.forgetting-main small { color: var(--muted); }
.urgency { width: fit-content; padding: 3px 8px; border-radius: 999px; background: var(--yellow); color: #856600; font-size: 11px; font-weight: 900; }
.urgency.urgent { background: var(--pink); color: #b33c65; }
.recall-score { display: grid; justify-items: center; padding: 9px 4px; border-radius: 14px; background: var(--soft); }
.recall-score strong { color: var(--brand-dark); font-size: 20px; }
.recall-score span { color: var(--muted); font-size: 9px; }
.task-detail-item { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); box-shadow: 0 8px 20px rgba(46, 91, 136, .08); overflow: hidden; }
.task-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-detail-head > div:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.task-detail-head > div:first-child strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-detail-head > div:first-child span { flex: 0 0 auto; padding: 3px 8px; border-radius: 999px; background: var(--soft-strong); color: var(--brand-deep); font-size: 11px; font-weight: 900; }
.task-detail-item > p { margin: 11px 0 7px; color: var(--muted); font-size: 13px; line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.task-mastery { display: grid; justify-items: end; flex: 0 0 auto; }
.task-mastery strong { color: var(--brand-dark); }
.task-mastery small, .task-sources { color: var(--muted); font-size: 10px; }
.task-sources { line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.task-start-button { width: 100%; min-width: 0; margin-top: 14px; padding-inline: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.knowledge-progress-item .progress-title { min-width: 0; }
.knowledge-progress-item .progress-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forgetting-main { overflow: hidden; }

@media (max-width: 380px) {
  .confidence-actions { grid-template-columns: repeat(2, 1fr); }
  .goal-form { grid-template-columns: 1fr; }
  .goal-form > * { grid-column: 1 !important; }
  .goal-setting-row { grid-template-columns: 1fr; }
}

/* Unified high-contrast blue visual system */
.profile-strip,
.upload-panel,
.goal-panel,
.insight-card,
.daily-card,
.settings-panel,
.study-card,
.stat-tile,
.pack-card,
.knowledge-progress-item,
.forgetting-item,
.task-detail-item,
.badge {
  border-color: rgba(36, 79, 125, 0.28);
  box-shadow: 0 14px 30px rgba(16, 47, 82, 0.13);
}

.today-hero {
  border-color: rgba(36, 79, 125, 0.32);
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 255, 255, 0.72) 0 54px, transparent 55px),
    linear-gradient(145deg, #ffffff 0%, var(--soft-strong) 68%, #a9d8f3 100%);
  box-shadow: 0 18px 38px rgba(16, 47, 82, 0.18);
}

.today-progress,
.diagnosis-metrics > div {
  border-color: rgba(36, 79, 125, 0.2);
  background: rgba(255, 255, 255, 0.82);
}

.pack-card,
.badge,
.knowledge-progress-item,
.forgetting-item,
.task-detail-item,
.settings-panel,
.upload-panel,
.goal-panel {
  background: linear-gradient(145deg, #ffffff 58%, var(--soft) 100%);
}

.pack-entry:nth-child(even) .pack-card,
.knowledge-progress-item:nth-child(even),
.forgetting-item:nth-child(even),
.task-detail-item:nth-child(even) {
  background: linear-gradient(145deg, #ffffff 42%, rgba(193, 232, 255, 0.72) 100%);
}

.stat-tile {
  background: linear-gradient(145deg, #ffffff, var(--soft-strong));
}

.primary-button,
.segmented.active,
.task-start-button,
.due-review-item button {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-dark) 58%, var(--brand));
  color: #ffffff;
}

.secondary-button,
.mode-pill,
.goal-chip,
.source-proof,
#learningInsights article,
.calculation-list article {
  border: 1px solid rgba(36, 79, 125, 0.14);
}

.file-picker {
  border-color: rgba(36, 79, 125, 0.52);
  background: linear-gradient(145deg, #ffffff, var(--soft-strong));
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 4px rgba(111, 149, 194, 0.22);
}

.bottom-nav {
  background: rgba(255, 255, 255, 0.95);
  border-top-color: rgba(36, 79, 125, 0.24);
  box-shadow: 0 -12px 28px rgba(16, 47, 82, 0.1);
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(145deg, var(--brand-deep), var(--brand-dark));
  box-shadow: 0 8px 18px rgba(16, 47, 82, 0.2);
}

.explanation-dialog,
.poster-dialog,
.review-dialog,
.security-dialog {
  border: 1px solid rgba(111, 149, 194, 0.34);
  box-shadow: 0 24px 70px rgba(16, 47, 82, 0.3);
}

.toast {
  background: var(--brand-deep);
}

.profile-strip {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  margin-bottom: 14px;
}

.avatar {
  width: 54px;
  height: 54px;
  min-width: 54px;
  min-height: 54px;
  aspect-ratio: 1;
  flex: 0 0 54px;
  overflow: hidden;
  padding: 0;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--brand-deep), var(--brand), var(--soft-strong));
  color: white;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(46, 91, 136, 0.26);
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.profile-copy {
  flex: 1;
  min-width: 0;
}

.profile-copy span,
.daily-card span,
.stat-tile span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.progress-rail {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #c1e8ff;
  margin-top: 8px;
  border: 1px solid rgba(89, 186, 243, 0.12);
}

.progress-rail span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #102f52, #244f7d);
  transition: width 240ms ease;
}

.upload-panel,
.settings-panel {
  padding: 16px;
  margin-bottom: 14px;
}

.upload-panel p,
.settings-panel p,
.pack-card p,
.badge p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.pack-card .question-material-notice {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  color: #b45309;
  font-size: 13px;
  font-weight: 700;
}

.pack-card > p:not(.question-material-notice) {
  display: -webkit-box;
  margin: 0 0 10px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.pack-meta span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker {
  display: grid;
  place-items: center;
  min-height: 78px;
  border: 2px dashed rgba(89, 186, 243, 0.48);
  border-radius: 22px;
  background: linear-gradient(145deg, #ffffff, var(--soft-strong));
  color: var(--brand-dark);
  font-weight: 900;
  margin-bottom: 12px;
}

.file-picker input {
  display: none;
}

.material-source-actions {
  display: grid;
  grid-template-columns: 1fr 128px;
  gap: 10px;
  margin-bottom: 12px;
}

.material-source-actions .file-picker {
  margin-bottom: 0;
}

.camera-button {
  min-height: 78px;
  border-radius: 22px;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
}

textarea {
  resize: vertical;
}

textarea:focus,
input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(89, 186, 243, 0.16);
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.segmented,
.nav-item,
.text-button,
.icon-button,
.secondary-button,
.primary-button,
.option-button {
  border-radius: 999px;
}

.segmented,
.nav-item,
.text-button,
.icon-button,
.secondary-button,
.primary-button {
  border: 0;
}

.segmented {
  min-height: 38px;
  padding: 9px 6px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.segmented.active {
  background: var(--brand);
  color: white;
  box-shadow: var(--button-shadow);
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 50px;
  font-weight: 900;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: white;
  box-shadow: var(--button-shadow);
}

.secondary-button {
  background: var(--soft);
  color: var(--brand-deep);
}

.primary-button:active,
.secondary-button:active,
.pack-card:active,
.option-button:active,
.segmented:active,
.icon-button:active {
  transform: translateY(1px);
}

.status-line {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--brand-deep);
  font-size: 14px;
}
.status-line.error, .feedback-error {
  color: #a52a2a;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.feedback-error {
  padding: 10px 12px;
  border: 1px solid rgba(165, 42, 42, .24);
  border-radius: 10px;
  background: rgba(165, 42, 42, .08);
  line-height: 1.5;
}

.daily-card {
  padding: 15px;
  margin-bottom: 18px;
}

.section-head,
.practice-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.text-button {
  background: transparent;
  color: var(--brand-dark);
  font-weight: 900;
  padding: 8px 10px;
}

.text-button:hover {
  background: var(--soft);
}

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

.pack-card {
  padding: 15px;
  text-align: left;
  color: var(--ink);
}

.pack-card strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

.pack-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.pack-meta span,
.mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand-dark);
  font-weight: 800;
}

.mode-pill {
  background: var(--soft-strong);
}

.icon-button {
  width: 44px;
  height: 44px;
  background: var(--soft);
  color: var(--brand-deep);
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(46, 91, 136, 0.12);
}

.practice-view {
  min-height: 0;
}

.practice-top {
  margin-bottom: 14px;
}

.study-card {
  min-height: 0;
  flex: 0 0 auto;
  display: block;
  padding: 0;
  margin-bottom: 14px;
  perspective: 1100px;
  border: 2px solid rgba(89, 186, 243, 0.72);
  border-radius: 22px;
  background: transparent;
  box-shadow: 0 12px 26px rgba(46, 91, 136, 0.12);
}

.study-card.hidden,
.answer-area:empty,
.badge-grid:empty {
  display: none;
}

.card-inner {
  display: grid;
  min-height: 180px;
  transform-origin: center center;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 280ms cubic-bezier(.4, 0, .2, 1);
}

.study-card.flip-enabled.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  grid-area: 1 / 1;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  line-height: 1.75;
  font-size: 18px;
  word-break: break-word;
}

.card-front {
  position: relative;
  z-index: 2;
}

.card-back {
  position: relative;
  z-index: 1;
  transform: rotateY(-180deg);
}

.study-card.flip-enabled.flipped .card-front {
  z-index: 1;
}

.study-card.flip-enabled.flipped .card-back {
  z-index: 2;
}

.study-card:not(.flip-enabled) .card-back {
  display: none;
}

.single-face-answer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.single-face-answer strong {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-dark);
  font-size: 13px;
}

.card-face small {
  display: block;
  color: var(--brand-dark);
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 900;
}

.card-visual {
  margin: 0 0 16px;
}

.card-visual img {
  display: block;
  width: 100%;
  max-height: 46vh;
  border-radius: 16px;
  object-fit: contain;
  background: var(--soft);
}

.card-visual figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.quiz-result {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 13px 14px;
  border-radius: 15px;
}

.quiz-result.correct { color: #147858; background: #dcf8ef; }
.quiz-result.wrong { color: #aa3248; background: #fff0f3; }

.answer-area {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

#achievementsView > :last-child,
#meView > :last-child {
  margin-bottom: 0;
}

.option-button {
  min-height: 48px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 10px 14px;
}

.option-button.selected {
  border-color: var(--brand);
  background: var(--soft);
  color: var(--brand-deep);
  box-shadow: 0 8px 18px rgba(46, 91, 136, 0.13);
}

.practice-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 12px 0 6px;
  background: var(--paper);
}

.reward-strip {
  display: flex;
  justify-content: space-between;
  color: var(--brand-deep);
  font-weight: 900;
  padding: 14px 2px;
}

.poster-dialog {
  width: min(92vw, 420px);
  border: 0;
  border-radius: 12px;
  padding: 18px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(10, 26, 38, 0.24);
}

.poster-dialog::backdrop {
  background: rgba(18, 50, 73, 0.48);
  backdrop-filter: blur(5px);
}

.poster-dialog h2 {
  margin: 0 0 12px;
}

.poster-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.poster-title-row h2 { margin-bottom: 3px; }
.poster-title-row p { margin: 0; color: var(--muted); font-size: 12px; }
.poster-title-row > span { padding: 3px 0; color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: .08em; }
.poster-previews { display: flex; overflow-x: auto; border-radius: 4px; margin-top: 14px; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.poster-previews::-webkit-scrollbar { display: none; }

.poster-canvas {
  display: block;
  flex: 0 0 100%;
  min-width: 100%;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: var(--soft-strong);
  scroll-snap-align: center;
}

.poster-dots { display: flex; justify-content: center; gap: 7px; margin-top: 10px; }
.poster-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--line); transition: width .2s ease, background .2s ease; }
.poster-dots button.active { width: 22px; border-radius: 999px; background: var(--brand-dark); }

.poster-actions {
  display: grid;
  grid-template-columns: .8fr 1fr 1.2fr;
  gap: 10px;
  margin-top: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.stat-tile {
  padding: 16px;
}

.stat-tile strong {
  display: block;
  font-size: 26px;
  margin-top: 8px;
  color: var(--brand-deep);
}

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

.badge {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  padding: 12px;
}

.badge.locked {
  opacity: 0.5;
}

.settings-panel label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.settings-panel .secondary-button {
  margin-top: 10px;
}

.me-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.me-hero h2 {
  margin: 3px 0 4px;
  font-size: 22px;
  font-weight: 850;
}
.profile-identity h2 { display: flex; align-items: center; gap: 5px; }
.profile-identity { min-width: 0; }
.profile-identity .eyebrow { margin: 0; font-size: 14px; font-weight: 850; color: var(--brand-deep); }
.profile-identity #profileEmail { display: block; overflow-wrap: anywhere; font-size: 14px; font-weight: 650; color: var(--muted); }
.profile-identity .profile-motto { margin: 6px 0 0; color: var(--brand-deep); font-size: 13px; font-weight: 650; line-height: 1.4; }
.profile-motto:empty { display: none; }
.profile-edit-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 1px solid var(--line); border-radius: 15px; padding: 12px 15px; background: rgba(255,255,255,.78); color: var(--brand-deep); font: inherit; font-weight: 800; cursor: pointer; }
.membership-entry { width: 100%; margin: 0 0 12px; border-color: rgba(36,79,125,.28); background: var(--soft); }
.profile-edit-toggle span { font-size: 22px; line-height: 1; transition: transform .2s; }
.profile-edit-toggle[aria-expanded="true"] span { transform: rotate(90deg); }
.profile-editor { padding-top: 16px; }
.profile-editor.hidden { display: none; }
.profile-editor .primary-button { width: 100%; }
.member-star { color: #f4b73f; font-size: 15px; line-height: 1; }
.member-expiry { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

.membership-dialog { width: min(92vw, 430px); border: 0; border-radius: 24px; padding: 20px; color: var(--ink); }
.membership-dialog::backdrop { background: rgba(16, 47, 82, .42); backdrop-filter: blur(4px); }
.membership-dialog h2 { margin: 2px 0 0; }
.membership-usage { margin: 12px 0; padding: 9px 12px; border-radius: 12px; background: var(--soft); font-size: 13px; }
.membership-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border-radius: 14px; background: var(--soft); }
.membership-tabs button { border: 0; border-radius: 11px; padding: 9px; color: var(--muted); background: transparent; font-weight: 800; }
.membership-tabs button.active { color: white; background: linear-gradient(135deg, #102f52, #2869a5); }
.membership-plans { display: grid; gap: 9px; margin-top: 12px; }
.membership-plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 13px 14px; border: 1px solid rgba(36,79,125,.18); border-radius: 16px; color: var(--ink); background: white; text-align: left; }
.membership-plan strong { display: block; font-size: 16px; }
.membership-plan small { color: var(--muted); }
.membership-plan .plan-price { color: var(--brand); font-size: 18px; font-weight: 900; white-space: nowrap; }
.membership-plan:disabled { opacity: .55; }
.subscription-disclosure,.membership-legal { margin: 11px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.membership-actions { display: flex; justify-content: center; gap: 18px; margin-top: 10px; }
.membership-actions .text-button { padding: 5px; }
.membership-legal a { color: var(--brand); }

.referral-panel { padding: 18px; overflow: hidden; }
.referral-head,
.referral-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.referral-head h2 { margin: 2px 0 0; font-size: 18px; }
.referral-head .eyebrow { margin: 0; }
.referral-count { display: grid; text-align: right; }
.referral-count strong { font-size: 22px; color: var(--brand); }
.referral-count span,
.referral-code-row small { color: var(--muted); font-size: 12px; }
.referral-code-row {
  margin-top: 12px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--soft);
}
.referral-code-row > div { display: grid; min-width: 0; gap: 2px; }
.referral-code-row > div > strong { overflow: hidden; letter-spacing: 1px; white-space: nowrap; text-overflow: ellipsis; }
.referral-code-row .secondary-button,
.referral-bind .secondary-button { flex: 0 0 42px; width: 42px; min-width: 42px; height: 42px; min-height: 42px; margin: 0; padding: 0; border-radius: 11px; font-size: 12px; }
.referral-summary { margin: 8px 0 0; font-size: 12px !important; }
.referral-divider { height: 1px; margin: 14px 0 12px; background: rgba(36,79,125,.2); }
.referral-bind-label { display: block !important; margin: 0 0 8px !important; font-size: 13px !important; }
.referral-bind { display: grid; grid-template-columns: minmax(0, 1fr) 42px; align-items: center; gap: 8px; min-width: 0; margin-top: 0; }
.referral-bind input { min-width: 0; width: 100%; height: 42px; min-height: 42px; padding: 8px 12px; border-radius: 12px; text-transform: uppercase; }
.referral-bound { margin: 9px 0 0; color: var(--brand) !important; font-size: 12px !important; font-weight: 700; }

.avatar-large {
  width: 76px;
  height: 76px;
  min-width: 76px;
  min-height: 76px;
  flex-basis: 76px;
  border-radius: 24px;
  font-size: 35px;
}

.avatar-edit {
  border: 0;
  cursor: pointer;
}

.avatar-upload {
  margin-top: 4px;
}

.code-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
  width: 100%;
}

.goal-setting-row {
  display: grid;
  grid-template-columns: minmax(90px, .8fr) minmax(70px, 1fr) auto;
  gap: 8px;
}

.goal-setting-row select,
.goal-setting-row input {
  min-width: 0;
}

.goal-setting-row .secondary-button {
  margin-top: 0;
  white-space: nowrap;
}

.code-input-row input { min-width: 0; }

.code-input-row .secondary-button {
  width: 96px;
  padding: 0 8px;
  margin-top: 0;
  white-space: nowrap;
  font-size: 13px;
}

.subpage-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.subpage-head h2 { margin: 0; }
.full-width-button { width: 100%; }
.danger-panel { display: grid; gap: 10px; }
.danger-panel .secondary-button { margin-top: 0; }
.danger-button { min-height: 50px; border: 1px solid #f2b7c2; border-radius: 16px; background: #fff0f3; color: #b7354b; font-weight: 900; }

.security-note {
  font-size: 13px;
  margin: 12px 0;
}

.study-document {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--muted);
}

.study-document summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; color: var(--ink); font-weight: 800; }
.study-document summary::marker { color: var(--muted); }
.study-document summary strong { margin-left: auto; color: var(--brand-deep); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.study-document div { white-space: pre-wrap; line-height: 1.7; margin-top: 10px; }

.pack-entry { position: relative; }
.pack-entry .pack-card { width: 100%; padding-right: 15px; padding-bottom: 68px; }
.pack-entry .pack-card > strong { padding-right: 74px; }
.review-pack { position: absolute; right: 12px; bottom: 14px; border: 0; border-radius: 10px; padding: 7px 9px; color: var(--brand-deep); background: var(--soft); font-size: 12px; font-weight: 900; }
.manage-pack { position:absolute; right:90px; bottom:14px; border:0; border-radius:10px; padding:7px 9px; color:white; background:var(--brand-dark); font-size:12px; font-weight:900; }
.delete-pack {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 0;
  border-radius: 10px;
  padding: 6px 8px;
  color: #b7354b;
  background: #fff0f3;
  font-size: 12px;
  font-weight: 800;
}
.material-source-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
.material-source-actions .file-picker,.material-source-actions .camera-button { min-width:0; padding-inline:10px; text-align:center; }
.material-image-previews { display:flex; gap:9px; margin:8px 2px 12px; overflow-x:auto; padding:3px 1px 7px; }
.material-image-previews button { position:relative; flex:0 0 68px; height:68px; padding:0; overflow:hidden; border:2px solid #77adca; border-radius:13px; background:#d5ebf7; box-shadow:0 5px 12px rgba(19,57,96,.12); }
.material-image-previews img { width:100%; height:100%; object-fit:cover; }
.material-image-previews span { position:absolute; right:4px; bottom:4px; min-width:20px; padding:2px 5px; border-radius:9px; color:white; background:rgba(10,49,91,.82); font-size:10px; font-weight:900; }
.image-source-dialog { width:min(88vw,360px); border:0; border-radius:22px; padding:22px; color:var(--ink); background:#eef8fd; box-shadow:0 24px 70px rgba(8,42,76,.3); }
.image-source-dialog h2,.image-source-dialog p { margin:0 0 10px; }
.image-source-actions { display:grid; gap:10px; margin:18px 0 10px; }
.image-source-actions button { width:100%; }
.image-source-actions #chooseAlbumOption { border:2px solid var(--brand-dark); background:#fff; box-shadow:0 6px 16px rgba(16,47,82,.1); }
.image-source-dialog>.text-button { display:block; margin:8px auto 0; }
.ai-data-note { margin:10px 2px 0; color:var(--muted); font-size:12px; line-height:1.55; }
.ai-consent-dialog { width:min(92vw,520px); max-height:88dvh; overflow:auto; border:1px solid #7baecb; border-radius:24px; padding:24px; background:linear-gradient(165deg,#e1f2fb,#fff 58%,#d2eaf7); color:var(--ink); box-shadow:0 24px 70px rgba(18,50,73,.34); }
.ai-consent-dialog::backdrop { background:rgba(18,50,73,.56); backdrop-filter:blur(5px); }
.ai-consent-dialog h2 { margin:6px 0 14px; font-size:21px; line-height:1.4; }
.ai-consent-dialog p { color:var(--muted); line-height:1.65; }
.ai-consent-dialog strong { color:var(--ink); }
.ai-consent-dialog a { color:var(--brand-dark); font-weight:900; }
.ai-consent-choice { padding:11px 13px; border-radius:13px; background:rgba(255,255,255,.72); }
.material-image-viewer { width:min(94vw,720px); max-height:90dvh; border:0; border-radius:20px; padding:42px 12px 12px; background:#0b2948; }
.material-image-viewer .icon-button { position:absolute; top:8px; right:8px; color:white; background:rgba(255,255,255,.15); }
.material-image-viewer img { display:block; width:100%; max-height:calc(90dvh - 58px); object-fit:contain; border-radius:12px; }
.privacy-consent { display:flex!important; grid-template-columns:none!important; align-items:flex-start; gap:8px!important; margin:4px 0 12px; color:var(--muted); font-size:12px; font-weight:700!important; line-height:1.45; }
.privacy-consent input { flex:0 0 auto; width:18px!important; height:18px; margin:0; }
.privacy-consent a { color:var(--brand-dark); font-weight:900; }
.material-selection-note { margin:8px 2px 12px; color:var(--muted); font-size:12px; line-height:1.5; }

.due-review-section { margin-bottom: 16px; }
.review-list { display: grid; gap: 9px; }
.due-review-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.due-review-item div { display: grid; gap: 4px; min-width: 0; }
.due-review-item small { color: var(--muted); }
.due-review-item button { border: 0; border-radius: 12px; padding: 9px 12px; background: var(--brand); color: white; font-weight: 900; }
.due-review-item button.reviewed { background: #e5e9ec; color: var(--brand-deep); cursor: default; }
#todayDate { color: var(--muted); font-size: 13px; }
.review-dialog { width: min(92vw, 420px); border: 0; border-radius: 24px; padding: 18px; }
.review-dialog::backdrop { background: rgba(18, 50, 73, .48); }
.review-dialog label { display: grid; gap: 7px; margin: 12px 0; color: var(--muted); font-weight: 800; }
.review-dialog input, .review-dialog select { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.review-dialog .toggle-row { display: flex; justify-content: space-between; align-items: center; }
.review-dialog .toggle-row input { width: 22px; height: 22px; }

.generated-pack-dialog { width: min(92vw, 430px); border: 0; border-radius: 24px; padding: 24px; background: var(--paper); color: var(--ink); text-align: center; box-shadow: 0 24px 70px rgba(18, 50, 73, .3); }
.generated-pack-dialog::backdrop { background: rgba(18, 50, 73, .48); backdrop-filter: blur(4px); }
.generated-pack-dialog h2 { margin: 12px 0 8px; }
.generated-pack-dialog p { color: var(--muted); line-height: 1.6; }
.generated-pack-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; background: var(--soft); color: var(--brand-deep); font-size: 28px; font-weight: 900; }
.generated-pack-actions { display: grid; gap: 10px; margin-top: 20px; }
.card-manager-dialog { width:min(96vw,760px); max-height:94dvh; padding:18px; text-align:left; overflow:hidden; background:linear-gradient(165deg,#d8eefb 0,#f4faff 48%,#c3e3f6 100%); border:1px solid #6fa7ca; }
.card-manager-head,.card-manager-head>div,.dialog-title-row,.add-count-row,.dialog-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.card-manager-head .generated-pack-icon { flex:0 0 48px; margin:0; background:#dff2fc; color:var(--brand-deep); }
.card-manager-head h2,.dialog-title-row h2 { margin:0; }
.card-manager-head p { margin:3px 0 0; }
.card-manager-head #closeGeneratedPackButton { background:#dff2fc; color:var(--brand-deep); border:1px solid #b8dff3; }
.card-preview-toolbar { display:flex; align-items:center; justify-content:space-between; gap:18px; margin:12px 14px 4px; padding:0 20px; }
.card-preview-toolbar .icon-button { width:40px; height:40px; background:var(--brand-deep); color:#fff; border:1px solid var(--brand-deep); box-shadow:0 8px 18px rgba(16,47,82,.18); }
.card-preview-toolbar .icon-button:disabled { background:#dbeaf3; color:#7c9bb4; border-color:#c4dce9; box-shadow:none; }
.card-preview-toolbar strong { min-width:156px; display:flex; align-items:baseline; justify-content:center; gap:10px; text-align:center; color:var(--brand-deep); }
.card-preview-toolbar strong b { font-size:18px; font-weight:950; }
.card-preview-toolbar strong span { color:var(--muted); font-size:13px; font-weight:750; }
.card-preview-track { display:flex; gap:14px; width:100%; overflow-x:auto; overscroll-behavior-x:contain; scroll-snap-type:x mandatory; scroll-behavior:smooth; scrollbar-width:none; touch-action:pan-x pan-y; }
.card-preview-track::-webkit-scrollbar { display:none; }
.card-preview-slide { flex:0 0 100%; height:min(54dvh,470px); padding:18px; overflow-y:auto; scroll-snap-align:center; scroll-snap-stop:always; border:2px solid #4c8db8; border-radius:22px; background:linear-gradient(160deg,#f8fcff,#dceefa); box-shadow:0 12px 30px rgba(16,47,82,.16),inset 0 0 0 1px rgba(255,255,255,.75); }
.card-preview-slide header { display:flex; align-items:center; justify-content:space-between; gap:18px; position:sticky; top:-18px; z-index:2; margin:-18px -18px 14px; padding:11px 18px; background:rgba(187,222,242,.97); border-bottom:1px solid #6fa7ca; }
.card-preview-slide header .preview-card-number { min-width:72px; padding:0 8px; color:var(--brand-deep); font-size:15px; font-weight:950; letter-spacing:.02em; white-space:nowrap; }
.card-preview-slide header .preview-edit-button { width:auto; min-height:34px; padding:6px 18px; border:1px solid #3979a6; background:#f7fbfe; color:var(--brand-deep); font-size:13px; font-weight:850; box-shadow:none; }
.card-preview-slide section { margin:14px 0; }
.card-preview-slide section small { display:block; margin-bottom:6px; color:var(--brand-dark); font-weight:900; }
.card-preview-slide section p { margin:0; color:var(--ink); white-space:pre-wrap; overflow-wrap:anywhere; }
.card-preview-slide .preview-answer { padding:14px; border:1px solid #8dbbd5; border-radius:16px; background:#cfe6f4; }
.card-preview-images { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.card-preview-image { display:block; width:100%; max-height:220px; object-fit:contain; margin:10px 0; border-radius:16px; background:#edf4f8; }
.swipe-hint { margin:4px 0 0!important; text-align:center; font-size:11px; line-height:1.25!important; }
.card-manager-dialog .generated-pack-actions { grid-template-columns:repeat(3,minmax(0,1fr)); margin-top:12px; }
.card-manager-dialog #addCardsButton,.card-manager-dialog #saveGeneratedPackButton { border:2px solid #377cac; background:#eaf6fd; color:var(--brand-deep); }
.card-edit-dialog { width:min(94vw,620px); max-height:92dvh; overflow:auto; border:1px solid #73a9c8; border-radius:24px; padding:20px; background:linear-gradient(165deg,#d8eefb,#f5fbff 48%,#c9e6f6); color:var(--ink); box-shadow:0 24px 70px rgba(18,50,73,.34); }
.card-edit-dialog::backdrop { background:rgba(18,50,73,.52); backdrop-filter:blur(4px); }
.card-edit-dialog>label,.add-card-item label { display:grid; gap:7px; margin:13px 0; color:var(--muted); font-weight:800; }
.card-edit-dialog textarea,.card-edit-dialog input { width:100%; padding:12px 13px; border:1px solid #6fa7ca; border-radius:14px; background:#f8fcff; color:var(--ink); font:inherit; resize:vertical; }
.card-image-editor { display:grid; gap:10px; padding:14px; border:1px dashed var(--line); border-radius:18px; text-align:center; background:var(--soft); }
.card-image-editor img { width:100%; max-height:260px; object-fit:contain; border-radius:14px; }
.card-image-editor p { margin:12px; color:var(--muted); }
.card-image-editor>div { display:flex; justify-content:center; align-items:center; gap:8px; }
.card-image-editor .file-picker { display:inline-flex; margin:0; }
.dialog-actions { margin-top:18px; }
.danger-button { padding:12px 16px; border:0; border-radius:14px; background:#fff0f0; color:#b42727; font-weight:900; }
.add-form-heading { margin:18px 0 10px; color:var(--brand-deep); font-size:24px; }
.add-count-row { align-items:stretch; margin:0 0 14px; }
.add-count-row label { flex:1; display:flex; align-items:center; gap:10px; margin:0!important; padding:8px 10px; border:1px solid #77adca; border-radius:14px; background:#d5ebf7; color:var(--brand-deep); font-weight:900; }
.add-count-row label span { white-space:nowrap; }
.add-count-row label input { min-width:0; height:42px; text-align:center; font-weight:900; }
.add-count-row input[type="number"] { appearance:textfield; -moz-appearance:textfield; }
.add-count-row input[type="number"]::-webkit-inner-spin-button,
.add-count-row input[type="number"]::-webkit-outer-spin-button { margin:0; -webkit-appearance:none; appearance:none; }
.add-count-row #applyAddCardCount { width:auto; min-width:130px; min-height:58px; border:2px solid #377cac; background:#eaf6fd; }
.add-card-fields { display:grid; gap:12px; }
.add-card-item { padding:14px; border:1px solid #73a9c8; border-radius:18px; background:#dceffa; }
.add-card-item h3 { margin:0 0 8px; color:var(--brand-deep); }
.new-card-image-picker { min-height:48px; margin:8px 0 0!important; border:1px dashed #4385b1; background:#c8e5f6; }
.new-card-image-thumbnails { display:grid; grid-template-columns:repeat(2,minmax(0,92px)); gap:9px; margin-top:9px; }
.new-card-image-thumbnails:empty { display:none; }
.new-card-image-thumbnails img { width:92px; height:68px; object-fit:cover; border:2px solid #fff; border-radius:11px; box-shadow:0 5px 12px rgba(16,47,82,.2); }
.review-dialog,.poster-dialog,.security-dialog { background:linear-gradient(165deg,#dceffa,#f7fbfe 55%,#c4e3f5); border:1px solid #7baecb; }
@media (max-width:600px) { .card-manager-dialog { width:100vw; max-width:none; height:100dvh; max-height:none; border-radius:0; } .card-preview-slide { height:calc(100dvh - 286px); min-height:320px; } .card-preview-toolbar { margin:7px 2px 1px; padding-inline:10px; } .card-preview-toolbar strong { min-width:132px; } .card-manager-dialog .generated-pack-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:8px; } .card-manager-dialog #studyGeneratedPackButton { grid-column:1/-1; } .card-manager-dialog .generated-pack-actions button { min-height:43px; padding:7px; font-size:13px; } .dialog-actions { align-items:stretch; } .dialog-actions>* { flex:1; } .add-count-row { flex-direction:row; } .add-count-row #applyAddCardCount { min-width:112px; } }
.generation-view { min-height:100vh; margin:-16px -16px -20px; padding:calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); place-items:center; background:radial-gradient(circle at 50% 30%,#dff4ff 0,#b9e4ff 32%,#65baf3 72%,#398ed5 100%); }
.generation-view.active { display:grid; }
.generation-stage { width:min(100%,520px); padding:42px 26px; text-align:center; border:1px solid rgba(255,255,255,.65); border-radius:30px; background:rgba(255,255,255,.84); box-shadow:0 24px 70px rgba(26,91,148,.22); backdrop-filter:blur(18px); }
.generation-stage h2 { margin:8px 0; font-size:28px; color:#194d7d; }
.generation-stage > p { color:#52728f; line-height:1.65; }
.generation-spinner { width:82px; height:82px; margin:0 auto 22px; border:7px solid rgba(62,157,222,.18); border-top-color:#328fd4; border-radius:50%; animation:generationSpin .9s linear infinite; }
.generation-spinner span { display:block; width:18px; height:18px; margin:4px; border-radius:50%; background:#73c8fb; box-shadow:0 0 22px #73c8fb; }
.generation-spinner.ready { animation:none; border-color:#78c9a8; display:grid; place-items:center; }
.generation-spinner.ready::after { content:"✓"; color:#25875f; font-size:36px; font-weight:900; }
.generation-spinner.ready span { display:none; }
.generation-ready-actions { display:grid; gap:12px; margin-top:26px; padding-top:22px; border-top:1px solid rgba(49,95,168,.14); }
.generation-ready-actions p { margin:0 0 6px; color:#42647f; line-height:1.6; }
.generation-ready-actions strong { color:#194d7d; font-size:18px; }
@keyframes generationSpin { to { transform:rotate(360deg); } }
.generation-badge { display:inline-flex; align-items:center; gap:6px; color:var(--brand-dark); font-weight:800; }
.generation-badge::before { content:""; width:8px; height:8px; border-radius:50%; background:currentColor; animation:pulse 1.1s infinite alternate; }
@keyframes pulse { to { opacity:.25; transform:scale(.75); } }

.feedback-dialog { width: min(92vw, 420px); border: 0; border-radius: 18px; padding: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 70px rgba(18, 50, 73, .3); }
.feedback-dialog::backdrop { background: rgba(18, 50, 73, .48); backdrop-filter: blur(4px); }
.feedback-dialog h2 { margin: 0 0 16px; }
.feedback-field { display: grid; gap: 7px; margin-bottom: 12px; color: var(--muted); font-size: 13px; font-weight: 800; }
.feedback-field select { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font: inherit; }
.feedback-dialog textarea { width: 100%; resize: vertical; min-height: 140px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font: inherit; line-height: 1.6; }
.feedback-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; margin-top: 14px; }
.delete-account-dialog { width:min(88vw,390px); border:1px solid var(--line); border-radius:22px; padding:24px; background:linear-gradient(160deg,var(--paper),var(--soft)); color:var(--ink); box-shadow:0 24px 70px rgba(18,50,73,.28); }
.delete-account-dialog::backdrop { background:rgba(18,50,73,.55); backdrop-filter:blur(4px); }
.delete-account-dialog h2 { margin:0 0 20px; color:var(--ink); font-size:21px; line-height:1.45; text-align:center; }
.delete-account-dialog input { width:100%; min-height:50px; padding:13px 15px; border:2px solid var(--line); border-radius:15px; outline:0; background:var(--paper); color:var(--ink); font:inherit; font-weight:700; }
.delete-account-dialog input:focus { border-color:var(--brand); box-shadow:0 0 0 4px rgba(49,95,143,.12); }
.delete-account-dialog .status-line:empty { display:none; }
.delete-account-dialog .dialog-actions { margin-top:18px; }
.danger-button:disabled { opacity:.45; cursor:not-allowed; }
.review-calendar-head { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 10px; }
.review-calendar-head button { border: 0; background: var(--soft); color: var(--brand-deep); width: 36px; height: 36px; border-radius: 12px; }
.review-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-cell { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; font-size: 12px; }
.calendar-cell.review-day { border: 2px solid var(--brand); color: var(--brand-deep); font-weight: 900; background: var(--soft); }
.review-date-button { width:100%; padding:0; border:1px solid transparent; background:rgba(255,255,255,.72); color:var(--ink); cursor:pointer; }
.review-date-button:hover, .review-date-button:focus-visible { border-color:var(--brand); outline:2px solid rgba(76,141,184,.24); outline-offset:1px; }
.outside-review-range { color:var(--muted); opacity:.42; }
.review-calendar-instruction { margin-top:4px; color:var(--brand-deep); }

.avatar-picker {
  display: grid;
  gap: 8px;
  margin: 14px 0 18px;
  font-weight: 800;
}

.avatar-picker > div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.avatar-choice {
  width: 46px;
  height: 46px;
  border: 2px solid transparent;
  border-radius: 15px;
  background: var(--soft);
  font-size: 23px;
  cursor: pointer;
}

.avatar-choice.selected {
  border-color: var(--brand);
  background: var(--soft-strong);
}

.account-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.legal-link { text-decoration: none; }

.setting-action {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
}

.setting-action:hover { background: var(--soft); }

.account-panel { padding: 18px; }
.account-panel > h2 { margin: 0 0 14px; }
.account-panel > label,
.account-panel .account-row {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 15px 4px;
  border: 0;
  background: transparent;
}
.account-panel > label {
  border-bottom: 1px solid rgba(36, 79, 125, .12);
}
.account-panel .account-row {
  min-height: 58px;
  align-items: center;
  border-bottom: 1px solid rgba(36, 79, 125, .12);
}
.account-panel .account-row:last-child {
  border-bottom: 0;
}
.account-panel .setting-action:hover,
.account-panel .setting-action:focus-visible { background: rgba(255, 255, 255, .42); }

.security-panel {
  padding: 20px 18px;
  margin-bottom: 16px;
}

.security-panel label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  font-weight: 800;
}

.security-panel h2 {
  margin: 0 0 16px;
}

.security-panel > p:first-of-type {
  margin: 0 0 16px;
}

.account-row span { color: var(--muted); }
.account-row strong { color: var(--ink); font-size: 14px; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(-1px * var(--keyboard-inset, 0));
  width: min(100%, 460px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 10px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  transition: bottom 120ms ease-out;
  z-index: 100;
}

.nav-item {
  min-height: 56px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.nav-item span {
  font-size: 20px;
  line-height: 1;
}

.nav-item.active {
  color: var(--brand-deep);
  background: var(--soft);
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translate(-50%, 18px);
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 999px;
  background: #203040;
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: all 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.empty {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed var(--line);
  border-radius: 22px;
  padding: 18px;
  text-align: center;
}

@media (max-width: 380px) {
  .mode-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .practice-actions,
  .stats-grid,
  .badge-grid {
    grid-template-columns: 1fr;
  }
}

/* Final cascade: keep the same visual hierarchy across every app view. */
.profile-strip, .upload-panel, .goal-panel, .insight-card, .daily-card,
.settings-panel, .study-card, .stat-tile, .pack-card,
.knowledge-progress-item, .forgetting-item, .task-detail-item, .badge {
  border-color: rgba(36, 79, 125, .28);
  box-shadow: 0 14px 30px rgba(16, 47, 82, .13);
}

.today-hero {
  border-color: rgba(36, 79, 125, .32);
  background: radial-gradient(circle at 88% 14%, rgba(255,255,255,.72) 0 54px, transparent 55px), linear-gradient(145deg, #fff 0%, var(--soft-strong) 68%, #a9d8f3 100%);
  box-shadow: 0 18px 38px rgba(16, 47, 82, .18);
}

.pack-card, .badge, .knowledge-progress-item, .forgetting-item,
.task-detail-item, .settings-panel, .upload-panel, .goal-panel {
  background: linear-gradient(145deg, #fff 58%, var(--soft) 100%);
}

.pack-entry:nth-child(even) .pack-card,
.knowledge-progress-item:nth-child(even), .forgetting-item:nth-child(even),
.task-detail-item:nth-child(even) {
  background: linear-gradient(145deg, #fff 42%, rgba(193,232,255,.72) 100%);
}

.stat-tile { background: linear-gradient(145deg, #fff, var(--soft-strong)); }
.today-progress, .diagnosis-metrics > div { border-color: rgba(36,79,125,.2); background: rgba(255,255,255,.82); }
.file-picker { border-color: rgba(36,79,125,.52); background: linear-gradient(145deg, #fff, var(--soft-strong)); }

.primary-button, .segmented.active, .task-start-button, .due-review-item button {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-dark) 58%, var(--brand));
  color: #fff;
}

.bottom-nav { background: rgba(255,255,255,.95); border-top-color: rgba(36,79,125,.24); box-shadow: 0 -12px 28px rgba(16,47,82,.1); }
.nav-item.active { color: #fff; background: linear-gradient(145deg, var(--brand-deep), var(--brand-dark)); box-shadow: 0 8px 18px rgba(16,47,82,.2); }
.toast { background: var(--brand-deep); }

/* Softer blue surfaces with a text-only active navigation state. */
.profile-strip, .upload-panel, .goal-panel, .insight-card, .daily-card,
.settings-panel, .study-card, .stat-tile, .pack-card,
.knowledge-progress-item, .forgetting-item, .task-detail-item, .badge {
  background: linear-gradient(145deg, #f7fcff 0%, #dcefff 100%);
}

.today-hero {
  background: radial-gradient(circle at 88% 14%, rgba(255,255,255,.48) 0 54px, transparent 55px), linear-gradient(145deg, #eaf7ff 0%, var(--soft-strong) 68%, #9fd2ef 100%);
}

.pack-entry:nth-child(even) .pack-card,
.knowledge-progress-item:nth-child(even), .forgetting-item:nth-child(even),
.task-detail-item:nth-child(even) {
  background: linear-gradient(145deg, #edf8ff 20%, #c1e8ff 100%);
}

.today-progress, .diagnosis-metrics > div {
  background: rgba(238, 249, 255, .9);
}

.bottom-nav {
  background: rgba(225, 242, 253, .96);
}

.nav-item.active {
  color: var(--brand-deep);
  background: transparent;
  box-shadow: none;
}

.nav-item.active span {
  color: var(--brand-deep);
  font-weight: 900;
}

.nav-item:focus,
.nav-item:focus-visible {
  outline: none;
}

.progress-section {
  width: auto;
  min-width: 0;
  margin-inline: 8px;
  padding-inline: 0;
  overflow: hidden;
}

.knowledge-progress-list,
.knowledge-progress-item,
.progress-title {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.knowledge-progress-item {
  overflow: hidden;
}

.progress-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item span {
  font-size: 25px;
  transition: transform 160ms ease, filter 160ms ease;
  transform-origin: center;
}

.nav-item:active span {
  transform: translateY(2px) scale(.76) rotate(-6deg);
}

.nav-item.active span {
  animation: nav-icon-pop 320ms cubic-bezier(.2, .9, .3, 1.35);
  filter: saturate(1.15) drop-shadow(0 4px 5px rgba(16, 47, 82, .18));
}

@keyframes nav-icon-pop {
  0% { transform: translateY(3px) scale(.72); }
  65% { transform: translateY(-3px) scale(1.14); }
  100% { transform: translateY(0) scale(1); }
}

.forgetting-item {
  width: 100%;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.forgetting-item:hover {
  border-color: var(--brand-dark);
  box-shadow: 0 14px 28px rgba(16, 47, 82, .18);
}

.forgetting-item:active { transform: scale(.985); }
.forgetting-item:focus-visible { outline: 3px solid rgba(36, 79, 125, .28); outline-offset: 2px; }

.pack-refresh-button span {
  display: inline-block;
  font-size: 18px;
  transition: transform 220ms ease;
}

.pack-refresh-button:active span { transform: rotate(120deg) scale(.86); }
.pack-refresh-button.refreshing span { animation: refresh-spin 700ms linear infinite; }

@keyframes refresh-spin {
  to { transform: rotate(360deg); }
}
 
/* First-visit product introduction */
.introduction-dialog {
  width: min(92vw, 560px);
  max-height: 92dvh;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(111, 174, 211, .72);
  border-radius: 28px;
  background: linear-gradient(165deg, #ffffff 0%, #eef8fd 62%, #dceffa 100%);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(16, 47, 82, .34);
}
.introduction-dialog::backdrop { background: rgba(12, 35, 61, .62); backdrop-filter: blur(7px); }
.introduction-topbar { display:flex; align-items:center; justify-content:space-between; padding:16px 18px 10px; }
.introduction-brand { color:var(--brand-deep); font-size:13px; font-weight:900; letter-spacing:.08em; }
.introduction-close { width:34px; height:34px; display:grid; place-items:center; padding:0; border:1px solid #b8dff3; border-radius:50%; background:#dff2fc; color:var(--brand-deep); font:800 22px/1 inherit; cursor:pointer; }
.introduction-progress { height:5px; margin:0 18px; overflow:hidden; border-radius:999px; background:#cfe5f2; }
.introduction-progress span { display:block; width:12.5%; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--brand-dark),#4d9bd0); transition:width 260ms ease; }
.introduction-content { min-height:390px; display:flex; flex-direction:column; align-items:center; padding:24px 34px 12px; text-align:center; }
.introduction-visual { width:112px; height:112px; display:grid; place-items:center; margin-bottom:18px; border:1px solid rgba(111,174,211,.64); border-radius:32px; background:radial-gradient(circle at 32% 25%,#fff 0 20%,transparent 21%),linear-gradient(145deg,#dff3fd,#a9d8f1); color:var(--brand-deep); font-size:48px; box-shadow:0 16px 32px rgba(36,79,125,.16); transform:rotate(-2deg); overflow:hidden; }
.introduction-visual img { width:100%; height:100%; object-fit:cover; transform:rotate(2deg) scale(1.04); }

@media (max-width:600px) {
  .material-source-actions { grid-template-columns:minmax(0,1fr) 112px; }
  .view.active { animation:view-enter 150ms ease-out both; }
  .bottom-nav { backdrop-filter:none; background:#e1f2fd; }
  .pack-card,.today-hero,.goal-panel,.upload-panel,.settings-panel { box-shadow:0 8px 20px rgba(16,47,82,.11); }
}

/* Stable iPhone viewport: safe breathing room and no tap-induced motion. */
@media (max-width: 600px) {
  .app-shell {
    width: calc(100% - 24px);
    max-width: 436px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding-bottom: calc(108px + env(safe-area-inset-bottom));
    border-radius: 0;
  }

  .bottom-nav {
    width: calc(100% - 24px);
    max-width: 436px;
    bottom: calc(-1px * var(--keyboard-inset, 0));
    border-radius: 18px 18px 0 0;
  }

  button,
  a,
  input,
  textarea,
  select,
  [role="button"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .primary-button:active,
  .secondary-button:active,
  .pack-card:active,
  .option-button:active,
  .segmented:active,
  .icon-button:active,
  .nav-item:active span,
  .forgetting-item:active,
  .pack-refresh-button:active span {
    transform: none;
  }

  .nav-item.active span,
  .view.active {
    animation: none;
  }
}
@keyframes view-enter { from { opacity:.72; transform:translateY(3px); } to { opacity:1; transform:none; } }
.introduction-step { margin:0 0 7px; color:#3f78a5; font-size:12px; font-weight:900; letter-spacing:.08em; }
.introduction-content h2 { margin:0; color:var(--brand-deep); font-size:clamp(24px,5vw,31px); letter-spacing:-.02em; }
.introduction-description { max-width:440px; min-height:50px; margin:10px 0 14px; color:var(--muted); line-height:1.65; }
.introduction-points { width:min(100%,430px); display:grid; gap:9px; margin:0; padding:0; list-style:none; text-align:left; }
.introduction-points li { position:relative; padding:10px 13px 10px 38px; border:1px solid #c7e2f0; border-radius:14px; background:rgba(255,255,255,.76); color:var(--ink); font-size:14px; line-height:1.48; }
.introduction-points li::before { content:'✓'; position:absolute; left:13px; top:10px; color:#2876ad; font-weight:950; }
.introduction-dots { display:flex; align-items:center; justify-content:center; gap:7px; min-height:20px; padding:0 18px 12px; }
.introduction-dots button { width:7px; height:7px; padding:0; border:0; border-radius:999px; background:#a9cbdc; cursor:pointer; transition:width 180ms ease,background 180ms ease; }
.introduction-dots button.active { width:24px; background:var(--brand-deep); }
.introduction-actions { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 18px calc(18px + env(safe-area-inset-bottom)); border-top:1px solid #c4dfed; background:rgba(240,249,254,.92); }
.introduction-actions>div { display:flex; gap:9px; }
.introduction-actions .primary-button,.introduction-actions .secondary-button { width:auto; min-width:92px; min-height:42px; padding:9px 17px; }
.introduction-actions .secondary-button:disabled { opacity:.4; cursor:default; }
.introduction-skip { padding:8px 2px; border:0; background:transparent; color:var(--muted); font:800 13px/1 inherit; cursor:pointer; }
@media (max-width:600px) {
  .introduction-dialog { width:100vw; max-width:none; height:100dvh; max-height:none; border:0; border-radius:0; }
  .introduction-content { min-height:0; height:calc(100dvh - 190px); justify-content:center; padding:18px 22px 8px; overflow-y:auto; }
  .introduction-visual { width:96px; height:96px; margin-bottom:15px; border-radius:28px; font-size:42px; }
  .introduction-description { min-height:0; }
  .introduction-points { gap:7px; }
  .introduction-points li { padding-block:8px; }
  .introduction-points li::before { top:8px; }
  .introduction-actions { padding-inline:14px; }
  .introduction-actions .primary-button,.introduction-actions .secondary-button { min-width:78px; padding-inline:13px; }
}

/* Keep native date controls within the same form grid on narrow iPhones. */
.goal-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.goal-form > *, .goal-form input, .goal-form select { min-width: 0; max-width: 100%; box-sizing: border-box; }
.date-field { width: 100%; overflow: hidden; border-radius: 13px; }
.date-field input { display: block; width: 100%; min-width: 0; min-inline-size: 0; appearance: none; -webkit-appearance: none; }
.review-dialog input, .review-dialog select, .pack-goal-editor select { min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; min-height: 44px; }
.pack-goal-editor { display: grid; gap: 8px; margin: 12px 0; }
.review-occurrences { max-height: 240px; overflow: auto; }
.review-occurrences label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 12px; }
.mode-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 15px; }
.mode-spinner { width: 22px; height: 22px; border: 3px solid #bddce7; border-top-color: #245470; border-radius: 50%; animation: mode-spin .7s linear infinite; }
@keyframes mode-spin { to { transform: rotate(360deg); } }
#practiceView[aria-busy="true"] #confidenceActions, #practiceView[aria-busy="true"] .practice-actions { pointer-events: none; }
@media (max-width: 560px) { .goal-form { grid-template-columns: minmax(0, 1fr); } }
