/*
 * Definitieve mobiele laag.
 *
 * De oudere stylesheets blijven de gedeelde en desktopcomponenten beheren.
 * Hier staan alleen correcties die op kleine schermen nodig zijn, zodat de
 * mobiele cascade op één voorspelbare plek eindigt.
 */
.first-run-mobile-only {
  display: none;
}

@media (min-width: 721px) {
  /* Op desktop blijft de bestaande, volledig geopende herinneringskaart staan. */
  #detailPaymentPanel .detail-reminder > summary {
    display: none;
  }

  #detailPaymentPanel .detail-reminder > .detail-reminder-content {
    display: block !important;
  }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: calc(16px + env(safe-area-inset-top));
    scroll-padding-bottom: calc(168px + env(safe-area-inset-bottom));
  }

  body {
    min-width: 320px;
    overflow-x: hidden;
  }

  .main,
  .main:has(#todayView:not([hidden])) {
    padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
    padding-bottom: calc(168px + env(safe-area-inset-bottom));
  }

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

  /* Lange koppen en vertalingen mogen hun natuurlijke hoogte gebruiken. */
  .main > :is(#invoicesView, #expensesView, #moneyView, #checksView, #workView, #settingsView) > .page-head {
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0 0 18px;
    overflow: visible;
  }

  .main > :is(#invoicesView, #expensesView, #moneyView, #checksView, #workView, #settingsView) > .page-head p {
    display: block;
    margin-top: 7px;
    overflow: visible;
    font-size: 13px;
    line-height: 1.45;
    text-overflow: clip;
    white-space: normal;
    -webkit-line-clamp: unset;
  }

  /* iOS zoomt niet meer in wanneer een formulier focus krijgt. */
  .main :is(input, select, textarea),
  .first-run :is(input, select, textarea),
  dialog :is(input, select, textarea) {
    max-width: 100%;
    font-size: 16px !important;
  }

  button,
  [role="button"],
  summary {
    touch-action: manipulation;
  }

  /* KPI-kaarten blijven leesbaar op 320–430 px en snappen per kaart. */
  .main :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics {
    grid-auto-columns: min(82vw, 330px);
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 6px;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    touch-action: pan-x pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
  }

  .main :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics::-webkit-scrollbar {
    display: none;
  }

  .main :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card) {
    min-height: 112px;
    padding: 15px 16px;
  }

  .main :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card) > strong {
    font-size: clamp(24px, 7.5vw, 30px);
  }

  /* The visible card owns the mobile highlight, even while the previous filter is active. */
  #mainContent.main :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card) {
    transition: background-color .1s ease-out, border-color .1s ease-out, box-shadow .1s ease-out;
  }

  #mainContent.main :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card):not(.is-current-kpi) {
    border-color: var(--line);
    box-shadow: none;
    background: var(--paper);
  }

  #mainContent.main :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card).is-current-kpi {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
    background: var(--accent-soft);
  }

  /* Vandaag: eerst de status en actie, daarna pas de historische grafiek. */
  #todayView .today-mobile-dashboard {
    gap: 14px;
  }

  #todayView .modern-topbar {
    position: relative;
    min-height: 44px;
    padding-bottom: 8px;
    border-bottom: 0;
  }

  #todayView .today-settings-button {
    display: grid;
    place-items: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-soft);
    color: var(--ink);
  }

  #todayView .today-settings-button .summa-icon {
    width: 19px;
    height: 19px;
  }

  #todayView .modern-welcome {
    margin: 2px 0 0;
  }

  #todayView .modern-welcome p {
    margin-top: 7px;
    font-size: 12px;
  }

  .main #todayView .modern-overview-card {
    grid-row: 3;
    min-height: 174px;
    padding: 20px;
  }

  #todayView .modern-overview-card > strong {
    max-width: calc(100% - 82px);
    margin: 6px 0 8px;
    font-size: clamp(36px, 10.5vw, 46px);
  }

  #todayView .modern-overview-card .today-mobile-trend {
    max-width: calc(100% - 62px);
    margin: 0;
  }

  #todayView .modern-overview-visual {
    right: -20px;
    transform: scale(.78);
    transform-origin: right center;
  }

  #todayView .modern-daily-briefing {
    grid-row: 4;
    padding: 15px 16px 8px;
    border-top: 0;
  }

  #todayView .modern-focus-head {
    align-items: center;
    padding-bottom: 8px;
  }

  #todayView .modern-focus-head strong {
    font-size: 22px;
  }

  #todayView .modern-daily-briefing #todayModernAttention .modern-attention-card,
  #todayView .modern-daily-briefing .modern-open-invoices,
  #todayView .modern-daily-briefing .modern-upcoming .modern-attention-card {
    min-height: 66px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
  }

  #todayView .modern-daily-briefing .modern-open-invoices.has-overdue {
    border-left: 1px solid var(--line);
  }

  #todayView .modern-daily-briefing #todayModernAttention {
    margin-bottom: 10px;
  }

  #todayView .modern-daily-briefing .modern-focus-context {
    gap: 10px;
    margin-top: 0;
    border: 0;
  }

  #todayView .modern-focus-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  #todayView .modern-focus-dismiss {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
  }

  #todayView .modern-focus-dismiss .summa-icon {
    width: 17px;
    height: 17px;
    transform: rotate(-90deg);
  }

  #todayView .modern-focus-head-actions #todayFocusCount {
    min-width: 0;
    min-height: 30px;
    padding: 4px 9px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
  }

  #todayView .modern-checks-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    margin-top: 7px;
    padding: 9px 4px 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
  }

  #todayView .modern-checks-row strong {
    font-size: 13px;
    font-weight: 650;
  }

  #todayView .modern-checks-row-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--muted);
  }

  #todayView .modern-checks-row-icon .summa-icon,
  #todayView .modern-checks-row-chevron {
    width: 17px;
    height: 17px;
  }

  #todayView .modern-focus-collapsed[hidden] {
    display: none !important;
  }

  #todayView .modern-daily-briefing.is-collapsed {
    padding: 0;
    border: 0;
  }

  #todayView .modern-daily-briefing.is-collapsed > :not(.modern-focus-collapsed) {
    display: none;
  }

  #todayView .modern-daily-briefing.is-collapsed .modern-focus-collapsed {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    color: var(--ink);
    text-align: left;
  }

  #todayView .modern-focus-collapsed-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--amber-soft);
    color: var(--amber);
  }

  #todayView .modern-focus-collapsed > strong {
    font-size: 13px;
    font-weight: 650;
  }

  #todayView .modern-focus-collapsed-chevron {
    justify-self: end;
    width: 17px;
    height: 17px;
    color: var(--muted);
    transform: rotate(90deg);
  }

  #todayView .modern-daily-briefing.is-clear {
    padding-bottom: 8px;
  }

  #todayView .modern-daily-briefing.is-clear .modern-focus-head {
    min-height: 40px;
    padding-bottom: 4px;
  }

  #todayView .modern-daily-briefing.is-clear #todayModernAttention,
  #todayView .modern-daily-briefing.is-clear .modern-focus-context {
    display: none !important;
  }

  #todayView #todayNewMenu > summary {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 11px;
  }

  #todayView #todayNewMenu > summary .button-icon {
    width: 18px;
    height: 18px;
  }

  #todayView #todayNewMenu .today-new-popover {
    width: min(270px, calc(100vw - 32px));
    padding: 7px;
  }

  #todayView #todayNewMenu .today-new-popover button {
    min-height: 58px;
    padding: 9px 10px;
  }

  #todayView .studio-rhythm {
    grid-row: 5;
    padding: 18px;
  }

  #todayView .studio-rhythm header p {
    margin-top: 3px;
  }

  #todayView .studio-chart {
    height: 104px;
    gap: 9px;
  }

  #todayView .modern-month-panel {
    grid-row: 6;
  }

  /* Werk opent op de urenlijst. Invoer verschijnt pas via de actie als sheet. */
  #workView .work-entry-panel:not(.is-mobile-sheet) {
    display: none !important;
  }

  #workView .work-list-panel {
    margin-top: 2px;
    padding: 16px;
  }

  #workView .work-list-head {
    align-items: flex-start;
    gap: 10px;
  }

  #workView .work-list-head select {
    flex: none;
  }

  #workView .work-hours-note {
    margin: 10px 2px 0;
    font-size: 12px;
  }

  #workView .work-list-panel > .list {
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  #workView .work-empty-state {
    min-height: 118px;
    padding: 26px 12px;
    border: 0;
    background: transparent;
    font-size: 14px;
  }

  #workView .work-list-panel > #workListNote[hidden] {
    display: none;
  }

  /* De herinnering is een disclosure; de betaalactie blijft daardoor leidend. */
  #detailPaymentPanel .detail-reminder {
    margin-top: 14px;
    padding-top: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
  }

  #detailPaymentPanel .detail-reminder > summary {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 11px 13px;
    cursor: pointer;
    list-style: none;
  }

  #detailPaymentPanel .detail-reminder > summary::-webkit-details-marker {
    display: none;
  }

  #detailPaymentPanel .detail-reminder > summary::after {
    width: 8px;
    height: 8px;
    justify-self: center;
    border-right: 1.5px solid var(--muted);
    border-bottom: 1.5px solid var(--muted);
    content: "";
    transform: rotate(45deg) translate(-2px, 2px);
    transition: transform .16s ease;
  }

  #detailPaymentPanel .detail-reminder[open] > summary::after {
    transform: rotate(225deg) translate(-2px, 2px);
  }

  #detailPaymentPanel .detail-reminder > summary strong,
  #detailPaymentPanel .detail-reminder > summary small {
    display: block;
  }

  #detailPaymentPanel .detail-reminder > summary strong {
    font-size: 13px;
  }

  #detailPaymentPanel .detail-reminder > summary small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
  }

  #detailPaymentPanel .detail-reminder[open] > summary {
    border-bottom: 1px solid var(--line);
  }

  #detailPaymentPanel .detail-reminder-content {
    padding: 12px;
  }

  #detailPaymentPanel .detail-reminder-content .message-action {
    margin: 0;
    padding: 0;
    background: transparent;
  }

  #detailPaymentPanel .detail-reminder-content .message-action > :is(strong, p) {
    display: none;
  }

  #detailPaymentPanel .detail-reminder-content textarea {
    min-height: 132px;
    resize: vertical;
  }

  /* De formulieractie en gevarenzone vormen samen een rustige, symmetrische afsluiting. */
  #detailDataPanel .detail-review-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    margin: 24px 0 0;
  }

  #detailDataPanel .detail-review-actions > button,
  #detailDataPanel .danger-zone > #detailDelete {
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
  }

  #detailDataPanel .danger-zone {
    margin-top: 10px;
    padding-top: 0;
  }

  /* Alleen de merkbalk blijft bovenaan; welkom en aanmelden staan in het midden. */
  body.first-run-active {
    height: 100svh;
    overflow: hidden;
  }

  .first-run {
    height: 100svh;
    min-height: 0;
    padding: max(20px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    overflow: hidden;
    place-items: start center;
  }

  .first-run-shell,
  .first-run-card {
    height: 100%;
    min-height: 0;
  }

  .first-run-card {
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 36px;
  }

  .first-run-card-header {
    min-height: 44px;
    flex-wrap: nowrap;
    gap: 12px;
  }

  .first-run-mobile-brand {
    flex: none;
  }

  .first-run-mobile-brand img {
    width: 28px;
    height: 28px;
  }

  #firstRunLanguageSwitch {
    min-width: 0;
    min-height: 44px;
    padding: 8px 26px 8px 8px;
    border-color: transparent;
    background: transparent;
  }

  .first-run-language::after {
    right: 8px;
  }

  .first-run-step {
    align-self: center;
    min-height: 0;
    max-height: 100%;
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .first-run-step::-webkit-scrollbar {
    display: none;
  }

  .first-run-login .first-run-step-copy h2 {
    font-size: clamp(28px, 7.6vw, 34px);
    line-height: 1.15;
    letter-spacing: -.04em;
  }

  .first-run-mobile-only {
    display: block;
  }

  .first-run .first-run-desktop-only {
    display: none;
  }

  .first-run-login .first-run-step-copy > p {
    margin-top: 10px;
    max-width: 32ch;
    font-size: 15px;
    line-height: 1.55;
  }

  /* De startknop en het openen van een bestaande werkplek horen bij elkaar. */
  .first-run-login .first-run-route {
    display: grid;
    gap: 8px;
    margin: 24px 0 0;
    text-align: left;
  }

  .first-run-login .first-run-route button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 11px 16px;
    border: 1px solid var(--ink);
    border-radius: 10px;
    background: var(--ink);
    color: var(--paper);
    font-size: 14px;
    text-decoration: none;
  }

  .first-run-login .first-run-workspace-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin-top: 6px;
    padding: 8px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
  }




  .first-run-footer [data-first-run-back="help"] {
    display: none;
  }

  .first-run-footer {
    align-self: end;
    gap: 24px;
    font-size: 12px;
  }

  .first-run-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

