/* Cross-Vendor Network Task Translator — no framework, no build step. */

:root {
  color-scheme: light dark;

  --bg:            #f6f7f9;
  --bg-raised:     #ffffff;
  --bg-sunken:     #eceef2;
  --border:        #d7dbe2;
  --border-strong: #b9c0cb;
  --text:          #1a1f27;
  --text-dim:      #5b6474;
  --text-faint:    #838c9c;
  --accent:        #1f5fa8;
  --accent-soft:   #e6eef8;
  --code-bg:       #f0f2f6;
  --code-text:     #16324f;

  --gui:      #0f7b53;
  --gui-bg:   #e2f4ec;
  --cli:      #7a4bbd;
  --cli-bg:   #efe8fa;
  --both:     #1f5fa8;
  --both-bg:  #e6eef8;
  --none:     #8a6212;
  --none-bg:  #f7eed6;

  --warn:     #a13b1e;
  --warn-bg:  #fbeae4;

  --radius: 9px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #14171c;
    --bg-raised:     #1c2028;
    --bg-sunken:     #101318;
    --border:        #2c323d;
    --border-strong: #414a58;
    --text:          #e6e9ee;
    --text-dim:      #a3acbb;
    --text-faint:    #7b8494;
    --accent:        #6fa8e8;
    --accent-soft:   #1b2937;
    --code-bg:       #12161c;
    --code-text:     #b8d4f0;

    --gui:      #57c99b;
    --gui-bg:   #143025;
    --cli:      #b795e8;
    --cli-bg:   #251c38;
    --both:     #6fa8e8;
    --both-bg:  #16283a;
    --none:     #d9ab52;
    --none-bg:  #322816;

    --warn:     #e8916f;
    --warn-bg:  #34201a;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.14em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
  word-break: break-word;
}

a { color: var(--accent); }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

.topbar-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 20px 10px;
  flex-wrap: wrap;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-dim);
  max-width: 62ch;
}

.search-wrap {
  position: relative;
  flex: 0 1 340px;
  min-width: 220px;
}

#search {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 8px 11px;
  padding-right: 68px;
  color: var(--text);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

#search:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  background: var(--bg-raised);
}

.search-count {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-faint);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* ---------- translate bar ---------- */

.translate-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 12px;
  background: var(--accent-soft);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

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

.vendor-pick label {
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

.translate-bar select {
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  padding: 6px 9px;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  max-width: 240px;
}

.translate-bar select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.swap {
  font-size: 17px;
  line-height: 1;
  padding: 7px 11px;
  cursor: pointer;
  color: var(--accent);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
}

.swap:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.spacer { flex: 1 1 auto; }

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
}

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  align-items: start;
  gap: 0;
}

.sidebar {
  position: sticky;
  top: 116px;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  padding: 16px 12px 40px;
  border-right: 1px solid var(--border);
  background: var(--bg);
}

.cat-group { margin-bottom: 18px; }

.cat-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 8px 5px;
}

.task-link {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 13.5px;
  padding: 7px 9px;
  margin-bottom: 1px;
  cursor: pointer;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 6px;
  border-left: 3px solid transparent;
}

.task-link:hover { background: var(--bg-sunken); }

.task-link.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  font-weight: 600;
  color: var(--accent);
}

.task-link .hit {
  display: block;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 1px;
}

.sidebar-empty {
  padding: 10px;
  font-size: 13px;
  color: var(--text-faint);
}

/* ---------- content ---------- */

.content {
  padding: 24px 28px 80px;
  min-width: 0;
  max-width: 1500px;
}

.loading, .fatal {
  padding: 40px 4px;
  color: var(--text-dim);
}

.fatal {
  background: var(--warn-bg);
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  padding: 20px 22px;
  color: var(--text);
}

.fatal h2 { margin-top: 0; color: var(--warn); }
.fatal pre {
  background: var(--code-bg);
  padding: 10px 12px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 13px;
  border: 1px solid var(--border);
}

/* task header */

.task-head { margin-bottom: 20px; }

