:root {
  color-scheme: light;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #f0f4f6;
  --surface-3: #f8fafb;
  --ink: #141b24;
  --muted: #667386;
  --line: #dce3ea;
  --line-soft: #e8edf2;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --blue: #1d4ed8;
  --amber: #b45309;
  --red: #b91c1c;
  --green: #047857;
  --shadow: 0 14px 34px rgba(20, 27, 36, 0.065);
  --shadow-soft: 0 8px 22px rgba(20, 27, 36, 0.045);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f9fbfc 0%, var(--bg) 260px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 480px) 1fr;
}

.login-panel {
  background: var(--surface);
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line-soft);
}

.login-context {
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(rgba(248, 250, 251, 0.78), rgba(248, 250, 251, 0.94)),
    linear-gradient(135deg, #f8faf9 0%, #e4edf0 54%, #f7f9fb 100%);
}

.login-context h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 1;
  letter-spacing: 0;
}

.brand-lockup {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 40px;
}

.brand-lockup.compact {
  margin-bottom: 32px;
}

.brand-lockup.compact div:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-lockup.compact span {
  color: var(--muted);
  font-size: 0.82rem;
}

.workspace-chip {
  margin-top: 16px;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfdfd;
}

.workspace-chip span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.workspace-chip strong {
  color: var(--accent-strong);
  font-size: 0.84rem;
}

.workspace-chip small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.secondary-button.quiet {
  margin-top: 10px;
  width: 100%;
  min-height: 36px;
  box-shadow: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #101821;
  color: white;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 3vw, 2.45rem);
  line-height: 1.05;
  font-weight: 800;
}

h2 {
  font-size: 1rem;
  margin-bottom: 0;
  line-height: 1.25;
  font-weight: 800;
}

.login-form,
.form-panel,
.panel,
.table-panel,
.wallet-hero,
.filters {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-form {
  padding: 22px;
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(20, 27, 36, 0.02);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.11);
}

