:root {
  color-scheme: light;
  --ink: #172126;
  --muted: #667178;
  --line: #d9e0df;
  --surface: #ffffff;
  --surface-soft: #f4f7f5;
  --green: #127a5a;
  --green-soft: #dff3eb;
  --blue: #285c8f;
  --yellow: #f0b53a;
  --red: #b84a4a;
  --shadow: 0 18px 48px rgba(32, 42, 46, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: #eef3f1;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #eef3f1;
}

.login-gate[hidden] {
  display: none;
}

.login-panel {
  width: min(100%, 470px);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 12px 0 8px;
  font-size: 2rem;
  line-height: 1.05;
}

.login-panel p {
  margin: 0 0 18px;
  color: var(--muted);
}

.login-panel label,
.login-panel small {
  display: block;
}

.login-panel label {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 750;
}

.login-panel input {
  width: 100%;
  min-height: 42px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-panel .primary-button {
  width: 100%;
}

.bankid-choice-grid {
  display: grid;
  gap: 12px;
}

.bankid-choice {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.bankid-choice:hover,
.bankid-choice:focus-visible {
  border-color: var(--green);
  box-shadow: 0 10px 26px rgba(18, 122, 90, 0.14);
  transform: translateY(-1px);
}

.bankid-choice-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
}

.bankid-choice strong,
.bankid-choice small {
  display: block;
}

.bankid-choice strong {
  margin-bottom: 3px;
  font-size: 1rem;
}

.bankid-choice small {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.bankid-active {
  display: grid;
  gap: 12px;
}

.bankid-active[hidden] {
  display: none;
}

.bankid-autostart {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 12px 26px rgba(18, 122, 90, 0.2);
  font-weight: 850;
  text-decoration: none;
}

.bankid-qr-shell {
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
}

.bankid-qr-shell[hidden] {
  display: none;
}

.bankid-qr-shell img {
  width: 220px;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.bankid-switch {
  color: var(--green);
  font-weight: 850;
}

.bankid-autostart[hidden] {
  display: none;
}

.login-panel small {
  margin-top: 12px;
  color: var(--muted);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.ghost-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 264px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  color: #f7fbfa;
  background: #172126;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #eaf7f1;
  box-shadow:
    0 0 0 1px rgba(229, 247, 239, 0.7),
    0 12px 24px rgba(4, 20, 16, 0.24);
  overflow: hidden;
}

.brand-mark svg,
.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-mark img {
  object-fit: cover;
}

.brand strong,
.brand span,
.account-card span,
.account-card small {
  display: block;
}

.brand span,
.account-card span,
.account-card small {
  color: rgba(247, 251, 250, 0.68);
  font-size: 0.82rem;
}

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

.nav-group-label {
  margin: 12px 10px 2px;
  color: rgba(247, 251, 250, 0.48);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-group-label:first-child {
  margin-top: 0;
}

.nav-group-label[hidden] {
  display: none;
}

.nav-list a {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: 8px;
  color: rgba(247, 251, 250, 0.78);
  text-decoration: none;
  font-weight: 650;
}

.nav-list a span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #bfe8d7;
}

.nav-list a.active,
.nav-list a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-list {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.account-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.account-card strong {
  display: block;
  margin: 5px 0 3px;
}

.company-switch-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
}

.company-switcher {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.company-switcher[hidden] {
  display: none;
}

.company-switcher button {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: left;
}

.company-switcher button.selected {
  border-color: var(--yellow);
}

.app-shell {
  min-height: 100vh;
  margin-left: 264px;
  padding: 28px;
}

.page-hidden {
  display: none !important;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.98;
}

h2 {
  font-size: 1.18rem;
}

.top-actions,
.panel-header,
.segmented-control,
.mail-forward,
.assistant-form,
.tax-preview,
.deadline-list li {
  display: flex;
  align-items: center;
}

.top-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.icon-button,
.primary-button,
.secondary-button,
.status-button,
.segmented-control button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.primary-button {
  padding: 0 15px;
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.secondary-button {
  padding: 0 13px;
}

.receipt-picker-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.receipt-native-picker {
  position: relative;
  overflow: hidden;
}

.danger-button {
  border-color: #f0b8aa;
  color: #9c2f1f;
}

.primary-button,
.secondary-button,
.status-button,
.secondary-link,
.icon-button {
  max-width: 100%;
}

button:disabled,
.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.status-strip article,
.home-work-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-strip article {
  padding: 16px;
}

.home-work-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
  padding: 16px;
}

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

.home-action-card {
  display: grid;
  gap: 7px;
  min-height: 126px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  color: var(--ink);
  text-decoration: none;
}

.home-action-card:hover {
  border-color: rgba(9, 131, 95, 0.42);
  background: #ffffff;
}

.home-action-card span,
.home-action-card small {
  color: var(--muted);
  font-size: 0.84rem;
}

.home-action-card span {
  font-weight: 800;
}

.home-action-card strong {
  font-size: 1.05rem;
}

.status-strip span,
.status-strip small,
.mail-forward span,
.tax-preview span,
.deadline-list small {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.status-strip strong {
  display: block;
  margin: 5px 0;
  font-size: 1.7rem;
}

.work-grid,
.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 12px;
  margin-bottom: 12px;
}

.interpretation-panel {
  margin-bottom: 12px;
}

#refreshReceiptsButton {
  align-self: flex-start;
}

.voucher-intake-card {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.voucher-intake-actions {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1fr);
  gap: 12px;
  align-items: stretch;
}

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

.voucher-flow article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.voucher-flow span {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-weight: 900;
}

.voucher-flow strong,
.voucher-flow small {
  min-width: 0;
}

.voucher-flow small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.25;
}

.receipt-workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}

.saved-receipts-panel {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.saved-receipts-panel[hidden] {
  display: none;
}

.saved-receipts-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-weight: 900;
}

.saved-receipts-panel summary::-webkit-details-marker {
  display: none;
}

.saved-receipts-panel summary::after {
  content: "▾";
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.saved-receipts-panel[open] summary::after {
  content: "▴";
}

.saved-receipts-panel summary strong {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.78rem;
}

.saved-receipts-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.saved-receipts-table {
  width: 100%;
  min-width: 620px;
  table-layout: fixed;
}

.saved-receipts-table th,
.saved-receipts-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-receipts-table th:nth-child(1),
.saved-receipts-table td:nth-child(1) {
  width: 120px;
}

.saved-receipts-table th:nth-child(3),
.saved-receipts-table td:nth-child(3),
.saved-receipts-table th:nth-child(4),
.saved-receipts-table td:nth-child(4) {
  width: 130px;
}

.saved-receipts-table tbody tr {
  cursor: pointer;
}

.saved-receipts-table tbody tr:hover,
.saved-receipts-table tbody tr.selected {
  background: #f7faf9;
}

.saved-receipts-table .empty-row td {
  color: var(--muted);
  cursor: default;
}

.receipt-browser,
.receipt-side-panel {
  min-width: 0;
}

.receipt-search {
  position: relative;
  display: block;
  margin-bottom: 12px;
}

.receipt-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 44px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
}

.receipt-search span {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.2rem;
}

.receipt-tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.receipt-tabs button {
  min-height: 42px;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.receipt-tabs button.selected {
  border-color: #e8b500;
  color: var(--ink);
}

.receipt-tabs span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  border-radius: 999px;
  background: #edf4f1;
  color: var(--muted);
  font-size: 0.78rem;
}

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

.receipt-table {
  min-width: 760px;
  table-layout: fixed;
}

.receipt-table th,
.receipt-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-table th:nth-child(1),
.receipt-table td:nth-child(1) {
  width: 110px;
}

.receipt-table th:nth-child(2),
.receipt-table td:nth-child(2) {
  width: 210px;
}

.receipt-table th:nth-child(3),
.receipt-table td:nth-child(3),
.receipt-table th:nth-child(4),
.receipt-table td:nth-child(4) {
  width: 96px;
}

.receipt-table th:nth-child(5),
.receipt-table td:nth-child(5) {
  width: 220px;
}

.receipt-table th:nth-child(6),
.receipt-table td:nth-child(6) {
  width: 120px;
}

.receipt-table tbody tr {
  cursor: pointer;
}

.receipt-table tbody tr:hover,
.receipt-table tbody tr.selected {
  background: #f7faf9;
}

.receipt-table .empty-row td {
  color: var(--muted);
  cursor: default;
}

.receipt-table .needs-review-cell {
  color: #8a5d00;
  font-weight: 850;
}

.receipt-side-panel {
  display: grid;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  color: var(--ink);
  overflow: hidden;
}

.receipt-side-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 34px;
  text-align: center;
}

.receipt-side-empty[hidden] {
  display: none;
}

.document-icon {
  width: 92px;
  height: 116px;
  border: 8px solid var(--green);
  border-radius: 12px;
  position: relative;
  opacity: 0.8;
}

.document-icon::before,
.document-icon::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
}

