:root {
  --ink: #111a2a;
  --muted: #607086;
  --line: #bfc9d6;
  --line-soft: #d9e1ea;
  --paper: #f7f9fc;
  --panel: #ffffff;
  --nav: #102235;
  --nav-2: #17304b;
  --blue: #1e5aa7;
  --green: #1b7d57;
  --green-soft: #e7f5ed;
  --amber: #99640a;
  --amber-soft: #fff5db;
  --red: #bd2f35;
  --red-soft: #fff0f0;
  --shadow: 0 18px 40px rgba(24, 36, 56, 0.12);
  --mono: "SFMono-Regular", "Cascadia Mono", "Liberation Mono", monospace;
  --sans: "Aptos", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #eef2f7;
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.brand-svg,
.pharos-nav nav svg,
.source-svg,
.node-svg {
  display: inline-block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-svg {
  width: 28px;
  height: 34px;
  color: #f4f9ff;
  stroke-width: 2;
}

.pharos-nav nav svg {
  width: 15px;
  height: 15px;
  color: #d7e8f7;
  stroke-width: 2;
}

.source-svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke-width: 2;
}

.node-svg {
  width: 34px;
  height: 31px;
  margin-bottom: 4px;
  color: #315eaf;
  stroke-width: 2;
}

.board {
  width: min(1536px, 100vw);
  margin: 0 auto;
  padding: 10px 12px 12px;
  display: grid;
  gap: 10px;
}

.top-grid {
  display: grid;
  grid-template-columns: minmax(650px, 1.47fr) minmax(330px, 0.69fr) minmax(430px, 0.91fr);
  gap: 10px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  display: grid;
  grid-template-rows: 48px 640px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #0e1828;
  font-size: 14px;
  white-space: nowrap;
}

.panel-title .num {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #1c2b42;
  color: #fff;
  font-size: 14px;
  font-weight: 850;
}

.panel-title strong {
  font-weight: 850;
}

.panel-title span:not(.num) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-title em {
  margin-left: auto;
  font-style: normal;
  background: #162238;
  color: #fff;
  font-size: 10px;
  border-radius: 3px;
  padding: 6px 8px;
}

.accountant-shell,
.workflow-card,
.console-shell,
.architecture,
.legend {
  background: var(--panel);
  border: 1.5px solid #1f2c40;
  border-radius: 7px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.accountant-shell {
  height: 640px;
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr) 204px;
}

.pharos-nav {
  background: linear-gradient(160deg, #0e2237 0%, #0b1d2e 100%);
  color: #f1f7ff;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pharos-brand {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  letter-spacing: 0.18em;
  font-weight: 850;
  font-size: 15px;
}

.pharos-nav nav {
  padding: 22px 8px 0;
  display: grid;
  gap: 4px;
}

.pharos-nav a,
.console-nav a {
  text-decoration: none;
  color: inherit;
}

.pharos-nav nav a {
  min-height: 46px;
  border-radius: 4px;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  color: #e7f0fa;
  font-size: 12px;
}

.pharos-nav nav a.active {
  background: rgba(87, 126, 166, 0.24);
}

.pharos-nav b {
  background: #eef4fb;
  color: #14243a;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
}

.client-block {
  margin-top: auto;
  padding: 14px 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.client-block small,
.user-block small {
  display: block;
  color: #aebdd0;
  font-size: 10px;
  margin-bottom: 4px;
}

.client-block strong,
.user-block strong {
  font-size: 12px;
}

.user-block {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 12px 18px;
  display: flex;
  gap: 9px;
  align-items: center;
}

.user-block > span,
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #e6edf5;
  color: #1d2b40;
  font-size: 11px;
  flex: 0 0 auto;
}

.chat-pane {
  min-width: 0;
  background: #fbfcfe;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-soft);
}

.chat-top {
  height: 44px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}

.chat-top label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}

select,
input {
  border: 1px solid #c9d3df;
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  min-height: 28px;
  padding: 0 9px;
}

.message-row {
  display: flex;
  gap: 10px;
  padding: 14px 18px 6px;
}

.question {
  max-width: 270px;
  min-height: 50px;
  padding: 10px 13px;
  border: 1px solid #d2dbe6;
  border-radius: 7px;
  background: #f6f8fb;
  font-size: 10.5px;
  line-height: 1.22;
  color: #253247;
}

.question time {
  display: block;
  text-align: right;
  color: #8b99aa;
  font-size: 9px;
  margin-top: 7px;
}

.answer-card {
  margin: 8px 12px 0;
  padding: 13px 12px 10px;
  border: 1.5px solid #d99b27;
  border-radius: 6px;
  background: #fffefa;
  font-size: 11px;
  line-height: 1.38;
}

.warning-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff6df;
  color: #81540d;
  padding: 7px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-size: 11px;
}

