/* チャオあみ — the shop's own pieces. Everything else comes from the Amigurumi UI Kit (ami-*).
   Sizes in rem, like the kit. */

/* product grids breathe on large screens; text pages stay at reading width */
:root { --ami-max: 77.5rem; }
.ami-narrowish { --ami-max: 62rem; }
.site-gap-top { margin-top: clamp(1rem, 2.5vw, 1.5rem); }
.site-wide { width: 100%; }
.site-centered { margin-inline: auto; max-width: 30rem; }
.site-list li { display: flex; align-items: center; gap: 0.75rem; font-weight: 900; }
.site-scroll { overflow-x: auto; }
.ami-carousel__track > li { display: grid; }   /* cards in a row share one height */

/* ---- home hero: a carousel of banners, text on the left ---- */
.site-herocar .ami-carousel__track { gap: 0; padding: 0; margin: 0; scroll-padding-inline: 0; }
.site-herocar::after { margin-top: 0.75rem; }
.site-herocar .ami-carousel__track::scroll-button(inline-start) { left: 0.75rem; }
.site-herocar .ami-carousel__track::scroll-button(inline-end) { right: 0.75rem; }
/* Photo backgrounds come in two sizes (tools/thumbs.py): phones get the small copy, so they decode far fewer pixels */
.site-bg--hero-top { background-image: url("/images/banners/hero-top.webp"); }
.site-bg--hero-making { background-image: url("/images/banners/hero-making.webp"); }
.site-bg--hero-list { background-image: url("/images/banners/hero-list.webp"); }
@media (width <= 42.5em) {
  .site-bg--hero-top { background-image: url("/images/banners/sm/hero-top.webp"); }
  .site-bg--hero-making { background-image: url("/images/banners/sm/hero-making.webp"); }
  .site-bg--hero-list { background-image: url("/images/banners/sm/hero-list.webp"); }
}
.site-hero { position: relative; isolation: isolate; width: 100%; max-width: none; min-height: clamp(15rem, 40vw, 28rem); gap: 0.75rem; background-position: 72% center; }
.site-hero__lead { font-weight: 900; text-shadow: var(--ami-emboss); }
/* a soft cream veil on the left keeps the text readable over a busy photo */
.site-hero--veil::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgb(253 243 230 / 0.92) 0 30%, rgb(253 243 230 / 0) 72%); }
@media (width <= 42.5em) {
  .site-hero::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgb(253 243 230 / 0.92) 0 38%, rgb(253 243 230 / 0) 82%); }
@media (width <= 30em) {
  /* photos whose left third is empty: on phones the text sits on top and the picture below it, so nothing covers the subject */
  .site-herocar .site-hero { min-height: 25rem; }
  .site-hero--right { align-content: start; padding-top: 1.5rem; background-color: #f3e6d6; background-size: auto 56%; background-position: 88% bottom; }
  .site-hero--right .site-hero__lead { display: none; }
  .site-hero.site-hero--right::before { background: linear-gradient(180deg, #fdf3e6 0 44%, rgb(253 243 230 / 0) 60%); }
}
}

/* ranking: first place is twice the size, the rest line up beside it */
.site-rank { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--ami-gap); }
.site-rank > :first-child { grid-column: span 2; grid-row: span 2; --ami-card-stitch: var(--ami-stitch); }
/* the big card is as tall as two small ones: its photo takes up the spare height instead of leaving a gap */
.site-rank > :first-child img { flex: 1 1 0; min-height: 0; aspect-ratio: auto; }
.site-rank > :first-child .ami-product__name { font-size: clamp(1.3rem, 1rem + 1.6vw, 2rem); }
.site-rank > :first-child .ami-product__price { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); }
.site-rank > :first-child .ami-product__badge { min-width: 4.25rem; height: 4.25rem; font-size: 1.0625rem; }
@media (width <= 42.5em) {
  .site-rank { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-rank > :first-child { grid-row: auto; }
  .site-rank > :first-child { --photo-ratio: 0.625; }   /* photo height ÷ width: the 「◯%OFF」 tag sits on its bottom edge */
  .site-rank > :first-child img { flex: none; aspect-ratio: 16 / 10; }
}
@media (width <= 42.5em) { .site-cats { --ami-cols: 2 !important; --ami-min: 8rem !important; } }

/* ---- list page: filters work without JavaScript (the checked option hides what does not match) ---- */
.site-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.875rem; margin-bottom: clamp(1rem, 3vw, 1.5rem); }
/* left of the sort box: how many products, which ones are shown, and the filters in use */
.site-toolbar__count { margin: 0; font-weight: 900; white-space: nowrap; }
.site-toolbar__count b { margin-right: 0.125rem; color: var(--ami-coral-text); font-size: var(--ami-h3); }
.site-toolbar__count span { color: var(--ami-ink-soft); font-size: var(--fs-sm); font-weight: 500; }
@media (width > 56em) { .site-toolbar .site-active { margin: 0 auto 0 0; } }
.site-active:empty { display: none; }
.site-count--sm { display: none; }   /* the toolbar shows the count on wide screens */
.site-sort { width: auto; min-width: 11rem; }
.ami-filter-btn { margin-bottom: 0.875rem; }
@media (width <= 56em) {
  /* phones: the filter button and the sort box share one row while the filter panel is closed */
  .site-catalog .ami-split--filter { row-gap: 0; }
  .site-toolbar__count { display: none; }   /* phones and tablets: the filter button sits here; the count goes under the list */
  .site-count--sm { display: block; }
  .ami-split--filter:has(.ami-filter-toggle:not(:checked)) .site-toolbar { margin-top: -3.625rem; padding-left: 8.5rem; min-height: 2.75rem; justify-content: flex-end; row-gap: 0.75rem; }
  /* nhãn điều kiện đang lọc: một hàng riêng dưới [絞り込み]…[並び順], rộng hết màn hình và xếp ngang */
  .site-toolbar .site-sort { order: 1; }
  .site-toolbar .site-active { order: 2; flex: 1 0 100%; gap: 0.5rem; margin: 0; }
  .ami-split--filter:has(.ami-filter-toggle:not(:checked)) .site-toolbar .site-active { margin-left: -8.5rem; }
  .site-active .site-filter-tag { min-height: 2.5rem; padding-inline: 0.875rem; font-size: var(--fs-sm); }
}
/* ---- product page ---- */
.site-detail { margin-top: clamp(1.125rem, 3vw, 1.75rem); }
.site-gallery__main { padding: clamp(0.875rem, 2vw, 1.125rem); }
.site-shot { display: none; width: 100%; border-radius: 0.875rem; }
.site-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--ami-gap); margin-top: var(--ami-gap); }
.site-thumb { padding: 0.375rem; cursor: pointer; touch-action: manipulation; transition: transform 0.12s; }
.site-thumb::after { content: none; }   /* too small for the stitched border */
.site-thumb img { width: 100%; border-radius: 1.25rem; }
.site-thumb:active { transform: scale(0.96); }
.site-info span { display: grid; line-height: 1.5; }
.site-info { cursor: auto; }
.site-info small { font-weight: 500; }
.site-more__title { margin-bottom: 0.875rem; }
.site-opt { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; font-weight: 900; }
.site-opt__label { min-width: 3.5em; }
.ami-tabs__panel > * + * { margin-top: 0.75rem; }

