/* ==========================================================================
   冠婚葬祭マナー・持ち物ガイド (Ceremony Manners & Checklist Guide)
   Shared stylesheet. Mobile-first. No framework, no external fonts.
   Palette "紅椿" (red camellia): deep red accent / gold secondary,
   warm paper background - formal and calm, suited to ceremonial topics.
   ========================================================================== */

:root {
  --accent: #A6455B;
  --accent-dark: #3D2B2E;
  --accent-pale: #F5E6E8;
  --gold: #C9A65C;
  --gold-dark: #8A6D33;
  --link: #93404F;
  --text: #3D2B2E;
  --muted: #7A6A6C;
  --border: #E5DBD6;
  --bg: #FAF6F3;
  --card: #FFFFFF;
  --warn-bg: #FBF3E2;
  --warn-border: #D9C08A;
  --radius: 12px;
  --space-sm: 14px;
  --space-lg: 28px;
  /* Vertical spacing scale (shared across the DeepMint checklist sites).
     One source of truth per gap: the PRECEDING element carries margin-bottom;
     blocks never carry margin-top (documented exceptions only). */
  --gap-s: 12px;  /* intra-block spacing */
  --gap-m: 20px;  /* between adjacent blocks (cards, ad slots, FAQ) */
  --gap-l: 32px;  /* between major sections */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "BIZ UDPGothic", Meiryo, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3 { word-break: keep-all; line-height: 1.4; }

a { color: var(--link); }

img { max-width: 100%; display: block; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  min-width: 0;
}

.site-header .brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-header .brand img { width: 28px; height: 28px; flex: none; border-radius: 6px; }

.lang-link {
  margin-left: auto;
  flex: none;
  font-size: 13px;
  text-decoration: none;
  color: var(--accent-dark);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--card);
}

/* --------------------------------------------------------------------------
   Hero (all category pages). Real photo, full bleed, with the palette
   gradient laid on top as a semi-transparent tint (same 3 variants as
   before) plus the shippo-tsunagi (interlocking circles) pattern in
   filigree. White title/subtitle anchored to the bottom, same convention
   as the sibling sites.
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
}

.hero-photo {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.hero-tint {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero.celebration .hero-tint { background: linear-gradient(180deg, rgba(166,69,91,0.25) 0%, rgba(110,44,60,0.82) 100%); }
.hero.solemn .hero-tint { background: linear-gradient(180deg, rgba(85,64,63,0.30) 0%, rgba(46,34,37,0.85) 100%); }
.hero.gold .hero-tint { background: linear-gradient(180deg, rgba(169,133,67,0.25) 0%, rgba(124,95,44,0.82) 100%); }

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cg fill='none' stroke='%23FFFFFF' stroke-width='1'%3E%3Ccircle cx='24' cy='24' r='23'/%3E%3Ccircle cx='0' cy='0' r='23'/%3E%3Ccircle cx='48' cy='0' r='23'/%3E%3Ccircle cx='0' cy='48' r='23'/%3E%3Ccircle cx='48' cy='48' r='23'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.10;
  pointer-events: none;
}

.hero .overlay {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 18px;
}

.hero h1 {
  color: #fff;
  font-size: 22px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
}

.hero p {
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.45);
}

/* Guide pages that open directly with a content card (no intro paragraph
   under the hero) need explicit clearance below the hero band.
   Deliberate margin-top exception (same as the sibling sites). */
.hero + .container > .seo-block:first-child { margin-top: var(--gap-m); }

/* --------------------------------------------------------------------------
   Hub (index)
   -------------------------------------------------------------------------- */
.hub-head {
  text-align: center;
  padding: 28px 16px 8px;
}

.hub-head h1 { font-size: 24px; margin-bottom: 8px; }

.hub-head p { color: var(--muted); font-size: 14px; }

