/* ポチまて ガイド — the app's look (cream graph paper, sticker cards with a brown outline and a hard shadow,
   Zen Maru Gothic, vermilion 承認 and navy 却下) for reading pages. Static: no app JavaScript. Mobile first. */

:root {
  --bg: #fff6e8;
  --grid: rgba(226, 178, 120, .22);
  --ink: #4a3a30;
  --ink-2: #7a6658;
  --ink-3: #a8968a;
  --card: #fffdf8;
  --line: #4a3a30;
  --pink: #ff7f9f;
  --pink-deep: #e2557a;
  --pink-soft: #ffe0e8;
  --butter: #ffd66b;
  --butter-soft: #fff1c4;
  --mint: #9fe0c6;
  --mint-soft: #e2f6ee;
  --sky: #cfe8ff;
  --approve: #e8473c;
  --approve-soft: #ffe3df;
  --reject: #3d5a98;
  --reject-soft: #e1e8f7;
  --dash: #e3d4c4;
  --radius: 18px;
  --shadow: 4px 4px 0 var(--line);
  --shadow-sm: 2px 2px 0 var(--line);
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  line-height: 1.85;
  min-height: 100dvh;
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.4; margin: 0; font-weight: 900; }
/* Japanese line breaks at phrase boundaries where the browser can (Chrome 119+); others break as usual. */
h1, h2, h3, .toc a, .faq summary, .table th, .table td, .cta__title, .guide-card b { word-break: auto-phrase; }
.pochi { display: block; flex: none; }
.yen { white-space: nowrap; }

/* ------------------------------------------------------------ top bar (same as the app) */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px max(16px, calc((100vw - 1060px) / 2));
  background: rgba(255, 246, 232, .9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--line);
}
.logo { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 900; font-size: 20px; letter-spacing: .02em; }
.logo .pochi { margin: -4px 0; }
.top__nav { display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: 14px; }
.top__nav a:not(.btn) { text-decoration: none; padding: 4px 2px; border-bottom: 3px solid transparent; }
.top__nav a.is-on { border-color: var(--pink); }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 18px;
  background: var(--card); border: 2.5px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow-sm); font: inherit; font-weight: 900; font-size: 15px; line-height: 1.3; text-decoration: none; color: var(--ink); cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--line); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--line); }
.btn--primary { background: var(--pink); color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
.btn--ghost { background: transparent; box-shadow: none; }
.btn--ghost:hover { box-shadow: none; background: rgba(255, 255, 255, .6); }
.btn--lg { min-height: 54px; padding: 10px 26px; font-size: 17px; }
.btn--sm { min-height: 36px; padding: 4px 14px; font-size: 14px; }

/* ------------------------------------------------------------ page */
.guide { max-width: 1060px; margin: 0 auto; padding: 12px 16px 24px; }
.card { background: var(--card); border: 2.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0 0 12px; padding: 0; list-style: none; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.crumbs li + li::before { content: "›"; margin: 0 7px; color: var(--ink-3); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink-3); }

.layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.layout > * { min-width: 0; }

/* the head of a guide */
.hero {
  position: relative; overflow: hidden; padding: 16px 18px 16px; border-radius: 26px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "kicker pochi" "h1 h1" "lede lede" "meta meta";
}
.hero::after { content: ""; position: absolute; right: -50px; top: -50px; width: 170px; height: 170px; border-radius: 50%; background: var(--pink-soft); z-index: 0; }
.hero > * { position: relative; z-index: 1; }
.hero__kicker { grid-area: kicker; align-self: center; display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 900; color: var(--pink-deep); letter-spacing: .04em; }
.hero__kicker span { padding: 0 10px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--butter); color: var(--ink); font-size: 11px; line-height: 1.8; letter-spacing: .06em; }
.hero h1 { grid-area: h1; margin: 4px 0 12px; font-size: clamp(26px, 7.4vw, 40px); letter-spacing: .01em; }
.hero h1 span { display: block; }
.hero__pochi { grid-area: pochi; align-self: end; width: 72px; height: 72px; margin: -6px -4px -2px 0; animation: bob 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2deg); } }
.hero__lede { grid-area: lede; margin: 0; font-size: 16px; line-height: 1.9; }
.hero__meta { grid-area: meta; margin: 12px 0 0; padding-top: 10px; border-top: 1.5px dashed var(--dash); font-size: 12px; color: var(--ink-2); }

