:root {
  --ink: #18202b;
  --muted: #5e6978;
  --line: #d8dee8;
  --paper: #ffffff;
  --canvas: #f5f7fb;
  --teal: #11756d;
  --teal-dark: #0c514c;
  --amber: #b66200;
  --blue: #315db6;
  --red: #b93d3d;
  --green-bg: #e9f6f1;
  --blue-bg: #eef4ff;
  --amber-bg: #fff4df;
  --red-bg: #fff0f0;
  --shadow: 0 16px 38px rgba(24, 32, 43, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}

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

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand span {
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 480px);
  gap: 32px;
  align-items: end;
  padding: 56px 24px 22px;
}

.intro-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: 4.8rem;
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.22rem;
  line-height: 1.18;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.25;
}

.intro-text {
  max-width: 740px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.07rem;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
}

.metric-strip div {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.metric-strip dt {
  font-size: 2rem;
  font-weight: 850;
  line-height: 1;
}

.metric-strip dd {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.guardrail-band {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 24px 22px;
}

.guardrail-band span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #c8d8d5;
  border-radius: 999px;
  background: var(--green-bg);
  color: var(--teal-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

.resource-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.48fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  padding: 0 24px 22px;
}

.resource-heading,
.resource-grid a {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.resource-heading h2 {
  max-width: 360px;
}

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

.resource-grid a {
  display: grid;
  gap: 7px;
  color: var(--ink);
  text-decoration: none;
}

.resource-grid a:hover strong {
  color: var(--blue);
}

.resource-grid span {
  color: var(--muted);
  font-size: 0.9rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
  padding: 0 24px 44px;
}

.tool-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.directory-panel,
.tracker-panel,
.intent-panel {
  grid-column: 1 / -1;
}

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

.form-grid,
.filter-grid,
.intent-grid {
  display: grid;
  gap: 12px;
}

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

.form-grid.compact {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.5fr) minmax(180px, 0.5fr) minmax(140px, 0.35fr);
}

.filter-grid {
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(160px, 0.6fr)) repeat(3, minmax(150px, 0.45fr));
  align-items: end;
  margin-bottom: 14px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

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

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd3df;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 0.96rem;
}

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

textarea {
  resize: vertical;
  min-height: 92px;
  padding: 10px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(17, 117, 109, 0.22);
  outline-offset: 2px;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #cbd3df;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.check-label input {
  width: 16px;
  min-height: 16px;
}

.primary-action,
.secondary-action,
.small-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 7px;
  font-weight: 800;
}

.primary-action {
  margin-top: 14px;
  padding: 10px 15px;
  border: 1px solid var(--teal-dark);
  background: var(--teal);
  color: #fff;
}

.secondary-action {
  margin-top: 14px;
  padding: 10px 15px;
  border: 1px solid #9eb2da;
  background: var(--blue-bg);
  color: #244d9d;
}

.small-action {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.84rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.output-stack {
  display: grid;
  gap: 12px;
}

.output-block {
  min-height: 108px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.output-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.output-block p {
  margin-bottom: 0;
  color: #2d3745;
}

.preserve-lines {
  white-space: pre-line;
}

.selected-directory {
  min-height: 148px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #d7dfcf;
  border-radius: 8px;
  background: #f7fbf4;
}

.selected-directory p {
  margin-bottom: 8px;
  color: var(--muted);
}

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

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

.compact-table table {
  min-width: 900px;
}

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

th {
  background: #eef2f8;
  color: #344054;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

tbody tr[data-muted="true"] {
  background: #fbf5ed;
}

.cell-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.79rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f8;
  color: #344054;
  font-size: 0.78rem;
  font-weight: 800;
}

.badge-published,
.badge-submitted {
  background: var(--green-bg);
  color: var(--teal-dark);
}

.badge-candidate {
  background: var(--blue-bg);
  color: #244d9d;
}

.badge-blocked {
  background: var(--red-bg);
  color: var(--red);
}

.badge-competitor {
  background: var(--amber-bg);
  color: var(--amber);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--teal-dark);
  font-size: 0.9rem;
  font-weight: 750;
}

.hidden {
  display: none;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-size: 0.9rem;
}

.policy-page {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 44px 24px;
}

.policy-page article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.policy-page h1 {
  font-size: 3.2rem;
}

.policy-page h2 {
  margin-top: 28px;
  margin-bottom: 8px;
}

.policy-page li {
  margin-bottom: 8px;
}

@media (max-width: 1180px) {
  .intro-band,
  .workspace,
  .resource-band {
    grid-template-columns: 1fr;
  }

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

  h1 {
    font-size: 4rem;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 10px 16px;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }

  .nav {
    width: 100%;
    gap: 10px;
  }

  .nav a {
    font-size: 0.9rem;
  }

  .intro-band {
    padding-top: 22px;
    padding-bottom: 14px;
    gap: 14px;
  }

  .form-grid,
  .filter-grid,
  .intent-grid {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace,
  .intro-band,
  .guardrail-band,
  .resource-band {
    padding-left: 16px;
    padding-right: 16px;
  }

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

  .tool-panel {
    padding: 15px;
  }

  .panel-heading {
    align-items: start;
    flex-direction: column;
  }

  h1 {
    font-size: 2.45rem;
    line-height: 1.02;
  }

  .intro-text {
    font-size: 0.96rem;
  }

  .metric-strip div {
    min-height: 68px;
    padding: 10px;
  }

  .metric-strip dt {
    font-size: 1.7rem;
  }

  .metric-strip dd {
    font-size: 0.75rem;
  }

  .guardrail-band {
    gap: 8px;
    padding-bottom: 16px;
  }

  .guardrail-band span {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 0.82rem;
  }

  .policy-page h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 440px) {
  h1 {
    font-size: 2.28rem;
  }
}