.warn-icon {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  display: inline-grid;
  place-items: center;
  background: #d28a0f;
  color: #fff;
  font-weight: 900;
  font-size: 11px;
}

.answer-card p {
  margin: 0 0 10px;
}

.answer-card button,
.source-used button {
  border: 1px solid #85a8d9;
  background: #f3f7ff;
  color: #1e58ad;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 10px;
}

.source-used {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.source-used span {
  width: 100%;
  font-size: 10px;
  color: #4d5d72;
}

.answer-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #4b5a70;
  font-size: 9px;
  margin-top: 16px;
}

.prompt-line {
  margin: 18px 12px 0;
  height: 50px;
  display: grid;
  grid-template-columns: 1fr 32px;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line-soft);
}

.prompt-line input {
  border: 0;
  background: transparent;
  color: #6c7a8d;
  width: 100%;
}

.prompt-line button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  position: relative;
}

.prompt-line button::before {
  content: "";
  position: absolute;
  inset: 6px 5px 6px 7px;
  border-top: 2px solid #79889a;
  border-right: 2px solid #79889a;
  transform: skew(-18deg) rotate(25deg);
}

.chat-actions {
  height: 44px;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 0 14px;
  border-top: 1px solid var(--line-soft);
}

.chat-actions button,
.history,
.table-card button {
  border: 1px solid #c9d3df;
  background: #fff;
  border-radius: 3px;
  min-height: 26px;
  padding: 0 8px;
  font-size: 10px;
  color: #27364d;
}

.sources-pane {
  min-width: 0;
  background: #f6f8fb;
  display: flex;
  flex-direction: column;
  padding: 0 6px 38px;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.source-tabs {
  height: 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
}

.source-tabs button {
  height: 40px;
  border: 0;
  background: transparent;
  color: #718096;
  font-size: 11px;
  border-bottom: 2px solid transparent;
}

.source-tabs .active {
  color: #18304e;
  border-bottom-color: var(--blue);
  font-weight: 800;
}

.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 6px;
}

.filters span:first-child {
  background: #edf5ff;
  color: #1e58ad;
  border: 1px solid #9ec0ef;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
}

.mini {
  width: 13px;
  height: 13px;
  display: inline-block;
}

.mini.bank {
  border: 2px solid #315eaf;
  border-top-width: 5px;
}

.mini.firm {
  border: 2px solid #99640a;
}

.mini.client {
  border: 2px solid #456fb8;
  border-radius: 50%;
}

.mini.idea {
  border: 2px solid #a66b0a;
  border-radius: 50%;
}

.source {
  padding: 8px;
  border: 1px solid #d7e0ea;
  border-radius: 5px;
  background: #fff;
  font-size: 10px;
  line-height: 1.28;
}

.source.public {
  border-color: #a7d7bd;
  background: #fafffb;
}

.source.firm {
  border-color: #c7d6f3;
}

.source.client {
  border-color: #b9d5c2;
}

.source.hypothesis {
  border-color: #e9c36c;
  background: #fffbf0;
}

.source header {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #1f5e45;
}

.source.public .source-svg,
.source.client .source-svg {
  color: var(--green);
}

.source.firm .source-svg {
  color: #315eaf;
}

.source.hypothesis .source-svg {
  color: #b4740c;
}

.source header strong {
  font-size: 11px;
}

.source p {
  margin: 4px 0;
  color: #1f334f;
}

.source blockquote {
  margin: 5px 0;
  color: #34445a;
}

.source footer {
  display: flex;
  justify-content: space-between;
  color: #69798e;
  font-size: 9px;
}