.document-icon::before {
  top: 26px;
}

.document-icon::after {
  top: 48px;
}

.receipt-detail {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(420px, 1fr);
  grid-template-rows: auto minmax(430px, 1fr);
  gap: 12px;
  min-height: 0;
  padding: 12px;
}

.receipt-detail[hidden] {
  display: none;
}

.receipt-detail.awaiting-document {
  grid-template-columns: 1fr;
}

.receipt-detail.awaiting-document .receipt-preview {
  grid-column: 1 / -1;
}

.receipt-detail.awaiting-document .receipt-list {
  display: none;
}

.receipt-detail-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.receipt-detail-head strong,
.receipt-detail-head span {
  display: block;
}

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

.receipt-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.booked-search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 240px);
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.booked-search-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 850;
}

.booked-search-panel input,
.booked-search-panel select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 750;
}

.booked-receipts-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.booked-receipts-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}

.booked-receipts-table th,
.booked-receipts-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booked-receipts-table th:nth-child(1),
.booked-receipts-table td:nth-child(1) {
  width: 120px;
}

.booked-receipts-table th:nth-child(4),
.booked-receipts-table td:nth-child(4) {
  width: 120px;
}

.booked-receipts-table tbody tr {
  cursor: pointer;
}

.booked-receipts-table tbody tr:hover,
.booked-receipts-table tbody tr.selected {
  background: #f7faf9;
}

.booked-receipts-table .empty-row td {
  color: var(--muted);
  cursor: default;
}

.booked-result-count {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 750;
}

.booked-receipt-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.booked-receipt-detail[hidden] {
  display: none;
}

.booked-receipt-preview {
  min-width: 0;
  min-height: 520px;
  max-height: 720px;
  overflow: hidden;
  border: 1px solid #9fb4ad;
  border-radius: 8px;
  background: var(--surface);
}

.booked-receipt-preview .receipt-preview-link {
  min-height: 520px;
  max-height: 720px;
}

.booked-receipt-preview .receipt-preview-stage {
  min-height: 520px;
  max-height: 720px;
  border: 0;
  place-items: center;
}

.booked-receipt-preview img,
.booked-receipt-preview iframe {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 720px;
  min-height: 0;
  object-fit: contain;
}

.booked-receipt-facts {
  align-self: start;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.booked-facts-heading strong,
.booked-facts-heading span {
  display: block;
}

.booked-facts-heading span {
  color: var(--muted);
  font-size: 0.86rem;
}

.booked-facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.booked-facts-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #cfe0da;
  border-radius: 8px;
  background: #eef7f3;
}