.primary-button,
.secondary-button,
.nav-item,
.icon-button {
  border: 0;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.primary-button {
  background: var(--accent);
  color: white;
  box-shadow: 0 9px 18px rgba(15, 118, 110, 0.18);
}

.primary-button:hover {
  background: var(--accent-strong);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
}

.secondary-button {
  background: #f7fafb;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.secondary-button:hover {
  background: #fff;
  border-color: #cbd5df;
}

.full {
  width: 100%;
}

.context-grid {
  margin-top: 38px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 820px;
}

.context-grid div {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(220, 227, 234, 0.86);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.context-grid span,
.metric-card span,
.wallet-health span,
.definition-grid span,
.split-rule span,
.trust-header span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.context-grid strong {
  display: block;
  margin-top: 8px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 22px;
  background: var(--surface);
  border-right: 1px solid var(--line-soft);
}

.sidebar nav {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.nav-item {
  text-align: left;
  background: transparent;
  color: var(--muted);
  min-height: 42px;
  padding: 0 14px;
}

.nav-item.active,
.nav-item:hover {
  background: #f4f7f8;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.content {
  padding: 30px;
  min-width: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.page-header p:last-child {
  color: var(--muted);
  margin-bottom: 0;
  line-height: 1.5;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-soft);
}

.metric-card strong {
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.dashboard-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.panel-title {
  padding: 15px 17px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-body {
  padding: 13px;
  display: grid;
  gap: 7px;
}

.activity-row,
.action-row,
.revenue-row,
.site-summary-row {
  width: 100%;
  border: 0;
  background: transparent;
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 11px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.activity-row:hover,
.action-row:hover,
.revenue-row:hover,
.site-summary-row:hover {
  background: var(--surface-3);
  border-color: var(--line-soft);
}

.activity-row small,
.revenue-row small,
.site-summary-row span,
.action-row span,
.timeline p,
.evidence-item p,
.allocation-list span {
  color: var(--muted);
}

.action-row {
  grid-template-columns: 130px 1fr auto;
  align-items: center;
}

.table-panel {
  overflow-x: auto;
  box-shadow: var(--shadow-soft);
}

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

th,
td {
  padding: 14px 15px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--surface-3);
  font-weight: 850;
}

td {
  color: #243142;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #fbfdfd;
}

.table-action-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 34px;
  padding: 0 12px;
  background: #f7fafb;
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.table-action-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.table-action-button.subtle {
  background: #fff;
  color: var(--muted);
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 25px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.74rem;
  font-weight: 800;
  border: 1px solid transparent;
}

.badge.trusted {
  color: var(--green);
  background: #e8f6ef;
  border-color: #d4eddf;
}

.badge.limited {
  color: var(--amber);
  background: #fff4df;
  border-color: #f3ddb1;
}

.badge.unverified {
  color: var(--red);
  background: #feecec;
  border-color: #f6d0d0;
}

.status-pill {
  color: var(--blue);
  background: #eaf0ff;
  border-color: #d8e2ff;
}

.filters {
  padding: 13px;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
}

.form-panel {
  padding: 20px;
}

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

.wide {
  grid-column: 1 / -1;
}

.form-actions,
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.validation-message {
  margin: 14px 0 0;
  color: var(--green);
  font-weight: 800;
}

.validation-message.error {
  color: var(--red);
}

.form-error,
.save-error {
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

.save-error {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #f6d0d0;
  border-radius: 8px;
  background: #fff5f5;
}

.role-note {
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdfd;
  font-weight: 750;
}

.wallet-hero {
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr repeat(3, minmax(140px, 180px));
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.wallet-hero h2 {
  margin: 14px 0 8px;
  font-size: 1.45rem;
}

.wallet-hero p {
  color: var(--muted);
  margin: 0;
}

.wallet-health {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.wallet-health strong {
  display: block;
  margin-top: 8px;
  font-size: 1.25rem;
}

.wallet-detail-page {
  display: grid;
  gap: 13px;
}

.wallet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.wallet-header,
.wallet-panel,
.wallet-money-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.wallet-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.78fr);
  gap: 24px;
  align-items: stretch;
  padding: 25px;
  border-top: 3px solid var(--ink);
  box-shadow: var(--shadow);
}

.wallet-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.wallet-kicker .eyebrow {
  margin-bottom: 0;
}

.wallet-live-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #edf8f4;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid #d6eee3;
}

.wallet-live-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.wallet-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.wallet-title-row h1 {
  margin: 0;
  font-size: clamp(2.5rem, 4.4vw, 4.35rem);
  letter-spacing: 0;
  line-height: 0.98;
}

.wallet-asset-line {
  color: var(--muted);
  margin: 11px 0 0;
  font-size: 1.04rem;
}

.wallet-identity-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.wallet-identity-line span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  background: #fbfcfd;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.wallet-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wallet-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wallet-context-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--surface-3);
  min-height: 82px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.wallet-context-grid span,
.wallet-panel-header span,
.state-grid span,
.split-stack span,
.payout-behavior span,
.trust-blockers span,
.recent-trust span,
.wallet-money-card span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wallet-context-grid strong {
  display: block;
  margin-top: 8px;
  line-height: 1.25;
}

.wallet-money-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
}

.wallet-money-strip.recently-updated .wallet-money-card {
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 14px 34px rgba(15, 118, 110, 0.13);
}

.wallet-money-card {
  position: relative;
  overflow: hidden;
  padding: 15px 16px;
  min-height: 122px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 0;
  box-shadow: var(--shadow-soft);
}

.wallet-money-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--ink);
}

.wallet-money-card::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-2);
}

.wallet-money-card strong {
  display: block;
  margin: 11px 0 7px;
  font-size: clamp(1.55rem, 2.35vw, 2.25rem);
  line-height: 1;
}

.wallet-money-card p {
  color: var(--muted);
  margin: 0;
  font-size: 0.86rem;
}

.wallet-money-card.gross::before {
  background: var(--ink);
}

.wallet-money-card.operator::before,
.wallet-money-card.operator::after {
  background: var(--accent);
}

.wallet-money-card.owner::before,
.wallet-money-card.owner::after {
  background: #334155;
}

.wallet-money-card.reserve::before,
.wallet-money-card.reserve::after {
  background: #8a6817;
}

.wallet-money-card.pending::before,
.wallet-money-card.pending::after {
  background: var(--muted);
}

.wallet-money-card.attention {
  background: #fffdf8;
}

.wallet-money-card.attention::before,
.wallet-money-card.attention::after {
  background: var(--amber);
}

