:root {
  --ink: #172126;
  --deep: #2f3e46;
  --paper: #f1faee;
  --gold: #e9c46a;
  --blue: #457b9d;
  --mist: #dbe8df;
  --line: rgba(47, 62, 70, 0.16);
  --danger: #b84a45;
  --ok: #2e7d5b;
  --shadow: 0 18px 55px rgba(23, 33, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  min-width: 320px;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(69, 123, 157, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(47, 62, 70, 0.08) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
}

.topline {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px clamp(14px, 3vw, 30px);
  background: rgba(241, 250, 238, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

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

.brand img {
  flex: 0 0 auto;
}

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

.brand strong {
  font-size: 18px;
  line-height: 1.05;
}

.brand small {
  margin-top: 2px;
  color: rgba(23, 33, 38, 0.66);
  font-size: 12px;
}

.source-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.source-pill span,
.mono,
.eyebrow,
.section-head span {
  color: rgba(23, 33, 38, 0.58);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.source-pill strong {
  font-size: 13px;
}

.workspace {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 14px clamp(12px, 2.4vw, 28px) 38px;
}

.summary-row {
  position: sticky;
  top: 71px;
  z-index: 15;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: rgba(47, 62, 70, 0.96);
  color: var(--paper);
  box-shadow: var(--shadow);
}

.summary-row article {
  min-width: 0;
  padding: 13px 14px;
  border-right: 1px solid rgba(241, 250, 238, 0.16);
}

.summary-row article:last-child {
  border-right: 0;
}

.summary-row span {
  display: block;
  color: rgba(241, 250, 238, 0.68);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-row strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 0.95;
}

.summary-row .accent strong {
  color: var(--gold);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0 10px;
}

.tab {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  color: var(--deep);
  font-weight: 800;
}

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

.view {
  display: none;
}

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

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.toolbar h1 {
  margin: 3px 0 0;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
}

.tools {
  display: flex;
  align-items: end;
  gap: 10px;
}

.search {
  display: grid;
  gap: 6px;
  min-width: min(300px, 45vw);
}

.search span,
.note-box label {
  font-size: 12px;
  font-weight: 800;
  color: rgba(23, 33, 38, 0.62);
}

.search input,
.note-box textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  outline: none;
}

.search input {
  padding: 0 13px;
}

.note-box textarea {
  min-height: 110px;
  padding: 12px;
  resize: vertical;
}

.icon-button,
.primary-button {
  min-height: 46px;
  border: 1px solid var(--deep);
  border-radius: 0;
  font-weight: 900;
}

.icon-button {
  width: 48px;
  background: var(--deep);
  color: var(--paper);
  font-size: 22px;
}

.primary-button {
  padding: 0 18px;
  background: var(--blue);
  color: #fff;
}

.lane-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.lane {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  text-align: left;
  transition: transform 160ms ease, background 160ms ease;
}

.lane:hover {
  transform: translateY(-2px);
  background: #fff;
}

.lane span,
.lane small {
  display: block;
}

.lane span {
  font-weight: 900;
}

.lane strong {
  display: block;
  margin: 8px 0 3px;
  font-size: 32px;
  line-height: 1;
}

.lane small {
  color: rgba(23, 33, 38, 0.62);
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 14px;
  align-items: start;
}

.ledger-zone,
.inspector,
.analytics-grid section,
.import-window {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-size: 17px;
}

.ledger-table {
  overflow-x: auto;
}

.table-head,
.ledger-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) minmax(130px, 0.7fr) minmax(105px, 0.45fr) minmax(130px, 0.7fr) minmax(90px, 0.4fr);
  min-width: 820px;
}

.table-head {
  position: sticky;
  top: 143px;
  z-index: 10;
  background: #e4efe1;
  border-bottom: 1px solid var(--line);
}

.table-head span {
  padding: 10px 14px;
  color: rgba(23, 33, 38, 0.58);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.ledger-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.ledger-row:hover,
.ledger-row.is-selected {
  background: rgba(233, 196, 106, 0.22);
}

.ledger-row > span {
  min-width: 0;
  padding: 13px 14px;
}

.ledger-row strong,
.ledger-row small {
  display: block;
}

.ledger-row strong {
  overflow-wrap: anywhere;
}

.ledger-row small {
  margin-top: 4px;
  color: rgba(23, 33, 38, 0.62);
}

.ledger-row.is-risk {
  box-shadow: inset 5px 0 0 var(--danger);
}

.ledger-row.is-watch {
  box-shadow: inset 5px 0 0 var(--gold);
}

.ledger-row.is-ready {
  box-shadow: inset 5px 0 0 var(--ok);
}

.inspector {
  position: sticky;
  top: 143px;
  padding: 18px;
}

.inspector h2 {
  margin: 8px 0;
  font-size: 24px;
  line-height: 1.1;
}

.inspector p {
  color: rgba(23, 33, 38, 0.72);
  line-height: 1.45;
}

.inspector dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.inspector dl div {
  min-width: 0;
  padding: 10px;
  background: rgba(47, 62, 70, 0.07);
}

.inspector dt {
  color: rgba(23, 33, 38, 0.58);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.inspector dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.note-box {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 14px;
}

.bar-list,
.member-list,
.public-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(120px, 1fr) 54px;
  align-items: center;
  gap: 12px;
}

.bar-row span,
.bar-row strong,
.bar-row small,
.member-item strong,
.member-item span,
.member-item small {
  display: block;
  min-width: 0;
}

.bar-row small,
.member-item small {
  color: rgba(23, 33, 38, 0.62);
}

.bar-row i {
  height: 22px;
  background: linear-gradient(90deg, var(--blue), var(--gold));
}

.bar-row b {
  text-align: right;
}

.member-item {
  padding: 12px;
  background: rgba(47, 62, 70, 0.07);
}

.import-console {
  display: grid;
  min-height: 420px;
  place-items: stretch;
}

.import-window {
  padding: clamp(18px, 4vw, 36px);
  background: var(--deep);
  color: var(--paper);
}

.import-window h2 {
  margin: 8px 0;
  font-size: clamp(24px, 4vw, 44px);
  line-height: 1;
}

.import-window p {
  color: rgba(241, 250, 238, 0.76);
}

.import-window pre {
  overflow-x: auto;
  margin: 18px 0 0;
  padding: 14px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--gold);
}

.public-item {
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.public-item h2 {
  margin: 10px 0 6px;
  font-size: clamp(22px, 4vw, 36px);
  line-height: 1.05;
}

.public-item p {
  margin: 0;
  color: rgba(23, 33, 38, 0.7);
}

.public-item footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.public-item footer span,
.public-state {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 10px;
  background: rgba(47, 62, 70, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.empty {
  padding: 28px;
  color: rgba(23, 33, 38, 0.7);
}

@media (max-width: 920px) {
  .summary-row {
    top: 71px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-row article:nth-child(2) {
    border-right: 0;
  }

  .lane-strip,
  .work-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .inspector {
    position: static;
  }

  .table-head {
    top: 221px;
  }
}

@media (max-width: 640px) {
  .topline {
    align-items: flex-start;
  }

  .source-pill {
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    min-height: 46px;
  }

  .workspace {
    padding-left: 10px;
    padding-right: 10px;
  }

  .summary-row {
    top: 71px;
  }

  .summary-row article {
    padding: 11px 10px;
  }

  .summary-row span {
    font-size: 10px;
  }

  .tabs {
    gap: 6px;
  }

  .tab {
    min-height: 44px;
    padding: 0 14px;
  }

  .toolbar,
  .tools {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .search {
    min-width: 0;
  }

  .icon-button {
    width: 100%;
  }

  .lane {
    min-height: 76px;
  }

  .inspector dl {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bar-row b {
    text-align: left;
  }
}