.booked-facts-grid dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.booked-facts-grid dd {
  margin: 2px 0 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.booked-purchase-items {
  margin-top: 0;
}

.booked-original-link {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.receipt-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.receipt-preview.upload-zone {
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  border-style: solid;
  background: var(--surface);
}

.receipt-preview.upload-zone > input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.receipt-preview.upload-zone.is-dragging {
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px rgba(18, 122, 90, 0.18);
}

.receipt-preview.has-document {
  cursor: zoom-in;
}

.receipt-preview-document {
  width: 100%;
  height: 100%;
  min-height: 430px;
  display: grid;
  place-items: center;
}

.receipt-preview-link {
  width: 100%;
  height: 100%;
  min-height: 430px;
  display: grid;
  color: inherit;
  text-decoration: none;
}

.receipt-preview-stage {
  position: relative;
  width: 100%;
  min-height: 430px;
  display: grid;
  place-items: start center;
}

.receipt-preview img,
.receipt-preview iframe {
  width: 100%;
  height: auto;
  min-height: 430px;
  border: 0;
  object-fit: contain;
  background: var(--surface);
}

.receipt-preview-empty {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 28px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.receipt-email-preview {
  display: grid;
  gap: 12px;
  align-content: start;
  width: 100%;
  min-height: 100%;
  padding: 18px;
  color: var(--ink);
}

.receipt-email-preview strong {
  font-size: 1rem;
}

.receipt-email-preview pre {
  max-height: 680px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink);
  font: 0.86rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.receipt-preview-empty .receipt-visual {
  width: 92px;
  min-height: 116px;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(23, 33, 38, 0.12);
}

.receipt-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.quick-expense-toggle {
  grid-column: 1 / -1;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
}

.quick-expense-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

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

.receipt-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.receipt-edit-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.receipt-edit-form[hidden] {
  display: none;
}

.receipt-edit-form label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.receipt-edit-form label[hidden] {
  display: none;
}

.receipt-periodization,
.receipt-currency-conversion {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.receipt-periodization[hidden],
.receipt-currency-conversion[hidden],
.receipt-periodization-fields[hidden] {
  display: none;
}

.receipt-currency-conversion {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.receipt-currency-conversion p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.receipt-periodization .checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 0.95rem;
}

.receipt-periodization .checkbox-row input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.receipt-periodization-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.receipt-periodization-fields small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.82rem;
}

.receipt-edit-form .document-kind-field {
  grid-column: 1 / -1;
}

.document-kind-guidance {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid #b8d9cf;
  border-radius: 8px;
  background: #eef8f4;
  color: #24443c;
  font-size: 0.9rem;
  font-weight: 750;
}

.receipt-edit-form .purchase-items,
.receipt-edit-form .validation-warnings {
  grid-column: 1 / -1;
}

.receipt-edit-form input,
.receipt-edit-form select {
  width: 100%;
  min-height: 38px;
  margin-top: 4px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.receipt-edit-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.receipt-card-main strong,
.receipt-numbers span,
.receipt-numbers strong {
  display: block;
}

.receipt-numbers span {
  color: var(--muted);
  font-size: 0.84rem;
}

.purchase-items {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.purchase-items[hidden] {
  display: none;
}

.purchase-items ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.purchase-items li {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid #cfe0da;
  border-radius: 999px;
  background: #eef7f3;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.validation-warnings {
  margin: 8px 0 0;
  padding: 8px 10px 8px 26px;
  border: 1px solid #f3d590;
  border-radius: 8px;
  background: #fff8e7;
  color: #7a5300;
  font-size: 0.82rem;
  font-weight: 700;
}

.validation-warnings[hidden] {
  display: none;
}

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

.receipt-numbers div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
}

.receipt-numbers strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.receipt-detail .receipt-list {
  align-self: stretch;
  align-content: start;
}

.receipt-detail .receipt-card {
  grid-template-columns: 1fr;
  max-height: none;
  background: var(--surface);
  color: var(--ink);
}

.receipt-detail .receipt-actions {
  justify-content: flex-start;
  padding-top: 0;
}

.receipt-card.is-busy {
  position: relative;
}

.receipt-busy {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 10px 12px;
  border: 1px solid #b6ddd0;
  border-radius: 8px;
  background: #edf8f4;
  color: #07543d;
  font-weight: 800;
}

.busy-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 3px solid rgba(7, 84, 61, 0.2);
  border-top-color: #0b7f5d;
  border-radius: 999px;
  animation: busySpin 0.8s linear infinite;
}

@keyframes busySpin {
  to {
    transform: rotate(360deg);
  }
}

.receipt-action-break {
  flex-basis: 100%;
  height: 0;
}

.receipt-detail .receipt-edit-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.required-marker {
  color: #a35b00;
  font-weight: 900;
}

.required-explanation {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.secondary-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 850;
  text-decoration: none;
}

.confidence {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 850;
}

.payment-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #e7eef8;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 850;
}

.confidence.low {
  background: #fff1cf;
  color: #8a5d00;
}

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

.panel-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-header.compact {
  align-items: flex-start;
}

.segmented-control {
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segmented-control button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.segmented-control button.selected {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(23, 33, 38, 0.12);
}

.bank-upload {
  display: flex;
  gap: 8px;
  margin: 0;
}

.bank-upload input {
  display: none;
}

.bank-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 14px;
  border: 1px solid #f3d590;
  border-radius: 8px;
  background: #fff8e7;
  color: #7a5300;
  margin-bottom: 12px;
}

.bank-status.ready {
  border-color: #a9ddc6;
  background: var(--green-soft);
  color: var(--green);
}

.bank-status.blocked {
  border-color: #f3d590;
  background: #fff8e7;
  color: #7a5300;
}

.bank-status span {
  font-size: 0.84rem;
}

.bank-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--ink);
}

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

.bank-list {
  display: grid;
  gap: 8px;
}

.bank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.bank-row strong,
.bank-row small {
  display: block;
}

.bank-row small,
.bank-row em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.bank-row:not(.matched) em {
  color: #8a5d00;
  font-weight: 850;
}

.bank-row.matched {
  border-color: #cce7db;
  background: #f7fbf9;
}

.bank-match {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.bank-match[hidden] {
  display: none;
}

.bank-match select {
  min-height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.bank-match label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.reconciliation-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  align-items: start;
}

.reconciliation-grid .bank-panel,
.reconciliation-grid .payments-panel {
  align-content: start;
}

.reconciliation-grid .panel-header {
  align-items: flex-start;
}

.reconciliation-grid .payment-center {
  grid-template-columns: 1fr;
}

.reconciliation-grid .payment-center article {
  min-height: auto;
  background: #f7faf9;
}

.invoice-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.payroll-panel {
  margin-bottom: 12px;
}

.fixed-asset-panel {
  margin-bottom: 12px;
}

.accrual-panel {
  margin-bottom: 12px;
}

.payroll-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.payroll-actions input {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.payroll-tabs {
  justify-content: flex-start;
  margin-bottom: 12px;
}

.payroll-section {
  display: grid;
  gap: 12px;
}

.payroll-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.payroll-section-head h3 {
  margin: 0;
}

.payroll-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) minmax(240px, 0.9fr);
  gap: 12px;
}

.employee-grid,
.attendance-grid,
.payroll-run-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: 12px;
}

.payroll-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.payroll-form strong,
.payroll-form button {
  grid-column: 1 / -1;
}