@media (max-width: 380px) {
  .main,
  .main:has(#todayView:not([hidden])) {
    padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right));
  }

  .main #todayView .modern-overview-card {
    min-height: 164px;
    padding: 18px;
  }

  #detailPaymentPanel .payment-icon {
    width: 64px;
    height: 64px;
  }

  #detailPaymentPanel .payment-icon .summa-icon {
    width: 32px;
    height: 32px;
  }

  #detailPaymentPanel .payment-main {
    column-gap: 14px;
  }

  .mobile-action-dock button,
  .modern-quick-actions.mobile-action-dock button {
    padding-inline: 8px;
    font-size: 12px;
  }
}

@media (max-width: 720px) and (max-height: 740px) {
  #todayView .modern-topbar {
    padding-bottom: 2px;
  }

  #todayView .modern-welcome .studio-eyebrow {
    margin-bottom: 7px;
  }

  .main #todayView .modern-overview-card {
    min-height: 156px;
  }

  #todayView .studio-chart {
    height: 88px;
  }
}

/* Vandaag heeft één centrale actielauncher. De drie keuzes verschijnen als
   losse knoppen in een rustige boog, zonder een menucontainer eromheen. */
@media (max-width: 720px) {
  #todayNewMenu {
    position: fixed;
    z-index: 70;
    top: auto;
    right: auto;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: calc(50% - 26px);
    margin: 0;
  }

  #todayView #todayNewMenu > summary {
    position: relative;
    z-index: 2;
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    border: 1px solid var(--navy);
    border-radius: 17px;
    background: var(--navy);
    color: #fff;
    box-shadow: 0 9px 24px #00000026;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
  }

  #todayView #todayNewMenu > summary .launcher-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #fff !important;
    color: #fff !important;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
    transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .16s ease;
  }
  #todayView #todayNewMenu > summary .launcher-close { display: none; }

  #todayView #todayNewMenu[open] > summary {
    background: var(--navy-soft);
    border-color: var(--navy-soft);
    box-shadow: 0 10px 28px #00000032;
  }

  #todayView #todayNewMenu[open] > summary .launcher-add { display: none; }
  #todayView #todayNewMenu[open] > summary .launcher-close { display: block; }

  #todayView #todayNewMenu .today-new-scrim {
    display: none;
  }

  #todayView #todayNewMenu[open] .today-new-scrim {
    display: block;
    position: fixed;
    z-index: 0;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--canvas) 34%, transparent);
    box-shadow: none;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: today-actions-scrim-in .18s ease-out both;
  }

  #todayView #todayNewMenu .today-new-popover {
    position: absolute;
    z-index: 2;
    top: auto;
    right: auto;
    bottom: calc(100% + 14px);
    left: 26px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    width: min(430px, calc(100vw - 32px));
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    transform: translateX(-50%);
  }

  #todayView #todayNewMenu .today-new-popover button {
    --fan-y: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    height: 70px;
    min-height: 70px;
    padding: 9px 7px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--paper) 95%, transparent);
    color: var(--ink);
    text-align: center;
    box-shadow: 0 12px 28px #0000001f;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: today-action-rise .24s cubic-bezier(.18, .86, .28, 1.12) both;
  }

  #todayView #todayNewMenu .today-new-popover button:nth-child(2) {
    animation-delay: 35ms;
  }

  #todayView #todayNewMenu .today-new-popover button:nth-child(3) {
    animation-delay: 70ms;
  }

  #todayView #todayNewMenu .today-new-popover button .summa-icon {
    width: 21px;
    height: 21px;
    color: currentColor;
  }

  #todayView #todayNewMenu .today-new-popover strong {
    font-size: 12px;
    line-height: 1.2;
    font-weight: 680;
  }

  #todayView #todayNewMenu .today-new-popover small {
    display: none;
  }

  #todayView .modern-quick-actions.mobile-action-dock {
    display: none !important;
  }

  #todayView .today-mobile-dashboard {
    padding-bottom: 72px;
  }

  #todayView .modern-daily-briefing .modern-focus-action[data-desktop-label] {
    font-size: 12px;
  }

  #todayView .modern-daily-briefing .modern-focus-action[data-desktop-label]::before {
    content: none;
  }

  #todayView .modern-daily-briefing #todayModernReminderButton,
  #todayView .modern-daily-briefing .modern-open-invoices .modern-row-chevron,
  #todayView .modern-daily-briefing #todayModernUpcomingButton {
    box-sizing: border-box;
    justify-self: end;
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    font-size: 12px;
    text-align: center;
  }

  #todayView .today-mobile-dashboard.is-clear .modern-daily-briefing {
    padding-block: 12px;
  }

  #todayView .today-mobile-dashboard.is-clear .modern-focus-head {
    min-height: 48px;
    padding-bottom: 0;
  }

  #todayView .today-mobile-dashboard.is-clear .modern-focus-head small,
  #todayView .today-mobile-dashboard.is-clear .modern-focus-context,
  #todayView .today-mobile-dashboard.is-clear .modern-upcoming {
    display: none;
  }

  #todayView .today-mobile-dashboard.is-clear .modern-focus-head strong {
    font-size: 18px;
  }

  #workView .work-list-panel .list-row.work-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 6px 12px;
    min-height: 0;
    padding: 13px 11px;
  }

  #workView .work-list-panel .list-row.work-entry .grow {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  #workView .work-list-panel .list-row.work-entry .amount {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }

  #workView .work-list-panel .list-row.work-entry button {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    min-height: 28px;
    margin: 0;
    padding: 3px 0;
    border: 0;
    background: transparent;
  }
}