.jp-scope-note {
  display: inline-block;
  margin: var(--gap-s) 0 0;
  padding: 6px 16px;
  background: var(--accent-pale);
  border-radius: 999px;
  color: var(--muted);
  font-size: clamp(10px, 0.9vw, 12px);
  text-align: center;
}

/* Hub groups: deliberate margin-top exception (title-led sections, hub page
   only). 12px on top of the preceding .hub-cards 20px bottom padding gives
   32px (--gap-l) between major hub sections. */
.hub-group { margin-top: var(--gap-s); }

.hub-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-pale);
  padding: 10px 14px;
  margin-bottom: 4px;
  border-radius: 10px 10px 0 0;
  border-bottom: 3px solid var(--accent);
}

.hub-group-title svg {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: var(--accent-dark);
}

.hub-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px 0 var(--gap-m);
}

.hub-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(61,43,46,0.06);
}

/* Card header: real photo, same gradient tint + shippo pattern treatment
   as the page hero, in the card's own variant color. No icon - the photo
   is the visual, not a background for one. */
.card-visual {
  height: 96px;
  flex: none;
  position: relative;
  overflow: hidden;
}

.card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.card-visual.celebration::after { background: linear-gradient(135deg, rgba(166,69,91,0.40) 0%, rgba(110,44,60,0.55) 100%); }
.card-visual.solemn::after { background: linear-gradient(135deg, rgba(85,64,63,0.45) 0%, rgba(46,34,37,0.60) 100%); }
.card-visual.gold::after { background: linear-gradient(135deg, rgba(169,133,67,0.40) 0%, rgba(124,95,44,0.55) 100%); }

.card-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cg fill='none' stroke='%23FFFFFF' stroke-width='1'%3E%3Ccircle cx='24' cy='24' r='23'/%3E%3Ccircle cx='0' cy='0' r='23'/%3E%3Ccircle cx='48' cy='0' r='23'/%3E%3Ccircle cx='0' cy='48' r='23'/%3E%3Ccircle cx='48' cy='48' r='23'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.10;
  pointer-events: none;
}

/* Tool cards (top hub section) are visually dominant: taller banner and
   larger title. Border matches every other card (var(--border), 1px) -
   no accent frame, so the 4 grid types stay visually consistent. */
.hub-card-tool .card-visual { height: 128px; }

.hub-card .body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Long katakana titles must wrap normally: the global keep-all plus the
   card's overflow:hidden would silently clip them. */
.hub-card h3 { font-size: 17px; margin-bottom: 4px; word-break: normal; overflow-wrap: anywhere; }

.hub-card-tool h3 { font-size: 19px; }

.hub-card p { font-size: 13px; color: var(--muted); margin-bottom: 10px; }

.hub-card .cta {
  display: inline-block;
  align-self: center;
  margin-top: auto;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  border-radius: 999px;
  padding: 8px 20px;
}

/* Standalone CTA (error pages): same pill as .hub-card .cta, usable outside
   the card grid. */
.error-cta {
  display: inline-block;
  margin-top: 16px;
  background: var(--accent);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 24px;
}

.hub-steps {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 var(--gap-m);
}

.hub-steps h2 { font-size: 16px; margin-bottom: 8px; }

.hub-steps ol { padding-left: 22px; font-size: 14px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Benefit line (tool pages, under the page title)
   -------------------------------------------------------------------------- */
.benefit-line {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0;
}

/* --------------------------------------------------------------------------
   Question card
   -------------------------------------------------------------------------- */
.qcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0 0;
}

/* --------------------------------------------------------------------------
   Flow: single flat flex container. Every direct child is one item of the
   sequence. Spacing is set per-child via .gap-lg / .gap-sm (margin-top on the
   element that FOLLOWS the gap). Only two values exist: 14px and 28px.
   No element inside carries its own vertical margin.
   -------------------------------------------------------------------------- */
.flow { display: flex; flex-direction: column; }
.flow > .gap-lg { margin-top: var(--space-lg); }
.flow > .gap-sm { margin-top: var(--space-sm); }
/* An empty notices container must not occupy space or emit a phantom gap. */
#notices:empty { display: none; }

