:root {
  color-scheme: light;
  --bg: #fffaf1;
  --paper: #fff;
  --ink: #1e2140;
  --muted: #555a70;
  --border: #e5e2de;
  --accent: #343eb5;
  --accent-hover: #28318e;
  --tint: #e9ecff;
  --photo: #eef1f7;
  --butter: #f4d86b;
  --butter-soft: #fff2bc;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 "Pretendard", "Malgun Gothic", system-ui, sans-serif;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.24; letter-spacing: -.045em; }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a, input, select { touch-action: manipulation; }
button {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  padding: .56rem .85rem;
  font-weight: 700;
}
button { cursor: pointer; }
button:disabled { opacity: .52; cursor: not-allowed; }
button:not(:disabled):hover { border-color: #8f98cb; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.wrap { width: min(1100px, calc(100% - 48px)); margin-inline: auto; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 70px; }
header { background: var(--paper); border-bottom: 1px solid var(--border); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.43rem;
  font-weight: 900;
  letter-spacing: -.075em;
  white-space: nowrap;
}
.brand span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: var(--tint);
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
}
.site-nav, .actions { display: flex; align-items: center; gap: 10px; }
.site-nav { gap: 28px; font-weight: 750; }
.site-nav a:hover { color: var(--accent); }
.actions { font-size: .875rem; }
.actions button, .actions a { white-space: nowrap; }
#member-profile { font-weight: 700; }
#member-profile:hover { text-decoration: underline; text-underline-offset: 3px; }
.storefront { margin-block: 31px 72px; }
.schedule {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 20px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--paper);
}
.broadcast-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--butter-soft);
  color: var(--ink);
  font-size: .85rem;
}
.folded-corner { position: relative; }
.folded-corner::after {
  position: absolute;
  inset: 0 0 auto auto;
  width: 16px;
  height: 16px;
  border-top-right-radius: 4px;
  background: linear-gradient(225deg, var(--bg) 49%, var(--butter) 51%);
  box-shadow: -1px 1px 2px #1e214025;
  border-bottom-left-radius: 4px;
  pointer-events: none;
  content: "";
}
.schedule-copy { flex: 1; min-width: 0; }
.schedule h2 { font-size: 1rem; }
.schedule p { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.schedule > a { color: var(--accent); font-size: .875rem; font-weight: 800; }
.schedule a:hover { text-decoration: underline; text-underline-offset: 3px; }
.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .25rem .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 750;
  white-space: nowrap;
}
.live.on { background: var(--butter); border-color: var(--butter); color: var(--ink); }
.live.on::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}
.products { margin-top: 30px; scroll-margin-top: 15px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-heading h1 { font-size: 1.45rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button[aria-pressed="true"] { background: var(--accent); color: white; border-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.featured-grid { grid-template-columns: 1fr; }
.card {
  min-width: 0;
  overflow: hidden;
  border-radius: 20px;
  background: var(--paper);
  border: 1px solid var(--border);
}
.featured-grid .card {
  display: grid;
  grid-template-columns: minmax(0, .96fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding: 13px;
  box-shadow: 0 14px 42px -34px #1e214061;
}
.photo { background: var(--photo); overflow: hidden; aspect-ratio: 1; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-with-artwork img { object-fit: contain; }
.featured-grid .photo { border-radius: 13px; }
.card-copy { padding: 18px; }
.featured-grid .card-copy { padding: 24px clamp(18px, 3.5vw, 48px) 24px 0; }
.card-meta, .stock-status { font-size: .875rem; color: var(--muted); font-weight: 650; }
.card-meta { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.card-meta span { color: var(--accent); border-left: 1px solid var(--border); padding-left: 9px; }
.card h2 { font-size: 1.15rem; }
.featured-grid .card h2 { font-size: clamp(1.9rem, 4.15vw, 3rem); word-break: keep-all; }
.price { margin-top: 10px; font-size: 1.2rem; font-weight: 850; letter-spacing: -.035em; }
.featured-grid .price { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.card-description { color: var(--muted); margin-top: 12px; word-break: keep-all; }
.stock-status { margin-top: 12px; }
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  padding: .69rem 1rem;
  font-weight: 800;
}
.primary:not(:disabled):hover { background: var(--accent-hover); }
.card .primary { margin-top: 18px; width: 100%; }
.featured-grid .primary { margin-top: 24px; width: min(100%, 300px); }

footer { border-top: 1px solid var(--border); background: var(--paper); color: var(--muted); }
.site-footer { padding: 24px 0 28px; }
.footer-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
footer .brand { color: var(--ink); font-size: 1.1rem; }
footer .brand span { width: 26px; height: 26px; font-size: 1.1rem; border-radius: 8px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px 32px; margin-top: 14px; }
.merchant, #studio-link { font-size: .875rem; }
.merchant a, #studio-link { text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.footer-policies { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 14px; }
.studio-title { padding: 29px 0 16px; }
.studio-title > h2 { font-size: 2em; }
.studio-title > * + * { margin-top: 9px; }
.studio-title p, .muted, .empty { color: var(--muted); }
.studio-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; margin-bottom: 36px; }
#monitor { margin-bottom: 36px; }
.monitor-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px 18px; margin-bottom:16px; }
.monitor-actions .primary { padding:10px 14px; border-radius:10px; }
.monitor-layout { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1.2fr); gap:16px; align-items:start; }
#monitor-chat { width:100%; min-height:480px; height:65vh; border:1px solid var(--border); border-radius:12px; background:white; }
.monitor-channel-links { margin: 0 0 16px; }
.monitor-link-row { display: grid; grid-template-columns: 4rem minmax(0,1fr) auto; align-items: center; gap: 8px; margin-top: 8px; }
.monitor-link-row input { min-width: 0; }
.monitor-tiktok form { margin-top: 8px; }
#monitor-tiktok-chat { color: var(--accent); text-decoration: underline; }
.monitor-latest {
  padding: 15px 17px;
  min-height: 120px;
  border: 1px solid #c7cafa;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: #f2f0ff;
  overflow-wrap: anywhere;
}
.monitor-latest-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: #555176; font-size: .79rem; font-weight: 750; }
.monitor-latest-meta time { margin-left: auto; font-variant-numeric: tabular-nums; }
.monitor-latest-name { font-size: clamp(1.1rem, 2.4vw, 1.55rem); line-height: 1.24; font-weight: 800; margin-top: 5px; }
.monitor-latest-items { font-size: .94rem; font-weight: 750; margin-top: 4px; }
.monitor-connection, #mini-sync { font-size: .82rem; color: var(--muted); font-weight: 660; }
.monitor-connection[data-state="connected"], #mini-sync[data-state="connected"] { color: #216250; }
.monitor-connection[data-state="delayed"], #mini-sync[data-state="delayed"] { color: #9b292a; }
.monitor-mini { padding: 12px; background: var(--bg); }
.monitor-mini h1 { font-size: .95rem; margin-bottom: 8px; }
.monitor-mini #mini-sync { margin-top: 7px; }
.monitor-latest-mode { font-size: .83rem; color: #555176; margin-top: 3px; }
.order-source { display: inline-flex; align-items: center; border-radius: 999px; padding: .15rem .6rem; margin-right: .24rem; background: #e8e5ef; color: #463953; font-size: .78rem; font-weight: 800; line-height: 1.45; }
.order-source--youtube { background: #ffe5e7; color: #952533; }
.order-source--tiktok { background: #dff8f3; color: #09665d; }
#monitor-tools > details { margin-top:16px; }
.box { border: 1px solid var(--border); background: var(--paper); padding: 18px; border-radius: 16px; }
.box h2 { margin-bottom: 12px; }
.box a:not(.primary) { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.stack { display: grid; gap: 12px; }
.form-row { display: grid; gap: 4px; font-weight: 700; }
.form-row input, .form-row select {
  padding: .57rem .65rem;
  border: 1px solid #c3c9da;
  border-radius: 9px;
  width: 100%;
  min-width: 0;
  background: var(--paper);
  color: var(--ink);
}
.item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.item:last-child { border: 0; }
.item-head, .total { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.item img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; vertical-align: middle; margin-right: 6px; }
.item label { display: block; }
.total { margin: 12px 0; font-weight: 850; }
.order-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.order-tools button { font-size: .875rem; }
.pack { padding-top: 8px; }
.pack label { display: flex; align-items: center; gap: 7px; margin: 4px 0; }
.pack input { width: 20px; height: 20px; accent-color: var(--accent); }
dialog {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  width: min(510px, calc(100% - 26px));
  max-height: 90dvh;
  padding: 22px;
}
dialog::backdrop { background: #1e214097; }
dialog h2 { padding-right: 40px; }
dialog .close { position: absolute; top: 12px; right: 12px; font-size: 1.45rem; padding: 0; width: 38px; height: 38px; }
dialog .stack { margin-top: 14px; }
#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background: var(--ink);
  color: white;
  border-radius: 12px;
  padding: .55rem .9rem;
  width: max-content;
  max-width: calc(100% - 28px);
}
#toast:empty { display: none; }
.empty { padding: .6rem 0; }
.order-receipt {
  margin-top: 14px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--tint);
}
.order-receipt p { margin-top: 3px; font-size: .875rem; }
#sheet-actions { display: none; }
.checkout-sheet[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0;
  overflow: hidden;
}
.checkout-sheet #sheet-body {
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 20px;
}
.checkout-sheet .close { z-index: 1; background: var(--paper); }
.checkout-preview {
  margin: 10px 0;
  color: var(--muted);
  font-size: .875rem;
}
.checkout-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .875rem;
}
.checkout-checkbox input { margin: .22em 0 0; flex: none; accent-color: var(--accent); }
#open-notice .checkout-checkbox { margin-top: 8px; }
.quick-checkout .buy-line { justify-content: flex-start; gap: 10px; }
.buy-line .line-tools { margin-left: auto; flex: none; }
.buy-thumbnail { width: 54px; height: 54px; object-fit: cover; flex: none; border-radius: 8px; }
.buy-section { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.buy-section h3 { font-size: 1.05rem; }
.buy-address-list { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.buy-address-list legend { font-size: .9rem; font-weight: 700; margin-bottom: 5px; }
#buy-address-list { display: grid; gap: 6px; }
.buy-address-option { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; cursor: pointer; }
.buy-address-option:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.buy-address-option input { flex: none; margin: 5px 0 0; accent-color: var(--accent); }
.buy-address-option small { display: block; overflow-wrap: anywhere; color: var(--muted); }
.buy-address-add { align-items: center; min-height: 42px; }
.buy-address-add input { margin-top: 0; }
.buy-address-form { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.address-search-row { display: flex; align-items: end; gap: 8px; }
.address-search-row .form-row { flex: 1; min-width: 0; }
.address-search-row button { flex: none; min-height: 42px; }
.buy-broadcast { margin-top: 2px; }
.buy-broadcast summary, .buy-section summary { color: var(--accent); cursor: pointer; padding: 5px 0; font-weight: 750; }
.buy-broadcast p { margin-top: 6px; font-size: .875rem; }
.buy-broadcast a { text-decoration: underline; text-underline-offset: 3px; }
.buy-totals { display: grid; gap: 3px; }
.buy-totals div { display: flex; justify-content: space-between; gap: 12px; }
.buy-totals dd { margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; }
.buy-policy { padding: 10px 12px; border-radius: 10px; background: var(--tint); }
.buy-policy .policy-links { margin-top: 6px; font-size: .8rem; }
.quick-checkout #reward-preview { font-size: .85rem; }
.quick-checkout .checkout-action-row > [role="status"] { display: none; }
.quick-checkout #checkout-submit { width: 100%; min-height: 50px; }
@media (max-width: 430px) {
  .quick-checkout .buy-line { display: grid; grid-template-columns: auto minmax(0,1fr); }
  .quick-checkout .line-tools { grid-column: 2; justify-self: start; margin-left: 0; }
}
#checkout-actions {
  border-top: 1px solid var(--border);
  padding: 10px 18px max(10px, env(safe-area-inset-bottom));
  background: var(--paper);
}
.checkout-action-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.checkout-action-row span { display: block; color: var(--muted); font-size: .875rem; }
.checkout-action-row strong { display: block; font-size: 1.1rem; }
.checkout-action-row button { min-height: 44px; }
#checkout-review-options { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.checkout-error { color: #9f263d; font-size: .875rem; margin-bottom: 8px; overflow-wrap: anywhere; }
.line-tools { display: flex; gap: .4rem; align-items: center; }
.line-tools button { padding: .22rem .55rem; }
.product-cart { margin-top: 12px; }
.product-details { border-top: 1px solid var(--border); padding-top: 14px; }
.product-details h3 { font-size: 1.1rem; }
.product-details img { display: block; width: 100%; height: auto; border-radius: 12px; }
.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #747775;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font: 500 .875rem/1.4 "Google Sans", Roboto, "Malgun Gothic", sans-serif;
}
.google-button img { display: block; flex: none; object-fit: contain; }
.google-button:hover { background: #f7f9fc; }
.google-button:active { background: #edf1f7; }
.account-summary, .checkout-account {
  margin-top: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--tint);
  color: var(--ink);
  font-size: .875rem;
}
.account-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.checkout-account a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.policy { width: min(840px, calc(100% - 32px)); margin-block: 30px 48px; }
.policy h1 { font-size: clamp(1.65rem, 4vw, 2.5rem); }
.policy-notice { margin: 14px 0 18px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--tint); }
.policy-links { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .875rem; font-weight: 700; }
.policy-links a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.policy-section { margin-top: 18px; scroll-margin-top: 12px; }
.policy-section h3 { margin-top: 15px; font-size: 1rem; }
.policy-section p, .policy-section ul { margin-top: 6px; }
.policy-section ul { padding-inline-start: 1.25em; }
.policy-section li + li { margin-top: 7px; }

@media (max-width: 820px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured-grid { grid-template-columns: 1fr; }
  .studio-layout, .monitor-layout { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 28px); }
  .site-header .bar { flex-wrap: wrap; padding-block: 10px; gap: 10px 12px; }
  .site-nav { order: 3; flex-basis: 100%; gap: 20px; border-top: 1px solid var(--border); padding-top: 8px; font-size: .875rem; }
  .actions { flex-wrap: wrap; gap: 6px; }
  .actions button, .actions a { padding: .42rem .58rem; }
  .brand { font-size: 1.2rem; }
  .brand span { width: 28px; height: 28px; }
  .storefront { margin-block: 15px 36px; }
  .schedule { flex-wrap: wrap; gap: 8px; padding: 11px; }
  .schedule > a { margin-left: 46px; }
  .products { margin-top: 22px; }
  .section-heading { margin-bottom: 10px; }
  .section-heading h1 { font-size: 1.25rem; }
  .featured-grid .card { display: block; padding: 9px; border-radius: 16px; }
  .featured-grid .photo { border-radius: 10px; }
  .featured-grid .card-copy { padding: 16px 9px 9px; }
  .featured-grid .card h2 { font-size: 1.6rem; }
  .featured-grid .primary { width: 100%; margin-top: 16px; }
  .product-sheet[open] {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 0;
    overflow: hidden;
  }
  .product-sheet #sheet-body { overflow-y: auto; overscroll-behavior-y: contain; padding: 22px; }
  .product-sheet .close { z-index: 1; }
  .product-sheet .desktop-add { display: none; }
  .product-sheet #sheet-actions {
    display: block;
    border-top: 1px solid var(--border);
    padding: 10px 18px max(10px, env(safe-area-inset-bottom));
    background: var(--paper);
  }
  #sheet-actions .primary { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
}

.product-guide-link { margin-top: 16px; text-align: center; }
.product-guide-link a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.product-guide-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 20px; }
.product-guide-intro img { display: block; width: 100%; height: auto; border-radius: 12px; }
@media (max-width: 600px) {
  .product-guide-intro { grid-template-columns: 1fr; }
}

/* Customer storefront and cart share the checkout's quieter brand palette. */
body:has(.storefront:not([hidden])) {
  --bg: #faf7f5;
  --ink: #282025;
  --muted: #645963;
  --border: #e9dedf;
  --accent: #a62a50;
  --accent-hover: #84203f;
  --tint: #fae9ef;
  --photo: #fbf0f1;
}
.storefront .schedule, .storefront .featured-grid .card { box-shadow: none; }
.storefront .schedule::after { display: none; }
.storefront .featured-grid .price { color: var(--accent); }
.storefront .featured-grid .primary { min-height: 48px; }
.storefront .featured-grid .photo { border-radius: 12px; }

.shop-live-strip {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 7px 14px;
  background: #faf7f5;
  border-block: 1px solid #eee3df;
  color: #473d3f;
  font-size: .875rem;
  font-weight: 700;
}
.shop-live-strip.is-live #shop-live-state {
  padding: 0 8px;
  border-radius: 999px;
  background: #f9e7a1;
  color: #433318;
}
.storefront .photo { position: relative; }
.photo-stock {
  position: absolute;
  top: 8px;
  left: 8px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 700;
}
.card-opening {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  max-width: 300px;
  font-size: .9rem;
  font-weight: 700;
}
.card-opening select {
  width: 100%;
  min-height: 42px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
}
.storefront .featured-grid .card { border-radius: 12px; }
.storefront .featured-grid .price { color: #222; }

.product-quantity-control { display: grid; grid-template-columns: minmax(0,1fr) 44px 44px; gap: 6px; }
.product-quantity-control input { min-width: 0; appearance: textfield; }
.product-quantity-control input::-webkit-inner-spin-button,
.product-quantity-control input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.product-quantity-control button { min-height: 44px; padding: 0; font-size: 18px; }
