@font-face {
  font-family: "Open Sans";
  src: url("../fonts/open-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Slab";
  src: url("../fonts/roboto-slab.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #26332e;
  --muted: #4c5a54;
  --green: #196047;
  --green-deep: #124a36;
  --green-light: #e8f1ec;
  --tint: #f5f7f6;
  --line: #d3ddd7;
  --serif: "Roboto Slab", Georgia, serif;
  --sans: "Open Sans", system-ui, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

[hidden] { display: none !important; }
body { background: var(--paper); color: var(--ink); font: 1rem/1.6 var(--sans); }
h1, h2, h3, p, dl { margin: 0; }
h1, h2, h3 { color: var(--ink); font-family: var(--serif); }
strong, b { color: inherit; }
a { color: var(--green); }
a:hover { color: var(--green-deep) !important; border-bottom-color: var(--green-deep); }
button, input, select { font: inherit; }
body button {
  height: auto;
  line-height: 1.35;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: none;
  padding: 0;
  border-radius: .25rem;
  color: inherit !important;
}
body button:hover, body button:active { background-color: transparent; }
body form { margin: 0; }
:focus-visible { outline: 2px solid #228257; outline-offset: 3px; }
.visually-hidden, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip:focus { position: absolute; z-index: 20; top: .6rem; left: .6rem; padding: .6rem 1rem; background: white; }
.shell { width: 100%; }

#main { min-width: 0; }
#main > .inner { padding-inline: clamp(1.4rem, 4vw, 4.25rem); max-width: 77rem; }
#header { align-items: center; justify-content: space-between; gap: .75rem; border-bottom: 4px solid var(--green); padding: 2.45rem 0 .95rem; }
#header .logo { font: 400 clamp(1.025rem, 2.3vw, 1.275rem)/1.3 var(--serif); color: var(--ink); overflow-wrap: anywhere; }
#header .logo strong { font-weight: 700; }
#header #menu-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  gap: .45rem;
  align-items: center;
  min-height: 2.5rem;
  padding: .4rem .58rem;
  border: 1px solid var(--line);
  color: var(--green) !important;
  font-size: .9rem;
  font-weight: 700;
}
#header #menu-toggle:hover { background: var(--tint); }
.menu-icon {
  display: inline-block;
  width: .9rem;
  height: .64rem;
  border-block: 1.5px solid currentColor;
  position: relative;
}
.menu-icon::after { content: ""; position: absolute; inset: calc(50% - .5px) 0 auto; border-top: 1px solid currentColor; }

#sidebar {
  width: clamp(14.5rem, 19.5vw, 18rem);
  position: relative;
  left: auto;
  top: auto;
  height: auto;
  z-index: auto;
  box-shadow: none;
  background: #f5f6f5;
  border-inline-end: 1px solid var(--line);
}
#sidebar > .inner {
  position: sticky;
  top: 0;
  width: 100%;
  height: auto;
  max-height: 100vh;
  overflow: auto;
  padding: 2.45rem clamp(1.25rem, 2.55vw, 2.15rem);
}
#sidebar > .inner::after { content: none; }
#menu > header.major { margin: 0; }
#menu > header.major h2 { border-color: var(--green); margin: 0 0 .65rem; padding: 0 .55rem .36rem 0; font-size: 1.2rem; }
#menu > ul + header.major { margin-top: 1.65rem; }
#menu ul { font-family: var(--sans); letter-spacing: normal; text-transform: none; }
#menu > ul > li { margin: 0; padding: 0; border-top: 1px solid var(--line); }
#menu > ul > li:first-child { border-top: 0; }
#menu ul a { padding: .61rem 0; color: var(--ink); font-size: .9rem; line-height: 1.42; }
#menu ul a[aria-current="page"] { color: var(--green); font-weight: 700; }

.hero, .page-hero { padding: 2.6rem 0 1.6rem; }
.hero h1, .page-hero h1 { font-size: clamp(1.95rem, 3.7vw, 2.9rem); line-height: 1.16; max-width: 28ch; }
.page-hero h1 { max-width: 39ch; text-wrap: balance; }
.hero p, .page-hero p { margin-top: .65rem; color: var(--muted); max-width: 63ch; }
.tool-section { padding-bottom: 2.5rem; }
.workbench { display: grid; grid-template-columns: minmax(0, 1.56fr) minmax(0, 1fr); align-items: start; gap: 1.2rem; scroll-margin-top: 1.3rem; }
.tool-card { min-width: 0; padding: 1.05rem 1.15rem 1.2rem; border: 1px solid var(--line); border-radius: .2rem; }
.tool-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.tool-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 2.55rem;
  padding: .35rem;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--muted) !important;
  font-weight: 650;
}
.tool-tabs button[aria-selected="true"] { border-color: var(--green); color: var(--green-deep) !important; }
.tool-tabs button:hover { background: var(--tint); }
.glyph { width: .95rem; height: .95rem; display: inline-block; flex: 0 0 .95rem; position: relative; }
.glyph-grid { border: 1.5px solid currentColor; border-radius: .18rem; }
.glyph-grid::before, .glyph-grid::after { content: ""; position: absolute; background: currentColor; }
.glyph-grid::before { width: 100%; height: 1px; top: 50%; left: 0; }
.glyph-grid::after { height: 100%; width: 1px; top: 0; left: 50%; }
.glyph-search::before { content: ""; position: absolute; inset: .01rem .22rem .22rem .01rem; border: 1.5px solid currentColor; border-radius: 50%; }
.glyph-search::after { content: ""; position: absolute; bottom: .1rem; right: -.02rem; height: 1.5px; width: .38rem; background: currentColor; transform: rotate(45deg); }
.glyph-lock::before { content: ""; position: absolute; inset: .39rem .03rem 0; border: 1.5px solid currentColor; border-radius: .14rem; }
.glyph-lock::after { content: ""; position: absolute; inset: 0 .21rem auto; height: .49rem; border: 1.5px solid currentColor; border-bottom: 0; border-radius: .36rem .36rem 0 0; }
.glyph-copy::before, .glyph-copy::after { content: ""; position: absolute; border: 1.5px solid currentColor; border-radius: .13rem; }
.glyph-copy::before { inset: 0 .23rem .23rem 0; }
.glyph-copy::after { inset: .23rem 0 0 .23rem; background: white; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem .95rem; }
.field { min-width: 0; }
.field > label, .field legend { display: block; color: var(--ink); font-size: .925rem; font-weight: 650; margin-bottom: .28rem; }
.field input:not([type="radio"]), .field select {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  height: auto;
  padding: .5rem .65rem;
  border: 1px solid #b9c9c0;
  border-radius: .25rem;
  background: white;
  color: var(--ink);
  font: inherit;
}
.field input::placeholder { color: #5c6861 !important; opacity: 1; }
.field input:not([type="radio"]):focus, .field select:focus { border-color: var(--green); box-shadow: none; outline: 2px solid #76a890; outline-offset: 1px; }
.field input[aria-invalid="true"], .choice:has(input[aria-invalid="true"]) span { border-color: #b83e38; }
.full { grid-column: 1/-1; }
.date-fields { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: .35rem; }
.field .date-fields input:not([type="radio"]) { padding-inline: .12rem; text-align: center; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
.choice { position: relative; min-width: 0; cursor: pointer; margin: 0; }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice span {
  display: grid;
  place-items: center;
  min-height: 2.75rem;
  padding: .22rem .14rem;
  text-align: center;
  border: 1px solid #b9c9c0;
  border-radius: .25rem;
  color: var(--muted);
  font-size: .89rem;
}
.choice input:checked + span { background: var(--green-light); color: var(--green-deep); border-color: #57936e; font-weight: 650; }
.choice input:focus-visible + span { outline: 2px solid #228257; outline-offset: 2px; }
.place-picker { position: relative; }
.place-picker input:not([type="radio"]) { padding-inline-start: 2.05rem; }
.place-picker > .glyph { position: absolute; top: .89rem; left: .68rem; color: var(--green); pointer-events: none; }
small { display: block; margin-top: .3rem; color: var(--muted); font-size: .84rem; }
.place-options {
  position: absolute;
  z-index: 5;
  inset: 100% 0 auto;
  max-height: 16.8rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .25rem;
  margin: .2rem 0 0;
  border: 1px solid #b9c9c0;
  list-style: none;
  background: white;
  box-shadow: 0 .35rem .75rem #26332e20;
}
.place-options li { display: flex; justify-content: space-between; gap: .55rem; padding: .43rem .55rem; cursor: pointer; }
.place-options li[aria-selected="true"], .place-options li:hover { background: var(--green-light); }
.place-options small { margin: 0; }
.place-options .place-code { color: var(--green); font: .83rem/1.6 var(--mono); white-space: nowrap; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .65rem; margin-top: .25rem; }
body .primary-button, body .plain-button, body .copy-button { min-height: 2.65rem; padding: .46rem .72rem; font-weight: 650; }
body .primary-button { background: var(--green); color: white !important; border: 1px solid var(--green); }
body .primary-button:hover, body .primary-button:active { background: var(--green-deep); }
body .plain-button { color: var(--green-deep) !important; }
body .plain-button:hover { background: var(--tint); text-decoration: underline; }
.form-message { padding: .5rem .65rem; border-left: 3px solid #a4352e; background: #faeae8; color: #84281f; font-size: .925rem; }
.field .code-field:not([type="radio"]) { font-family: var(--mono); text-transform: uppercase; }
.code-field::placeholder { text-transform: none; font-family: var(--sans); }
.decoded { margin-top: 1.15rem; background: var(--tint); padding: .85rem .95rem; border-left: 3px solid var(--green); }
.decoded-title { color: var(--green-deep); font-weight: 700; }
.decoded dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem .95rem; margin: .6rem 0; }
.decoded dt { font-size: .86rem; color: var(--muted); }
.decoded dd { margin: 0; font-weight: 650; }

.result-stack { display: grid; gap: .8rem; min-width: 0; }
.result-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 10.4rem;
  padding: 1rem 1.1rem;
  gap: .6rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--green);
  background: var(--tint);
  scroll-margin-block: 1.2rem;
}
.result-top { display: flex; align-items: center; gap: .55rem; font-family: var(--serif); font-weight: 700; }
.card-symbol { display: inline-grid; grid-template-columns: repeat(2, .22rem); grid-template-rows: repeat(2, .22rem); place-content: center; gap: .13rem; width: 1.6rem; height: 1.6rem; border: 1px solid #77a68f; border-radius: .2rem; }
.card-symbol i { background: var(--green); }
.result-placeholder, #result-code { margin-top: .38rem; font: 700 clamp(1.04rem, 2vw, 1.45rem)/1.28 var(--mono); }
.result-placeholder { display: flex; flex-wrap: wrap; gap: .36rem; color: #557466; letter-spacing: .01em; }
#result-code { color: var(--green-deep); letter-spacing: .018em; overflow-wrap: anywhere; }
.result-card p { color: var(--muted); font-size: .9rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: .34rem; margin-top: .16rem; }
body .copy-button {
  display: inline-flex;
  gap: .38rem;
  align-items: center;
  min-height: 2.28rem;
  padding: .28rem .52rem;
  border: 1px solid #80a795;
  background: white;
  color: var(--green-deep) !important;
  font-size: .845rem;
}
body .copy-button:hover { background: var(--green-light); }
body .copy-button.secondary { background: transparent; }
body .copy-button.secondary:hover { background: var(--green-light); }
.result-preview-link { align-self: flex-start; font-size: .9rem; font-weight: 650; }
.local-note { display: flex; gap: .55rem; align-items: flex-start; padding: .18rem 0; }
.privacy-icon { display: grid; place-items: center; color: var(--green); width: 1.3rem; height: 1.45rem; flex: 0 0 1.3rem; }
.local-note strong { font-size: .92rem; }
.local-note p, .official-note { color: var(--muted); font-size: .88rem; }
.official-note a { font-weight: 650; }
.card-previews { margin-top: 2rem; scroll-margin-top: 1.25rem; }
.preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: .95rem; }
.preview-tile { min-width: 0; padding: .9rem; border: 1px solid var(--line); }
.preview-tile h3 { margin-bottom: .55rem; font-size: 1.02rem; }
.preview-tile canvas { display: block; width: 100%; height: auto; margin-bottom: .7rem; }
.preview-status:not(:empty) { margin-top: .55rem; color: var(--muted); font-size: .89rem; }

.portal-shortcuts, .guide-section, .faq-section, .editorial-area { padding-block: 1.9rem 2.1rem; border-top: 1px solid var(--line); }
.portal-shortcuts h2, .section-intro h2 { font-size: clamp(1.3rem, 2.9vw, 1.72rem); line-height: 1.28; }
.section-intro p { margin-top: .55rem; color: var(--muted); max-width: 62ch; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.related-card { display: grid; align-content: start; gap: .3rem; padding-block: .6rem; border-top: 2px solid var(--line); border-bottom: 0; }
.related-card:hover { border-top-color: var(--green); }
.related-card strong { text-decoration: underline; text-underline-offset: .2em; }
.related-card span { color: var(--muted); font-size: .91rem; }
.anatomy { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 1.1rem; border-block: 1px solid var(--line); }
.anatomy article { padding: .9rem .8rem; }
.anatomy article + article { border-inline-start: 1px solid var(--line); }
.code-chip { display: inline-block; padding: .2rem .38rem; border: 1px solid #c6dbd0; border-radius: .2rem; color: var(--green-deep); background: var(--green-light); font: 700 .94rem/1.4 var(--mono); white-space: nowrap; }
.anatomy h3 { font-size: .99rem; margin: .5rem 0 .24rem; }
.anatomy p, .guide-detail p, .questions p { color: var(--muted); font-size: .93rem; }
.guide-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem 1.5rem; margin-top: 1.25rem; }
.guide-detail h3 { font-size: 1.12rem; margin-bottom: .32rem; }
.article-related { margin-top: .9rem; }
.faq-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.85fr); gap: 1.05rem 1.35rem; }
.questions details { border-bottom: 1px solid var(--line); }
.questions details:first-child { border-top: 1px solid var(--line); }
.questions summary { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .65rem 0; font-weight: 650; cursor: pointer; list-style: none; }
.questions summary::-webkit-details-marker { display: none; }
.questions summary::after { content: "+"; color: var(--green); font-size: 1.2rem; }
.questions details[open] summary::after { content: "−"; }
.questions details p { padding-bottom: .7rem; }

.editorial { max-width: 73ch; }
.editorial h2 { margin: 1.7rem 0 .5rem; font-size: clamp(1.25rem, 2.8vw, 1.7rem); line-height: 1.27; }
.editorial h2:first-child { margin-top: 0; }
.editorial .seo-subheading { margin: 1.15rem 0 .35rem; font-size: 1.12rem; }
.editorial p + p { margin-top: .6rem; }
.editorial ul { margin: .65rem 0; }
.editorial li + li { margin-top: .35rem; }
.editorial code { color: var(--green-deep); font-family: var(--mono); overflow-wrap: anywhere; }
.editorial .article-sources { color: var(--muted); margin-top: 1.25rem; padding-top: .6rem; border-top: 1px solid var(--line); font-size: .9rem; }
.site-breadcrumb {
  color: var(--muted);
  font-size: .875rem;
  padding-top: 1rem;
}
.site-breadcrumb + .page-hero { padding-top: 1.15rem; }
.site-breadcrumb ol { display: flex; flex-wrap: wrap; gap: .25rem .55rem; margin: 0; padding: 0; list-style: none; }
.site-breadcrumb li { display: flex; gap: .55rem; align-items: baseline; padding: 0; }
.site-breadcrumb li + li::before {
  content: "";
  width: .32rem;
  height: .32rem;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translateY(-.1rem) rotate(45deg);
}
.editorial .seo-table { margin-bottom: .85rem; font-size: .93rem; }
.seo-table caption { color: var(--muted); padding-block: .35rem; text-align: left; }
.seo-table th[scope="row"] { padding: .55rem .65rem; }
.seo-table th[scope="col"] { padding-inline: .65rem; }
.seo-table td { padding: .55rem .65rem; }
.article-index { display: flex; flex-wrap: wrap; gap: .35rem .95rem; border-bottom: 1px solid var(--line); padding-bottom: .65rem; font-size: .93rem; }
.reference-list { margin-top: .85rem; border-block: 1px solid var(--line); }
.reference-list > div { display: grid; grid-template-columns: minmax(5.2rem, .45fr) minmax(0, 2.3fr); gap: .5rem .8rem; padding-block: .65rem; }
.reference-list > div + div { border-top: 1px solid var(--line); }
.reference-list dt { font-weight: 700; }
.reference-list dd { margin: 0; }
.official-list > div { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.official-list p + a { display: inline-block; margin-top: .25rem; font-weight: 650; }
.character-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; margin-top: .75rem; }
.character-grid.compact { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.character-grid > div { background: var(--tint); display: flex; justify-content: space-between; align-items: center; gap: .35rem; padding: .35rem .55rem; }
.character-grid dt { font-weight: 400; }
.character-grid dd { color: var(--green); font: 700 1rem var(--mono); margin: 0; }
.archive-card h2 { font-size: 1.25rem; margin-bottom: .65rem; }
.archive-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: .65rem; }
.field select {
  appearance: none;
  padding-right: 1.55rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--green) 50%), linear-gradient(135deg, var(--green) 50%, transparent 50%);
  background-position: calc(100% - .882rem) 50%, calc(100% - .55rem) 50%;
  background-size: .34rem .34rem;
  background-repeat: no-repeat;
}
.sample-links { font-size: .88rem; color: var(--muted); }
.archive-status { margin-top: 1rem; padding-block: .45rem; color: var(--muted); border-top: 1px solid var(--line); }
.archive-results { list-style: none; padding: 0; margin: 0; }
.archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  padding: .56rem .2rem;
  border-bottom: 1px solid var(--line);
}
.archive-row small { margin-top: .08rem; }
.archive-period { color: var(--muted); font-size: .9rem; }
.archive-more { margin-top: .4rem; }

.site-footer { padding-block: 1.35rem; border-top: 1px solid var(--line); }
.footer-layout { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .65rem 1.2rem; }
.footer-brand { color: var(--ink); border-bottom: 0; font: 700 .96rem var(--serif); }
.footer-brand .brand-mark { display: none; }
.site-footer p { font-size: .85rem; color: var(--muted); margin-top: .22rem; }
.footer-link-groups { display: flex; flex-wrap: wrap; flex: 1 0 100%; gap: 1rem clamp(1.25rem, 5vw, 4rem); padding-block: .65rem; }
.footer-link-groups .footer-link-title { color: var(--ink); font-weight: 700; }
.footer-link-groups ul { margin: .35rem 0 0; padding: 0; list-style: none; font-size: .875rem; }
.footer-link-groups li { margin: .25rem 0; padding: 0; }
.print-slip { display: none; }
@media print {
  body.printing-result > :not(.print-slip) { display: none !important; }
  .print-slip { display: block; margin: 2cm; color: #000; }
  .print-slip h1 { font-size: 1.45rem; }
  .print-code { margin: .8rem 0; font: 700 1.6rem var(--mono); }
  #sidebar, #menu-toggle { display: none !important; }
}

@media (max-width: 62rem) {
  #wrapper { display: block; }
  #sidebar { width: 100%; border: 0; border-bottom: 1px solid var(--line); }
  #sidebar > .inner { position: static; max-height: none; overflow: visible; padding: 1rem 1rem 1.15rem; }
  #menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; align-items: start; }
  #menu > ul + header.major { grid-row: 1; grid-column: 2; margin-top: 0; }
  #menu > ul { grid-row: 2; }
  #menu > ul:nth-of-type(2) { grid-column: 2; }
  #header { padding-top: 1.2rem; }
  .hero, .page-hero { padding-top: 1.8rem; }
}

@media (max-width: 45rem) {
  #main > .inner { padding-inline: 1rem; }
  .workbench, .guide-detail, .faq-layout, .related-grid, .preview-grid { grid-template-columns: minmax(0, 1fr); }
  .related-grid { gap: .2rem; }
  .archive-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-field { grid-column: 1/-1; }
  .archive-row { grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .5rem; }
  .archive-row .code-chip { grid-column: 2; grid-row: 1 / span 2; }
  .archive-period { grid-row: 2; }
  .anatomy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .anatomy article:nth-child(odd) { border-inline-start: 0; }
  .anatomy article:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 24rem), (min-width: 62.01rem) and (max-width: 72rem) {
  .form-grid { gap: .65rem; }
  .choice span { font-size: .8rem; }
  .tool-card { padding: .85rem; }
}

@media (max-width: 24rem) {
  #header .logo { font-size: .94rem; overflow-wrap: normal; }
  .form-grid > fieldset { grid-column: 1/-1; }
  .choice span { font-size: .89rem; }
  .form-actions .plain-button { padding-inline: .25rem; }
  .archive-form, .official-list > div { grid-template-columns: minmax(0, 1fr); }
  .character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .character-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
