:root {
  color-scheme: light;
  --paper: #f7f6f1;
  --surface: #fffefa;
  --ink: #1c2522;
  --soft: #565e58;
  --line: #d6d8ce;
  --orange: #e65b31;
  --green: #203e35;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --sans: Inter, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 22px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #0a776c; outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { width: min(1160px, calc(100% - 96px)); margin-inline: auto; }
.sr-only, .skip:not(:focus) { position: absolute; height: 1px; width: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: absolute; z-index: 4; top: 8px; left: 8px; background: white; padding: 10px; }
.masthead { border-bottom: 1px solid var(--line); }
.mast-row, nav, .brand, .profile, .heading-line, .filters, .searchbox, .tile-meta, .links, .query-actions { display: flex; align-items: center; }
.mast-row { justify-content: space-between; min-height: 75px; gap: 18px; }
.brand { gap: 11px; font-size: 24px; letter-spacing: -1.2px; font-weight: 750; }
.brand-mark { width: 32px; height: 32px; background: var(--ink); border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 2px; }
.brand-mark i { width: 4px; height: 12px; background: #ff845a; transform: skew(-14deg); }
.brand-mark i:nth-child(2) { height: 19px; }
nav { gap: 27px; font-size: 13px; font-weight: 650; }
.profile { border: 1px solid #bcc2b8; border-radius: 25px; padding: 8px 14px; gap: 8px; }
.profile:hover, .share:hover { background: #eeeee5; }
.nav-directory:hover, .form-source:hover { text-decoration: underline; text-underline-offset: 4px; }
.hero { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 28px; padding: clamp(25px,4vw,48px) 0; }
.hero > .share { border-color: #cbd0c6; }
.hero h1 { margin: 0; font-size: clamp(40px,5vw,68px); letter-spacing: -.062em; font-weight: 800; line-height: 1.14; white-space: nowrap; }
.hero-x { color: var(--green); }
:lang(en) .hero h1 { white-space: normal; text-wrap: balance; }
html:lang(ja) { --sans: Inter, "Helvetica Neue", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif; }
.title-dot { display: inline-block; width: .15em; height: .15em; border-radius: 50%; background: var(--orange); margin: 0 .03em 0 .1em; }
.hero-copy p { margin: 10px 0 0; line-height: 1.65; color: var(--soft); font-size: clamp(15px,1.5vw,18px); }
.query-actions { flex-wrap: wrap; }
.solid, .share { display: inline-flex; align-items: center; justify-content: center; gap: 12px; font-size: 14px; font-weight: 650; border-radius: 8px; min-height: 41px; }
.solid { border: 1px solid var(--ink); color: var(--surface); background: var(--ink); padding: 9px 18px; }
.solid:hover { background: var(--green); }
.solid[aria-disabled="true"] { opacity: .45; cursor: default; }
.share { padding: 8px 12px; background: transparent; border: 1px solid transparent; }
.share:disabled { opacity: .45; cursor: default; }
#plot { display: block; width: 100%; height: 60px; margin-top: 7px; border-radius: 5px; background: #20382f; }
.catalog { border-top: 1px solid var(--line); padding: 32px 0 57px; }
.section-top, .footer, .dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-top { gap: 13px; flex-wrap: wrap; }
.heading-line { gap: 11px; }
.section-top h2 { font-size: 30px; letter-spacing: -.055em; margin: 0; line-height: 1.3; }
.total { font: 12px var(--mono); color: var(--soft); padding: 4px 8px; border: 1px solid #cbd0c6; border-radius: 16px; }
.searchbox { gap: 10px; background: var(--surface); padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.magnifier, .sight { display: inline-block; position: relative; border: 1.6px solid currentColor; border-radius: 50%; }
.magnifier { width: 14px; height: 14px; color: #69736a; }
.magnifier::after, .sight::after { content: ""; position: absolute; width: 6px; height: 1.8px; background: currentColor; right: -4px; bottom: -2px; transform: rotate(45deg); }
.searchbox:focus-within { border-color: #477566; }
.searchbox input { min-width: 0; width: 173px; max-width: 100%; padding: 2px; background: transparent; border: 0; font-size: 13px; outline-offset: 0; }
.filters { flex-wrap: wrap; gap: 7px; margin: 21px 0; }
.filters button { border: 1px solid var(--line); border-radius: 25px; background: transparent; padding: 6px 15px; font-size: 13px; min-height: 34px; line-height: 1.4; }
.filters button[aria-pressed="true"] { color: var(--surface); background: var(--ink); border-color: var(--ink); }
.filters button[aria-pressed="false"]:hover { background: #ebece3; }
.grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.tile { display: flex; flex-direction: column; min-width: 0; padding: 21px 22px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.featured { grid-column: span 2; background: #eef1f8; border-color: #cdd5e3; }
.tile-meta { gap: 9px; font-size: 12px; color: var(--soft); }
.glyph { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; font: bold 23px/1 var(--sans); }
.glyph.blue { background: #2855af; color: white; letter-spacing: -3px; font-style: italic; padding-right: 3px; }
.glyph.blue span { font-size: 16px; margin-top: 5px; margin-left: 1px; }
.glyph.mint { background: #d5e6dd; color: #245646; }
.glyph.sand { background: #f0e4c8; color: #694d1c; font-size: 32px; padding-bottom: 4px; }
.glyph.lilac { background: #e8dff3; color: #63507f; }
.glyph.smoke { background: #e5e5de; color: #41463e; }
.glyph.peach { background: #fae1d2; color: #8b4128; }
.glyph.yellow { background: #e6e9c4; color: #535d29; }
.glyph.code { font: 650 16px var(--mono); letter-spacing: -2px; }
.layers { height: 3px; width: 15px; transform: skewY(-16deg); background: currentColor; box-shadow: 0 -5px currentColor,0 5px currentColor; }
.sight { width: 14px; height: 14px; border-width: 2px; }
.sight::before { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: currentColor; left: 3px; top: 3px; }
.bars { width: 4px; height: 9px; background: currentColor; box-shadow: 6px -4px currentColor, -6px 4px currentColor; transform: skewY(-10deg); }
.tile h3 { font-size: 23px; margin: 13px 0 6px; line-height: 1.3; letter-spacing: -.04em; }
.tile p { color: var(--soft); font-size: 14px; margin: 0 0 17px; line-height: 1.7; max-width: 64ch; }
.links { gap: 6px 13px; flex-wrap: wrap; margin-top: auto; margin-bottom: 17px; }
.links a { font-size: 13px; font-weight: 700; color: #1d4738; padding: 4px 0; }
.links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.featured .links { gap: 7px; }
.featured .links a { color: #253e6c; border: 1px solid #bfcce0; border-radius: 5px; padding: 4px 9px; }
.featured .links a:hover { background: #e1e8f4; text-decoration: none; }
.tile-meta .rank-label { margin-inline-start: auto; color: #344969; font-weight: 700; text-align: end; }
.tile-bottom { border-top: 1px solid var(--line); padding: 10px 0 12px; font-size: 11px; color: #5b625c; line-height: 1.6; }
.featured .tile-bottom { border-color: #cdd5e3; }
.empty { text-align: center; padding: 45px 15px; border: 1px dashed #b9c1b5; border-radius: 12px; }
.empty h3, .empty p { margin-top: 0; }
.footer { border-top: 1px solid var(--line); padding: 20px 0 30px; color: var(--soft); font-size: 12px; }
.footer > :first-child { font-weight: 650; color: var(--ink); }
.foot-div { color: #969b91; padding: 0 5px; }
.footer time { font-family: var(--mono); }
dialog { width: min(460px,calc(100% - 28px)); padding: 23px 26px 26px; max-height: calc(100dvh - 32px); overflow-y: auto; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 18px 60px #17291d33; }
dialog::backdrop { background: #13221c70; }
dialog h2 { font-size: 26px; line-height: 1.3; letter-spacing: -.05em; margin: 9px 0 7px; }
dialog p { margin: 0 0 16px; color: var(--soft); font-size: 14px; }
.dialog-heading { gap: 8px; }
.tool-type { font-size: 12px; color: #356453; font-weight: 700; }
.close { display: grid; place-items: center; background: #eeefe8; border: 0; border-radius: 50%; height: 32px; width: 32px; font: 24px/1 var(--sans); }
dialog form, dialog label { display: grid; gap: 10px; }
dialog label { min-width: 0; font-size: 13px; font-weight: 600; gap: 4px; }
dialog input, dialog select { border: 1px solid #bfc7ba; border-radius: 6px; background: #fff; min-height: 42px; padding: 7px 9px; width: 100%; min-width: 0; font: 16px var(--sans); }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result { display: grid; gap: 3px; background: #e9eee6; border-radius: 8px; padding: 12px 15px; margin-top: 3px; }
.result span { font-size: 12px; color: #4e5f51; }
.result output { font-size: 22px; font-weight: 700; color: var(--green); overflow-wrap: anywhere; }
.result small { color: var(--soft); }
.result output.expression { font: 15px/1.6 var(--mono); }
.form-source { color: var(--soft); font-size: 12px; justify-self: start; }
.query-actions { gap: 6px; }
#notice { position: fixed; z-index: 5; bottom: 18px; left: 50%; margin: 0; transform: translateX(-50%); max-width: 90%; width: max-content; border-radius: 8px; background: #1e3029; color: white; font-size: 13px; padding: 8px 16px; pointer-events: none; }
#notice:empty { display: none; }
@media (max-width: 900px) {
  .wrap { width: calc(100% - 52px); }
  .hero h1 { font-size: clamp(36px,5.4vw,54px); }
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .featured { grid-column: span 2; }
}
@media (max-width: 680px) {
  html { scroll-padding-top: 12px; }
  .wrap { width: calc(100% - 36px); }
  .mast-row { min-height: 61px; }
  .brand { font-size: 21px; gap: 8px; }
  .brand-mark { width: 28px; height: 28px; }
  .nav-directory { display: none; }
  .profile { font-size: 12px; padding: 7px 11px; }
  .hero { align-items: flex-start; flex-direction: column; gap: 12px; padding: 24px 0; }
  .hero h1 { font-size: clamp(40px,10.2vw,60px); }
  .hero-copy p { margin-top: 8px; }
  .catalog { padding: 24px 0 32px; }
  .section-top h2 { font-size: 25px; }
  .searchbox { padding: 6px 8px; gap: 7px; }
  .searchbox input { width: 116px; font-size: 12px; }
  .filters { margin: 15px 0; gap: 5px; }
  .filters button { padding: 5px 12px; }
  .grid { grid-template-columns: minmax(0,1fr); gap: 11px; }
  .featured { grid-column: auto; }
  .tile { padding: 17px 17px 0; }
  .tile h3 { margin-top: 10px; }
  .tile p { margin-bottom: 11px; }
  .links { margin-bottom: 12px; }
  .footer { align-items: flex-start; font-size: 11px; flex-wrap: wrap; }
  dialog { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