.source-history {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  border: 1px solid #c9d3df;
  background: #fff;
  color: #27364d;
  border-radius: 3px;
  min-height: 26px;
  padding: 0 8px;
  font-size: 10px;
  white-space: nowrap;
}

.workflow-card {
  height: 640px;
  padding: 9px;
  display: grid;
  align-content: start;
  gap: 7px;
  font-size: 11px;
}

.crumb {
  color: #738199;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 10px;
}

.danger-banner {
  justify-self: end;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  border: 1px solid #f2a9b0;
  background: #fff1f2;
  color: #ba1f2b;
  border-radius: 4px;
  padding: 6px 9px;
  font-weight: 800;
}

.object-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 18px;
  margin: 2px 0 4px;
}

dt {
  color: #66758b;
  font-size: 10px;
}

dd {
  margin: 0;
  font-weight: 700;
}

.pill.red {
  background: #de3441;
  color: #fff;
  border-radius: 4px;
  padding: 4px 7px;
}

.hot {
  color: #d02d38;
  font-weight: 850;
}

.workflow-card h3 {
  margin: 0;
  font-size: 12px;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 5px;
}

.steps li {
  display: grid;
  grid-template-columns: 22px 1fr 54px 80px;
  gap: 7px;
  align-items: start;
}

.steps b {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #d7dbe3;
  color: #6d7889;
  font-size: 10px;
}

.steps .active b {
  background: #1f63b7;
  color: #fff;
}

.steps strong {
  display: block;
  font-size: 10px;
}

.steps span,
.steps small {
  display: block;
  color: #66758b;
  font-size: 8.5px;
}

.steps em {
  justify-self: start;
  font-style: normal;
  background: #eef2f8;
  color: #34445b;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 10px;
}

.steps .active em {
  background: #e8f1ff;
  color: #1d5da9;
}

.billing {
  border-top: 1px solid var(--line-soft);
  padding-top: 7px;
}

.billing p {
  margin: 4px 0;
  color: #405168;
}

.billing label {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
}

.billing input {
  background: #e7f4ef;
  color: #24735b;
  font-weight: 850;
  text-align: center;
}

.payload {
  position: relative;
}

.payload pre {
  margin: 6px 0 0;
  background: #102235;
  color: #cfe4f7;
  border-radius: 4px;
  padding: 9px;
  font: 9.5px/1.35 var(--mono);
  overflow: hidden;
  max-height: 96px;
}

.payload button {
  position: absolute;
  right: 6px;
  bottom: 6px;
  border: 0;
  border-radius: 3px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 9px;
  padding: 4px 6px;
}

.history {
  justify-self: center;
}

.console-shell {
  height: 640px;
  display: grid;
  grid-template-columns: 114px minmax(0, 1fr);
}

.console-nav {
  background: linear-gradient(160deg, #0e2237 0%, #0a1b2b 100%);
  color: #e8f0fa;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.console-nav .brand-svg {
  margin: 0 0 14px 8px;
}

.console-nav input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #d9e7f6;
  font-size: 9px;
  min-height: 24px;
}

.console-nav a {
  min-height: 28px;
  display: flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 3px;
  font-size: 9.5px;
}

.console-nav a.active {
  background: #1f5aa3;
}

.directus {
  margin-top: auto;
  color: #aab9cb;
  font-size: 9px;
}

.admin-user {
  color: #dce8f5;
  font-size: 9px;
}

.console-content {
  padding: 12px;
  display: grid;
  grid-template-rows: 194px 202px 204px auto;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.table-card {
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #fff;
  padding: 10px;
  min-width: 0;
  overflow: hidden;
}

.table-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.table-card h3 {
  margin: 0;
  font-size: 12px;
}

.table-card h3 span {
  color: #9aa7b7;
  margin-left: 4px;
}

.table-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.8px;
}

th,
td {
  padding: 7px 5px;
  border-bottom: 1px solid #e5ebf2;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #516176;
  font-weight: 850;
}

.ok {
  color: #08724f;
}

.bad {
  color: #bd2f35;
}

.console-content footer {
  align-self: end;
  color: #8793a5;
  font-size: 9px;
  text-align: center;
}

.architecture {
  padding: 10px 12px 8px;
  min-height: 226px;
}