/* ---- cart ---- */
.site-ship { display: grid; gap: 0.625rem; }
.site-cart { display: grid; }
.site-item { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto auto; align-items: center; gap: 0.5rem 1rem; padding-block: 1rem; background: url("/kit/assets/svg/dash.svg") left bottom / 1.375rem 0.375rem repeat-x; }
.site-item:first-of-type { padding-top: 0; }
.site-item > img { width: 100%; }
.site-item__info h2 { font-size: 1.05rem; text-wrap: balance; }
.site-item__info .ami-muted { display: block; }
.site-item__price { min-width: 4.5em; text-align: right; font-size: 1.15rem; }
.site-item__del { grid-column: 4; justify-self: end; padding-block: 0.625rem; }
.site-item .ami-qty { grid-row: span 2; }
@media (width <= 36em) {
  .site-item { grid-template-columns: 4.5rem minmax(0, 1fr) auto; }
  .site-item > img { grid-row: span 2; }
  .site-item .ami-qty { grid-row: auto; grid-column: 2; justify-self: start; }
  .site-item__price { grid-column: 3; grid-row: 1; }
  .site-item__del { grid-column: 3; }
}
/* small line of an order (checkout summary) */
.site-mini { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; font-weight: 900; line-height: 1.4; }
.site-mini img { width: 100%; }
.site-mini small { display: block; }

/* ---- order complete ---- */
.site-thanks { display: grid; justify-items: center; gap: 1.25rem; text-align: center; padding-block: clamp(2rem, 6vw, 3rem); }
.site-thanks .ami-photo { width: min(15rem, 62%); }

/* ---- account ---- */
.site-menu { gap: 0.625rem; }
.site-menu [aria-current] { color: var(--ami-coral-text); box-shadow: 0 0 0 0.125rem var(--ami-coral), 0 0.4375rem 0.75rem -0.3125rem rgb(170 50 35 / 0.35); }
.site-orders { min-width: 26rem; }
.site-orders td { font-weight: 500; white-space: nowrap; }

/* ---- footer ---- */
.site-trust { padding-block: 1.75rem 0.25rem; }
.site-footer__deco { position: absolute; right: max(var(--ami-gutter), calc(50% - 38.75rem)); bottom: 3.75rem; width: clamp(5rem, 11vw, 8rem); pointer-events: none; }
@media (width <= 56em) { .site-footer__deco { display: none; } }
.site-pay .ami-tag { font-size: 0.75rem; }
/* a gingham band that ends the page runs straight into the footer; the footer's lace covers the seam */
main:has(> .ami-band:last-child) + .ami-footer,
main:has(> .ami-band + .ami-buybar:last-child) + .ami-footer { margin-top: 0; }

