:root {
  --ar-blue: #325ef5;
  --ar-blue-soft: #e9edff;
  --ar-ink: #10110f;
  --ar-lime: #d8f542;
  --ar-coral: #f17d5c;
  --ar-coral-soft: #fff0eb;
  --ar-sand: #f1efe9;
}

.headstar-product {
  --canvas: #f5f5f2;
  --surface-subtle: #f8f8f5;
  --coral: var(--ar-coral);
  --coral-soft: var(--ar-coral-soft);
}

.headstar-product .sidebar {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 68%), rgb(247 247 242 / 96%)),
    #f8f8f4;
}

.headstar-product .primary-nav a.active {
  background: #1a1b18;
  color: #fff;
}

.headstar-product .primary-nav a.active svg {
  color: var(--ar-lime);
}

.headstar-product .topbar-agent-state > i {
  background: var(--ar-blue);
  box-shadow: 0 0 0 4px rgb(50 94 245 / 9%);
}

.ar-live-marker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ar-live-marker i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgb(39 103 73 / 10%);
}

.ar-live-marker.offline i {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgb(154 93 24 / 10%);
}

.ar-view-head strong {
  color: var(--ar-blue);
}

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

.ar-metric-grid .metric-card {
  min-height: 124px;
}

.ar-metric-grid .metric-card:first-child {
  background: var(--ar-ink);
  color: #fff;
}

.ar-metric-grid .metric-card:first-child header span,
.ar-metric-grid .metric-card:first-child footer {
  color: #aeb1aa;
}

.ar-metric-grid .metric-card:first-child header b {
  background: rgb(216 245 66 / 14%);
  color: var(--ar-lime);
}

