:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5f6f7e;
  --line: #d9e1e8;
  --paper: #fbfcfd;
  --panel: #ffffff;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --amber: #b45309;
  --blue: #2563eb;
  --rose: #be123c;
  --violet: #6d28d9;
  --shadow: 0 18px 45px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 253, 0.94);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand);
  font-weight: 800;
}

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

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav a {
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
}

.topnav a:hover {
  background: #edf7f5;
  color: var(--brand-strong);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 28px;
  align-items: center;
  padding: clamp(38px, 6vw, 76px) clamp(18px, 4vw, 56px);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(37, 99, 235, 0.04) 46%, rgba(180, 83, 9, 0.06)),
    #fbfcfd;
}

.hero-copy {
  min-width: 0;
  max-width: 850px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  max-width: 860px;
  font-size: clamp(38px, 5vw, 72px);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h1 span {
  display: block;
}

h2 {
  font-size: clamp(28px, 4vw, 46px);
}

h3 {
  font-size: 22px;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 700px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.hero-actions .button {
  border-color: #c8d4de;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.06);
}

.hero-search {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 760px;
  margin-top: 26px;
}

.hero-search > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.hero-search input {
  min-width: 0;
  border-color: transparent;
  background: #f6fafb;
}

.hero-search input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
}
}

.button,
.tool-action,
.copy-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 800;
}

.primary,
.tool-action {
  color: #ffffff;
  background: var(--brand);
}

.secondary,
.copy-action {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
}

.hero-panel {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 74px;
  padding: 14px;
  border-radius: 7px;
  background: #f4f8fa;
}

.hero-panel > div:nth-child(1) .metric {
  color: var(--brand-strong);
}

.hero-panel > div:nth-child(2) .metric {
  color: var(--blue);
}

.hero-panel > div:nth-child(3) .metric {
  color: var(--amber);
}

.metric {
  color: var(--brand-strong);
  font-size: 26px;
  font-weight: 900;
}

.workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 900px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.featured {
  padding: 38px clamp(18px, 4vw, 56px) 46px;
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: 10px;
  max-width: 850px;
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: clamp(28px, 3.5vw, 44px);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.featured-card {
  display: grid;
  min-height: 170px;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  padding: 18px;
  text-align: left;
  box-shadow: 0 12px 28px rgba(23, 32, 42, 0.06);
}

.featured-card:hover {
  border-color: #8bd2c6;
  transform: translateY(-2px);
}

.featured-card span {
  width: fit-content;
  border-radius: 999px;
  background: #edf7f5;
  color: var(--brand-strong);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.featured-card strong {
  font-size: 21px;
  line-height: 1.18;
}

.featured-card small {
  color: var(--muted);
  font-size: 14px;
}

.sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
  height: calc(100vh - 72px);
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #f7fafb;
  padding: 18px;
}

.search-wrap {
  display: grid;
  gap: 8px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
}

input,
select {
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  min-height: 150px;
  padding: 11px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.category-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.category-tab.active {
  background: #dff3ef;
  border-color: #9edbd1;
  color: var(--brand-strong);
}

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

.tool-list button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 10px;
  text-align: left;
}

.tool-list button:hover,
.tool-list button.active {
  border-color: var(--line);
  background: #ffffff;
}

.tool-list strong {
  display: block;
  font-size: 14px;
}

.tool-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.tool-stage {
  padding: clamp(18px, 4vw, 46px);
}

.tool-shell {
  display: grid;
  gap: 22px;
  max-width: 1120px;
}

.tool-head {
  display: grid;
  gap: 12px;
}

.tool-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  border-radius: 999px;
  background: #eef6f9;
  color: #075985;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.form-panel,
.result-panel,
.list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.form-panel,
.result-panel {
  padding: 18px;
}

.field-grid {
  display: grid;
  gap: 14px;
}

.field-help {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

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

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.result-head h3 {
  font-size: 16px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.result-box {
  min-height: 300px;
  max-height: 620px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0d1b22;
  color: #e6f4f1;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.tool-tips {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.content-band {
  padding: clamp(40px, 7vw, 86px) clamp(18px, 4vw, 56px);
}

.content-band.muted {
  background: #eef5f4;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.category-grid article {
  display: grid;
  gap: 10px;
  min-height: 150px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 18px;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(23, 32, 42, 0.05);
}

.category-grid article:nth-child(1) {
  border-top: 4px solid var(--brand);
}

.category-grid article:nth-child(2) {
  border-top: 4px solid var(--blue);
}

.category-grid article:nth-child(3) {
  border-top: 4px solid var(--amber);
}

.category-grid article:nth-child(4) {
  border-top: 4px solid var(--rose);
}

.category-grid article:nth-child(5) {
  border-top: 4px solid var(--violet);
}

.category-grid article:nth-child(6) {
  border-top: 4px solid #0f766e;
}

.category-grid strong {
  font-size: 20px;
}

.category-grid span,
.public-note p {
  color: var(--muted);
}

.public-note {
  max-width: 880px;
}

.public-note p {
  font-size: 18px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 26px clamp(18px, 4vw, 56px);
  color: var(--muted);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero,
  .workspace,
  .tool-grid,
  .featured-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tool-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
  }

  .hero-panel > div {
    grid-template-columns: 1fr;
  }

  .hero-search > div {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: min(330px, calc(100vw - 40px));
    font-size: 26px;
    line-height: 1.18;
  }

  .hero-copy > p:not(.eyebrow) {
    max-width: min(330px, calc(100vw - 40px));
    font-size: 16px;
  }

  .hero {
    padding: 34px 20px 38px;
  }

  .hero-copy,
  .hero-panel,
  .hero-search {
    width: min(330px, calc(100vw - 40px));
    max-width: min(330px, calc(100vw - 40px));
  }

  .hero-actions .button {
    display: flex;
    width: 100%;
    border-color: #b8c7d3;
    background: #ffffff;
    padding: 12px 14px;
    justify-content: center;
  }

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

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