:root {
  color-scheme: light;

  --ink: #222924;
  --muted: #626961;
  --paper: #fafbf7;
  --line: #dfe3da;
  --green: #dae8c6;
  --violet: #ece6f6;

  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
}

a {
  color: inherit;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

p {
  line-height: 1.6;
}

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

h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: clamp(2.2rem, 3.6vw, 3.5rem);
  line-height: 1.13;
  letter-spacing: -0.04em;
  margin-bottom: 18px;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.4;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1rem;
  line-height: 1.5;
}

small {
  font-size: 0.8rem;
}

.sidebar {
  position: fixed;
  width: 236px;
  height: 100dvh;
  padding: 38px 22px 28px;
  background: var(--ink);
  color: #f9fbf6;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.65rem;
  letter-spacing: -0.06em;
  padding: 0 12px;
  flex-shrink: 0;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  background: var(--green);
  color: var(--ink);
  border-radius: 12px;
  font: 700 2rem Georgia, serif;
}

.brand-dot {
  font-size: 0.65rem;
  align-self: flex-start;
  margin-top: 7px;
  margin-left: -8px;
}

.sidebar-label {
  color: #b4bdb1;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  margin: 68px 12px 18px;
}

nav {
  display: grid;
  gap: 9px;
}

nav a {
  border-radius: 9px;
  padding: 15px 17px;
  color: #d5ddd2;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.88rem;
}

nav a[aria-current='page'] {
  background: var(--green);
  color: var(--ink);
}


.sidebar-note {
  margin-top: auto;
  padding: 25px 12px 0;
  border-top: 1px solid #485145;
}

dialog h2 {
  margin: 20px 0 8px;
  font-size: 1.5rem;
}

dialog > p {
  font-size: 0.875rem;
}

.sidebar-note p {
  font-size: 0.88rem;
  margin: 14px 0 20px;
}

.sidebar-note small {
  color: #b4bdb1;
  font-size: 0.68rem;
}

.small-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #527348;
}

.sidebar .small-dot {
  background: #dae8c6;
}

main {
  margin-left: 236px;
  padding: 0 clamp(24px, 4.6vw, 76px);
  max-width: 1800px;
  min-width: 0;
}

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

.topbar p {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  margin: 0;
}

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

.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  margin: 0 0 32px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.eyebrow {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 16px;
}

.business-name {
  color: var(--muted);
  letter-spacing: 0.03em;
  margin: 0;
  font-size: 0.875rem;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 13px 19px;
  line-height: 1.4;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  font-size: 0.875rem;
  max-width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
}

.button:hover {
  background: #364535;
}

.button-light {
  background: transparent;
  color: var(--ink);
  border-color: #b9c3b2;
}

.button-light:hover {
  background: #e8eddf;
}

.summary-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

.balance-card {
  padding: 27px 30px 22px;
  border-radius: 18px;
  background: var(--green);
  position: relative;
  min-width: 0;
}

.balance-card > header, .sync-card > header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  border: 1px solid #91a27b;
  padding: 5px 10px;
  line-height: 1.4;
  font-size: 0.75rem;
  white-space: normal;
  max-width: 100%;
}

.balance-amount {
  line-height: 1.2;
  letter-spacing: -0.04em;
  margin: 38px 0 10px;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: clamp(2rem, 4vw, 3.8rem);
}

.balance-amount small {
  font-size: 0.9rem;
  letter-spacing: 0;
}

#balance-caption {
  margin-bottom: 29px;
  font-size: 0.875rem;
}

