:root {
  --yellow: #ffd400;
  --yellow-soft: #fff3a3;
  --black: #080808;
  --ink: #181818;
  --muted: #6f6f6f;
  --line: #e8e2c4;
  --paper: #fffdf4;
  --white: #ffffff;
  --shadow: 0 20px 60px rgba(8, 8, 8, 0.12);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: var(--black);
  color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  color: inherit;
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: var(--black);
  border-radius: 8px;
  font-weight: 900;
}

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

.brand small {
  color: #c9c9c9;
  margin-top: 3px;
}

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

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: #efefef;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--yellow);
  color: var(--black);
}

.icon {
  width: 24px;
  text-align: center;
  font-weight: 800;
}

.sidebar-note {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sidebar-note span {
  border: 1px solid #3f3f3f;
  border-radius: 999px;
  padding: 6px 10px;
  color: #d8d8d8;
  font-size: 0.78rem;
}

.workspace {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 880px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.5rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.8rem;
  line-height: 1.1;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.top-actions,
.section-heading,
.block-header,
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.primary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid var(--black);
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  background: var(--yellow);
  color: var(--black);
}

.ghost-button {
  background: var(--white);
  color: var(--black);
}

.app-alert,
.form-message {
  margin: 0;
  font-weight: 800;
}

.app-alert {
  padding: 12px 16px;
  background: #ffe5e5;
  border-bottom: 1px solid #b00020;
  color: #8a0018;
}

.form-message {
  color: var(--muted);
}

.form-message.is-error {
  color: #8a0018;
}

.table-link {
  color: var(--black);
  font-weight: 900;
}

.view {
  display: none;
}

.view.is-visible {
  display: grid;
  gap: 20px;
}

.section-heading {
  align-items: flex-end;
}

.section-heading p {
  margin-bottom: 0;
}

.metrics-grid,
.content-grid,
.reports-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric-card,
.panel-block,
.content-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 14px 0 4px;
  font-size: 2.3rem;
  line-height: 1;
}

.split-layout,
.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.flow-map {
  display: grid;
  grid-template-columns: 1fr 32px 1fr 32px 1fr 32px 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 18px;
}

.flow-step {
  min-height: 190px;
  padding: 18px;
  border: 2px solid var(--black);
  border-radius: 8px;
  background: var(--yellow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flow-step span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--black);
  color: var(--yellow);
  font-weight: 900;
}

.flow-step strong {
  font-size: 1.35rem;
}

.flow-step small {
  color: #252525;
  line-height: 1.4;
}

.flow-line {
  height: 3px;
  background: var(--black);
}

.activity-list,
.check-list,
.report-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.activity-list {
  display: grid;
  gap: 15px;
}

.activity-list li {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.activity-list span {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--yellow);
  border: 2px solid var(--black);
}

.activity-list strong {
  color: var(--black);
}

.architecture-grid {
  display: grid;
  grid-template-columns: repeat(11, auto);
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
}

.arch-node {
  min-width: 128px;
  padding: 14px;
  border: 1px solid var(--black);
  border-radius: 8px;
  background: var(--paper);
  text-align: center;
  font-weight: 800;
}

.arch-node.accent {
  background: var(--black);
  color: var(--yellow);
}

.arch-arrow {
  font-weight: 900;
}

.status-pill,
.file-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--yellow);
  color: var(--black);
  border: 1px solid var(--black);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.warning {
  background: var(--white);
}

.content-grid {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
}

.content-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
}

.content-card h3 {
  margin-top: 28px;
  font-size: 1.35rem;
}

.card-meta {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.88rem;
}

.connector-form {
  display: grid;
  gap: 16px;
}

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

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--black);
  padding: 0 12px;
}

.toggle-row {
  display: grid;
  gap: 10px;
}

.toggle-row label {
  grid-template-columns: 18px 1fr;
  align-items: center;
  color: var(--ink);
  font-weight: 600;
}

.toggle-row input {
  min-height: auto;
}

.check-list {
  display: grid;
  gap: 10px;
}

.check-list li {
  padding: 12px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
}

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

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

th,
td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: var(--black);
  color: var(--yellow);
}

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

.calculator {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.estimate {
  min-width: 170px;
  padding: 16px;
  border: 2px solid var(--black);
  border-radius: 8px;
  background: var(--yellow);
}

.estimate span,
.estimate strong,
.estimate small {
  display: block;
}

.estimate strong {
  font-size: 2rem;
}

.reports-grid {
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
}

.chart-card {
  min-height: 340px;
}

.bars {
  height: 230px;
  display: flex;
  align-items: end;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.bars span {
  flex: 1;
  min-width: 32px;
  border-radius: 8px 8px 0 0;
  background: var(--yellow);
  border: 2px solid var(--black);
}

.report-list {
  display: grid;
  gap: 12px;
}

.report-list li {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.report-list strong,
.report-list span {
  display: block;
}

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

.modal {
  width: min(560px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.48);
}

.modal-content {
  position: relative;
  padding: 28px;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--black);
  border-radius: 8px;
  background: var(--white);
  font-size: 1.3rem;
  line-height: 1;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

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

  .split-layout,
  .builder-layout,
  .calculator,
  .reports-grid {
    grid-template-columns: 1fr;
  }

  .flow-map {
    grid-template-columns: 1fr;
  }

  .flow-line {
    width: 3px;
    height: 24px;
    margin: auto;
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .section-heading,
  .top-actions {
    display: grid;
  }

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

  .metrics-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.35rem;
  }
}
