/* セールおかね計算室
   スーパーのチラシと値札、レシートをモチーフにする。
   値札の赤(aka)、チラシの黄(ki)、レシートの白と墨の3つが軸。
   見せ場は計算結果の「レシート」と、斜めに貼った値札シール。 */
:root {
  --paper: #ffffff;
  --ink: #1d1d1f;
  --muted: #5e6066;
  --rule: #dcdcdf;
  --aka: #d7263d;
  --aka-ink: #ffffff;
  --ki: #ffd23f;
  --ki-soft: #fff6d1;
  --receipt: #fbfaf6;
  --link: #b3122a;
  --font: "M PLUS 1p", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --disp: "Dela Gothic One", "M PLUS 1p", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151517;
    --ink: #ececee;
    --muted: #a6a8ae;
    --rule: #333338;
    --aka: #ff5a6e;
    --aka-ink: #1d0509;
    --ki: #e6bb2c;
    --ki-soft: #2a2410;
    --receipt: #1e1e21;
    --link: #ff8a98;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.85; }
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--aka); outline-offset: 2px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー:チラシの赤い帯 */
header.site { background: var(--aka); color: #fff; border-bottom: 6px solid var(--ki); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-family: var(--disp); font-size: 19px; letter-spacing: .02em; }
/* ロゴ:小さな値札 */
.logo i { width: 26px; height: 18px; background: var(--ki); clip-path: polygon(28% 0, 100% 0, 100% 100%, 28% 100%, 0 50%); position: relative; }
.logo i::after { content: ""; position: absolute; left: 6px; top: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--aka); }
nav.top { display: flex; gap: 18px; font-size: 14px; font-weight: 700; }
nav.top a { color: #fff; text-decoration: none; }
nav.top a:hover { text-decoration: underline; }

.crumbs { font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.crumbs a { color: var(--muted); }
h1, h2, h3 { font-weight: 800; letter-spacing: .02em; }
h1 { font-size: clamp(24px, 4.6vw, 30px); line-height: 1.5; margin: 10px 0 8px; }
h2 { font-size: 20px; line-height: 1.5; margin: 44px 0 12px; display: inline-block; background: linear-gradient(transparent 60%, var(--ki) 60%); padding: 0 4px; }
h3 { font-size: 17px; margin: 26px 0 6px; }
.lead { color: var(--muted); margin: 0 0 22px; max-width: 36em; }
article p, article li { max-width: 36em; }

.hero { padding: 34px 0 4px; }
.hero h1 { font-family: var(--disp); font-weight: 400; font-size: clamp(28px, 6.4vw, 44px); line-height: 1.35; margin: 0 0 14px; }
.hero h1 em { font-style: normal; color: var(--aka); }
.hero p { color: var(--muted); margin: 0; max-width: 34em; }
.event { display: inline-block; margin: 0 0 14px; padding: 2px 12px; background: var(--ki); color: #1d1d1f; font-weight: 800; font-size: 14px; border-radius: 3px; }
.event a { color: #1d1d1f; }

/* 入力欄 */
.sheet { border: 2px solid var(--ink); border-radius: 10px; padding: 22px; margin: 20px 0; background: var(--paper); }
.tool label { display: block; font-weight: 800; font-size: 14px; margin: 14px 0 5px; }
.tool .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.tool input, .tool select { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid #8e9097; border-radius: 6px; background: var(--paper); color: var(--ink); }
.tool input:focus, .tool select:focus { outline: 3px solid var(--ki); outline-offset: 0; border-color: var(--ink); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 0 10px; align-items: end; }
.with-unit { display: grid; grid-template-columns: 1fr 112px; gap: 6px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } .row3 { grid-template-columns: 1fr 1fr; } }

/* 結果:レシート */
#out { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: flex-start; }
#out > p, #out > .scroll, #out > ul.plain { flex-basis: 100%; }
#out p { font-size: 15px; color: var(--muted); margin: 0; }
.receipt { flex: 1 1 300px; max-width: 380px; background: var(--receipt); padding: 18px 20px 14px; box-shadow: 0 1px 0 var(--rule), 0 0 0 1px var(--rule);
  -webkit-mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 14px 100% repeat-x; mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 14px 100% repeat-x; padding-bottom: 24px; }
.receipt .rhead { text-align: center; font-weight: 800; letter-spacing: .3em; font-size: 13px; color: var(--muted); margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--muted); }
.receipt ul { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.receipt li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 15px; }
.receipt li.sum { border-top: 1px dashed var(--muted); margin-top: 4px; padding-top: 7px; font-weight: 800; }
.rtotal { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--ink); margin-top: 10px; padding-top: 8px; }
.rtotal span { font-weight: 800; }
.rtotal b { font-family: var(--disp); font-weight: 400; font-size: clamp(30px, 7vw, 40px); line-height: 1.1; color: var(--aka); font-variant-numeric: tabular-nums; }
.rtotal small { font-size: 16px; margin-left: 2px; }

/* 値札シール */
.tag { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 150px; padding: 14px 20px; background: var(--ki); color: #1d1d1f;
  border-radius: 50%; aspect-ratio: 1; transform: rotate(-8deg); text-align: center; line-height: 1.25; }
.tag span { font-size: 13px; font-weight: 800; }
.tag b { font-family: var(--disp); font-weight: 400; font-size: 34px; color: #c41c33; font-variant-numeric: tabular-nums; }
.tag.big { border-radius: 14px; aspect-ratio: auto; transform: rotate(-2deg); min-width: 220px; padding: 14px 28px; }
.tag.big b { font-size: clamp(40px, 9vw, 56px); }
.tag.ok { background: #d9f2df; }
.tag.ok b { color: #17663a; }
@media (prefers-reduced-motion: no-preference) { .tag { transition: transform .2s; } }
ul.plain { margin: 0; padding-left: 1.2em; color: var(--muted); }

table.data { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { border: 1px solid var(--rule); padding: 8px; text-align: left; vertical-align: top; }
table.data tr:first-child th { background: var(--ki-soft); }
table.data .n { text-align: right; white-space: nowrap; }
table.data tr.best td { background: var(--ki-soft); font-weight: 800; }
table.data em { font-style: normal; font-size: 12px; background: var(--aka); color: var(--aka-ink); padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.scroll { overflow-x: auto; }
.note { border: 2px dashed var(--rule); padding: 10px 16px; font-size: 14px; margin: 24px 0; color: var(--muted); }

.promo { border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); padding: 14px 18px; margin: 20px 0; }
.promo .tag { all: unset; display: inline-block; font-size: 12px; color: var(--muted); border: 1px solid var(--muted); padding: 0 6px; border-radius: 3px; }
.promo strong { display: block; font-size: 17px; margin-top: 4px; }
.promo p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.promo ul.aff { list-style: none; margin: 10px 0 0; padding: 0; }
.promo ul.aff li { border-top: 1px solid var(--rule); padding: 8px 0; font-size: 14px; }
.promo ul.aff a { font-weight: 800; display: block; }
.promo ul.aff span { color: var(--muted); }

.index { list-style: none; margin: 8px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.index li { border-bottom: 1px solid var(--rule); }
.index a { display: block; padding: 13px 4px; text-decoration: none; color: var(--ink); }
.index b { display: block; color: var(--link); }
.index a:hover b { text-decoration: underline; }
.index span { color: var(--muted); font-size: 15px; }

details { border-bottom: 1px solid var(--rule); padding: 10px 2px; }
details:first-of-type { border-top: 1px solid var(--rule); }
summary { font-weight: 800; cursor: pointer; }
details p { margin: 8px 0 2px; color: var(--muted); }
footer.site { margin-top: 56px; border-top: 6px solid var(--ki); background: var(--ink); color: #c9cacf; font-size: 13px; }
@media (prefers-color-scheme: dark) { footer.site { background: #0c0c0d; } }
footer.site .wrap { padding-top: 18px; padding-bottom: 28px; }
footer.site a { color: #ececee; margin-right: 14px; display: inline-block; }
@media (max-width: 560px) { .sheet { padding: 16px 14px; } }
