:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #5f6c64;
  --line: #dce4de;
  --panel: #ffffff;
  --canvas: #f5f7f2;
  --green: #20745f;
  --green-dark: #135c4a;
  --amber: #c27a1f;
  --red: #b6403b;
  --blue: #386b9d;
  --violet: #6f5a99;
  --shadow: 0 18px 48px rgba(24, 38, 30, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(32, 116, 95, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(56, 107, 157, 0.05) 1px, transparent 1px),
    var(--canvas);
  background-size: 42px 42px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

button {
  cursor: pointer;
  min-width: 0;
}

.app-shell {
  min-height: 100vh;
}

.public-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(18px, 4vw, 42px);
}

.public-card {
  display: grid;
  width: min(760px, 100%);
  gap: 22px;
  padding: clamp(22px, 5vw, 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.public-card.compact {
  width: min(420px, 100%);
  justify-items: center;
  text-align: center;
}

.landing-card {
  min-height: min(720px, calc(100vh - 48px));
  align-content: center;
  justify-items: center;
  text-align: center;
}

.site-logo {
  width: min(220px, 64vw);
  height: auto;
}

.hero-logo {
  width: min(340px, 72vw);
  height: auto;
}

.topbar-logo {
  width: 132px;
  height: auto;
  display: block;
}

.brand-image-only {
  min-width: 132px;
}

.landing-copy {
  display: grid;
  gap: 10px;
}

.landing-copy h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  line-height: 0.98;
}

.landing-copy p {
  max-width: 590px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.landing-actions,
.auth-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.auth-card,
.setup-card {
  width: min(560px, 100%);
}

.auth-head {
  align-items: flex-start;
}

.notice-text {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #efd69f;
  border-radius: 8px;
  background: #fff7e6;
  color: #76500f;
  line-height: 1.45;
}

.setup-progress {
  height: 8px;
  border-radius: 999px;
  background: #e8eee9;
  overflow: hidden;
}

.setup-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.setup-question {
  display: grid;
  gap: 18px;
}

.setup-question h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.08;
}

.setup-choice-grid {
  grid-template-columns: 1fr;
}

.account-picker {
  display: grid;
  gap: 16px;
}

.account-picker-group {
  display: grid;
  gap: 8px;
}

.choice-card.locked {
  cursor: default;
  opacity: 0.72;
}

.field-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.field .field-options label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.15;
  text-transform: none;
}

.field .field-options input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}

.profile-logo-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.business-logo-preview {
  display: grid;
  width: 120px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 0.86rem;
}