/* Factuurdetail — Summa als redactioneel kasboek.
 * De betaalstatus vormt het anker; herkende gegevens volgen als controleerbare
 * regels. Deze laag staat bewust als laatste zodat oude mobiele varianten niet
 * opnieuw kaarten of een tweede vaste actie over het ontwerp leggen. */
@media (max-width: 720px) {
  .main,
  .main:has(#todayView:not([hidden])) {
    padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right));
  }

  .main:has(#detailView:not([hidden])) {
    padding-top: 19px;
    padding-bottom: calc(71px + env(safe-area-inset-bottom));
  }

  #detailView {
    width: 100%;
    max-width: 459px;
    margin-inline: auto;
    padding-bottom: 0;
  }

  #detailView .page-head {
    position: relative;
    margin: 0 2px 15px;
  }

  #detailView .page-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 4px 0 4px 6px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
  }

  #detailView .page-back .summa-icon {
    width: 22px;
    height: 22px;
    stroke-width: 1.75;
  }

  #detailView .page-head > .row {
    display: block;
    margin-top: 0;
  }

  #detailView .page-head h1,
  .main #detailView .page-head h1 {
    max-width: none;
    margin: 0;
    padding-right: 0;
    overflow-wrap: anywhere;
  }

  #detailView .detail-actions-menu {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
  }

  #detailView .detail-actions-menu > .invoice-more {
    width: 44px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--paper);
  }

  #detailView .page-head > p {
    display: block;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.35;
  }

  #detailView #detailMode {
    position: static;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0;
    width: 100%;
    margin-top: 10px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    box-shadow: none;
  }

  #detailView #detailMode button {
    min-width: 0;
    min-height: 40px;
    padding: 8px 4px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    font-size: clamp(12px, 3.3vw, 14px);
    font-weight: 500;
  }

  #detailView #detailMode button:last-child {
    border-right: 0;
  }

  #detailView #detailMode button.is-active {
    border-radius: 11px;
    background: linear-gradient(105deg, #202020, #111);
    color: var(--paper);
    font-weight: 600;
  }

  #detailView .detail-grid,
  #detailView #detailLeft {
    display: grid;
    gap: 0;
  }

  #detailView #detailPaymentPanel {
    position: relative;
    isolation: isolate;
    margin: 0 0 30px;
    padding: 29px 14px 20px;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background:
      radial-gradient(ellipse 58% 128% at 101% 50%, rgba(124, 120, 112, .09) 0 66%, transparent 67%),
      linear-gradient(132deg, var(--paper), var(--surface-soft));
    box-shadow: none;
  }

  #detailView #detailPaymentPanel::after {
    position: absolute;
    z-index: -1;
    top: -16%;
    right: -28%;
    width: 70%;
    height: 132%;
    border-radius: 50%;
    background: color-mix(in srgb, var(--paper) 44%, transparent);
    content: "";
    pointer-events: none;
  }

  #detailView #detailPaymentPanel .payment-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "tekst bedrag";
    align-items: end;
    gap: 16px;
    margin: 0;
  }

  #detailView #detailPaymentPanel .payment-icon {
    display: none;
  }

  #detailView #detailPaymentPanel .payment-text {
    grid-area: tekst;
    align-self: stretch;
    margin-left: 5px;
  }

  #detailView #detailPaymentPanel .payment-text .panel-kicker {
    display: block;
    margin: 0 0 13px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
  }

  #detailView #detailPaymentPanel .payment-main h2 {
    margin: 0;
    color: var(--ink);
    font: 400 clamp(36px, 8vw, 39px)/1 var(--font-display);
    letter-spacing: -.045em;
  }

  #detailView #detailPaymentPanel .payment-text::after {
    display: block;
    width: min(100%, 164px);
    height: 1px;
    margin-top: 20px;
    background: var(--line);
    content: "";
  }

  #detailView #detailPaymentPanel .payment-amount {
    grid-area: bedrag;
    align-self: end;
    margin-right: 10px;
    color: var(--ink);
    font: 400 clamp(31px, 8.2vw, 36px)/1 var(--font-display);
    letter-spacing: -.045em;
    white-space: nowrap;
    transform: translateY(14px);
  }

  #detailView #detailPaymentPanel .payment-footer {
    display: block;
    margin-top: 23px;
    padding-top: 0;
    border-top: 0;
  }

  #detailView #detailPaymentPanel .payment-footer > .panel-note {
    margin: 0 0 0 5px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
  }

  #detailView #detailPaymentPanel .payment-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    gap: 8px;
    width: 100%;
    margin-top: 19px;
  }

  #detailView #detailPaymentPanel .payment-actions button {
    position: relative;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 11px 50px;
    border: 1px solid var(--ink);
    border-radius: 11px;
    background: linear-gradient(105deg, #202020, #111);
    color: var(--paper);
    box-shadow: none;
    font-size: 14px;
    font-weight: 650;
    text-align: center;
  }

  #detailView #detailPaymentPanel .payment-actions button::after {
    position: absolute;
    top: 50%;
    right: 19px;
    content: "→";
    font-size: 22px;
    font-weight: 350;
    line-height: 1;
    transform: translateY(-52%);
  }

  #detailView #detailPaymentPanel .detail-reminder {
    position: relative;
    z-index: 1;
    background: color-mix(in srgb, var(--paper) 72%, transparent);
  }

  #detailView #detailRecognitionPanel {
    margin: 0 12px 22px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #detailView #detailRecognitionPanel .panel-kicker {
    display: none;
  }

  #detailView #detailRecognitionPanel h2 {
    margin: 0 0 13px;
    color: var(--ink);
    font: 400 clamp(24px, 5.6vw, 25px)/1.08 var(--font-display);
    letter-spacing: -.045em;
  }

  #detailView #detailRecognitionPanel .recognition-grid {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
  }

  #detailView #detailRecognitionPanel .recognition-item {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 12px;
    align-items: baseline;
    min-height: 42px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
  }

  #detailView #detailRecognitionPanel .recognition-item span,
  #detailView #detailRecognitionPanel .recognition-item strong {
    font-size: 14px;
    line-height: 1.35;
  }

  #detailView #detailRecognitionPanel .recognition-item span {
    color: var(--muted);
  }

  #detailView #detailRecognitionPanel .recognition-item strong {
    color: var(--ink);
    font-weight: 550;
  }

  #detailView #detailRecognitionPanel .recognition-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
  }

  #detailView #detailRecognitionPanel .recognition-status::before {
    width: 9px;
    height: 9px;
    margin-top: 4px;
    flex: 0 0 auto;
  }

  #detailView #detailVerdictPanel {
    margin: 0 0 14px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: var(--surface-soft);
    box-shadow: none;
  }

  #detailView #detailVerdictPanel > summary {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 14px;
    align-items: center;
    gap: 11px;
    min-height: 60px;
    padding: 8px 14px;
  }

  #detailView #detailVerdictPanel .audit-summary-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    justify-self: center;
    color: var(--muted);
    stroke-width: 1.55 !important;
  }

  #detailView #detailVerdictPanel > summary > span {
    min-width: 0;
  }

  #detailView #detailVerdictPanel > summary strong {
    font-size: 13px;
    line-height: 1.3;
  }

  #detailView #detailVerdictPanel > summary small {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.3;
  }

  #detailView #detailVerdictPanel > summary::after {
    width: 9px;
    height: 9px;
    margin: 0;
    justify-self: center;
    border-color: var(--ink);
    transform: rotate(-45deg);
  }

  #detailView #detailVerdictPanel[open] > summary::after {
    transform: rotate(45deg);
  }

  #detailView #detailVerdictPanel .audit-content {
    background: var(--paper);
  }

  #detailView #detailVerdicts > .verdict > summary {
    cursor: default;
  }

  #detailView #detailVerdicts > .verdict > summary::after {
    display: none;
  }

  #detailView:not([hidden]) .mobile-detail-actions.is-overview {
    display: none !important;
  }

  .sidebar > .nav-button.is-active {
    background: var(--surface-soft);
    color: var(--ink);
  }

  .sidebar > .nav-button.is-active .nav-icon {
    color: var(--ink);
  }

  .sidebar {
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }

  .sidebar > .nav-button {
    min-height: 50px;
    padding: 3px 2px;
    gap: 3px;
    font-size: 12px;
  }

  /* Een compacte, gevulde teller leest als status en niet als tweede icoon. */
  .sidebar .nav-count {
    top: 2px;
    left: calc(50% + 9px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border: 0;
    border-radius: 999px;
    background: #242424;
    color: #fff;
    font-size: 12px;
    line-height: 16px;
    font-variant-numeric: tabular-nums;
  }
}

