:root {
  --bg: #f6f7f5;
  --paper: #ffffff;
  --paper-2: #f0f3f1;
  --ink: #1f282c;
  --muted: #5f6d72;
  --quiet: #7a8689;
  --line: #d7dedb;
  --line-strong: #b9c5c1;
  --accent: #2f6574;
  --accent-2: #47685c;
  --warn: #8a6420;
  --note: #f6f0df;
  --code: #172126;
  --ok: #2e6d4f;
  --max: 1120px;
  --radius: 6px;
  --sans: "Segoe UI", Arial, Helvetica, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.58;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: 0;
}

p {
  margin: 0;
}

code,
pre {
  font-family: var(--mono);
}

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid #26373d;
  background: #1f2e34;
  color: #d9e2df;
  font-size: 13px;
}

.topbar .wrap {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-nav {
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 35px;
  height: 35px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: #fafdfe;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.brand-name {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.brand-sub {
  display: block;
  color: var(--quiet);
  font-size: 12px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.nav-links a {
  color: var(--muted);
  border-bottom: 2px solid transparent;
  padding: 22px 0 20px;
  font-size: 15px;
  font-weight: 560;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
}

.lang-switch button {
  border: 0;
  border-right: 1px solid var(--line-strong);
  padding: 6px 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.lang-switch button:last-child {
  border-right: 0;
}

.lang-switch button.active {
  background: var(--accent);
  color: #fff;
}

.hero {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .82fr);
  gap: 38px;
  align-items: start;
  padding: 46px 0 42px;
}

.hero h1 {
  max-width: 660px;
  font-size: 42px;
  overflow-wrap: anywhere;
}

.lead {
  max-width: 710px;
  margin-top: 16px;
  color: #38484d;
  font-size: 18px;
}

.hero-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 14px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  font-weight: 640;
  text-decoration: none;
}

.button:hover {
  border-color: var(--accent);
  background: #f8fbfa;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: #285867;
}

.tool-card,
.panel {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
}

.tool-card {
  padding: 18px;
  box-shadow: 0 12px 28px rgba(31, 40, 44, .08);
}

.tool-card h2,
.panel h2 {
  font-size: 21px;
}

.tool-card p,
.panel p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.wide-field {
  grid-column: 1 / -1;
}

.field input:disabled {
  background: #eef2f0;
  color: var(--quiet);
  cursor: not-allowed;
}

.tool-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 22px;
}

.tool-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--accent);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.tool-nav a:hover {
  border-color: var(--accent);
  background: #f8fbfa;
}

.tool-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.tool-grid-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-grid-main .tool-card:first-child {
  grid-row: span 2;
}

.tool-section {
  scroll-margin-top: 22px;
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
}

.tool-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.tool-section-head h2 {
  font-size: 24px;
}

.tool-section-head p {
  max-width: 720px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.tool-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-panel-grid .wide {
  grid-column: 1 / -1;
}

.tool-hint {
  margin-top: 12px;
  border-left: 3px solid var(--accent-2);
  background: #eef3ef;
  color: #435056;
  padding: 9px 11px;
  font-size: 13px;
}

.field label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.section {
  padding: 48px 0;
}

.section.muted {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: 28px;
}

.section-head p {
  max-width: 560px;
  color: var(--muted);
  font-size: 15px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(320px, 1fr) max-content;
  gap: 18px;
  align-items: end;
  margin-bottom: 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 16px;
}

.category-filter > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 31px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 5px 9px;
  font-size: 13px;
  font-weight: 620;
}

.chip span {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.chip:hover,
.chip.active {
  border-color: var(--accent);
  background: #eef5f2;
  color: var(--accent);
}

.muted-count {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--muted);
  padding: 14px;
  font-size: 14px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(280px, .28fr);
  gap: 26px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.panel.note {
  background: var(--note);
}

.note-list {
  border-top: 1px solid var(--line-strong);
}

.note-row {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.note-row time {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 12px;
}

.note-row h3 {
  font-size: 20px;
}

.note-row p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 15px;
}

.tagline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 2px 6px;
  background: #fff;
  color: var(--quiet);
  font-size: 12px;
  font-family: var(--mono);
}

.page-head {
  padding: 34px 0 24px;
}

.page-head h1 {
  font-size: 38px;
}

.page-head p {
  max-width: 780px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 17px;
}

.crumb {
  padding-top: 24px;
  color: var(--quiet);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #eef2f0;
  color: #435056;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.code-block {
  margin-top: 14px;
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--code);
  color: #d8e3df;
  padding: 14px;
  font-size: 13px;
  line-height: 1.55;
}

.snippet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.snippet {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px;
}

.snippet h3 {
  font-size: 18px;
}

.snippet p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}

.output {
  margin-top: 16px;
}

.output textarea {
  width: 100%;
  min-height: 170px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  resize: vertical;
}

.tool-result {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.compact-table {
  margin-top: 0;
}

.compact-table table {
  min-width: 0;
}

.compact-table th,
.compact-table td {
  padding: 9px 10px;
  font-size: 13px;
}

.compact-table code {
  overflow-wrap: anywhere;
}

.kv-result {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 12px;
}

.kv-result span {
  color: var(--quiet);
  font-size: 12px;
  text-transform: uppercase;
}

.kv-result strong {
  color: var(--ink);
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ok);
  font-weight: 650;
}

.status-dot.warn {
  color: var(--warn);
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.footer {
  margin-top: 36px;
  border-top: 1px solid #26373d;
  background: #1f2e34;
  color: #d9e2df;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 28px;
  padding: 32px 0;
}

.footer h2,
.footer h3 {
  color: #fff;
  font-size: 15px;
}

.footer p,
.footer a {
  margin-top: 8px;
  color: #d9e2df;
  font-size: 14px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding: 15px 0;
  color: #b8c5c1;
  font-size: 13px;
}

.notfound {
  min-height: 54vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 56px 0;
}

.notfound h1 {
  font-size: 42px;
}

.notfound p {
  max-width: 560px;
  margin: 14px auto 24px;
  color: var(--muted);
}

@media (max-width: 920px) {
  .nav-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 14px 0 0;
  }

  .nav-right {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
  }

  .nav-links {
    max-width: 100%;
    overflow-x: auto;
    gap: 18px;
  }

  .nav-links a {
    padding: 10px 0 14px;
  }

  .hero-grid,
  .two-col,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero h1,
  .page-head h1 {
    font-size: 34px;
  }

  .snippet-grid {
    grid-template-columns: 1fr;
  }

  .tool-grid-main,
  .tool-panel-grid,
  .search-panel {
    grid-template-columns: 1fr;
  }

  .tool-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-grid-main .tool-card:first-child {
    grid-row: auto;
  }

  .tool-panel-grid .wide {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .wrap {
    width: min(var(--max), calc(100% - 28px));
  }

  .topbar .wrap {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
  }

  .brand-sub {
    display: none;
  }

  .nav-right {
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    padding-bottom: 3px;
  }

  .hero-grid {
    padding: 34px 0;
  }

  .hero h1,
  .page-head h1,
  .notfound h1 {
    font-size: 30px;
  }

  .lead {
    font-size: 17px;
  }

  .tool-grid,
  .note-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .muted-count {
    white-space: normal;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
