:root {
  --ink: var(--sl-bg, #0b0e13);
  --panel-bg: var(--sl-panel, #11151c);
  --border: var(--sl-raised, #1a2029);
  --gold: #dfba74;
  --paper: #f2e8d3;
  --muted: var(--sl-muted, #b7b1a4);
  --accent: var(--sl-muted, #b7b1a4);
  --line: var(--border);
  --shell-height: 114px;
  --serif: Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  --sans: "Avenir Next", "PingFang SC", system-ui, sans-serif;
}
body {
  background: var(--ink);
  color: var(--paper);
  font: 15px/1.5 var(--sans);
}
a {
  color: var(--gold);
  text-underline-offset: 3px;
}
button,
input,
select,
textarea {
  font: inherit;
}
:where(button, a, select, summary, input, textarea):focus-visible {
  outline: 2px solid #f5cb75;
  outline-offset: 3px;
}
button {
  touch-action: manipulation;
}
h1,
h2,
h3 {
  font-family: var(--serif);
}
#shell {
  position: relative;
  z-index: 5;
  isolation: isolate;
  background: var(--sl-bg, #0b0e13);
}
.sitebar {
  height: 64px;
  display: flex;
  align-items: stretch;
  padding: 0 clamp(12px, 2.6vw, 44px);
  gap: clamp(18px, 3.8vw, 58px);
  border-bottom: 1px solid var(--sl-raised, #1a2029);
  background: var(--sl-bg, #0b0e13);
}
.site-brand {
  display: flex;
  align-items: center;
  flex: none;
}
.site-brand img {
  display: block;
  width: 146px;
  height: 55px;
  object-fit: contain;
}
.site-nav,
.tool-nav,
.langs {
  display: flex;
  align-items: stretch;
}
.site-nav {
  gap: clamp(12px, 2.7vw, 36px);
}
.site-nav a,
.tool-nav a,
.langs a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
}
.site-nav a {
  font: 600 16px/1 var(--serif);
  color: var(--sl-muted, #b7b1a4);
  padding: 0 2px;
}
.site-nav a.active,
.tool-nav a.active,
.langs a.active {
  color: var(--gold);
}
.site-nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
}
.langs {
  margin-left: auto;
  align-items: center;
  gap: 2px;
}
.langs a {
  min-width: 42px;
  min-height: 44px;
  color: var(--sl-muted, #b7b1a4);
  font-size: 12px;
  font-weight: 650;
}
.langs a.active {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.tool-nav {
  padding: 0 clamp(12px, 2.6vw, 44px);
  min-height: 50px;
  gap: 5px;
  border-bottom: 1px solid var(--sl-line, #373940);
  background: var(--sl-panel, #11151c);
}
.tool-nav a {
  padding: 0 18px;
  gap: 9px;
  color: var(--sl-muted, #b7b1a4);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  border-width: 0 1px;
}
.tool-nav a.active {
  border-color: var(--sl-raised, #1a2029);
  background: var(--sl-raised, #1a2029);
}
.tool-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--gold);
}
.tool-nav svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.site-nav a:hover,
.tool-nav a:hover,
.langs a:hover {
  color: #fff2ce;
}
.site-skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 9;
  background: var(--ink);
  padding: 9px 15px;
}
.site-skip:focus {
  top: 10px;
}
#tool-root {
  min-width: 0;
  outline: 0;
}
.tool-title {
  font: 700 clamp(24px, 2.5vw, 38px)/1.18 var(--serif);
  margin: 0;
  color: var(--paper);
}
.eyebrow {
  font: 700 11px/1.45 var(--sans);
  color: var(--gold);
  letter-spacing: 0.09em;
  margin: 0;
}
.muted {
  color: var(--muted);
}
.panel {
  background: var(--panel-bg);
  color: var(--paper);
}
.workarea {
  min-width: 0;
}
.button,
.icon-button {
  border: 1px solid var(--sl-line, #373940);
  background: var(--sl-raised, #1a2029);
  color: var(--paper);
  border-radius: 3px;
  font: 600 14px/1.4 var(--sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  min-height: 42px;
  gap: 8px;
  padding: 8px 14px;
}
.button:hover,
.icon-button:hover {
  border-color: #a89462;
  background: var(--sl-raised, #1a2029);
}
.button-primary {
  background: #dfbc79;
  border-color: #e3bf7d;
  color: var(--sl-panel, #11151c);
}
.button-primary:hover {
  background: #ebc988;
  border-color: #f0ce8e;
}
.icon-button {
  min-width: 42px;
  padding: 6px;
}
.button:disabled,
.icon-button:disabled {
  opacity: 0.5;
  cursor: default;
}
.field {
  display: block;
  max-width: 100%;
  min-height: 42px;
  border: 1px solid var(--sl-line, #373940);
  background: var(--sl-bg, #0b0e13);
  padding: 8px 10px;
  color: var(--paper);
  border-radius: 3px;
}
@media (max-width: 720px) {
  .sitebar {
    height: 55px;
    padding: 0 12px;
    gap: 12px;
  }
  .site-brand img {
    width: 95px;
    height: 44px;
  }
  .site-nav {
    gap: 10px;
    align-items: stretch;
  }
  .site-nav a {
    font-size: 13px;
  }
  .site-nav .base-link {
    display: none;
  }
  .langs {
    gap: 0;
  }
  .langs a {
    min-width: 32px;
    font-size: 11px;
  }
  .tool-nav {
    min-height: 48px;
    padding: 0;
    gap: 0;
  }
  .tool-nav a {
    flex: 1 1 0;
    padding: 0 5px;
    font-size: 13px;
    gap: 5px;
  }
  .tool-nav svg {
    width: 15px;
    height: 15px;
  }
}
@media (max-width: 390px) {
  .sitebar {
    gap: 8px;
    padding: 0 6px;
  }
  .site-brand img {
    width: 72px;
  }
  .site-nav {
    gap: 7px;
  }
  .site-nav a {
    font-size: 12px;
  }
  .langs a {
    min-width: 28px;
  }
  .tool-nav a {
    font-size: 12px;
  }
}

.tool-directory { max-width: 1080px; margin: 0 auto; padding: 54px 24px 80px; color: var(--sl-text, #ede4cf); }
.tool-directory-kicker { color: var(--gold, #c8ad70); font-size: 11px; letter-spacing: .16em; }
.tool-directory h1 { font: 400 clamp(30px, 4vw, 46px)/1.15 Georgia, serif; margin: 12px 0; }
.tool-directory > p:not(.tool-directory-kicker) { color: var(--sl-muted, #b7b1a4); line-height: 1.6; }
.tool-directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 32px; }
.tool-directory-card { display: flex; align-items: flex-start; gap: 16px; min-height: 150px; padding: 22px; border: 1px solid var(--sl-line, #373940); background: var(--sl-panel, #11151c); color: inherit; text-decoration: none; }
.tool-directory-card:hover, .tool-directory-card:focus-visible { border-color: var(--gold, #c8ad70); }
.tool-directory-card svg { flex: none; width: 26px; height: 26px; fill: none; stroke: var(--gold, #c8ad70); stroke-width: 1.5; }
.tool-directory-card span { flex: 1; min-width: 0; }
.tool-directory-card strong, .tool-directory-card small { display: block; }
.tool-directory-card strong { font: 400 21px/1.3 Georgia, serif; }
.tool-directory-card small { margin-top: 10px; color: var(--sl-muted, #b7b1a4); font-size: 13px; line-height: 1.55; }
.tool-directory-card b { color: var(--gold, #c8ad70); }
@media (max-width: 800px) { .tool-directory-grid { grid-template-columns: 1fr; } .tool-directory-card { min-height: 0; } .tool-directory { padding: 32px 18px 50px; } }
.tool-back { display: inline-block; padding: 10px 16px; color: var(--gold, #c8ad70); font-size: 12px; text-decoration: none; }
.tool-back:hover, .tool-back:focus-visible { text-decoration: underline; }
@media (min-width: 801px) { .tool-directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