.architecture header {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.flow {
  min-height: 174px;
  display: grid;
  grid-template-columns: 170px 76px 182px 78px minmax(300px, 1fr) 86px 192px 84px 192px;
  gap: 8px;
  align-items: center;
}

.flow-node {
  min-height: 112px;
  border: 1.4px solid #27364d;
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  align-content: start;
  gap: 5px;
  position: relative;
}

.flow-node h3 {
  margin: 0;
  font-size: 12px;
}

.flow-node p,
.flow-node ul {
  margin: 0;
  color: #26364d;
  font-size: 9.5px;
  line-height: 1.28;
}

.flow-node ul {
  padding-left: 14px;
}

.connector {
  height: 2px;
  background: #1f2c40;
  position: relative;
}

.connector::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -5px;
  border-left: 8px solid #1f2c40;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.connector span {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 80px;
  color: #2c3b50;
  font-size: 10px;
  text-align: center;
}

.store b {
  margin-top: 6px;
  color: #27364d;
  font-size: 10px;
}

.ledger {
  position: absolute;
  right: 12px;
  top: 34px;
  width: 140px;
  font-size: 9px;
  color: #102235;
}

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

.postgres em {
  position: absolute;
  left: 80px;
  right: 80px;
  bottom: 8px;
  color: #197447;
  font-style: normal;
  font-weight: 900;
  text-align: center;
  font-size: 11px;
}

.apps p {
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 6px;
  margin-top: 4px;
  text-align: center;
}

.erp code {
  border: 1px dashed #579562;
  background: #f6fff8;
  color: #267348;
  padding: 7px;
  border-radius: 4px;
  font: 9px var(--mono);
  text-align: center;
}

.erp small {
  color: #267348;
  font-size: 9px;
  text-align: center;
}

.git-line {
  width: 214px;
  margin: 4px 0 0 31%;
  border: 1.4px solid #27364d;
  border-radius: 4px;
  padding: 8px;
  text-align: center;
  font-size: 11px;
  background: #fff;
  color: #26364d;
  position: relative;
}

.git-line::before,
.git-line::after {
  content: "";
  position: absolute;
  border-top: 1.4px dashed #267348;
  height: 30px;
  top: -30px;
}

.git-line::before {
  left: -70px;
  width: 70px;
}

.git-line::after {
  right: -216px;
  width: 216px;
}

.legend {
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 8px 14px;
  color: #2c3b50;
  font-size: 10px;
}

.legend p {
  margin: 0;
}

.legend div {
  display: flex;
  gap: 18px;
  align-items: center;
}

.shield,
.lock,
.dash {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: -12px;
}

.shield {
  background: #237a43;
  border-radius: 50%;
}

.lock {
  border: 1.5px solid #9b6b2a;
  border-radius: 2px;
}

.dash {
  width: 26px;
  height: 0;
  border-top: 1.5px dashed #237a43;
}

@media (max-width: 1320px) {
  .top-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .panel-title {
    min-height: 38px;
  }

  .flow {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .connector {
    height: 36px;
    width: 2px;
    margin: 0 auto;
  }

  .connector::after {
    right: -5px;
    top: auto;
    bottom: -1px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #1f2c40;
    border-bottom: 0;
  }

  .connector span {
    left: 18px;
    bottom: 8px;
    transform: none;
  }

  .git-line {
    margin: 12px auto 0;
  }

  .git-line::before,
  .git-line::after {
    display: none;
  }
}

@media (max-width: 760px) {
  .board {
    padding: 8px;
  }

  .panel-title {
    flex-wrap: wrap;
    white-space: normal;
  }

  .accountant-shell,
  .console-shell,
  .workflow-card {
    height: auto;
  }

  .accountant-shell,
  .console-shell {
    grid-template-columns: 1fr;
  }

  .accountant-shell {
    min-height: 0;
  }

  .pharos-nav,
  .console-nav {
    min-height: 0;
  }

  .pharos-nav nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 10px;
  }

  .client-block,
  .user-block {
    display: none;
  }

  .chat-top,
  .steps li,
  .object-grid {
    grid-template-columns: 1fr;
  }

  .sources-pane {
    padding-top: 8px;
  }

  .console-content {
    overflow-x: auto;
  }

  .legend,
  .legend div {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
