:root {
  --ink: #282b29;
  --muted: #585c57;
  --line: #d9d8cf;
  --canvas: #faf9f5;
}
body {
  color: var(--ink);
  background: var(--canvas);
  font-family: "DM Sans", "Noto Sans JP", sans-serif;
  & button, & summary { cursor: pointer; }
  & [hidden] { display: none !important; }
  & :is(a,button,summary):focus-visible { outline: 2px solid #254ac5; outline-offset: 4px; }
}
.mast, .sec_intro, .sec_drawers {
  padding-inline: 40px;
  & > .wrap { max-width: 1280px; margin-inline: auto; }
  @media (max-width: 800px) { padding-inline: 24px; }
  @media (max-width: 480px) { padding-inline: 16px; }
}
.mast {
  background: #fff;
  border-bottom: 1px solid var(--line);
  & > .wrap { min-height: 56px; display: flex; align-items: center; gap: 16px; }
  & .brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 20px; font-weight: 800; text-decoration: none; }
  & .division { padding-left: 16px; color: var(--muted); font-size: 12px; border-left: 1px solid var(--line); }
  & .kr-template-menu { margin-left: auto; font-size: 14px; }
}
.sec_intro {
  padding-block: 40px 32px;
  border-bottom: 1px solid var(--line);
  & h1 { font-size: 48px; font-weight: 800; line-height: 1.3em; letter-spacing: -.04em; }
  & h1 span { margin-left: .16em; color: #666961; white-space: nowrap; }
  & p { margin-top: 12px; color: var(--muted); font-size: 16px; line-height: 1.75em; }
  @media (max-width: 1120px) { & h1 { font-size: 44px; } }
  @media (max-width: 800px) { & h1 { font-size: 40px; } }
  @media (max-width: 600px) { padding-block: 24px; & h1 { font-size: 36px; } & p { font-size: 14px; } }
  @media (max-width: 400px) { & h1 { font-size: 32px; } }
  @media (max-width: 350px) { & h1 { font-size: 28px; } }
}
.sec_drawers {
  padding-bottom: 64px;
  & .toolbar { padding-top: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
  & .filters, & .compare { display: flex; flex-wrap: wrap; gap: 4px; }
  & .toolbar button, & .foot button {
    padding: 8px 12px; min-height: 36px; background: #fff; color: var(--ink); line-height: 1.3em;
    font-family: inherit; font-size: 14px; font-weight: 600; border: 1px solid var(--line); border-radius: 8px;
    transition: background-color .2s ease, color .2s ease;
  }
  & .toolbar button:hover, & .foot button:hover { background-color: #e9e8df; }
  & .filters button { border-radius: 24px; }
  & .filters [aria-pressed="true"] { background: #2c302d; color: #fff; border-color: #2c302d; }
  & .compare { gap: 0; }
  & .compare button { border-radius: 8px 0 0 8px; }
  & .compare button + button { border-left: 0; border-radius: 0 8px 8px 0; }
  & .count { margin-block: 12px; color: var(--muted); font-size: 12px; line-height: 1.5em; }
  & .grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
  & .card { min-width: 0; overflow: clip; scroll-margin: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
  & .card:target { outline: 2px solid #366453; outline-offset: 2px; }
  & .plate { background: var(--sheet); }
  & .meta { padding: 12px 16px 0; display: flex; align-items: center; justify-content: space-between; color: #414840; font-size: 12px; line-height: 1.5em; }
  & .meta a { color: inherit; font-weight: 700; font-variant-numeric: tabular-nums; text-decoration: none; letter-spacing: .08em; }
  & .meta a:hover { color: #1a4635; }
  & .stage { padding: 8px 16px 24px; min-height: 112px; display: grid; place-items: center; }
  & .foot { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); }
  & .foot h2 { font-size: 16px; line-height: 1.5em; font-weight: 650; }
  & .foot button { padding: 6px 10px; flex: none; font-size: 12px; }
  @media (max-width: 1080px) { & .grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
  @media (max-width: 640px) {
    & .grid { grid-template-columns: minmax(0,1fr); }
    & .toolbar { padding-top: 16px; }
    & .toolbar button { font-size: 12px; }
  }
}
#code {
  position: fixed; margin: auto; padding: 24px; width: calc(100% - 32px); max-width: 680px;
  max-height: 84vh; overflow: auto; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  &::backdrop { background: #181d20a8; }
  & .head, & .actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  & .num { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
  & h2 { margin-top: 4px; font-size: 24px; line-height: 1.45em; }
  & button, & .zip { padding: 8px 12px; flex: none; background: #fff; color: var(--ink); font-family: inherit; font-size: 14px; line-height: 1.5em; text-decoration: none; border: 1px solid var(--line); border-radius: 6px; }
  & .actions { margin-block: 20px 12px; justify-content: start; flex-wrap: wrap; }
  & .actions button { background: var(--ink); color: #fff; }
  & .hint, & .result { margin-block: 8px; color: var(--muted); font-size: 14px; line-height: 1.7em; }
  & details { padding-block: 12px; border-top: 1px solid var(--line); }
  & summary { font-size: 14px; font-weight: 700; }
  & details button { margin-block: 8px; }
  & pre { padding: 12px; overflow: auto; background: #f2f2ed; font: 14px/1.6em monospace; }
  & textarea { width: 100%; }
  @media (max-width: 480px) { padding: 16px; & h2 { font-size: 20px; } }
}
