:root {
  --ink: #141414;
  --paper: #faf7f0;
  --muted: #716b62;
  --line: #ded7ca;
  --violet: #7c3aed;
  --green: #10b981;
  --amber: #d97706;
  --red: #dc2626;
  --white: #fffdf8;
  --shadow: 0 18px 45px rgba(20, 20, 20, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.command-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr minmax(250px, 430px);
  gap: 18px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.12);
  background: rgba(250, 247, 240, 0.94);
  backdrop-filter: blur(14px);
}

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

.brand img {
  flex: 0 0 auto;
  border-radius: 10px;
}

.brand strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1;
}

.brand small,
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
}

.tab,
.icon-button,
.primary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

.tab {
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}

.tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.command-actions {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 10px;
}

.search {
  display: grid;
  gap: 3px;
}

.search span {
  color: var(--muted);
  font-size: 11px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 40px;
  padding: 0 12px;
}

textarea {
  padding: 12px;
  resize: vertical;
}

.icon-button {
  min-width: 44px;
  min-height: 44px;
  font-size: 20px;
}

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

.intro-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  gap: 22px;
  align-items: end;
  padding: 26px 0 22px;
}

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

h1 {
  max-width: 920px;
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 72px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 14px;
  font-size: 17px;
}

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

.metric {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.screen {
  display: none;
}

.screen.is-visible {
  display: block;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin: 18px 0 14px;
}

.section-head.compact {
  align-items: center;
  margin: 0 0 12px;
}

.section-head select {
  max-width: 190px;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.resource-card {
  min-height: 230px;
  display: grid;
  gap: 16px;
  align-content: space-between;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.resource-card.risk {
  border-color: rgba(220, 38, 38, 0.35);
}

.resource-card.watch {
  border-color: rgba(217, 119, 6, 0.4);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.status-pill,
.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eee7dc;
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.risk .status-pill {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}

.watch .status-pill {
  background: rgba(217, 119, 6, 0.14);
  color: #92400e;
}

.ready .status-pill {
  background: rgba(16, 185, 129, 0.13);
  color: #047857;
}

.resource-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.workflow-line {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.workflow-step {
  min-height: 6px;
  border-radius: 999px;
  background: #e6ded2;
}

.workflow-step.is-done {
  background: var(--violet);
}

.workflow-step.is-current {
  background: var(--green);
}

.next-action {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.analytics-grid,
.import-layout,
.status-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.import-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #ece4d8;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--green));
}

.stack-list,
.events {
  display: grid;
  gap: 10px;
}

.list-item,
.event-item,
.status-tile {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf1;
}

.list-item strong,
.event-item strong,
.status-tile strong {
  display: block;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.list-item p,
.event-item p,
.status-tile p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

form.panel {
  display: grid;
  gap: 14px;
}

form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.primary-button {
  min-height: 44px;
  padding: 0 16px;
  background: var(--ink);
  color: var(--paper);
}

.event-stream {
  border-top: 1px solid rgba(20, 20, 20, 0.12);
  background: #efe8dd;
  padding: 18px 22px 24px;
}

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

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

@media (max-width: 1100px) {
  .command-bar,
  .intro-strip {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 720px) {
  .command-bar {
    padding: 12px;
  }

  main {
    padding: 14px;
  }

  h1 {
    font-size: 37px;
    line-height: 1;
  }

  .board,
  .events,
  .metric-rail,
  .analytics-grid,
  .import-layout,
  .status-wall {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
  }

  .section-head select {
    max-width: none;
  }
}

