    :root {
      color-scheme: light;
      --themebg1: #fff;
      --themebg2: #eee;
      --themebg3: #ddd;
      --themefg1: #000;
      --themefg2: #222;
      --themefg3: #444;
      --themefontsize: small;
      --themeh1fontsize: 1.8rem;
      --themeh2fontsize: 1.15rem;
      --themeh3fontsize: 1rem;
      --themefontfamily: 'iransans', 'irs', Tahoma, Arial, sans-serif;
      --themebordersize: 1px;
      --themeborderstyle: solid;
      --themebordercolor: var(--themebg3);
      --themeborderadius: 5px;
      --themepadding: 12px;
      --thememargin: 12px;
      --themespace: 12px;
      --themeprimarybg: #3157d5;
      --themesecondrybg: #6b21a8;
      --themeprimaryfg: #fff;
      --themesecondryfg: #fff;
      color: var(--themefg2);
      background: var(--themebg2);
      font-family: var(--themefontfamily);
      font-synthesis: none;
    }

    :root[data-theme="dark"] {
      color-scheme: dark;
      --themebg1: #1f2937;
      --themebg2: #111827;
      --themebg3: #374151;
      --themefg1: #f9fafb;
      --themefg2: #e5e7eb;
      --themefg3: #9ca3af;
      --themeprimarybg: #5269a8;
      --themesecondrybg: #394f9f;
      --themeprimaryfg: #fff;
      --themesecondryfg: #fff;
    }

    @media (prefers-color-scheme: dark) {
      :root[data-theme="auto"] {
        color-scheme: dark;
        --themebg1: #1f2937;
        --themebg2: #111827;
        --themebg3: #374151;
        --themefg1: #f9fafb;
        --themefg2: #e5e7eb;
        --themefg3: #9ca3af;
        --themeprimarybg: #5269a8;
        --themesecondrybg: #394f9f;
        --themeprimaryfg: #fff;
        --themesecondryfg: #fff;
      }
    }

    * { box-sizing: border-box; }

    body {
      max-width: 1440px;
      margin: calc(var(--thememargin) * 0) auto;
      padding: calc(var(--themepadding) * 2.33333333) calc(var(--themepadding) * 2) calc(var(--themepadding) * 4.66666667);
      font-size: var(--themefontsize);
      font-family: var(--themefontfamily);
    }

    .admin-shell {
      display: grid;
      grid-template-columns: 238px minmax(0, 1fr);
      align-items: start;
      gap: calc(var(--themespace) * 1.83333333);
    }
    .admin-sidebar {
      position: sticky;
      top: 20px;
      padding: calc(var(--themepadding) * 1.5) var(--themepadding);
      border: var(--themebordersize) var(--themeborderstyle) var(--themebordercolor);
      border-radius: var(--themeborderadius);
      background: var(--themebg1);
      box-shadow: none;
    }
    .sidebar-title {
      margin: calc(var(--thememargin) * 0) calc(var(--thememargin) * 0.83333333) calc(var(--thememargin) * 1.16666667);
      color: var(--themefg3);
      font-weight: 700;
    }
    .side-menu { display: grid; gap: calc(var(--themespace) * 0.5); }
    .side-menu-item {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: var(--themespace);
      width: 100%;
      padding: var(--themepadding);
      border: var(--themebordersize) var(--themeborderstyle) transparent;
      background: none;
      color: var(--themefg3);
      text-align: right;
    }
    .side-menu-item:hover { background: var(--themebg2); color: var(--themefg2); }
    .side-menu-item.is-active {
      border-color: var(--themebordercolor);
      background: linear-gradient(135deg, var(--themeprimarybg), var(--themesecondrybg));
      color: var(--themesecondryfg);
      font-weight: 700;
    }
    .menu-icon { width: 22px; font-size: var(--themefontsize); text-align: center; }
    .admin-content { min-width: 0; }
    .admin-panel[hidden] { display: none !important; }
    .admin-panel > .card:last-child { margin-bottom: calc(var(--thememargin) * 0); }
    .report-card { min-height: 280px; }
    .dashboard-card, .dashboard-section { min-width: 0; }
    .dashboard-heading h2 { margin-bottom: calc(var(--thememargin) * 0.33333333); }
    .dashboard-heading .discount-help { margin: calc(var(--thememargin) * 0); }
    .dashboard-stats {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: var(--themespace);
      margin-top: calc(var(--thememargin) * 1.66666667);
    }
    .dashboard-stat {
      display: grid;
      gap: calc(var(--themespace) * 0.66666667);
      min-width: 0;
      padding: calc(var(--themepadding) * 1.33333333);
      border: var(--themebordersize) var(--themeborderstyle) var(--themebordercolor);
      border-radius: var(--themeborderadius);
      background: var(--themebg2);
    }
    .dashboard-stat span { color: var(--themefg3); font-size: var(--themefontsize); }
    .dashboard-stat strong { color: var(--themefg2); font-size: var(--themefontsize); overflow-wrap: anywhere; }
    .dashboard-section h2 { margin-bottom: var(--thememargin); }
    #person-expense-chart { width: 100%; min-height: 280px; direction: ltr; }
    .dashboard-message { min-height: 0; margin: calc(var(--thememargin) * 0); color: var(--themefg1); font-size: var(--themefontsize); line-height: 1.8; }
    .dashboard-table { margin-top: calc(var(--thememargin) * 0.33333333); }
    .dashboard-table tfoot { background: var(--themebg2); font-weight: 700; }

    h1, h2, h3, p { margin-top: calc(var(--thememargin) * 0); }
    h1 { margin-bottom: calc(var(--thememargin) * 0.66666667); font-size: var(--themeh1fontsize); }
    h2 { margin-bottom: calc(var(--thememargin) * 1.33333333); font-size: var(--themeh2fontsize); }
    h3 { font-size: var(--themeh3fontsize); }
    .intro { margin-bottom: calc(var(--thememargin) * 2.16666667); color: var(--themefg3); line-height: 1.8; }

    .card {
      margin-bottom: calc(var(--thememargin) * 1.66666667);
      padding: calc(var(--themepadding) * 1.83333333);
      border: var(--themebordersize) var(--themeborderstyle) var(--themebordercolor);
      border-radius: var(--themeborderadius);
      background: var(--themebg1);
      box-shadow: none;
    }

    textarea, input, select {
      width: 100%;
      padding: calc(var(--themepadding) * 0.83333333) var(--themepadding);
      border: var(--themebordersize) var(--themeborderstyle) var(--themebordercolor);
      border-radius: var(--themeborderadius);
      background: var(--themebg1);
      color: inherit;
      font: inherit;
    }

    textarea {
      min-height: 112px;
      direction: ltr;
      text-align: left;
      resize: vertical;
    }

    input[type="number"] { min-width: 130px; }
    input[type="checkbox"] {
      width: 18px;
      height: 18px;
      padding: calc(var(--themepadding) * 0);
      accent-color: var(--themeprimarybg);
      cursor: pointer;
    }

    button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: calc(var(--themespace) * 0.66666667);
      padding: calc(var(--themepadding) * 0.83333333) calc(var(--themepadding) * 1.25);
      border: calc(var(--themebordersize) * 0) var(--themeborderstyle) transparent;
      border-radius: var(--themeborderadius);
      background: linear-gradient(135deg, var(--themeprimarybg), var(--themesecondrybg));
      color: var(--themeprimaryfg);
      font: inherit;
      cursor: pointer;
    }

    button:hover { background: linear-gradient(135deg, var(--themesecondrybg), var(--themeprimarybg)); }
    .button-icon { flex: 0 0 auto; line-height: 1; }
    button:focus-visible, input:focus-visible, textarea:focus-visible {
      outline: calc(var(--themebordersize) * 3) var(--themeborderstyle) var(--themeprimarybg);
      outline-offset: calc(var(--themebordersize) * 2);
    }

    .secondary-button { margin-top: var(--thememargin); }
    .theme-settings { max-width: 420px; }
    .friend-form {
      display: grid;
      grid-template-columns: minmax(180px, 1fr) auto;
      align-items: end;
      gap: var(--themespace);
      margin-bottom: calc(var(--thememargin) * 1.33333333);
    }
    .friends-table { min-width: 420px; }
    .friends-table th:first-child,
    .friends-table td:first-child { width: 100px; }
    .friends-table th:last-child,
    .friends-table td:last-child { width: 130px; }
    .friend-selection-cell,
    .friend-actions-cell { text-align: center; }
    .friend-selection-cell input { width: 18px; margin: calc(var(--thememargin) * 0); vertical-align: middle; }
    .friend-actions-cell, .edit-actions { white-space: nowrap; }
    .archive-button, .restore-button { padding: calc(var(--themepadding) * 0.58333333) calc(var(--themepadding) * 0.83333333); font-size: var(--themefontsize); }
    .archive-button { background: var(--themebg2); color: var(--themefg1); }
    .archive-button:hover { background: var(--themebg3); }
    .archived-heading { margin: calc(var(--thememargin) * 1.5) calc(var(--thememargin) * 0) calc(var(--thememargin) * 0.83333333); font-size: var(--themeh3fontsize); }
    .archived-friends {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
      gap: calc(var(--themespace) * 0.83333333);
    }
    .backup-actions { display: flex; flex-wrap: wrap; gap: calc(var(--themespace) * 0.83333333); }
    .button { display: inline-flex; align-items: center; justify-content: center; }
    .file-button { padding: calc(var(--themepadding) * 0.83333333) calc(var(--themepadding) * 1.25); border-radius: var(--themeborderadius); background: linear-gradient(135deg, var(--themeprimarybg), var(--themesecondrybg)); color: var(--themeprimaryfg); cursor: pointer; }
    .file-button:hover { background: linear-gradient(135deg, var(--themesecondrybg), var(--themeprimarybg)); }
    .visually-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: calc(var(--themepadding) * 0);
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      clip-path: inset(50%);
      border: calc(var(--themebordersize) * 0) var(--themeborderstyle) transparent;
    }
    .add-expense-form {
      display: grid;
      grid-template-columns: minmax(140px, 1fr) minmax(180px, 1fr) minmax(150px, 220px) auto;
      align-items: end;
      gap: var(--themespace);
      margin-bottom: calc(var(--thememargin) * 1.5);
    }

    .friend-option {
      display: inline-flex;
      align-items: center;
      gap: calc(var(--themespace) * 0.58333333);
      padding: calc(var(--themepadding) * 0.66666667) calc(var(--themepadding) * 0.91666667);
      border: var(--themebordersize) var(--themeborderstyle) var(--themebordercolor);
      border-radius: var(--themeborderadius);
      cursor: pointer;
    }
    .friend-option input { margin: calc(var(--thememargin) * 0); }
    label.field-label { display: block; margin-bottom: calc(var(--thememargin) * 0.5); font-size: var(--themefontsize); }
    .table-wrap { overflow-x: auto; }
    table { width: 100%; border-collapse: collapse; white-space: nowrap; }
    th, td { padding: var(--themepadding) calc(var(--themepadding) * 0.83333333); border-bottom: var(--themebordersize) var(--themeborderstyle) var(--themebordercolor); text-align: right; }
    th { background: var(--themebg2); color: var(--themefg3); font-size: var(--themefontsize); }
    .expense-table td:not(:first-child) { text-align: center; }
    .expense-table th:not(:first-child) { text-align: center; }
    .expense-name { min-width: 140px; font-weight: 600; }
    .amount-cell { min-width: 130px; }
    .expense-edit-input { min-width: 120px; padding: calc(var(--themepadding) * 0.58333333) calc(var(--themepadding) * 0.66666667); }
    .edit-actions { display: flex; justify-content: center; gap: calc(var(--themespace) * 0.5); }
    .invoice-form {
      display: grid;
      grid-template-columns: minmax(180px, 1fr) auto;
      align-items: end;
      gap: var(--themespace);
      margin-bottom: calc(var(--thememargin) * 1.33333333);
    }
    .invoice-list { display: grid; gap: calc(var(--themespace) * 0.83333333); }
    .invoice-row {
      display: grid;
      grid-template-columns: minmax(140px, 1fr) repeat(2, minmax(130px, 190px)) auto;
      align-items: end;
      gap: var(--themespace);
      padding: var(--themepadding);
      border: var(--themebordersize) var(--themeborderstyle) var(--themebordercolor);
      border-radius: var(--themeborderadius);
    }
    .invoice-row label { display: block; font-size: var(--themefontsize); }
    .invoice-row input { margin-top: calc(var(--thememargin) * 0.41666667); }
    .invoice-guests { grid-column: 1 / -1; }
    .invoice-guests summary { cursor: pointer; color: var(--themefg3); }
    .invoice-guest-options { display: flex; flex-wrap: wrap; gap: calc(var(--themespace) * 0.66666667); margin-top: calc(var(--thememargin) * 0.83333333); }
    .invoice-guest-option {
      display: inline-flex;
      align-items: center;
      gap: calc(var(--themespace) * 0.5);
      padding: calc(var(--themepadding) * 0.5) calc(var(--themepadding) * 0.75);
      border: var(--themebordersize) var(--themeborderstyle) var(--themebordercolor);
      border-radius: var(--themeborderadius);
    }
    .invoice-guest-option input { width: 16px; height: 16px; margin: calc(var(--thememargin) * 0); padding: calc(var(--themepadding) * 0); }
    .invoice-delete { background: var(--themebg2); color: var(--themefg1); }
    .save-button { padding: calc(var(--themepadding) * 0.58333333) calc(var(--themepadding) * 0.83333333); }
    .cancel-button { padding: calc(var(--themepadding) * 0.58333333) calc(var(--themepadding) * 0.83333333); background: var(--themebg2); color: var(--themefg3); }
    .cancel-button:hover { background: var(--themebg3); }
    .remove-button { padding: calc(var(--themepadding) * 0.58333333) calc(var(--themepadding) * 0.83333333); background: var(--themebg2); color: var(--themefg1); }
    .remove-button:hover { background: var(--themebg3); }
    .total-row { background: var(--themebg2); font-weight: 700; }
    .empty-state { padding: calc(var(--themepadding) * 2.08333333) calc(var(--themepadding) * 0.83333333); color: var(--themefg3); text-align: center; }
    .summary { margin: calc(var(--thememargin) * 0) calc(var(--thememargin) * 0) calc(var(--thememargin) * 1.16666667); color: var(--themefg3); }
    .report-tabs { display: flex; flex-wrap: wrap; gap: calc(var(--themespace) * 0.66666667); margin: calc(var(--thememargin) * 0) calc(var(--thememargin) * 0) calc(var(--thememargin) * 1.5); border-bottom: var(--themebordersize) var(--themeborderstyle) var(--themebordercolor); }
    .report-tab {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: calc(var(--themespace) * 0.58333333);
      padding: calc(var(--themepadding) * 0.75) var(--themepadding);
      border: calc(var(--themebordersize) * 0) var(--themeborderstyle) transparent;
      border-bottom: calc(var(--themebordersize) * 2) var(--themeborderstyle) transparent;
      border-radius: var(--themeborderadius);
      background: none;
      color: var(--themefg3);
    }
    .report-tab:hover { background: var(--themebg2); color: var(--themefg2); }
    .report-tab.is-active { border-bottom-color: var(--themeprimarybg); color: var(--themeprimarybg); font-weight: 700; }
    .report-view[hidden] { display: none; }
    .report-view h3 { margin: calc(var(--thememargin) * 0) calc(var(--thememargin) * 0) var(--thememargin); font-size: var(--themeh3fontsize); }
    .expense-detail-table, .text-detail-table { margin-top: var(--thememargin); }
    .expense-detail-table td, .expense-detail-table th { min-width: 95px; }
    .expense-detail-table td:nth-child(1), .expense-detail-table th:nth-child(1),
    .expense-detail-table td:nth-child(3), .expense-detail-table th:nth-child(3) { min-width: 130px; }
    .text-breakdown { min-width: 280px; white-space: normal; line-height: 1.9; }
    .summary-table tfoot, .expense-detail-table tfoot { background: var(--themebg2); font-weight: 700; }
    .invoice-total-row td { background: var(--themebg2); font-weight: 600; }
    .invoice-total-row td:first-child { text-align: right; }
    .invoice-total-details { white-space: normal; font-size: var(--themefontsize); }
    .guest-share-row td { background: var(--themebg2); color: var(--themefg2); font-size: var(--themefontsize); }
    .invoice-expense-section { margin: calc(var(--thememargin) * 1.66666667) calc(var(--thememargin) * 0) calc(var(--thememargin) * 2.33333333); }
    .invoice-expense-section h3 { margin: calc(var(--thememargin) * 0) calc(var(--thememargin) * 0) calc(var(--thememargin) * 0.83333333); font-size: var(--themeh3fontsize); }
    .discount-control { max-width: 280px; margin-bottom: calc(var(--thememargin) * 1.33333333); }
    .discount-help { margin: calc(var(--thememargin) * 0.5) calc(var(--thememargin) * 0) calc(var(--thememargin) * 0); color: var(--themefg3); font-size: var(--themefontsize); }
    .export-button { margin-top: calc(var(--thememargin) * 1.33333333); }
    .export-message { min-height: 22px; margin: calc(var(--thememargin) * 0.66666667) calc(var(--thememargin) * 0) calc(var(--thememargin) * 0); color: var(--themefg1); font-size: var(--themefontsize); }
    .summary-table { margin-top: calc(var(--thememargin) * 0.83333333); }
    .print-help { margin: calc(var(--thememargin) * 0.66666667) calc(var(--thememargin) * 0) calc(var(--thememargin) * 0); color: var(--themefg3); font-size: var(--themefontsize); }
    .storage-message { min-height: 22px; margin: calc(var(--thememargin) * -0.41666667) calc(var(--thememargin) * 0) calc(var(--thememargin) * 1.16666667); color: var(--themefg2); font-size: var(--themefontsize); }
    .storage-message[data-error="true"] { color: var(--themefg1); }
    .allocation-warning { color: var(--themefg1); font-size: var(--themefontsize); }

    @media (max-width: 680px) {
      body { padding: calc(var(--themepadding) * 1.33333333) var(--themepadding) calc(calc(var(--themepadding) * 9.33333333) + env(safe-area-inset-bottom)); }
      header { margin-bottom: calc(var(--thememargin) * 1.5); }
      h1 { font-size: var(--themeh1fontsize); line-height: 1.5; }
      h2 { margin-bottom: var(--thememargin); font-size: var(--themeh2fontsize); }
      .intro { margin-bottom: calc(var(--thememargin) * 0); font-size: var(--themefontsize); line-height: 1.8; }
      .admin-shell { grid-template-columns: minmax(0, 1fr); gap: calc(var(--themespace) * 1.16666667); }
      .admin-sidebar {
        position: fixed;
        z-index: 20;
        top: auto;
        right: 10px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        left: 10px;
        height: auto;
        max-width: 460px;
        margin: calc(var(--thememargin) * 0) auto;
        padding: calc(var(--themepadding) * 0.66666667);
        border-radius: var(--themeborderadius);
        background: var(--themebg1);
        box-shadow: none;
      }
      .sidebar-title { display: none; }
      .side-menu {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: calc(var(--themespace) * 0.16666667);
      }
      #tab-home { grid-column: 3; }
      #tab-people { grid-column: 1; grid-row: 1; }
      #tab-invoices { grid-column: 2; grid-row: 1; }
      #tab-reports { grid-column: 4; grid-row: 1; }
      #tab-settings { grid-column: 5; grid-row: 1; }
      .side-menu-item {
        flex-direction: column;
        justify-content: center;
        gap: calc(var(--themespace) * 0.25);
        min-width: 0;
        min-height: 58px;
        padding: calc(var(--themepadding) * 0.41666667) calc(var(--themepadding) * 0.16666667);
        font-size: var(--themefontsize);
        line-height: 1.3;
        text-align: center;
        white-space: normal;
      }
      .side-menu-item > span:last-child { width: 100%; min-width: 0; }
      .side-menu-item.is-active > span:last-child {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: calc(var(--themepadding) * 0);
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        clip-path: inset(50%);
      }
      .menu-icon { width: auto; font-size: var(--themefontsize); line-height: 1.2; }
      .admin-content, .admin-panel { min-width: 0; }
      .card { margin-bottom: calc(var(--thememargin) * 1.16666667); padding: calc(var(--themepadding) * 1.33333333) calc(var(--themepadding) * 1.16666667); border-radius: var(--themeborderadius); }
      .friend-form, .invoice-form, .add-expense-form, .invoice-row { grid-template-columns: minmax(0, 1fr); }
      .friend-form, .invoice-form, .add-expense-form { gap: calc(var(--themespace) * 0.83333333); }
      .friend-form button, .invoice-form button, .add-expense-form button,
      .export-button { width: 100%; min-height: 44px; }
      .invoice-row { gap: calc(var(--themespace) * 0.83333333); padding: var(--themepadding); }
      .invoice-guests { grid-column: auto; }
      .invoice-row input, input[type="number"], select { min-width: 0; min-height: 44px; }
      .discount-control, .theme-settings { max-width: none; }
      .friends-table { min-width: 0; table-layout: fixed; }
      .friends-table th:first-child, .friends-table td:first-child { width: 62px; }
      .friends-table th:last-child, .friends-table td:last-child { width: 76px; }
      .friends-table th, .friends-table td { padding: calc(var(--themepadding) * 0.83333333) calc(var(--themepadding) * 0.5); }
      .friend-selection-cell input { width: 22px; height: 22px; }
      .friend-actions-cell { display: flex; justify-content: center; gap: calc(var(--themespace) * 0.33333333); }
      .friend-actions-cell .archive-button, .friend-actions-cell .restore-button { padding: calc(var(--themepadding) * 0.5); }
      .mobile-icon-only {
        position: relative;
        width: 40px;
        min-width: 40px;
        min-height: 40px;
        padding: calc(var(--themepadding) * 0);
      }
      .mobile-icon-only .button-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: calc(var(--themepadding) * 0);
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        clip-path: inset(50%);
        border: calc(var(--themebordersize) * 0) var(--themeborderstyle) transparent;
      }
      .edit-actions { display: flex; justify-content: center; gap: calc(var(--themespace) * 0.41666667); }
      .edit-actions button { min-height: 40px; padding: calc(var(--themepadding) * 0.58333333) calc(var(--themepadding) * 0.75); }
      .table-wrap {
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
      }
      table { width: max-content; min-width: 100%; }
      .friends-table { width: 100%; }
      .invoice-table { min-width: max-content; }
      .expense-table th, .expense-table td,
      .expense-detail-table th, .expense-detail-table td,
      .text-detail-table th, .text-detail-table td { padding: calc(var(--themepadding) * 0.75) calc(var(--themepadding) * 0.66666667); font-size: var(--themefontsize); }
      .report-card { min-height: 0; }
      .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(var(--themespace) * 0.66666667); margin-top: calc(var(--thememargin) * 1.16666667); }
      .dashboard-stat { gap: calc(var(--themespace) * 0.5); padding: var(--themepadding) calc(var(--themepadding) * 0.83333333); }
      .dashboard-stat span { font-size: var(--themefontsize); }
      .dashboard-stat strong { font-size: var(--themefontsize); }
      .dashboard-table th, .dashboard-table td { padding: calc(var(--themepadding) * 0.75) calc(var(--themepadding) * 0.66666667); font-size: var(--themefontsize); }
      .report-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: calc(var(--themespace) * 0.16666667);
        margin: calc(var(--thememargin) * 0) calc(var(--thememargin) * -0.33333333) calc(var(--thememargin) * 1.16666667);
      }
      .report-tab { min-width: 0; padding: calc(var(--themepadding) * 0.75) calc(var(--themepadding) * 0.33333333); font-size: var(--themefontsize); line-height: 1.5; }
      .report-view h3 { line-height: 1.7; }
      .person-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
      .summary { line-height: 1.8; overflow-wrap: anywhere; }
      .backup-actions { display: grid; grid-template-columns: 1fr; }
      .backup-actions > button, .backup-actions > .file-button { width: 100%; min-height: 44px; }
      .file-button { min-height: 44px; }
      .export-message, .storage-message, .allocation-warning { overflow-wrap: anywhere; line-height: 1.8; }
      .text-breakdown { min-width: 220px; }
    }

    @media (max-width: 380px) {
      body { padding-right: calc(var(--themepadding) * 0.66666667); padding-left: calc(var(--themepadding) * 0.66666667); }
      .card { padding: calc(var(--themepadding) * 1.16666667) calc(var(--themepadding) * 0.83333333); }
      .side-menu-item { font-size: var(--themefontsize); }
      .report-tab { font-size: var(--themefontsize); }
      .friends-table th:first-child, .friends-table td:first-child { width: 52px; }
      .friends-table th:last-child, .friends-table td:last-child { width: 68px; }
    }

    .fa-solid, .fa-regular, .fa-brands { font-size: max(16px, 1em); }

    @media print {
      :root, body {
        color-scheme: light;
        --themebg1: #fff;
        --themebg2: #eee;
        --themebg3: #ddd;
        --themefg1: #000;
        --themefg2: #222;
        --themefg3: #444;
        --themebordercolor: #ddd;
        --themesecondrybg: #eee;
        --themesecondryfg: #222;
        background: var(--themebg1);
        color: var(--themefg1);
      }
      body { max-width: none; padding: calc(var(--themepadding) * 0); }
      .admin-shell { display: block; }
      .admin-sidebar, .admin-panel:not(#panel-invoices):not(#panel-reports) { display: none !important; }
      #panel-invoices, #panel-invoices[hidden],
      #panel-reports, #panel-reports[hidden] { display: block !important; }
      .admin-content { width: 100%; }
      .card { padding: var(--themepadding) calc(var(--themepadding) * 0); border: calc(var(--themebordersize) * 0) var(--themeborderstyle) transparent; box-shadow: none; break-inside: avoid; }
      .screen-only, button, .storage-message, .export-message, .print-help { display: none !important; }
      .invoice-tables-card { display: block !important; }
      .invoice-expense-section { break-inside: avoid; }
      .report-view[hidden] { display: block !important; }
      .report-view { margin-top: calc(var(--thememargin) * 1.66666667); break-inside: avoid; }
      .report-tabs { display: none; }
      .text-breakdown { min-width: 0; }
      table { white-space: normal; }
      .table-wrap { overflow: visible; }
    }