.payroll-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.payroll-form input,
.payroll-form select {
  min-height: 38px;
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.attendance-calendar {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.attendance-calendar-head,
.attendance-calendar-week,
.attendance-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.attendance-calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.attendance-calendar-week span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-align: center;
}

.attendance-day {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
}

.attendance-day.is-outside {
  opacity: 0.35;
}

.attendance-day.has-sick-leave {
  border-color: rgba(154, 88, 0, 0.35);
  background: #fff8e5;
  color: #7a5200;
}

.payroll-modal {
  width: min(760px, calc(100vw - 28px));
}

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

.payroll-run-side {
  display: grid;
  gap: 12px;
}

.payroll-summary article {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.payroll-summary span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.payroll-summary strong {
  font-size: 1.35rem;
}

.payroll-readiness {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

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

.payroll-readiness li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.payroll-readiness li > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff3cf;
  color: #805200;
  font-weight: 900;
}

.payroll-readiness li.passed > span {
  background: #dff6ef;
  color: var(--green);
}

.payroll-readiness small {
  color: var(--muted);
  font-weight: 750;
}

.payroll-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.payroll-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.payroll-row small {
  display: block;
  color: var(--muted);
}

.payroll-row span {
  color: var(--green);
  font-weight: 850;
}

.workflow-help {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(18, 122, 90, 0.2);
  border-radius: 8px;
  background: #effaf6;
}

.workflow-help p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
}

.fixed-asset-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.25fr);
  gap: 12px;
}

.fixed-asset-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.fixed-asset-form strong,
.fixed-asset-form button {
  grid-column: 1 / -1;
}

.fixed-asset-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.fixed-asset-form input {
  min-height: 38px;
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.fixed-asset-list {
  display: grid;
  gap: 8px;
}

.fixed-asset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fixed-asset-row small {
  display: block;
  color: var(--muted);
}

.fixed-asset-row span {
  color: var(--green);
  font-weight: 850;
}

.accrual-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.25fr);
  gap: 12px;
}

.accrual-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.accrual-form strong,
.accrual-form button {
  grid-column: 1 / -1;
}

.accrual-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.accrual-form input,
.accrual-form select {
  min-height: 38px;
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.accrual-list {
  display: grid;
  gap: 8px;
}

.accrual-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.accrual-row small {
  display: block;
  color: var(--muted);
}

.accrual-row span {
  color: var(--green);
  font-weight: 850;
}

.ledger-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

#ledger {
  display: grid;
  gap: 12px;
}

.workflow-section {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.workflow-section summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  color: var(--ink);
  font-weight: 850;
  list-style: none;
}

.workflow-section summary::-webkit-details-marker {
  display: none;
}

.workflow-section summary::after {
  content: "Öppna";
  flex: 0 0 auto;
  min-width: 72px;
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--green);
  font-size: 0.82rem;
  text-align: center;
}

.workflow-section[open] summary::after {
  content: "Stäng";
}

.workflow-section summary small {
  flex: 1 1 260px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.workflow-section > :not(summary) {
  margin-top: 12px;
}

.invoice-aging {
  order: 1;
}

.invoice-lists {
  order: 2;
}

.outbox-panel {
  order: 3;
}

.invoice-panel .workflow-section {
  order: 4;
}

#ledger .table-wrap {
  order: 1;
}

#ledger .workflow-section {
  order: 3;
}

