:root {
  color-scheme: dark;
  --bg: #08090b;
  --bg-raised: #0d0f13;
  --panel: #111419;
  --panel-2: #171b22;
  --editor: #202938;
  --ink: #f5f7fb;
  --text: #d7dce6;
  --muted: #939bad;
  --faint: #677083;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --brand: #7c3aed;
  --hot: #ff7a1a;
  --gold: #fbbf24;
  --green: #62d6a3;
  --danger: #ff6b6b;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -120px, rgba(255, 122, 26, 0.14), transparent 360px),
    radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.09), transparent 420px),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(255, 122, 26, 0.72);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 420px) minmax(170px, 1fr);
  align-items: center;
  gap: 22px;
  min-height: 76px;
  padding: 14px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.82);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: linear-gradient(135deg, #8b5cf6, #6227d9 55%, #32166f);
  color: white;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.25);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.1;
}

.brand strong span {
  color: #b197ff;
}

.brand small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.global-search span {
  color: var(--faint);
  font-size: 1.1rem;
}

.global-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.global-search input::placeholder {
  color: #7c8495;
}

kbd {
  min-width: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.top-nav {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
  color: var(--muted);
  font-weight: 750;
}

.top-nav a:hover,
.related-list a:hover {
  color: var(--ink);
}

.eyebrow,
.tool-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.catalog-hero {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 54px clamp(18px, 4vw, 52px) 34px;
  text-align: center;
}

.catalog-hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(3rem, 7vw, 5.7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.catalog-hero h1 span {
  color: transparent;
  background: linear-gradient(90deg, var(--hot), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
}

.catalog-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.chip {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.025);
  color: #a8afbf;
  cursor: pointer;
  font-weight: 850;
}

.chip.active,
.chip:hover {
  border-color: rgba(255, 122, 26, 0.48);
  background: linear-gradient(135deg, #ff7a1a, #ff5c00);
  color: white;
  box-shadow: 0 16px 38px rgba(255, 104, 18, 0.24);
}

.all-tools,
.category-band,
.trust-band {
  padding-inline: clamp(18px, 4vw, 52px);
}

.all-tools {
  padding-block: 18px 48px;
}

.category-band {
  padding-block: 34px;
  border-top: 1px solid var(--line);
}

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

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.35rem;
  letter-spacing: 0;
}

.section-heading p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

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

.tool-card {
  position: relative;
  min-height: 236px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.tool-card::before {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(circle at 25% 10%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 34%);
  content: "";
  opacity: 0.52;
  pointer-events: none;
}

.tool-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, rgba(255, 255, 255, 0.18));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03)),
    var(--panel);
  transform: translateY(-3px);
}

.tool-card > * {
  position: relative;
}

.tool-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 18%, rgba(255, 255, 255, 0.035));
  color: #ffa85f;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 900;
}

.favorite {
  position: absolute;
  top: 24px;
  right: 24px;
  color: #8d95a8;
  font-size: 1.55rem;
  line-height: 1;
}

.tool-kicker {
  display: inline-flex;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  background: rgba(255, 255, 255, 0.04);
  color: #9ca3b4;
  font-size: 0.68rem;
  letter-spacing: 0;
  text-transform: none;
}

.tool-card h3 {
  margin: 16px 0 10px;
  color: var(--ink);
  font-size: 1.24rem;
  letter-spacing: 0;
}

.tool-card p {
  min-height: 50px;
  margin: 0;
  color: var(--muted);
}

.open-link {
  display: inline-flex;
  margin-top: 20px;
  color: #ffa25a;
  font-weight: 900;
}

.compact-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tool-card.compact {
  min-height: 180px;
  padding: 22px;
}

.tool-card.compact .tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.tool-card.compact .tool-kicker,
.tool-card.compact .favorite {
  display: none;
}

.tool-card.compact h3 {
  font-size: 1.04rem;
}

.tool-card.compact p {
  min-height: auto;
  font-size: 0.92rem;
}

.trust-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-block: 1px solid var(--line);
  background: var(--line);
}

.trust-band div {
  padding: 24px;
  background: rgba(255, 255, 255, 0.035);
}

.trust-band strong,
.trust-band span {
  display: block;
}

.trust-band strong {
  color: var(--ink);
}

.trust-band span {
  margin-top: 4px;
  color: var(--muted);
}

.workspace-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
}

.tool-sidebar {
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(9, 11, 16, 0.9);
  padding: 20px 0 28px;
}