/* ---- journal: post cards, list filter, article ---- */
.site-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: var(--ami-gap); }
.site-post { display: flex; flex-direction: column; padding: 0.875rem; transition: transform 0.18s; }
.site-post > img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 0.875rem; background: var(--ami-blush); }
.site-post__body { display: grid; align-content: start; flex: 1; min-width: 0; gap: 0.5rem; padding: 0.875rem 0.5rem 0.5rem; }
.site-post__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem; margin: 0; color: var(--ami-ink-soft); font-size: 0.875rem; font-weight: 900; letter-spacing: 0.04em; }
.site-post__title { margin: 0; font-size: 1.125rem; line-height: 1.5; }
.site-post__title a { color: inherit; text-decoration: none; }
.site-post__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* the whole card is the link */
.site-post__title a:focus-visible { outline: none; }
.site-post:has(a:focus-visible) { outline: 0.1875rem solid var(--ami-coral-text); outline-offset: 0.125rem; }
.site-post__text { margin: 0; color: var(--ami-ink-soft); font-size: 0.9375rem; line-height: 1.7; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.site-post:active { transform: scale(0.98); }
@media (hover: hover) { .site-post:hover .site-post__title { color: var(--ami-coral-text); } }
@media (width > 56em) {
  /* the newest post leads the list: photo on the left, words on the right */
  .site-post--lead { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 1.5rem; padding: 1.125rem; --ami-card-stitch: var(--ami-stitch); }
  .site-post--lead > img { width: 46%; }
  .site-post--lead .site-post__body { flex: 1; padding: 0.5rem 1rem 0.5rem 0; gap: 0.75rem; }
  .site-post--lead .site-post__title { font-size: var(--ami-h2); line-height: 1.4; }
  .site-post--lead .site-post__text { font-size: 1rem; -webkit-line-clamp: 3; line-clamp: 3; }
}
@media (width <= 30em) {
  /* phones: small photo beside the words, so three posts fit on one screen */
  .site-post:not(.site-post--lead) { flex-direction: row; align-items: center; gap: 0.75rem; padding: 0.75rem; }
  .site-post:not(.site-post--lead) > img { flex: none; width: 6.5rem; aspect-ratio: 1; }
  .site-post:not(.site-post--lead) .site-post__body { padding: 0; gap: 0.375rem; }
  .site-post:not(.site-post--lead) .site-post__title { font-size: 1rem; }
  .site-post:not(.site-post--lead) .site-post__text { display: none; }
}
/* category tabs: radios, the checked one hides the posts that do not match */
.site-journal__tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: clamp(1rem, 2.5vw, 1.5rem); }
.site-journal__tabs span { display: grid; place-items: center; min-height: 2.75rem; padding: 0 1.25rem; border-radius: 99rem; border: 0.125rem dashed var(--ami-thread); background: var(--ami-paper); font-weight: 900; white-space: nowrap; cursor: pointer; touch-action: manipulation; }
.site-journal__tabs :checked + span { border-color: rgb(255 255 255 / 0.85); background: var(--ami-coral-text); color: #fff; box-shadow: 0 0 0 0.1875rem var(--ami-coral-text); }
.site-journal__tabs :focus-visible + span { outline: 0.1875rem solid var(--ami-coral-text); outline-offset: 0.25rem; }
/* article */
.site-article { display: grid; gap: 1.125rem; min-width: 0; }
.site-article > h1 { margin: 0; line-height: 1.45; }
.site-article__photo { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.site-prose { display: grid; gap: 1rem; line-height: 1.95; }
.site-prose > * { margin: 0; }
.site-prose h2 { margin-top: 1rem; padding-left: 0.875rem; border-left: 0.3125rem solid var(--ami-coral); font-size: var(--ami-h3); line-height: 1.5; }
.site-prose :is(ul, ol) { display: grid; gap: 0.375rem; padding-left: 1.5rem; }
.site-prose li::marker { color: var(--ami-coral-text); font-weight: 900; }
.site-article__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1rem; padding-top: 1.25rem; background: url("/kit/assets/svg/dash.svg") left top / 1.375rem 0.375rem repeat-x; }
.site-article__nav a { display: grid; align-content: start; gap: 0.25rem; min-height: 2.75rem; padding: 0.75rem 1rem; border-radius: var(--ami-radius-sm); background: var(--ami-paper); box-shadow: var(--ami-shadow-soft); color: inherit; font-weight: 900; line-height: 1.5; text-decoration: none; touch-action: manipulation; }
.site-article__nav a[rel="next"] { text-align: right; }
.site-article__nav small { color: var(--ami-coral-text); }
.site-article__nav a:active { background: var(--ami-blush); }
@media (width <= 30em) { .site-article__nav { grid-template-columns: 1fr; } .site-article__nav span { display: none; } .site-article__nav a[rel="next"] { text-align: left; } }
.site-recent { display: grid; grid-template-columns: 4rem minmax(0, 1fr); align-items: center; gap: 0.75rem; min-height: 2.75rem; color: inherit; font-weight: 900; line-height: 1.5; text-decoration: none; touch-action: manipulation; }
.site-recent img { width: 100%; height: auto; aspect-ratio: 1; }
.site-recent small { display: block; color: var(--ami-ink-soft); font-weight: 500; }
.site-recent:active { color: var(--ami-coral-text); }
.site-article ~ aside .ami-tag { display: inline-grid; place-items: center; min-height: 2.75rem; color: inherit; text-decoration: none; touch-action: manipulation; }
.site-prose ul { list-style: disc; }
.site-prose ol { list-style: decimal; }

/* ================= amichan (Next.js) ================= */
/* Font hệ thống, độ đậm bình thường. UI kit đặt 500 (chữ thường) và 900 (tiêu đề) — với font hệ thống
   900 thành nét W9 rất dày. "AmiSans" chỉ trỏ tới hai nét có sẵn trong máy (không tải gì):
   ≤550 -> Regular, >550 -> Bold. */
@font-face {
  font-family: "AmiSans";
  font-weight: 1 550;
  src: local("HiraginoSans-W3"), local("Hiragino Sans W3"), local("HiraKakuProN-W3"), local("YuGothic-Regular"), local("Yu Gothic Regular"),
    local("YuGothicUI-Regular"), local("Meiryo"), local("NotoSansJP-Regular"), local("Noto Sans JP Regular"), local("NotoSansCJKjp-Regular");
}
@font-face {
  font-family: "AmiSans";
  font-weight: 551 1000;
  src: local("HiraginoSans-W6"), local("Hiragino Sans W6"), local("HiraKakuProN-W6"), local("YuGothic-Bold"), local("Yu Gothic Bold"),
    local("YuGothicUI-Bold"), local("Meiryo-Bold"), local("Meiryo Bold"), local("NotoSansJP-Bold"), local("Noto Sans JP Bold"), local("NotoSansCJKjp-Bold");
}
:root { --ami-font: "AmiSans", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans JP", system-ui, sans-serif; }
.site-results ~ .ami-pager::before { content: none; }
.site-count { color: var(--ami-ink-soft); font-size: 0.9375rem; text-align: center; margin-top: 1rem; }
.site-filter-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
/* gallery (React): the chosen photo shows, the chosen thumb gets a ring */
.site-shot { display: block; aspect-ratio: 1; object-fit: cover; }
.site-thumbs { grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr)); }
.site-thumb { border: 0; background: none; font: inherit; }
.site-thumb[aria-pressed="true"] { box-shadow: 0 0 0 0.1875rem var(--ami-coral), 0 0.5rem 0.875rem -0.375rem rgb(110 60 35 / 0.35); }
.site-thumb img { aspect-ratio: 1; object-fit: cover; }
.ami-product img { aspect-ratio: 1; object-fit: cover; }
.site-item > img, .site-mini img { aspect-ratio: 1; object-fit: cover; }
.ami-tile img { aspect-ratio: 4 / 3; object-fit: cover; }
.site-noimg { display: grid; place-items: center; aspect-ratio: 1; border-radius: 1.25rem; background: var(--ami-blush); color: var(--ami-ink-soft); font-size: 0.875rem; }
/* checkout */
.site-name2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.site-zip { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.site-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.site-review dt { color: var(--ami-ink-soft); font-size: 0.875rem; }
.site-review dd { margin: 0 0 0.75rem; font-weight: 900; }
.site-thanks .ami-table { text-align: left; width: 100%; }
.site-pay-note { text-align: left; }
.site-pay-note li { list-style: disc; margin-left: 1.25rem; }
.site-amount { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.2rem); }
/* legal / content pages */
.site-content table { width: 100%; }
.site-content .ami-table th { width: 32%; }
.site-content th, .site-content td { text-align: left; vertical-align: top; }
/* cart stock message */
.site-item__warn { grid-column: 2 / -1; color: var(--ami-coral-text); font-size: 0.875rem; font-weight: 900; }

/* Giảm chuyển động: bỏ hiệu ứng nhấc/nghiêng/phóng to khi rê chuột của kit.
   Giữ hiệu ứng nhấn (:active) nhỏ để có phản hồi khi chạm. */
@media (hover: hover) {
  .ami-btn:hover, .ami-product:hover, .ami-tile:hover, .ami-tile:hover img,
  .ami-cat:hover, .ami-pager > a:hover, .ami-check:enabled:hover { transform: none; }
}
.ami-sway, .ami-rise, .ami-reveal { animation: none; }

/* Tab chuyên mục よみもの dạng link (bản demo dùng radio) */
.site-journal__tabs a { color: inherit; text-decoration: none; }
.site-journal__tabs [aria-current] > span { border-color: rgb(255 255 255 / 0.85); background: var(--ami-coral-text); color: #fff; box-shadow: 0 0 0 0.1875rem var(--ami-coral-text); }
.site-journal__tabs a:focus-visible { outline: none; }
.site-journal__tabs a:focus-visible > span { outline: 0.1875rem solid var(--ami-coral-text); outline-offset: 0.25rem; }
.site-article__photo { aspect-ratio: 3 / 2; }
.site-article .site-prose img { max-width: 100%; height: auto; border-radius: var(--ami-radius-sm); }

/* FAQ */
.site-faq { scroll-margin-top: 6rem; }
.site-faq .ami-answer .site-prose { min-width: 0; gap: 0.5rem; }
.site-faq .ami-answer .site-prose > :first-child { margin-top: 0; }
.site-faq__jump { display: inline-grid; place-items: center; min-height: 2.75rem; color: inherit; text-decoration: none; }
/* Liên hệ */
.site-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* Link trong nội dung Markdown (FAQ, よみもの, trang nội dung) */
.site-prose a { color: var(--ami-coral-text); font-weight: 900; text-decoration: underline; text-underline-offset: 0.25rem; }
.site-prose a:active { opacity: 0.7; }

/* Thành viên */
.site-name-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.875rem; }
.site-auth { max-width: 34rem; margin-inline: auto; }
.site-addr { display: grid; gap: 0.25rem; line-height: 1.7; }
.site-addr__tools { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin-top: 0.5rem; }
.site-linkbtn { appearance: none; border: 0; padding: 0.25rem 0; background: none; color: var(--ami-coral-text); font: inherit; font-weight: 900; text-decoration: underline; text-underline-offset: 0.25rem; cursor: pointer; }
.site-linkbtn:disabled { opacity: 0.5; cursor: default; }
.site-menu__logout { width: 100%; border: 0; font: inherit; font-weight: 900; color: inherit; text-align: left; }
.site-orders a { font-weight: 900; }
/* Yêu thích */
.site-favbtn { justify-self: center; }
.site-favbtn .ami-icon { width: 1.375rem; }
.site-favbtn[aria-pressed="true"] { color: var(--ami-coral-text); }