.business-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.tax-helper {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.tax-helper strong,
.tax-helper h3 {
  margin: 0;
}

.tax-quiz-panel {
  background: #fff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 242, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.workspace-switcher {
  display: grid;
  gap: 4px;
  min-width: min(320px, 34vw);
  max-width: 380px;
}

.workspace-switcher label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace-switcher-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.workspace-switcher select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.layout {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.sidebar {
  min-width: 0;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.nav-list {
  display: grid;
  gap: 10px;
}

.nav-group {
  min-width: 0;
  border: 1px solid rgba(23, 33, 27, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.nav-group summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  min-width: 0;
  padding: 7px 9px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  list-style: none;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

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

.nav-group[open] summary {
  color: var(--green-dark);
  border-bottom: 1px solid rgba(23, 33, 27, 0.08);
}

.nav-group-icon {
  display: inline-flex;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
}

.nav-group-items {
  display: grid;
  gap: 3px;
  padding: 5px;
}

.nav-button,
.icon-button,
.primary-button,
.secondary-button,
.ghost-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: left;
}

.nav-button .nav-label,
.nav-group summary span,
.primary-button span,
.secondary-button span,
.ghost-button span,
.choice-card strong,
.choice-card span,
.status-chip,
.balance-chip,
.metric span,
.metric strong,
.metric small,
.section-head h2,
.section-head h3,
.section-head p,
.field-hint,
.empty-state {
  min-width: 0;
  overflow-wrap: anywhere;
}

.issue-list {
  display: grid;
  gap: 6px;
}

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

.checkbox-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.checkbox-grid label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow-wrap: anywhere;
}

.checkbox-option {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  max-width: 220px;
  white-space: normal;
  text-align: left;
}

.checkbox-option.compact {
  font-size: 0.9rem;
}

.checkbox-grid input {
  width: auto;
  min-height: 0;
  margin-top: 3px;
}

.inbox-picker {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

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

.nav-button:hover,
.nav-button.active {
  background: #eaf2ed;
  color: var(--ink);
}

.nav-icon {
  display: inline-flex;
  width: 20px;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.action-icon,
.lucide {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2;
}

.content {
  min-width: 0;
  padding: clamp(18px, 3vw, 34px);
}

.view {
  display: grid;
  gap: 18px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.section-head > * {
  min-width: 0;
}

.section-head h2 {
  margin: 0 0 4px;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.section-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.section-head.compact {
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.section-head.compact.unframed {
  padding: 0;
  border-bottom: 0;
}

.section-head p,
.field-hint,
.empty-state,
.role-guide-head p,
.role-guide-summary {
  margin: 0;
  color: var(--muted);
}

.muted-text {
  color: var(--muted);
  font-size: 0.86rem;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-inner {
  min-width: 0;
  padding: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

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

.metric {
  min-width: 0;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  max-width: 100%;
  white-space: normal;
}

.primary-button > span,
.secondary-button > span,
.ghost-button > span {
  line-height: 1.15;
}

.primary-button {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

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

.primary-button:disabled {
  cursor: not-allowed;
  border-color: #b9c5bd;
  background: #b9c5bd;
}

.secondary-button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-button {
  background: transparent;
  color: var(--muted);
}

.icon-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segment {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.segment.active {
  background: var(--green);
  color: white;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.subhead {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.compact-select {
  min-height: 36px;
  max-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 7px 9px;
  font-weight: 700;
}

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

.choice-card {
  display: grid;
  align-content: start;
  min-height: 122px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.choice-card.active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.choice-card strong {
  display: block;
  margin-bottom: 6px;
}

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

.wizard-step {
  display: grid;
  gap: 16px;
}

.beginner-questionnaire {
  overflow: hidden;
}

.beginner-question-card {
  display: grid;
  gap: 16px;
  min-height: 360px;
  align-content: start;
  animation: slide-question-in 220ms ease-out;
}

.beginner-question-card h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.beginner-amount-field {
  max-width: 360px;
}

@keyframes slide-question-in {
  from {
    opacity: 0;
    transform: translateX(22px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 28px);
  background: rgba(15, 24, 19, 0.48);
}

.modal-panel {
  display: grid;
  gap: 14px;
  width: min(1060px, 100%);
  max-height: min(860px, calc(100vh - 24px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(10, 18, 14, 0.28);
  padding: clamp(16px, 3vw, 24px);
}

.compact-modal {
  width: min(620px, 100%);
}

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

.modal-head h2 {
  margin: 0 0 4px;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
}

.transaction-surface {
  display: grid;
  gap: 16px;
}

.modal-body {
  min-width: 0;
}

.journal-lines {
  display: grid;
  gap: 10px;
}

.journal-line {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px 120px 40px;
  gap: 8px;
  align-items: end;
}

.balance-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #edf4f0;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.status-chip.warn {
  background: #fff5df;
  color: #8b5513;
}

.status-chip.bad {
  background: #fdeceb;
  color: var(--red);
}

.status-chip.good {
  background: #e8f5ee;
  color: var(--green-dark);
}

.reminder-list {
  display: grid;
  gap: 10px;
}

.reminder-list.compact {
  gap: 8px;
}

.reminder-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #fff;
}

.document-suggestion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  min-width: 0;
}

.document-suggestion strong,
.document-suggestion p,
.document-suggestion-meta span,
.document-intelligence-details p {
  overflow-wrap: anywhere;
}

.document-suggestion p,
.document-intelligence-details p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.document-suggestion-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.document-intelligence-row td {
  background: #fbfdfb;
}

.document-intelligence-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 14px;
  padding: 6px 0;
  min-width: 0;
}

.reminder-item.blocker {
  border-left-color: var(--red);
}

.reminder-item.warn {
  border-left-color: var(--amber);
}

.reminder-item.info {
  border-left-color: var(--blue);
}

.reminder-item strong,
.reminder-item p {
  margin: 0;
}

.reminder-item p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.role-guide-list {
  display: grid;
  gap: 10px;
}

.role-guide-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.role-guide-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.role-guide-head h4 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.role-guide-head p,
.role-guide-summary {
  line-height: 1.4;
}

.role-permission-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.role-permission {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  text-align: center;
}

.role-permission span,
.role-permission strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.role-permission span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.role-permission strong {
  color: var(--muted);
  font-size: 0.82rem;
}

.role-permission.allowed {
  border-color: #cfe5d9;
  background: #f2faf5;
}

.role-permission.allowed strong {
  color: var(--green-dark);
}

.deployment-checklist {
  display: grid;
  gap: 16px;
}

.deployment-section .panel-inner {
  gap: 12px;
}

.deployment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.32fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.deployment-item.ready {
  border-color: #cfe5d9;
  background: #f8fcfa;
}

.deployment-item label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.deployment-item input {
  margin-top: 3px;
  accent-color: var(--green);
}

.deployment-item span,
.deployment-item strong,
.deployment-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.deployment-item label > span {
  display: grid;
  gap: 4px;
}

.deployment-item small {
  color: var(--muted);
  line-height: 1.4;
}

.deployment-item-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  text-align: right;
}

.reminder-actions {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.reminder-actions > strong {
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

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

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

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

td.amount,
th.amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

.ledger-summary-table th,
.ledger-summary-table td {
  padding: 14px 16px;
}

.ledger-account-column {
  width: 16%;
}

.ledger-meaning-column {
  width: 42%;
}

.ledger-section-column {
  width: 12%;
}

.ledger-amount-column {
  width: 7%;
}

.ledger-balance-column {
  width: 10%;
}

.ledger-action-column {
  width: 108px;
}

.ledger-summary-table .selected-ledger-row {
  background: #f4f9f6;
}

.ledger-summary-table .ledger-action {
  text-align: right;
  white-space: nowrap;
}

.ledger-summary-table .ledger-action .ghost-button {
  min-width: 96px;
  padding: 8px 9px;
  white-space: nowrap;
}

.ledger-summary-table .ledger-action .ghost-button > span {
  white-space: nowrap;
}

.entry-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.entry-card.void-entry {
  background: #faf7f6;
  border-color: #e8ccc9;
}

.entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.entry-head strong {
  display: block;
}

.entry-head span {
  color: var(--muted);
  font-size: 0.88rem;
}

.entry-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.void-entry .entry-lines {
  opacity: 0.62;
}

.draft-entry {
  border-left: 4px solid var(--amber);
}

.entry-warning {
  margin: 0;
  padding: 10px 14px 0;
  color: var(--amber);
  font-size: 0.88rem;
  font-weight: 700;
}

.entry-warning.bad {
  color: var(--red);
}

.entry-lines {
  padding: 8px 14px 14px;
}

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

.report-filter-panel,
.report-export-panel {
  overflow: hidden;
}

.report-filter-grid {
  padding: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inline-actions {
  margin-top: 0;
}

.report-export-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.report-export-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-export-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
}

.report-export-summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}

.report-export-summary strong {
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.export-format-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.export-format-actions .secondary-button {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 0.8rem;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.filing-package-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.report-card {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-card h3 {
  margin: 0;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}

.report-card .section-head h3 {
  padding: 0;
  border-bottom: 0;
}

.official-document-form {
  margin: 12px 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 72%, #fff);
}

.official-document-form textarea {
  min-height: 72px;
}

.statement-card {
  overflow: hidden;
}

.statement-table {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.statement-section th {
  padding-top: 16px;
  background: #f4f7f4;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
}

.statement-total td,
.statement-grand-total td {
  font-weight: 800;
}

.statement-grand-total td {
  border-top: 2px solid var(--ink);
  color: var(--green-dark);
}

.t-account-panel {
  overflow: hidden;
}

.t-account-panel > .field-hint {
  padding: 0 20px 20px;
}

.t-account {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 20px 20px 18px;
  background: #fff;
}

.t-account-title {
  grid-column: 1 / -1;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--ink);
  text-align: center;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 900;
}

.t-account-head {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.debit-head,
.debit-side {
  border-right: 2px solid var(--ink);
}

.credit-head,
.credit-side {
  border-left: 0;
}

.t-account-side {
  display: grid;
  align-content: start;
  min-height: 104px;
}

.t-account-row,
.t-account-total,
.t-account-balance {
  display: grid;
  grid-template-columns: minmax(68px, auto) minmax(0, 1fr) minmax(100px, auto);
  gap: 12px;
  align-items: baseline;
  padding: 9px 16px;
  min-height: 40px;
}

.t-account-row span,
.t-account-total span,
.t-account-balance span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.t-account-row strong,
.t-account-total strong,
.t-account-balance strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.t-account-total {
  margin-top: 8px;
  border-top: 2px solid var(--line);
  font-weight: 800;
}

.t-account-balance {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto);
  border-top: 3px double var(--ink);
  color: var(--green-dark);
  font-weight: 900;
}

.bar-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.bar-row {
  display: grid;
  gap: 5px;
}

.bar-label {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.bar-label span,
.bar-label strong,
.ledger-strip span,
.ledger-strip strong,
.reminder-item strong,
.reminder-item p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #ecf0ed;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(920px, 100%);
}

.login-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: center;
}

.login-copy {
  padding: 28px;
}

.login-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

.login-copy p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.ledger-art {
  display: grid;
  min-height: 360px;
  align-content: center;
  gap: 12px;
  padding: 26px;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(32, 116, 95, 0.12), rgba(56, 107, 157, 0.1)),
    #fff;
}

.ledger-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  min-height: 52px;
  padding: 10px;
  border: 1px solid rgba(23, 33, 27, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

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

.ledger-strip strong:last-child {
  text-align: right;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .layout,
  .login-hero,
  .grid.two,
  .grid.three,
  .report-grid,
  .report-filter-grid,
  .report-export-grid,
  .metric-row,
  .choice-grid {
    grid-template-columns: 1fr;
  }

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

  .layout {
    min-height: auto;
  }

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

  .ledger-art {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .journal-line {
    grid-template-columns: 1fr 1fr;
  }

  .t-account {
    padding: 12px;
  }

  .t-account-row,
  .t-account-total,
  .t-account-balance {
    grid-template-columns: minmax(48px, auto) minmax(0, 1fr);
  }

  .t-account-row strong,
  .t-account-total strong {
    grid-column: 1 / -1;
  }

  .reminder-item,
  .reminder-actions {
    grid-template-columns: 1fr;
  }

  .document-suggestion,
  .document-intelligence-details {
    grid-template-columns: 1fr;
  }

  .document-suggestion-meta {
    justify-items: start;
    text-align: left;
  }

  .reminder-actions > strong {
    text-align: left;
  }

  .role-permission-grid {
    grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  }

  .deployment-item {
    grid-template-columns: 1fr;
  }

  .deployment-item-meta {
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .topbar,
  .section-head,
  .entry-head,
  .modal-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .footer-actions {
    justify-content: stretch;
  }

  .workspace-switcher {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .segmented {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .form-grid,
  .nav-list,
  .profile-logo-row {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .role-guide-head {
    flex-direction: column;
  }
}
