:root {
  color-scheme: only light;
  --cream: #fcf9f2;
  --paper: #fff;
  --ink: #173f67;
  --text: #3e5062;
  --muted: #4d6375;
  --pale: #eaf7ff;
  --wash: #f4faff;
  --selected: #cdeafa;
  --blue: #146398;
  --deep-blue: #104d78;
  --line: #cbdfe9;
  --control: #6c8799;
  --warm: #823d21;
  --warm-wash: #fff2e3;
  --warm-line: #b7754f;
  --success: #195d43;
  --success-wash: #e4f5ec;
  --error: #8b3027;
  --error-wash: #fff0ed;
  --shadow: 0 4px 14px #3c668215;
  --dialog-shadow: 0 12px 44px #254f6730;
  --font: "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, "Noto Sans CJK JP", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: var(--cream); scroll-behavior: smooth; scroll-padding-top: 1rem; }
body { margin: 0; color: var(--text); background: var(--cream); font: 1rem/1.7 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--blue); text-underline-offset: .2em; }
:where(button, a, input, textarea, select, summary):focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
h1, h2, h3, h4, strong { color: var(--ink); }
svg { width: 1.25em; height: 1.25em; vertical-align: middle; }
.icon-sheet { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

.top-inner, .wrap, footer { width: min(1280px, calc(100% - 48px)); margin-inline: auto; }
.site-masthead {
  display: grid;
  place-items: center;
  background: #aadaf5 url("../assets/masthead-sky.webp") center 46% / cover no-repeat;
}
.site-masthead a { display: block; padding: 10px 0 16px; }
.site-masthead img { display: block; width: clamp(260px, 30vw, 400px); height: auto; }
.top-inner {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  min-height: 64px;
  margin-top: -5px;
  padding: 9px clamp(12px, 2.5vw, 32px);
  background: var(--paper);
  box-shadow: var(--shadow);
  border: 1px solid #ebeae3;
  border-radius: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--warm-wash); color: var(--warm); }