.balance-card footer {
  border-top: 1px solid #b3c39e;
  display: grid;
  gap: 14px;
  padding-top: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.balance-card footer strong {
  font-weight: 600;
}

.sync-card {
  padding: 24px 26px;
  background: var(--violet);
  border-radius: 18px;
  min-width: 0;
}

.sync-card .pill {
  border-color: #b6a4c9;
}

.status-orb {
  display: grid;
  place-items: center;
  height: 38px;
  width: 38px;
  border-radius: 50%;
  background: #fff9;
  font-size: 1.7rem;
}

.sync-card h2 {
  margin: 22px 0 8px;
}

.sync-card > p {
  color: #54515b;
  font-size: 0.875rem;
}

dl {
  display: grid;
  gap: 10px 12px;
  margin: 21px 0 0;
  line-height: 1.5;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  font-size: 0.8125rem;
}

dt {
  color: #595363;
}

dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.date-note {
  display: flex;
  gap: 12px;
  margin: 20px 0 0;
  padding: 13px 17px;
  border: 1px solid #dfd8bd;
  border-radius: 9px;
  background: #fbf5e3;
  color: #665221;
  align-items: flex-start;
}

.date-note p {
  margin: 0;
  font-size: 0.875rem;
  min-width: 0;
}

.date-note > span {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.payments-section {
  margin: 40px 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.section-heading h2 {
  margin: 0;
}

.section-heading p {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 0.875rem;
}

.section-heading .eyebrow {
  margin-bottom: 10px;
  font-size: 0.63rem;
}

.text-link {
  background: none;
  border: 0;
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: #34492c;
  line-height: 1.6;
  font-size: 0.875rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  overflow-wrap: anywhere;
}

.payment-list {
  display: grid;
  gap: 11px;
}

.payment-row {
  display: grid;
  align-items: center;
  background: #fff;
  padding: 21px 23px;
  border: 1px solid var(--line);
  border-radius: 12px;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  gap: 16px;
}

.tax-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: #f0ede5;
  border-radius: 11px;
  font-size: 0.85rem;
  font-weight: 600;
}

.payment-row:nth-child(2) .tax-icon {
  background: #e8e9f5;
}

.payment-row:nth-child(3) .tax-icon {
  background: #e6efeb;
}

.payment-row:nth-child(4) .tax-icon {
  background: #f6ecd9;
}

.payment-row h3 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.payment-row p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 0.8125rem;
}

.payment-row .row-amount {
  color: var(--ink);
  font-size: 1.03rem;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.row-amount small {
  font-weight: 400;
  font-size: 0.75rem;
}

.payment-row .button {
  padding: 10px 13px;
  font-size: 0.8125rem;
}

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

.payment-footnote {
  margin: 14px 0 0;
  font-size: 0.8125rem;
}

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

.paper-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 25px;
  min-width: 0;
}

.balance-card > header h2 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.paper-panel .section-heading h2 {
  font-size: 1rem;
}

.paper-panel .pill {
  border-color: var(--line);
}

.record-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.record-list li {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #edf0e9;
  padding: 17px 0;
  line-height: 1.5;
  font-size: 0.875rem;
  flex-wrap: wrap;
}

.record-list p {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.record-list small {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
  margin-top: 4px;
}

.record-list a {
  flex-shrink: 0;
  text-underline-offset: 3px;
  font-size: 0.8125rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.page-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 28px 0;
  margin-top: 40px;
  border-top: 1px solid var(--line);
}

.page-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.page-footer span {
  margin: 0 8px;
}

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

form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  min-width: 0;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
}

input:not([type='checkbox']), select {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid #b6c0ae;
  border-radius: 7px;
  background: #fcfdf9;
  color: var(--ink);
  min-height: 44px;
  font-size: 1rem;
  min-width: 0;
}

input[type='file'] {
  padding: 10px;
}

input[type='checkbox'] {
  width: 19px;
  height: 19px;
  accent-color: #34492c;
  flex-shrink: 0;
}

.check-label {
  min-height: 44px;
  padding: 8px 0;
  display: flex;
  gap: 10px;
  line-height: 1.6;
  font-weight: 400;
  font-size: 0.875rem;
  align-items: flex-start;
}

.check-label span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.field-help {
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.875rem;
}

.connection-detail {
  padding: 12px;
  background: #eaf0e3;
  border-radius: 7px;
}

#client-link-label {
  margin-top: 20px;
  margin-bottom: 10px;
}

.notice {
  padding: 16px;
  background: #e7eeda;
  border: 1px solid #9cb481;
  border-radius: 9px;
  font-size: 0.84rem;
}

.access-panel {
  max-width: 600px;
  padding: 60px 0;
}

.empty-state {
  padding: 30px;
  background: #f0f3ea;
  border-radius: 12px;
}

dialog {
  color: var(--ink);
  width: min(520px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  overflow-y: auto;
  max-height: calc(100dvh - 32px);
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: #182316a6;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-header .eyebrow {
  margin: 0;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #eff2e9;
  color: var(--ink);
  font-size: 1.5rem;
}

.payment-details {
  padding: 18px 0;
  margin: 0 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}

dialog .check-label {
  margin-bottom: 18px;
  padding: 12px;
  background: #fbf5e3;
  border-radius: 8px;
}

figure {
  margin: 20px 0;
  text-align: center;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 360px;
  margin: auto;
}

figcaption {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.8125rem;
}

#dialog-error {
  color: #a22222;
  margin-top: 18px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 10;
  padding: 15px;
  background: #fff;
  color: #222;
}

.skip-link:focus {
  top: 10px;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #684391;
  outline-offset: 4px;
}