.qcard h2 { font-size: 16px; margin-bottom: 12px; }

.qgroup { margin-bottom: 14px; }

.qgroup:last-child { margin-bottom: 0; }

.qgroup .qlabel {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.qbtns { display: flex; flex-wrap: wrap; gap: 8px; }

.qbtn {
  font: inherit;
  font-size: 14px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  flex: 1 1 auto;
}

.qbtn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
  font-weight: 700;
}

.qhint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* --------------------------------------------------------------------------
   Amount result panel (koden / goshugi guide tools)
   -------------------------------------------------------------------------- */
.result-card {
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
}

.result-card .result-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.result-card .result-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.3;
  margin-bottom: 8px;
}

.result-card .result-note {
  font-size: 13px;
  color: var(--text);
  text-align: left;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.result-card .result-note li {
  list-style: none;
  padding-left: 1.2em;
  text-indent: -1.2em;
  margin-bottom: 4px;
}

.result-card .result-note li::before { content: "・"; }

/* Sub-table inside the result panel (relative-specific breakdown) */
.result-detail {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 10px 0 0;
}

.result-detail th, .result-detail td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
}

.result-detail th {
  background: var(--accent-pale);
  font-weight: 700;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Envelope writing diagram (inline SVG, koden / goshugi pages)
   -------------------------------------------------------------------------- */
.envelope-figure {
  display: flex;
  justify-content: center;
  padding: 6px 0 10px;
}

.envelope-figure svg { max-width: 280px; height: auto; }

/* --------------------------------------------------------------------------
   Taboo word checker (imikotoba)
   -------------------------------------------------------------------------- */
.checker-input {
  width: 100%;
  min-height: 140px;
  font: inherit;
  font-size: 15px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}

.checker-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.checker-actions { display: flex; gap: 8px; margin-top: 10px; }

.checker-actions button {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  flex: 1;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

.checker-actions .primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.checker-actions button:hover { border-color: var(--accent); }

.checker-result-text {
  font-size: 15px;
  line-height: 2;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

mark.ng {
  background: #F6D9DE;
  color: #7E2337;
  border-bottom: 2px solid var(--accent);
  border-radius: 2px;
  padding: 0 1px;
}

mark.caution {
  background: #F8ECD4;
  color: #6B5320;
  border-bottom: 2px solid var(--gold);
  border-radius: 2px;
  padding: 0 1px;
}

.checker-summary { font-size: 14px; font-weight: 700; }

.checker-summary.ok { color: #2F7D4F; }

.found-list { list-style: none; }

.found-list li {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  font-size: 14px;
}

.found-list li:last-child { border-bottom: none; }

.found-list .fw { font-weight: 700; color: #7E2337; }

.found-list .fw.caution { color: #6B5320; }

.found-list .fcat {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 8px;
  margin-left: 6px;
  vertical-align: 1px;
}

.found-list .falt { display: block; font-size: 13px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Progress counter (checklist page)
   -------------------------------------------------------------------------- */
.progress {
  width: 72%;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
  font-size: 14px;
  color: var(--text);
  background: var(--accent-pale);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.progress strong { color: var(--accent); font-size: 22px; }

/* --------------------------------------------------------------------------
   Actions (print / share / reset)
   -------------------------------------------------------------------------- */
.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

.actions button svg { width: 18px; height: 18px; flex: none; }

.actions button:hover:not(:disabled) { background: var(--bg); border-color: var(--accent); }

.actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.action-status {
  font-size: 13px;
  color: var(--accent-dark);
  text-align: center;
}

/* When the status message is empty it must take no vertical room at all,
   otherwise it injects a phantom gap between the buttons and the counter. */
.action-status:empty { display: none; }
.action-status:not(:empty) { margin-top: 6px; }

/* --------------------------------------------------------------------------
   Ad disclosure
   -------------------------------------------------------------------------- */
.ad-note {
  font-size: 12px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  margin: 0 0 var(--gap-m);
}

/* --------------------------------------------------------------------------
   Ad slot: empty reserved container. Stays invisible (and gapless) while
   empty; once an ad script is pasted inside it takes the standard banner
   footprint and spacing.
   -------------------------------------------------------------------------- */
.ad-slot {
  max-width: 760px;
  margin: 0 auto var(--gap-m);
  padding: 0 16px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.ad-slot > div,
.ad-slot iframe,
.ad-slot table {
  max-width: 100% !important;
}

.ad-slot:empty { display: none; margin: 0; padding: 0; }

/* --------------------------------------------------------------------------
   Checklist
   -------------------------------------------------------------------------- */
#checklist { display: flex; flex-direction: column; gap: var(--space-sm); }

.checklist-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.checklist-section h3 {
  font-size: 14px;
  background: var(--accent-pale);
  color: var(--text);
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}

.checklist-section ul { list-style: none; }

.check-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.check-item:last-child { border-bottom: none; }

.check-item label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
  flex: none;
}

.remove-btn {
  flex: none;
  font: inherit;
  font-size: 12px;
  border: 1px solid #E0897E;
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
  background: var(--card);
  color: #C0392B;
  cursor: pointer;
}

.remove-btn:hover, .remove-btn:focus {
  background: #FDECEA;
}

.check-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.check-item .iname { font-size: 15px; }

.check-item .inote {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.check-item input:checked ~ .itext .iname {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(122,106,108,0.5);
}

.buy-link {
  flex: none;
  font-size: 12px;
  text-decoration: none;
  color: var(--accent-dark);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
  align-self: center;
}

/* --------------------------------------------------------------------------
   Custom items (user-added checklist entries)
   -------------------------------------------------------------------------- */
.custom-desc {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 14px;
}

.custom-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.custom-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}

.custom-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.custom-add-btn {
  flex: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  padding: 8px 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #FFFFFF;
  cursor: pointer;
}

.custom-add-btn:hover:not(:disabled) { background: #8E3A4E; }

.custom-add-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.custom-limit-msg {
  font-size: 12px;
  color: var(--muted);
  padding: 0 14px 10px;
}

.custom-limit-msg:empty { display: none; }

/* --------------------------------------------------------------------------
   Notice (cautions)
   -------------------------------------------------------------------------- */
.notice {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   SEO text block
   -------------------------------------------------------------------------- */
.seo-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin: 0 0 var(--gap-m);
}

.seo-block h2 { font-size: 17px; margin-bottom: 10px; }

.seo-block h3 { font-size: 15px; margin: 14px 0 6px; }

.seo-block p { font-size: 14px; color: #4A393C; margin-bottom: 10px; }

.seo-block p:last-child { margin-bottom: 0; }

.seo-block ul, .seo-block ol {
  font-size: 14px;
  color: #4A393C;
  padding-left: 22px;
  margin-bottom: 10px;
}

/* Content photo inside a .seo-block (choosing-guide pages).
   Spacing: bottom margin only, per the site-wide rule. */
.content-photo { margin: 0 0 10px; }

.content-photo img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Wide reference tables must scroll inside their own box rather than push
   the page. Same rule as nyugaku / goshuin. */
.table-scroll {
  overflow-x: auto;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

/* The min-width is what makes the wrapper actually scroll: without a floor,
   width:100% lets the table squeeze into the viewport and break short cells
   one character per line. */
.table-scroll .souba-table { margin-bottom: 0; min-width: 480px; }

/* Amount reference table (souba pages) */
.souba-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 10px;
}

.souba-table th, .souba-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.souba-table th {
  background: var(--accent-pale);
  font-weight: 700;
  white-space: nowrap;
}

.souba-table td .sub { display: block; font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------------------------
   YMYL disclaimer note (amount pages). Spacing follows the site-wide rule:
   margin-bottom only (--gap-m); clearance above comes from the preceding
   block.
   -------------------------------------------------------------------------- */
.disclaimer-note {
  font-size: 12px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 var(--gap-m);
}

/* --------------------------------------------------------------------------
   FAQ block
   -------------------------------------------------------------------------- */
.faq-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin: 0 0 var(--gap-m);
}

.faq-block h2 { font-size: 17px; margin-bottom: 8px; }

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.faq-item:last-child { border-bottom: none; padding-bottom: 0; }

.faq-item summary {
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 28px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
}

.faq-item[open] summary::after { content: '\2212'; }

.faq-item p {
  font-size: 14px;
  color: #4A393C;
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Back to top button
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(61,43,46,0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 40;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top svg { width: 22px; height: 22px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  /* No margin-top: the block that always precedes the footer carries
     the gap (margin-bottom: var(--gap-m)) - single source of truth. */
  margin-top: 0;
  padding: 20px 16px 28px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-bottom: 10px;
}

.site-footer a { color: var(--muted); text-decoration: none; }

/* --------------------------------------------------------------------------
   Print title (hidden on screen)
   -------------------------------------------------------------------------- */
.print-header { display: none; }

/* --------------------------------------------------------------------------
   Narrow mobile adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  /* Action buttons stay horizontal and equal-width; hide the decorative
     icon and keep the text label, since a mis-tapped icon-only Reset
     button would silently wipe the user's saved progress. */
  .actions button svg { display: none; }

  .check-item { flex-direction: column; align-items: stretch; }
  .row-actions { margin-left: 0; margin-top: 4px; justify-content: flex-end; }

  /* 4-option question groups: force a fixed 2x2 grid instead of flex-wrap,
     so JP/EN label length never produces an unbalanced 3+1 wrap. */
  .qbtns-grid2 { display: grid; grid-template-columns: 1fr 1fr; }
}

/* --------------------------------------------------------------------------
   Desktop adjustments (secondary target)
   -------------------------------------------------------------------------- */
@media (min-width: 720px) {
  .hero-photo { height: 260px; }
  .hero h1 { font-size: 28px; }
  .hub-cards { grid-template-columns: repeat(3, 1fr); }
  /* Section-size variants: 2 or 4 cards fill a 2-column grid so no row is
     ever left with a single card floating beside an empty column. */
  .hub-cards-2, .hub-cards-4 { grid-template-columns: repeat(2, 1fr); }
  .card-visual { height: 104px; }
  .hub-card-tool .card-visual { height: 140px; }
}

/* --------------------------------------------------------------------------
   Print: checklist only, black and white
   -------------------------------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .site-header, .hero, .qcard, .actions, .progress, .action-status,
  .ad-note, .buy-link, .remove-btn, .benefit-line, .seo-block, .faq-block,
  .site-footer, .notice, .back-to-top, .ad-slot, .result-card,
  .disclaimer-note, .custom-desc, .custom-add-row, .custom-limit-msg,
  .action-group, .checker-actions, .envelope-figure { display: none !important; }
  .custom-section.is-empty { display: none !important; }
  .print-header { display: block; margin-bottom: 12pt; }
  .print-header h1 { font-size: 16pt; }
  .print-header p { font-size: 10pt; color: #333; }
  .container { max-width: none; padding: 0; }
  #checklist { gap: 0; }
  .checklist-section {
    border: none;
    border-radius: 0;
    margin-bottom: 8pt;
    break-inside: avoid;
  }
  .checklist-section h3 {
    background: none;
    border-bottom: 1pt solid #000;
    padding: 2pt 0;
    font-size: 12pt;
  }
  .check-item { padding: 3pt 0; border-bottom: none; }
  .check-item .iname { font-size: 11pt; color: #000 !important; text-decoration: none !important; }
  .check-item .inote { color: #444; }
}