.ledger-source-panel {
  display: grid;
  gap: 10px;
  order: 2;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.ledger-source-preview {
  min-height: 280px;
  max-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.ledger-source-preview img,
.ledger-source-preview iframe {
  display: block;
  width: 100%;
  height: 520px;
  border: 0;
  object-fit: contain;
}

tr.selected {
  background: var(--green-soft);
}

tr[data-clickable],
tbody tr {
  cursor: pointer;
}

.import-status {
  min-height: 20px;
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.settings-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
}

.audit-panel,
.document-archive-panel {
  margin-bottom: 12px;
}

.system-admin-panel:not([hidden]) {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.audit-list {
  display: grid;
  gap: 8px;
}

.archive-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(160px, 220px);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.archive-filter-bar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.archive-filter-bar input,
.archive-filter-bar select {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.archive-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.archive-summary span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7faf9;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.document-archive-list {
  display: grid;
  gap: 8px;
}

.document-archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.document-archive-row span {
  display: inline-block;
  margin-bottom: 3px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.document-archive-row small,
.document-archive-meta small {
  display: block;
  color: var(--muted);
  font-weight: 750;
}

.document-archive-meta {
  min-width: 120px;
  text-align: right;
}

.audit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.audit-row small {
  display: block;
  color: var(--muted);
}

.audit-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.readiness-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.readiness-row > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-weight: 950;
}

.readiness-row.ok > span {
  background: #dff6ec;
  color: var(--green);
}

.readiness-row.blocked > span {
  background: #fff1c9;
  color: #8a5b00;
}

.settings-panel small {
  color: var(--muted);
  font-weight: 750;
}

.settings-sections {
  display: grid;
  gap: 12px;
}

.settings-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.settings-section h3 {
  margin: 0;
}

.settings-section small {
  display: block;
  margin-top: 3px;
}

.role-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.role-access-grid article {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.role-access-grid span {
  color: var(--muted);
  font-weight: 700;
}

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

.settings-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.settings-form label:nth-child(3),
.settings-form label:nth-child(5) {
  grid-column: span 2;
}

.settings-form input,
.settings-form select {
  min-height: 38px;
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

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

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

.inline-mail-forward {
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.compact-form {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: end;
}

.compact-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.admin-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.admin-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.admin-section-head h3,
.admin-section-head small {
  margin: 0;
}

.admin-section-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

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

.admin-actions-section .settings-form {
  grid-template-columns: 1fr;
}

.admin-actions-section h3 {
  margin: 0;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  grid-template-columns: none !important;
}

.checkbox-row input {
  width: auto;
  min-height: auto;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-list > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-list strong,
.compact-list small {
  display: block;
}

.compact-list small {
  color: var(--muted);
}

.admin-user-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.admin-memberships {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.admin-memberships span,
.admin-memberships em {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.admin-memberships em {
  background: #f0f3f2;
  color: var(--muted);
}

.admin-system-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.admin-company-card {
  display: grid;
  gap: 12px;
}

.admin-company-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.admin-fiscal-years {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.admin-fiscal-years span {
  padding: 5px 8px;
  border-radius: 8px;
  background: #f0f7f4;
  border: 1px solid var(--line);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.admin-company-edit button {
  grid-column: auto;
}

.admin-user-company-slot {
  margin-top: 10px;
}

.admin-user-company-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.5fr) auto;
  gap: 8px;
  align-items: end;
}

.admin-user-company-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.admin-user-company-form select {
  min-height: 36px;
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.admin-memberships span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.admin-memberships button {
  width: 22px;
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  color: var(--green);
  cursor: pointer;
  font-weight: 900;
}

.admin-modal {
  width: min(520px, calc(100vw - 28px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(20, 31, 38, 0.24);
}

.admin-modal::backdrop {
  background: rgba(21, 31, 34, 0.34);
}

.modal-head {
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.modal-head h3 {
  margin: 0;
}

.settings-form button {
  align-self: end;
  min-height: 38px;
}

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

.invoice-form,
.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.invoice-form strong,
.invoice-form button,
.contact-form strong,
.contact-form button,
.contact-list {
  grid-column: 1 / -1;
}

.invoice-form label,
.contact-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.invoice-form input,
.invoice-form select,
.contact-form input,
.contact-form select {
  min-height: 38px;
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.invoice-lines-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.invoice-line-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.8fr) minmax(80px, 0.6fr) minmax(96px, 0.7fr) minmax(80px, 0.6fr) minmax(170px, 1.2fr) 40px;
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.invoice-line-row label {
  min-width: 0;
}

.invoice-line-remove {
  align-self: end;
  width: 38px;
  height: 38px;
}

.invoice-lists {
  margin-top: 12px;
}

.contact-workspace {
  margin-top: 12px;
}

.outbox-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.mini-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.mini-header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.outbox-list {
  display: grid;
  gap: 8px;
}

.outbox-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.outbox-row small {
  display: block;
  color: var(--muted);
}

.outbox-row span {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 850;
}

.tax-account-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

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

.tax-account-grid article {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tax-account-grid span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.tax-account-grid strong {
  font-size: 1rem;
}

.tax-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.migration-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.go-live-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf4;
}

.switch-wizard-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f8fb;
}

.switch-wizard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #c9d8e3;
  border-radius: 8px;
  background: var(--surface);
}

.switch-wizard-hero span,
.switch-wizard-hero small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.switch-wizard-hero strong {
  display: block;
  margin: 3px 0;
  font-size: 1.12rem;
}

.switch-wizard-steps {
  display: grid;
  gap: 8px;
}

.switch-wizard-steps article {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.switch-wizard-steps article.active {
  border-color: #9fc7bc;
  background: #eef7f3;
}

.switch-wizard-steps article > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #edf4f1;
  color: var(--muted);
  font-weight: 900;
}

.switch-wizard-steps article.passed > span {
  background: #dff4e9;
  color: var(--green);
}

.switch-wizard-steps small {
  display: block;
  color: var(--muted);
}

.switch-wizard-steps button:disabled {
  cursor: default;
  opacity: 0.45;
}

.migration-score {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.go-live-score,
.go-live-next-step,
.year-end-next-step {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.go-live-next-step,
.year-end-next-step {
  grid-template-columns: minmax(0, 1fr) auto;
  border-color: #dfd6ae;
  background: #fff9df;
}

.migration-score span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.go-live-score span,
.go-live-next-step span,
.go-live-next-step small,
.year-end-next-step span,
.year-end-next-step small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.go-live-score strong,
.go-live-next-step strong,
.year-end-next-step strong {
  display: block;
  margin: 3px 0;
  font-size: 1.05rem;
}

.migration-score strong {
  display: block;
  font-size: 1.25rem;
}

.migration-progress {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e2ece8;
}

.migration-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 220ms ease;
}

.migration-next-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #c7ddd5;
  border-radius: 8px;
  background: #eef7f3;
}

.migration-next-step span,
.migration-next-step small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.migration-next-step strong {
  display: block;
  margin: 3px 0;
  font-size: 1.05rem;
}

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

.migration-metrics article {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.migration-metrics span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

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

.migration-preview,
.migration-import-log {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.migration-preview[hidden] {
  display: none;
}

.migration-preview-list,
.migration-run-list {
  display: grid;
  gap: 8px;
}

.migration-preview-list div,
.migration-run {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.migration-run-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.migration-run-head small,
.migration-run-head span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.migration-run-items {
  display: grid;
  gap: 6px;
}

.migration-preview-list div,
.migration-run-items div {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface);
}

.migration-run-items span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #edf4f1;
  color: var(--muted);
  font-weight: 900;
}

.migration-preview-list .importable span,
.migration-run-items .imported span {
  background: #dff4e9;
  color: var(--green);
}

.migration-preview-list .blocked span {
  background: #fff1cf;
  color: #8a5d00;
}

.migration-preview-list small,
.migration-preview-list em,
.migration-run-items small,
.migration-run-items em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 750;
}

.migration-checks,
.go-live-checks {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.migration-checks li,
.go-live-checks li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.migration-checks li > span,
.go-live-checks li > span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #edf4f1;
  color: var(--muted);
  font-weight: 900;
}

.migration-checks li.passed > span,
.go-live-checks li.passed > span {
  background: #dff4e9;
  color: var(--green);
}

.migration-checks small,
.go-live-checks small {
  display: block;
  color: var(--muted);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--green);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.attention-pulse {
  outline: 3px solid rgba(28, 108, 85, 0.24);
  outline-offset: 3px;
}

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

.contact-import-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--muted);
  font-weight: 750;
}

.invoice-import-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--muted);
  font-weight: 750;
}

.contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.contact-row small {
  display: block;
  color: var(--muted);
}

.inline-agreement-end-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.2fr) auto;
  gap: 8px;
  align-items: end;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.inline-agreement-end-form label,
.form-note {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.inline-agreement-end-form input {
  width: 100%;
}

.form-note {
  min-height: 18px;
}

.form-note a {
  color: var(--green);
  font-weight: 850;
}

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

.invoice-aging article {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.invoice-aging span,
.invoice-aging small,
.invoice-aging em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 750;
}

.invoice-aging strong {
  font-size: 1.25rem;
}

.invoice-aging div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.invoice-lists h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.invoice-list {
  display: grid;
  gap: 8px;
}

.invoice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.invoice-row small {
  display: block;
  color: var(--muted);
}

.invoice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.year-end-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #f3d590;
  border-radius: 8px;
  background: #fff8e7;
  color: #7a5300;
  margin-bottom: 10px;
}

.year-end-card.ready {
  border-color: #a9ddc6;
  background: var(--green-soft);
  color: var(--green);
}

.year-end-card strong,
.year-end-card span {
  display: block;
}

.year-end-card span {
  font-size: 0.84rem;
}

.year-end-checks {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.year-end-checks li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.year-end-checks span {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
}

.year-end-checks .passed span {
  background: var(--green-soft);
  color: var(--green);
}

.year-end-checks .blocked span {
  background: #fff1cf;
  color: #8a5d00;
}

.year-end-checks strong,
.year-end-checks small {
  display: block;
}

.year-end-checks small {
  color: var(--muted);
  font-size: 0.82rem;
}

.authority-readiness-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

.authority-readiness-checks {
  max-height: 420px;
  overflow: auto;
}

.authority-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.authority-source {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 5px 8px;
  text-decoration: none;
}

.year-end-closing-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.corporate-tax-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.tax-adjustment-guide {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(18, 122, 90, 0.2);
  border-radius: 8px;
  background: #effaf6;
}

.tax-adjustment-guide p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
}

.tax-adjustment-advanced {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tax-adjustment-advanced summary {
  display: grid;
  gap: 3px;
  padding: 12px;
  cursor: pointer;
  font-weight: 850;
}

.tax-adjustment-advanced summary small {
  color: var(--muted);
  font-weight: 650;
}

.tax-adjustment-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}

.tax-adjustment-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.tax-adjustment-form label.wide {
  grid-column: span 3;
}

.tax-adjustment-form input,
.tax-adjustment-form select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.tax-adjustment-form button {
  align-self: end;
}

.closing-result {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.closing-result span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.closing-result strong {
  font-size: 1.2rem;
}

.report-warnings {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.report-warnings li {
  padding: 8px 10px;
  border: 1px solid #f3d590;
  border-radius: 8px;
  background: #fff8e7;
  color: #7a5300;
  font-size: 0.82rem;
  font-weight: 750;
}

.upload-zone {
  min-height: 180px;
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
  padding: 22px;
  border: 1.5px dashed #96aaa2;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(18, 122, 90, 0.08), rgba(40, 92, 143, 0.06)),
    var(--surface-soft);
}

.upload-preview-zone {
  min-height: 240px;
  cursor: pointer;
}

.upload-zone.is-dragging {
  border-color: var(--green);
  background: var(--green-soft);
}

.expense-options {
  display: grid;
  grid-template-columns: auto minmax(180px, 260px);
  gap: 12px;
  align-items: end;
  margin-top: 0;
}

.toggle-row {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  color: var(--ink);
  font-weight: 750;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.reimbursement-field {
  display: none;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.reimbursement-field.is-visible {
  display: block;
}

.reimbursement-field input {
  width: 100%;
  min-height: 38px;
  margin-top: 4px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upload-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-zone .receipt-native-picker input {
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  z-index: 2;
  font-size: 120px;
  opacity: 0.01;
  cursor: pointer;
  color: transparent;
  pointer-events: auto;
}

.upload-zone strong,
.upload-zone span {
  display: block;
}

.upload-zone strong {
  font-size: 1.45rem;
}

.upload-zone span {
  max-width: 520px;
  margin-top: 6px;
  color: var(--muted);
}

.receipt-visual {
  width: 100%;
  min-height: 196px;
  padding: 18px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(23, 33, 38, 0.16);
}

.receipt-visual div {
  height: 28px;
  margin-bottom: 18px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--green), var(--yellow));
}

.receipt-visual span {
  height: 8px;
  margin: 10px 0;
  border-radius: 999px;
  background: #d8e2df;
}

.receipt-visual span:last-child {
  width: 58%;
  background: #a8b8b2;
}

.voucher-upload-content {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
}

.voucher-upload-content .segmented-control {
  width: min(100%, 560px);
}

.mail-forward {
  justify-content: space-between;
  gap: 14px;
  margin-top: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.integration-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.payment-center article {
  display: grid;
  gap: 5px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.payment-center span,
.payment-center small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.payment-center strong {
  font-size: 1.25rem;
}

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

.payment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.payment-row small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.payment-row > span {
  color: var(--green);
  font-weight: 850;
  white-space: nowrap;
}

.payments-panel {
  display: grid;
  gap: 12px;
}

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

.assistant-panel {
  display: grid;
  gap: 10px;
}

.assistant-thread {
  flex: 1;
  min-height: 140px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: #2a363b;
}

.assistant-thread p {
  margin: 0 0 12px;
}

.assistant-form {
  gap: 8px;
  margin-top: 12px;
}

.assistant-form input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ai-assistant-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(9, 102, 77, 0.25);
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(12, 31, 35, 0.24);
}

.ai-assistant-panel {
  position: fixed;
  right: 22px;
  bottom: 78px;
  z-index: 90;
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto auto;
  width: min(420px, calc(100vw - 28px));
  max-height: min(640px, calc(100vh - 112px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(12, 31, 35, 0.28);
}

.ai-assistant-panel.is-hidden {
  display: none;
}

.ai-assistant-panel.is-minimized {
  grid-template-rows: auto;
}

.ai-assistant-panel.is-minimized .assistant-thread,
.ai-assistant-panel.is-minimized .quick-question-row,
.ai-assistant-panel.is-minimized .assistant-form {
  display: none;
}

.ai-assistant-head,
.ai-assistant-actions,
.quick-question-row {
  display: flex;
  align-items: center;
}

.ai-assistant-head {
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  cursor: move;
  touch-action: none;
}

.ai-assistant-head h3 {
  margin: 0;
  font-size: 1rem;
}

.ai-assistant-actions {
  gap: 6px;
}

.quick-question-row {
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.quick-question-row button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 800;
}

.year-flow {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.year-flow-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(9, 102, 77, 0.24);
  border-radius: 8px;
  background: #effaf6;
}

.year-flow-summary > div {
  display: grid;
  gap: 3px;
}

.year-flow-summary strong {
  font-size: 1rem;
}

.year-flow-summary span {
  color: var(--muted);
  font-weight: 700;
}

.year-flow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.year-flow-steps li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.year-flow-steps li > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff3cf;
  color: #805200;
  font-weight: 900;
}

.year-flow-steps li.is-done > span {
  background: #dff6ef;
  color: var(--green);
}

.year-flow-steps li.is-active {
  border-color: rgba(9, 102, 77, 0.45);
  background: #f0fbf7;
}

.year-flow-steps strong,
.year-flow-steps small {
  display: block;
}

.year-flow-steps small {
  margin-top: 3px;
  color: var(--muted);
}

.report-section-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 18px 0 10px;
  padding-top: 4px;
}

.report-section-heading > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--green);
  color: #ffffff;
  font-weight: 900;
}

.report-section-heading strong,
.report-section-heading small {
  display: block;
}

.report-section-heading small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}

.manual-ledger-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.manual-ledger-head,
.manual-ledger-line,
.manual-ledger-actions {
  display: grid;
  gap: 10px;
}

.manual-ledger-head {
  grid-template-columns: 160px minmax(0, 1fr);
}

.manual-ledger-line {
  grid-template-columns: minmax(190px, 1fr) minmax(100px, 0.45fr) minmax(100px, 0.45fr) 38px;
  align-items: end;
}

.manual-ledger-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.manual-ledger-form input,
.manual-ledger-form select {
  min-height: 38px;
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.manual-ledger-actions {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.manual-ledger-actions strong {
  color: #9a6a07;
  text-align: center;
}

.manual-ledger-actions strong.is-balanced {
  color: var(--green);
}

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

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

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

td select {
  min-height: 34px;
  width: 100%;
  min-width: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.status-button {
  min-height: 32px;
  padding: 0 10px;
  border-color: transparent;
  background: var(--green-soft);
  color: var(--green);
}

.status-button.needs-review {
  background: #fff1cf;
  color: #8a5d00;
}

.ledger-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ledger-row-actions .icon-button {
  width: 32px;
  min-height: 32px;
}

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

.deadline-list li {
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.deadline-list li div {
  min-width: 0;
  flex: 1;
}

.done,
.pending {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  font-weight: 900;
}

.done {
  background: var(--green-soft);
  color: var(--green);
}

.pending {
  background: #fff1cf;
  color: #9a6a07;
}

.tax-preview {
  gap: 8px;
  margin-top: 12px;
}

.tax-preview div {
  flex: 1;
  padding: 14px;
  border-radius: 8px;
  background: #f7faf9;
}

.tax-preview strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
}

.financial-report {
  margin-top: 14px;
}

.financial-summary,
.financial-columns {
  display: grid;
  gap: 8px;
}

.financial-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.financial-summary div,
.financial-columns section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.financial-summary span,
.financial-line span {
  color: var(--muted);
  font-size: 0.84rem;
}

.financial-summary strong {
  display: block;
  margin-top: 4px;
}

.financial-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
}

.financial-columns h3,
.financial-columns h4 {
  margin: 0;
}

.financial-columns h4 {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.financial-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.financial-line.total {
  border-bottom: 0;
  font-weight: 850;
}

@media (max-width: 1060px) {
  .sidebar {
    position: static;
    width: auto;
    flex-direction: row;
    align-items: center;
    padding: 14px;
  }

  .nav-list {
    grid-auto-flow: column;
    overflow-x: auto;
    min-width: 0;
    padding-bottom: 2px;
    overscroll-behavior-inline: contain;
  }

  .nav-group-label {
    display: none;
  }

  .nav-list a {
    white-space: nowrap;
  }

  .account-card {
    display: none;
  }

  .app-shell {
    margin-left: 0;
    padding: 18px;
  }

  .status-strip,
  .home-work-grid,
  .work-grid,
  .split-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .receipt-card {
    grid-template-columns: 1fr;
  }

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

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

  .receipt-actions {
    justify-content: flex-start;
  }

  .expense-options {
    grid-template-columns: 1fr;
  }

  .invoice-workspace,
  .invoice-aging,
  .contact-workspace,
  .invoice-lists,
  .payment-center,
  .payroll-grid,
  .fixed-asset-grid,
  .accrual-grid,
  .tax-account-grid,
  .settings-form {
    grid-template-columns: 1fr;
  }

  .settings-form label:nth-child(3),
  .settings-form label:nth-child(5) {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  body {
    background: #f2f6f4;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .brand {
    justify-content: flex-start;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 1rem;
  }

  .brand span {
    font-size: 0.76rem;
  }

  .nav-list {
    display: flex;
    gap: 6px;
    margin: 0 -2px;
    padding: 0 2px 4px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav-group-label {
    display: none;
  }

  .nav-list a {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 0.86rem;
  }

  .nav-list a span {
    width: 18px;
    height: 18px;
  }

  .app-shell {
    padding: 14px 10px 24px;
  }

  .topbar,
  .panel-header,
  .mail-forward,
  .mini-header,
  .admin-section-head,
  .receipt-detail-head,
  .receipt-detail-actions,
  .year-end-card,
  .closing-result {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 14px;
    margin-bottom: 14px;
  }

  h1 {
    font-size: 2.2rem;
    line-height: 1;
  }

  h2 {
    font-size: 1.06rem;
    line-height: 1.18;
  }

  .top-actions,
  .ledger-tools,
  .bank-upload,
  .invoice-actions,
  .tax-account-actions,
  .migration-actions,
  .receipt-actions,
  .receipt-edit-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
  }

  .top-actions .primary-button,
  .ledger-tools .secondary-button,
  .bank-upload .secondary-button,
  .mail-forward .secondary-button,
  .migration-actions button,
  .invoice-actions button,
  .tax-account-actions button,
  .receipt-actions button,
  .receipt-edit-actions button,
  .secondary-link {
    flex: 1 1 150px;
  }

  .icon-button {
    flex: 0 0 38px;
  }

  .status-strip,
  .home-work-grid,
  .work-grid,
  .split-grid,
  .voucher-flow,
  .voucher-intake-actions,
  .receipt-workbench,
  .invoice-workspace,
  .contact-workspace,
  .invoice-lists,
  .invoice-aging,
  .payment-center,
  .payroll-grid,
  .fixed-asset-grid,
  .accrual-grid,
  .tax-account-grid,
  .financial-summary,
  .financial-columns,
  .migration-metrics {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(32, 42, 46, 0.08);
  }

  .panel-header {
    gap: 10px;
    margin-bottom: 12px;
  }

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

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

  .upload-zone {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 14px;
    padding: 16px;
  }

  .upload-preview-zone {
    min-height: auto;
  }

  .upload-zone strong {
    font-size: 1.1rem;
  }

  .receipt-visual {
    width: 72px;
    height: 94px;
    padding: 10px;
  }

  .receipt-visual div {
    height: 18px;
    margin-bottom: 12px;
  }

  .expense-options,
  .receipt-numbers,
  .payroll-summary,
  .fixed-asset-summary,
  .accrual-summary {
    grid-template-columns: 1fr;
  }

  .receipt-tabs {
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 1px;
  }

  .receipt-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .receipt-side-panel {
    min-height: auto;
  }

  .receipt-side-empty {
    min-height: 260px;
    padding: 24px;
  }

  .receipt-detail {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .receipt-preview,
  .ledger-source-preview {
    min-height: 280px;
  }

  .receipt-preview img,
  .receipt-preview iframe,
  .ledger-source-preview img,
  .ledger-source-preview iframe {
    min-height: 280px;
  }

  .receipt-card {
    grid-template-columns: 1fr;
  }

  .manual-ledger-head,
  .manual-ledger-line,
  .manual-ledger-actions {
    grid-template-columns: 1fr;
  }

  .receipt-numbers {
    grid-template-columns: 1fr;
  }

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

  .receipt-periodization-fields {
    grid-template-columns: 1fr;
  }

  .top-actions,
  .tax-preview {
    flex-wrap: wrap;
  }

  .financial-summary,
  .financial-columns,
  .year-flow-steps,
  .archive-filter-bar,
  .tax-adjustment-form {
    grid-template-columns: 1fr;
  }

  .tax-adjustment-form label.wide {
    grid-column: auto;
  }

  .primary-button {
    flex: 1;
  }

  .upload-zone {
    grid-template-columns: 1fr;
  }

  .invoice-form,
  .invoice-line-row,
  .contact-form,
  .admin-company-edit,
  .admin-user-card,
  .admin-user-company-form,
  .payroll-form,
  .fixed-asset-form,
  .accrual-form,
  .payment-center,
  .payment-row,
  .payroll-summary,
  .payroll-row,
  .fixed-asset-row,
  .accrual-row,
  .settings-form,
  .invoice-row,
  .audit-row,
  .document-archive-row,
  .outbox-row,
  .contact-row,
  .inline-agreement-end-form,
  .migration-score,
  .go-live-score,
  .go-live-next-step,
  .year-end-next-step,
  .migration-next-step,
  .switch-wizard-hero,
  .switch-wizard-steps article,
  .migration-checks li,
  .go-live-checks li,
  .migration-preview-list div,
  .migration-run-head,
  .migration-run-items div {
    grid-template-columns: 1fr;
  }

  .admin-section {
    padding: 12px;
  }

  .admin-system-toggle {
    white-space: normal;
  }

  .admin-company-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-company-edit button,
  .settings-form button,
  .invoice-form button,
  .contact-form button,
  .payroll-form button,
  .fixed-asset-form button,
  .accrual-form button {
    width: 100%;
  }

  .admin-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    padding: 14px;
  }

  .workflow-section {
    padding: 0;
  }

  .workflow-section summary {
    align-items: start;
    gap: 10px;
    padding: 12px;
  }

  .workflow-section > :not(summary) {
    margin: 0 12px 12px;
  }

  #ledger {
    gap: 12px;
  }

  .ledger-source-panel {
    order: 2;
  }

  #ledger .table-wrap {
    order: 3;
  }

  #ledger .workflow-section {
    order: 4;
  }

  .table-wrap,
  .receipt-table-wrap {
    margin-inline: -4px;
    border: 1px solid var(--line);
    background:
      linear-gradient(90deg, rgba(18, 122, 90, 0.08), transparent 22px) left / 22px 100% no-repeat,
      var(--surface);
  }

  table,
  .receipt-table {
    min-width: 560px;
  }

  th,
  td {
    padding: 11px 9px;
    font-size: 0.9rem;
  }

  td select {
    min-width: 140px;
  }

  .ledger-row-actions {
    justify-content: flex-start;
  }

  .deadline-list li {
    align-items: flex-start;
  }

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

  .assistant-form {
    align-items: stretch;
  }

  .assistant-form .icon-button {
    width: 100%;
    flex-basis: 46px;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding-inline: 8px;
  }

  .panel {
    padding: 12px;
  }

  h1 {
    font-size: 1.95rem;
  }

  .top-actions .primary-button,
  .top-actions .secondary-button,
  .ledger-tools .secondary-button,
  .bank-upload .secondary-button,
  .mail-forward .secondary-button,
  .migration-actions button,
  .invoice-actions button,
  .tax-account-actions button,
  .receipt-actions button,
  .receipt-edit-actions button,
  .secondary-link {
    flex-basis: 100%;
  }

  .top-actions .icon-button {
    flex: 1 1 38px;
  }

  table,
  .receipt-table {
    min-width: 520px;
  }
}

.photo-camera-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #040706;
}

.photo-camera-modal[hidden] {
  display: none;
}

body.has-camera-modal {
  overflow: hidden;
}

.photo-camera-view {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #0b1514;
}

.photo-camera-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-camera-mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.photo-camera-frame {
  width: min(56vw, 310px);
  max-width: 62%;
  max-height: 76dvh;
  aspect-ratio: 0.36;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 10px;
  box-shadow:
    0 0 0 999px rgba(4, 16, 14, 0.48),
    0 0 0 1px rgba(8, 120, 88, 0.65) inset;
  background: rgba(255, 255, 255, 0.04);
}

.photo-camera-frame[data-mode="a4"] {
  width: calc(100vw - 18px);
  height: calc(100dvh - 150px);
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
}

.photo-camera-left-controls,
.photo-camera-top-controls,
.photo-camera-controls {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.photo-camera-left-controls {
  left: max(14px, env(safe-area-inset-left));
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.photo-camera-top-controls {
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  top: max(12px, env(safe-area-inset-top));
  justify-content: flex-start;
}

.photo-camera-controls {
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  flex-direction: column;
  justify-content: center;
}

.photo-camera-top-controls .secondary-button,
.photo-shutter-button {
  min-height: 48px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.photo-camera-mode {
  width: 54px;
  display: grid;
  grid-template-columns: 1fr;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(8, 16, 15, 0.72);
  backdrop-filter: blur(14px);
}

.photo-document-mode.photo-camera-mode {
  grid-template-columns: 1fr;
}

.photo-camera-mode button {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  color: rgba(255, 255, 255, 0.72);
}

.photo-camera-mode button.selected {
  color: #0f4737;
}

.photo-shutter-button {
  min-width: min(78vw, 360px);
  border: 2px solid rgba(255, 255, 255, 0.72);
}

.photo-camera-zoom {
  width: 54px;
  height: min(34dvh, 260px);
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
  justify-items: center;
  padding: 13px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(8, 16, 15, 0.72);
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.18rem;
  font-weight: 900;
  backdrop-filter: blur(14px);
  touch-action: none;
  user-select: none;
}

.photo-camera-zoom[hidden] {
  display: none;
}

.photo-camera-zoom input {
  width: 32px;
  height: 100%;
  min-height: 0;
  accent-color: #72d9a9;
  writing-mode: vertical-rl;
  direction: rtl;
  touch-action: none;
}

.photo-camera-zoom span {
  pointer-events: none;
}

.zoom-symbol {
  line-height: 1;
}

.camera-mode-icon {
  display: block;
  border: 2px solid currentColor;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}

.camera-mode-icon.receipt {
  width: 16px;
  height: 30px;
}

.camera-mode-icon.a4 {
  width: 21px;
  height: 30px;
}

.photo-document-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f8f6;
}

.photo-document-mode button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.photo-document-mode button.selected {
  background: var(--surface);
  color: var(--green-dark);
  box-shadow: var(--shadow-sm);
}
