:root {
  color-scheme: light;
  --paper: #f5f5f7;
  --surface: #fff;
  --ink: #202124;
  --muted: #686b75;
  --line: #e1e2e8;
  --blue: #0066d9;
  --button: #0876ed;
  --header-space: var(--shop-header-height);
  --font: var(--shop-frame-font);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--header-space) + 20px); }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding-top: var(--header-space);
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; min-width: 0; }
main:focus { outline: 0; }
.frame { width: var(--shop-frame-width); margin-inline: auto; }
a { color: var(--blue); text-decoration: none; }
:where(a, button, input, textarea, select):focus-visible { outline: 3px solid #0876ed; outline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.3; }
h1 { font-size: clamp(32px, 3.2vw, 46px); font-weight: 600; letter-spacing: -.045em; }
h2 { font-size: 25px; font-weight: 600; letter-spacing: -.035em; }
h3 { margin: 18px 0 8px; font-size: 18px; font-weight: 570; }
.icon { display: block; flex: none; width: 20px; height: 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.muted, .loading, .empty { color: var(--muted); }
.muted, .empty { font-size: 14px; }
.loading, .empty { padding-block: 24px; }

footer.frame { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 34px; padding: 17px 0 max(24px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.catalog-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 48px; margin-top: 38px; }
.category-rail { min-width: 0; }
.category-panel {
  position: sticky;
  top: calc(var(--header-space) + 28px);
  display: flex;
  flex-direction: column;
  min-height: 560px;
  height: calc(100dvh - var(--header-space) - 132px);
  max-height: calc(100dvh - var(--header-space) - 56px);
}
.rail-heading { display: flex; align-items: center; justify-content: space-between; padding: 2px 12px 20px; }
.rail-heading h2 { color: var(--muted); font-size: 15px; font-weight: 400; letter-spacing: 0; }
.category-links { display: flex; flex-direction: column; gap: 6px; min-height: 0; padding: 4px 0; overflow-y: auto; scrollbar-width: thin; }
.category-link { display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 11px 15px; border-radius: 14px; color: #4e525f; font-size: 15px; font-weight: 450; }
.category-link img { flex: none; width: 22px; height: 22px; object-fit: contain; opacity: .78; }
.category-link > span { min-width: 0; line-height: 1.45; overflow-wrap: anywhere; }
.category-link small { flex: none; display: grid; place-items: center; min-width: 24px; height: 24px; margin-left: auto; border-radius: 50%; background: #e8e9ee; color: #575b67; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.category-link.subcategory { margin-left: 12px; padding-left: 18px; font-size: 14px; }
.category-link:hover { background: rgb(255 255 255 / 65%); }
.category-link[aria-current] { color: var(--ink); background: #fff; box-shadow: 0 4px 14px rgb(28 35 57 / 5%); font-weight: 580; }
.category-link[aria-current] img { opacity: 1; }
.category-link:focus-visible { outline-offset: -3px; }
.drawer-open, .drawer-close { display: none; }
.category-drawer { position: fixed; inset: 0 auto 0 0; width: min(320px, 88vw); max-width: none; height: 100%; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: var(--paper); color: var(--ink); }
.category-drawer::backdrop { background: rgb(20 24 34 / 32%); }
.category-drawer .category-panel { position: static; height: 100%; min-height: 0; max-height: 100%; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px max(20px, env(safe-area-inset-bottom, 0px)); }
.category-drawer .rail-heading { padding: 0 10px 16px; }
.category-drawer .rail-heading h2 { font-size: 17px; color: var(--ink); }
.category-drawer .drawer-close { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: #e9e9ef; }
body:has(.category-drawer[open]) { overflow: hidden; }

.catalog-pane, .catalog-heading, .catalog-body { min-width: 0; }
.shop-announcement {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 27px;
  padding: 14px 17px;
  border: 1px solid #c8ddf7;
  border-radius: 14px;
  background: #edf5ff;
  color: #244769;
  overflow-wrap: anywhere;
}
.shop-announcement-warning { border-color: #ebd09d; background: #fff6e5; color: #684416; }
.shop-announcement .icon { margin-top: 2px; }
.shop-announcement h2 { color: inherit; font-size: 15px; letter-spacing: 0; }
.shop-announcement p { margin-top: 4px; font-size: 14px; white-space: pre-line; }
.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.catalog-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 16px; }
.catalog-heading h1 { font-size: 25px; letter-spacing: -.035em; overflow-wrap: anywhere; }
#catalog-count { color: var(--muted); font-size: 14px; white-space: nowrap; }
.catalog-search { display: flex; align-items: center; flex: 0 1 316px; min-width: 180px; height: 44px; padding-right: 14px; border: 1px solid #d5d7df; border-radius: 24px; background: #ffffffb3; }
.catalog-search:focus-within { outline: 2px solid #0876ed; outline-offset: 2px; }
.catalog-search button { display: grid; place-items: center; flex: none; width: 46px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.catalog-search button .icon { width: 21px; height: 21px; opacity: .65; }
.catalog-search button:focus-visible { outline-offset: -3px; }
.catalog-search input { flex: 1; width: 0; min-width: 0; margin: 0; padding: 7px 0; border: 0; border-radius: 0; outline: 0; background: transparent; font-size: 15px; }
input::placeholder, textarea::placeholder { color: #818593; opacity: 1; }
.catalog-body { margin-top: 24px; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin: 0; padding: 0; list-style: none; }
.product-grid > li { display: flex; min-width: 0; }
.product-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 3px 7px rgb(30 38 57 / 4%), 0 12px 28px rgb(30 38 57 / 5%);
  transform: translateY(0);
}
.product-card:focus-visible { outline-offset: 5px; }
.product-cover { flex: none; overflow: hidden; aspect-ratio: 4 / 3; background: #eaedf2; }
.product-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-info { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 227px; padding: 22px 24px 24px; }
.product-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; color: #696d77; font-size: 13px; line-height: 1.6; }
.product-meta .delivery { color: #787e87; font-size: 11px; }
.product-meta .sold-out { color: #9b563d; font-size: 12px; }
.product-info h3 { margin: 10px 0 0; color: #1e2228; font-size: clamp(17px, 1.4vw, 21px); font-weight: 600; letter-spacing: -.035em; line-height: 1.5; overflow-wrap: anywhere; }
.product-description { display: -webkit-box; margin-top: 8px; min-height: 42px; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--muted); font-size: 13px; line-height: 1.7; }
.product-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 24px; }
.product-price { min-width: 0; color: #14181f; font-size: clamp(24px, 2.1vw, 30px); font-weight: 600; line-height: 1.2; letter-spacing: -.055em; overflow-wrap: anywhere; }
.product-cta { flex: none; padding: 8px 17px; border-radius: 24px; background: var(--button); color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; }
.product-card:hover { box-shadow: 0 5px 12px rgb(30 38 57 / 5%), 0 16px 35px rgb(30 38 57 / 9%); transform: translateY(-4px); }
.product-card:hover .product-cta { background: #0065d0; }
.catalog-message { padding: 70px 20px; border-radius: 20px; background: rgb(255 255 255 / 60%); color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.catalog-message a, .catalog-message button { display: inline-block; margin-top: 12px; }
.catalog-pages { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 24px; font-size: 14px; }
.catalog-pages a { padding: 7px 12px; border-radius: 18px; background: white; }
.catalog-pages [aria-disabled] { color: var(--muted); }

.back { display: inline-flex; align-items: center; min-height: 40px; margin: 22px 0; color: var(--muted); font-size: 14px; }
.back:hover, .rich a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
main:has(.detail-grid) { max-width: 1120px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .85fr); align-items: start; gap: clamp(28px, 5vw, 70px); margin-bottom: 16px; }
.detail { min-width: 0; }
.tile.large { width: 100%; aspect-ratio: 4 / 3; overflow: hidden; margin: 0 0 30px; border-radius: 24px; background: #eaedf2; }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.eyebrow { margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 450; }
.detail h1 { font-size: clamp(28px, 2.8vw, 38px); font-weight: 600; overflow-wrap: anywhere; }
.lede { color: var(--muted); font-size: 16px; line-height: 1.8; }
.detail .lede, .narrow h1 + .lede, .narrow h1 + .muted { margin: 14px 0 24px; }
.rich { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.rich h2, .panel h2 { font-size: 21px; font-weight: 580; }
.rich h2 { margin-bottom: 14px; }
.rich p, .sample p, .panel > p, .panel > ol { margin: 9px 0; }
.rich :where(ol, ul), .sample :where(ol, ul) { padding-inline-start: 1.5em; }
.rich a, .sample a:not(.action) { text-decoration: underline; text-underline-offset: 3px; }
.panel { min-width: 0; padding: clamp(24px, 2.4vw, 34px); border-radius: 24px; background: var(--surface); box-shadow: 0 4px 18px rgb(30 38 57 / 4%); }
.detail-grid > .panel { position: sticky; top: calc(var(--header-space) + 28px); }
.panel + .panel { margin-top: 18px; }
.price { color: var(--ink); font-size: 38px; font-weight: 580; line-height: 1.3; letter-spacing: -.045em; }
form label { display: block; margin: 20px 0; font-size: 14px; font-weight: 480; }
form label:first-child { margin-top: 0; }
label small { margin-left: 4px; color: var(--muted); font-weight: 400; }
input, textarea, select { display: block; width: 100%; min-width: 0; margin-top: 7px; padding: 11px 14px; border: 1px solid #d1d4dc; border-radius: 11px; background: #fff; color: var(--ink); font-size: 16px; line-height: 1.5; }
textarea { resize: vertical; }
.primary, .action, .secondary, .thread-list button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 22px; border: 1px solid transparent; border-radius: 25px; background: var(--button); color: #fff; font-size: 14px; font-weight: 500; }
.primary:hover, .action:hover { background: #0065d0; }
.wide { width: 100%; }
.primary:disabled { background: #e1e3e9; color: #626775; cursor: default; }
.secondary, .thread-list button { padding: 7px 17px; border-color: #d9dce3; background: white; color: var(--ink); }
.secondary:hover, .lookup-row:hover, .thread-list button:hover { background: var(--paper); }
.thread-list button[aria-pressed="true"] { background: var(--ink); color: white; }
.feedback { color: #934a32; font-size: 13px; overflow-wrap: anywhere; }
.feedback:empty { display: none; }
.narrow { max-width: 660px; }
.inner { margin-inline: auto; }
.inner > h1 { margin-bottom: 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.state, .sample-code { background: #f0f2f7; color: #50586c; }
.state { border-radius: 20px; padding: 4px 13px; font-size: 12px; white-space: nowrap; }
dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 22px; margin: 24px 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
code, pre { font: 14px/1.65 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; white-space: pre-wrap; }
.sample-code { display: inline-block; max-width: 100%; padding: 7px 11px; border-radius: 8px; }
.sample .action { margin-top: 8px; }
.test-notice { margin: 14px 0; color: #62687a; font-size: 13px; }
.order-steps { display: flex; list-style: none; gap: 10px; padding: 0; margin: 24px 0; counter-reset: step; }
.order-steps li { flex: 1; border-top: 3px solid #dce0e8; padding-top: 12px; color: #747b8b; font-size: 13px; }
.order-steps li::before { counter-increment: step; content: counter(step) ' · '; }
.order-steps .done { color: #2c6550; border-color: #619b7b; }
.checkout-amount { font-size: 36px; font-weight: 600; letter-spacing: -.04em; }
.checkout-alternatives, .order-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; align-items: center; }
.order-actions { justify-content: space-between; font-size: 14px; }
.order-record { margin-top: 20px; font-size: 13px; color: #62687a; }
.order-record summary { cursor: pointer; }
.order-record ul { padding-left: 20px; line-height: 1.9; }
.order-record time { font-variant-numeric: tabular-nums; }
.delivery-options { border: 0; padding: 0; margin: 20px 0; }
.delivery-options label { display: flex; align-items: center; gap: 8px; }
.delivery-options input { width: auto; margin: 0; }
.lookup-row { width: 100%; margin: 10px 0; padding: 14px 18px; border: 0; border-radius: 12px; background: var(--surface); color: var(--blue); text-align: left; overflow-wrap: anywhere; }
.chat-panel { margin-top: 24px; }
.messages { display: flex; flex-direction: column; gap: 12px; min-height: 135px; max-height: 380px; overflow-y: auto; padding: 22px 1px; border-bottom: 1px solid var(--line); }
.bubble { align-self: flex-start; max-width: 86%; padding: 10px 15px; border-radius: 16px 16px 16px 5px; background: #f0f1f5; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; border-radius: 16px 16px 5px 16px; background: #e9f2ff; }
.bubble small { color: var(--muted); font-size: 11px; }
.bubble p { white-space: pre-wrap; }
.thread-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }

@media (min-width: 761px) and (max-width: 1180px) {
  .catalog-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 28px; }
  .category-link { gap: 10px; padding-inline: 11px; font-size: 14px; }
  .category-link.subcategory { margin-left: 6px; padding-left: 12px; font-size: 13px; }
  .category-link small { min-width: 21px; height: 21px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .catalog-search { flex-basis: 250px; }
}
@media (max-width: 760px) {
  .catalog-layout { display: block; margin-top: 28px; }
  .category-rail { display: none; }
  .drawer-open { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--blue); font-size: 13px; white-space: nowrap; }
  .drawer-open img { display: block; flex: none; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .product-info { padding: 18px 20px 22px; }
  .product-info h3 { font-size: 18px; }
  .catalog-heading h1 { font-size: 22px; }
  .catalog-search { flex-basis: 260px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: 620px; margin-inline: auto; }
  .detail-grid > .panel { position: static; }
  .tile.large { max-width: 540px; margin-bottom: 24px; }
  .back { margin: 14px 0; }
  .panel { padding: 25px; border-radius: 22px; }
}
@media (max-width: 560px) {
  .catalog-toolbar { align-items: stretch; flex-direction: column; gap: 16px; }
  .catalog-heading { gap: 13px; }
  #catalog-count { font-size: 13px; }
  .catalog-search { flex: none; width: 100%; height: 44px; }
  .catalog-search input { font-size: 16px; }
  .catalog-body { margin-top: 22px; }
  .product-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .product-card { border-radius: 22px; }
  .product-info { min-height: 214px; padding: 21px 24px 24px; }
  .product-info h3 { font-size: 20px; }
  .product-meta { font-size: 13px; }
  .product-description { min-height: 0; font-size: 14px; }
  .product-price { font-size: 28px; }
  .product-bottom { padding-top: 22px; }
  .product-cta { padding: 9px 20px; font-size: 13px; }
  footer.frame { align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11px; }
}
@media (max-width: 380px) {
  .drawer-open { gap: 4px; font-size: 12px; }
  .panel { padding: 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  .product-card { transition: transform 220ms ease, box-shadow 220ms ease; }
  .category-link, .primary, .action, .product-cta { transition: color 150ms ease, background-color 150ms ease; }
}
@media (prefers-reduced-motion: reduce) {
  .product-card:hover { transform: none; }
}
