@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800;900&display=swap");

:root {
  --bg: #0d100f;
  --surface: #151a18;
  --surface-soft: #1b2420;
  --ink: #f5fbf8;
  --muted: #9aa7a2;
  --line: #27302d;
  --primary: #63f59b;
  --primary-dark: #102f24;
  --accent: #f7c86a;
  --violet: #8ca0ff;
  --gold: #f1c861;
  --danger: #ff7b6e;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --sidebar: 292px;
  font-family: "Be Vietnam Pro", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(99, 245, 155, 0.13), transparent 36rem),
    radial-gradient(circle at 80% 10%, rgba(140, 160, 255, 0.1), transparent 28rem),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.side-nav {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 28px 22px;
  background: rgba(255, 255, 255, 0.88);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand.compact {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  border-radius: var(--radius);
  font-weight: 900;
}

.brand strong {
  display: block;
  font-size: 1.04rem;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-links {
  display: grid;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--muted);
  border-radius: var(--radius);
  font-weight: 700;
}

.nav-link svg,
.icon-button svg,
.primary-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: 0 0 auto;
}

.nav-link.active,
.nav-link:hover {
  color: var(--primary-dark);
  background: var(--surface-soft);
}

.trust-box {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.trust-box p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.12);
}

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

.mobile-topbar {
  display: none;
}

.screen {
  display: none;
  max-width: 1180px;
  margin: 0 auto;
}

.screen.active-screen {
  display: block;
}

.screen-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.compact-heading {
  align-items: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2.1rem, 3.8vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.22;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.source-pill {
  min-width: 180px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: right;
}

.source-pill span,
.source-pill strong {
  display: block;
}

.source-pill span {
  color: var(--muted);
  font-size: 0.8rem;
}

.source-pill strong {
  margin-top: 2px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.75fr) minmax(240px, 0.75fr);
  gap: 16px;
  align-items: stretch;
}

.summary-panel,
.tool-panel,
.result-panel,
.document-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.summary-panel {
  padding: 22px;
}

.summary-panel p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.highlight-panel {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #f3fbf9 52%, #fff8ee 100%);
}

.panel-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.panel-art {
  display: grid;
  gap: 10px;
  align-content: center;
  min-height: 160px;
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 126px;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: var(--radius);
  background: #f7fbfa;
}

.bar-chart span {
  width: 100%;
  min-height: 22px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--primary), var(--violet));
}

.mini-ledger {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid rgba(184, 92, 56, 0.18);
  border-radius: var(--radius);
  background: #fffaf7;
}

.mini-ledger i {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(184, 92, 56, 0.12));
}

.mini-ledger i:nth-child(2) {
  width: 70%;
}

