:root {
  color-scheme: light;
  --bg: #fbf8f1;
  --surface: #ffffff;
  --surface-soft: #f5efe3;
  --text: #312b25;
  --muted: #786f65;
  --line: #e7ded1;
  --brand: #766246;
  --brand-dark: #58472f;
  --success: #397253;
  --danger: #a3423c;
  --shadow: 0 12px 36px rgba(70, 56, 38, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
button, input, textarea, select { font: inherit; }
a { color: inherit; }
button, .button { min-height: 46px; }

.migration-bar { display: none !important; }

.funnel-page {
  width: 100%;
  overflow-x: hidden;
  background: #fff;
}

.funnel-section {
  width: 100%;
}

.funnel-row {
  width: min(100%, 680px) !important;
  max-width: 100%;
  margin-right: auto;
  margin-left: auto;
}

.funnel-col {
  min-width: 0;
  max-width: 100%;
}

.funnel-image {
  max-width: 100%;
  margin: 0;
}

.funnel-image img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin-right: auto;
  margin-left: auto;
}

.vimeo-embed-section {
  width: 100%;
  max-width: 680px;
  margin-right: auto;
  margin-left: auto;
}

.vimeo-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.vimeo-embed iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.site-shell { min-height: 100vh; padding-left: 248px; }
.site-header { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 248px; border-right: 1px solid var(--line); background: rgba(251,248,241,.98); backdrop-filter: blur(12px); }
.header-inner { width: 100%; min-height: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 22px; padding: 30px 18px 24px; overflow-y: auto; }
.brand { padding: 0 10px 22px; border-bottom: 1px solid var(--line); font-size: 1.12rem; font-weight: 800; text-decoration: none; letter-spacing: .02em; }
.header-actions { display: flex; min-height: 0; flex: 1; flex-direction: column; align-items: stretch; gap: 5px; }
.header-actions .badge { align-self: flex-start; margin: 0 10px 8px; }
.header-actions a { display: flex; align-items: center; min-height: 46px; border-radius: 12px; padding: 10px 13px; text-decoration: none; color: var(--muted); font-weight: 700; }
.header-actions a:hover, .header-actions a[aria-current="page"] { background: var(--surface-soft); color: var(--brand-dark); }
.header-actions a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--brand); }
.header-actions .link-button { margin-top: auto; min-height: 46px; border-radius: 12px; padding: 10px 13px; text-align: left; }
.mobile-menu-toggle, .mobile-menu-scrim { display: none; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 64px; }
.narrow { width: min(560px, calc(100% - 32px)); }