@media (max-width: 720px) {
  :root[data-theme="dark"] .sidebar .nav-count {
    background: #f1f1f1;
    color: #1b1b1b;
  }
}

@media (max-width: 720px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar .nav-count {
    background: #f1f1f1;
    color: #1b1b1b;
  }
}

@media (max-width: 360px) {
  #detailView #detailPaymentPanel .payment-main {
    grid-template-columns: 1fr;
    grid-template-areas:
      "tekst"
      "bedrag";
    gap: 14px;
    align-items: start;
  }

  #detailView #detailPaymentPanel .payment-amount {
    align-self: start;
    justify-self: start;
    margin-right: 0;
    transform: none;
  }

  #detailView #detailPaymentPanel .payment-text::after {
    margin-top: 16px;
  }
}

/* De omzet-KPI behoudt op hover en active exact dezelfde geometrie. */
@media (max-width: 720px) {
  #detailView #detailMode button.is-active:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--paper) 55%, var(--ink));
    outline-offset: -4px;
  }

  #detailView #detailDataPanel {
    width: 100%;
    max-width: 100%;
    padding: 18px 16px 86px;
    overflow: hidden;
  }

  #detailView #detailDataPanel > h2 {
    margin: 0 0 18px;
    font: 400 27px/1.1 var(--font-display);
    letter-spacing: -.04em;
  }

  #detailView #detailDataPanel > .detail-edit-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  #detailView #detailDataPanel .detail-edit-section {
    margin-top: 22px;
    padding-top: 18px;
  }

  #detailView #detailDataPanel .detail-edit-section h3 {
    margin-bottom: 12px;
    font-size: 15px;
  }

  #detailView #detailDataPanel .detail-review-summary {
    margin: -6px 0 18px;
    padding: 10px 12px;
  }

  #detailView #detailDataPanel .invoice-source-facts {
    width: 100%;
    max-width: 100%;
    margin-top: 12px;
    overflow: hidden;
  }

  #detailView #detailDataPanel .invoice-source-facts > summary {
    min-height: 48px;
    font-size: 13px;
  }

  #detailView #detailDataPanel .invoice-source-line-main {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #detailView #detailDataPanel .invoice-source-line-main strong,
  #detailView #detailDataPanel .invoice-source-line-main span {
    font-size: 12px;
  }

  #detailView #detailDataPanel #rememberPanel {
    margin-top: 18px;
  }

  .main #todayView .modern-overview-card,
  .main #todayView .modern-overview-card:hover,
  .main #todayView .modern-overview-card:active {
    min-height: 148px;
    height: auto;
    padding: 16px 20px;
    transform: none;
    transition: none;
  }
}

