/* Storefront — paper, ink and one highlighter.
   The accent (admin-configurable, --mark) is used like a highlighter pen: only behind prices and offers. */
:root {
  --paper: #fbfbf8;
  --surface: #ffffff;
  --ink: #172440;
  --ink-2: #4a5570;
  --ink-3: #737c91;
  --rule: #e3e4de;
  --rule-2: #cfd1c8;
  --mark: #f1d74a;
  --ok: #1f7a4d;
  --warn: #8a5a00;
  --bad: #b42318;
  --tint: #f3f4ef;
  --radius: 10px;
  --radius-lg: 14px;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --wrap: 1120px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
h2 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.tiny { font-size: .8rem; color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; vertical-align: middle; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Strip banner & header ---------- */
.strip { background: var(--ink); color: #fff; font-size: .875rem; text-align: center; padding: 7px 16px; }
.strip a { color: #fff; font-weight: 600; margin-left: 6px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; text-decoration: none; white-space: nowrap; }
.finder { position: relative; flex: 1; max-width: 440px; }
.finder input { width: 100%; height: 40px; border: 1px solid var(--rule-2); border-radius: 999px; padding: 0 14px 0 38px; font: inherit; font-size: .95rem; background: var(--paper); color: var(--ink); }
.finder input:focus { outline: none; border-color: var(--ink); background: var(--surface); }
.finder > .icon { position: absolute; left: 13px; top: 10px; color: var(--ink-3); pointer-events: none; }
.finder-list { position: absolute; left: 0; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(23,36,64,.12); max-height: 60vh; overflow: auto; padding: 6px; margin: 0; list-style: none; display: none; }
.finder-list.open { display: block; }
.finder-list a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; }
.finder-list a[aria-selected="true"], .finder-list a:hover { background: var(--tint); }
.finder-list .ctx { display: block; font-size: .8rem; color: var(--ink-3); }
.finder-list .empty { padding: 10px; color: var(--ink-2); font-size: .9rem; }
.nav { display: flex; gap: 18px; align-items: center; margin-left: auto; font-size: .93rem; }
.nav a { text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav .cart { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.nav .count { background: var(--ink); color: #fff; border-radius: 999px; font-size: .72rem; padding: 1px 6px; font-weight: 600; }
.nav-links { display: flex; gap: 18px; }
@media (max-width: 760px) {
  .site-header .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .finder { order: 3; flex-basis: 100%; max-width: none; }
  .nav-links { display: none; }
  .nav { gap: 14px; }
}

/* ---------- Buttons, badges, price ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: 600 .95rem/1 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: #22325a; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn-ghost:hover { background: var(--tint); border-color: var(--ink-3); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .88rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { background: var(--tint); border-color: var(--rule); color: var(--ink-3); cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; cursor: pointer; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--rule-2); color: var(--ink-2); background: var(--surface); white-space: nowrap; }
.badge-offer { background: var(--mark); border-color: transparent; color: var(--ink); }
.badge-soon { color: var(--warn); border-color: #e9d6ac; background: #fdf7e8; }
.badge-ok { color: var(--ok); border-color: #b9dcc8; background: #eef7f1; }
.badge-off { color: var(--bad); border-color: #f1c3be; background: #fdf1f0; }
.price { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price .now { font-weight: 700; font-size: 1.1rem; padding: 0 3px; background: linear-gradient(transparent 52%, var(--mark) 52%, var(--mark) 92%, transparent 92%); }
.price .was { color: var(--ink-3); text-decoration: line-through; font-size: .9rem; }
.price-lg .now { font-family: var(--serif); font-size: 2rem; font-weight: 700; }

/* ---------- Page scaffolding ---------- */
main { padding-bottom: 56px; }
.crumbs { font-size: .85rem; color: var(--ink-3); padding: 16px 0 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs .icon { color: var(--rule-2); }
.page-head { padding: 4px 0 18px; }
.page-head p { color: var(--ink-2); max-width: 64ch; margin: 0; }
.section { margin-top: 44px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 2px 0 0; color: var(--ink-2); font-size: .95rem; }
.notice { border: 1px solid var(--rule); background: var(--surface); border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.notice-warn { background: #fdf7e8; border-color: #ecdcb3; }
.notice-bad { background: #fdf1f0; border-color: #f1c3be; }
.notice-ok { background: #eef7f1; border-color: #b9dcc8; }
.stack > * + * { margin-top: 10px; }

/* ---------- Home ---------- */
.hero { padding: 40px 0 8px; display: grid; gap: 28px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: end; }
.hero h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); max-width: 18ch; }
.hero p { color: var(--ink-2); font-size: 1.08rem; max-width: 48ch; }
.hero-find { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 18px; }
.hero-find label { display: block; font-weight: 600; margin-bottom: 8px; }
.hero-find .finder { max-width: none; }
.hero-find .finder input { height: 48px; font-size: 1rem; border-radius: var(--radius); }
.hero-find .finder > .icon { top: 14px; }
.hero-find .quick { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rule-2); background: var(--surface); font-size: .88rem; text-decoration: none; color: var(--ink); cursor: pointer; font-family: var(--sans); }
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; padding-top: 22px; gap: 18px; } }

.directory { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 28px; border-top: 1px solid var(--rule); }
.directory .col { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.directory h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.directory h3 a { text-decoration: none; }
.directory ul { list-style: none; margin: 0; padding: 0; columns: 1; }
.directory li a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; text-decoration: none; }
.directory li a:hover .nm { text-decoration: underline; }
.directory .ctx { color: var(--ink-3); font-size: .85rem; white-space: nowrap; }

.course-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.course-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 16px; text-decoration: none; display: flex; flex-direction: column; gap: 6px; min-height: 136px; }
.course-card:hover { border-color: var(--ink-3); }
.course-card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-2); }
.course-card .nm { font-family: var(--serif); font-weight: 600; font-size: 1.12rem; }
.course-card .meta { color: var(--ink-2); font-size: .9rem; margin-top: auto; }

.rows { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--rule); text-decoration: none; }
.row:first-child { border-top: 0; }
.row:hover .nm { text-decoration: underline; }
.row .ic { width: 40px; height: 40px; border-radius: 8px; background: var(--tint); display: grid; place-items: center; color: var(--ink-2); overflow: hidden; }
.row .ic img { width: 100%; height: 100%; object-fit: cover; }
.row .nm { font-weight: 600; display: block; }
.row .sub { color: var(--ink-3); font-size: .85rem; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; }

/* ---------- Course page: the bundle "booklet" ---------- */
.course-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.booklet { position: relative; background: var(--surface); border: 1px solid var(--rule-2); border-radius: var(--radius-lg); box-shadow: 0 1px 0 var(--rule), 0 18px 40px -24px rgba(23,36,64,.35); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .9fr); grid-template-rows: auto 1fr; grid-template-areas: "head side" "body side"; overflow: hidden; }
.bk-head { grid-area: head; padding: 26px 26px 0 58px; }
.bk-body { grid-area: body; padding: 0 26px 24px 58px; }
.booklet::before { content: ""; position: absolute; top: 0; bottom: 0; left: 30px; border-left: 1px solid #e7b9b4; border-right: 1px solid #e7b9b4; width: 4px; }
.booklet-side { grid-area: side; padding: 26px; background: var(--tint); border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 14px; }
.booklet h2 { font-size: clamp(1.35rem, 1.15rem + .8vw, 1.75rem); margin-bottom: 6px; }
.booklet .lede { color: var(--ink-2); margin-bottom: 16px; }
.contents { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 18px; }
.contents li { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed var(--rule); font-size: .95rem; }
.contents li .icon { color: var(--ok); margin-top: 2px; }
.contents li .ch { color: var(--ink-3); font-size: .82rem; margin-left: auto; white-space: nowrap; }
.receive-m { display: none; margin-top: 12px; }
.contents-more summary { cursor: pointer; margin-top: 10px; font-size: .9rem; color: var(--ink-2); list-style: none; }
.contents-more summary::-webkit-details-marker { display: none; }
.receive { list-style: none; padding: 0; margin: 0; font-size: .9rem; color: var(--ink-2); }
.receive li { display: flex; gap: 8px; padding: 3px 0; }
.receive .icon { color: var(--ink-3); margin-top: 3px; }
.saving { font-size: .9rem; color: var(--ink-2); }
.offer-end { font-size: .85rem; color: var(--warn); display: flex; align-items: center; gap: 6px; }
.state-box { border: 1px dashed var(--rule-2); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.state-box strong { display: block; font-family: var(--serif); font-size: 1.1rem; }
@media (max-width: 820px) {
  /* Phones: title, then price and buy button, then the contents — the purchase stays above the fold. */
  .booklet { grid-template-columns: 1fr; grid-template-areas: "head" "side" "body"; }
  .booklet::before { left: 16px; }
  .bk-head { padding: 18px 18px 4px 36px; }
  .bk-head .lede { margin-bottom: 8px; font-size: .95rem; }
  .booklet-side { border-left: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 16px 18px 18px 36px; gap: 10px; }
  .bk-body { padding: 14px 18px 16px 36px; }
  .booklet-side .bk-receive { display: none; }
  .bk-body .receive-m { display: block; }
}

/* ---------- Product grid ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.select { height: 36px; border: 1px solid var(--rule-2); border-radius: 999px; padding: 0 12px; background: var(--surface); font: inherit; font-size: .88rem; color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card[hidden] { display: none; }
.card-head { display: flex; gap: 12px; align-items: flex-start; }
.card-head .ic { width: 42px; height: 42px; border-radius: 10px; background: var(--tint); display: grid; place-items: center; color: var(--ink); flex: none; overflow: hidden; }
.card-head .ic img { width: 100%; height: 100%; object-fit: cover; }
.card h3 { margin: 0; font-size: 1.05rem; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card .type { font-size: .8rem; color: var(--ink-3); }
.card .desc { font-size: .92rem; color: var(--ink-2); margin: 0; }
.card details { font-size: .88rem; color: var(--ink-2); }
.card details summary { cursor: pointer; }
.card details ol { margin: 6px 0 0; padding-left: 1.3em; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.card-foot .acts { display: flex; gap: 6px; align-items: center; }
.card-foot form { margin: 0; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--rule); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--rule); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform .15s; color: var(--ink-3); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq .answer { color: var(--ink-2); padding-top: 8px; }
.faq .answer p:last-child { margin: 0; }

/* ---------- Product page ---------- */
.product-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.buybox { position: sticky; top: 76px; background: var(--surface); border: 1px solid var(--rule-2); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 860px) { .product-layout { grid-template-columns: 1fr; } .buybox { position: static; order: -1; } }
.contents-list { columns: 2 220px; padding-left: 1.3em; margin: 0; }
.contents-list li { padding: 3px 0; break-inside: avoid; }
.sample-frame { width: 100%; height: 70vh; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--tint); }

/* ---------- Forms, cart, checkout ---------- */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 20px; }
.narrow { max-width: 440px; margin: 32px auto 0; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field input, .field select { width: 100%; height: 44px; border: 1px solid var(--rule-2); border-radius: var(--radius); padding: 0 12px; font: inherit; background: var(--surface); color: var(--ink); }
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,36,64,.08); }
.field .err, .err { color: var(--bad); font-size: .86rem; margin-top: 4px; display: block; }
.check { display: flex; gap: 8px; align-items: center; font-size: .92rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.lines { list-style: none; padding: 0; margin: 0; }
.lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.lines li:first-child { padding-top: 0; }
.lines .nm { font-weight: 600; }
.lines .sub { color: var(--ink-3); font-size: .85rem; grid-column: 1; }
.lines .amt { text-align: right; }
.totals { width: 100%; border-collapse: collapse; font-size: .95rem; }
.totals td { padding: 6px 0; }
.totals td:last-child { text-align: right; }
.totals .grand td { border-top: 1px solid var(--rule); padding-top: 12px; font-weight: 700; font-size: 1.1rem; }
.coupon { display: flex; gap: 8px; }
.coupon input { flex: 1; height: 40px; border: 1px solid var(--rule-2); border-radius: var(--radius); padding: 0 12px; font: inherit; text-transform: uppercase; }
.gw { display: flex; gap: 10px; align-items: center; border: 1px solid var(--rule-2); border-radius: var(--radius); padding: 12px; cursor: pointer; margin-bottom: 8px; }
.gw:has(input:checked) { border-color: var(--ink); background: var(--tint); }
.gw input { accent-color: var(--ink); }

/* ---------- Library / orders ---------- */
.lib { display: grid; gap: 12px; }
.lib-item { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.files { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; font-size: .93rem; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.table th { font-weight: 600; color: var(--ink-2); background: var(--tint); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 28px 0 36px; font-size: .9rem; color: var(--ink-2); background: var(--surface); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 36px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.site-footer form { display: inline; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
/* Never let a flex/grid child force the page wider than the phone. */
.two-col > *, .lines li > *, .product-layout > * { min-width: 0; }
.coupon input { min-width: 0; width: 100%; }
html, body { overflow-x: clip; }