.side-group {
  display: grid;
  gap: 6px;
  margin-bottom: 22px;
}

.side-group h2 {
  margin: 0;
  padding: 0 20px 4px;
  color: #8f97aa;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.side-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border-left: 3px solid transparent;
  padding: 5px 16px 5px 20px;
  color: #c0c6d3;
}

.side-link span {
  display: grid;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #1d2633;
  color: #aeb7ca;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 900;
}

.side-link strong {
  overflow: hidden;
  font-size: 0.94rem;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-link:hover,
.side-link.active {
  border-left-color: #8b5cf6;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.28), rgba(124, 58, 237, 0.04));
  color: var(--ink);
}

.tool-workspace {
  min-width: 0;
  padding: 32px clamp(20px, 4vw, 52px) 64px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 22px;
  color: #7d8496;
  font-weight: 700;
}

.breadcrumb strong {
  color: var(--text);
}

.tool-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.tool-hero h1 {
  max-width: 900px;
  margin: 10px 0 12px;
  color: var(--ink);
  font-size: clamp(2.3rem, 4.2vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.tool-hero p {
  max-width: 920px;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.tool-hero-badge {
  display: grid;
  align-self: start;
  min-width: 150px;
  gap: 10px;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.tool-hero-badge span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 24%, #151922);
  color: #ffa25a;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 900;
}

.tool-hero-badge strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
}

.tool-root,
.tool-aside {
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: var(--shadow);
}

.tool-root {
  padding: 22px;
}

.tool-aside {
  align-self: start;
  padding: 20px;
}

.tool-aside h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 0.98rem;
}

.tool-aside p {
  margin: 0 0 20px;
  color: var(--muted);
}

.related-list {
  display: grid;
  gap: 8px;
}

.related-list a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.035);
  color: #cbd2df;
  font-weight: 760;
}

.tool-layout {
  display: grid;
  gap: 16px;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field label,
.fieldset-title {
  color: #dce2ed;
  font-size: 0.92rem;
  font-weight: 830;
}

textarea,
input[type="text"],
input[type="number"],
input[type="datetime-local"],
input[type="search"],
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--editor);
  color: var(--ink);
}

textarea,
input[type="text"],
input[type="number"],
input[type="datetime-local"],
select {
  padding: 12px 13px;
}

textarea {
  min-height: 286px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.94rem;
  line-height: 1.6;
}

.short-textarea {
  min-height: 170px;
}

.output,
.preview {
  min-height: 220px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 16px;
  background: #202938;
  color: #e6edf7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.94rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview {
  background: #151922;
  color: var(--text);
  font-family: inherit;
}

.button-row,
.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.tool-button,
.copy-button,
.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 10px 15px;
  background: #151922;
  color: #d8deea;
  cursor: pointer;
  font-weight: 850;
}

.tool-button.primary,
.primary-action {
  border-color: rgba(124, 58, 237, 0.7);
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: white;
  box-shadow: 0 14px 32px rgba(109, 40, 217, 0.28);
}

.tool-button:hover,
.copy-button:hover,
.secondary-action:hover {
  border-color: rgba(255, 122, 26, 0.46);
  color: var(--ink);
}

.status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-weight: 760;
}

.status.ok {
  color: var(--green);
}

.status.error {
  color: var(--danger);
}

.inline-control {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #c4cad7;
  font-weight: 760;
}

.inline-control input {
  width: auto;
}

input[type="color"] {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 3px;
  background: var(--editor);
}

input[type="file"] {
  width: 100%;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.swatch {
  min-height: 152px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}

.diff-line {
  display: block;
  padding: 2px 6px;
}

.diff-add {
  background: rgba(98, 214, 163, 0.22);
}

.diff-remove {
  background: rgba(255, 107, 107, 0.22);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(18px, 4vw, 52px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .tool-grid,
  .compact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .tool-sidebar {
    position: relative;
    top: 0;
    display: flex;
    gap: 18px;
    height: auto;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 18px;
  }

  .side-group {
    min-width: 220px;
    margin: 0;
  }

  .tool-hero {
    flex-direction: column;
  }

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

@media (max-width: 720px) {
  .catalog-hero {
    align-items: start;
    justify-items: start;
    text-align: left;
  }

  .catalog-hero h1 {
    font-size: 3rem;
  }

  .category-chips {
    justify-content: flex-start;
  }

  .tool-grid,
  .compact-grid,
  .trust-band {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: 210px;
  }

  .site-footer,
  .section-heading {
    align-items: start;
    flex-direction: column;
  }
}
