:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #667085;
  --line: #d9e1e8;
  --panel: #ffffff;
  --paper: #f4f7f8;
  --nav: #14213d;
  --accent: #0f8b8d;
  --accent-2: #f25c54;
  --gold: #f4b942;
  --ok: #167a4a;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

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

.auth-shell {
  align-items: center;
  background: linear-gradient(135deg, #eef7f7 0%, #f8fafc 55%, #ffffff 100%);
  display: flex;
  grid-column: 1 / -1;
  justify-content: center;
  min-height: 100vh;
  padding: 28px;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(20, 33, 61, 0.14);
  display: grid;
  gap: 18px;
  max-width: 520px;
  padding: 30px;
  width: 100%;
}

.auth-card h1 {
  color: var(--nav);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-message {
  background: #fff8e6;
  border: 1px solid #fedf89;
  border-radius: 8px;
  color: #93370d;
  margin: 0;
  padding: 11px 12px;
}

.auth-switch {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.auth-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
}

.account-bar {
  align-items: center;
  background: #f8fbfb;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 11px 14px;
}

.account-bar div {
  display: grid;
  gap: 3px;
}

.account-bar span {
  color: var(--muted);
  font-size: 12px;
}

.shell-nav {
  background: var(--nav);
  color: #fff;
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: grid;
  gap: 2px;
  padding: 0 10px 22px;
  letter-spacing: 0;
}

.brand span {
  color: #9fd8d9;
  font-size: 13px;
  font-weight: 800;
}

.brand strong {
  font-size: 25px;
}

.nav-button,
.primary,
.secondary,
.icon {
  border: 0;
  cursor: pointer;
}

.nav-button {
  color: #d9e6ef;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  border-radius: 6px;
}

.nav-button.active,
.nav-button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.workspace {
  padding: 28px;
  max-width: 1320px;
  width: 100%;
}

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

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 6px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 34px;
}

h2 {
  font-size: 18px;
}

.month-chip {
  background: #e5f4f4;
  color: #075e61;
  padding: 9px 12px;
  border-radius: 6px;
  font-weight: 800;
}

.terms-overlay {
  align-items: center;
  background: rgba(20, 33, 61, 0.72);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 22px;
  position: fixed;
  z-index: 20;
}

.terms-modal {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 28px 70px rgba(20, 33, 61, 0.32);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(88vh, 820px);
  max-width: 920px;
  overflow: hidden;
  width: min(100%, 920px);
}

.terms-modal-head {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 20px 22px 14px;
}

.terms-modal-head h2 {
  color: var(--nav);
  font-size: 24px;
  margin-bottom: 4px;
}

.terms-close {
  color: var(--danger);
  font-size: 18px;
}

.terms-content {
  color: var(--ink);
  line-height: 1.52;
  overflow: auto;
  padding: 18px 22px;
}

.terms-content h3 {
  color: var(--nav);
  font-size: 15px;
  margin: 18px 0 7px;
}

.terms-content h3:first-child {
  margin-top: 0;
}

.terms-content p {
  font-size: 13px;
  margin-bottom: 10px;
}

.terms-content a {
  color: var(--accent);
  font-weight: 800;
}

.terms-actions {
  align-items: center;
  background: #f8fafc;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px 22px;
}

.terms-actions p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.terms-actions small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 4px;
  max-width: 520px;
}

.alerts {
  border-left: 4px solid var(--accent-2);
  background: #fff2f0;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.alerts p {
  margin: 4px 0;
}

.dashboard-workspace {
  max-width: 1180px;
}

.dashboard-board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px 10px;
}

.dashboard-header {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 28px;
  justify-content: space-between;
  margin-bottom: 5px;
  padding-bottom: 8px;
}