@media (max-width: 380px) {
  .main #todayView .modern-overview-card,
  .main #todayView .modern-overview-card:hover,
  .main #todayView .modern-overview-card:active {
    min-height: 148px;
    padding: 16px 18px;
  }
}

@media (max-width: 720px) and (max-height: 740px) {
  .main #todayView .modern-overview-card,
  .main #todayView .modern-overview-card:hover,
  .main #todayView .modern-overview-card:active {
    min-height: 148px;
  }
}

.today-new-scrim { display: none; }

/* Uitgaven gebruikt dezelfde centrale actielauncher als Vandaag. Iedere keuze
   heeft een eigen documenttype-icoon en exact dezelfde knopgeometrie. */
@media (min-width: 721px) {
  #expensesNewMenu,
  #workNewMenu { display: none; }
}

@media (max-width: 720px) {
  #expensesNewMenu {
    position: fixed;
    z-index: 70;
    right: auto;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: calc(50% - 26px);
    margin: 0;
  }

  #expensesNewMenu > summary {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    padding: 0;
    border: 1px solid var(--navy);
    border-radius: 17px;
    background: var(--navy);
    color: #fff;
    box-shadow: 0 9px 24px #00000026;
    list-style: none;
  }

  #expensesNewMenu > summary::-webkit-details-marker { display: none; }
  #expensesNewMenu > summary .expenses-launcher-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #fff !important;
    color: #fff !important;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
    transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .16s ease;
  }
  #expensesNewMenu > summary .expenses-launcher-close { display: none; }
  #expensesNewMenu[open] > summary {
    background: var(--navy-soft);
    border-color: var(--navy-soft);
    color: #fff;
    box-shadow: 0 10px 28px #00000032;
  }
  #expensesNewMenu[open] > summary .expenses-launcher-add { display: none; }
  #expensesNewMenu[open] > summary .expenses-launcher-close { display: block; }

  #expensesNewMenu[open] .today-new-scrim {
    display: block;
    position: fixed;
    z-index: 0;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--canvas) 34%, transparent);
    box-shadow: none;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: today-actions-scrim-in .18s ease-out both;
  }

  #expensesNewMenu .today-new-popover {
    position: absolute;
    z-index: 2;
    right: auto;
    bottom: calc(100% + 14px);
    left: 26px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    width: min(430px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    transform: translateX(-50%);
  }

  #expensesNewMenu .today-new-popover button {
    --fan-y: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    height: 70px;
    min-height: 70px;
    padding: 9px 7px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--paper) 95%, transparent);
    color: var(--ink);
    text-align: center;
    box-shadow: 0 12px 28px #0000001f;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: today-action-rise .24s cubic-bezier(.18, .86, .28, 1.12) both;
  }
  #expensesNewMenu .today-new-popover button:nth-child(2) { animation-delay: 35ms; }
  #expensesNewMenu .today-new-popover button:nth-child(3) { animation-delay: 70ms; }
  #expensesNewMenu .today-new-popover button .summa-icon { width: 21px; height: 21px; color: currentColor; }
  #expensesNewMenu .today-new-popover strong { font-size: 12px; line-height: 1.2; font-weight: 680; }
  #expensesNewMenu .today-new-popover small { display: none; }
  #expensesView { padding-bottom: 72px; }
}

/* Werk gebruikt dezelfde vaste launcher, met twee even brede keuzes. */
@media (max-width: 720px) {
  #workNewMenu {
    position: fixed;
    z-index: 70;
    right: auto;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: calc(50% - 26px);
    margin: 0;
  }

  #workNewMenu > summary {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    padding: 0;
    border: 1px solid var(--navy);
    border-radius: 17px;
    background: var(--navy);
    color: #fff;
    box-shadow: 0 9px 24px #00000026;
    list-style: none;
  }

  #workNewMenu > summary::-webkit-details-marker { display: none; }
  #workNewMenu > summary .work-launcher-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #fff !important;
    color: #fff !important;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
    transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .16s ease;
  }
  #workNewMenu > summary .work-launcher-close { display: none; }
  #workNewMenu[open] > summary {
    background: var(--navy-soft);
    border-color: var(--navy-soft);
    color: #fff;
    box-shadow: 0 10px 28px #00000032;
  }
  #workNewMenu[open] > summary .work-launcher-add { display: none; }
  #workNewMenu[open] > summary .work-launcher-close { display: block; }

  #workNewMenu[open] .today-new-scrim {
    display: block;
    position: fixed;
    z-index: 0;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--canvas) 34%, transparent);
    box-shadow: none;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: today-actions-scrim-in .18s ease-out both;
  }

  #workNewMenu .today-new-popover {
    position: absolute;
    z-index: 2;
    right: auto;
    bottom: calc(100% + 14px);
    left: 26px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    width: min(292px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    transform: translateX(-50%);
  }

  #workNewMenu .today-new-popover button {
    --fan-y: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    height: 70px;
    min-height: 70px;
    padding: 9px 7px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--paper) 95%, transparent);
    color: var(--ink);
    text-align: center;
    box-shadow: 0 12px 28px #0000001f;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: today-action-rise .24s cubic-bezier(.18, .86, .28, 1.12) both;
  }
  #workNewMenu .today-new-popover button:nth-child(2) { animation-delay: 35ms; }
  #workNewMenu .today-new-popover button .summa-icon { width: 21px; height: 21px; color: currentColor; }
  #workNewMenu .today-new-popover strong { font-size: 12px; line-height: 1.2; font-weight: 680; }
  #workView { padding-bottom: 72px; }

  body.has-mobile-sheet #workNewMenu {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@keyframes today-actions-scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes today-action-rise {
  from { opacity: 0; transform: translateY(28px) scale(.82); }
  to { opacity: 1; transform: translateY(var(--fan-y)) scale(1); }
}

/* Facturen heeft één directe hoofdactie. De compacte plus staat op dezelfde
   vaste positie en gebruikt dezelfde maat als de launchers op andere pagina's. */
@media (max-width: 720px) {
  #invoicesView:not([hidden]) .mobile-invoice-actions.mobile-action-dock {
    display: block;
    right: auto;
    left: calc(50% - 26px);
    width: 52px;
    height: 52px;
  }
  #invoicesView #mobileNewInvoiceButton {
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    padding: 0;
    border: 1px solid var(--navy);
    border-radius: 17px;
    background: var(--navy);
    color: #fff;
    box-shadow: 0 9px 24px #00000026;
  }
  #invoicesView #mobileNewInvoiceButton .button-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #fff !important;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
  }
  #invoicesView #mobileNewInvoiceButton span { display: none; }
}