.brand-icon svg { width: 27px; height: 27px; }
.brand b { display: block; font-size: 1.05rem; line-height: 1.4; }
.top nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-left: auto; }
.top nav :is(button, a), .submit-top {
  display: inline-flex; align-items: center; justify-content: center; gap: .3em;
  min-height: 40px; padding: 5px 11px; border-radius: 99px;
  font-size: .94rem; font-weight: 700; white-space: nowrap; text-decoration: none;
}
.top nav button { color: var(--ink); }
.top nav button:hover, .top nav .nav-official:hover { background: var(--pale); color: var(--deep-blue); }
.top nav .nav-active { background: var(--selected); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.top nav .nav-official { border: 1px solid var(--control); color: var(--blue); }
.nav-official span { font-family: var(--mono); }
.submit-top { background: var(--blue); color: white; border: 1px solid var(--blue); padding-inline: 16px; }
.submit-top:hover { background: var(--deep-blue); }
.parent-home { display: inline-flex; align-items: center; min-height: 40px; margin-block: 3px; font-size: .875rem; }
.parent-home:hover, .footer-home:hover { color: var(--deep-blue); }

.hero {
  position: relative; isolation: isolate; display: flex; align-items: center;
  min-height: 222px; overflow: hidden; border-radius: 22px;
  border: 1px solid #cbe6f2; background: var(--pale);
}
.hero-art { position: absolute; z-index: -2; inset: 0 0 0 auto; width: 76%; background: url("../assets/hero.webp") right center / cover no-repeat; }
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(90deg, #eaf7ff 13%, #eef9ff 32%, #eef9ffd9 42%, #eef9ff40 57%, transparent 70%);
}
.hero-inner { padding: 24px clamp(20px, 4.5vw, 58px); }
.hero h1 { margin: 0 0 7px; font-size: clamp(1.7rem, 2.65vw, 2.45rem); line-height: 1.35; letter-spacing: .04em; }
.hero h1 strong { color: var(--blue); }
.hero p { margin: 0; color: #32576c; line-height: 1.75; font-size: 1rem; }

.catalog {
  margin-top: 24px; padding: clamp(16px, 2.3vw, 30px);
  background: var(--paper); border: 1px solid #e4e9e8; border-radius: 22px; box-shadow: var(--shadow);
}
.catalog-heading, .filter-result-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.eyebrow { color: var(--blue); font: 700 .75rem/1.5 var(--mono); letter-spacing: .12em; }
.catalog h2 { display: flex; align-items: center; gap: 10px; margin: 2px 0 0; font-size: clamp(1.45rem, 2.2vw, 1.9rem); line-height: 1.45; }
.catalog h2 svg { width: .85em; height: .85em; color: var(--blue); }
.search-wrap {
  display: flex; align-items: center; gap: 9px; min-height: 44px; width: min(100%, 310px);
  padding: 6px 14px; background: var(--paper); color: var(--blue); border: 1px solid var(--control); border-radius: 99px;
}
.search-wrap svg { flex: none; }
.search-wrap input { min-width: 0; width: 100%; color: var(--ink); border: 0; background: transparent; font-size: 1rem; }
.search-wrap input:focus { outline: none; }
.search-wrap:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.catalog-scopes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.catalog-scopes a {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 6px 16px; border: 1px solid var(--control); border-radius: 99px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: .94rem;
}
.catalog-scopes svg { width: 18px; height: 18px; color: var(--warm); }
.catalog-scopes a:hover { background: var(--wash); }
.catalog-scopes a[aria-current="page"] { background: var(--selected); border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.tag-filter { margin-top: 18px; padding: 14px 0 10px; border-top: 1px solid var(--line); }
.tag-filter-head, .tag-options, .tag-finder { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tag-filter-head { justify-content: space-between; }
.tag-filter-head h3 { margin: 0; font-size: 1.05rem; }
.tag-hint, .tag-finder, .official-tags summary span, .official-tags h4 small { color: var(--muted); font-size: .9rem; }
.tag-hint { margin: 3px 0 10px; }
.tag-finder { margin: 6px 0 12px; }
.tag-query { width: min(100%, 18rem); min-height: 40px; padding: 5px 12px; border: 1px solid var(--control); border-radius: 8px; color: var(--ink); background: var(--paper); }
.tag-clear, .registry-notice button, .issued-card-actions button { padding: 4px; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.tag-clear { font-size: .9rem; }
.tag-clear:disabled { cursor: default; color: var(--muted); text-decoration: none; }
.tag-choice, .card-tag {
  max-width: 100%; border: 1px solid var(--control); border-radius: 99px;
  background: var(--wash); color: var(--ink); overflow-wrap: anywhere; text-align: start;
}
.tag-choice { min-height: 36px; padding: 3px 12px; font-size: .9rem; font-weight: 650; }
.tag-choice:hover, .card-tag:hover { color: var(--deep-blue); border-color: var(--blue); text-decoration: underline; }
.official-tags { padding: 9px 14px; margin: 6px 0 12px; background: var(--wash); border: 1px solid var(--line); border-radius: 12px; }
.official-tags summary { width: fit-content; padding-block: 2px; cursor: pointer; color: var(--ink); font-weight: 750; }
.official-tags summary span, .official-tags h4 small { font-weight: 500; margin-left: 5px; }
.official-tags h4 { margin: 12px 0 5px; font-size: 1rem; }
.official-tags .tag-change { margin: 12px 0 8px; }
.official-tags a { display: inline-flex; align-items: center; text-decoration: none; background: var(--paper); }
.official-tags a:hover { text-decoration: underline; }
.filter-result-row { justify-content: flex-end; margin: 0 0 10px; }
.count { font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.registry-notice { margin-top: 14px; color: var(--muted); font-size: .95rem; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  transition: transform .16s, border-color .16s;
}
.card:hover { transform: translateY(-2px); border-color: var(--control); }
.artbtn { position: relative; display: block; padding: 0; width: 100%; aspect-ratio: 1.98; overflow: hidden; background: var(--pale); }
.artbtn:focus-visible { outline-offset: -4px; z-index: 1; }
.artbtn img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.save, .close-icon { display: grid; place-items: center; line-height: 1; border: 1px solid var(--control); background: var(--paper); color: var(--ink); border-radius: 10px; }
.save { position: absolute; z-index: 1; top: 10px; right: 10px; width: 38px; height: 38px; box-shadow: var(--shadow); }
.save:hover, .save.is-saved { background: var(--pale); border-color: var(--blue); color: var(--blue); }
.save.is-saved::after { content: "✓"; position: absolute; right: 2px; bottom: 1px; font-size: .75rem; line-height: 1; font-weight: 800; background: var(--pale); }
.close-icon { width: 40px; height: 40px; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 15px 17px; }
.tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; color: var(--ink); background: var(--pale); padding: 1px 8px; border-radius: 99px; line-height: 1.65; font-size: .875rem; font-weight: 650; }
.tag.pink { color: #893b64; background: #ffebf4; }
.tag.blue { color: #245e8b; background: #e6f3ff; }
.tag.teal { color: #22605e; background: #e3f6f2; }
.tag-choice[aria-pressed="true"], .card-tag[aria-pressed="true"] { color: var(--deep-blue); background: var(--selected); border-color: var(--blue); }
.tag-choice[aria-pressed="true"]::after, .card-tag[aria-pressed="true"]::after { content: "✓"; margin-inline-start: .35em; font-weight: 800; }
.card h3 { margin: 9px 0 6px; font-size: clamp(1.12rem, 1.6vw, 1.4rem); line-height: 1.45; }
.card h3 button { padding: 0; color: var(--ink); font-size: inherit; font-weight: 800; text-align: left; }
.card h3 button:hover { color: var(--blue); text-decoration: underline; }
.card p { margin: 0 0 16px; line-height: 1.7; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.card-meta svg { width: 16px; height: 16px; margin-right: 4px; }
.note-badge, .evidence-label { color: var(--muted); }
.evidence-label { display: block; margin: 0 0 10px; font-size: .875rem; }
.issued-card { border-top: 3px solid var(--warm-line); overflow-wrap: anywhere; }
.issued-emblem { display: flex; align-items: center; gap: 7px; padding-right: 35px; color: var(--warm); font-size: .9rem; font-weight: 700; }
.issued-card .tags, .issued-card h3 { margin-bottom: 12px; }
.issued-card-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 5px; }
.issued-card-actions button { padding-left: 0; font-size: .94rem; }
.mini-mark { display: inline-block; flex: none; position: relative; width: 19px; height: 18px; color: var(--warm); }
.mini-mark svg:first-child { position: absolute; bottom: 0; left: 0; width: 16px; height: 16px; }
.mini-mark svg:last-child { position: absolute; top: 0; right: -1px; width: 10px; height: 10px; color: #bc4228; }

.about-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin: 24px 0 30px; padding: 18px clamp(16px, 2.4vw, 30px); border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(110deg, white 50%, var(--pale)); box-shadow: var(--shadow); }
.strip-mark { position: relative; display: grid; place-items: center; width: 52px; height: 52px; flex: none; border: 1px solid #dfbc95; background: var(--warm-wash); color: var(--warm); border-radius: 14px; }
.strip-mark svg { width: 33px; height: 33px; }
.strip-mark .little-flame { position: absolute; top: -6px; right: 2px; width: 19px; height: 22px; color: #bc4228; }
.about-strip h2 { margin: 0; font-size: 1.2rem; }
.about-strip .eyebrow { color: var(--warm); }
.about-strip p { margin: 2px 0 0; color: var(--muted); font-size: .94rem; }
.mark-links, .detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.mark-links { margin-left: auto; }
.secondary { min-height: 40px; padding: 6px 15px; background: var(--paper); border: 1px solid var(--blue); border-radius: 99px; color: var(--blue); font-size: .94rem; font-weight: 700; }
.secondary:hover, .close-icon:hover { background: var(--pale); }
footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 16px 0 24px; border-top: 1px solid var(--line); color: var(--muted); }
footer div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
footer span { font: .75rem/1.5 var(--mono); }
.footer-home, footer button { color: var(--blue); font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; }
footer button { padding: 4px 0; }
.empty { grid-column: 1/-1; padding: 26px 16px; background: var(--wash); border: 1px dashed var(--control); border-radius: 14px; text-align: center; }
.empty p { color: var(--muted); }
dialog::backdrop { background: rgba(112, 151, 172, .27); }
#info { width: min(660px, calc(100% - 28px)); max-height: 88dvh; padding: 0; border: 1px solid var(--control); border-radius: 18px; background: var(--paper); color: var(--text); box-shadow: var(--dialog-shadow); }
.detail-wrap { padding: clamp(16px, 3vw, 26px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dt-image { width: 100%; aspect-ratio: 2.75; object-fit: cover; image-rendering: pixelated; border-radius: 10px; }
.detail-wrap h2 { margin: 9px 0 3px; line-height: 1.45; font-size: 1.55rem; }
.detail-wrap h3 { margin: 19px 0 5px; font-size: 1.1rem; }
.detail-wrap p { margin: 5px 0 10px; }
.detail-wrap .byline { color: var(--muted); font-size: .9rem; }
.detail-wrap .info-box { padding: 12px 15px; background: var(--pale); border-left: 3px solid var(--blue); border-radius: 6px; font-size: .94rem; }
.detail-actions { justify-content: flex-end; margin-top: 20px; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 24px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 8px 18px; border: 1px solid var(--control); border-radius: 12px; background: var(--pale); color: var(--ink); box-shadow: var(--shadow); pointer-events: none; opacity: 0; transition: opacity .15s; }
.toast.show { opacity: 1; }

@media (max-width: 920px) {
  .top-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding-inline: 14px; }
  .brand { grid-area: 1 / 1; justify-self: start; white-space: normal; }
  .submit-top { grid-area: 1 / 2; }
  .top nav {
    grid-column: 1 / -1; grid-row: 2; justify-content: space-around; width: 100%;
    margin: 0; padding-top: 4px; gap: 3px; border-top: 1px solid var(--line);
  }
  .top nav :is(button, a) { padding-inline: 8px; }
  .cards { gap: 14px; }
}
@media (max-width: 760px) {
  .top-inner, .wrap, footer { width: calc(100% - 24px); }
  .top-inner { border-radius: 18px; }
  .top nav :is(button, a) { font-size: .875rem; padding-inline: 7px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-heading { align-items: start; flex-direction: column; gap: 10px; }
  .search-wrap { width: 100%; }
  .hero-art { width: 87%; }
  .hero::before { background: linear-gradient(90deg, #eaf7ff 8%, #eef9ff 42%, #eef9ffcc 55%, transparent 80%); }
  .mark-links { margin-left: 0; }
}
@media (max-width: 520px) {
  .top nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .site-masthead img { width: min(74vw, 300px); }
  .brand { gap: 6px; }
  .brand b { font-size: .97rem; word-break: keep-all; }
  .brand-icon { width: 30px; height: 30px; }
  .brand-icon svg { width: 22px; height: 22px; }
  .submit-top { font-size: .875rem; padding-inline: 10px; }
  .hero { min-height: 0; flex-direction: column; align-items: stretch; border-radius: 18px; }
  .hero-inner { padding: 15px 18px 6px; }
  .hero::before { display: none; }
  .hero-art { position: relative; z-index: 0; inset: auto; order: 1; width: 100%; height: 88px; background-position: 76% 55%; }
  .hero-art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, var(--pale), transparent 30%); }
  .hero h1 { font-size: 1.65rem; }
  .hero p { font-size: .94rem; }
  .catalog { margin-top: 16px; border-radius: 16px; }
  .catalog-scopes { gap: 5px; }
  .catalog-scopes a { padding-inline: 10px; font-size: .875rem; }
  .tag-options { gap: 6px; }
  .tag-choice { min-height: 38px; padding-inline: 10px; }
  .cards { grid-template-columns: 1fr; gap: 15px; }
  .about-strip { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; }
  .strip-mark { width: 42px; height: 42px; }
  .mark-links { grid-column: 1 / -1; }
  footer { align-items: flex-start; }
}
@media (max-width: 380px) {
  .top-inner { column-gap: 6px; padding-inline: 10px; }
  .submit-top svg { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
a.submit-top { color:#fff; text-decoration:none; display:inline-flex; align-items:center; gap:6px; font-weight:700; }
.mark-links a.secondary,.detail-actions a.secondary { display:inline-flex; align-items:center; text-decoration:none; }
.footer-actions>a { font-weight:700; }