strong { font-weight: 900; background: linear-gradient(transparent 62%, var(--butter-soft) 62%); }
.hero strong { background: linear-gradient(transparent 60%, var(--butter) 60%); }

/* contents */
.toc { padding: 14px 18px; box-shadow: var(--shadow-sm); }
.toc__title { margin: 0 0 4px; font-size: 13px; font-weight: 900; letter-spacing: .2em; color: var(--ink-2); }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; display: flex; gap: 8px; padding: 5px 0; border-top: 1.5px dashed var(--dash); font-size: 14px; font-weight: 700; line-height: 1.5; }
.toc li:first-child { border-top: 0; }
.toc li::before { content: counter(toc, decimal-leading-zero); flex: none; min-width: 22px; color: var(--pink-deep); font-weight: 900; font-size: 12px; padding-top: 2px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ------------------------------------------------------------ article text */
.prose { font-size: 16px; }
.prose p { margin: 0 0 1em; }
.sec { margin: 0 0 30px; }
.sec h2 {
  position: relative; margin: 8px 0 14px; padding: 0 0 8px 30px; font-size: 21px;
  border-bottom: 2.5px solid var(--line);
}
.sec h2::before {
  /* a paw: the stamp everyone presses */
  content: ""; position: absolute; left: 0; top: .25em; width: 22px; height: 22px;
  background: var(--pink); border: 2px solid var(--line); border-radius: 50% 50% 46% 46%;
  -webkit-mask: radial-gradient(circle at 50% 68%, #000 38%, transparent 39%), radial-gradient(circle at 18% 34%, #000 13%, transparent 14%), radial-gradient(circle at 39% 16%, #000 13%, transparent 14%), radial-gradient(circle at 61% 16%, #000 13%, transparent 14%), radial-gradient(circle at 82% 34%, #000 13%, transparent 14%);
  mask: radial-gradient(circle at 50% 68%, #000 38%, transparent 39%), radial-gradient(circle at 18% 34%, #000 13%, transparent 14%), radial-gradient(circle at 39% 16%, #000 13%, transparent 14%), radial-gradient(circle at 61% 16%, #000 13%, transparent 14%), radial-gradient(circle at 82% 34%, #000 13%, transparent 14%);
  border: 0;
}
.prose h3 { margin: 20px 0 8px; font-size: 18px; }
.prose a:not(.btn) { color: var(--pink-deep); font-weight: 700; text-underline-offset: 3px; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.5em; }
.prose li { margin: 0 0 .45em; }
.prose li::marker { color: var(--pink-deep); font-weight: 900; }
.prose ol > li { padding-left: .2em; }

.table { margin: 0 0 1em; overflow-x: auto; border: 2.5px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow-sm); }
.table table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.6; }
.table th, .table td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1.5px dashed var(--dash); }
.table tr:last-child td { border-bottom: 0; }
.table th { background: var(--butter-soft); font-weight: 900; font-size: 13px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td:first-child { font-weight: 700; }
.table td:not(:first-child) { overflow-wrap: anywhere; }
.ex-note { font-size: 13px; color: var(--ink-2); }

blockquote { margin: 0 0 1em; padding: 12px 16px; background: var(--card); border-left: 6px solid var(--reject); border-radius: 0 14px 14px 0; box-shadow: var(--shadow-sm); }
blockquote p { margin: 0 !important; font-weight: 900; }
blockquote cite { display: block; margin-top: 2px; font-style: normal; font-size: 12px; color: var(--ink-2); }
blockquote cite::before { content: "— "; }

/* ------------------------------------------------------------ a sample 稟議書 (looks like the app's card) */
.ringi {
  position: relative; margin: 6px 0 22px; padding: 14px 16px 16px;
  background: var(--card); border: 2.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.ringi__head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.ringi__title { font-weight: 900; font-size: 17px; letter-spacing: .3em; padding: 0 2px; background: linear-gradient(transparent 62%, var(--pink-soft) 62%); }
.ringi__ex { margin-left: auto; padding: 0 9px; border: 1.5px solid var(--line); border-radius: 999px; background: #efe6dc; font-size: 11px; font-weight: 900; line-height: 1.8; }
.ringi__rows { margin: 0; display: grid; }
.ringi__rows > div { display: grid; grid-template-columns: 3.2em 1fr; gap: 10px; padding: 7px 0; border-bottom: 1.5px dashed var(--dash); }
.ringi__rows > div:last-child { border-bottom: 0; }
.ringi__rows dt { font-size: 12px; color: var(--ink-2); font-weight: 900; padding-top: 3px; }
.ringi__rows dd { margin: 0; overflow-wrap: anywhere; line-height: 1.7; }
.ringi__rows .is-item { font-weight: 900; font-size: 17px; line-height: 1.5; padding-right: 64px; }
.ringi__rows .is-price { font-weight: 900; font-size: 20px; color: var(--approve); letter-spacing: .02em; }
.ringi__alt { display: flex; gap: 8px; align-items: baseline; margin: 6px 0 0 !important; padding: 8px 10px; background: var(--butter-soft); border: 1.5px dashed #e6c873; border-radius: 12px; font-size: 14px; font-weight: 700; line-height: 1.6; }
.ringi__alt span { flex: none; padding: 0 8px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font-size: 11px; font-weight: 900; line-height: 1.8; }
.ringi__stamp { position: absolute; right: 8px; top: 40px; transform: rotate(-14deg); opacity: .92; pointer-events: none; }
.ringi__stamp svg { display: block; width: 76px; height: 76px; }
.ringi figcaption { margin-top: 12px; }
.ringi__label { margin: 0 0 6px !important; font-size: 13px; font-weight: 900; color: var(--ink-2); }
.ringi.is-approve .ringi__label { color: var(--approve); }
.ringi.is-reject .ringi__label { color: var(--reject); }
.ringi__votes { list-style: none; margin: 0 !important; padding: 0 !important; display: grid; gap: 6px; }
.ringi__votes li { display: flex; gap: 8px; align-items: baseline; margin: 0; font-size: 14px; font-weight: 700; line-height: 1.6; }
.ringi__votes b { flex: none; padding: 0 8px; border-radius: 999px; color: #fff; font-size: 11px; line-height: 1.9; }
.ringi__votes .is-approve b { background: var(--approve); }
.ringi__votes .is-reject b { background: var(--reject); }

/* ------------------------------------------------------------ the ひと稟議 box */
.cta {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: start;
  margin: 8px 0 30px; padding: 18px 16px;
  background: var(--butter-soft); border: 2.5px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
}
.cta__pochi { width: 64px; height: 64px; animation: bob 2.6s ease-in-out infinite; }
.cta__body { display: contents; }
.cta__title { grid-column: 2; align-self: center; margin: 0 !important; font-size: 19px; font-weight: 900; line-height: 1.45; }
.cta__text { grid-column: 1 / -1; margin: 4px 0 0 !important; font-size: 14.5px; line-height: 1.8; }
.cta__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cta__actions .btn--primary { flex: 1 1 100%; }
.cta__actions .btn--ghost { flex: 1 1 100%; }
.cta__fine { grid-column: 1 / -1; margin: 4px 0 0 !important; font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.cta--end { background: var(--pink-soft); }

/* copyable template */
.tpl { margin: 0 0 1.2em; border: 2.5px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.tpl__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 8px 14px; background: var(--butter); border-bottom: 2px solid var(--line); font-weight: 900; font-size: 14px; }
.tpl pre { margin: 0; padding: 14px 16px; font-family: var(--font); font-weight: 700; font-size: 14.5px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }

/* official help lines */
.help { margin: 0 0 1.2em; padding: 14px 16px; background: var(--mint-soft); border: 2px solid #6fbf9f; border-radius: 16px; }
.help__title { margin: 0 0 4px !important; font-weight: 900; font-size: 15px; }
.help p { font-size: 14.5px; }
.help ul { margin: 0 !important; padding-left: 1.2em; font-size: 14.5px; }
.help li { margin-bottom: .5em; }
.prose .help a { color: var(--ink); }

/* FAQ */
.faq details { margin: 0 0 10px; background: var(--card); border: 2.5px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.faq summary { position: relative; padding: 12px 44px 12px 46px; font-weight: 900; line-height: 1.6; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q"; position: absolute; left: 12px; top: 11px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--pink); color: #fff; font-size: 13px; line-height: 1; }
.faq summary::after { content: "＋"; position: absolute; right: 14px; top: 11px; font-weight: 900; color: var(--ink-2); }
.faq details[open] summary::after { content: "－"; }
.faq details p { margin: 0 !important; padding: 0 16px 14px 46px; font-size: 15px; line-height: 1.85; }

/* sources */
.sources { font-size: 13px; color: var(--ink-2); }
.sources h2 { font-size: 16px !important; }
.sources p { margin-bottom: .5em !important; }
.sources ul { padding-left: 1.2em; }
.prose .sources a { color: var(--ink-2); font-weight: 500; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ guide cards */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.guide-card {
  position: relative; display: grid; gap: 2px; height: 100%; padding: 14px 16px 12px; text-decoration: none;
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s;
}
.guide-card:hover { transform: translate(-2px, -2px) rotate(-.3deg); box-shadow: 5px 5px 0 var(--line); }
.guide-card__no { position: absolute; right: 14px; top: 10px; font-size: 26px; font-weight: 900; color: var(--pink-soft); -webkit-text-stroke: 1.5px var(--pink-deep); line-height: 1; }
.guide-card__kicker { font-size: 12px; font-weight: 900; color: var(--pink-deep); }
.guide-card b { padding-right: 40px; font-size: 17px; line-height: 1.5; }
.guide-card small { color: var(--ink-2); font-size: 13.5px; line-height: 1.7; }
.guide-card__go { justify-self: end; margin-top: 4px; font-size: 13px; font-weight: 900; color: var(--pink-deep); }

.related { margin-top: 10px; }
.related h2 { margin: 0 0 12px; font-size: 19px; }

.index { display: grid; gap: 18px; max-width: 760px; margin: 0 auto; }
.index .cta { margin: 6px 0 0; }

/* ------------------------------------------------------------ footer */
.foot { padding: 18px 16px 40px; text-align: center; color: var(--ink-2); font-size: 13px; }
.foot__motto { display: inline-flex; flex-direction: column; gap: 2px; margin: 0 0 14px; padding: 10px 18px; background: var(--butter-soft); border: 2px dashed var(--line); border-radius: 14px; color: var(--ink); font-weight: 900; font-size: 15px; }
.foot__motto span { font-size: 11px; color: var(--ink-2); letter-spacing: .12em; font-weight: 700; }
.foot__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 6px 0; font-weight: 700; }
.foot__by { margin: 0; }

/* ------------------------------------------------------------ wider screens */
@media (max-width: 420px) {
  .top__nav a:not(.btn) { display: none; }
}
@media (min-width: 600px) {
  .guide { padding: 18px 24px 32px; }
  .hero { padding: 26px 28px 20px; grid-template-areas: "kicker pochi" "h1 pochi" "lede lede" "meta meta"; }
  .hero__pochi { width: 112px; height: 112px; margin: 0 -4px 6px 0; }
  .cta { grid-template-columns: auto 1fr; padding: 20px 22px; gap: 4px 18px; }
  .cta__pochi { grid-row: 1 / span 4; width: 92px; height: 92px; align-self: center; }
  .cta__title, .cta__text, .cta__actions, .cta__fine { grid-column: 2; }
  .cta__actions .btn--primary, .cta__actions .btn--ghost { flex: 0 0 auto; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .ringi { padding: 16px 20px 18px; }
  .ringi__stamp { top: 50px; right: 14px; }
  .ringi__stamp svg { width: 88px; height: 88px; }
  .ringi__rows .is-item { padding-right: 90px; }
}
@media (min-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 720px) 260px; grid-template-areas: "hero toc" "prose toc"; justify-content: center; column-gap: 40px; row-gap: 22px; }
  .layout > .hero { grid-area: hero; }
  .toc { grid-area: toc; align-self: start; position: sticky; top: 76px; }
  .prose { grid-area: prose; font-size: 16.5px; }
  .related { max-width: 1020px; margin: 10px auto 0; }
  .related .cards, .index .cards { grid-template-columns: repeat(3, 1fr); }
  .index { max-width: 1020px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__pochi, .cta__pochi { animation: none; }
}