/* Instellingen vormen op mobiel één rustige index en vlakke detailpagina's. */
@media (max-width: 720px) {
  .main:has(#settingsView:not([hidden])) {
    padding-bottom: calc(67px + env(safe-area-inset-bottom));
  }

  #settingsView {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  #settingsView:not([data-mobile-pane]) > .settings-page-head {
    margin-bottom: 14px;
  }

  #settingsView:not([data-mobile-pane]) .settings-mobile-home {
    display: block;
  }

  #settingsView .settings-mobile-group {
    margin: 0;
  }

  #settingsView .settings-mobile-group > h2 {
    display: none;
  }

  #settingsView .settings-mobile-list {
    display: grid;
    gap: 2px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
  }

  #settingsView .settings-mobile-row {
    grid-template-columns: 23px minmax(0, 1fr) 18px;
    gap: 11px;
    min-height: 61px;
    padding: 9px 8px;
    border: 0;
    border-radius: 11px;
  }

  #settingsView .settings-mobile-row:hover,
  #settingsView .settings-mobile-row:active {
    background: var(--surface-soft);
  }

  #settingsView .settings-mobile-row .settings-tab-icon,
  #settingsView .settings-mobile-row .summa-icon {
    width: 21px;
    height: 21px;
  }

  #settingsView .settings-mobile-row strong {
    font-size: 14px;
    line-height: 1.2;
  }

  #settingsView .settings-mobile-row small {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.25;
  }

  #settingsView[data-mobile-pane] > .settings-mobile-back {
    display: inline-flex;
    width: auto;
    min-height: 34px;
    margin: 0 0 12px;
    padding: 3px 2px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    font-size: 14px;
    font-weight: 600;
  }

  #settingsView[data-mobile-pane] > .panel[data-pane] {
    overflow: visible;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #settingsView[data-mobile-pane] .settings-panel-hero,
  #settingsView[data-mobile-pane] .settings-panel-hero.is-green,
  #settingsView[data-mobile-pane] .settings-panel-hero.is-orange {
    display: block;
    min-height: 0;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  #settingsView[data-mobile-pane] .settings-panel-hero h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(27px, 8vw, 34px);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -.04em;
  }

  #settingsView[data-mobile-pane] .settings-panel-hero h2:focus {
    outline: 0;
  }

  #settingsView[data-mobile-pane] .settings-panel-hero p {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.4;
  }

  #settingsView[data-mobile-pane] .settings-panel-body {
    padding: 0;
  }

  #settingsView[data-mobile-pane] .settings-save-row {
    display: none;
  }

  #settingsView[data-mobile-pane] .settings-content-panel label:not(.demo-switch) > span {
    margin-bottom: 4px;
    font-size: 12px;
  }

  #settingsView[data-mobile-pane] .settings-content-panel :is(input, select) {
    min-height: 46px;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 16px;
  }

  #settingsView[data-mobile-pane="bedrijf"] .settings-form-card {
    gap: 10px;
  }

  #settingsView[data-mobile-pane="fiscaal"] .settings-choice-list {
    display: grid;
    gap: 8px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  #settingsView[data-mobile-pane="fiscaal"] .settings-choice-list .setting-row {
    min-height: 70px;
    padding: 11px 13px;
    border: 0;
    border-radius: 12px;
    background: var(--surface-soft);
  }

  #settingsView[data-mobile-pane="fiscaal"] .settings-source-note {
    display: none;
  }

  #settingsView[data-mobile-pane="uiterlijk"] .appearance-panel .theme-setting {
    gap: 8px;
    margin: 0 0 14px;
    padding: 0;
    border: 0;
  }

  #settingsView[data-mobile-pane="uiterlijk"] .appearance-panel .setting-label small,
  #settingsView[data-mobile-pane="uiterlijk"] .language-setting p,
  #settingsView[data-mobile-pane="uiterlijk"] .appearance-intro,
  #settingsView[data-mobile-pane="uiterlijk"] .appearance-status {
    display: none;
  }

  #settingsView[data-mobile-pane="uiterlijk"] .language-setting {
    gap: 8px;
    margin: 0 0 14px;
    padding: 0;
    border: 0;
  }

  #settingsView[data-mobile-pane="uiterlijk"] .language-setting h3,
  #settingsView[data-mobile-pane="uiterlijk"] #paletteTitle {
    margin: 0 0 7px;
    font-size: 13px;
  }

  #settingsView[data-mobile-pane="uiterlijk"] .theme-switch {
    min-height: 40px;
    border-radius: 10px;
  }

  #settingsView[data-mobile-pane="uiterlijk"] .theme-switch button {
    min-height: 38px;
    padding: 7px 8px;
    font-size: 12px;
  }

  #settingsView[data-mobile-pane="uiterlijk"] .palette-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  /* Kleurkiezer (27 sep 2026): het voorbeeld en de korte omschrijving blijven ook op mobiel zichtbaar. */
  #settingsView[data-mobile-pane="uiterlijk"] .palette-card {
    padding: 7px 7px 11px;
    border-radius: 13px;
  }

  #settingsView[data-mobile-pane="uiterlijk"] .palette-preview {
    height: 76px;
  }

  #settingsView[data-mobile-pane="uiterlijk"] .palette-heading {
    margin: 9px 3px 2px;
  }

  #settingsView[data-mobile-pane="uiterlijk"] .palette-heading strong {
    font-size: 14px;
    line-height: 1.2;
  }

  #settingsView[data-mobile-pane="uiterlijk"] .palette-check .summa-icon {
    width: 16px;
    height: 16px;
  }

  #settingsView[data-mobile-pane="gegevens"] .settings-source-note {
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  #settingsView[data-mobile-pane="gegevens"] #backupVerification {
    display: none;
  }

  #settingsView[data-mobile-pane="gegevens"] .settings-data-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #settingsView[data-mobile-pane="gegevens"] .settings-data-actions #backupButton {
    grid-column: 1 / -1;
  }

  #settingsView[data-mobile-pane="gegevens"] .settings-data-actions button {
    min-height: 46px;
    padding: 8px;
    font-size: 12px;
  }

  #settingsView[data-mobile-pane="gegevens"] .settings-data-disclosures {
    gap: 7px;
    margin-top: 11px;
  }

  #settingsView[data-mobile-pane="gegevens"] .settings-data-disclosure,
  #settingsView[data-mobile-pane="gegevens"] .reset-zone {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--surface-soft);
  }

  #settingsView[data-mobile-pane="gegevens"] .settings-data-disclosure > summary,
  #settingsView[data-mobile-pane="gegevens"] .reset-zone > summary {
    min-height: 54px;
    padding: 10px 13px;
  }

  #settingsView[data-mobile-pane="gegevens"] .reset-zone > summary::after {
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 1.5px solid var(--muted);
    border-bottom: 1.5px solid var(--muted);
    content: "";
    transform: rotate(45deg) translate(-2px, 2px);
  }

  #settingsView[data-mobile-pane="gegevens"] .reset-zone[open] > summary::after {
    content: "";
    transform: rotate(225deg) translate(-2px, 2px);
  }

  #settingsView[data-mobile-pane="gegevens"] .settings-data-disclosure-body {
    padding: 0 13px 13px;
  }

  #settingsView[data-mobile-pane="gegevens"] .reset-zone {
    margin-top: 7px;
  }

  #settingsView[data-mobile-pane="demo"] > .demo-settings-panel {
    overflow: visible;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #settingsView[data-mobile-pane="demo"] .demo-settings-hero {
    display: block;
    min-height: 0;
    margin-bottom: 14px;
    padding: 0;
    background: transparent;
  }

  #settingsView[data-mobile-pane="demo"] .demo-settings-icon,
  #settingsView[data-mobile-pane="demo"] .demo-settings-kicker,
  #settingsView[data-mobile-pane="demo"] .demo-settings-preview {
    display: none;
  }

  #settingsView[data-mobile-pane="demo"] .demo-settings-intro h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(27px, 8vw, 34px);
    font-weight: 500;
    letter-spacing: -.04em;
  }

  #settingsView[data-mobile-pane="demo"] .demo-settings-intro h2:focus {
    outline: 0;
  }

  #settingsView[data-mobile-pane="demo"] .demo-settings-intro p {
    margin-top: 6px;
  }

  #settingsView[data-mobile-pane="demo"] .demo-settings-control,
  #settingsView[data-mobile-pane="demo"] .demo-settings-safety {
    min-height: 76px;
    padding: 14px;
    border: 0;
    border-radius: 13px;
    background: var(--surface-soft);
  }

  #settingsView[data-mobile-pane="demo"] .demo-settings-safety {
    margin-top: 9px;
    background: color-mix(in srgb, var(--green-soft) 54%, var(--paper));
  }

  #settingsView .mobile-settings-actions {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 430px) and (max-width: 720px) {
  #settingsView[data-mobile-pane="bedrijf"] .settings-form-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  #todayView #todayNewMenu > summary .launcher-icon,
  #todayView #todayNewMenu .today-new-popover button,
  #todayView #todayNewMenu[open] .today-new-scrim {
    animation: none;
    transition: none;
  }
  #expensesNewMenu > summary .expenses-launcher-icon,
  #expensesNewMenu .today-new-popover button,
  #expensesNewMenu[open] .today-new-scrim {
    animation: none;
    transition: none;
  }
  #workNewMenu > summary .work-launcher-icon,
  #workNewMenu .today-new-popover button,
  #workNewMenu[open] .today-new-scrim {
    animation: none;
    transition: none;
  }
}