.board-heading {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.dashboard-brand {
  align-items: center;
  display: flex;
  font-size: 19px;
  font-weight: 800;
  gap: 10px;
}

.dashboard-brand span {
  background: var(--accent);
  border-radius: 2px;
  display: block;
  height: 22px;
  width: 6px;
}

.dashboard-month-reset {
  align-items: center;
  background: #fff8f7;
  border: 1px solid #f3b5ae;
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 8px 0 10px;
  padding: 10px 12px;
}

.dashboard-month-reset strong {
  color: var(--danger);
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}

.dashboard-month-reset p {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
}

.dashboard-month-reset button {
  flex: 0 0 auto;
}

.period-data {
  display: flex;
  gap: 22px;
  margin: 0;
}

.period-data div {
  display: grid;
  gap: 2px;
}

.period-data dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.period-data dd {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}

.dashboard-table-wrap {
  overflow-x: auto;
}

.dashboard-summary {
  table-layout: fixed;
}

.dashboard-summary th:first-child {
  width: 21%;
}

.dashboard-summary th:nth-child(2),
.dashboard-summary th:nth-child(3) {
  width: 29%;
}

.dashboard-summary th:last-child {
  width: 21%;
}

.dashboard-summary td {
  height: 41px;
  padding-bottom: 5px;
  padding-top: 5px;
}

.concept-name {
  font-weight: 800;
}

.dashboard-values {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
}

.dashboard-values span {
  display: grid;
  gap: 1px;
  min-width: 78px;
}

.dashboard-values small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.dashboard-values strong {
  font-size: 14px;
}

.evaluation {
  align-items: center;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
  white-space: nowrap;
}

.evaluation.problem {
  color: var(--danger);
}

.evaluation.watch {
  color: #9a6700;
}

.evaluation.good {
  color: var(--ok);
}

.signal-dot {
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  height: 11px;
  width: 11px;
}

.signal-dot.problem {
  background: #d92d4f;
}

.signal-dot.watch {
  background: #f4b942;
}

.signal-dot.good {
  background: #29b56f;
}

.table-section-row td {
  background: #f5f8fa;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  height: auto;
  padding: 6px 10px;
  text-transform: uppercase;
}

.detail-row td {
  font-size: 13px;
  height: 32px;
  padding-bottom: 4px;
  padding-top: 4px;
}

.detail-name {
  display: inline-block;
  font-weight: 700;
  margin-right: 9px;
}

.detail-name::before {
  color: var(--muted);
  content: "\2022";
  margin-right: 8px;
}

.credit-card-structure td {
  border-top: 1px solid #c8d2dc;
  height: 40px;
}

.financial-status {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px 20px;
  grid-template-columns: 160px minmax(230px, 430px) 1fr;
  margin-top: 5px;
  padding-top: 10px;
}

.financial-status h2 {
  align-items: center;
  display: flex;
  gap: 8px;
  font-size: 14px;
  margin: 0;
  text-transform: uppercase;
}

.financial-status h2 span {
  background: var(--accent);
  display: block;
  height: 18px;
  width: 5px;
}

.status-scale {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 12px;
  margin: 0 8px 11px;
  max-width: 490px;
  position: relative;
}

.status-scale i:first-child {
  background: #29b56f;
  border-radius: 99px 0 0 99px;
}

.status-scale i.watch {
  background: #f4b942;
}

.status-scale i.problem {
  background: #d92d4f;
  border-radius: 0 99px 99px 0;
}

.status-scale b {
  border-color: var(--ink) transparent transparent;
  border-style: solid;
  border-width: 9px 6px 0;
  bottom: -13px;
  display: block;
  position: absolute;
  transform: translateX(-50%);
}

.financial-values {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.financial-values p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.financial-values strong {
  color: var(--ink);
  margin-left: 7px;
}

.dashboard-alerts {
  background: #fff7ed;
  border-left: 3px solid var(--gold);
  margin-top: 9px;
  padding: 7px 10px;
}

.dashboard-alerts p {
  font-size: 13px;
  margin: 3px 0;
}

.data-quality-notice {
  align-items: stretch;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-left: 5px solid #f97316;
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.data-quality-notice strong {
  color: #9a3412;
  display: block;
  font-size: 14px;
  margin-bottom: 3px;
}

.data-quality-notice p {
  color: #7c2d12;
  font-size: 13px;
  margin: 3px 0;
}

.notice-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.data-quality-notice button,
.balance-correction-head button {
  flex: 0 0 auto;
}

.action-suggestions {
  margin-top: 12px;
}

.action-suggestions-dashboard {
  background: #f8fbff;
  border-color: #b7d4ee;
  box-shadow: 0 8px 20px rgba(20, 33, 61, 0.08);
}

.action-suggestions h2 {
  color: var(--nav);
  font-size: 16px;
  margin: 0 0 6px;
}

.action-suggestions ul {
  display: grid;
  gap: 9px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.action-suggestions li {
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
}

.action-suggestions li strong {
  color: var(--ink);
  font-size: 13px;
}

.action-suggestions li span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.action-suggestions .suggestion-good {
  background: #f2fbf5;
  border-color: #29b56f;
}

.action-suggestions .suggestion-watch {
  background: #fffaf0;
  border-color: #f4b942;
}

.action-suggestions .suggestion-problem {
  background: #fff8f7;
  border-color: #d92d4f;
}

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

.help-intro {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.help-intro h2 {
  color: var(--nav);
  font-size: 24px;
  margin: 2px 0 6px;
}

.help-scope {
  background: #e8fbf5;
  border: 1px solid #9ee6cf;
  border-radius: 999px;
  color: #047857;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
}

.help-chat {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  max-height: 430px;
  overflow: auto;
  padding: 14px;
}

.help-message {
  border-radius: 12px;
  display: grid;
  gap: 4px;
  max-width: 78%;
  padding: 11px 13px;
}

.help-message span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.help-message p {
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
}

.help-assistant {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--ink);
  justify-self: start;
}

.help-assistant span {
  color: var(--accent);
}

.help-user {
  background: var(--nav);
  color: #ffffff;
  justify-self: end;
}

.help-user span {
  color: #bff4ee;
}

.help-form {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

.help-start-guide {
  align-items: center;
  background: #f0fbfb;
  border: 1px solid #b7e5e6;
  border-radius: 12px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 12px 14px;
}

.help-start-guide div {
  display: grid;
  gap: 3px;
}

.help-start-guide strong {
  color: var(--nav);
  font-size: 14px;
}

.help-start-guide span {
  color: var(--muted);
  font-size: 13px;
}

.help-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  padding: 12px 14px;
}

.help-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.help-actions {
  display: flex;
  justify-content: flex-end;
}

.help-quick button {
  flex: 0 0 auto;
}

.help-disclaimer {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.help-current ul {
  display: grid;
  gap: 9px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.help-current li {
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
}

.help-current .suggestion-good {
  background: #f2fbf5;
  border-color: #29b56f;
}

.help-current .suggestion-watch {
  background: #fffaf0;
  border-color: #f4b942;
}

.help-current .suggestion-problem {
  background: #fff8f7;
  border-color: #d92d4f;
}

.help-current li strong {
  color: var(--ink);
  font-size: 13px;
}

.help-current li span {
  color: var(--muted);
  font-size: 13px;
}

.balance-correction-panel {
  background: #fff8f7;
  border-color: #fecaca;
  border-left: 6px solid #d92d4f;
}

.balance-correction-head {
  align-items: flex-start;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.balance-correction-head h2 {
  color: #991b1b;
  font-size: 17px;
  margin: 0 0 4px;
}

.balance-correction-head p {
  color: #7f1d1d;
  font-size: 13px;
  margin: 0;
}

.balance-difference-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0;
}

.balance-difference-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.balance-difference-grid article span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.balance-difference-grid article strong {
  display: block;
  font-size: 18px;
  margin-top: 4px;
}

.balance-difference-grid article.ok {
  background: #f2fbf5;
  border-color: #bbf7d0;
}

.balance-difference-grid article.danger {
  background: #fff1f2;
  border-color: #fecdd3;
}

.balance-correction-panel h3 {
  color: var(--ink);
  font-size: 14px;
  margin: 8px 0;
}

.balance-correction-panel ol {
  color: #7f1d1d;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
  padding-left: 21px;
}

.balance-correction-panel li + li {
  margin-top: 5px;
}

.group-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.signal-guide {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 20px;
  margin-top: 9px;
  padding-top: 8px;
}

.signal-guide h2 {
  font-size: 12px;
  margin: 0 8px 0 0;
  text-transform: uppercase;
}

.signal-guide p {
  align-items: center;
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 8px;
  margin: 0;
}

.budget-sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 880px;
  padding: 16px 20px;
}

.budget-title {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 10px;
}

.budget-title input {
  max-width: 170px;
}

.budget-section {
  margin-top: 14px;
}

.budget-section h2 {
  border-left: 4px solid var(--accent);
  font-size: 14px;
  margin: 0 0 4px;
  padding-left: 8px;
  text-transform: uppercase;
}

.budget-simple,
.budget-expenses {
  table-layout: fixed;
}

.budget-simple th:first-child {
  width: 42%;
}

.budget-simple th:nth-child(2) {
  width: 22%;
}

.budget-simple th:nth-child(3) {
  width: 18%;
}

.budget-simple th:nth-child(4) {
  width: 18%;
}

.setup-review-table th:first-child,
.setup-review-table td:first-child {
  width: 33%;
}

.setup-review-table th:nth-child(2),
.setup-review-table td:nth-child(2) {
  width: 24%;
}

.setup-review-table th:nth-child(3),
.setup-review-table td:nth-child(3) {
  width: 21%;
}

.setup-review-table th:nth-child(4),
.setup-review-table td:nth-child(4) {
  text-align: center;
  width: 22%;
}

.budget-simple th,
.budget-expenses th {
  font-size: 10px;
  padding: 4px 7px;
}

.budget-simple td,
.budget-expenses td {
  height: 33px;
  padding: 3px 7px;
}

.inline-field {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  max-width: 100%;
  width: 100%;
}

.inline-field input,
.budget-expenses input {
  border-color: transparent;
  background: #f7fafb;
  border-radius: 4px;
  height: 28px;
  padding: 4px 7px;
}

.inline-field input:focus,
.budget-expenses input:focus {
  background: #fff;
  border-color: var(--accent);
  outline: none;
}

.setup-review-table td:nth-child(2) .inline-field input,
.budget-expenses td:nth-child(3) input,
.budget-expenses td:nth-child(4) input {
  width: 100%;
}

.setup-review-table td:nth-child(3),
.budget-expenses td:nth-child(4),
.budget-expenses td:nth-child(5) {
  text-align: center;
}

.budget-expenses td:nth-child(2) {
  text-align: center;
}

.field-suffix {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.calculated-mark {
  color: var(--muted);
  font-weight: 700;
}

.budget-total-row td {
  background: #f5f8fa;
  border-top: 1px solid var(--line);
  font-weight: 800;
}

.budget-total-row td:nth-child(2) {
  color: var(--accent);
  font-size: 15px;
}

.total-expenses-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.budget-section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.budget-section-head h2 {
  margin-bottom: 0;
}

.add-concept {
  font-size: 12px;
  padding: 5px 9px;
}

.budget-expenses th:first-child,
.budget-expenses td:first-child {
  width: 34%;
}

.budget-expenses th:nth-child(2),
.budget-expenses td:nth-child(2) {
  width: 8%;
}

.budget-expenses th:nth-child(3),
.budget-expenses td:nth-child(3) {
  width: 20%;
}

.budget-expenses th:nth-child(4),
.budget-expenses td:nth-child(4) {
  width: 11%;
}

.budget-expenses th:nth-child(5),
.budget-expenses td:nth-child(5) {
  text-align: center;
  width: 17%;
}

.budget-expenses th:last-child,
.budget-expenses td:last-child {
  text-align: center;
  width: 10%;
}

.budget-expenses .ref-input {
  text-align: center;
}

.fixed-reference {
  align-items: center;
  background: #f7fafb;
  border-radius: 4px;
  display: flex;
  height: 28px;
  justify-content: flex-start;
  padding: 0 7px;
}

.fixed-reference strong {
  font-size: 14px;
}

.reference-select {
  background: #f7fafb;
  border-color: transparent;
  border-radius: 4px;
  font-size: 12px;
  height: 28px;
  max-width: 100%;
  padding: 3px 6px;
  width: 100%;
}

.selectable-refs .reference-select {
  padding-left: 0;
}

.reference-select:focus {
  background: #fff;
  border-color: var(--accent);
  outline: none;
}

.selectable-refs th:first-child,
.selectable-refs td:first-child {
  width: 34%;
}

.selectable-refs th:nth-child(2),
.selectable-refs td:nth-child(2) {
  padding-left: 13px;
  width: 8%;
}

.selectable-refs th:nth-child(3),
.selectable-refs td:nth-child(3) {
  width: 20%;
}

.selectable-refs th:nth-child(4),
.selectable-refs td:nth-child(4) {
  width: 11%;
}

.selectable-refs th:nth-child(5),
.selectable-refs td:nth-child(5) {
  text-align: center;
  width: 17%;
}

.selectable-refs th:last-child,
.selectable-refs td:last-child {
  text-align: center;
  width: 10%;
}

.review-note {
  color: #7c2d12;
}

.review-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  justify-content: center;
  min-width: 64px;
  padding: 4px 8px;
  text-align: center;
}

.review-pill.ok {
  background: #ecfdf3;
  color: #047857;
}

.review-pill.watch {
  background: #fffbeb;
  color: #b45309;
}

.review-pill.over {
  background: #eef2ff;
  color: #4338ca;
}

.review-pill.neutral {
  background: #f5f8fa;
  color: var(--muted);
}

.budget-expenses .icon {
  height: 27px;
  line-height: 1;
  width: 27px;
}

.budget-note {
  color: var(--muted);
  font-size: 11px;
  margin: 4px 7px 0;
}

.important-notes p {
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 6px;
}

.important-notes h3 {
  color: #7c2d12;
  font-size: 12px;
  margin: 0 0 5px;
  text-transform: uppercase;
}

.calculated-section td:nth-child(2) {
  font-weight: 800;
}

.misc-table th:first-child {
  width: 48%;
}

.misc-table th:nth-child(2) {
  width: 28%;
}

.misc-table th:nth-child(3) {
  width: 24%;
}

.calculated-heading {
  align-items: baseline;
  display: flex;
  gap: 14px;
  margin-bottom: 4px;
}

.calculated-heading h2 {
  margin-bottom: 0;
}

.calculated-heading p {
  color: var(--muted);
  font-size: 11px;
  margin: 0;
}

.ending-section {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 9px;
}

.summary-inputs strong {
  display: inline-block;
  margin-right: 8px;
  text-transform: uppercase;
}

.credit-card-budget-section {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.credit-card-budget {
  table-layout: fixed;
}

.credit-card-budget th:first-child,
.credit-card-budget td:first-child {
  width: 34%;
}

.credit-card-budget th:nth-child(2),
.credit-card-budget td:nth-child(2) {
  width: 18%;
}

.credit-card-budget th:nth-child(3),
.credit-card-budget td:nth-child(3) {
  width: 16%;
}

.credit-card-budget th:nth-child(4),
.credit-card-budget td:nth-child(4) {
  text-align: right;
  width: 14%;
}

.credit-card-budget th:nth-child(5),
.credit-card-budget td:nth-child(5) {
  text-align: center;
  width: 18%;
}

.credit-card-budget td {
  font-weight: 700;
  height: 38px;
  padding: 4px 7px;
}

.credit-card-budget .inline-field {
  justify-content: start;
  max-width: none;
}

.credit-card-budget .inline-field input {
  max-width: 148px;
}

.credit-card-total {
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
}

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

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.language-setting,
.form-grid label:has([data-field="language"]) {
  display: none;
}

.form-grid:has(.language-setting:only-child) {
  display: none;
}

.metric {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.metric span,
.metric small,
.muted {
  color: var(--muted);
}

.metric strong {
  font-size: 26px;
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.formula-panel,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.formula-panel p {
  color: var(--muted);
  margin-bottom: 0;
}

.ok {
  color: var(--ok);
}

.danger,
.danger-text {
  color: var(--danger);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 700;
}

input,
select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}

.primary,
.secondary {
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 800;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.secondary {
  background: #eef2f6;
  color: var(--ink);
}

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

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

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  max-width: 360px;
}

.history-actions small {
  color: var(--muted);
  flex-basis: 100%;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
}

.history-head h2 {
  margin-bottom: 8px;
}

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

.history-metric {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 13px 14px;
}

.history-metric span,
.history-metric small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-metric strong {
  color: var(--nav);
  font-size: 20px;
}

.history-table {
  min-width: 660px;
  table-layout: fixed;
  width: max-content;
}

.history-table th,
.history-table td {
  font-size: 12px;
  white-space: nowrap;
}

.history-table td {
  text-align: left;
}

.history-table th:first-child,
.history-table td:first-child {
  text-align: left;
  white-space: normal;
  width: 230px;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2),
.history-table th:nth-child(3),
.history-table td:nth-child(3) {
  width: 95px;
}

.history-average-cell,
.history-month-cell,
.history-month-group {
  width: 125px;
}

.history-average-cell,
.history-month-group {
  border-left: 2px solid var(--line);
}

.history-table th span,
.history-table th small {
  display: block;
}

.history-table th small {
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 3px;
}

.history-date-row th {
  border-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding-bottom: 2px;
  text-align: center;
}

.history-date-row .history-update-cell {
  text-align: center;
}

.history-date-row .history-month-group {
  border-bottom: 1px solid var(--line);
}

.history-delete-table-row td {
  border-bottom: 0;
  padding-top: 8px;
}

.history-delete-table-row .danger-text {
  color: #dc2626;
  font-size: 18px;
  font-weight: 900;
  padding: 0 4px;
}

.history-empty {
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.icon {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #fff2f0;
  font-size: 22px;
}

.transaction-form {
  display: grid;
  grid-template-columns: 150px 170px 1.5fr 130px 160px 1fr auto;
  gap: 10px;
}

.transaction-heading {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.transaction-heading-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.transaction-heading-actions strong {
  border-radius: 8px;
  padding: 10px 14px;
}

.transaction-heading-actions .income-total {
  background: #effaf3;
  border: 1px solid #abdec2;
  color: var(--ok);
}

.transaction-heading-actions .expense-total {
  background: #fff8f7;
  border: 1px solid #f3b5ae;
  color: var(--danger);
}

.danger-button {
  background: #fff2f0;
  border: 1px solid #f3b5ae;
  color: var(--danger);
  font-weight: 800;
}

.transaction-panel h2 {
  margin-bottom: 16px;
}

.transaction-panel .transaction-heading h2 {
  margin: 0;
}

.actual-balance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.actual-balance-grid label {
  align-content: start;
  display: grid;
  grid-template-rows: 20px 42px minmax(30px, auto);
}

.actual-balance-grid input {
  height: 42px;
}

.actual-balance-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.last-update input {
  font-weight: 700;
}

.last-update.stale input {
  background: #fff2f0;
  border-color: #f3b5ae;
  color: var(--danger);
}

.last-update.stale small {
  color: var(--danger);
}

.last-update.current input {
  background: #effaf3;
  border-color: #abdec2;
  color: var(--ok);
}

.transaction-filter-panel {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
  margin-top: 18px;
  padding-top: 14px;
}

.transaction-filter-panel label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.transaction-filter-panel button {
  align-self: end;
}

.transaction-list-wrap {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  overflow-x: auto;
  padding-top: 14px;
}

.transaction-list {
  table-layout: fixed;
  width: 100%;
}

.transaction-list th,
.transaction-list td {
  font-size: 12px;
  padding: 9px 8px;
  vertical-align: middle;
}

.transaction-list th:nth-child(1),
.transaction-list td:nth-child(1) {
  width: 13%;
}

.transaction-list th:nth-child(2),
.transaction-list td:nth-child(2) {
  width: 12%;
}

.transaction-list th:nth-child(3),
.transaction-list td:nth-child(3) {
  width: 24%;
}

.transaction-list th:nth-child(4),
.transaction-list td:nth-child(4) {
  text-align: right;
  width: 12%;
}

.transaction-list th:nth-child(5),
.transaction-list td:nth-child(5) {
  width: 13%;
}

.transaction-list th:nth-child(6),
.transaction-list td:nth-child(6) {
  width: 20%;
}

.transaction-list th:nth-child(7),
.transaction-list td:nth-child(7) {
  text-align: center;
  width: 6%;
}

.transaction-rules {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 18px 0 0;
  padding-top: 12px;
}

.important-notes {
  background: #fffbeb;
  border: 1px solid #f5d287;
  border-radius: 8px;
  color: #7c2d12;
  margin: 14px 0;
  padding: 12px 14px;
}

.budget-advantage {
  background: #ecfeff;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  color: #0f766e;
  margin-bottom: 10px;
  padding: 10px 12px;
}

.budget-advantage strong {
  color: #0f766e;
  font-size: 17px;
  margin-bottom: 4px;
}

.budget-advantage p {
  color: #134e4a;
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

.important-notes strong {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
}

.important-notes ul {
  column-gap: 28px;
  columns: 2;
  margin: 0;
  padding-left: 18px;
}

.important-notes li {
  break-inside: avoid;
  font-size: 12px;
  line-height: 1.45;
  margin: 3px 0;
}

.projection-panel h2 {
  margin-bottom: 12px;
}

.projection-note {
  font-size: 12px;
  margin-bottom: 12px;
}

.projection-top-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  align-items: start;
}

.payment-timing-card {
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 0.9fr) minmax(360px, 1.4fr);
  padding: 12px;
  width: 100%;
}

.payment-timing-card h2 {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.payment-timing-row {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  min-height: 58px;
  padding: 10px 12px;
}

.payment-timing-row span,
.payment-timing-row label,
.payment-timing-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payment-timing-row strong {
  font-size: 18px;
}

.payment-timing-row.future {
  grid-template-columns: minmax(150px, 1fr) 92px minmax(120px, auto) auto;
}

.payment-timing-row.future label,
.payment-timing-row.future small {
  display: grid;
  gap: 5px;
}

.payment-timing-row.future strong {
  justify-self: end;
}

.payment-timing-row input {
  padding: 6px 7px;
  width: 54px;
}

.projection-special-table strong {
  font-weight: 800;
}

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

.projection-section-head h2 {
  margin-bottom: 8px;
}

.projection-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 700;
  gap: 16px;
  justify-content: flex-end;
  min-width: 260px;
  padding-top: 2px;
}

.projection-grid {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(190px, 1.45fr) repeat(5, minmax(105px, 0.9fr)) minmax(140px, 1fr);
  padding: 10px;
}

.projection-top-grid .projection-grid {
  padding-left: 0;
  padding-right: 0;
}

.projection-grid span:not(:first-child) {
  text-align: right;
}

.projection-grid span:last-child {
  text-align: left;
}

.projection-grid-header {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.projection-group {
  border-bottom: 1px solid var(--line);
}

.projection-group summary {
  cursor: pointer;
  list-style: none;
}

.projection-group summary::-webkit-details-marker {
  display: none;
}

.projection-group summary strong::before {
  color: var(--accent);
  content: "+";
  display: inline-block;
  font-size: 16px;
  margin-right: 10px;
  width: 10px;
}

.projection-group[open] summary strong::before {
  content: "-";
}

.projection-group.status-problem summary {
  background: #fff8f7;
}

.projection-group.status-watch summary {
  background: #fffaf0;
}

.projection-available-row {
  border-bottom: 1px solid var(--line);
}

.projection-available-row.status-problem {
  background: #fff8f7;
}

.projection-available-row.status-watch {
  background: #fffaf0;
}

.projection-standard-row {
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.projection-standard-row strong {
  font-weight: 800;
}

.projection-standard-row.status-problem {
  background: #fff8f7;
}

.projection-standard-row.status-watch {
  background: #fffaf0;
}

.projection-detail-wrap {
  background: #f7f9fb;
  padding: 0 12px 12px 30px;
}

.projection-detail-table td,
.projection-detail-table th {
  font-size: 12px;
  padding: 8px;
}

.projection-detail-table {
  table-layout: fixed;
  width: 100%;
}

.projection-detail-table th:first-child,
.projection-detail-table td:first-child {
  width: 22%;
}

.projection-detail-table th:not(:first-child),
.projection-detail-table td:not(:first-child) {
  text-align: right;
}

.projection-detail-table th:nth-child(7),
.projection-detail-table td:nth-child(7),
.projection-detail-table th:nth-child(8),
.projection-detail-table td:nth-child(8) {
  text-align: center;
}

.projection-detail-table td:first-child {
  font-weight: 700;
}

.due-date {
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  font-weight: 800;
  min-width: 92px;
  padding: 4px 8px;
  text-align: center;
}

.due-paid {
  background: #2563eb;
}

.due-future {
  background: #16a34a;
}

.due-soon {
  background: #7c3aed;
}

.due-overdue {
  background: #dc2626;
}

.projection-special-table td:nth-child(4) {
  font-weight: 800;
}

.projection-signals {
  margin-top: 16px;
}

.smart-model-header {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.smart-model-header strong {
  background: #e7f7f7;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 8px 12px;
  white-space: nowrap;
}

.smart-model-table {
  font-size: 12px;
}

.smart-model-table th {
  background: #c9f5f4;
  color: var(--ink);
}

.smart-model-table td {
  padding: 6px 8px;
}

.smart-model-table td:nth-child(1) {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  width: 18%;
}

.smart-model-table td:nth-child(2) {
  width: 37%;
}

.smart-model-table td:nth-child(n + 3) {
  font-weight: 800;
  text-align: center;
  width: 9%;
}

.smart-ok {
  background: #eefaf2;
}

.smart-watch {
  background: #fff6d9;
}

.smart-risk {
  background: #ffd6d1;
  color: var(--danger);
}

.smart-chart-panel h2 {
  color: #b45309;
  font-size: 18px;
  text-transform: uppercase;
}

.smart-chart-panel > h2 {
  text-align: center;
}

.smart-chart-header {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.smart-chart-header h2 {
  margin-bottom: 6px;
}

.smart-chart-header .muted {
  margin: 0;
}

.smart-pie-selector {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  text-transform: uppercase;
}

.smart-pie-selector input {
  max-width: 76px;
  text-align: center;
}

.smart-pie-wrap {
  align-items: center;
  display: grid;
  gap: 22px;
  grid-template-columns: 280px 1fr;
}

.smart-pie {
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset -18px -22px 0 rgba(0, 0, 0, 0.16), 0 10px 18px rgba(16, 24, 40, 0.18);
}

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

.smart-pie-legend span,
.smart-legend span {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 7px;
}

.smart-pie-legend i,
.smart-legend i {
  display: inline-block;
  height: 10px;
  width: 18px;
}

.smart-bars {
  align-items: end;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(15, minmax(22px, 1fr));
  height: 260px;
  padding: 10px 8px 0;
}

.smart-bar-group {
  align-items: end;
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(3, 1fr);
  height: 100%;
  position: relative;
}

.smart-bar-group span {
  bottom: -22px;
  color: #7c2d12;
  font-size: 12px;
  font-weight: 700;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
}

.smart-bar-group i {
  display: block;
  min-height: 2px;
}

.smart-bar-group .balanced,
.smart-legend .balanced {
  background: #bff5ff;
}

.smart-bar-group .current,
.smart-legend .current {
  background: #c75b12;
}

.smart-bar-group .projected,
.smart-legend .projected {
  background: #ffd7c7;
}

.smart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-top: 34px;
}

.financial-evaluation-panel h2 {
  margin-bottom: 14px;
}

.financial-range {
  border-radius: 999px;
  display: grid;
  grid-template-columns: 40fr 20fr 40fr;
  height: 34px;
  margin: 18px 8px 18px;
  overflow: visible;
  position: relative;
}

.financial-range span {
  align-items: center;
  color: #fff;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  text-transform: uppercase;
}

.financial-range .range-good {
  background: #29b56f;
  border-radius: 999px 0 0 999px;
}

.financial-range .range-watch {
  background: #f4b942;
  color: #4a3200;
}

.financial-range .range-risk {
  background: #d92d4f;
  border-radius: 0 999px 999px 0;
}

.financial-range b {
  border-color: var(--ink) transparent transparent;
  border-style: solid;
  border-width: 13px 8px 0;
  bottom: -18px;
  display: block;
  position: absolute;
  transform: translateX(-50%);
}

.financial-range b em {
  color: var(--ink);
  font-style: normal;
  font-weight: 800;
  left: 50%;
  position: absolute;
  top: 12px;
  transform: translateX(-50%);
}

.financial-range-labels {
  color: var(--muted);
  display: flex;
  font-size: 11px;
  font-weight: 700;
  justify-content: space-between;
  margin: 0 8px 12px;
}

.financial-range-note {
  font-size: 12px;
  margin-bottom: 0;
}

.financial-group-ranges {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.financial-group-range {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 18px;
}

.financial-group-range.status-good {
  background: #f2fbf5;
}

.financial-group-range.status-watch {
  background: #fffaf0;
}

.financial-group-range.status-problem {
  background: #fff8f7;
}

.financial-group-range header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.financial-range-small {
  height: 28px;
  margin: 0 8px 8px;
}

.financial-range-small b {
  border-color: #46720c transparent transparent;
  border-width: 18px 11px 0;
  bottom: auto;
  top: -20px;
}

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

.tx-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  display: grid;
  gap: 5px;
}

.tx-card span,
.tx-card small {
  color: var(--muted);
}

.bars {
  display: grid;
  gap: 14px;
}

.bars div {
  display: grid;
  grid-template-columns: 170px 120px 1fr;
  gap: 12px;
  align-items: center;
}

.bars i,
.thermometer {
  display: block;
  height: 12px;
  background: #e9edf1;
  border-radius: 99px;
  overflow: hidden;
}

.bars em,
.thermometer span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.thermometer {
  height: 24px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  #app {
    display: block;
    max-width: 100vw;
    overflow: hidden;
    width: 100vw;
  }

  .shell-nav {
    max-width: 100%;
    overflow: hidden;
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

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

  .workspace {
    max-width: 100vw;
    overflow: hidden;
    padding: 18px;
  }

  .nav-button {
    font-size: 14px;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 10px;
  }

  .topbar,
  .dashboard-header,
  .formula-panel,
  .section-head,
  .history-head {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .form-grid,
  .actual-balance-grid,
  .card-list,
  .history-summary-grid {
    grid-template-columns: 1fr;
  }

  .transaction-form {
    grid-template-columns: 1fr;
  }

  .transaction-heading,
  .transaction-heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .transaction-list {
    min-width: 780px;
  }

  .projection-top-grid {
    grid-template-columns: 1fr;
  }

  .projection-grid {
    gap: 5px;
    grid-template-columns: minmax(100px, 1.4fr) repeat(3, minmax(66px, 1fr));
    padding: 8px 3px;
  }

  .projection-grid span:nth-child(5),
  .projection-grid span:nth-child(6),
  .projection-grid span:nth-child(7) {
    display: none;
  }

  .projection-detail-wrap {
    overflow-x: auto;
    padding: 0 0 10px 12px;
  }

  .bars div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  h1 {
    font-size: 28px;
  }

  .dashboard-board {
    max-width: 100%;
    overflow: hidden;
    padding: 10px;
  }

  .budget-sheet {
    max-width: 100%;
    min-width: 0;
    padding: 10px;
    width: 100%;
  }

  .budget-section,
  .budget-section .table-wrap,
  .budget-section-head {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .budget-title {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .budget-section-head {
    align-items: start;
    display: block;
    gap: 8px;
  }

  .budget-section-head h2 {
    flex: 1 1 auto;
    min-width: 0;
  }

  .budget-section-head .add-concept {
    margin: 6px 0 3px;
  }

  .budget-expenses {
    min-width: 0;
    max-width: 100%;
    width: 330px;
  }

  .budget-expenses th:first-child {
    width: 43%;
  }

  .budget-expenses th:nth-child(2) {
    width: 12%;
  }

  .budget-expenses th:nth-child(3) {
    width: 21%;
  }

  .budget-expenses th:nth-child(4) {
    width: 16%;
  }

  .budget-expenses th:nth-child(5) {
    width: 18%;
  }

  .budget-expenses th:last-child,
  .budget-expenses td:last-child {
    display: none;
  }

  .budget-simple th {
    font-size: 9px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .budget-simple td {
    padding-left: 4px;
    padding-right: 4px;
  }

  .budget-simple.summary-inputs th:first-child {
    width: 48%;
  }

  .budget-simple.summary-inputs th:nth-child(2) {
    width: 21%;
  }

  .budget-simple.summary-inputs th:nth-child(3) {
    font-size: 8px;
    overflow-wrap: anywhere;
    width: 31%;
  }

  .budget-expenses thead {
    display: none;
  }

  .budget-expenses,
  .budget-expenses tbody {
    display: block;
  }

  .budget-expenses tr {
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 4px 8px;
    grid-template-areas:
      "concept concept concept"
      "ref amount due"
      "review review review";
    grid-template-columns: 54px 1fr 64px;
    padding: 5px 4px;
  }

  .budget-expenses.selectable-refs tr {
    grid-template-areas:
      "concept concept concept"
      "ref amount due"
      "review review review";
    grid-template-columns: 54px 1fr 64px;
  }

  .budget-expenses td {
    border: 0;
    display: block;
    height: auto;
    padding: 0;
  }

  .budget-expenses td::before {
    color: var(--muted);
    display: block;
    font-size: 9px;
    font-weight: 800;
    margin-bottom: 2px;
    text-transform: uppercase;
  }

  .budget-expenses td:first-child {
    grid-area: concept;
  }

  .budget-expenses td:first-child::before {
    content: "Concept";
  }

  .budget-expenses td:nth-child(2) {
    grid-area: ref;
  }

  .budget-expenses td:nth-child(2)::before {
    content: "Ref";
  }

  .budget-expenses td:nth-child(3) {
    grid-area: amount;
  }

  .budget-expenses td:nth-child(3)::before {
    content: "Amount";
  }

  .budget-expenses td:nth-child(4) {
    grid-area: due;
  }

  .budget-expenses td:nth-child(4)::before {
    content: "Due Day";
  }

  .budget-expenses td:nth-child(5) {
    grid-area: review;
  }

  .budget-expenses td:nth-child(5)::before {
    content: "Review";
  }

  .budget-expenses input {
    font-size: 12px;
    max-width: 100%;
    padding-left: 4px;
    padding-right: 4px;
  }

  .reference-select {
    font-size: 12px;
    max-width: 100%;
    width: 100%;
  }

  .fixed-reference {
    height: 28px;
  }

  .budget-expenses .icon {
    font-size: 15px;
    height: 23px;
    width: 23px;
  }

  .add-concept {
    white-space: nowrap;
  }

  .budget-note {
    max-width: 330px;
  }

  .calculated-heading {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .credit-card-budget th:first-child,
  .credit-card-budget td:first-child {
    width: 43%;
  }

  .credit-card-budget th:nth-child(2),
  .credit-card-budget td:nth-child(2) {
    width: 24%;
  }

  .credit-card-budget th:nth-child(3),
  .credit-card-budget td:nth-child(3) {
    font-size: 11px;
    width: 21%;
  }

  .credit-card-budget th:nth-child(4),
  .credit-card-budget td:nth-child(4) {
    font-size: 11px;
    width: 12%;
  }

  .credit-card-budget th:nth-child(5),
  .credit-card-budget td:nth-child(5) {
    font-size: 11px;
    width: 15%;
  }

  .credit-card-budget td {
    padding-left: 3px;
    padding-right: 3px;
  }

  .credit-card-budget .inline-field input {
    max-width: 82px;
  }

  .period-data {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .period-data div {
    min-width: 0;
  }

  .period-data dt {
    font-size: 10px;
    overflow-wrap: anywhere;
  }

  .period-data dd {
    font-size: 13px;
    white-space: normal;
  }

  .dashboard-summary th:first-child {
    width: 38%;
  }

  .dashboard-summary th:nth-child(2),
  .dashboard-summary th:nth-child(3) {
    width: 31%;
  }

  .dashboard-summary th:last-child,
  .dashboard-summary tr:not(.table-section-row) td:last-child {
    display: none;
  }

  .dashboard-summary .table-section-row td {
    display: table-cell;
  }

  .dashboard-values {
    display: grid;
    gap: 3px;
  }

  .dashboard-values span {
    min-width: 0;
  }

  .dashboard-summary td {
    font-size: 12px;
    height: 36px;
    padding: 4px;
  }

  .dashboard-summary th {
    font-size: 10px;
    padding: 7px 4px;
  }

  .dashboard-values strong {
    font-size: 13px;
  }

  .dashboard-summary tr.status-good td:first-child::before,
  .dashboard-summary tr.status-watch td:first-child::before,
  .dashboard-summary tr.status-problem td:first-child::before {
    border-radius: 50%;
    content: "";
    display: inline-block;
    height: 8px;
    margin-right: 5px;
    width: 8px;
  }

  .dashboard-summary tr.status-good td:first-child::before {
    background: #29b56f;
  }

  .dashboard-summary tr.status-watch td:first-child::before {
    background: #f4b942;
  }

  .dashboard-summary tr.status-problem td:first-child::before {
    background: #d92d4f;
  }

  .detail-row td {
    height: 29px;
  }

  .detail-name {
    margin-right: 4px;
  }

  .detail-name::before {
    display: none;
  }

  .financial-status {
    display: block;
  }

  .financial-status h2 {
    margin-bottom: 10px;
  }

  .financial-values {
    gap: 8px 15px;
  }

  .signal-guide {
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 15px;
  }
}

@media (max-width: 700px) {
  .help-intro,
  .help-form,
  .help-start-guide {
    grid-template-columns: 1fr;
  }

  .help-intro,
  .help-start-guide {
    display: grid;
  }

  .help-message {
    max-width: 100%;
  }
}