.crumb {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.task-head h2 {
  margin: 4px 0 6px;
  font-size: 25px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.task-desc {
  margin: 0;
  font-size: 15px;
  color: var(--text-dim);
  max-width: 82ch;
}

.differs {
  margin: 14px 0 0;
  padding: 11px 14px;
  font-size: 13.5px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: 100ch;
}

.differs strong { color: var(--accent); }

/* the headline callout: GUI vs CLI mismatch */

.headline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0 22px;
  padding: 12px 15px;
  font-size: 14px;
  border-radius: var(--radius);
  background: var(--none-bg);
  border: 1px solid var(--none);
  max-width: 100ch;
}

.headline.match {
  background: var(--gui-bg);
  border-color: var(--gui);
}

.headline .icon { font-size: 15px; line-height: 1.4; }

/* vendor cards */

.compare {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(370px, 1fr));
  align-items: start;
}

.compare.pair { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }

.vcard {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.vcard.is-source { border-color: var(--border-strong); }
.vcard.is-target { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.vcard-head {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sunken);
}

.vcard-role {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.vcard.is-target .vcard-role { color: var(--accent); }

.vcard-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.vcard-title h3 {
  margin: 0;
  font-size: 15.5px;
  letter-spacing: -0.01em;
}

.vcard-meta {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-faint);
}

.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2.5px 8px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

.badge-gui  { color: var(--gui);  background: var(--gui-bg);  border-color: var(--gui); }
.badge-cli  { color: var(--cli);  background: var(--cli-bg);  border-color: var(--cli); }
.badge-both { color: var(--both); background: var(--both-bg); border-color: var(--both); }
.badge-none { color: var(--none); background: var(--none-bg); border-color: var(--none); }

.vcard-body { padding: 14px 15px 16px; }

.sec-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 7px;
}

.vcard-body .sec-label + * { margin-top: 0; }

ol.steps {
  margin: 0 0 16px;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}

ol.steps li {
  position: relative;
  counter-increment: step;
  padding: 0 0 0 27px;
  margin-bottom: 8px;
  font-size: 13.5px;
  line-height: 1.5;
}

ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: var(--text-dim);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
}

ul.version-notes {
  margin: 0 0 16px;
  padding-left: 0;
  list-style: none;
}

ul.version-notes li {
  display: flex;
  gap: 9px;
  align-items: baseline;
  margin-bottom: 7px;
  font-size: 13px;
  line-height: 1.5;
}

.version-tag {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  white-space: nowrap;
}

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

ul.notes {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

ul.notes li {
  position: relative;
  padding: 0 0 0 22px;
  margin-bottom: 9px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

ul.notes li::before {
  content: "!";
  position: absolute;
  left: 0;
  top: 1px;
  width: 15px;
  height: 15px;
  font-size: 10px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  color: var(--warn);
  background: var(--warn-bg);
  border-radius: 3px;
}

ul.notes li strong { color: var(--warn); }

.docs-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 12.5px;
}

.no-entry {
  font-size: 13.5px;
  color: var(--text-dim);
  padding: 6px 0 2px;
}

/* home / landing */

.home { max-width: 90ch; }
.home h2 { margin-top: 0; font-size: 22px; }
.home p { color: var(--text-dim); }

.home-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-top: 22px;
}

.home-card {
  padding: 13px 15px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.home-card h3 { margin: 0 0 4px; font-size: 14px; }
.home-card p { margin: 0; font-size: 12.5px; }

.vendor-legend {
  margin-top: 26px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.vendor-legend dl { margin: 0; }
.vendor-legend dt { font-weight: 650; font-size: 14px; margin-top: 13px; }
.vendor-legend dd { margin: 2px 0 0; font-size: 13px; color: var(--text-dim); }
.vendor-legend .ver { font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); }

.kbd-hint {
  margin-top: 24px;
  font-size: 12.5px;
  color: var(--text-faint);
}

kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1.5px 5px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
}

/* ---------- footer ---------- */

.footer {
  padding: 22px 28px 40px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-faint);
  background: var(--bg-raised);
}

.footer p { margin: 0 0 8px; max-width: 100ch; }
.footer .disclaimer { color: var(--text-dim); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .content { padding: 20px 16px 60px; }
  .compare, .compare.pair { grid-template-columns: 1fr; }
  .translate-bar { gap: 9px; }
  .vendor-pick { flex: 1 1 100%; }
  .vendor-pick select { flex: 1; max-width: none; }
}

/* ---------- print ---------- */

@media print {
  .topbar, .sidebar, .footer, .swap { display: none !important; }
  .layout { grid-template-columns: 1fr; }
  .content { padding: 0; max-width: none; }
  .vcard { break-inside: avoid; border-color: #999; }
  .compare { grid-template-columns: 1fr 1fr; }
  body { background: #fff; font-size: 11pt; }
}