/* De mobiele tabbar bevat uitsluitend de vijf dagelijkse hoofdroutes. */
@media (max-width: 720px) {
  .sidebar > .nav-button[data-go="work"] { display: flex !important; }
  .sidebar > .nav-button[data-go="checks"],
  .sidebar > .mobile-settings-tab,
  .sidebar > .mobile-more-button { display: none !important; }
}

/* Alle vier regels in Actie nodig gebruiken dezelfde linker tekstas. */
@media (max-width: 720px) {
  #todayView .modern-daily-briefing #todayModernAttention .modern-attention-card,
  #todayView .modern-daily-briefing .modern-open-invoices,
  #todayView .modern-daily-briefing .modern-upcoming .modern-attention-card {
    grid-template-columns: 24px minmax(0, 1fr) 72px;
    column-gap: 10px;
    padding-inline: 14px;
  }

  #todayView .modern-checks-row {
    grid-template-columns: 24px minmax(0, 1fr) 20px;
    column-gap: 10px;
    padding-inline: 14px;
  }

  #todayView .modern-daily-briefing.is-clear,
  #todayView .today-mobile-dashboard.is-clear .modern-daily-briefing {
    padding: 10px 16px 8px;
  }

  #todayView .modern-daily-briefing.is-clear .modern-focus-head,
  #todayView .today-mobile-dashboard.is-clear .modern-focus-head {
    min-height: 36px;
    padding-bottom: 0;
  }
}

/* Summa 3.3 stap 1: actie, financiële status en aankomend zijn zelfstandige
   informatiegroepen. Alleen de echte actie kan worden ingeklapt; het overzicht
   en de eerstvolgende vervaldatum blijven daardoor scanbaar. */
#todayView .today-context-sections {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

#todayView .today-context-sections[hidden] { display: none !important; }

#todayView .today-financial-overview,
#todayView .today-upcoming-overview {
  min-width: 0;
  padding: 15px 16px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

#todayView .today-context-head { margin: 0; padding: 0 0 8px; }

#todayView .today-context-head h2 {
  margin: 0;
  font: 400 22px/1.2 var(--font-display);
  letter-spacing: -.04em;
}

#todayView .today-context-sections .modern-open-invoices,
#todayView .today-context-sections .modern-attention-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 72px;
  align-items: center;
  column-gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 66px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
}

#todayView .today-context-sections .modern-open-invoices > span:nth-child(2),
#todayView .today-context-sections .modern-attention-card > span:nth-child(2) { min-width: 0; }

#todayView .today-context-sections :is(.modern-open-invoices, .modern-attention-card) strong,
#todayView .today-context-sections :is(.modern-open-invoices, .modern-attention-card) small { display: block; }

#todayView .today-context-sections :is(.modern-open-invoices, .modern-attention-card) strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

#todayView .today-context-sections :is(.modern-open-invoices, .modern-attention-card) small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#todayView .today-context-sections :is(.modern-notification-icon, .modern-attention-icon) {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

#todayView .today-context-sections :is(.modern-focus-action, .modern-row-chevron) {
  display: grid;
  place-items: center;
  justify-self: end;
  width: 72px;
  min-width: 72px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--modern-blue);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

#todayView .today-context-sections .modern-checks-row {
  grid-column: 1 / -1;
  margin-top: 0;
}

@media (min-width: 721px) {
  #todayView .today-context-sections { grid-row: 5; }
  #todayView .modern-month-panel { grid-row: 6; }
}

@media (max-width: 720px) {
  #todayView .today-context-sections {
    grid-row: 6;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  #todayView .modern-month-panel { grid-row: 7; }
  #todayView .today-context-sections .modern-checks-row { padding-inline: 14px; }
}

/* Urenlijst: dezelfde tweeregelige kaartopbouw als de andere hoofdlijsten. */
@media (max-width: 720px) {
  #workView .work-list-panel {
    margin-top: 2px;
    padding: 10px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  #workView .work-list-head {
    display: block;
    margin: 0 2px 12px;
  }

  #workView .work-list-head h2 { font-size: 17px; }

  #workView .work-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  #workView .work-toolbar-controls {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    min-width: 0;
    gap: 8px;
  }

  #workView .work-toolbar-controls select,
  #workView .work-toolbar-controls #workFilter {
    width: 100%;
    min-width: 0;
    font-size: 12px;
  }

  #workView .work-toolbar-controls #workYear:not([hidden]) {
    width: 82px;
    flex: 0 0 82px;
  }

  #workView #workSearchWrap {
    grid-column: 2;
    grid-row: 1;
  }

  #workView #workSearchWrap.is-open {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  #workView .work-list-panel > #serviceList {
    display: grid;
    gap: 8px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  #workView .work-list-panel .work-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    align-items: stretch;
    gap: 0;
    min-height: 84px;
    padding: 0;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
  }

  #workView .work-list-panel .work-row-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "partij bedrag"
      "partij status";
    align-items: center;
    gap: 6px 10px;
    min-width: 0;
    min-height: 82px;
    padding: 10px 4px 10px 12px;
    border: 0;
    background: transparent;
  }

  #workView .work-row-party { grid-area: partij; gap: 10px; }
  #workView .work-row-icon { width: 32px; height: 32px; border-radius: 9px; }
  #workView .work-row-icon .summa-icon { width: 18px; height: 18px; }
  #workView .work-row-party strong { font-size: 14px; }
  #workView .work-row-party small { font-size: 12px; }
  #workView .work-row-main > .amount {
    grid-area: bedrag;
    align-self: end;
    justify-self: end;
    margin: 0;
    font-size: 15px;
  }
  #workView .work-source-badge {
    grid-area: status;
    align-self: start;
    justify-self: end;
    width: 72px;
    min-width: 72px;
    min-height: 20px;
    padding: 2px 5px;
    font-size: 12px;
  }

  #workView .work-list-panel .work-row-menu {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin: 0;
  }

  #workView .work-list-panel .work-row-menu > .invoice-more {
    display: grid;
    width: 40px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  #workView .work-empty-state {
    min-height: 104px;
    padding: 22px 12px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
  }
}