/* ---------- Tối ưu form: gợi ý email, hiện mật khẩu, đồng ý điều khoản ---------- */
.site-suggest { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; font-size: 0.9375rem; color: var(--ami-ink); }
.site-pw { position: relative; display: block; }
.site-pw > .ami-input { width: 100%; padding-right: 4.25rem; }
.site-pw__toggle { position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); appearance: none; border: 0; background: none; padding: 0.375rem 0.5rem; font: inherit; font-size: 0.875rem; font-weight: 900; color: var(--ami-coral-text); cursor: pointer; }
.site-agree { font-size: 0.875rem; line-height: 1.7; }

/* ---------- Mã giảm giá ---------- */
.site-coupon { display: grid; gap: 0.375rem; padding: 0.75rem 0; border-block: 0.125rem dashed var(--ami-line); }
.site-coupon__row { display: flex; gap: 0.5rem; align-items: center; }
.site-coupon__row .ami-input { flex: 1; min-width: 0; text-transform: uppercase; }
.site-coupon__on { display: flex; flex-wrap: wrap; gap: 0.25rem 0.625rem; align-items: center; font-size: 0.9375rem; }
.site-discount { color: var(--ami-coral-text); font-weight: 900; }

/* ---------- Popup 「カートに入れました」 ---------- */
.site-dialog { border: 0; padding: 0; background: transparent; width: min(26rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow: visible; color: inherit; }
.site-dialog::backdrop { background: rgb(90 45 30 / 0.4); }
.site-dialog__box { max-height: calc(100dvh - 2rem); overflow-y: auto; }
.site-dialog__x { appearance: none; border: 0; background: none; font: inherit; font-size: 1.75rem; line-height: 1; padding: 0.25rem 0.5rem; cursor: pointer; color: var(--ami-ink-soft); }
.site-dialog__ship p { margin: 0; }
.site-dialog__cont { justify-self: center; }
body:has(.site-dialog[open]) { overflow: hidden; }

/* ---------- Bảng trong trang nội dung (特商法, お店について…) ---------- */
.site-prose table { width: 100%; border-collapse: collapse; }
.site-prose thead:not(:has(th:not(:empty))) { display: none; } /* hàng tiêu đề trống "| | |" */
.site-prose :is(th, td) { padding: 0.75rem 0.5rem; vertical-align: top; text-align: left; border-bottom: 0.125rem dashed var(--ami-line); }
.site-prose td:first-child { width: 1%; white-space: nowrap; padding-right: 1.25rem; font-weight: 900; color: var(--ami-ink-soft); }
@media (width <= 42.5em) {
  .site-prose :is(table, tbody, tr, td) { display: block; }
  .site-prose td { padding: 0 0 0.75rem; border: 0; }
  .site-prose td:first-child { width: auto; white-space: normal; padding: 0.75rem 0 0.25rem; }
  .site-prose tr { border-bottom: 0.125rem dashed var(--ami-line); }
}

/* ---------- Nút 「カートに入れる」 trên thẻ sản phẩm ---------- */
.site-cardbtn { margin-top: 0.75rem; position: relative; z-index: 1; gap: 0.375rem; min-height: 2.75rem; padding-block: 0.55em 0.65em; }   /* full tap height; the stitched inner border needs room to breathe */
.site-cardbtn .ami-icon { width: 1.25rem; height: 1.25rem; }
@media (width <= 42.5em) { .site-cardbtn { min-height: 2.5rem; padding-inline: 0.5rem; letter-spacing: 0.02em; } .site-cardbtn .ami-icon { display: none; } }

/* ---- type scale: one set of sizes for the whole site ----
   The kit's sizes were made for a heavy rounded font. With the system font they read too large on
   tablets and desktops, so every size here grows gently between a 360px phone and a 1440px screen. */
:root {
  --fs-2xs: 0.6875rem;                                    /* 11px: tab bar labels */
  --fs-xs: clamp(0.75rem, 0.73rem + 0.1vw, 0.8125rem);    /* 12–13: badges, notes */
  --fs-sm: clamp(0.8125rem, 0.79rem + 0.12vw, 0.875rem);  /* 13–14: captions, meta */
  --ami-text: clamp(0.9375rem, 0.91rem + 0.12vw, 1rem);   /* 15–16: body */
  --fs-md: clamp(1rem, 0.96rem + 0.18vw, 1.125rem);       /* 16–18: card titles, buttons */
  --fs-lg: clamp(1.0625rem, 0.99rem + 0.35vw, 1.25rem);   /* 17–20: prices, emphasis */
  --ami-h3: clamp(1.0625rem, 0.99rem + 0.35vw, 1.25rem);  /* 17–20 */
  --ami-h2: clamp(1.3125rem, 1.15rem + 0.75vw, 1.75rem);  /* 21–28 */
  --ami-h1: clamp(1.625rem, 1.3rem + 1.5vw, 2.5rem);      /* 26–40 */
}
.ami-logo { font-size: clamp(1.125rem, 0.97rem + 0.7vw, 1.625rem); }
.ami-nav { font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem); }
.ami-topbar { font-size: var(--fs-sm); }
.ami-btn { font-size: var(--fs-md); }
.ami-btn--lg { font-size: var(--fs-lg); }
.ami-btn--sm { font-size: var(--fs-sm); min-height: 2.5rem; padding-block: 0.5em 0.6em; }   /* the kit's small size was 31px tall: too flat beside the stitched border */
.ami-chip span { font-size: clamp(0.875rem, 0.84rem + 0.2vw, 1rem); }
.ami-product__name { font-size: var(--fs-md); }
.ami-product__price { font-size: var(--fs-lg); }
.ami-product__badge { font-size: var(--fs-xs); }
.ami-product__rate, .ami-footer__bottom { font-size: var(--fs-sm); }
.site-cardbtn { font-size: clamp(0.8125rem, 0.78rem + 0.15vw, 0.9375rem); }
.ami-steps { font-size: clamp(0.75rem, 0.7rem + 0.25vw, 0.9375rem); }
.ami-pager { font-size: var(--fs-md); }
.ami-row--card > summary { font-size: 1.05em; }
.ami-feature b, .ami-footer__title { font-size: var(--fs-md); }
.ami-rating__score b { font-size: clamp(2rem, 1.7rem + 1.2vw, 2.75rem); }
.site-rank > :first-child .ami-product__name { font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem); }
.site-rank > :first-child .ami-product__price { font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.75rem); }
.site-rank > :first-child .ami-product__badge { font-size: var(--fs-sm); }
.site-item__info h2 { font-size: var(--fs-md); }
.site-item__price { font-size: var(--fs-lg); }
.site-post__title { font-size: var(--fs-md); }
.site-post__text, .site-count, .site-suggest, .site-coupon__on { font-size: var(--fs-sm); }
.site-post__meta, .site-review dt, .site-noimg, .site-item__warn, .site-agree, .site-pw__toggle { font-size: var(--fs-xs); }
.site-amount { font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem); }
.site-hero .ami-banner__title { font-size: clamp(1.75rem, 1.3rem + 2vw, 3rem); }   /* the home hero sits on a large photo */
@media (width <= 42.5em) {
  .ami-topbar { font-size: var(--fs-xs); }
  .ami-tabbar, .ami-tabbar b { font-size: var(--fs-2xs); }
  .ami-buybar .ami-price { font-size: 1.25rem; }
  .ami-buybar .ami-btn { font-size: 1rem; }
  .ami-nav { font-size: 1.0625rem; }   /* the slide-out menu: bigger targets on a phone */
  /* header row on phones: the logo takes only the space left over (and shrinks with the screen),
     so the search, basket and menu buttons never drop to a second row */
  .ami-header--shop .ami-logo { flex: 1 1 0; font-size: clamp(1rem, 0.5rem + 2.4vw, 1.25rem); }
  @media (width <= 24em) { .ami-header--shop .ami-header__in { column-gap: 0.25rem; } .ami-header--shop .ami-logo { gap: 0.25rem; } }   /* small phones: tighter icons so the whole name fits */
  /* two cards per row: smaller names keep the price and button on one line */
  .ami-product__name { font-size: 0.9375rem; }
  .ami-product__price { font-size: 1.0625rem; }
}

