:root {
  --bg: #f7f4ef; --card: #fffdf9; --ink: #1d1a17; --muted: #7a7168; --line: #e4ddd2;
  --accent: #8c6b3f; --sold: #a39a90; --ok: #3d7a52;
  --serif: "Didot", "Bodoni 72", "Cormorant Garamond", Georgia, "Noto Serif JP", "Songti SC", "Noto Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "PingFang SC", "PingFang TC", "Apple SD Gothic Neo", "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: rgba(247,244,239,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.logo { display: flex; flex-direction: column; align-items: center; text-decoration: none; line-height: 1; }
.logo-main { font-family: var(--serif); font-size: 26px; letter-spacing: .32em; margin-right: -.32em; }
.logo-sub { font-size: 9px; letter-spacing: .6em; margin-right: -.6em; margin-top: 4px; color: var(--muted); }
.logo.small .logo-main { font-size: 20px; }
.pickers { display: flex; gap: 8px; }
.picker select, .filter-row select { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 7px 28px 7px 12px; font: inherit; font-size: 13px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a7168'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.ratebar { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 6px 16px; font-size: 12px;
  color: var(--muted); border-bottom: 1px solid var(--line); }
.ratebar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(61,122,82,.5); animation: pulse 2s infinite; }
#liveLbl { color: var(--ok); font-weight: 600; letter-spacing: .05em; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(61,122,82,0); } 100% { box-shadow: 0 0 0 0 rgba(61,122,82,0); } }

/* hero */
.hero { text-align: center; padding: 64px 20px 48px; max-width: 760px; margin: 0 auto; }
.eyebrow { font-size: 12px; letter-spacing: .25em; text-transform: uppercase; color: var(--accent); margin: 0 0 16px; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 7vw, 56px); line-height: 1.15; margin: 0 0 18px; }
.hero-sub { color: var(--muted); margin: 0 auto 28px; max-width: 560px; }
.btn { display: inline-block; background: var(--ink); color: var(--bg); text-decoration: none; border: 0; border-radius: 999px;
  padding: 13px 28px; font: inherit; font-size: 14px; letter-spacing: .06em; cursor: pointer; transition: opacity .2s; }
.btn:hover { opacity: .85; }
.btn.full { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn:disabled { background: var(--sold); cursor: not-allowed; }

.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.trust div { background: var(--bg); padding: 20px 16px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.trust strong { font-family: var(--serif); font-weight: 400; font-size: 17px; }
.trust span { font-size: 12px; color: var(--muted); }

/* shop */
.shop { max-width: 1240px; margin: 0 auto; padding: 40px 16px 24px; }
.filters { position: sticky; top: 61px; z-index: 10; background: var(--bg); padding: 8px 0 12px; margin-bottom: 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 16px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filter-row { display: flex; gap: 8px; align-items: center; }
.count { margin-right: auto; font-size: 13px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 32px 20px; } }
@media (min-width: 1080px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { text-decoration: none; display: flex; flex-direction: column; gap: 8px; animation: fade .4s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.card .ph { position: relative; aspect-ratio: 4/5; overflow: hidden; background: var(--line); border-radius: 4px; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .ph img { transform: scale(1.04); }
.card.sold .ph img { filter: grayscale(.7) opacity(.6); }
.badge { position: absolute; top: 8px; left: 8px; font-size: 10px; letter-spacing: .12em; padding: 3px 8px; border-radius: 2px; background: var(--card); color: var(--ink); }
.badge.new { background: var(--accent); color: #fff; }
.badge.reserved { background: #fff3df; color: var(--accent); }
.badge.sold { background: var(--ink); color: var(--bg); }
.card .brand { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.card .title { font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { display: flex; flex-direction: column; }
.price .main { font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.price .sub { font-size: 12px; color: var(--muted); }
.card.sold .price .main { color: var(--sold); text-decoration: line-through; }
.cond { display: inline-block; font-size: 11px; border: 1px solid var(--line); border-radius: 2px; padding: 0 6px; margin-right: 6px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

.how { max-width: 1000px; margin: 40px auto 0; padding: 48px 16px; border-top: 1px solid var(--line); text-align: center; }
.how h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 0 0 28px; }
.how ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.how li { display: flex; flex-direction: column; gap: 4px; }
.how b { font-family: var(--serif); font-weight: 400; color: var(--accent); font-size: 22px; }
.how span { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .trust, .how ol { grid-template-columns: 1fr; } }

/* detail */
#detail { max-width: 1160px; margin: 0 auto; padding: 16px 16px 48px; }
.backlink { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 12px; }
.dwrap { display: grid; gap: 28px; }
@media (min-width: 860px) { .dwrap { grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: start; } .dinfo { position: sticky; top: 90px; } }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 4px; background: var(--line); }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; aspect-ratio: 4/5; object-fit: cover; scroll-snap-align: center; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; }
.thumbs button { width: 56px; aspect-ratio: 4/5; padding: 0; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; cursor: pointer; background: none; opacity: .6; }
.thumbs button.on { opacity: 1; border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.dinfo .brand { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.dinfo h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 4vw, 34px); line-height: 1.25; margin: 6px 0 16px; }
.dinfo .price .main { font-size: 26px; }
.dinfo .price .sub { font-size: 13px; }
.note { font-size: 12px; color: var(--muted); margin: 6px 0 20px; }
.specs { border-top: 1px solid var(--line); margin: 20px 0; }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.specs dt { color: var(--muted); } .specs dd { margin: 0; text-align: right; }
.desc { white-space: pre-wrap; margin: 0 0 24px; }
.status-msg { background: #fff3df; color: var(--accent); padding: 10px 14px; border-radius: 4px; font-size: 13px; margin-bottom: 12px; }
.status-msg.sold { background: #ece8e2; color: var(--muted); }

/* dialog */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(460px, calc(100% - 24px)); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(29,26,23,.45); backdrop-filter: blur(2px); }
#orderForm, #thanks { padding: 24px 20px 20px; display: flex; flex-direction: column; gap: 12px; position: relative; }
#orderForm h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 0; }
#orderForm label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
#orderForm input, #orderForm select, #orderForm textarea { font: inherit; font-size: 16px; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; }
#orderForm p { margin: 0; font-size: 13px; }
.x { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--muted); }
.dlg-item { display: flex; gap: 12px; align-items: center; padding: 10px; background: var(--bg); border-radius: 8px; }
.dlg-item img { width: 52px; aspect-ratio: 4/5; object-fit: cover; border-radius: 4px; }
.dlg-item div { font-size: 13px; line-height: 1.4; }
.err { color: #b23b3b; }
.hp { position: absolute; left: -9999px; }
#thanks p { font-size: 16px; text-align: center; margin: 12px 0; }

.foot { text-align: center; padding: 40px 16px 56px; border-top: 1px solid var(--line); margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.foot p { margin: 0; font-size: 13px; }
.flash { animation: flash 1.4s ease; }
@keyframes flash { 0% { background: #fff3df; } 100% { background: transparent; } }