/* Factuur- en uitgavenkaarten delen mobiel exact dezelfde assen als Uren. */
@media (max-width: 720px) {
  :is(#invoicesView, #expensesView) .invoice-browser {
    padding: 10px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  :is(#invoicesView, #expensesView) .invoice-browser > .list {
    display: grid;
    gap: 8px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  :is(#invoicesView, #expensesView) .invoice-list-row,
  #expensesView .expense-list-row,
  #expensesView .expense-list-row:not(.has-subtitle),
  #expensesView .expense-list-row.has-subtitle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    align-items: stretch;
    gap: 0;
    min-height: 84px;
    padding: 0;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
  }

  :is(#invoicesView, #expensesView) .invoice-row-open,
  #expensesView .expense-row-open,
  #expensesView .expense-row-open:not(.has-subtitle),
  #expensesView .expense-row-open.has-subtitle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "partij bedrag"
      "partij status";
    align-items: center;
    gap: 6px 10px;
    min-width: 0;
    min-height: 82px;
    padding: 10px 4px 10px 12px;
    border: 0;
    background: transparent;
  }

  :is(#invoicesView, #expensesView) .invoice-party {
    grid-area: partij;
    gap: 10px;
    min-width: 0;
  }

  :is(#invoicesView, #expensesView) .invoice-avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  :is(#invoicesView, #expensesView) .invoice-avatar .summa-icon {
    width: 18px;
    height: 18px;
  }

  :is(#invoicesView, #expensesView) .invoice-party .grow { display: block; }
  :is(#invoicesView, #expensesView) .invoice-party strong { font-size: 14px; }
  :is(#invoicesView, #expensesView) .invoice-party small {
    display: block;
    margin-top: 3px;
    font-size: 12px;
  }

  :is(#invoicesView, #expensesView) .invoice-row-open > .amount {
    grid-area: bedrag;
    align-self: end;
    justify-self: end;
    margin: 0;
    font-size: 15px;
  }

  #invoicesView .invoice-status,
  #expensesView .expense-category {
    grid-area: status;
    align-self: start;
    justify-self: end;
    max-width: min(44vw, 210px);
    padding: 3px 8px;
    font-size: 12px;
  }

  :is(#invoicesView, #expensesView) .invoice-actions-menu:not(.detail-actions-menu) {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: center;
    margin: 0;
  }

  :is(#invoicesView, #expensesView) .invoice-actions-menu:not(.detail-actions-menu) > .invoice-more {
    display: grid;
    width: 40px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  #expensesView .expense-actions-menu { display: block; }
}

/* Factuurdetail behoudt in ieder donker palet leesbare primaire acties. */
@media (max-width: 720px) {
  /* Eén vaste mobiele contentas: de pagina levert de 14px buitenmarge. */
  #invoicesView .invoice-browser,
  #workView .work-list-panel {
    padding-inline: 0;
  }

  #workView .work-list-head {
    margin-inline: 0;
  }

  :root[data-theme="dark"] #detailView #detailMode button.is-active,
  :root[data-theme="dark"] #detailView #detailPaymentPanel .payment-actions button {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--canvas);
  }

  :root[data-theme="dark"] #detailView #detailMode button.is-active:hover,
  :root[data-theme="dark"] #detailView #detailPaymentPanel .payment-actions button:hover {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
    color: var(--canvas);
  }

  :root[data-theme="dark"] #detailView #detailPaymentPanel::after {
    opacity: .32;
  }
}

@media (max-width: 720px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #detailView #detailMode button.is-active,
  :root:not([data-theme="light"]) #detailView #detailPaymentPanel .payment-actions button {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--canvas);
  }

  :root:not([data-theme="light"]) #detailView #detailMode button.is-active:hover,
  :root:not([data-theme="light"]) #detailView #detailPaymentPanel .payment-actions button:hover {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
    color: var(--canvas);
  }

  :root:not([data-theme="light"]) #detailView #detailPaymentPanel::after {
    opacity: .32;
  }
}

/* Filters retain their full label; search keeps a dedicated touch target. */
@media (max-width: 720px) {
  #expensesView .expense-toolbar {
    display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: start; gap: 8px;
  }
  #expensesView .expense-toolbar-controls {
    grid-column: 1; grid-row: 1; display: grid; grid-template-columns: minmax(0, 1fr);
    gap: 8px; min-width: 0; width: 100%;
  }
  #expensesView .expense-toolbar-controls select { width: 100%; min-width: 0; max-width: 100%; }
  #expensesView #expenseSearchWrap { grid-column: 2; grid-row: 1; width: 44px; }
  #expensesView .expense-toolbar:has(#expenseSearchWrap.is-open) #expenseSearchWrap {
    grid-column: 1 / -1; grid-row: 1; width: 100%;
  }
  #expensesView .expense-toolbar:has(#expenseSearchWrap.is-open) .expense-toolbar-controls { grid-row: 2; grid-column: 1 / -1; }
  #todayView .today-settings-button, #todayView .modern-focus-dismiss { min-width: 44px; min-height: 44px; }
  #todayView .modern-overview-card .today-mobile-trend { max-width: 100%; }
  #todayView #todayRevenueTrendText { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 4px 10px; }
  #todayView #todayRevenueTrendText .modern-trend-icon { grid-column: 1; grid-row: 1 / 3; }
  #todayView #todayMobileRevenueChange, #todayView #todayMobileRevenueComparison { grid-column: 2; font-size: 13px; line-height: 1.45; }
  #todayView .studio-chart-value { font-size: 12px; }
  #todayView .chart-value-exact, #todayView .chart-value-rounded { display: none; }
  #todayView .chart-value-compact { display: inline; }
  #todayView .today-first-step { padding: 0 0 18px; }
}

@media (max-width: 720px) {
  /* Category labels have their own row so names and amounts stay recognizable. */
  #expensesView .expense-row-open,
  #expensesView .expense-row-open:not(.has-subtitle),
  #expensesView .expense-row-open.has-subtitle {
    grid-template-areas: "partij bedrag" "status status";
    grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px;
  }
  #expensesView .expense-category { justify-self: start; margin-left: 42px; max-width: calc(100% - 42px); white-space: normal; line-height: 1.4; }
  #expensesView .invoice-party strong { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
  #expensesView .invoice-party small { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
  #expensesView .expense-row-open > .amount { align-self: start; margin-top: 2px; }
  #detailView #detailMode button { min-height: 44px; }
}