.ar-truth-chain {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.ar-truth-step {
  position: relative;
  min-width: 0;
  padding: 14px 15px 13px;
  border-right: 1px solid var(--line);
}

.ar-truth-step:last-child {
  border-right: 0;
}

.ar-truth-step::after {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: -5px;
  width: 9px;
  height: 9px;
  border-top: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  background: var(--surface);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.ar-truth-step:last-child::after {
  display: none;
}

.ar-truth-step small,
.ar-truth-step strong,
.ar-truth-step span {
  display: block;
}

.ar-truth-step small {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.ar-truth-step strong {
  margin-top: 5px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-truth-step span {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-truth-step.active {
  background: #f1f4ff;
}

.ar-truth-step.active strong {
  color: var(--ar-blue);
}

.ar-truth-step.done {
  background: #eff8f2;
}

.ar-truth-step.done strong {
  color: var(--green);
}

.ar-today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(330px, .72fr);
  align-items: start;
  gap: 16px;
}

.ar-work-list {
  display: grid;
}

.ar-work-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1.2fr) minmax(150px, .8fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.ar-work-item:last-child {
  border-bottom: 0;
}

.ar-work-item:hover {
  background: #fbfbf8;
}

.ar-work-rank {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: var(--ar-blue-soft);
  color: var(--ar-blue);
  font-size: 10px;
  font-weight: 800;
}

.ar-work-rank.blocked {
  background: var(--ar-coral-soft);
  color: #b4482e;
}

.ar-work-copy,
.ar-work-action {
  min-width: 0;
}

.ar-work-copy strong,
.ar-work-copy small,
.ar-work-action strong,
.ar-work-action small {
  display: block;
}

.ar-work-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-work-copy small,
.ar-work-action small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-work-action strong {
  overflow: hidden;
  color: #30342e;
  font-size: 10px;
  font-weight: 690;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-work-amount {
  min-width: 90px;
  text-align: right;
}

.ar-work-amount strong {
  display: block;
  font-family: "Inter Tight", sans-serif;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.ar-work-amount small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.ar-case-card {
  overflow: hidden;
  border: 1px solid #d8d8d1;
  border-radius: 14px;
  background: #fff;
}

.ar-case-card > header {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 100% 0, rgb(50 94 245 / 16%), transparent 44%),
    #f8f8f5;
}

.ar-case-card > header span {
  color: var(--ar-blue);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.ar-case-card > header h3 {
  margin: 6px 0 0;
  font-family: "Inter Tight", sans-serif;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.035em;
}

.ar-case-card > header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.ar-stage-list {
  display: grid;
  padding: 8px 0;
}

.ar-stage {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
}

.ar-stage > i {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.ar-stage.done > i {
  border-color: #a7d6b8;
  background: var(--green-soft);
  color: var(--green);
}

.ar-stage.active > i {
  border-color: var(--ar-blue);
  background: var(--ar-blue);
  color: #fff;
}

.ar-stage strong,
.ar-stage small {
  display: block;
}

.ar-stage strong {
  font-size: 10px;
}

.ar-stage small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.ar-stage > span {
  color: var(--muted-2);
  font-size: 8px;
  text-transform: uppercase;
}

.ar-case-card > footer {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
}

.ar-case-card > footer .button {
  width: 100%;
  justify-content: center;
}

.ar-case-card > footer p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
  text-align: center;
}

.ar-table-panel {
  overflow: hidden;
}

.ar-table-panel .data-table th,
.ar-table-panel .data-table td {
  padding-inline: 14px;
}

.ar-table-panel .data-table td {
  height: 58px;
}

.ar-table-panel .data-table tbody tr {
  cursor: pointer;
}

.ar-invoice-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ar-invoice-stack span {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafaf8;
  color: #4f544c;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
}

.ar-mobile-list {
  display: none;
}

.ar-inbox-shell {
  display: grid;
  min-height: min(670px, calc(100vh - 210px));
  grid-template-columns: 330px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.ar-thread-list {
  border-right: 1px solid var(--line);
  background: #f8f8f5;
}

.ar-thread-list > header {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.ar-thread-list > header strong,
.ar-thread-list > header small {
  display: block;
}

.ar-thread-list > header strong {
  font-size: 12px;
}

.ar-thread-list > header small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.ar-thread-button {
  display: grid;
  width: 100%;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.ar-thread-button.active {
  background: #fff;
  box-shadow: inset 3px 0 var(--ar-blue);
}

.ar-thread-button strong,
.ar-thread-button small,
.ar-thread-button span {
  display: block;
}

.ar-thread-button strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-thread-button small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-thread-button time {
  color: var(--muted-2);
  font-size: 8px;
}

.ar-thread-view {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.ar-thread-view > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.ar-thread-view > header h3,
.ar-thread-view > header p {
  margin: 0;
}

.ar-thread-view > header h3 {
  font-size: 13px;
}

.ar-thread-view > header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.ar-message-stream {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background:
    linear-gradient(#fafafa, #f7f7f4);
}

.ar-message {
  max-width: 82%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 7px rgb(20 22 18 / 3%);
}

.ar-message.outbound {
  margin-left: auto;
  border-color: #d7defb;
  background: #f2f4ff;
}

.ar-message header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 8px;
}

.ar-message p {
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.55;
  white-space: pre-line;
}

.ar-proposal {
  margin: 0 18px 18px;
  padding: 15px;
  border: 1px solid #cbd6fd;
  border-radius: 12px;
  background: #f4f6ff;
}

.ar-proposal > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ar-proposal > header span {
  color: var(--ar-blue);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.ar-proposal > header b {
  color: var(--muted);
  font-size: 8px;
}

.ar-proposal h4 {
  margin: 8px 0 0;
  font-size: 11px;
}

.ar-proposal blockquote {
  margin: 11px 0 0;
  padding: 11px 12px;
  border: 1px solid #dde2fb;
  border-radius: 9px;
  background: #fff;
  color: #353934;
  font-size: 9px;
  line-height: 1.55;
  white-space: pre-line;
}

.ar-proposal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.ar-proposal footer small {
  color: var(--muted);
  font-size: 8px;
}

.ar-proposal-actions {
  display: flex;
  gap: 7px;
}

.ar-cash-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.ar-cash-summary > div {
  padding: 16px;
  border-right: 1px solid var(--line);
}

.ar-cash-summary > div:last-child {
  border-right: 0;
}

.ar-cash-summary small,
.ar-cash-summary strong,
.ar-cash-summary span {
  display: block;
}

.ar-cash-summary small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 760;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.ar-cash-summary strong {
  margin-top: 6px;
  font-family: "Inter Tight", sans-serif;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.ar-cash-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

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

.ar-cash-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.ar-cash-card > header {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.ar-cash-card > header h3 {
  margin: 0;
  font-size: 11px;
}

.ar-cash-item {
  display: block;
  width: 100%;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.ar-cash-item:last-child {
  border-bottom: 0;
}

.ar-cash-item:hover {
  background: #fbfbf8;
}

.ar-cash-item strong,
.ar-cash-item small,
.ar-cash-item span {
  display: block;
}

.ar-cash-item strong {
  font-size: 10px;
}

.ar-cash-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.ar-cash-item span {
  margin-top: 8px;
  font-family: "Inter Tight", sans-serif;
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.ar-equation {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #d9e0fe;
  border-radius: 12px;
  background: #f4f6ff;
}

.ar-equation code {
  color: #273b8f;
  font-size: 10px;
  line-height: 1.7;
  white-space: normal;
}

.ar-equation p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 8px;
}

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

.ar-blocker-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.ar-blocker-card > header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
}

.ar-blocker-card > header > span:first-child {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: var(--ar-coral-soft);
  color: #ba4d31;
}

.ar-blocker-card > header svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.ar-blocker-card h3,
.ar-blocker-card p {
  margin: 0;
}

.ar-blocker-card h3 {
  font-size: 11px;
}

.ar-blocker-card header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.ar-blocker-card header strong {
  font-family: "Inter Tight", sans-serif;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.ar-blocker-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
}

.ar-blocker-card dl > div {
  min-width: 0;
  padding: 12px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ar-blocker-card dl > div:nth-child(even) {
  border-right: 0;
}

.ar-blocker-card dl > div:nth-last-child(-n+2) {
  border-bottom: 0;
}

.ar-blocker-card dt {
  color: var(--muted);
  font-size: 8px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ar-blocker-card dd {
  margin: 5px 0 0;
  overflow: hidden;
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-blocker-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  background: #fbfbf8;
}

.ar-blocker-card > footer p {
  color: var(--muted);
  font-size: 8px;
}

.ar-controls-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.ar-control-list {
  display: grid;
}

.ar-control-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}

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

.ar-control-row > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
}

.ar-control-row.warning > span {
  background: var(--amber-soft);
  color: var(--amber);
}

.ar-control-row svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

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

.ar-control-row strong {
  font-size: 10px;
}

.ar-control-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.ar-control-row b {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.ar-audit-stream {
  max-height: 440px;
  overflow-y: auto;
}

.ar-audit-event {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.ar-audit-event > i {
  width: 6px;
  height: 6px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--ar-blue);
}

.ar-audit-event strong,
.ar-audit-event small {
  display: block;
}

.ar-audit-event strong {
  font-size: 9px;
}

.ar-audit-event small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.ar-audit-event time {
  color: var(--muted-2);
  font-size: 8px;
}

.ar-buyer-hero {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 100% 0, rgb(216 245 66 / 32%), transparent 42%),
    #fafaf7;
}

.ar-buyer-hero h3,
.ar-buyer-hero p {
  margin: 0;
}

.ar-buyer-hero h3 {
  font-family: "Inter Tight", sans-serif;
  font-size: 25px;
  letter-spacing: -.04em;
}

.ar-buyer-hero p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.ar-buyer-hero > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.ar-buyer-grid {
  display: grid;
  min-height: calc(100dvh - 210px);
  grid-template-columns: minmax(190px, .75fr) minmax(260px, 1.15fr) minmax(190px, .7fr);
}

.ar-buyer-column {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.ar-buyer-column:last-child {
  border-right: 0;
}

.ar-buyer-column > h4 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 780;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.ar-invoice-card,
.ar-context-card {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.ar-invoice-card strong,
.ar-invoice-card small,
.ar-invoice-card span,
.ar-context-card strong,
.ar-context-card small {
  display: block;
}

.ar-invoice-card strong,
.ar-context-card strong {
  font-size: 9px;
}

.ar-invoice-card span {
  margin-top: 8px;
  font-family: "Inter Tight", sans-serif;
  font-size: 18px;
  font-weight: 650;
}

.ar-invoice-card small,
.ar-context-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.ar-sheet-message {
  margin-bottom: 9px;
  padding: 11px;
  border-radius: 9px;
  background: #f3f3ef;
}

.ar-sheet-message.outbound {
  background: #eff2ff;
}

.ar-sheet-message small,
.ar-sheet-message p {
  margin: 0;
}

.ar-sheet-message small {
  color: var(--muted);
  font-size: 8px;
}

.ar-sheet-message p {
  margin-top: 6px;
  font-size: 9px;
  line-height: 1.5;
  white-space: pre-line;
}

.ar-import-flow {
  padding: 20px;
}

.ar-import-flow > .button {
  margin-top: 12px;
}

.ar-import-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.ar-import-steps span {
  padding: 10px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  text-align: center;
  text-transform: uppercase;
}

.ar-import-steps span:last-child {
  border-right: 0;
}

.ar-import-steps span:first-child {
  background: #f1f4ff;
  color: var(--ar-blue);
}

.ar-drop-zone {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  padding: 24px;
  border: 1px dashed #bdc2b8;
  border-radius: 12px;
  background: #fafaf7;
  text-align: center;
}

.ar-drop-zone svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: var(--ar-blue);
  stroke-width: 1.6;
}

.ar-drop-zone h3,
.ar-drop-zone p {
  margin: 0;
}

.ar-drop-zone h3 {
  margin-top: 10px;
  font-size: 13px;
}

.ar-drop-zone p {
  max-width: 430px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.ar-drop-zone .button {
  margin-top: 15px;
}

.ar-import-fields {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
}

.ar-backend-error {
  display: grid;
  min-height: 55vh;
  place-items: center;
}

.ar-backend-error > div {
  width: min(520px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: center;
}

.ar-backend-error h2,
.ar-backend-error p {
  margin: 0;
}

.ar-backend-error h2 {
  font-family: "Inter Tight", sans-serif;
  font-size: 25px;
}

.ar-backend-error p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.ar-backend-error code {
  display: block;
  margin-top: 16px;
  padding: 11px;
  border-radius: 8px;
  background: #1a1b18;
  color: var(--ar-lime);
  font-size: 11px;
}

@media (max-width: 1180px) {
  .ar-today-grid,
  .ar-controls-grid {
    grid-template-columns: 1fr;
  }

  .ar-case-card {
    max-width: none;
  }

  .ar-cash-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 980px) {
  .ar-metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ar-truth-chain {
    grid-template-columns: 1fr;
  }

  .ar-truth-step {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ar-truth-step:last-child {
    border-bottom: 0;
  }

  .ar-truth-step::after {
    display: none;
  }

  .ar-inbox-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .ar-buyer-grid {
    grid-template-columns: 1fr;
  }

  .ar-buyer-column {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .ar-truth-step small,
  .ar-stage > span,
  .ar-proposal > header span,
  .ar-proposal > header b,
  .ar-cash-summary small,
  .ar-control-row b,
  .ar-buyer-column > h4 {
    font-size: 10px;
  }

  .ar-truth-step span,
  .ar-stage small,
  .ar-case-card > footer p,
  .ar-thread-button small,
  .ar-thread-button time,
  .ar-thread-view > header p,
  .ar-message header,
  .ar-proposal footer small,
  .ar-cash-summary span,
  .ar-blocker-card header p,
  .ar-blocker-card dt,
  .ar-blocker-card > footer p,
  .ar-control-row small,
  .ar-audit-event small,
  .ar-audit-event time,
  .ar-invoice-card small,
  .ar-context-card small,
  .ar-sheet-message small,
  .ar-mobile-case small {
    font-size: 11px;
  }

  .ar-stage strong,
  .ar-thread-button strong,
  .ar-message p,
  .ar-proposal h4,
  .ar-proposal blockquote,
  .ar-blocker-card h3,
  .ar-blocker-card dd,
  .ar-control-row strong,
  .ar-audit-event strong,
  .ar-invoice-card strong,
  .ar-context-card strong,
  .ar-sheet-message p,
  .ar-mobile-case strong {
    font-size: 12px;
  }

  .ar-metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ar-metric-grid .metric-card {
    min-height: 108px;
  }

  .ar-metric-grid .metric-card strong {
    font-size: 22px;
  }

  .ar-work-item {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .ar-work-action {
    grid-column: 2 / -1;
  }

  .ar-work-amount {
    grid-column: 3;
    grid-row: 1;
  }

  .ar-table-panel .table-wrap {
    display: none;
  }

  .ar-mobile-list {
    display: grid;
  }

  .ar-mobile-case {
    display: block;
    width: 100%;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    background: transparent;
    text-align: left;
  }

  .ar-mobile-case header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .ar-mobile-case strong,
  .ar-mobile-case small {
    display: block;
  }

  .ar-mobile-case strong {
    font-size: 11px;
  }

  .ar-mobile-case small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 8px;
  }

  .ar-mobile-case > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 11px;
  }

  .ar-inbox-shell {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .ar-thread-list {
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ar-thread-list > header {
    display: none;
  }

  .ar-thread-button {
    min-width: 230px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .ar-thread-button.active {
    box-shadow: inset 0 -3px var(--ar-blue);
  }

  .ar-message-stream {
    max-height: 390px;
  }

  .ar-message {
    max-width: 94%;
  }

  .ar-proposal footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .ar-proposal-actions {
    width: 100%;
  }

  .ar-proposal-actions .button {
    flex: 1;
    justify-content: center;
  }

  .ar-cash-summary,
  .ar-cash-grid,
  .ar-blocker-grid {
    grid-template-columns: 1fr;
  }

  .ar-cash-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ar-cash-summary > div:last-child {
    border-bottom: 0;
  }

  .ar-blocker-card dl {
    grid-template-columns: 1fr;
  }

  .ar-blocker-card dl > div {
    border-right: 0;
  }

  .ar-blocker-card dl > div:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .ar-blocker-card > footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .ar-import-steps {
    grid-template-columns: 1fr 1fr;
  }

  .ar-import-steps span:nth-child(2) {
    border-right: 0;
  }

  .ar-import-steps span:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 420px) {
  .ar-metric-grid {
    grid-template-columns: 1fr;
  }

  .ar-metric-grid .metric-card {
    min-height: 0;
  }
}