.mini-ledger i:nth-child(3) {
  width: 48%;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.user-finance-dashboard {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  padding: 18px;
  color: var(--ink);
  background: rgba(21, 26, 24, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dashboard-card-placeholder {
  display: grid;
  gap: 6px;
}

.dashboard-card-placeholder strong {
  color: #fff;
}

.user-finance-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.user-finance-head h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.user-finance-head p {
  max-width: 720px;
  margin: 6px 0 0;
  color: #aeb9b4;
  line-height: 1.45;
}

.user-finance-head .secondary-button {
  flex: 0 0 auto;
  text-decoration: none;
}

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

.user-finance-grid article,
.dashboard-journey-card {
  min-width: 0;
  padding: 14px;
  background: #111614;
  border: 1px solid #27302d;
  border-radius: 10px;
}

.user-finance-grid span,
.dashboard-journey-card small {
  display: block;
  color: #9fa9a5;
  font-size: 0.76rem;
  font-weight: 850;
}

.user-finance-grid strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 1.08rem;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.user-finance-grid small {
  display: block;
  margin-top: 7px;
  color: #aeb9b4;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.user-finance-grid .is-signal {
  border-color: rgba(247, 200, 106, 0.36);
}

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

.dashboard-journey-card {
  display: grid;
  gap: 9px;
}

.dashboard-journey-card > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.dashboard-journey-card strong {
  color: #fff;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.dashboard-journey-card p {
  margin: 0;
  color: #dce6e2;
  font-weight: 850;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.dashboard-journey-card i {
  display: block;
  height: 6px;
  overflow: hidden;
  background: #2d3633;
  border-radius: 999px;
}

.dashboard-journey-card b {
  display: block;
  height: 100%;
  background: #63f59b;
  border-radius: inherit;
}

.action-card {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.action-card:hover {
  border-color: rgba(15, 118, 110, 0.42);
  transform: translateY(-1px);
}

.action-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.action-card strong {
  align-self: end;
  font-size: 1.05rem;
}

.segmented-control {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}
.segmented-control::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.segmented-control button {
  min-height: 38px;
  padding: 8px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 800;
  white-space: nowrap;
  flex: 0 0 auto;
}

.segmented-control button.active {
  color: #fff;
  background: var(--primary);
}

.calc-layout,
.doc-layout {
  display: none;
  grid-template-columns: minmax(330px, 0.78fr) minmax(0, 1.22fr);
  gap: 16px;
  align-items: start;
}

.calc-layout.active,
.doc-layout.active {
  display: grid;
}

.tool-panel,
.result-panel,
.document-preview {
  padding: 22px;
}

.tool-panel {
  display: grid;
  gap: 16px;
}

.panel-title p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 750;
}

fieldset {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.form-section {
  gap: 14px;
  background: linear-gradient(180deg, #fff, #fbfcfc);
}

legend {
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.inline-choice,
.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.form-note {
  margin: 0;
  padding: 10px 12px;
  color: #6d3d05;
  background: #fff5dc;
  border: 1px solid #f0d79c;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.scan-panel .input-row {
  align-items: end;
}

.scan-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

input[readonly] {
  color: #d7fff0;
  background: rgba(99, 245, 155, 0.08);
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

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

input[type="radio"],
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

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

.result-panel {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 16px;
}

.income-dashboard {
  display: grid;
  gap: 14px;
  padding: 18px;
  color: #f4fbf7;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    #111413;
  border: 1px solid #27302d;
  border-radius: 12px;
  box-shadow: 0 28px 90px rgba(7, 13, 11, 0.24);
}

.dashboard-topline,
.income-hero,
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.dash-kicker,
.income-hero span,
.chart-head span,
.live-metrics span,
.insight-grid span {
  color: #9fa9a5;
  font-size: 0.78rem;
  font-weight: 800;
}

.income-dashboard h2 {
  margin-top: 6px;
  color: #fff;
  font-size: 1.45rem;
}

.dash-tabs {
  display: inline-flex;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  scrollbar-width: none;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  background: #191e1c;
  border: 1px solid #2a3330;
  border-radius: 999px;
  -webkit-overflow-scrolling: touch;
}
.dash-tabs::-webkit-scrollbar {
  display: none;
}

.dash-tabs span,
.dash-tabs button {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: #aeb8b4;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.dash-tabs .active,
.dash-tabs button:hover {
  color: #111413;
  background: #f8faf9;
}

.income-hero {
  flex-wrap: wrap;
  padding: 18px;
  background: #151a18;
  border: 1px solid #27302d;
  border-radius: 10px;
}

.income-hero > div {
  min-width: 0;
}

.income-hero > div:first-child {
  flex: 1 1 240px;
}

.income-hero strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

.income-hero small {
  display: block;
  margin-top: 8px;
  color: #aeb8b4;
}

.live-gauges {
  display: grid;
  flex: 1 1 220px;
  min-width: 0;
  gap: 12px;
}

.live-gauges label {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  color: #f4fbf7;
}

.live-gauges label > span,
.live-gauges strong {
  font-size: 0.78rem;
}

.live-gauges i {
  display: block;
  height: 8px;
  overflow: hidden;
  background: #333a37;
  border-radius: 999px;
}

.live-gauges b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #52e581, #7af8a5);
  border-radius: inherit;
}

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

.live-metrics article,
.insight-grid article,
.income-chart-card {
  padding: 14px;
  background: #151a18;
  border: 1px solid #27302d;
  border-radius: 10px;
}

.live-metrics strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 1.08rem;
}

.live-metrics small {
  display: block;
  margin-top: 4px;
  color: #7e8984;
  font-size: 0.75rem;
}

.formula-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
  gap: 12px;
  padding: 14px;
  background: #151a18;
  border: 1px solid #27302d;
  border-radius: 10px;
}

.formula-panel span {
  display: block;
  color: #9fa9a5;
  font-size: 0.78rem;
  font-weight: 850;
}

.formula-panel strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  line-height: 1.35;
}

.formula-panel small {
  display: block;
  margin-top: 8px;
  color: #cfd9d5;
  line-height: 1.45;
}

.formula-panel ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.formula-panel li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #27302d;
}

.formula-panel li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.formula-panel li strong {
  margin-top: 0;
  white-space: nowrap;
}

.income-chart-card {
  display: grid;
  gap: 10px;
}

.chart-head strong {
  display: block;
  margin-top: 3px;
  color: #fff;
}

.income-chart {
  width: 100%;
  height: auto;
  min-height: 210px;
}

.income-chart line {
  stroke: #27302d;
  stroke-width: 1;
}

.income-chart .gross-line,
.income-chart .net-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.income-chart .gross-line {
  stroke: rgba(255, 255, 255, 0.5);
}

.income-chart .net-line {
  stroke: #63f59b;
}

.income-chart circle {
  fill: #63f59b;
  stroke: #111413;
  stroke-width: 2;
}

.income-chart text {
  fill: #77827d;
  font-size: 13px;
  font-weight: 700;
}

.insight-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
}

.income-bars {
  display: flex;
  align-items: end;
  gap: 6px;
  height: 112px;
  margin-top: 12px;
}

.income-bars span {
  flex: 1;
  min-width: 6px;
  background: linear-gradient(180deg, #63f59b, rgba(99, 245, 155, 0.18));
  border-radius: 999px 999px 3px 3px;
}

.insight-grid ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.finance-review-card ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.insight-grid li {
  color: #dce6e2;
  font-size: 0.86rem;
  line-height: 1.45;
}

.finance-review-card li {
  color: #dce6e2;
  font-size: 0.86rem;
  line-height: 1.45;
}

.result-total {
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius);
}

.result-total span {
  display: block;
  opacity: 0.82;
  font-size: 0.88rem;
  font-weight: 800;
}

.result-total strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
  line-height: 1.05;
}

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

.metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.15rem;
}

.breakdown {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  color: var(--muted);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.breakdown li:last-child {
  border-bottom: 0;
}

.breakdown strong {
  color: var(--ink);
  white-space: nowrap;
}

/* Salary dashboard alignment and overflow hardening */
.income-dashboard {
  container-type: inline-size;
  overflow: hidden;
}

.income-dashboard,
.income-dashboard * {
  min-width: 0;
  box-sizing: border-box;
}

.income-dashboard strong {
  font-variant-numeric: tabular-nums;
}

.dashboard-topline {
  align-items: start;
}

.dashboard-topline > div:first-child,
.income-hero > div:first-child,
.chart-head > div {
  min-width: 0;
}

.income-dashboard h2,
.income-hero small,
.formula-panel strong,
.formula-panel small,
.live-metrics small,
.insight-grid li,
.finance-review-card li {
  overflow-wrap: anywhere;
}

.income-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.72fr);
  align-items: start;
}