/* ---- button width: forms and stacks are grids, which stretch a button across the whole card.
   On wide screens a button keeps a comfortable width; on phones it stays full width, easy to tap. ---- */
.ami-btn--block { max-width: 26rem; margin-inline: auto; }
:where(.ami-form, .ami-stack) > .ami-btn:not(.ami-btn--block) { justify-self: center; min-width: min(100%, 15rem); }
.site-cardbtn { max-width: 18rem; }
@media (width > 42.5em) { .site-buy > .ami-btn { justify-self: start; margin-inline: 0; } }   /* product page: in line with the price and quantity above */
@media (width <= 42.5em) {
  :where(.ami-form, .ami-stack) > .ami-btn:not(.ami-btn--block) { justify-self: stretch; }
}

/* ---- back-to-top button: appears once the page has scrolled about one screen ---- */
.site-totop-mark { position: absolute; top: 100vh; left: 0; width: 1px; height: 1px; pointer-events: none; }
.site-totop {
  position: fixed; z-index: 14; right: max(1rem, env(safe-area-inset-right)); bottom: max(1.25rem, env(safe-area-inset-bottom));
  display: grid; place-items: center; align-content: center; width: 3.25rem; height: 3.25rem; padding: 0; border: 0; border-radius: 50%;
  color: var(--ami-coral-text); background: var(--ami-paper); outline: 0.125rem dashed var(--ami-thread); outline-offset: -0.3125rem; box-shadow: var(--ami-shadow-felt);
  font: 900 0.625rem / 1 var(--ami-font); letter-spacing: 0.06em; cursor: pointer; touch-action: manipulation;
  opacity: 0; visibility: hidden; translate: 0 0.75rem; transition: opacity 0.2s, translate 0.2s, visibility 0s 0.2s;
}
.site-totop svg { margin-top: -0.125rem; }
.site-totop[data-show] { opacity: 1; visibility: visible; translate: 0; transition-delay: 0s; }
.site-totop:active { translate: 0 0.125rem; }
.site-totop:focus-visible { outline: 0.1875rem solid var(--ami-coral-text); outline-offset: 0.1875rem; }
@media (hover: hover) { .site-totop:hover { color: var(--ami-paper); background: var(--ami-coral); outline-color: rgb(255 255 255 / 0.8); } }
@media (width <= 42.5em) {
  .site-totop { width: 2.875rem; height: 2.875rem; right: max(0.75rem, env(safe-area-inset-right)); bottom: calc(4.5rem + env(safe-area-inset-bottom)); }   /* above the tab bar */
  body:has(.ami-buybar) .site-totop { bottom: calc(5.5rem + env(safe-area-inset-bottom)); }   /* product page: above the buy bar */
}
@media (prefers-reduced-motion: reduce) { .site-totop { transition: none; } }
@media print { .site-totop { display: none; } }

/* product carousels on phones: one card about as wide as a list-page card, with the next one peeking in,
   so the card button's label stays on one line */
@media (width <= 42.5em) { .site-pcar .ami-carousel__track { grid-auto-columns: min(11.5rem, 72%); } }
@media (42.5em < width <= 60em) { .site-pcar .ami-carousel__track { --ami-n: 3; } }   /* tablets: three cards instead of four */

/* ---- required mark: 「必須」 beside the label of every required field; optional ones say （任意） ---- */
.site-req {
  display: inline-block; margin-left: 0.5em; padding: 0.15em 0.5em 0.2em; border-radius: 0.3125rem; vertical-align: 0.1em;
  color: #fff; background: var(--ami-coral-text); font-size: 0.6875rem; font-weight: 900; letter-spacing: 0.06em; line-height: 1.2; white-space: nowrap;
}
.ami-field small.ami-muted { margin-left: 0.25em; font-weight: 500; }
@media (width > 42.5em) { .ami-field--row { grid-template-columns: 11em minmax(0, 1fr); } }   /* room for 「メールアドレス 必須」 on one line */
@media (forced-colors: active) { .site-req { border: 1px solid; } }
/* checkbox + sentence (agree to terms, etc.): the box stays on the left and the sentence wraps beside it */
label.ami-cluster:has(> .ami-check) { flex-wrap: nowrap; align-items: center; }
label.ami-cluster:has(> .ami-check) > :not(.ami-check) { flex: 1 1 auto; min-width: 0; }
/* a short note such as （任意） moves to the next line as a whole instead of breaking in the middle */
.ami-field small.ami-muted { display: inline-block; }
/* total row: 「合計（税込）」 stays on one line even in the narrow order summary */
dt.ami-totals__sum { white-space: nowrap; }
dt.ami-totals__sum small { font-size: 0.6em; font-weight: 500; }

