:root {
  color-scheme: light dark;
  --canvas: #f7f5f0;
  --surface: #ffffff;
  --surface-soft: #f1eee7;
  --ink: #252b32;
  --muted: #66717d;
  --navy: #1e2c3f;
  --navy-soft: #31445c;
  --accent: #9c681c;
  --accent-soft: #f4ead8;
  --border: #dedbd4;
  --success: #28704d;
  --success-bg: #e8f1ec;
  --danger: #a54238;
  --danger-bg: #f8e9e6;
  --shadow: 0 12px 36px rgba(35, 38, 40, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--surface); padding: 12px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid #bd8735; outline-offset: 3px; }
.topbar { background: var(--navy); color: #fff; border-bottom: 1px solid rgba(255,255,255,.12); }
.topbar-inner { max-width: 1160px; min-height: 78px; margin: 0 auto; padding: 12px 28px; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-width: 194px; }
.brand-mark { width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; display: grid; place-items: center; position: relative; }
.brand-mark span { position: absolute; display: block; width: 17px; height: 2px; border-radius: 2px; background: #e3bd7a; transform-origin: left center; }
.brand-mark span:nth-child(1) { transform: rotate(-40deg) translate(-2px, -3px); }
.brand-mark span:nth-child(2) { transform: rotate(0deg) translate(-2px, 0); }
.brand-mark span:nth-child(3) { transform: rotate(40deg) translate(-2px, 3px); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: 15px; letter-spacing: .16em; }
.brand-copy small { color: rgba(255,255,255,.68); font-size: 11px; letter-spacing: .025em; margin-top: 4px; }
.demo-pill { color: #f0d7a9; border: 1px solid rgba(240,215,169,.36); border-radius: 20px; padding: 4px 9px; font-size: 10px; white-space: nowrap; }
.main-nav { display: flex; align-items: center; gap: 6px; flex: 1; }
.nav-link { min-height: 44px; border: 0; background: transparent; color: rgba(255,255,255,.75); padding: 0 13px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.12); color: #fff; }
.cart-nav { display: inline-flex; gap: 8px; align-items: center; }
.cart-count { min-width: 20px; height: 20px; border-radius: 20px; display: inline-grid; place-items: center; background: #e4bd79; color: #1e2c3f; font-size: 11px; font-weight: 700; padding: 0 5px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.user-label { max-width: 140px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: rgba(255,255,255,.77); font-size: 12px; }
.menu-toggle { display: none; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; border-radius: 8px; min-width: 44px; min-height: 44px; }
.hamburger-icon { display: block; position: relative; width: 18px; height: 2px; margin: auto; background: #fff; border-radius: 2px; }
.hamburger-icon:before, .hamburger-icon:after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: #fff; border-radius: 2px; }
.hamburger-icon:before { top: -6px; }
.hamburger-icon:after { top: 6px; }
.page-shell { max-width: 1160px; min-height: calc(100vh - 148px); margin: 0 auto; padding: 36px 28px 64px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 4px 0 24px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 8px; }
h1, h2, h3, p { margin-top: 0; }
h1 { color: var(--navy); font-size: clamp(28px, 4vw, 40px); line-height: 1.12; letter-spacing: -.035em; margin-bottom: 9px; }
h2 { color: var(--navy); font-size: 22px; line-height: 1.25; letter-spacing: -.02em; margin-bottom: 10px; }
h3 { color: var(--navy); font-size: 16px; line-height: 1.35; margin-bottom: 8px; }
.lede { color: var(--muted); max-width: 620px; margin-bottom: 0; font-size: 15px; }
.catalog-intro { background: linear-gradient(112deg, var(--navy) 0%, #273b54 62%, #36495a 100%); color: white; padding: 28px 32px; border-radius: 14px; display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; overflow: hidden; position: relative; }
.catalog-intro:after { content: ""; position: absolute; right: -40px; top: -86px; width: 280px; height: 280px; border: 1px solid rgba(238,204,143,.18); border-radius: 50%; box-shadow: 0 0 0 24px rgba(238,204,143,.035), 0 0 0 52px rgba(238,204,143,.025); pointer-events: none; }
.catalog-intro h1 { color: white; margin-bottom: 9px; font-size: clamp(27px, 3vw, 36px); }
.catalog-intro p { max-width: 570px; margin-bottom: 0; color: rgba(255,255,255,.75); font-size: 14px; }
.intro-note { z-index: 1; flex: 0 0 175px; border-left: 1px solid rgba(255,255,255,.25); padding-left: 20px; color: #efd29a; font-size: 13px; }
.intro-note strong { display: block; color: #fff; font-size: 23px; line-height: 1.1; margin-bottom: 6px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 22px; }
.input-wrap { position: relative; flex: 1 1 280px; }
.input-wrap .search-icon { position: absolute; left: 16px; top: 14px; width: 14px; height: 14px; border: 1.7px solid var(--muted); border-radius: 50%; }
.input-wrap .search-icon:after { content: ""; position: absolute; width: 6px; height: 1.7px; background: var(--muted); right: -5px; bottom: -2px; transform: rotate(45deg); border-radius: 2px; }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); background: var(--surface); }
.input-wrap input { padding-left: 42px; }
select { min-width: 210px; }
input::placeholder, textarea::placeholder { color: #8a9298; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 46px; border: 1px solid transparent; border-radius: 8px; background: var(--navy); color: #fff; padding: 10px 16px; font-size: 14px; font-weight: 650; cursor: pointer; text-decoration: none; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover { background: #293c54; transform: translateY(-1px); }
.button-small { min-height: 38px; padding: 7px 12px; font-size: 13px; }
.button-outline { background: transparent; color: white; border-color: rgba(255,255,255,.38); }
.button-outline:hover { background: rgba(255,255,255,.1); }
.button-quiet { background: transparent; color: white; border-color: transparent; }
.button-quiet:hover { background: rgba(255,255,255,.1); }
.button-accent { background: var(--accent); color: #fff; }
.button-accent:hover { background: #805314; }
.button-secondary { background: var(--surface); color: var(--navy); border-color: var(--border); }
.button-secondary:hover { background: var(--surface-soft); }
.button-danger { background: var(--danger-bg); color: var(--danger); border-color: #eed0cc; }
.button-danger:hover { background: #f3d9d5; }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.course-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(35,38,40,.03); display: flex; flex-direction: column; min-height: 220px; }
.course-card:hover { border-color: #c6ad84; box-shadow: var(--shadow); }
.course-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.tag { display: inline-flex; align-items: center; min-height: 25px; border-radius: 20px; background: var(--accent-soft); color: #79551c; font-size: 11px; font-weight: 700; padding: 3px 9px; }
.course-card h2 { font-size: 18px; margin: 0; }
.course-card .course-description { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 10px 0 16px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.card-meta span { display: inline-flex; gap: 5px; align-items: center; }
.card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; }
.price { color: var(--navy); font-size: 19px; font-weight: 750; white-space: nowrap; }
.price small { color: var(--muted); font-size: 11px; font-weight: 500; }
.empty-state { text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; padding: 42px 22px; color: var(--muted); }
.empty-state strong { display: block; color: var(--navy); font-size: 17px; margin-bottom: 7px; }
.notice { padding: 12px 16px; border-radius: 8px; margin: 0 0 18px; font-size: 14px; }
.notice.success { background: var(--success-bg); color: var(--success); }
.notice.error { background: var(--danger-bg); color: var(--danger); }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 12px; }
.footer-inner { max-width: 1160px; padding: 16px 28px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; }
.footer-dot { color: var(--accent); padding: 0 4px; }
.course-dialog { max-width: 700px; width: calc(100% - 32px); max-height: min(88vh, 820px); padding: 0; border: 1px solid var(--border); border-radius: 14px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.course-dialog::backdrop { background: rgba(15,22,31,.64); }
.dialog-content { padding: 28px; }
.dialog-close { float: right; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); width: 42px; height: 42px; cursor: pointer; font-size: 18px; }
.dialog-desc { color: var(--muted); line-height: 1.7; margin: 15px 0 20px; }
.variant-list { display: grid; gap: 10px; }
.variant-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 9px; }
.variant-info strong { display: block; color: var(--navy); font-size: 14px; }
.variant-info small { color: var(--muted); font-size: 12px; }
.auth-card, .panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 26px; box-shadow: 0 2px 8px rgba(35,38,40,.03); }
.auth-card { max-width: 560px; margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--navy); font-size: 12px; font-weight: 700; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.form-note { color: var(--muted); font-size: 12px; margin: 14px 0 0; }
.segmented { display: inline-flex; padding: 4px; border-radius: 9px; background: var(--surface-soft); margin-bottom: 18px; }
.segmented button { min-height: 38px; padding: 6px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 700; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(270px, .75fr); gap: 18px; align-items: start; }
.cart-list { display: grid; gap: 12px; }
.cart-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 17px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.cart-item p { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.cart-item-actions { display: flex; align-items: center; gap: 8px; }
.qty-control { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty-control button { border: 0; width: 38px; min-height: 40px; background: var(--surface-soft); cursor: pointer; }
.qty-control span { min-width: 34px; text-align: center; font-size: 13px; }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; position: sticky; top: 18px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--border); }
.summary-row.total { color: var(--navy); font-size: 17px; font-weight: 750; border-bottom: 0; padding-top: 15px; }
.summary-card .button { width: 100%; margin-top: 14px; }
.discount-chip { display: inline-flex; border-radius: 20px; background: var(--success-bg); color: var(--success); padding: 4px 9px; font-size: 11px; font-weight: 700; }
.order-list { display: grid; gap: 12px; }
.order-card { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 17px; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.order-lines { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.status { display: inline-flex; align-items: center; min-height: 26px; border-radius: 20px; padding: 3px 10px; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 700; }
.status.paid, .status.completed { background: var(--success-bg); color: var(--success); }
.status.cancelled { background: var(--danger-bg); color: var(--danger); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.metric { padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; color: var(--navy); font-size: 24px; margin-top: 4px; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 680px; font-size: 13px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--navy); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; background: var(--surface-soft); }
tr:last-child td { border-bottom: 0; }
td select { min-width: 130px; min-height: 38px; padding: 6px 9px; font-size: 12px; }
.admin-section { margin-top: 24px; }
.admin-section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.admin-section-head h2 { margin: 0; }
.pill-note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 14px; color: #6d542a; border-radius: 0 8px 8px 0; font-size: 12px; }
.loading { padding: 44px 12px; text-align: center; color: var(--muted); }
.error-box { padding: 16px; background: var(--danger-bg); color: var(--danger); border-radius: 8px; }
@media (max-width: 900px) {
  .topbar-inner { gap: 16px; padding-inline: 20px; }
  .brand { min-width: 165px; }
  .user-label { display: none; }
  .page-shell { padding: 28px 20px 48px; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .topbar-inner { min-height: 68px; padding: 10px 16px; gap: 10px; position: relative; }
  .brand { min-width: auto; flex: 1; }
  .demo-pill { display: none; }
  .brand-mark { width: 32px; height: 32px; }
  .menu-toggle { display: inline-grid; place-items: center; order: 3; }
  .top-actions { gap: 6px; }
  .top-actions .button { min-height: 38px; padding: 6px 9px; }
  .main-nav { display: none; position: absolute; z-index: 10; top: calc(100% + 4px); left: 12px; right: 12px; padding: 8px; border: 1px solid rgba(255,255,255,.15); border-radius: 10px; background: var(--navy); box-shadow: var(--shadow); flex-direction: column; align-items: stretch; }
  .main-nav.open { display: flex; }
  .nav-link { text-align: left; }
  .page-shell { padding: 22px 16px 42px; }
  .catalog-intro { padding: 23px 20px; align-items: flex-start; }
  .catalog-intro:after { right: -118px; }
  .intro-note { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .filter-bar { display: grid; grid-template-columns: 1fr; }
  .filter-bar select { width: 100%; }
  .course-grid { grid-template-columns: 1fr; }
  .course-card { min-height: unset; padding: 18px; }
  .course-card h2 { font-size: 17px; }
  .card-bottom { align-items: flex-end; }
  .footer-inner { padding: 15px 16px; flex-direction: column; gap: 4px; }
  .content-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .dialog-content { padding: 22px 18px; }
  .variant-row { align-items: flex-start; flex-direction: column; }
  .variant-row .button { width: 100%; }
  .cart-item { grid-template-columns: 1fr; }
  .cart-item-actions { justify-content: space-between; }
  .metrics { gap: 8px; }
  .metric { padding: 13px; }
  .metric strong { font-size: 21px; }
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #191919; --surface: #202020; --surface-soft: #2b2b29; --ink: #f2f2ef;
    --muted: #b0b0a9; --navy: #e3ebf5; --navy-soft: #d4dfeb; --accent: #eac26b;
    --accent-soft: #382f20; --border: rgba(255,255,255,.18); --success: #9bd1b1;
    --success-bg: #20352a; --danger: #ffaaa0; --danger-bg: #3a2724; --shadow: 0 12px 36px rgba(0,0,0,.28);
  }
  .topbar { background: #202020; }
  .catalog-intro { background: linear-gradient(112deg, #202020 0%, #28303a 64%, #35312b 100%); }
  .catalog-intro h1 { color: #fff; }
  .catalog-intro p { color: rgba(255,255,255,.76); }
  .price, h1, h2, h3, .course-card h2, .variant-info strong, .metric strong, .order-head strong { color: var(--navy); }
  .brand-copy strong, .topbar .button-outline { color: #fff; }
  .button { background: #35577f; }
  .button:hover { background: #456b94; }
  .button-accent { background: #805f28; }
  .button-accent:hover { background: #987332; }
  .tag { color: #efd29a; }
  .pill-note { color: #efd29a; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