.balance-card footer p {
  margin: 0;
  font-size: 0.8125rem;
}

.balance-amount > span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.payment-meta > span {
  min-width: 0;
}

.topbar p > span {
  margin: 0 10px;
}

nav a:hover:not([aria-current='page']) {
  background: #354033;
}

.balance-card footer span, .balance-card footer strong {
  display: block;
}

.balance-card footer span {
  margin-bottom: 7px;
}

.settings-grid .paper-panel > p {
  font-size: 0.875rem;
}

@media (prefers-reduced-motion: no-preference) {
  .button {
  transition: background-color 160ms ease;
}
}

.archive-section {
  margin-top: 24px;
}

.page-heading > div {
  flex: 1 1 320px;
  min-width: 0;
}

.page-heading > .button {
  flex-shrink: 0;
}

.payment-row > div {
  min-width: 0;
}

.payment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
}

@media (width <= 1199px) {
 .sidebar {
  position: static;
  width: 100%;
  height: auto;
  padding: 20px 28px;
  flex-flow: row wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  overflow-y: visible;
}

 .sidebar-label, .sidebar-note {
  display: none;
}

 nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

 nav a {
  min-height: 44px;
  padding: 12px 16px;
}


 main {
  margin-left: 0;
  padding: 0 28px;
}

 .topbar {
  padding: 24px 0;
}
}

@media (width <= 959px) {
 .summary-grid, .lower-grid, .settings-grid {
  grid-template-columns: minmax(0, 1fr);
}

 .summary-grid {
  gap: 16px;
}

 .sync-card dl {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

 .payment-row {
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

 .payment-row > button {
  grid-column: 2 / -1;
  justify-self: start;
}
}

@media (width <= 599px) {
 .sidebar {
  padding: 20px 16px 16px;
  gap: 20px;
}

 .brand {
  padding-left: 0;
}

 nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 8px;
}

 nav a {
  padding: 12px;
  font-size: 0.875rem;
  justify-content: center;
}

 main {
  padding: 0 16px;
}

 .topbar {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding: 20px 0;
}

 .topbar p {
  font-size: 0.625rem;
}

 h1 {
  font-size: clamp(2rem, 8vw, 2.75rem);
}

 .page-heading {
  gap: 20px;
  margin-bottom: 24px;
}

 .page-heading > div {
  flex-basis: 100%;
}

 dialog .button {
  width: 100%;
}

 .page-heading > .button {
  width: 100%;
}

 .eyebrow {
  line-height: 1.7;
}

 .balance-card, .sync-card, .paper-panel {
  padding: 20px;
}

 .balance-amount {
  font-size: clamp(2rem, 9vw, 3rem);
  margin-top: 28px;
}

 .balance-card footer {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

 .balance-card footer p {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  font-size: 0.875rem;
}

 .balance-card footer span {
  margin-bottom: 0;
}

 .section-heading {
  align-items: flex-start;
  gap: 12px;
}

 .payments-section {
  margin: 32px 0;
}

 .payment-row {
  padding: 18px;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px 12px;
}

 .tax-icon {
  width: 36px;
  height: 36px;
  align-self: start;
}

 .payment-row .row-amount {
  grid-column: 2;
  text-align: left;
  font-size: 1.25rem;
  white-space: normal;
}

 .payment-row > button {
  grid-column: 1 / -1;
  width: 100%;
  justify-self: stretch;
  font-size: 0.875rem;
}

 .record-list li {
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}

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

 dialog {
  width: calc(100% - 24px);
  max-height: calc(100dvh - 24px);
  padding: 20px;
}

 .payment-details {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

 .payment-details dd {
  text-align: left;
  margin-bottom: 12px;
}

 .access-panel {
  padding: 24px 0;
}
}

.taxpayer-controls {
  margin: 0 0 28px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

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

.topbar select {
  width: auto;
}

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

legend {
  font-size: 0.875rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}

.admin-item, .connection-item {
  padding: 20px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.admin-item label {
  margin-bottom: 10px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

#connection-list {
  margin-top: 24px;
}

#current-password-field {
  display: grid;
  gap: 12px;
}

.connection-help {
  margin-bottom: 24px;
}

summary {
  min-height: 44px;
  padding: 10px 0;
  font-weight: 600;
  cursor: pointer;
}

summary:focus-visible {
  outline: 3px solid #684391;
  outline-offset: 4px;
}

.help-steps {
  padding-left: 24px;
  line-height: 1.7;
}

.help-steps li {
  padding: 8px 0;
}

.help-image {
  max-width: 1200px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

body [hidden] {
  display: none;
}