/* ---- sale price: the selling price in coral, the old price struck through, and a small 「◯%OFF」 tag ---- */
.site-pricetag { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0 0.5em; }
.site-pricetag__was { color: var(--ami-ink-soft); font-size: 0.62em; font-weight: 500; text-decoration-thickness: 0.08em; white-space: nowrap; }
.site-pricetag__off {
  align-self: center; padding: 0.2em 0.5em 0.25em; border-radius: 0.3125rem; color: #fff; background: var(--ami-coral-text);
  font-size: max(0.6875rem, 0.5em); font-weight: 900; letter-spacing: 0.04em; line-height: 1.1; white-space: nowrap;
}
.site-buy .site-pricetag { justify-content: flex-start; }
.site-buy .site-pricetag__was { font-size: 0.5em; }
.site-buy .site-pricetag__off { font-size: 0.8125rem; }
/* the card's stitched dash above the price takes its own row (the price is a flex row when on sale) */
.ami-product__price.site-pricetag::before { flex: 0 0 100%; box-sizing: border-box; width: auto; padding-inline: calc(50% - 2.0625rem); background-clip: content-box; background-origin: content-box; }

/* ===== Social share (product detail) ===== */
.site-share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding-top: .875rem; border-top: 2px dashed var(--ami-line); }
.site-share__label { font-size: var(--fs-sm); font-weight: 700; color: var(--ami-ink-soft); }
.site-share__list { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.site-share__btn {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  color: #fff; background: var(--sns, var(--ami-ink-soft)); border: 0; cursor: pointer;
  box-shadow: 0 .1875rem 0 color-mix(in srgb, var(--sns, #555) 70%, #000);
  transition: transform .15s, box-shadow .15s;
}
.site-share__btn:hover { transform: translateY(-2px); box-shadow: 0 .3125rem 0 color-mix(in srgb, var(--sns, #555) 70%, #000); }
.site-share__btn:active { transform: translateY(2px); box-shadow: 0 .0625rem 0 color-mix(in srgb, var(--sns, #555) 70%, #000); }
.site-share__btn:focus-visible { outline: 3px solid var(--ami-coral); outline-offset: 2px; }
.site-share__btn--x { --sns: #111; }
.site-share__btn--line { --sns: #06c755; }
.site-share__btn--line svg { width: 24px; height: 24px; }
.site-share__btn--facebook { --sns: #1877f2; }
.site-share__btn--pinterest { --sns: #e60023; }
.site-share__btn--link, .site-share__btn--more { --sns: #8a7468; }
.site-share__done { font-size: var(--fs-xs); font-weight: 700; color: #0a7d3b; }
.site-share__done:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .site-share__btn { transition: none; } .site-share__btn:hover, .site-share__btn:active { transform: none; } }
.site-share__btn--line text { fill: var(--sns); }

/* ===== Product cards on phones: a shorter card =====
   two cards per row leaves ~150–190px per card, so the desktop layout stacked into a tall strip.
   Phones get tighter padding, at most two lines of name, no stitched dash, the old price on the
   same row as the price, the 「◯%OFF」 tag on the photo corner, and the button closer to the price. */
@media (width <= 42.5em) {
  .ami-product { --pad: 0.5rem; padding: var(--pad) var(--pad) 0.625rem; container-type: inline-size; }
  .ami-product__name {
    margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.35;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  }
  .ami-product__price { padding-top: 0.25rem; font-size: 1.0625rem; }
  .ami-product__price::before, .ami-product__price.site-pricetag::before { content: none; }
  .ami-product .site-pricetag { flex-wrap: nowrap; gap: 0 0.375em; }
  .ami-product .site-pricetag__was { font-size: 0.7em; }
  /* the 「◯%OFF」 tag sits on the bottom-left corner of the photo (the card is the container: 100cqw = photo width) */
  .ami-product .site-pricetag__off {
    position: absolute; z-index: 1; left: calc(var(--pad) + 0.375rem); top: calc(var(--pad) + 100cqw * var(--photo-ratio, 1) - 1.75rem);
    font-size: 0.75rem; box-shadow: 0 0.125rem 0 rgb(120 20 10 / 0.25);
  }
  .ami-product__badge { min-width: 2.75rem; height: 2.75rem; font-size: 0.6875rem; top: -0.5rem; left: -0.375rem; }
  .ami-product .ami-fav { top: 0.125rem; right: 0.125rem; }
  .site-cardbtn { margin-top: 0.5rem; }
}

/* ===== 「入荷お知らせ」: products not on sale yet (販売前) or sold out take an email instead of an order ===== */
.site-notify { display: grid; gap: 0.75rem; scroll-margin-top: 6rem; }
.site-notify__lead { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-weight: 700; }
.site-notify__lead .ami-icon { flex: none; width: 1.5rem; height: 1.5rem; }
.site-notify__form { display: grid; gap: 0.75rem; padding: 1rem; border-radius: var(--ami-radius-sm); background: var(--ami-paper); box-shadow: var(--ami-shadow-soft); }
.site-notify__form small { line-height: 1.6; }
.site-notify__done {
  display: grid; gap: 0.25rem; padding: 0.875rem 1rem; border-radius: var(--ami-radius-sm);
  background: color-mix(in srgb, var(--ami-green) 16%, var(--ami-paper)); border: 2px dashed color-mix(in srgb, var(--ami-green) 60%, transparent);
}
.site-notify__done b { color: #4d6630; }
.site-notify__mail { font-weight: 700; word-break: break-all; }
.site-notify__again { justify-self: start; padding: 0; border: 0; background: none; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
@media (width > 42.5em) { .site-buy .site-notify__btn, .site-buy .site-notify__form > .ami-btn { justify-self: start; margin-inline: 0; } }
/* card badge 「近日発売」: a soft green, not the greyed-out sold-out look */
.site-soon .ami-product__badge { color: #fff; background: var(--ami-green); box-shadow: 0 0.1875rem 0 #6c8449, 0 0.5rem 0.625rem -0.25rem rgb(60 80 30 / 0.4); text-shadow: 0 0.0625rem 0.125rem rgb(40 60 20 / 0.5); }
.site-soon .ami-product__badge::before { border-color: rgb(255 255 255 / 0.85); }
.site-cardbtn .ami-icon--mail { width: 1.25rem; height: 1.25rem; }
.site-notify__member { display: grid; gap: 0.5rem; }
.site-notify__member small { line-height: 1.6; }
.site-notify__member .site-notify__again { margin-left: 0.5em; }

/* ---- sale price, 2 columns: the price on the left; on the right the 「◯%OFF」 tag sits above the struck-through old price.
   Cards on PC and the product page (on phones a card's tag is on the photo, see above) ---- */
.site-buy .site-pricetag,
.ami-product__price.site-pricetag {
  display: inline-grid; grid-template-columns: auto auto; grid-template-areas: "price off" "price was";
  align-items: center; column-gap: 0.5em; row-gap: 0.125rem;
}
.site-pricetag > .ami-price { grid-area: price; line-height: 1.1; }
.site-pricetag > .site-pricetag__off { grid-area: off; justify-self: start; align-self: end; }
.site-pricetag > .site-pricetag__was { grid-area: was; justify-self: start; align-self: start; line-height: 1.2; }
.site-buy .site-pricetag__off { font-size: 0.75rem; }
/* card: the stitched dash stays a full row above, everything centred */
.ami-product__price.site-pricetag { display: grid; justify-content: center; grid-template-areas: "dash dash" "price off" "price was"; }
.ami-product__price.site-pricetag::before { grid-area: dash; padding-inline: 0; width: 4.125rem; justify-self: center; }
.ami-product .site-pricetag__was { font-size: 0.68em; }
.ami-product .site-pricetag__off { font-size: 0.6875rem; padding: 0.15em 0.45em 0.2em; }
@media (width <= 42.5em) {
  /* phone cards: tag on the photo, old price beside the price on one row */
  .ami-product__price.site-pricetag { display: flex; grid-template-areas: none; }
}

/* square bottom corners: page banners (.site-bg--hero-list) and the home hero slides */
.ami-banner.site-bg--hero-list, .site-herocar .site-hero, .site-herocar .ami-carousel__track { border-radius: 0; }

/* ---- audit: footer deco không che link, tiêu đề không dính viền ren, vùng bấm đủ lớn trên điện thoại ---- */
@media (width > 56em) { .ami-footer__cols { padding-right: clamp(5rem, 11vw, 8rem); } }
.ami-main > .ami-heading:first-child, .ami-main > h1:first-child { margin-top: clamp(0.75rem, 3vw, 1.25rem); }
@media (width <= 42.5em) {
  .ami-crumbs a { min-height: 2.5rem; }
  .site-pw__toggle { min-height: 2.75rem; min-width: 2.75rem; }
  .ami-center > .ami-link:only-child { display: inline-flex; align-items: center; min-height: 2.75rem; }
  .site-filter-tag { display: inline-flex; align-items: center; }
}

/* ---- マイページ: PC thì menu bên trái dính theo khi cuộn; điện thoại cuộn tới nội dung có chừa khoảng trên ---- */
@media (width > 56em) {
  .ami-split--filter > .site-menu { position: sticky; top: 1.25rem; align-self: start; }
}
.site-account__body { scroll-margin-top: 0.75rem; }

/* ---- bảng nhãn – nội dung (ご利用ガイド, 商品の仕様, ご注文詳細…): nhãn 1/3, nội dung 2/3 ở mọi màn hình.
   Nền viên thuốc của nhãn vẽ trên <span> thay vì ::before cao cố định, để nhãn dài xuống dòng vẫn nằm gọn trong viên thuốc ---- */
.ami-table:not(.site-sumtable):has(th[scope="row"]) { table-layout: fixed; }
.ami-table:not(.site-sumtable) th[scope="row"] { width: 33.333%; white-space: normal; padding-inline: 0.25rem clamp(0.375rem, 1.5vw, 0.75rem); }
.ami-table:not(.site-sumtable) th[scope="row"]::before { content: none; }
.ami-table:not(.site-sumtable) th[scope="row"] > span {
  display: block; padding: 0.5rem 0.375rem 0.4375rem; line-height: 1.45; text-wrap: balance; overflow-wrap: anywhere;
  border-radius: var(--ami-radius-sm); background: var(--ami-blush); box-shadow: var(--ami-shadow-soft);
  outline: 0.0938rem dashed rgb(224 85 75 / 0.5); outline-offset: -0.25rem;
}
.ami-table:not(.site-sumtable) td { overflow-wrap: anywhere; }
@media (width <= 42.5em) { .ami-table:not(.site-sumtable) th[scope="row"] > span { font-size: 0.8125rem; padding-inline: 0.25rem; } }

/* ---- ご利用ガイド「ご購入の流れ」: điện thoại xếp ngang, icon bên trái, tiêu đề + mô tả bên phải ---- */
@media (width <= 42.5em) {
  .site-steps { gap: 0; grid-template-columns: minmax(0, 1fr) !important; }   /* mỗi bước 1 hàng (lưới gốc tự xếp 2 cột khi màn rộng hơn ~375px) */
  .site-steps .ami-feature { grid-template-columns: 3rem minmax(0, 1fr); column-gap: 0.875rem; row-gap: 0.125rem; align-items: center; justify-items: start; text-align: left; padding-block: 0.875rem; }
  .site-steps .ami-feature + .ami-feature { background: url("/kit/assets/svg/dash.svg") left top / 1.375rem 0.375rem round no-repeat; }
  .site-steps .ami-feature .ami-icon { grid-row: span 2; width: 3rem; align-self: center; }
  .site-steps .ami-feature b { align-self: end; }
}

/* ---- Safari (iPhone) áp text-wrap: pretty của kit rất mạnh với tiếng Nhật: ngắt dòng sớm cho đều,
   làm đoạn văn dồn sang trái và để trống bên phải. Văn bản thường: ngắt dòng bình thường, chạy hết chiều ngang ---- */
.ami-page :where(p, li, dd, .ami-note):lang(ja) { text-wrap: wrap; }

/* ảnh chèn trong nội dung Markdown (bài viết, mô tả sản phẩm, trang nội dung): co theo khung, bo góc */
.site-prose img { display: block; max-width: 100%; height: auto; margin-block: 1rem; border-radius: var(--ami-radius-sm); }

/* ===== 「チャオあみからのお知らせ」: newsletter sign-up inside articles ===== */
.site-newsletter { display: grid; gap: 0.75rem; margin-top: 2.5rem; }
.site-newsletter h2 { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.site-newsletter h2 .ami-icon { flex: none; width: 1.75rem; height: 1.75rem; }
.site-newsletter p { margin: 0; line-height: 1.8; }
.site-newsletter small { line-height: 1.6; }
.site-newsletter__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.625rem; align-items: end; }
.site-newsletter__form .ami-field { min-width: 0; }
@media (width <= 30em) { .site-newsletter__form { grid-template-columns: minmax(0, 1fr); } .site-newsletter__form .ami-btn { width: 100%; } }

/* FAQ block at the end of an article (## よくある質問 + ### questions in the Markdown) */
.site-postfaq { margin-top: 2.5rem; }

/* ===== loading.tsx: spinning yarn ball while the next page loads (fades in after 0.15s so fast loads don't flash) ===== */
.site-loading {
  display: grid; place-content: center; justify-items: center; gap: 0.75rem;
  min-height: min(60vh, 32rem); padding: 3rem 1rem; color: var(--ami-ink-soft); font-weight: 700; font-size: 0.9375rem;
  animation: site-loading-in 0.2s ease-out 0.15s both;
}
.site-loading .ami-icon { width: 3.25rem; height: 3.25rem; animation: site-loading-spin 1s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite; }
@keyframes site-loading-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes site-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .site-loading .ami-icon { animation: site-loading-pulse 1.4s ease-in-out infinite; } }
@keyframes site-loading-pulse { 50% { opacity: 0.4; } }

/* ===== top progress bar during client navigation (components/NavProgress.tsx) ===== */
.site-navbar {
  position: fixed; inset: 0 0 auto; z-index: 1000; height: 3px; pointer-events: none;
  background: linear-gradient(90deg, var(--ami-coral), var(--ami-pink));
  transform-origin: 0 50%; transform: scaleX(0); opacity: 0;
  transition: transform 0.25s ease-out, opacity 0.3s ease 0.15s;
}
.site-navbar.is-active { opacity: 1; transition: opacity 0.1s ease 0.1s; animation: site-navbar-grow 8s cubic-bezier(0.1, 0.7, 0.2, 1) 0.1s forwards; }
@keyframes site-navbar-grow { from { transform: scaleX(0.05); } 20% { transform: scaleX(0.45); } to { transform: scaleX(0.92); } }
.site-navbar.is-done { transform: scaleX(1); opacity: 0; transition: transform 0.2s ease-out, opacity 0.25s ease 0.2s; }
@media (prefers-reduced-motion: reduce) { .site-navbar.is-active { animation: none; transform: scaleX(0.6); } }

/* ===== order flow polish (checkout / cart / complete) ===== */
/* tablet: cart, checkout and article drop to one column; side by side the form column got too narrow for label + input rows */
@media (width <= 56em) { .ami-split--aside { grid-template-columns: minmax(0, 1fr); } }
/* 「選択してください」 fits in the prefecture select */
select.ami-input--short { max-width: 14em; }
/* totals: values like 「お届け先により計算」 stay on one line */
.ami-page .ami-totals dd { white-space: nowrap; text-wrap: nowrap; } /* beats the :lang(ja) text-wrap rule */
/* steps as the first thing on a page (complete page): keep clear of the header lace */
.ami-main > .ami-steps:first-child { margin-top: clamp(0.5rem, 2vw, 1rem); }
/* Japanese line breaking: never start a line with ー or small kana (くまのキーホルダ / ー) */
.ami-page:lang(ja) { line-break: strict; }
/* heading with a link beside it (.ami-head draws the dashed line): no second underline on the heading itself */
.ami-head > .ami-underline { padding-bottom: 0; background: none; }
/* product names in order summaries break between words (いちごの / キーホルダー), not mid-word */
.site-mini > span:lang(ja), .site-item__info > :first-child:lang(ja) { word-break: auto-phrase; }
/* long unbreakable strings (e-mail addresses, order URLs) wrap instead of widening the card past the screen.
   anywhere (not break-word) also lowers the min-content width, so grid/flex parents can shrink. */
.ami-note b, .ami-note > span, .site-review dd, .site-thanks p, .site-notify__mail, .ami-totals dd + dt { overflow-wrap: anywhere; }
.ami-note > span, .ami-stack > *, .site-review > * { min-width: 0; }
/* notes (.ami-note: icon + text) on phones: the icon floats at the top left and the text wraps under it back to the left edge,
   instead of a narrow text column beside a mostly empty icon column */
@media (width <= 42.5em) {
  .ami-note { display: flow-root; padding: 1.25rem 1.375rem; }
  /* icon no taller than one line (line-height 1.5–1.6): the 2nd line then starts at the left edge, not beside the icon */
  .ami-note > .ami-icon { float: left; width: 1.5em; height: 1.5em; margin: 0 0.5rem 0 0; }
  .ami-note > span { display: inline; }
}

/* ===== error popup (components/shop/AlertDialog.tsx) ===== */
.site-alert { width: min(23rem, calc(100% - 2rem)); }
.site-alert__title { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.site-alert__title .ami-icon { flex: none; width: 1.75rem; height: 1.75rem; }
.site-alert__msg { margin: 0; line-height: 1.8; overflow-wrap: anywhere; }
.site-alert[open] .site-dialog__box { animation: site-alert-in 0.18s ease-out; }
@keyframes site-alert-in { from { opacity: 0; transform: translateY(0.5rem) scale(0.98); } }
@media (prefers-reduced-motion: reduce) { .site-alert[open] .site-dialog__box { animation: none; } }

/* home: up to 4 posts — one row of 4 on desktop, 2×2 on tablet, a column on phones */
@media (width > 60em) { .site-posts--home { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (42.5em < width <= 60em) { .site-posts--home { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* stitched card border: the kit's SVG draws the stitch 2 units from the tile edge, and repeated border-image
   tiles sample across their edges, so a faint ghost of the stitch showed along the inner edge (seen on phones).
   Padded copies keep 2 empty units around the drawing; slice/width/inset grow by the same 2 so nothing moves. */
:root { --ami-stitch: url("/kit/assets/svg/stitch-pad.svg"); --ami-stitch-soft: url("/kit/assets/svg/stitch-soft-pad.svg"); }
.ami-card::after, .ami-row--card::after { inset: 0.25rem; border-width: 1.375rem; border-image-slice: 22; border-image-width: 1.375rem; }

/* ---- carousel ‹ › buttons (components/shop/CarouselNav): on every device, Safari and phones included.
   The kit's ::scroll-button version (Chrome + mouse only) is switched off so there is one set. ---- */
.ami-carousel:has(> .site-carnav) > .ami-carousel__track::scroll-button(*) { content: none; }
.site-carnav__btn {
  position: absolute; z-index: 2; top: calc(50% - 2.25rem); display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; padding: 0 0 0.25rem; border: 0; border-radius: 50%; cursor: pointer;
  font: 900 1.6rem / 1 var(--ami-font); color: var(--ami-ink); background: var(--ami-paper);
  outline: 0.125rem dashed var(--ami-thread); outline-offset: -0.375rem; box-shadow: var(--ami-shadow-felt);
  transition: translate 0.12s, opacity 0.2s; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;   /* no double-tap zoom delay, no text selection on fast taps */
}
.site-carnav__btn--prev { left: -1.125rem; }
.site-carnav__btn--next { right: -1.125rem; }
.site-carnav__btn:disabled { opacity: 0; pointer-events: none; }
.site-carnav__btn:active { translate: 0 0.125rem; }
.site-carnav__btn:focus-visible { outline: 0.1875rem solid var(--ami-coral-text); outline-offset: 0.1875rem; }
@media (hover: hover) { .site-carnav__btn:hover { color: var(--ami-coral-text); } }
.site-herocar .site-carnav__btn--prev { left: 0.75rem; }
.site-herocar .site-carnav__btn--next { right: 0.75rem; }
/* phones: a little smaller and inside the screen edge (the page gutter is only ~1rem) */
@media (width <= 42.5em) {
  .site-carnav__btn { width: 2.5rem; height: 2.5rem; font-size: 1.45rem; }
  .site-carnav__btn--prev { left: -0.5rem; }
  .site-carnav__btn--next { right: -0.5rem; }
  .site-herocar .site-carnav__btn { top: auto; bottom: 3rem; }   /* inside the photo, under the button; the dashes below the banner take ~2.1rem */
  .site-herocar .site-carnav__btn--prev { left: 0.5rem; }
  .site-herocar .site-carnav__btn--next { right: 0.5rem; }
}