.income-hero > div:first-child {
  max-width: 100%;
}

.income-hero strong {
  max-width: 100%;
  font-size: clamp(2.15rem, 8cqw, 4.05rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.live-gauges {
  width: 100%;
}

.live-metrics {
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
}

.live-metrics article {
  display: grid;
  align-content: start;
}

.live-metrics strong {
  font-size: clamp(0.98rem, 3.4cqw, 1.12rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.formula-panel {
  align-items: start;
}

.formula-panel > div,
.formula-panel ul {
  min-width: 0;
}

.formula-panel li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
}

.formula-panel li strong {
  min-width: max-content;
  max-width: 100%;
  text-align: right;
  white-space: normal;
}

.chart-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
}

.chart-head strong {
  overflow-wrap: anywhere;
}

.breakdown li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
}

.breakdown strong {
  text-align: right;
  white-space: normal;
}

@container (max-width: 720px) {
  .dashboard-topline,
  .income-hero {
    grid-template-columns: 1fr;
  }

  .income-hero {
    gap: 16px;
  }

  .income-hero strong {
    font-size: clamp(2.05rem, 11cqw, 3.35rem);
  }

  .formula-panel,
  .insight-grid {
    grid-template-columns: 1fr;
  }

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

  .finance-roadmap-head div:nth-child(2n) {
    border-right: 0;
  }

  .finance-roadmap-head div:nth-child(n + 3) {
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .chart-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.notice {
  padding: 12px;
  border-radius: var(--radius);
  color: var(--primary-dark);
  background: var(--surface-soft);
  line-height: 1.45;
}

.notice.warning {
  color: #6d3d05;
  background: #fff3d8;
}

.notice.danger {
  color: var(--danger);
  background: #fff0ee;
}

.search-box {
  min-width: min(360px, 100%);
}

.search-box span {
  color: var(--muted);
  font-size: 0.82rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.legal-sync-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(21, 26, 24, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.legal-sync-strip strong,
.legal-sync-strip small {
  display: block;
}

.legal-sync-strip small {
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
}

.legal-sync-strip .secondary-button {
  min-height: 36px;
  padding: 7px 12px;
}

.finance-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
  align-items: start;
}

.finance-dashboard {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.finance-live {
  padding: 18px;
}

.finance-view-tabs {
  justify-content: flex-end;
}

.finance-tab-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.finance-roadmap-head {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.finance-roadmap-head div {
  min-width: 0;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.finance-roadmap-head div:last-child {
  border-right: 0;
}

.finance-roadmap-head span,
.finance-chart-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.finance-roadmap-head strong,
.finance-chart-summary strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: clamp(0.95rem, 2vw, 1.18rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.finance-chart-wrap {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.finance-chart-legend,
.finance-chart-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
}

.finance-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.finance-chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.nominal-dot {
  background: #63f59b;
}

.real-dot {
  background: rgba(255, 255, 255, 0.6);
}

.target-dot {
  background: #f7c86a;
}

.finance-chart-summary {
  justify-content: flex-start;
}

.finance-chart {
  width: 100%;
  min-height: 260px;
  overflow: visible;
}

.finance-chart line {
  stroke: #27302d;
  stroke-width: 1;
}

.finance-chart .target-line {
  stroke: rgba(247, 200, 106, 0.75);
  stroke-dasharray: 7 7;
}

.finance-chart .finance-nominal,
.finance-chart .finance-real {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.finance-chart .finance-nominal {
  stroke: #63f59b;
}

.finance-chart .finance-real {
  stroke: rgba(255, 255, 255, 0.58);
}

.finance-chart .finance-marker {
  fill: var(--panel);
  stroke: #63f59b;
  stroke-width: 2.5;
}

.finance-chart text {
  fill: #77827d;
  font-size: 13px;
  font-weight: 750;
}

.finance-chart .axis-y {
  text-anchor: end;
}

.finance-chart .axis-x {
  fill: #8d9893;
}

.finance-chart .target-label {
  fill: #f7c86a;
}

.allocation-bars {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.allocation-bars div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 44px;
  align-items: center;
  gap: 10px;
}

.allocation-bars i {
  display: block;
  height: 9px;
  overflow: hidden;
  background: #333a37;
  border-radius: 999px;
}

.allocation-bars b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #63f59b, #8ca0ff);
  border-radius: inherit;
}

.allocation-bars strong {
  color: #fff;
  text-align: right;
  font-size: 0.84rem;
}

.allocation-total {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.allocation-total.is-balanced strong {
  color: #6ff0a4;
}

.allocation-total.is-warning strong,
.allocation-total.is-warning span {
  color: #ffd47a;
}

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

.finance-detail-grid article,
.finance-note,
.finance-review-card {
  padding: 14px;
  background: #151a18;
  border: 1px solid #27302d;
  border-radius: 10px;
}

.finance-detail-grid span,
.finance-note span,
.finance-review-card > span {
  display: block;
  color: #9fa9a5;
  font-size: 0.78rem;
  font-weight: 800;
}

.finance-detail-grid strong,
.finance-note strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 1.03rem;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.finance-detail-grid small {
  display: block;
  margin-top: 5px;
  color: #7e8984;
  line-height: 1.35;
}

.finance-note {
  display: grid;
  gap: 6px;
  border-color: rgba(247, 200, 106, 0.28);
  background: rgba(247, 200, 106, 0.08);
}

.finance-note span {
  color: #f3dbad;
  line-height: 1.45;
}

.profile-panel {
  display: grid;
  gap: 16px;
  padding: 16px;
  background: #151a18;
  border: 1px solid #27302d;
  border-radius: 10px;
}

.profile-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
  min-width: 0;
}

.profile-panel h3 {
  margin-top: 4px;
  color: #fff;
  font-size: 1.15rem;
}

.profile-key {
  min-width: 150px;
  padding: 10px 12px;
  background: #0f1412;
  border: 1px solid #27302d;
  border-radius: 9px;
}

.profile-key span,
.profile-status {
  display: block;
  color: #9fa9a5;
  font-size: 0.76rem;
  font-weight: 800;
}

.profile-key strong {
  display: block;
  margin-top: 4px;
  color: #63f59b;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

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

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

.profile-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 10px;
  color: #dce6e2;
  background: #101512;
  border: 1px solid #27302d;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 800;
}

.profile-checks input {
  width: 16px;
  height: 16px;
  accent-color: #63f59b;
}

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

.profile-status {
  margin: 0;
  padding: 10px 12px;
  background: #0f1412;
  border: 1px solid #27302d;
  border-radius: 9px;
  line-height: 1.42;
}

.profile-status.success {
  color: #9df0b8;
  border-color: rgba(99, 245, 155, 0.45);
}

.profile-status.error {
  color: #ffd0c7;
  border-color: rgba(255, 119, 95, 0.5);
}

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

.signal-item {
  padding: 14px;
  background: #151a18;
  border: 1px solid #27302d;
  border-radius: 10px;
}

.signal-item span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  color: #0d100f;
  background: #9fa9a5;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.signal-item strong {
  display: block;
  margin-top: 10px;
  color: #fff;
  line-height: 1.18;
}

.signal-item p {
  margin: 7px 0 0;
  color: #b8c4bf;
  line-height: 1.42;
}

.signal-item.is-warning {
  border-color: rgba(247, 200, 106, 0.45);
}

.signal-item.is-warning span {
  background: #f7c86a;
}

.signal-item.is-success {
  border-color: rgba(99, 245, 155, 0.45);
}

.signal-item.is-success span {
  background: #63f59b;
}

.signal-item.is-info span {
  background: #8ca0ff;
}

.goal-journey {
  display: grid;
  gap: 18px;
  padding: 16px;
  background: #151a18;
  border: 1px solid #27302d;
  border-radius: 10px;
}

.journey-head,
.journey-track header,
.journey-step > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.journey-head span,
.journey-track small,
.journey-step small {
  color: #9fa9a5;
  font-size: 0.76rem;
  font-weight: 800;
}

.journey-head h3 {
  margin-top: 4px;
  color: #fff;
  font-size: 1.1rem;
}

.journey-head strong {
  color: #63f59b;
  white-space: nowrap;
}

.journey-track {
  display: grid;
  gap: 10px;
}

.journey-track header > div {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.journey-track header strong {
  color: #fff;
}

.track-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #0d100f;
  background: #63f59b;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 950;
}

.journey-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(172px, 190px);
  align-items: stretch;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.journey-step {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 128px;
  padding: 12px;
  border: 1px solid #31413b;
  border-radius: 10px;
  background: #111614;
}

.journey-step::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -15px;
  width: 14px;
  height: 1px;
  background: #31413b;
}

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

.journey-step h4 {
  margin: 10px 0 8px;
  color: #fff;
  font-size: 0.88rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.journey-step small {
  overflow-wrap: anywhere;
}

.step-level,
.step-state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 950;
}

.step-level {
  color: #0d100f;
  background: rgba(99, 245, 155, 0.9);
}

.step-state {
  color: #dce6e2;
  background: rgba(255, 255, 255, 0.08);
}

.journey-step i {
  display: block;
  height: 5px;
  margin-top: 10px;
  overflow: hidden;
  background: #2d3633;
  border-radius: 999px;
}

.journey-step b {
  display: block;
  height: 100%;
  background: #63f59b;
  border-radius: inherit;
}

.journey-step.is-active {
  border-color: #f7c86a;
}

.journey-step.is-active .step-state,
.journey-step.is-active b {
  color: #0d100f;
  background: #f7c86a;
}

.journey-step.is-locked {
  opacity: 0.48;
}

.finance-intel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.finance-intel-grid:empty {
  display: none;
}

.finance-intel-card {
  min-height: 180px;
}

.chip {
  min-height: 36px;
  padding: 8px 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
}

.chip.active,
.chip:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

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

.rule-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.rule-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.rule-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.52;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  color: var(--primary-dark);
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.source-link {
  color: var(--primary);
  font-weight: 850;
}

.document-preview {
  position: sticky;
  top: 24px;
  min-height: 640px;
  overflow: auto;
  background: #eef2f3;
}

.doc-sheet {
  display: grid;
  gap: 14px;
  width: min(100%, 794px);
  min-height: 1122px;
  margin: 0 auto;
  padding: 46px 52px;
  color: #111;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 18px 55px rgba(17, 24, 39, 0.08);
  font-family: "Times New Roman", Times, serif;
  font-size: 0.98rem;
  line-height: 1.45;
}

.doc-sheet h2 {
  text-transform: uppercase;
  text-align: center;
  font-size: 1.2rem;
  line-height: 1.25;
}

.doc-sheet h3 {
  margin-top: 10px;
  font-family: "Times New Roman", Times, serif;
  font-size: 1rem;
}

.doc-sheet p {
  margin: 0;
}

.national {
  text-align: center;
  font-weight: 700;
  line-height: 1.4;
}

.national span {
  display: block;
}

.doc-title {
  display: grid;
  gap: 4px;
  text-align: center;
}

.doc-title h2 {
  font-size: 1.22rem;
}

.doc-title small {
  color: #333;
  font-style: italic;
}

.doc-meta {
  display: grid;
  gap: 8px;
}

.doc-line {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}

.doc-line span {
  color: var(--muted);
  font-weight: 800;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.doc-table th,
.doc-table td {
  padding: 7px 8px;
  border: 1px solid #bfc9c5;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.doc-table th {
  background: #eef5f3;
  font-weight: 700;
}

.party-table td:first-child {
  width: 32%;
  color: #3d4744;
  font-weight: 700;
}

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

.tax-pill {
  padding: 10px;
  border: 1px solid #bfc9c5;
  background: #f8fbfa;
}

.tax-pill span {
  display: block;
  color: #586561;
  font-size: 0.82rem;
  font-family: "Be Vietnam Pro", sans-serif;
}

.tax-pill strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
}

.legal-alerts {
  display: grid;
  gap: 8px;
}

.legal-alert {
  padding: 10px 12px;
  border-left: 4px solid var(--gold);
  background: #fff8e7;
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 0.84rem;
  line-height: 1.45;
}

.legal-alert.ok {
  border-left-color: var(--primary);
  background: #edf8f5;
}

.appendix-box {
  padding: 12px;
  border: 1px dashed #8aa39b;
  background: #fbfdfc;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  margin-top: 18px;
  text-align: center;
  font-weight: 800;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 16px;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: var(--radius);
  font-weight: 900;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 16px;
  color: var(--primary-dark);
  background: #fff;
  border: 1px solid rgba(8, 123, 116, 0.35);
  border-radius: var(--radius);
  font-weight: 900;
}

.secondary-button:hover {
  background: var(--surface-soft);
}

.primary-button svg,
.secondary-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* System-wide dark dashboard skin. The printable A4 sheet stays white below. */
.side-nav {
  background: rgba(14, 18, 16, 0.88);
}

.brand-mark {
  color: #0d100f;
}

.nav-link.active,
.nav-link:hover {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(99, 245, 155, 0.16), rgba(140, 160, 255, 0.08));
}

.trust-box,
.source-pill,
.summary-panel,
.tool-panel,
.result-panel,
.action-card,
.segmented-control,
.rule-card,
.metric,
.chip,
.icon-button {
  background: rgba(21, 26, 24, 0.94);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.highlight-panel {
  background: linear-gradient(135deg, rgba(99, 245, 155, 0.14), rgba(21, 26, 24, 0.98) 42%, rgba(247, 200, 106, 0.09));
}

.bar-chart,
.mini-ledger,
.form-section,
.breakdown li {
  background: #111614;
}

.bar-chart {
  border-color: rgba(99, 245, 155, 0.18);
}

.bar-chart span {
  background: linear-gradient(180deg, var(--primary), rgba(140, 160, 255, 0.76));
}

.mini-ledger {
  border-color: rgba(247, 200, 106, 0.2);
}

.mini-ledger i {
  background: linear-gradient(90deg, var(--accent), rgba(247, 200, 106, 0.12));
}

input,
select,
textarea {
  color: var(--ink);
  background: #101412;
  border-color: var(--line);
}

input::placeholder,
textarea::placeholder {
  color: #6f7c77;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 245, 155, 0.12);
}

.segmented-control button.active,
.chip.active,
.chip:hover,
.primary-button {
  color: #0d100f;
  background: var(--primary);
}

.secondary-button {
  color: var(--ink);
  background: #101412;
  border-color: rgba(99, 245, 155, 0.35);
}

.secondary-button:hover {
  background: var(--surface-soft);
}

.result-total {
  color: #0d100f;
  background: linear-gradient(135deg, #63f59b, #8ca0ff);
}

.breakdown,
.breakdown li {
  border-color: var(--line);
}

.breakdown strong {
  color: var(--ink);
}

.notice {
  color: #d8fff0;
  background: rgba(99, 245, 155, 0.11);
}

.notice.warning,
.form-note {
  color: #f7d99a;
  background: rgba(247, 200, 106, 0.1);
  border: 1px solid rgba(247, 200, 106, 0.28);
}

.notice.danger {
  color: #ffb3aa;
  background: rgba(255, 123, 110, 0.1);
}

.tag {
  color: #d8fff0;
  background: rgba(99, 245, 155, 0.12);
}

.source-link,
.panel-kicker,
.eyebrow {
  color: var(--primary);
}

.document-preview {
  background: #0f1312;
}

.doc-sheet {
  color: #111;
  background: #fff;
}

.doc-sheet h2,
.doc-sheet h3,
.doc-sheet p,
.doc-sheet strong,
.doc-table {
  color: #111;
}

.doc-table th {
  color: #111;
}

.appendix-box {
  color: #111;
}

@media (max-width: 1080px) {
  .hero-grid,
  .quick-actions,
  .user-finance-grid,
  .dashboard-journey-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .highlight-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: fixed;
    z-index: 20;
    width: min(310px, 92vw);
    transform: translateX(-105%);
    transition: transform 160ms ease;
  }

  .side-nav.open {
    transform: translateX(0);
  }

  .main-content {
    padding: 16px;
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -16px -16px 24px;
    padding: 12px 16px;
    background: rgba(245, 247, 251, 0.9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .screen-heading,
  .compact-heading {
    display: grid;
  }

  h1 {
    font-size: 2.25rem;
  }

  .source-pill {
    text-align: left;
  }

  .calc-layout,
  .doc-layout,
  .finance-layout {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }

  .document-preview {
    position: static;
    min-height: auto;
  }

  .rules-grid {
    grid-template-columns: 1fr;
  }

  .finance-intel-grid {
    grid-template-columns: 1fr;
  }

  .signal-list {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .hero-grid,
  .quick-actions,
  .user-finance-grid,
  .dashboard-journey-list,
  .input-row,
  .metric-grid,
  .signature-grid,
  .finance-roadmap-head,
  .finance-detail-grid,
  .finance-intel-grid,
  .profile-grid,
  .profile-checks {
    grid-template-columns: 1fr;
  }

  .highlight-panel {
    grid-template-columns: 1fr;
  }

  .segmented-control {
    width: 100%;
    overflow-x: auto;
  }

  .segmented-control button {
    flex: 1 0 auto;
  }

  .doc-sheet {
    min-height: auto;
    padding: 24px 18px;
    font-size: 0.9rem;
  }

  .doc-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .tax-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-topline,
  .income-hero,
  .user-finance-head,
  .chart-head {
    align-items: stretch;
    flex-direction: column;
  }

  .user-finance-head .secondary-button {
    width: 100%;
    text-align: center;
  }

  .dash-tabs {
    overflow-x: auto;
    max-width: 100%;
  }

  .live-metrics,
  .formula-panel,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .allocation-bars div {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .finance-roadmap-head div,
  .finance-roadmap-head div:nth-child(n + 3) {
    padding: 0 0 10px;
    border-top: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .finance-roadmap-head div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .allocation-bars strong {
    text-align: left;
  }

  .journey-head,
  .journey-track header {
    align-items: flex-start;
    flex-direction: column;
  }

  .journey-row {
    grid-auto-columns: minmax(170px, 76vw);
  }

  .profile-panel header,
  .profile-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-key {
    min-width: 0;
  }

  .profile-actions button {
    width: 100%;
  }

  .legal-sync-strip {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .legal-sync-strip .secondary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .button-row,
  .button-row button {
    width: 100%;
  }
}

@media (max-width: 880px) {
  .mobile-topbar {
    background: rgba(14, 18, 16, 0.92);
  }
}

/* Custom Drawflow Theme - Dark Mode */
.drawflow .drawflow-node {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.drawflow .drawflow-node.selected > div {
  outline: 2px solid var(--primary);
}
.drawflow .drawflow-node .inputs .input {
  background: var(--surface);
  border: 2px solid var(--primary);
  width: 14px;
  height: 14px;
  left: -8px;
}
.drawflow .drawflow-node .outputs .output {
  background: var(--surface);
  border: 2px solid var(--primary);
  width: 14px;
  height: 14px;
  right: -8px;
}
.drawflow .connection .main-path {
  stroke: #718096;
  stroke-width: 2px;
}
.drawflow .connection .point {
  stroke: #718096;
  stroke-width: 2;
  fill: #2d3748;
}
