/* Shared by the pages under /tools/. Colors, header, footer and buttons repeat the ones in /index.html. */
:root {
  --paper: #FAF6EF;
  --paper-2: #F3EBDD;
  --ink: #2B2117;
  --muted: #6A5E50;
  --birch: #D8C29C;
  --marker: #FFE34D;
  --rule: rgba(43, 33, 23, .16);
  --display-jp: "Dela Gothic One", "Hiragino Sans", "Yu Gothic", sans-serif;
  --latin: "Unbounded", "Arial Black", sans-serif;
  --body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
.skip { position: absolute; left: 8px; top: -60px; z-index: 20; padding: 10px 16px; font-weight: 700; color: var(--ink); background: #fff; border: 2px solid var(--ink); }
.skip:focus { top: 8px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.mk { background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%); padding-inline: .08em; }

/* ---------- header / footer ---------- */
.site-head { border-bottom: 2px solid var(--ink); background: var(--paper); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; min-height: 44px; line-height: 0; --lg-ink: var(--ink); --lg-fill: var(--paper-2); }
.brand svg { height: 40px; width: auto; }
.lg-line { fill: none; stroke: var(--lg-ink); stroke-width: 6px; stroke-linecap: square; stroke-miterlimit: 8; }
.lg-fill { fill: var(--lg-fill); stroke: var(--lg-ink); stroke-width: 6px; stroke-miterlimit: 8; }
.lg-txt { fill: var(--lg-ink); }
.site-nav { display: flex; align-items: center; gap: 4px 18px; font-size: 14px; font-weight: 500; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-nav a[aria-current="page"] { font-weight: 700; box-shadow: inset 0 -3px 0 var(--marker); }
.site-foot { border-top: 2px solid var(--ink); background: var(--ink); color: var(--paper); padding: 40px 0 48px; margin-top: 72px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: flex-end; }
.site-foot .brand { --lg-ink: var(--paper); --lg-fill: transparent; }
.site-foot .brand svg { height: 52px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0 22px; font-size: 13px; }
.site-foot nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; opacity: .85; }
.site-foot nav a:hover { opacity: 1; text-decoration: underline; }
.site-foot small { display: block; font-size: 12px; opacity: .6; margin-top: 14px; }
.site-foot :focus-visible { outline-color: var(--paper); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  font-family: var(--body); font-weight: 700; font-size: 15px; line-height: 1.2;
  padding: 12px 18px; border: 2px solid var(--ink); border-radius: 0;
  text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s;
  background: transparent; color: var(--ink);
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.btn-solid:hover { box-shadow: 4px 4px 0 var(--marker), 4px 4px 0 2px var(--ink); }
.btn-s { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ---------- page title ---------- */
.page-head { padding: 40px 0 32px; }
.crumb { font-size: 13px; font-weight: 700; letter-spacing: .08em; display: flex; gap: 8px; align-items: center; }
.crumb a { text-underline-offset: 4px; }
.page-head h1 { font-family: var(--display-jp); font-weight: 400; font-size: clamp(34px, 6vw, 56px); line-height: 1.25; margin: 10px 0 12px; }
.page-head .lead { max-width: 40em; color: var(--muted); }
.local-note { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* ---------- hub cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { border: 2px solid var(--ink); background: #fff; padding: 24px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--marker), 6px 6px 0 2px var(--ink); }
.card .no { font-family: var(--latin); font-weight: 800; font-size: 13px; letter-spacing: .08em; }
.card h2 { font-family: var(--display-jp); font-weight: 400; font-size: 26px; line-height: 1.3; }
.card p { color: var(--muted); font-size: 15px; }
.card .go { margin-top: auto; padding-top: 8px; font-weight: 700; font-size: 14px; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }

/* ---------- tool layout: settings on the left, result on the right ---------- */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; border-top: 2px solid var(--ink); padding-top: 32px; }
.tool > .out { position: sticky; top: 16px; }
@media (max-width: 900px) {
  .tool { grid-template-columns: 1fr; }
  .tool > .out { position: static; }
}
.panel { border: 2px solid var(--ink); background: #fff; padding: 20px; }
.panel + .panel { margin-top: 20px; }
.panel > h2, .panel > summary { font-size: 17px; font-weight: 700; line-height: 1.5; }
.panel > h2 { margin-bottom: 14px; }
.panel > h2 small { font-family: var(--latin); font-weight: 800; font-size: 11px; letter-spacing: .08em; margin-right: 10px; }
details.panel > summary { cursor: pointer; }
details.panel[open] > summary { margin-bottom: 14px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.6; }
.hint a { text-underline-offset: 3px; }

/* ---------- form controls ---------- */
.field { display: grid; gap: 4px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .lab, fieldset > legend { font-size: 13px; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: end; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
input[type="text"], input[type="date"], input[type="number"], input[type="email"], input[type="url"], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 10px;
  font: inherit; font-size: 16px; line-height: 1.5; color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); border-radius: 0;
}
textarea { resize: vertical; min-height: 76px; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset:last-child { margin-bottom: 0; }
fieldset > legend { padding: 0; margin-bottom: 6px; }
/* a row of choices drawn as tags; the real input stays in the tag so it is reachable by keyboard */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border: 2px solid var(--ink); background: var(--paper); font-size: 14px; font-weight: 500; line-height: 1.3; cursor: pointer; user-select: none; }
.chip input { appearance: none; -webkit-appearance: none; width: 14px; height: 14px; margin: 0; border: 2px solid var(--ink); background: #fff; flex: none; }
.chip input[type="radio"] { border-radius: 50%; }
.chip input:checked { background: var(--ink); box-shadow: inset 0 0 0 2px #fff; }
.chip:has(input:checked) { background: var(--marker); }
.chip:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.chip input:focus-visible { outline: none; }

.status { font-size: 13px; font-weight: 700; min-height: 1.8em; }

/* canvas preview on a grey desk so a white or transparent sheet still shows its edge */
.stage { background: #E4DCCD; border: 2px solid var(--ink); padding: 16px; display: grid; place-items: center; }
.stage canvas { height: auto; box-shadow: 0 1px 6px rgba(43, 33, 23, .25); }
.stage canvas.checker { background: repeating-conic-gradient(#fff 0 25%, #E9E9E9 0 50%) 0 0 / 16px 16px; }

/* Chinese and Korean are not in the site's fonts: show them whole in the device's fonts rather than mixed */
[lang|="zh"], [lang="ko"] { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