h1, h2, h3 { line-height: 1.35; margin: 0; }
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 4vw, 1.75rem); }
h3 { font-size: 1.08rem; }
p { line-height: 1.75; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-weight: 800; font-size: .84rem; letter-spacing: .08em; text-transform: uppercase; }
.lead { margin: 12px 0 0; color: var(--muted); font-size: 1.04rem; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-heading { margin: 34px 0 16px; }

.card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.course-card { overflow: hidden; padding: 0; }
.course-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: var(--surface-soft); }
.course-thumb.empty { display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.course-body { padding: 20px; }
.course-body .button { width: 100%; margin-top: 14px; }
.planner-entry-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; border-color: #e4d8ee; background: linear-gradient(135deg, #fff7c7, #ffe0ed 48%, #e2e2ff); }
.planner-entry-card p { margin-bottom: 0; }
.planner-entry-card .button { flex: 0 0 auto; background: linear-gradient(135deg, #6358c4, #e36fa4); }
.palm-report-link-grid { align-items: stretch; }
.palm-report-link-card { display: flex; min-height: 280px; flex-direction: column; justify-content: space-between; gap: 22px; }
.palm-report-link-card p:last-child { margin-bottom: 0; }
.palm-report-link-card .button { align-self: flex-start; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 10px 18px; background: var(--brand); color: white; font-weight: 800; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--brand-dark); }
.button.secondary { background: var(--surface); border-color: var(--line); color: var(--text); }
.button.danger { background: var(--danger); }
.button.small { min-height: 38px; padding: 7px 12px; font-size: .9rem; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.link-button { border: 0; background: transparent; color: var(--brand); font-weight: 800; cursor: pointer; padding: 8px; }

.form-grid { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-weight: 800; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #d7cbbb; border-radius: 11px; background: white; color: var(--text); padding: 12px 13px; min-height: 46px; }
.field textarea { min-height: 110px; resize: vertical; }
.field textarea.code-textarea { min-height: 380px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 3px solid rgba(118,98,70,.18); border-color: var(--brand); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.notice { margin: 16px 0; border-radius: 12px; padding: 13px 15px; background: #edf6ef; color: #28563d; }
.notice.error { background: #fff0ef; color: #8a302b; }
.empty-state { text-align: center; padding: 44px 22px; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: .82rem; font-weight: 800; }
.badge.success { background: #e8f4ec; color: var(--success); }
.badge.danger { background: #fae9e8; color: var(--danger); }
.badge.current { background: #eee7da; color: var(--brand-dark); }

.progress { height: 12px; border-radius: 999px; overflow: hidden; background: #ece5da; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.progress.compact { height: 14px; background: #edeff4; }
.progress.compact > span { background: #2f80ed; }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--muted); font-size: .9rem; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.stat strong { display: block; margin-top: 6px; font-size: 1.8rem; }

.course-learning-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.course-sidebar { position: sticky; top: 92px; border: 1px solid var(--line); background: #f8f9fb; }
.course-sidebar h1 { padding: 20px 18px 14px; font-size: 1rem; line-height: 1.55; background: #fff; border-bottom: 1px solid var(--line); }
.course-sidebar-thumb { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #eee; }
.course-sidebar-thumb.placeholder { display: grid; place-items: center; color: var(--muted); font-weight: 800; background: linear-gradient(135deg, #fff8df, #efe2bf); min-height: 150px; }
.course-sidebar .progress { width: calc(100% - 32px); margin: 24px auto 8px; }
.course-progress-percent { margin: 0 0 24px; text-align: center; font-weight: 800; color: #20242a; }
.course-back-link { display: block; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; text-decoration: none; font-weight: 800; background: #fff; }
.course-back-link:hover { color: var(--brand-dark); }
.course-main { min-width: 0; }
.course-breadcrumb { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; color: #6f7784; font-size: .94rem; }
.course-breadcrumb a { color: #2878d8; text-decoration: none; }
.course-breadcrumb a::after { content: "/"; margin-left: 10px; color: #b5bdc8; }
.course-description { margin: 0 0 18px; padding: 16px 18px; border: 1px solid var(--line); background: #fff; color: var(--muted); }
.utage-section { margin-bottom: 24px; border: 1px solid #dfe4ea; background: #fff; }
.utage-section-title { padding: 13px 18px; border-bottom: 1px solid #dfe4ea; background: #f8f9fb; color: #2878a7; font-weight: 800; }
.utage-lesson-list { list-style: none; margin: 0; padding: 16px 20px; }
.utage-lesson-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 54px; padding: 10px 0; border-bottom: 1px solid #edf0f3; }
.utage-lesson-row:last-child { border-bottom: 0; }
.lesson-status-dot { width: 17px; height: 17px; border: 1.5px solid #45515f; border-radius: 50%; background: #fff; }
.utage-lesson-row.completed .lesson-status-dot { border-color: var(--success); background: var(--success); box-shadow: inset 0 0 0 3px #fff; }
.utage-lesson-row.current .lesson-status-dot { border-color: #2f80ed; background: #2f80ed; box-shadow: inset 0 0 0 3px #fff; }
.utage-lesson-title { display: grid; gap: 3px; color: #374151; text-decoration: none; line-height: 1.55; }
.utage-lesson-title:hover { color: #1f6fbd; }
.utage-lesson-title small { color: var(--muted); }
.utage-lesson-button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 6px 14px; border-radius: 4px; background: #2f80ed; color: #fff; font-weight: 800; text-decoration: none; white-space: nowrap; }
.utage-lesson-button:hover { background: #1f6fbd; }
.utage-empty { padding: 22px; text-align: center; }

.section-card { padding: 0; overflow: hidden; }
.section-title { padding: 18px 20px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line); text-decoration: none; }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row:hover { background: #fcfaf6; }

.video-wrap { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: 16px; background: #201e1b; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-stack { display: grid; gap: 20px; }
.lesson-content-card { display: grid; gap: 18px; }
.lesson-content-card-without-video { margin-top: 0; }
.formatted-text { display: grid; gap: 0.7em; line-height: 1.85; overflow-wrap: anywhere; }
.formatted-text.compact { gap: 0.45em; line-height: 1.75; }
.formatted-text p { margin: 0; }
.lesson-content { display: block; color: #3f3932; line-height: 2.05; overflow-wrap: anywhere; font-size: 1.04rem; }
.lesson-content p { margin: 0 0 2.15rem; }
.lesson-content p:last-child { margin-bottom: 0; }
.lesson-content a { color: #2878d8; font-weight: 700; }
.lesson-line { display: block; margin: 0; line-height: 2.02; }
.lesson-line:last-child { margin-bottom: 0; }
.lesson-rich-content h2, .lesson-rich-content h3, .lesson-rich-content h4 { margin: 1.8rem 0 1rem; line-height: 1.55; }
.lesson-rich-content h2:first-child, .lesson-rich-content h3:first-child, .lesson-rich-content h4:first-child { margin-top: 0; }
.lesson-rich-content hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.lesson-rich-content ul, .lesson-rich-content ol { margin: 0 0 1.5rem 1.4rem; padding: 0; }
.lesson-rich-content li { margin: 0 0 .55rem; }
.lesson-rich-content strong, .lesson-rich-content b { font-weight: 800; }
.migration-video-note { display: block; border: 1px solid #cfe0f7; border-radius: 12px; background: #f3f8ff; color: #235b9a; padding: 12px 14px; font-weight: 800; }
.migration-video-note small { display: block; margin-top: 4px; color: #5e7188; font-weight: 600; line-height: 1.55; }
.lesson-materials { display: grid; gap: 14px; padding-top: 4px; }
.lesson-materials h2 { margin: 0; font-size: 1.05rem; }
.lesson-material-image { margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.lesson-material-image img { display: block; width: 100%; height: auto; }
.lesson-material-image figcaption { padding: 10px 12px; color: var(--muted); font-size: .9rem; background: #fafafa; }
.material-button-list { display: flex; flex-wrap: wrap; gap: 10px; }
.lesson-nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 22px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .86rem; }
.student-list-card { padding: 0; overflow: hidden; }
.student-search-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: #fffdf8; }
.student-search-fields { display: grid; grid-template-columns: minmax(260px, 1.25fr) repeat(2, minmax(190px, .85fr)); align-items: end; gap: 12px; }
.student-search-field { min-width: 0; }
.student-search-toolbar .button { margin-bottom: 1px; }
.student-search-toolbar .button[hidden] { display: none; }
.student-search-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; }
.student-search-actions .button[hidden] + p { margin-left: auto; }
.student-search-toolbar p { margin: 0; white-space: nowrap; }
.student-priority-badge { margin-top: 8px; background: #eee7da; color: var(--brand-dark); }
.student-list-card .table-wrap { padding: 0 10px 10px; }
.qualification-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.training-management-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.training-management-group { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fffdf8; }
.training-management-group h2 { margin: 0 0 12px; font-size: 16px; }
.training-management-group .qualification-tabs { margin-bottom: 0; }
.qualification-roster-card { display: grid; gap: 18px; padding: 0; overflow: hidden; }
.qualification-roster-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: end; gap: 14px; padding: 20px; border-bottom: 1px solid var(--line); background: #fffdf8; }
.qualification-roster-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.qualification-roster-toolbar p { grid-column: 1 / -1; margin: 0; }
.qualification-roster-card .table-wrap { padding: 0 12px; }
.qualification-roster-table { min-width: 560px; }
.qualification-student-check { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 10px; cursor: pointer; }
.qualification-student-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); }
.qualification-student-check span { display: grid; gap: 2px; }
.qualification-student-check small { color: var(--muted); font-weight: 500; }
.qualification-roster-save { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px 20px; }
.qualification-roster-save p { margin: 0; }
.student-training-status-form { display: grid; gap: 20px; }
.student-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.student-status-group { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fffdf8; }
.student-status-group h3 { margin-bottom: 14px; }
.student-status-checklist { display: grid; gap: 10px; }
.student-status-check { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 10px; border-radius: 10px; padding: 10px; cursor: pointer; }
.student-status-check:hover { background: var(--surface-soft); }
.student-status-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); }
.student-status-check span { line-height: 1.55; font-weight: 700; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-nav { display: flex; gap: 8px; margin: 0 0 24px; flex-wrap: wrap; }
.admin-nav a { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; text-decoration: none; font-weight: 700; }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 20px; align-items: start; }
.funnel-admin-card { display: grid; gap: 14px; }
.funnel-admin-card p { margin: 0; }
.funnel-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.funnel-card-metrics { display: flex; flex-wrap: wrap; gap: 10px; }
.funnel-card-metrics span { border-radius: 10px; padding: 8px 10px; background: var(--surface-soft); color: var(--muted); font-size: .86rem; }
.funnel-card-metrics b { color: var(--text); }
.funnel-form-group { display: grid; gap: 16px; border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #fcfaf6; }
.funnel-form-group .eyebrow { margin-bottom: 4px; }
.field textarea.funnel-body-field { min-height: 320px; line-height: 1.8; }
.admin-group-list { display: grid; gap: 18px; }
.admin-group { display: grid; gap: 14px; }
.admin-group-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.admin-group-header h2 { margin: 0; }
.admin-item-list { display: grid; gap: 12px; }
.admin-list-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, auto); gap: 16px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fffdf8; }
.admin-list-main { display: grid; gap: 8px; min-width: 0; }
.admin-list-main h3 { margin: 0; line-height: 1.45; }
.admin-list-side { display: grid; gap: 10px; justify-items: end; }
.sort-controls { display: inline-flex; gap: 6px; }
.button.tiny { min-height: 30px; padding: 4px 10px; border-radius: 9px; font-size: .9rem; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.review-toolbar { display: grid; gap: 16px; }
.review-course-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.review-course-form label { display: grid; gap: 6px; font-weight: 800; }
.review-course-form select { min-width: min(100%, 520px); padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; }
.review-summary { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); }
.review-list { display: grid; gap: 18px; margin-top: 18px; }
.review-card summary { cursor: pointer; display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.review-card summary small { display: block; margin-top: 4px; color: var(--muted); font-weight: 600; }
.review-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.review-columns h3 { margin: 0 0 12px; font-size: 1rem; }
.review-preview { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #fffdf8; }
.review-source { white-space: pre-wrap; overflow: auto; max-height: 520px; border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #f7f3ea; line-height: 1.8; font: inherit; margin: 0; }
.review-issues { border: 1px solid #f2b8b5; background: #fff2f0; color: #8a2a24; border-radius: 14px; padding: 12px 14px; margin-top: 14px; }
.review-issues p { margin: 0 0 8px; }
.review-issues p:last-child { margin-bottom: 0; }

@media (max-width: 760px) {
  body.menu-open { overflow: hidden; }
  .site-shell { padding: 58px 0 0; }
  .site-header { width: min(84vw, 300px); border-right: 1px solid var(--line); box-shadow: 18px 0 42px rgba(49,43,37,.18); transform: translateX(-105%); transition: transform .22s ease; }
  .site-shell.menu-open .site-header { transform: translateX(0); }
  .student-search-toolbar, .student-search-fields { grid-template-columns: 1fr; }
  .student-search-actions { align-items: flex-start; flex-direction: column; }
  .training-management-groups { grid-template-columns: 1fr; }
  .qualification-roster-toolbar { grid-template-columns: 1fr; }
  .qualification-roster-save { align-items: stretch; flex-direction: column; }
  .student-status-grid { grid-template-columns: 1fr; }
  .header-inner { min-height: 100%; gap: 20px; padding: 76px 18px 24px; }
  .brand { padding-bottom: 18px; }
  .header-actions a:not(.keep-mobile) { display: flex; }
  .mobile-menu-toggle { position: fixed; top: 10px; left: 12px; z-index: 50; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 13px; background: var(--surface); color: var(--text); font-weight: 800; box-shadow: 0 6px 20px rgba(49,43,37,.1); cursor: pointer; }
  .mobile-menu-scrim { position: fixed; inset: 0; z-index: 25; width: 100%; height: 100%; border: 0; background: rgba(49,43,37,.35); cursor: pointer; }
  .site-shell.menu-open .mobile-menu-scrim { display: block; }
  .container, .narrow { width: min(100% - 24px, 1120px); padding-top: 24px; }
  .planner-entry-card { align-items: flex-start; flex-direction: column; }
  .grid.two, .grid.three, .stats, .split { grid-template-columns: 1fr; }
  .review-columns { grid-template-columns: 1fr; }
  .admin-list-item { grid-template-columns: 1fr; }
  .admin-list-side { justify-items: start; }
  .course-learning-layout { grid-template-columns: 1fr; gap: 18px; }
  .course-sidebar { position: static; }
  .utage-lesson-list { padding: 8px 12px; }
  .utage-lesson-row { grid-template-columns: 22px minmax(0, 1fr); gap: 10px; }
  .utage-lesson-button { grid-column: 2; justify-self: start; margin-top: 4px; }
  .page-heading { align-items: start; flex-direction: column; }
  .card { border-radius: 15px; padding: 18px; }
  .lesson-row { align-items: flex-start; padding: 14px 16px; }
  .lesson-nav { grid-template-columns: 1fr; }
  h1 { font-size: 1.7rem; }
}
.numerology-entry-card {
  border-color: rgba(168, 85, 247, 0.24);
  background:
    radial-gradient(circle at top right, rgba(236, 72, 153, 0.11), transparent 38%),
    radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.1), transparent 42%),
    var(--surface);
}

.maya-calendar-entry-card {
  border-color: rgba(124, 92, 191, 0.3);
  background:
    radial-gradient(circle at top right, rgba(196, 111, 212, 0.13), transparent 38%),
    radial-gradient(circle at bottom left, rgba(240, 192, 96, 0.1), transparent 42%),
    var(--surface);
}

.kyusei-entry-card {
  border-color: rgba(176, 111, 216, 0.3);
  background:
    radial-gradient(circle at top right, rgba(232, 111, 168, 0.12), transparent 38%),
    radial-gradient(circle at bottom left, rgba(111, 157, 232, 0.11), transparent 42%),
    var(--surface);
}

.fortune-calculators-entry-card,
.astrology-entry-card {
  border-color: rgba(63, 81, 181, 0.28);
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.13), transparent 38%),
    radial-gradient(circle at bottom left, rgba(245, 158, 11, 0.1), transparent 42%),
    var(--surface);
}

.seimei-handan-entry-card {
  border-color: rgba(79, 70, 229, 0.28);
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.12), transparent 38%),
    radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.1), transparent 42%),
    var(--surface);
}

.ziwei-doushu-entry-card {
  border-color: rgba(139, 90, 60, 0.32);
  background:
    radial-gradient(circle at top right, rgba(212, 128, 26, 0.13), transparent 38%),
    radial-gradient(circle at bottom left, rgba(139, 26, 26, 0.09), transparent 42%),
    var(--surface);
}

.shichu-suimei-entry-card {
  border-color: rgba(92, 107, 79, 0.34);
  background:
    radial-gradient(circle at top right, rgba(138, 154, 91, 0.14), transparent 38%),
    radial-gradient(circle at bottom left, rgba(180, 118, 64, 0.09), transparent 42%),
    var(--surface);
}

.qimen-dunjia-entry-card {
  border-color: rgba(68, 113, 80, 0.3);
  background: linear-gradient(145deg, rgba(241, 248, 239, 0.98), rgba(255, 252, 241, 0.98));
}

.qimen-dunjia-page-heading { align-items: flex-start; }

.qimen-dunjia-app-shell {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.qimen-dunjia-app-frame {
  display: block;
  width: 100%;
  min-height: 2200px;
  border: 0;
  background: #fff;
}

@media (max-width: 720px) {
  .qimen-dunjia-app-shell { border-radius: 14px; }
  .qimen-dunjia-app-frame { min-height: 2800px; }
}

.fortune-calculators-page-heading,
.astrology-page-heading {
  margin-bottom: 18px;
}

.seimei-handan-page-heading {
  margin-bottom: 18px;
}

.ziwei-doushu-page-heading {
  margin-bottom: 18px;
}

.shichu-suimei-page-heading {
  margin-bottom: 18px;
}

.fortune-calculator-grid {
  align-items: stretch;
}

.fortune-calculator-card {
  display: flex;
  flex-direction: column;
}

.fortune-calculator-card .button {
  align-self: flex-start;
  margin-top: auto;
}

.numerology-page-heading {
  margin-bottom: 18px;
}

.maya-calendar-page-heading {
  margin-bottom: 18px;
}

.kyusei-page-heading {
  margin-bottom: 18px;
}

.numerology-app-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.maya-calendar-app-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #0d0d1a;
  box-shadow: var(--shadow);
}

.kyusei-app-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fdf6ff;
  box-shadow: var(--shadow);
}

.astrology-app-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #f7f3ea;
  box-shadow: var(--shadow);
}

.seimei-handan-app-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #eef2ff;
  box-shadow: var(--shadow);
}

.ziwei-doushu-app-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #f5f1e8;
  box-shadow: var(--shadow);
}

.shichu-suimei-app-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #f8f5ec;
  box-shadow: var(--shadow);
}

.numerology-app-frame {
  display: block;
  width: 100%;
  height: max(78vh, 900px);
  border: 0;
  background: #fff;
}

.maya-calendar-app-frame {
  display: block;
  width: 100%;
  height: max(82vh, 920px);
  border: 0;
  background: #0d0d1a;
}

.kyusei-app-frame {
  display: block;
  width: 100%;
  height: max(82vh, 980px);
  border: 0;
  background: #fdf6ff;
}

.astrology-app-frame {
  display: block;
  width: 100%;
  height: max(86vh, 980px);
  border: 0;
  background: #f7f3ea;
}

.seimei-handan-app-frame {
  display: block;
  width: 100%;
  height: max(82vh, 1080px);
  border: 0;
  background: #eef2ff;
}

.ziwei-doushu-app-frame {
  display: block;
  width: 100%;
  height: max(88vh, 1180px);
  border: 0;
  background: #f5f1e8;
}

.shichu-suimei-app-frame {
  display: block;
  width: 100%;
  height: max(92vh, 1400px);
  border: 0;
  background: #f8f5ec;
}

@media (max-width: 720px) {
  .numerology-app-shell {
    margin-inline: -10px;
    border-radius: 18px;
  }

  .maya-calendar-app-shell {
    margin-inline: -10px;
    border-radius: 18px;
  }

  .kyusei-app-shell {
    margin-inline: -10px;
    border-radius: 18px;
  }

  .astrology-app-shell {
    margin-inline: -10px;
    border-radius: 18px;
  }

  .seimei-handan-app-shell {
    margin-inline: -10px;
    border-radius: 18px;
  }

  .ziwei-doushu-app-shell {
    margin-inline: -10px;
    border-radius: 18px;
  }

  .shichu-suimei-app-shell {
    margin-inline: -10px;
    border-radius: 18px;
  }

  .numerology-app-frame {
    height: 86vh;
    min-height: 720px;
  }


  .maya-calendar-app-frame {
    height: 88vh;
    min-height: 760px;
  }

  .kyusei-app-frame {
    height: 88vh;
    min-height: 780px;
  }


  .astrology-app-frame {
    height: 90vh;
    min-height: 780px;
  }


  .seimei-handan-app-frame {
    height: 88vh;
    min-height: 920px;
  }


  .ziwei-doushu-app-frame {
    height: 92vh;
    min-height: 980px;
  }


  .shichu-suimei-app-frame {
    height: 94vh;
    min-height: 1200px;
  }
}