.revenue-confirmation {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) 1.2fr;
  gap: 16px;
  align-items: center;
  background: #f7fbf9;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 118, 110, 0.095);
  padding: 17px 58px 17px 17px;
}

.revenue-confirmation h2 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.revenue-confirmation p {
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

.revenue-confirmation .icon-button {
  position: absolute;
  top: 14px;
  right: 14px;
}

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

.confirmation-grid article {
  background: #fff;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  padding: 9px 10px;
}

.confirmation-grid span,
.value-flow-grid span,
.revenue-rule-preview span,
.form-note {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.confirmation-grid strong,
.value-flow-grid strong,
.revenue-rule-preview strong {
  display: block;
  margin-top: 6px;
}

.wallet-core-grid {
  display: grid;
  grid-template-columns: minmax(430px, 1.1fr) minmax(290px, 0.82fr) minmax(330px, 1fr);
  gap: 13px;
  align-items: start;
}

.wallet-support-grid {
  display: grid;
  grid-template-columns: minmax(460px, 1.08fr) minmax(360px, 0.92fr);
  gap: 13px;
  align-items: start;
}

.wallet-panel {
  padding: 17px;
}

.wallet-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 11px;
}

.wallet-panel-header h2 {
  font-size: 1.05rem;
}

.trust-explanation {
  color: var(--ink);
  line-height: 1.48;
  margin-bottom: 12px;
  font-size: 0.94rem;
}

.trust-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.trust-blockers,
.recent-trust {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: var(--surface-3);
  margin-bottom: 0;
}

.trust-blockers strong,
.recent-trust strong {
  display: block;
  margin-top: 7px;
  line-height: 1.35;
}

.recent-trust small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}

.wallet-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.wallet-check {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  background: #fff;
}

.wallet-check span {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 0.58rem;
  font-weight: 900;
}

.wallet-check strong {
  font-size: 0.86rem;
  line-height: 1.2;
}

.wallet-check.done span {
  background: var(--green);
}

.wallet-check.missing {
  background: #fffaf0;
}

.wallet-check.missing span {
  background: var(--amber);
}

.state-grid,
.split-stack {
  display: grid;
  gap: 8px;
}

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

.state-grid article,
.split-stack article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: var(--surface-3);
}

.state-grid strong,
.split-stack strong {
  display: block;
  margin-top: 7px;
}

.split-visual {
  display: grid;
  grid-template-columns: calc(var(--operator, 70) * 1fr) calc(var(--owner, 20) * 1fr) calc(var(--reserve, 10) * 1fr);
  gap: 5px;
  margin-bottom: 10px;
}

.split-segment {
  min-height: 68px;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  background: var(--ink);
}

.split-segment.operator {
  background: #14524d;
}

.split-segment.owner {
  background: #334155;
}

.split-segment.reserve {
  background: #7c5f19;
}

.split-segment span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.split-segment strong {
  font-size: 1.35rem;
}

.split-stack {
  margin-bottom: 10px;
}

.split-stack article {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
}

.split-stack p {
  grid-column: 1 / -1;
  color: var(--muted);
  margin: 0;
}

.payout-behavior {
  border-top: 1px solid var(--line);
  padding-top: 11px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.payout-behavior div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface-3);
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px;
  align-items: start;
}

.payout-behavior p {
  color: var(--muted);
  margin: 0;
  line-height: 1.35;
}

.activity-stream {
  display: grid;
  gap: 9px;
}

.activity-live-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.activity-live-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-3);
}

.activity-live-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.activity-live-summary strong {
  display: block;
  margin-top: 7px;
}

.activity-live-summary p {
  color: var(--muted);
  margin: 5px 0 0;
  line-height: 1.35;
}

.latest-value-flow.is-new {
  border-color: rgba(15, 118, 110, 0.28);
  background: #f7fbf9;
}

.value-flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.value-flow-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.value-flow-grid span {
  font-size: 0.66rem;
}

.value-flow-grid strong {
  font-size: 0.88rem;
}

.stream-event {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stream-marker {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 900;
}

.stream-event.revenue .stream-marker,
.stream-event.split .stream-marker {
  background: #e8f6ef;
  color: var(--green);
}

.stream-event.trust .stream-marker {
  background: #eaf0ff;
  color: var(--blue);
}

.stream-event.evidence .stream-marker {
  background: #fff4df;
  color: var(--amber);
}

.stream-event.status .stream-marker {
  background: #eef2f5;
  color: #475569;
}

.stream-event-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
}

