@import url("https://fonts.googleapis.com/css2?family=Archivo+Black&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  color-scheme: light;
  --ink: #000000;
  --muted: #5f5d57;
  --line: #d8d4cc;
  --paper: #f8f8f8;
  --panel: #ffffff;
  --accent: #938069;
  --accent-strong: #6f604f;
  --accent-soft: #f1eee8;
  --olive: #878b76;
  --olive-soft: #eeefe8;
  --warn: #7a4f00;
  --warn-soft: #fff4d8;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Space Grotesk", Arial, Helvetica, sans-serif;
  font-weight: 500;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--olive);
  color: #f8f8f8;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-home {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.brand-home:hover .brand-mark,
.brand-home:focus-visible .brand-mark {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #ffffff;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-block h1,
.brand-block p,
.summary-panel h2,
.panel h3,
.topbar h2 {
  margin: 0;
}

.brand-block h1 {
  font-family: "Archivo Black", "Space Grotesk", Arial, sans-serif;
  font-size: 19px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
}

.brand-block p {
  color: #cfcdc7;
  margin-top: 4px;
  font-size: 13px;
}

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

.step-button {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.08);
  color: #f8f8f8;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border-radius: 999px;
}

.step-button.active {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
}

.site-link {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  padding: 12px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.site-link:hover,
.site-link:focus-visible {
  background: #ffffff;
  color: #000000;
}

.step-number {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 13px;
}

.summary-panel {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  padding-top: 18px;
}

.summary-panel h2 {
  font-size: 15px;
  margin-bottom: 12px;
}

.summary-panel dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.summary-panel dl div {
  display: flex;
  justify-content: space-between;
  color: #f8f8f8;
}

.summary-panel dt {
  color: #ebe9e1;
}

.summary-panel dd {
  margin: 0;
  font-weight: 700;
}

.content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 96px;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border-bottom: 2px solid var(--ink);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 700;
}

.topbar h2 {
  font-family: "Archivo Black", "Space Grotesk", Arial, sans-serif;
  font-size: 28px;
  line-height: 1.05;
  text-transform: uppercase;
}

.topbar-actions,
.review-actions,
.toolbar,
.footer-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.toolbar {
  margin-bottom: 16px;
}

.review-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.send-panel {
  border: 1px solid var(--line);
  background: var(--olive-soft);
  padding: 16px;
  margin: 0 0 16px;
  display: grid;
  gap: 12px;
  align-items: start;
}

.send-panel h3 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.2;
}

.send-panel h3 span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.send-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.send-button {
  justify-self: start;
}

.step-view {
  display: none;
  padding: 28px 32px;
  flex: 1;
}

.step-view.active {
  display: block;
}

.intro {
  max-width: 860px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.intro p {
  margin: 0;
}

.intro .subtle-note {
  margin-top: 10px;
  font-size: 14px;
  color: #706d65;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.capability-card,
.hardware-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: none;
}

.capability-card {
  min-height: 150px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.capability-card.selected {
  border-color: var(--ink);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.card-head input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.card-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.capability-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

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

.panel {
  padding: 18px;
}

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

.panel h3 {
  font-size: 17px;
  margin-bottom: 12px;
}

.tag-list,
.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag,
.mini-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  border-radius: 999px;
}

.tag.auto {
  background: var(--warn-soft);
  border-color: #f0d088;
  color: var(--warn);
}

.hardware-list {
  display: grid;
  gap: 16px;
}

.hardware-category-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.hardware-tab {
  min-height: 46px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  font-weight: 700;
  border-radius: 999px;
}

.hardware-tab strong {
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 13px;
}

.hardware-tab.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.hardware-tab.active strong {
  background: #fff;
  color: var(--accent-strong);
}

.hardware-category-panel {
  display: grid;
  gap: 16px;
}

.category-heading {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  background: var(--panel);
}

.category-heading h3 {
  margin: 0 0 4px;
}

.category-heading p {
  margin: 0;
  color: var(--muted);
}

.hardware-card {
  padding: 18px;
}

.hardware-card h3 {
  margin: 0 0 4px;
}

.hardware-card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.hardware-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.hardware-select-block {
  display: grid;
  gap: 10px;
}

.hardware-select-block label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.hardware-select-block select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 0;
}

.selection-note {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--muted);
}

.hardware-option {
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 12px;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
}

.hardware-option input {
  margin-top: 2px;
  accent-color: var(--ink);
}

.hardware-option.disabled {
  color: var(--muted);
  background: #f0f0f0;
}

.hardware-option.disabled input {
  cursor: not-allowed;
}

.hardware-option strong {
  display: block;
  margin-bottom: 3px;
}

.hardware-option span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.hardware-option .cost-hint,
.selection-note .cost-hint {
  color: var(--accent-strong);
  font-weight: 700;
  margin-top: 6px;
}

.number-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(120px, 220px);
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.number-row label {
  font-weight: 700;
}

.number-row input {
  min-height: 40px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 0;
}

.calculated-value {
  margin-top: 12px;
  color: var(--accent-strong);
  font-weight: 700;
}

.inline-warning {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #f0cf82;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 14px;
  line-height: 1.4;
}

.inline-warning ul {
  margin: 0;
  padding-left: 18px;
}

.inline-warning li {
  margin: 4px 0;
}

.review-output {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.review-section {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px;
}

.review-warning-section {
  background: #fff8e6;
  border-color: #f0cf82;
  color: #5f4a13;
}

.review-section h3 {
  margin: 0 0 12px;
}

.review-section ul {
  margin: 0;
  padding-left: 20px;
}

.review-section li {
  margin: 5px 0;
}

.bom-output {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.bom-table {
  display: grid;
  border: 1px solid var(--line);
  overflow: auto;
}

.bom-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(220px, 1.5fr) 88px 90px 90px minmax(220px, 1.4fr);
  border-bottom: 1px solid var(--line);
}

.bom-row:last-child {
  border-bottom: 0;
}

.bom-row span {
  padding: 10px;
  border-right: 1px solid var(--line);
  min-width: 0;
  overflow-wrap: anywhere;
}

.bom-row span:last-child {
  border-right: 0;
}

.bom-cost-input {
  display: block;
}

.bom-cost-input input {
  width: 100%;
  min-width: 74px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 7px 8px;
}

.hardware-select-grid {
  display: grid;
  gap: 14px;
}

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

.bom-head {
  background: var(--accent-soft);
  font-weight: 700;
}

.bom-empty {
  padding: 14px;
  color: var(--muted);
}

.bom-total {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.bom-total strong {
  color: var(--ink);
}

.footer-actions {
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--panel);
  border-top: 2px solid var(--ink);
}

.primary-button,
.secondary-button,
.icon-button {
  border: 1px solid transparent;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
}

.primary-button {
  background: var(--ink);
  color: white;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  background: white;
  border-color: var(--ink);
  color: var(--ink);
}

.secondary-button:hover,
.icon-button:hover {
  background: var(--accent-soft);
  border-color: var(--ink);
}

.icon-button {
  width: 40px;
  padding: 0;
  background: white;
  border-color: var(--ink);
}

.empty-note {
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

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

  .summary-panel {
    margin-top: 0;
  }

  .dependency-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar,
  .step-view,
  .footer-actions,
  .sidebar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .steps,
  .toolbar,
  .review-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar {
    align-items: flex-start;
    gap: 16px;
  }
}