.stream-event time {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.stream-event p {
  color: var(--muted);
  line-height: 1.4;
  margin: 5px 0 0;
}

.document-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.evidence-form.compact {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.evidence-intro {
  color: var(--muted);
  line-height: 1.45;
  margin: -2px 0 12px;
}

.evidence-form.compact button {
  width: fit-content;
  min-width: 170px;
  white-space: nowrap;
}

.wallet-proof-list {
  margin-top: 12px;
}

.proof-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
}

.proof-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--accent-strong);
  font-weight: 900;
}

.proof-item strong,
.proof-item span {
  display: block;
}

.proof-item span {
  margin-top: 3px;
}

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

.definition-grid div,
.split-rule,
.evidence-item,
.allocation-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}

.definition-grid strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.trust-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.checklist {
  display: grid;
  gap: 9px;
}

.check-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.check-item span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-weight: 900;
}

.check-item.done span {
  background: var(--green);
}

.check-item.missing span {
  background: var(--amber);
}

.evidence-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.evidence-form button {
  align-self: end;
}

.evidence-list,
.allocation-list {
  display: grid;
  gap: 10px;
}

.evidence-item p {
  margin: 8px 0 0;
}

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

.timeline article {
  padding-left: 16px;
  border-left: 3px solid var(--accent);
}

.timeline time {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.timeline p {
  margin: 6px 0 0;
}

.revenue-grid .metric-card {
  min-height: 96px;
  box-shadow: none;
}

.split-rule {
  margin: 14px 0;
}

.split-rule strong {
  display: block;
  margin-top: 8px;
}

.allocation-list article {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 2fr;
  gap: 12px;
}

.allocation-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 27, 36, 0.46);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 20;
  backdrop-filter: blur(4px);
}

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  box-shadow: 0 24px 80px rgba(20, 27, 36, 0.22);
  padding: 21px;
}

.modal header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.revenue-modal {
  width: min(820px, 100%);
}

.modal-subtitle {
  color: var(--muted);
  line-height: 1.45;
  margin: 8px 0 0;
  max-width: 620px;
}

.revenue-rule-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.revenue-rule-preview div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 11px 12px;
}

.form-note {
  margin: 14px 0 0;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}

.icon-button {
  width: 38px;
  padding: 0;
  background: var(--surface-2);
  font-size: 1.35rem;
  box-shadow: none;
}

.icon-button:hover {
  background: #e7edf1;
}

.empty-state {
  color: var(--muted);
  margin: 0;
  padding: 14px;
}

::selection {
  background: rgba(15, 118, 110, 0.16);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.38);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .wallet-header,
  .wallet-core-grid,
  .wallet-support-grid {
    grid-template-columns: 1fr;
  }

  .wallet-money-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .payout-behavior {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .login-screen,
  .app-shell,
  .dashboard-grid,
  .detail-grid,
  .form-grid,
  .filters,
  .context-grid,
  .definition-grid,
  .revenue-grid,
  .evidence-form,
  .allocation-list article {
    grid-template-columns: 1fr;
  }

  .wallet-context-grid,
  .wallet-money-strip,
  .split-visual,
  .trust-meta-row,
  .wallet-checklist,
  .state-grid,
  .activity-live-summary,
  .revenue-confirmation,
  .confirmation-grid,
  .revenue-rule-preview {
    grid-template-columns: 1fr !important;
  }

  .login-context {
    display: none;
  }

  .login-panel {
    padding: 28px;
  }

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

  .content {
    padding: 20px;
  }

  .page-header,
  .trust-header {
    flex-direction: column;
  }

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

  .wallet-hero {
    grid-template-columns: 1fr;
  }

  .wallet-health {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 14px 0 0;
  }

  .wallet-header,
  .wallet-panel {
    padding: 18px;
  }

  .wallet-title-row h1 {
    font-size: 2.35rem;
  }

  .stream-event-top {
    display: grid;
  }

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

@media (max-width: 520px) {
  .metric-grid,
  .allocation-values {
    grid-template-columns: 1fr;
  }
}
