
    :root {
      --page-bg: linear-gradient(135deg, #f6f7f2 0%, #eef8ee 100%);
      --bg: #f6f7f2;
      --card: #ffffff;
      --text: #1f2933;
      --muted: #6b7280;
      --border: #d9e2d0;
      --accent: #2f855a;
      --accent-dark: #276749;
      --accent-soft: #dcfce7;
      --warning: #f59e0b;
      --danger: #dc2626;
      --ios-action-red: #ff3b30;
      --shadow: 0 16px 35px rgba(31, 41, 51, 0.08);
      --radius: 18px;
    }

    html[data-theme="dark"] {
      --page-bg: #0f172a;
      --bg: #0f172a;
      --card: #111827;
      --text: #f8fafc;
      --muted: #94a3b8;
      --border: #334155;
      --accent: #60a5fa;
      --accent-dark: #38bdf8;
      --accent-soft: #1e293b;
      --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: var(--page-bg);
      color: var(--text);
    }

    header {
      padding: 28px 20px 18px;
      max-width: 1180px;
      margin: 0 auto;
    }

    .hero {
      display: grid;
      grid-template-columns: 1.4fr 0.8fr;
      gap: 20px;
      align-items: stretch;
    }

    .hero-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 28px;
      box-shadow: var(--shadow);
    }

    .hero-card h1 {
      margin: 0 0 8px;
      font-size: clamp(2rem, 4vw, 3.4rem);
      letter-spacing: -0.04em;
    }

    .hero-card p {
      margin: 0;
      color: var(--muted);
      font-size: 1.05rem;
      max-width: 760px;
      line-height: 1.5;
    }

    .badge-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 22px;
    }

    .badge {
      background: var(--accent-soft);
      color: var(--accent-dark);
      border-radius: 999px;
      padding: 8px 12px;
      font-weight: 700;
      font-size: 0.86rem;
    }

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

    .impact-card {
      background: #143d2b;
      color: white;
      border-radius: var(--radius);
      padding: 22px;
      box-shadow: var(--shadow);
    }

    .impact-card strong {
      display: block;
      font-size: 2rem;
      margin-bottom: 6px;
    }

    .impact-card span {
      color: #c7f9d4;
      line-height: 1.4;
    }

    main {
      max-width: 1180px;
      margin: 0 auto;
      padding: 0 20px 40px;
    }

    .stats {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 14px;
      margin: 16px 0 22px;
    }

    .stat {
      background: rgba(255,255,255,0.76);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 16px;
      backdrop-filter: blur(10px);
    }

    .stat strong {
      display: block;
      font-size: 1.7rem;
      margin-bottom: 3px;
    }

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

    .tabs {
      display: flex;
      gap: 10px;
      overflow-x: auto;
      padding: 4px 0 14px;
      position: sticky;
      top: 0;
      z-index: 4;
      background: linear-gradient(180deg, rgba(246,247,242,0.98), rgba(246,247,242,0.86));
      backdrop-filter: blur(12px);
    }

    .tab {
      border: 1px solid var(--border);
      background: white;
      color: var(--text);
      border-radius: 999px;
      padding: 10px 16px;
      cursor: pointer;
      font-weight: 800;
      white-space: nowrap;
    }

    .tab.active {
      background: var(--accent);
      border-color: var(--accent);
      color: white;
    }

    .grid {
      display: grid;
      grid-template-columns: 0.85fr 1.15fr;
      gap: 18px;
      align-items: start;
    }

    section.panel {
      display: none;
    }

    section.panel.active {
      display: block;
    }

    .card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 20px;
      box-shadow: var(--shadow);
      margin-bottom: 18px;
    }

    .card h2, .card h3 {
      margin: 0 0 12px;
      letter-spacing: -0.02em;
    }

    .card p.help {
      margin-top: -4px;
      color: var(--muted);
      line-height: 1.45;
    }

    form {
      display: grid;
      gap: 10px;
    }

    label {
      font-size: 0.86rem;
      color: var(--muted);
      font-weight: 750;
    }

    input, select, textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 13px;
      padding: 12px 13px;
      font: inherit;
      background: #fbfcfa;
      color: var(--text);
      outline: none;
    }

    input:focus, select:focus, textarea:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 4px rgba(47, 133, 90, 0.12);
    }

    /* App-eigene Selects: Das native Select bleibt als Datenquelle erhalten,
       während Trigger und Optionsliste vollständig im ShopPilot-Stil erscheinen. */
    select.app-select-native {
      position: absolute !important;
      width: 1px !important;
      height: 1px !important;
      min-width: 1px !important;
      min-height: 1px !important;
      margin: -1px !important;
      padding: 0 !important;
      border: 0 !important;
      opacity: 0 !important;
      overflow: hidden !important;
      clip-path: inset(50%) !important;
      pointer-events: none !important;
    }

    .app-select {
      position: relative;
      width: 100%;
      min-width: 0;
      color: var(--text);
    }

    .app-select.is-open {
      z-index: 120;
    }

    .app-select-trigger {
      width: 100%;
      min-height: 50px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 14px;
      margin: 0;
      padding: 12px 14px 12px 16px;
      border: 1px solid var(--border);
      border-radius: 16px;
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 248, 0.98));
      color: var(--text);
      box-shadow: 0 5px 14px rgba(31, 41, 51, 0.05);
      font: inherit;
      font-weight: 850;
      line-height: 1.3;
      text-align: start;
      cursor: pointer;
      transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease;
    }

    .app-select-trigger:hover:not(:disabled) {
      border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
      background: #ffffff;
      box-shadow: 0 8px 20px rgba(31, 41, 51, 0.08);
    }

    .app-select-trigger:focus-visible,
    .app-select.is-open .app-select-trigger {
      border-color: var(--accent);
      outline: none;
      box-shadow:
        0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent),
        0 10px 24px rgba(31, 41, 51, 0.09);
    }

    .app-select.is-open .app-select-trigger {
      transform: translateY(-1px);
    }

    .app-select-value {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .app-select-chevron {
      width: 28px;
      height: 28px;
      display: inline-grid;
      place-items: center;
      border-radius: 10px;
      background: color-mix(in srgb, var(--accent) 10%, transparent);
      color: var(--accent-dark);
      transition: transform 0.18s ease, background 0.18s ease;
    }

    .app-select-chevron svg {
      width: 15px;
      height: 15px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2.4;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .app-select.is-open .app-select-chevron {
      transform: rotate(180deg);
      background: color-mix(in srgb, var(--accent) 18%, transparent);
    }

    .app-select-menu {
      position: absolute;
      top: calc(100% + 9px);
      left: 0;
      width: 100%;
      margin: 0;
      overflow: hidden;
      border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
      border-radius: 20px;
      background: rgba(255, 255, 255, 0.98);
      box-shadow:
        0 24px 60px rgba(31, 41, 51, 0.18),
        0 4px 14px rgba(31, 41, 51, 0.08);
      backdrop-filter: blur(18px);
      animation: app-select-menu-in 0.16s ease-out;
      transform-origin: top center;
    }

    .app-select-scroll {
      max-height: min(310px, 46vh);
      display: grid;
      gap: 4px;
      padding: 8px;
      overflow-x: hidden;
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-gutter: stable;
      scrollbar-width: thin;
      scrollbar-color: color-mix(in srgb, var(--accent) 38%, transparent) transparent;
      -webkit-overflow-scrolling: touch;
    }

    .app-select.opens-up .app-select-menu {
      top: auto;
      bottom: calc(100% + 9px);
      transform-origin: bottom center;
    }

    .app-select.opens-down .app-select-menu {
      position: absolute;
      top: calc(100% + 9px);
      bottom: auto;
      margin-top: 0;
      transform-origin: top center;
    }

    .app-select-menu[hidden] {
      display: none !important;
    }

    .app-select-option {
      width: 100%;
      min-height: 44px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 24px;
      align-items: center;
      gap: 12px;
      margin: 0;
      padding: 10px 11px 10px 13px;
      border: 0;
      border-radius: 14px;
      background: transparent;
      color: var(--text);
      font: inherit;
      font-weight: 750;
      line-height: 1.3;
      text-align: start;
      cursor: pointer;
      transition: background 0.14s ease, color 0.14s ease, transform 0.14s ease;
    }

    .app-select-option:hover:not(:disabled),
    .app-select-option.is-active:not(:disabled) {
      background: color-mix(in srgb, var(--accent) 10%, #ffffff);
      color: var(--accent-dark);
    }

    .app-select-option:active:not(:disabled) {
      transform: scale(0.99);
    }

    .app-select-option[aria-selected="true"] {
      background: color-mix(in srgb, var(--accent) 14%, #ffffff);
      color: var(--accent-dark);
      font-weight: 900;
    }

    .app-select-option:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }

    .app-select-option-label {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .app-select-option-check {
      width: 22px;
      height: 22px;
      display: inline-grid;
      place-items: center;
      border-radius: 8px;
      background: var(--accent);
      color: #ffffff;
      font-size: 0.78rem;
      font-weight: 950;
      opacity: 0;
      transform: scale(0.72);
      transition: opacity 0.14s ease, transform 0.14s ease;
    }

    .app-select-option[aria-selected="true"] .app-select-option-check {
      opacity: 1;
      transform: scale(1);
    }

    .app-select.is-disabled .app-select-trigger,
    .app-select-trigger:disabled {
      opacity: 0.58;
      cursor: not-allowed;
      box-shadow: none;
    }

    .app-select.is-invalid .app-select-trigger {
      border-color: var(--danger);
      box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
    }

    .app-select-scroll::-webkit-scrollbar {
      width: 9px;
    }

    .app-select-scroll::-webkit-scrollbar-track {
      background: transparent;
      margin-block: 10px;
    }

    .app-select-scroll::-webkit-scrollbar-thumb {
      border: 2px solid transparent;
      border-radius: 999px;
      background: color-mix(in srgb, var(--accent) 38%, transparent);
      background-clip: padding-box;
    }

    html[data-theme="dark"] .app-select-trigger {
      border-color: var(--border);
      background: linear-gradient(180deg, #1e293b, #172033);
      color: var(--text);
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    }

    html[data-theme="dark"] .app-select-trigger:hover:not(:disabled) {
      border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
      background: #223049;
    }

    html[data-theme="dark"] .app-select-menu {
      border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
      background: rgba(15, 23, 42, 0.98);
      box-shadow: 0 26px 65px rgba(0, 0, 0, 0.48);
    }

    html[data-theme="dark"] .app-select-option {
      color: #e5edf8;
    }

    html[data-theme="dark"] .app-select-option:hover:not(:disabled),
    html[data-theme="dark"] .app-select-option.is-active:not(:disabled),
    html[data-theme="dark"] .app-select-option[aria-selected="true"] {
      background: color-mix(in srgb, var(--accent) 17%, #172033);
      color: #ffffff;
    }

    @keyframes app-select-menu-in {
      from {
        opacity: 0;
        transform: translateY(-5px) scale(0.985);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    @media (max-width: 520px) {
      .app-select-trigger {
        min-height: 52px;
        border-radius: 17px;
      }

      .app-select-menu {
        border-radius: 22px;
      }

      .app-select-scroll {
        max-height: min(340px, 52vh);
        padding: 9px;
      }

      .app-select-option {
        min-height: 48px;
        border-radius: 15px;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .app-select-trigger,
      .app-select-chevron,
      .app-select-option,
      .app-select-option-check,
      .receipt-ocr-progress-fill {
        transition: none;
      }

      .app-select-menu,
      .receipt-ocr-status.is-scanning .receipt-ocr-icon {
        animation: none;
      }
    }

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

    button.primary, button.secondary, button.danger, button.icon {
      border: 0;
      border-radius: 13px;
      padding: 12px 14px;
      font-weight: 850;
      cursor: pointer;
      font: inherit;
    }

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

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

    button.secondary {
      background: #edf2e7;
      color: #285b3e;
      border: 1px solid var(--border);
    }

    button.danger {
      background: #fee2e2;
      color: var(--danger);
      border: 1px solid #fecaca;
    }

    button.icon {
      padding: 8px 10px;
      background: #f3f4f6;
      border: 1px solid #e5e7eb;
    }

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

    .item {
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 13px;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: center;
      background: #fff;
    }

    .item-main {
      min-width: 0;
    }

    .item-title {
      font-weight: 900;
      margin-bottom: 3px;
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .item-meta {
      color: var(--muted);
      font-size: 0.9rem;
      line-height: 1.35;
    }

    .pill {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      border-radius: 999px;
      padding: 4px 8px;
      font-size: 0.76rem;
      font-weight: 850;
      background: #f3f4f6;
      color: #374151;
    }

    .pill.warning { background: #fef3c7; color: #92400e; }
    .pill.danger { background: #fee2e2; color: #991b1b; }
    .pill.good { background: #dcfce7; color: #166534; }

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

    .empty {
      text-align: center;
      color: var(--muted);
      border: 1px dashed var(--border);
      padding: 28px 16px;
      border-radius: 16px;
      background: #fbfcfa;
    }

    .recipe-grid, .meal-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
    }

    .recipe {
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 15px;
      background: #fff;
    }

    .recipe h3 {
      margin: 0 0 8px;
      font-size: 1rem;
    }

    .recipe ul {
      margin: 8px 0 12px;
      padding-left: 20px;
      color: var(--muted);
    }

    .score {
      height: 8px;
      background: #e5e7eb;
      border-radius: 999px;
      overflow: hidden;
      margin: 8px 0;
    }

    .score span {
      display: block;
      height: 100%;
      background: var(--accent);
      border-radius: 999px;
    }

    .week {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 10px;
    }

    .day {
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 12px;
      background: #fff;
      min-height: 130px;
    }

    .day strong {
      display: block;
      margin-bottom: 8px;
    }

    .meal {
      background: #f0fdf4;
      border: 1px solid #bbf7d0;
      color: #14532d;
      padding: 8px;
      border-radius: 12px;
      font-size: 0.88rem;
      margin-bottom: 7px;
      display: flex;
      justify-content: space-between;
      gap: 8px;
    }

    .check {
      display: flex;
      align-items: center;
      gap: 9px;
    }

    .check input { width: auto; }

    .checked .item-title {
      text-decoration: line-through;
      color: var(--muted);
    }

    .split-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .tip {
      border-left: 5px solid var(--accent);
      background: #f0fdf4;
      border-radius: 14px;
      padding: 14px;
      color: #14532d;
      line-height: 1.45;
    }

    .storage-alert {
      position: fixed;
      left: 50%;
      bottom: 78px;
      width: min(620px, calc(100% - 28px));
      transform: translateX(-50%);
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 12px 16px;
      align-items: center;
      padding: 16px;
      border: 1px solid #f59e0b;
      border-radius: 18px;
      background: #fffbeb;
      color: #78350f;
      box-shadow: var(--shadow);
      z-index: 90;
    }

    .storage-alert[data-level="error"] {
      border-color: #ef4444;
      background: #fff1f2;
      color: #881337;
    }

    .storage-alert-message {
      min-width: 0;
      line-height: 1.4;
    }

    .storage-alert-message strong,
    .storage-alert-message span {
      display: block;
    }

    .storage-alert-message span {
      margin-top: 3px;
      font-size: 0.86rem;
    }

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

    .storage-alert-actions button {
      min-height: 38px;
      padding: 8px 12px;
      border-radius: 12px;
    }

    .storage-status-card {
      margin-top: 14px;
      padding: 12px 14px;
      border: 1px solid #dbe3dc;
      border-radius: 14px;
      background: #fbfcfa;
      color: #475569;
      font-size: 0.82rem;
      line-height: 1.45;
    }

    .storage-status-card strong,
    .storage-status-card span {
      display: block;
    }

    .storage-status-card[data-level="warning"] {
      border-color: #f59e0b;
      background: #fffbeb;
      color: #78350f;
    }

    @media (max-width: 640px) {
      .storage-alert {
        grid-template-columns: 1fr;
        bottom: 72px;
      }

      .storage-alert-actions {
        justify-content: stretch;
      }

      .storage-alert-actions button {
        flex: 1 1 auto;
      }
    }


    .start-modal {
      position: fixed;
      inset: 0;
      background: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      z-index: 50;
    }

    .start-modal.hidden {
      display: none;
    }

    .start-box {
      width: min(1120px, 100%);
      max-width: 100%;
      background: transparent;
      border: none;
      border-radius: 0;
      padding: 28px 18px 22px;
      position: relative;
      box-sizing: border-box;
      box-shadow: none;
    }

    .start-box h2 {
      margin: 0 0 8px;
      font-size: clamp(1.8rem, 4vw, 2.6rem);
      letter-spacing: -0.04em;
      text-align: center;
    }

    .start-box > p {
      margin: 0 auto 22px;
      color: var(--muted);
      text-align: center;
      max-width: 620px;
      line-height: 1.5;
    }

    #shoppingChoiceModal .start-box h2 {
      margin-bottom: 24px;
    }

    .choice-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }

    .choice-grid > * {
      box-sizing: border-box;
    }

    .choice-card {
      width: 100%;
      min-width: 0;
      max-width: 100%;
      border: 1px solid var(--border);
      border-radius: 22px;
      padding: 22px;
      background: #fbfcfa;
      cursor: pointer;
      text-align: left;
      transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
      min-height: 180px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      box-sizing: border-box;
      position: relative;
      z-index: 1;
      pointer-events: auto;
    }

    .choice-card:hover {
      transform: translateY(-3px);
      box-shadow: var(--shadow);
      border-color: var(--accent);
    }

    .choice-icon {
      width: 54px;
      height: 54px;
      display: grid;
      place-items: center;
      border-radius: 18px;
      background: var(--accent-soft);
      font-size: 1.8rem;
      margin-bottom: 14px;
    }

    .choice-card h3 {
      margin: 0 0 8px;
      font-size: 1.3rem;
    }

    .choice-card p {
      margin: 0 0 16px;
      color: var(--muted);
      line-height: 1.45;
    }

    .choice-card .primary {
      width: 100%;
    }

    .choice-skip {
      display: block;
      margin: 18px auto 0;
      border: 0;
      background: transparent;
      color: var(--muted);
      font-weight: 800;
      cursor: pointer;
      padding: 10px;
    }

    .start-shopping-box {
      width: min(430px, 100%);
      display: grid;
      gap: 16px;
      align-content: start;
      min-height: auto;
      padding: 28px 22px 24px;
      background: #ffffff;
    }

    #startShoppingScreen.start-modal {
      align-items: flex-start;
      overflow-y: auto;
      padding-top: max(18px, env(safe-area-inset-top));
      background: #ffffff;
    }

    #startShoppingScreen .start-box {
      margin: 0;
      border: 0;
      box-shadow: none;
      padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }

    .start-shopping-fixed-back-bar {
      position: fixed;
      left: 50%;
      bottom: 0;
      z-index: 30;
      width: min(430px, calc(100% - 28px));
      padding: 10px 22px max(10px, env(safe-area-inset-bottom));
      transform: translateX(-50%);
      background: transparent;
      pointer-events: none;
    }

    #startShoppingScreen .start-shopping-fixed-back-bar .choice-skip {
      margin: 0;
      pointer-events: auto;
    }

    @media (max-width: 430px) {
      .start-shopping-fixed-back-bar {
        padding-right: 16px;
        padding-left: 16px;
      }
    }

    #startShoppingScreen h2 {
      margin: 0;
      color: #111827;
      text-align: center;
      font-size: clamp(1.8rem, 5vw, 2.2rem);
      line-height: 1.12;
      letter-spacing: -0.045em;
      font-weight: 900;
    }

    #startShoppingScreen p {
      margin: 0 auto 4px;
      color: var(--muted);
      text-align: center;
      max-width: 360px;
      line-height: 1.45;
    }

    .start-shopping-lists {
      width: 100%;
      display: grid;
      gap: 12px;
      margin-top: 6px;
    }

    .start-shopping-list-button {
      width: 100%;
      border: 1px solid #d1d5db;
      border-radius: 16px;
      background: #ffffff;
      padding: 14px 16px;
      text-align: left;
      cursor: pointer;
      font: inherit;
      color: #111827;
      box-shadow: none;
    }

    .start-shopping-list-button:hover,
    .start-shopping-list-button:focus {
      background: #f9fafb;
      outline: none;
    }

    .start-shopping-list-card,
    .saved-list-card {
      position: relative;
      width: 100%;
      min-width: 0;
      max-width: 100%;
    }

    .saved-list-card .saved-list-summary {
      padding-right: 96px;
    }

    .start-shopping-list-card .start-shopping-list-button {
      padding-right: 96px;
    }

    .list-edit-button,
    .list-delete-button {
      position: absolute;
      top: 10px;
      width: 34px;
      height: 34px;
      min-height: 34px;
      border: 1px solid #e5e7eb;
      border-radius: 999px;
      background: #ffffff;
      display: inline-grid;
      place-items: center;
      padding: 0;
      cursor: pointer;
      font-size: 1rem;
      line-height: 1;
      box-shadow: 0 8px 18px rgba(31, 41, 51, 0.08);
      z-index: 2;
    }

    .list-edit-button {
      right: 52px;
      color: var(--accent-dark);
    }

    .list-delete-button {
      right: 10px;
      color: #991b1b;
    }

    .list-edit-button:hover,
    .list-edit-button:focus-visible {
      background: var(--accent-soft);
      border-color: var(--accent);
      outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
      outline-offset: 2px;
    }

    .list-delete-button:hover,
    .list-delete-button:focus-visible {
      background: #fee2e2;
      border-color: #fecaca;
      outline: 3px solid rgba(220, 38, 38, 0.24);
      outline-offset: 2px;
    }

    #deleteListModal.app-confirm-overlay,
    #deleteExpenseModal.app-confirm-overlay,
    #emptyListConfirmModal.app-confirm-overlay,
    #currencyConfirmModal.app-confirm-overlay,
    #startEmptyShoppingListModal.app-confirm-overlay {
      position: fixed;
      inset: 0;
      z-index: 180;
      width: 100%;
      height: 100dvh;
      display: grid;
      place-items: center;
      padding: 18px;
      box-sizing: border-box;
      overflow: hidden;
      background: rgba(15, 23, 42, 0.30);
      -webkit-backdrop-filter: blur(6px) saturate(0.92);
      backdrop-filter: blur(6px) saturate(0.92);
      isolation: isolate;
    }

    #deleteListModal.app-confirm-overlay.hidden,
    #deleteExpenseModal.app-confirm-overlay.hidden,
    #emptyListConfirmModal.app-confirm-overlay.hidden,
    #currencyConfirmModal.app-confirm-overlay.hidden,
    #startEmptyShoppingListModal.app-confirm-overlay.hidden {
      display: none !important;
    }

    html:has(#deleteListModal:not(.hidden)),
    html:has(#deleteExpenseModal:not(.hidden)),
    html:has(#emptyListConfirmModal:not(.hidden)),
    html:has(#currencyConfirmModal:not(.hidden)),
    html:has(#startEmptyShoppingListModal:not(.hidden)),
    body:has(#deleteListModal:not(.hidden)),
    body:has(#deleteExpenseModal:not(.hidden)),
    body:has(#emptyListConfirmModal:not(.hidden)),
    body:has(#currencyConfirmModal:not(.hidden)),
    body:has(#startEmptyShoppingListModal:not(.hidden)) {
      overflow: hidden !important;
      overscroll-behavior: none !important;
    }

    #deleteListModal .delete-confirm-box,
    #deleteExpenseModal .delete-confirm-box,
    #emptyListConfirmModal .delete-confirm-box,
    #currencyConfirmModal .delete-confirm-box {
      width: min(390px, 100%);
      background: #ffffff;
      border: 1px solid #e5e7eb;
      border-radius: 22px;
      box-shadow: 0 22px 55px rgba(31, 41, 51, 0.22);
      padding: 24px;
      text-align: center;
    }

    #deleteListModal h2,
    #deleteExpenseModal h2,
    #emptyListConfirmModal h2,
    #currencyConfirmModal h2 {
      margin: 0 0 10px;
      color: #111827;
      font-size: 1.55rem;
      line-height: 1.15;
      letter-spacing: -0.035em;
    }

    #deleteListModal p,
    #deleteExpenseModal p,
    #emptyListConfirmModal p,
    #currencyConfirmModal p {
      margin: 0;
      color: var(--muted);
      line-height: 1.45;
    }

    .delete-confirm-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-top: 20px;
    }

    .delete-confirm-actions button {
      width: 100%;
    }

    #startEmptyShoppingListModal .shopping-run-empty-card {
      width: min(390px, 100%);
      margin: 0;
      box-shadow: 0 22px 55px rgba(31, 41, 51, 0.22);
    }

    #startEmptyShoppingListModal .shopping-run-actions {
      width: 100%;
    }

    #startEmptyShoppingListModal.app-confirm-overlay {
      place-items: center;
      background: rgba(15, 23, 42, 0.34);
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }

    #startEmptyShoppingListModal .shopping-run-empty-card {
      max-height: calc(100dvh - 36px - env(safe-area-inset-bottom));
      overflow-y: auto;
    }

    .start-shopping-list-title {
      display: block;
      font-weight: 900;
      font-size: 1.05rem;
      margin-bottom: 4px;
    }

    .start-shopping-list-meta,
    .start-shopping-list-preview {
      display: block;
      color: var(--muted);
      font-weight: 800;
      font-size: 0.9rem;
      line-height: 1.35;
    }

    .start-shopping-list-preview {
      margin-top: 6px;
      font-weight: 700;
    }

    .start-shopping-empty {
      border: 1px solid #d1d5db;
      border-radius: 16px;
      padding: 22px 16px;
      color: var(--muted);
      text-align: center;
      line-height: 1.45;
      background: #fbfcfa;
    }

    .start-shopping-empty strong {
      display: block;
      margin-bottom: 6px;
      color: #111827;
      font-size: 1rem;
      line-height: 1.25;
      font-weight: 900;
    }

    .start-shopping-empty span {
      display: block;
    }

    #startShoppingScreen .choice-skip {
      margin: 10px auto 0;
      padding: 14px 0;
      width: 100%;
      max-width: 280px;
      border-radius: 999px;
      background: transparent;
      color: var(--muted);
    }

    .paper-list-back-link {
      display: block;
      width: fit-content;
      min-width: 88px;
      margin: 16px auto 0;
      padding: 12px 0;
      border: 0;
      background: transparent;
      color: var(--muted);
      font-weight: 800;
      text-align: center;
      cursor: pointer;
      border-radius: 999px;
      transition: background 0.15s ease, color 0.15s ease;
    }

    .paper-list-back-link:hover,
    .paper-list-back-link:focus {
      background: rgba(0, 0, 0, 0.04);
      outline: none;
    }


    .simple-list-view {
      max-width: 760px;
      margin: 0 auto;
    }

    .simple-list-card {
      background: white;
      border: 1px solid var(--border);
      border-radius: 26px;
      box-shadow: var(--shadow);
      padding: 28px;
      min-height: 520px;
    }

    .simple-list-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 22px;
      border-bottom: 1px solid var(--border);
      padding-bottom: 18px;
    }

    .simple-list-header h2 {
      margin: 0;
      font-size: 2rem;
      letter-spacing: -0.04em;
    }

    .simple-list-input {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      margin-bottom: 18px;
    }

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

    .simple-list-row {
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 12px;
      align-items: center;
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 13px 14px;
      background: #fbfcfa;
    }

    .simple-list-row input {
      width: auto;
    }

    .simple-list-row.done span {
      color: var(--muted);
      text-decoration: line-through;
    }


    body.list-only-mode header,
    body.list-only-mode .stats,
    body.list-only-mode .tabs {
      display: none;
    }

    body.list-only-mode main {
      max-width: none;
      padding: 34px 16px;
    }

    body.list-only-mode {
      background: #f7f8f4;
    }

    .simple-list-view {
      max-width: 390px;
      margin: 0 auto;
    }

    .simple-list-card {
      background: #ffffff;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      box-shadow: 0 12px 32px rgba(31, 41, 51, 0.10);
      padding: 22px 24px 28px;
      min-height: 620px;
    }

    .paper-list-top {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      align-items: start;
      gap: 14px;
      margin-bottom: 22px;
    }

    .paper-list-name {
      border: 1px solid #111827;
      border-radius: 999px;
      padding: 4px 12px 4px 18px;
      width: 100%;
      min-width: 96px;
      max-width: 100%;
      min-height: 32px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      justify-self: stretch;
      gap: 8px;
      box-sizing: border-box;
      font-family: inherit;
      font-size: 1rem;
      line-height: 1.1;
      background: #fff;
      outline: none;
      cursor: text;
    }

    .paper-list-name:focus-within {
      border-color: #111827;
      box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
    }

    .paper-list-name-input {
      width: auto;
      min-width: 0;
      flex: 1 1 auto;
      border: 0;
      border-radius: 0;
      padding: 0;
      background: transparent;
      color: #111827;
      font: inherit;
      font-weight: 700;
      line-height: 1.1;
      text-align: center;
      outline: none;
      box-shadow: none;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .paper-list-name-input:focus {
      border: 0;
      box-shadow: none;
    }

    .paper-list-edit-icon {
      flex: 0 0 auto;
      width: 16px;
      height: 16px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: #6b7280;
      font-size: 0.88rem;
      line-height: 1;
      pointer-events: none;
    }

    .paper-list-date-editor {
      position: relative;
      display: grid;
      width: 100%;
      min-width: 0;
      justify-items: start;
      gap: 5px;
    }

    .paper-list-date-label {
      color: #6b7280;
      font-size: 0.69rem;
      font-weight: 800;
      line-height: 1.2;
      white-space: nowrap;
    }

    .paper-list-date {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      min-height: 34px;
      margin: 0;
      padding: 7px 10px;
      border: 1px solid #d1d5db;
      border-radius: 999px;
      background: #ffffff;
      color: #111827;
      font-family: inherit;
      font-size: 0.78rem;
      font-weight: 800;
      line-height: 1;
      white-space: nowrap;
      cursor: pointer;
      transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    }

    .paper-list-date:hover,
    .paper-list-date:focus {
      border-color: #111827;
      background: #f9fafb;
      box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.07);
      outline: none;
    }

    .paper-list-calendar-icon {
      width: 1em;
      height: 1em;
      display: inline-grid;
      place-items: center;
      flex: 0 0 1em;
      font-size: 0.9rem;
      line-height: 1;
      color: #111827;
    }

    .paper-list-calendar-icon svg {
      width: 100%;
      height: 100%;
      display: block;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .paper-list-date-input {
      position: absolute;
      right: 0;
      bottom: 0;
      width: 1px;
      height: 1px;
      padding: 0;
      border: 0;
      opacity: 0;
      pointer-events: none;
    }

    .paper-list-date-past-hint {
      max-width: none;
      color: #b45309;
      font-size: 0.68rem;
      font-weight: 700;
      line-height: 1.3;
      text-align: left;
    }

    .paper-list-lines {
      display: grid;
      gap: 9px;
    }

    .paper-list-line {
      display: grid;
      grid-template-columns: 18px 1fr;
      align-items: center;
      gap: 8px;
    }

    .paper-list-line input[type="checkbox"] {
      width: 11px;
      height: 11px;
      margin: 0;
      accent-color: #111827;
    }

    .paper-write-line {
      width: 100%;
      height: 18px;
      border: 0;
      border-bottom: 1px solid #9ca3af;
      border-radius: 0;
      outline: none;
      background: transparent;
      font-size: 0.9rem;
      line-height: 18px;
      color: #111827;
      padding: 0 2px;
      overflow: hidden;
      white-space: nowrap;
      box-sizing: border-box;
    }

    .paper-write-line:focus {
      border-bottom-color: var(--accent);
      box-shadow: 0 1px 0 var(--accent);
    }


    .paper-list-bottom {
      margin-top: 24px;
      display: grid;
      gap: 12px;
    }

    body.list-only-mode main {
      padding-bottom: 0;
    }

    body.list-only-mode #simpleShoppingPlan .simple-list-card {
      display: flex;
      flex-direction: column;
      min-height: calc(100dvh - 34px);
      padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
    }

    #simpleShoppingPlan .simple-list-card > * {
      flex-shrink: 0;
    }

    #simpleShoppingPlan .paper-list-back-slot {
      margin-top: auto;
      padding-top: 30px;
    }

    #simpleShoppingPlan .paper-list-back-slot .paper-list-back-link {
      margin: 0;
    }

    .standard-shopping-check {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 9px;
      border: 1px solid #d1d5db;
      border-radius: 999px;
      padding: 10px 14px;
      background: #ffffff;
      color: #111827;
      font-size: 0.86rem;
      font-weight: 800;
      cursor: pointer;
      user-select: none;
    }

    .standard-shopping-check input {
      appearance: none;
      -webkit-appearance: none;
      width: 18px;
      height: 18px;
      min-width: 18px;
      min-height: 18px;
      margin: 0;
      padding: 0;
      border: 2px solid #777;
      border-radius: 5px;
      background: #ffffff;
      display: inline-grid;
      place-content: center;
      box-sizing: border-box;
      flex: 0 0 18px;
      cursor: pointer;
    }

    .standard-shopping-check input::before {
      content: "";
      width: 10px;
      height: 10px;
      transform: scale(0);
      transition: transform 0.08s ease-in-out;
      background: #ffffff;
      clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 16%, 84% 0, 37% 66%);
    }

    .standard-shopping-check input:checked {
      border-color: #111827;
      background: #111827;
    }

    .standard-shopping-check input:checked::before {
      transform: scale(1);
    }

    .paper-back-button {
      border: 1px solid #d1d5db;
      border-radius: 999px;
      padding: 10px 14px;
      background: #f9fafb;
      color: #111827;
      font-size: 0.86rem;
      font-weight: 800;
      cursor: pointer;
    }

    .paper-back-button:hover,
    .standard-shopping-check:hover {
      background: #f3f4f6;
    }

    @media (max-width: 900px) {
      .hero, .grid, .stats {
        grid-template-columns: 1fr;
      }

      .recipe-grid, .meal-grid, .week, .choice-grid {
        grid-template-columns: 1fr;
      }

      .row, .simple-list-input {
        grid-template-columns: 1fr;
      }
    }

    .paper-list-line {
      display: grid;
      grid-template-columns: 44px minmax(0, 1fr) 44px;
      align-items: center;
      gap: 6px;
      min-height: 44px;
    }

    .paper-check-control {
      width: 44px;
      height: 44px;
      display: grid;
      place-items: center;
      cursor: pointer;
    }

    .paper-list-line input[type="checkbox"] {
      appearance: none;
      -webkit-appearance: none;
      width: 22px !important;
      height: 22px !important;
      min-width: 22px;
      max-width: 22px;
      min-height: 22px;
      max-height: 22px;
      margin: 0;
      padding: 0;
      border: 1.6px solid #777;
      border-radius: 3px;
      background: #ffffff;
      display: inline-grid;
      place-content: center;
      box-sizing: border-box;
      flex: 0 0 22px;
      cursor: pointer;
    }

    .paper-list-line input[type="checkbox"]::before {
      content: "";
      width: 12px;
      height: 12px;
      transform: scale(0);
      transition: transform 0.08s ease-in-out;
      background: #111827;
      clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 16%, 84% 0, 37% 66%);
    }

    .paper-list-line input[type="checkbox"]:checked::before {
      transform: scale(1);
    }

    .paper-line-remove {
      width: 44px;
      height: 44px;
      margin: 0;
      padding: 0;
      border: 0;
      border-radius: 999px;
      background: transparent;
      color: #9ca3af;
      font-size: 1.1rem;
      font-weight: 800;
      line-height: 1;
      cursor: pointer;
    }

    .paper-line-remove:hover,
    .paper-line-remove:focus {
      background: #fee2e2;
      color: #b91c1c;
      outline: none;
    }


    #addNewListButton {
      border-color: var(--accent) !important;
      background: var(--accent) !important;
      color: #ffffff !important;
      box-shadow: 0 10px 22px rgba(47, 133, 90, 0.2);
    }

    #addNewListButton:hover,
    #addNewListButton:focus {
      border-color: var(--accent-dark) !important;
      background: var(--accent-dark) !important;
      color: #ffffff !important;
      outline: none;
    }

    #addNewListButton[data-mode="add"],
    #addNewListButton[data-mode="auto-save"],
    #addNewListButton[data-mode="save"] {
      border-color: var(--accent);
      background: var(--accent);
      color: #ffffff;
      box-shadow: 0 10px 22px rgba(47, 133, 90, 0.2);
    }

    #addNewListButton[data-mode="add"]:hover,
    #addNewListButton[data-mode="add"]:focus,
    #addNewListButton[data-mode="auto-save"]:hover,
    #addNewListButton[data-mode="auto-save"]:focus,
    #addNewListButton[data-mode="save"]:hover,
    #addNewListButton[data-mode="save"]:focus {
      border-color: var(--accent-dark);
      background: var(--accent-dark);
      outline: none;
    }


    body.manager-mode header,
    body.manager-mode .stats,
    body.manager-mode .tabs,
    body.finance-only-mode header,
    body.finance-only-mode .stats,
    body.finance-only-mode .tabs {
      display: none;
    }

    body.manager-mode main {
      max-width: none;
      padding: 34px 16px calc(96px + env(safe-area-inset-bottom));
    }

    .manager-fixed-back-bar {
      display: none;
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 30;
      padding: 10px 16px max(10px, env(safe-area-inset-bottom));
      background: transparent;
      pointer-events: none;
    }

    body.manager-mode #listManager.panel.active .manager-fixed-back-bar {
      display: block;
    }

    #listManager .manager-fixed-back-bar .manager-start-back-link {
      max-width: 780px !important;
      margin: 0 auto;
      pointer-events: auto;
    }

    body.finance-only-mode {
      background: #ffffff;
    }

    body.finance-only-mode main {
      max-width: none;
      min-height: 100dvh;
      padding: 0;
      background: #ffffff;
    }

    body.finance-only-mode #financeOverview.panel.active {
      min-height: 100dvh;
      padding: 0 20px max(42px, env(safe-area-inset-bottom));
      background: #ffffff;
      display: grid;
      place-items: end center;
    }

    .finance-back-link {
      margin: 0 auto;
      font-size: 1.05rem;
    }

    .list-manager-view {
      max-width: 780px;
      margin: 0 auto;
    }

    .list-manager-card {
      background: #ffffff;
      border: 1px solid #e5e7eb;
      border-radius: 24px;
      box-shadow: var(--shadow);
      padding: clamp(20px, 4vw, 30px);
    }

    .list-manager-header {
      padding-bottom: 22px;
      border-bottom: 1px solid #e5e7eb;
    }

    .list-manager-header h2 {
      margin: 0 0 6px;
      font-size: clamp(2rem, 6vw, 2.75rem);
      line-height: 1.05;
      letter-spacing: -0.055em;
    }

    .list-manager-subtitle {
      margin: 0;
      color: var(--muted);
      font-size: 1.05rem;
      line-height: 1.45;
    }

    .list-manager-section {
      padding-top: 24px;
    }

    .list-manager-section + .list-manager-section {
      margin-top: 24px;
      border-top: 1px solid #e5e7eb;
    }

    .list-manager-section h3 {
      margin: 0 0 14px;
      font-size: 1.25rem;
      letter-spacing: -0.025em;
    }

    .list-manager-toolbar {
      padding-top: 24px;
    }

    .list-manager-toolbar .list-manager-create-button {
      width: 100%;
    }

    .list-manager-lists-section {
      padding-top: 26px;
    }

    .current-list-preview-wrap {
      position: relative;
    }

    .current-list-edit-button.list-edit-button {
      top: 12px;
      right: 54px;
    }

    .current-list-delete-button.list-delete-button {
      top: 12px;
      right: 12px;
    }

    .current-list-preview-wrap .list-preview-paper {
      padding-right: 102px;
    }

    .list-manager-section-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 14px;
    }

    .list-manager-section-heading h3 {
      margin: 0;
    }

    .list-manager-create-button {
      min-height: 42px;
      padding: 9px 16px;
      border: 1px solid #d1d5db;
      border-radius: 999px;
      background: #ffffff;
      color: #111827;
      font: inherit;
      font-weight: 850;
      cursor: pointer;
      white-space: nowrap;
    }

    .list-manager-create-button:hover,
    .list-manager-create-button:focus-visible {
      border-color: var(--accent);
      background: var(--accent-soft);
      color: var(--accent-dark);
      outline: none;
    }

    .list-preview-paper {
      border: 1px solid #e5e7eb;
      border-radius: 16px;
      padding: 16px;
      background: #fbfcfa;
    }

    .list-preview-title {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 4px 10px;
      margin-bottom: 14px;
      font-weight: 900;
    }

    .list-preview-items {
      display: grid;
      gap: 8px;
      font-size: 0.95rem;
    }

    .list-preview-row {
      display: grid;
      grid-template-columns: 14px 1fr;
      gap: 8px;
      align-items: center;
      border-bottom: 1px solid #cbd5e1;
      min-height: 24px;
    }

    .tiny-checkbox {
      position: relative;
      width: 12px;
      height: 12px;
      border: 1.5px solid #777;
      border-radius: 3px;
      display: inline-grid;
      place-content: center;
      background: #ffffff;
    }

    .tiny-checkbox.is-checked {
      border-color: #111827;
      background: #111827;
    }

    .tiny-checkbox.is-checked::before {
      content: "";
      width: 7px;
      height: 7px;
      background: #ffffff;
      clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 16%, 84% 0, 37% 66%);
    }

    .saved-lists {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      min-width: 0;
      gap: 10px;
    }

    .saved-list-summary {
      width: 100%;
      min-width: 0;
      max-width: 100%;
      border: 1px solid #d1d5db;
      border-radius: 14px;
      background: #ffffff;
      padding: 12px 14px;
      text-align: left;
      font-weight: 800;
      box-sizing: border-box;
    }

    .saved-list-title-row {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px 10px;
      margin-bottom: 6px;
    }

    .saved-list-current-badge {
      display: inline-flex;
      align-items: center;
      min-height: 22px;
      padding: 2px 8px;
      border-radius: 999px;
      background: var(--accent-soft);
      color: var(--accent-dark);
      font-size: 0.72rem;
      font-weight: 900;
      line-height: 1;
    }

    .saved-list-meta-line {
      display: block;
      margin-top: 3px;
    }

    @media (max-width: 560px) {
      .list-manager-section-heading {
        align-items: stretch;
        flex-direction: column;
      }

      .list-manager-create-button {
        width: 100%;
      }
    }


    #startModal .choice-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      min-height: 190px;
    }

    #startModal .choice-card h3 {
      color: #111827;
      margin: 12px 0 0;
      text-align: center;
      font-size: 1.35rem;
    }

    #startModal .choice-icon {
      margin: 0;
      width: 140px;
      height: 140px;
      min-width: 140px;
      min-height: 140px;
      border-radius: 32px;
    }


    #startModal .start-box {
      position: relative;
      padding-bottom: 72px;
    }

    .settings-entry {
      position: absolute;
      right: 28px;
      bottom: 24px;
      border: 0;
      background: transparent;
      color: #111827;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-weight: 900;
      font-size: 0.95rem;
      cursor: pointer;
      padding: 8px 10px;
      border-radius: 999px;
    }

    .settings-entry:hover {
      background: #f3f4f6;
    }

    .settings-icon {
      display: block;
      width: 1em;
      height: 1em;
      flex-shrink: 0;
      font-size: 1.25rem;
      line-height: 1;
    }


    #startModal .start-box {
      position: relative !important;
      padding-bottom: 92px !important;
    }

    #startModal .settings-entry {
      position: absolute !important;
      right: 34px !important;
      bottom: 28px !important;
      z-index: 10;
      border: 0;
      background: transparent;
      color: #111827;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-weight: 900;
      font-size: 1rem;
      cursor: pointer;
      padding: 10px 12px;
      border-radius: 999px;
    }

    #startModal .settings-entry:hover {
      background: #f3f4f6;
    }

    #startModal .settings-icon {
      font-size: 1.35rem;
      line-height: 1;
    }


    #startModal .choice-grid {
      grid-template-columns: repeat(2, 1fr) !important;
    }

  html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

button,
input,
select,
textarea,
[contenteditable="true"] {
  font-size: 16px;
}

button,
.choice-card,
.tab,
.paper-back-button,
.standard-shopping-check {
  min-height: 44px;
  touch-action: manipulation;
}

.start-modal {
  min-height: 100dvh;
  overflow-y: auto;
  align-items: flex-start;
  padding:
    max(18px, env(safe-area-inset-top))
    14px
    max(18px, env(safe-area-inset-bottom));
}

.start-box {
  margin: auto 0;
  width: 100%;
  max-width: 430px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 22px;
  box-shadow: none;
}

#startModal .choice-grid {
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px;
  box-sizing: border-box;
  align-items: stretch;
  justify-items: stretch;
}

#startModal .choice-grid > * {
  box-sizing: border-box;
}

#startModal .choice-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 220px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 12px;
  box-sizing: border-box;
}

#startModal .choice-card h3 {
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  margin: 0;
  line-height: 1.2;
  word-break: break-word;
  hyphens: auto;
}

#startModal .choice-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.95rem;
}

#startModal .choice-icon {
  width: 132px;
  height: 132px;
  min-width: 132px;
  min-height: 132px;
  border-radius: 32px;
  font-size: 1.5rem;
}

@media (max-width: 430px) {
  .start-box {
    width: 100%;
    max-width: 100%;
    padding: 18px 16px 18px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  #startModal .choice-grid {
    gap: 16px;
  }
}

@media (max-width: 390px) {
  #startModal .choice-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  #startModal .choice-card {
    min-height: 200px;
  }
}

#startModal .settings-entry {
  position: absolute !important;
  right: 18px !important;
  bottom: 18px !important;
  font-size: 0.95rem;
  padding: 10px 12px;
}

@media (max-width: 600px) {
  body,
  #startModal,
  .start-modal {
    background: #ffffff !important;
  }

  #startModal {
    background: #ffffff !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    min-height: 100dvh !important;
    align-items: flex-start !important;
    justify-content: center !important;
  }

  #startModal .start-box {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100dvh !important;
    margin: 0 auto !important;
    padding: 34px 18px 20px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    position: relative !important;
  }

  #startModal .start-box h2 {
    margin: 0 0 18px !important;
    font-size: clamp(1.8rem, 4.5vw, 2.2rem) !important;
    line-height: 1.1 !important;
  }

  #startModal .start-box > p {
    margin: 0 auto 22px !important;
    font-size: clamp(0.95rem, 3vw, 1rem) !important;
  }

  #startModal .choice-grid {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  #startModal .choice-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 220px !important;
    padding: 20px 16px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
  }

  #startModal .choice-card h3 {
    margin: 0 0 8px !important;
    font-size: clamp(1rem, 4vw, 1.12rem) !important;
    line-height: 1.15 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
  }

  #startModal .choice-card p {
    margin: 0 !important;
    font-size: clamp(0.9rem, 3.5vw, 1rem) !important;
    line-height: 1.4 !important;
    color: var(--muted) !important;
  }

  #startModal .settings-entry {
    position: absolute !important;
    right: 14px !important;
    bottom: 14px !important;
    margin: 0 !important;
  }
}

/* Kompakte App-Texte: veraltete Hilfstexte bleiben auch bei altem HTML verborgen. */
#onboardingScreen .onboarding-note-row,
#settingsPanel .settings-row-description {
  display: none !important;
}

@media (max-width: 390px) {
  #startModal .choice-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  #startModal .choice-card {
    min-height: 180px !important;
    padding: 18px 14px !important;
  }
}

main {
  width: 100%;
}

.card {
  padding: 16px;
}

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

.actions {
  justify-content: stretch;
}

.actions button {
  flex: 1;
}

.tabs {
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.tab {
  flex: 0 0 auto;
}

@media (max-width: 480px) {
  header {
    padding: 18px 14px 12px;
  }

  main {
    padding: 0 14px 28px;
  }

  .tabs {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-card {
    padding: 20px;
  }

  .hero-card h1 {
    font-size: 2rem;
  }

  .hero-card p {
    font-size: 0.95rem;
  }

  .impact-card {
    padding: 18px;
  }

  .stat {
    padding: 14px;
  }

  .simple-list-view {
    max-width: 100%;
  }

  .simple-list-card {
    min-height: calc(100dvh - 68px);
    padding: 20px 18px 24px;
  }

  .paper-write-line {
    font-size: 1rem;
    height: 24px;
    line-height: 24px;
  }

  .list-manager-view {
    max-width: 100%;
  }

  .week {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  #startModal .choice-grid {
    grid-template-columns: 1fr !important;
  }

  #startModal .choice-card {
    min-height: 110px;
  }
}

@media (max-width: 430px) {
  #startModal .start-box {
    padding-top: 14px !important;
    padding-bottom: 16px !important;
  }

  #startModal #startTitle {
    margin: 0 0 16px !important;
    padding-top: 2px !important;
    font-size: clamp(1.9rem, 4vw, 2.2rem) !important;
    line-height: 1.05 !important;
  }

  #startModal .choice-card#chooseFinance h3 {
    font-size: clamp(0.95rem, 3.3vw, 1.05rem) !important;
    line-height: 1.1 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
  }

  #startModal .choice-card h3 {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
  }

  #startModal .choice-card {
    padding: 18px 14px !important;
    min-height: 210px !important;
    align-items: stretch !important;
    justify-content: center !important;
  }
}

@media (max-width: 600px) {
  #startModal {
    min-height: 100dvh !important;
    background: #ffffff !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: center !important;
  }

  #startModal .start-box {
    width: 100% !important;
    max-width: 430px !important;
    min-height: 100dvh !important;
    margin: 0 auto !important;
    padding: 44px 22px 28px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;

    display: flex !important;
    flex-direction: column !important;
  }

  #startModal #startTitle {
    margin-top: auto !important;
    margin-bottom: 28px !important;
    transform: none !important;
    text-align: center !important;
    font-size: clamp(1.65rem, 7vw, 2.15rem) !important;
    line-height: 1.18 !important;
  }

  #startModal .choice-grid {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    box-sizing: border-box !important;
  }

  #startModal .choice-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 190px !important;
    padding: 18px 8px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  #startModal .choice-card h3 {
    max-width: 100% !important;
    font-size: clamp(1rem, 4.5vw, 1.25rem) !important;
    line-height: 1.15 !important;
    text-align: center !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  #startModal #chooseFinance h3 {
    font-size: clamp(0.9rem, 4vw, 1.05rem) !important;
    letter-spacing: -0.03em !important;
  }

  #startModal #settingsButton {
    margin-top: auto !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    align-self: flex-end !important;
  }
}

@media (max-width: 360px) {
  #startModal .choice-grid {
    grid-template-columns: 1fr !important;
  }

  #startModal .choice-card {
    min-height: 150px !important;
  }
}

/* ================================
   FINAL CLEAN STARTSCREEN DESIGN
   This block intentionally comes last in the CSS.
   ================================ */
@media (max-width: 600px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    background: #ffffff !important;
    overflow-x: hidden;
  }

  #startModal.start-modal:not(.hidden) {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    overflow: hidden !important;
    display: flex !important;
    justify-content: center !important;
    align-items: stretch !important;
    z-index: 50 !important;
  }

  #startModal .start-box {
    width: 100% !important;
    max-width: 430px !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    margin: 0 auto !important;
    padding:
      max(24px, env(safe-area-inset-top))
      22px
      max(24px, env(safe-area-inset-bottom)) !important;

    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    position: relative !important;

    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows:
      minmax(56px, 0.35fr)
      auto
      minmax(28px, 0.35fr)
      auto
      minmax(44px, 1.3fr)
      auto !important;
  }

  #startModal #startTitle {
    grid-row: 2 !important;
    justify-self: center !important;
    align-self: center !important;

    width: 100% !important;
    max-width: 360px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;

    color: #111827 !important;
    text-align: center !important;
    font-size: clamp(1.45rem, 6vw, 1.9rem) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.045em !important;
    font-weight: 900 !important;
  }

  #startModal .choice-grid {
    grid-row: 4 !important;
    justify-self: center !important;
    align-self: center !important;

    width: 100% !important;
    max-width: 360px !important;
    margin: 0 auto !important;

    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    box-sizing: border-box !important;
    align-items: stretch !important;
    justify-items: stretch !important;
  }

  #startModal .choice-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: 1 / 1.08 !important;

    padding: 16px 8px !important;
    border: 1px solid #d9e2d0 !important;
    border-radius: 20px !important;
    background: #fbfcfa !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    overflow: hidden !important;

    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 13px !important;
    text-align: center !important;
    touch-action: manipulation !important;
  }

  #startModal .choice-card:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: #2f855a !important;
  }

  #startModal .choice-icon {
    width: 116px !important;
    height: 116px !important;
    min-width: 116px !important;
    min-height: 116px !important;

    margin: 0 !important;
    border-radius: 30px !important;
    background: #dcfce7 !important;

    display: grid !important;
    place-items: center !important;

    font-size: 1.45rem !important;
    line-height: 1 !important;
    flex: 0 0 auto !important;
  }

  #startModal .choice-card h3 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;

    color: #111827 !important;
    text-align: center !important;
    font-size: clamp(0.92rem, 3.9vw, 1.08rem) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.025em !important;
    font-weight: 900 !important;

    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    hyphens: auto !important;
  }

  #startModal #chooseFinance h3 {
    font-size: clamp(0.78rem, 3.35vw, 0.94rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.045em !important;
  }

  #startModal #settingsButton,
  #startModal .settings-entry {
    grid-row: 6 !important;
    justify-self: end !important;
    align-self: end !important;

    position: static !important;
    inset: auto !important;

    margin: 0 !important;
    padding: 10px 0 0 !important;
    border: 0 !important;
    background: transparent !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;

    color: #111827 !important;
    font-size: 0.95rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    cursor: pointer !important;
  }

  #startModal .settings-icon {
    font-size: 1.2rem !important;
    line-height: 1 !important;
  }
}

@media (max-width: 360px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    background: #ffffff !important;
    overflow-x: hidden;
  }

  #startModal.start-modal:not(.hidden) {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    overflow: hidden !important;
    display: flex !important;
    justify-content: center !important;
    align-items: stretch !important;
    z-index: 50 !important;
  }

  #startModal .start-box {
    width: 100% !important;
    max-width: 430px !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    margin: 0 auto !important;
    padding:
      max(24px, env(safe-area-inset-top))
      22px
      max(24px, env(safe-area-inset-bottom)) !important;

    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    position: relative !important;

    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows:
      minmax(56px, 0.35fr)
      auto
      minmax(28px, 0.35fr)
      auto
      minmax(44px, 1.3fr)
      auto !important;
  }

  #startModal #startTitle {
    grid-row: 2 !important;
    justify-self: center !important;
    align-self: center !important;

    width: 100% !important;
    max-width: 360px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;

    color: #111827 !important;
    text-align: center !important;
    font-size: clamp(1.45rem, 6vw, 1.9rem) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.045em !important;
    font-weight: 900 !important;
  }

  #startModal .choice-grid {
    grid-row: 4 !important;
    justify-self: center !important;
    align-self: center !important;

    width: 100% !important;
    max-width: 360px !important;
    margin: 0 auto !important;

    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    box-sizing: border-box !important;
    align-items: stretch !important;
    justify-items: stretch !important;
  }

  #startModal .choice-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: 1 / 1.08 !important;

    padding: 16px 8px !important;
    border: 1px solid #d9e2d0 !important;
    border-radius: 20px !important;
    background: #fbfcfa !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    overflow: hidden !important;

    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 13px !important;
    text-align: center !important;
    touch-action: manipulation !important;
  }

  #startModal .choice-card:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: #2f855a !important;
  }

  #startModal .choice-icon {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    min-height: 50px !important;

    margin: 0 !important;
    border-radius: 17px !important;
    background: #dcfce7 !important;

    display: grid !important;
    place-items: center !important;

    font-size: 1.45rem !important;
    line-height: 1 !important;
    flex: 0 0 auto !important;
  }

  #startModal .choice-card h3 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;

    color: #111827 !important;
    text-align: center !important;
    font-size: clamp(0.92rem, 3.9vw, 1.08rem) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.025em !important;
    font-weight: 900 !important;

    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    hyphens: auto !important;
  }

  #startModal #chooseFinance h3 {
    font-size: clamp(0.78rem, 3.35vw, 0.94rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.045em !important;
  }

  #startModal #settingsButton,
  #startModal .settings-entry {
    grid-row: 6 !important;
    justify-self: end !important;
    align-self: end !important;

    position: static !important;
    inset: auto !important;

    margin: 0 !important;
    padding: 10px 0 0 !important;
    border: 0 !important;
    background: transparent !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;

    color: #111827 !important;
    font-size: 0.95rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    cursor: pointer !important;
  }

  #startModal .settings-icon {
    font-size: 1.2rem !important;
    line-height: 1 !important;
  }
}

/* ================================
   MODERNE EINSTELLUNGEN
   ================================ */
#settingsPanel.start-modal {
  background: #ffffff !important;
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 16px;
  -webkit-overflow-scrolling: touch;
}

#settingsPanel .settings-screen-box {
  width: min(430px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 0 calc(96px + env(safe-area-inset-bottom)) !important;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-header {
  padding: 6px 4px 2px;
}

.settings-header h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(2rem, 7vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.settings-header p {
  margin: 0;
  color: #64748b;
  font-size: 0.98rem;
  line-height: 1.45;
}

.settings-content {
  display: grid;
  gap: 14px;
}

.settings-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(31, 41, 51, 0.08);
  padding: 18px;
}

.settings-card h3 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 56px;
  padding: 6px 0;
  border-top: 1px solid #edf2f7;
}

.settings-row:first-of-type {
  border-top: 0;
  padding-top: 2px;
}

.settings-row:last-child {
  padding-bottom: 2px;
}

.settings-row-main {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.settings-row-title {
  display: block;
  color: #111827;
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.25;
}

.settings-row-description {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.38;
}

.settings-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 44px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.settings-switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  opacity: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.settings-switch-slider {
  position: relative;
  width: 100%;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #e5e7eb;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.settings-switch-slider::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
  transition: transform 0.18s ease;
}

.settings-switch input:checked + .settings-switch-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.settings-switch input:checked + .settings-switch-slider::before {
  transform: translateX(22px);
}

.settings-switch input:focus {
  border-color: transparent;
  outline: none;
  box-shadow: none;
}

.settings-switch input:focus-visible + .settings-switch-slider {
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 24%, transparent);
}

.settings-select-label {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.settings-select-label .settings-row-title,
.settings-select-label .settings-row-description {
  display: block;
}

#settingsPanel select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  background: #fbfcfa;
  color: #111827;
  font-weight: 800;
  padding: 12px 14px;
}

.settings-data-actions {
  display: grid;
  gap: 10px;
}

.settings-data-actions button {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  text-align: center;
}

.settings-legal-actions {
  display: grid;
  gap: 10px;
}

.settings-legal-link,
.auth-legal-link {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #edf2e7;
  color: #285b3e;
  font: inherit;
  font-weight: 850;
  line-height: 1.25;
  padding: 12px 14px;
  text-align: center;
  text-decoration: none;
}

.settings-legal-link:hover,
.auth-legal-link:hover {
  background: #e4ecdc;
  color: #1d4d33;
}

.settings-legal-link:focus-visible,
.auth-legal-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 24%, transparent);
}

.settings-danger-button {
  background: #f8f9fb !important;
  color: var(--ios-action-red) !important;
  font-weight: 700 !important;
  border: 1px solid #e2e5e9 !important;
}

.settings-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  background: transparent;
  box-sizing: border-box;
  pointer-events: none;
}

.settings-footer .settings-back-button {
  max-width: 430px !important;
  pointer-events: auto;
}

.settings-back-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  min-height: 44px;
  padding: 10px 18px;
}

.settings-back-button:hover,
.settings-back-button:focus {
  background: #f3f4f6;
  color: #111827;
  outline: none;
}

.reset-confirm-box {
  width: min(420px, 100%);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 24px 62px rgba(15, 23, 42, 0.24);
  padding: 24px;
  text-align: left;
}

#resetConfirmModal.start-modal {
  background: rgba(15, 23, 42, 0.42) !important;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

#resetConfirmModal h2 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

#resetConfirmModal p {
  margin: 0;
  color: #64748b;
  line-height: 1.45;
}

.reset-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.reset-confirm-actions button {
  min-height: 48px;
  border-radius: 16px;
}

#importPreviewModal.start-modal {
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.48);
  overflow: hidden;
  z-index: 110;
}

.import-preview-box {
  width: min(620px, 100%);
  max-width: 100%;
  max-height: calc(100dvh - max(32px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.import-preview-header h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.45rem, 5vw, 1.85rem);
  line-height: 1.12;
}

.import-preview-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.import-preview-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.import-preview-meta,
.import-preview-summary {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
}

.import-preview-meta > div,
.import-preview-summary > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 92%, var(--accent-soft));
}

.import-preview-meta dt,
.import-preview-summary dt {
  color: var(--muted);
  font-weight: 750;
}

.import-preview-meta dd,
.import-preview-summary dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-weight: 850;
}

.import-preview-section {
  margin-top: 20px;
}

.import-preview-section h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.import-preview-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.45;
}

.import-preview-backup-note {
  margin: 20px 0 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
}

.import-preview-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 10px;
  margin-top: 20px;
}

.import-preview-actions button {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border-radius: 16px;
}

.import-preview-actions .danger {
  background: #b91c1c;
  color: #ffffff;
}

.import-preview-actions button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 3px;
}

@media (max-width: 520px) {
  #importPreviewModal.start-modal {
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .import-preview-box {
    padding: 18px 14px;
    border-radius: 20px;
  }

  .import-preview-meta > div,
  .import-preview-summary > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .import-preview-meta dd,
  .import-preview-summary dd {
    text-align: left;
  }

  .import-preview-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

#startupRecoveryModal.start-modal {
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.52);
  overflow: hidden;
  z-index: 120;
}

.startup-recovery-box {
  width: min(520px, 100%);
  max-width: 100%;
  max-height: calc(100dvh - max(32px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}

.startup-recovery-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 17px;
  background: var(--accent-soft);
  font-size: 1.55rem;
}

.startup-recovery-box h2 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 5vw, 1.8rem);
  line-height: 1.14;
  letter-spacing: -0.035em;
}

.startup-recovery-box > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.startup-recovery-status {
  margin-top: 16px !important;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 88%, var(--accent-soft));
  color: var(--text) !important;
  font-weight: 750;
}

.startup-recovery-action-status {
  min-height: 1.5em;
  margin-top: 10px !important;
  font-size: 0.92rem;
}

.startup-recovery-action-status.is-error {
  color: var(--danger) !important;
  font-weight: 750;
}

.startup-recovery-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.startup-recovery-actions button {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border-radius: 16px;
}

.startup-recovery-box:focus-visible,
.startup-recovery-actions button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 3px;
}

@media (max-width: 520px) {
  #startupRecoveryModal.start-modal {
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .startup-recovery-box {
    padding: 20px 16px;
    border-radius: 20px;
  }
}

body.large-display {
  font-size: 17px;
}

body.large-display .card,
body.large-display .choice-card,
body.large-display .settings-card,
body.large-display .simple-list-card,
body.large-display .finance-total-card,
body.large-display .finance-budget-card,
body.large-display .finance-form-card,
body.large-display .finance-stat-card,
body.large-display .finance-list-card {
  padding: 22px !important;
}

body.large-display .settings-row-description,
body.large-display .item-meta,
body.large-display .start-shopping-list-meta,
body.large-display .start-shopping-list-preview {
  font-size: 0.94rem;
}

@media (max-width: 360px) {
  #startModal .start-box {
    padding-left: 18px !important;
    padding-right: 18px !important;
    grid-template-rows:
      minmax(44px, 0.28fr)
      auto
      minmax(22px, 0.28fr)
      auto
      minmax(34px, 1fr)
      auto !important;
  }

  #startModal .choice-grid {
    max-width: 320px !important;
    gap: 12px !important;
  }

  #startModal .choice-card {
    border-radius: 18px !important;
    padding: 14px 6px !important;
  }

  #startModal .choice-icon {
    width: 100px !important;
    height: 100px !important;
    min-width: 100px !important;
    min-height: 100px !important;
    border-radius: 28px !important;
    font-size: 1.35rem !important;
  }

  #startModal .choice-card h3 {
    font-size: clamp(0.82rem, 4vw, 0.98rem) !important;
  }

  #startModal #chooseFinance h3 {
    font-size: clamp(0.72rem, 3.75vw, 0.86rem) !important;
  }
}

@media (min-width: 601px) {
  #startModal.start-modal:not(.hidden) {
    background: #ffffff !important;
    backdrop-filter: none !important;
  }

  #startModal .start-box {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
}



/* ================================
   FINANZÜBERSICHT
   ================================ */
body.finance-only-mode {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: #ffffff;
}

body.finance-only-mode main {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  padding: 0;
  background: #ffffff;
}

body.finance-only-mode #financeOverview.panel.active {
  display: block !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100dvh;
  padding: 0 16px max(34px, env(safe-area-inset-bottom));
  background: #ffffff;
}

.finance-shell {
  width: min(980px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 0 34px;
}

body.finance-only-mode #financeOverview.panel.active .finance-shell {
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.finance-fixed-back-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  background: transparent;
  pointer-events: none;
}

body.finance-only-mode #financeOverview.panel.active .finance-fixed-back-bar {
  display: block;
}

#financeOverview.finance-subview-advanced .finance-overview-back-bar {
  display: none !important;
}

#financeOverview .finance-fixed-back-bar .paper-list-back-link {
  max-width: 980px !important;
  margin: 0 auto;
  pointer-events: auto;
}

@media (max-width: 560px) {
  .finance-fixed-back-bar {
    padding-right: 14px;
    padding-left: 14px;
  }
}

.finance-header-card,
.finance-period-card,
.finance-total-card,
.finance-budget-card,
.finance-form-card,
.finance-stat-card,
.finance-list-card,
.finance-empty-state,
.finance-advanced-header-card,
.finance-advanced-launch-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(31, 41, 51, 0.08);
}

.finance-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.finance-header-card h2 {
  margin: 4px 0 6px;
  color: #111827;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.finance-header-card p,
.finance-form-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.finance-kicker,
.finance-card-label {
  display: inline-flex;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.finance-header-icon {
  width: 58px;
  height: 58px;
  min-width: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #dcfce7;
  font-size: 1.75rem;
}

.finance-back-link {
  margin: 18px auto 0;
}

/* Interne Finanznavigation: Unteransichten ersetzen die Übersicht vollständig. */
#financeOverview.finance-subview-active .finance-header-card,
#financeOverview.finance-subview-active .finance-main-period-card,
#financeOverview.finance-subview-active #financeEmptyState,
#financeOverview.finance-subview-active #financeAdvancedLaunch {
  display: none !important;
}

#financeOverview.finance-subview-active #financeContent {
  display: block !important;
  margin-top: 0;
}

#financeOverview.finance-subview-active #financeContent > * {
  display: none !important;
}

#financeOverview.finance-subview-add-expense #manualExpenseForm,
#financeOverview.finance-subview-expense-detail #manualExpenseForm,
#financeOverview.finance-subview-scan-receipt #receiptReviewCard {
  display: block !important;
}

#financeOverview.finance-subview-advanced #financeContent {
  display: none !important;
}

#financeOverview.finance-subview-advanced #financeAdvancedView {
  display: grid !important;
}

#financeOverview.finance-subview-advanced #financeAdvancedView > .finance-period-card {
  display: block !important;
  visibility: visible !important;
  margin-top: 0;
}

#financeOverview.finance-subview-advanced #backToStartFromFinance {
  display: none !important;
}

#financeOverview.finance-subview-active .finance-back-link {
  margin-top: 20px;
}

.finance-period-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  margin-top: 16px;
  padding: 12px;
}

.finance-period-tabs {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 13px;
  scrollbar-gutter: stable;
}

.finance-period-tabs::-webkit-scrollbar {
  height: 4px;
}

.finance-period-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.finance-period-tabs::-webkit-scrollbar-thumb {
  background: #c7cdd6;
  border-radius: 999px;
}

.finance-period-button {
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  flex: 0 0 auto;
  font: inherit;
  font-weight: 900;
  min-height: 42px;
  padding: 10px 14px;
  white-space: nowrap;
}

.finance-period-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.finance-custom-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
  padding: 4px 2px 2px;
}

.finance-content {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 16px;
  margin-top: 16px;
}

.finance-summary-grid,
.finance-stats-grid,
.finance-secondary-grid {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 16px;
}

.finance-summary-grid > *,
.finance-stats-grid > *,
.finance-secondary-grid > * {
  max-width: 100%;
  min-width: 0;
}

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

.finance-stats-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

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

.finance-total-card,
.finance-budget-card,
.finance-form-card,
.finance-stat-card,
.finance-list-card,
.finance-empty-state,
.finance-advanced-header-card,
.finance-advanced-launch-card {
  padding: 20px;
}

.finance-total-card {
  display: grid;
  align-content: center;
  min-height: 210px;
  background: linear-gradient(145deg, #ffffff, #f0fdf4);
}

.finance-total-card strong {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  margin: 8px 0 8px;
  color: #111827;
  font-size: clamp(2.35rem, 9vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.finance-total-card p,
.finance-budget-hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.finance-advanced-launch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  background: linear-gradient(145deg, #ffffff, #f0fdf4);
}

.finance-advanced-launch-copy {
  min-width: 0;
}

.finance-advanced-launch-card h3,
.finance-advanced-header-card h2 {
  margin: 0;
  color: #111827;
  letter-spacing: -0.035em;
}

.finance-advanced-launch-card p,
.finance-advanced-header-card p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.finance-advanced-launch-button {
  width: auto;
  min-width: 250px;
  min-height: 50px;
  border-radius: 18px !important;
  white-space: nowrap;
}

.finance-advanced-view {
  gap: 16px;
}

.finance-advanced-header-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.finance-advanced-header-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #dcfce7;
  font-size: 1.55rem;
}

.finance-advanced-header-card h2 {
  font-size: clamp(1.65rem, 5vw, 2.35rem);
  line-height: 1.08;
}

.finance-advanced-back {
  margin: 2px auto 0;
}

.finance-card-topline,
.finance-section-heading,
.finance-form-header,
.finance-budget-details {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.finance-card-topline > *,
.finance-section-heading > *,
.finance-form-header > *,
.finance-budget-details > *,
.finance-category-row-top > *,
.finance-planned-row > * {
  max-width: 100%;
  min-width: 0;
}

.finance-category-row-top strong,
.finance-planned-row strong {
  overflow-wrap: anywhere;
}

.finance-small-action,
.finance-icon-button {
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 8px 11px;
}

.finance-icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.finance-budget-input-row,
.finance-form-grid {
  display: grid;
  gap: 12px;
}

.finance-budget-input-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.finance-budget-progress,
.finance-category-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.finance-budget-progress {
  margin: 16px 0 10px;
}

.finance-budget-details strong,
#financeBudgetRemaining,
#financeBudgetAmount {
  text-decoration: none !important;
  text-decoration-line: none !important;
  -webkit-text-decoration-line: none !important;
}

#financeBudgetAmount {
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.finance-budget-progress span,
.finance-category-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.finance-budget-hint.warning {
  color: #92400e;
  font-weight: 850;
}

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

.finance-action-button {
  min-height: 54px;
  border-radius: 18px !important;
  font-weight: 950 !important;
}

.finance-form-card h3,
.finance-list-card h3 {
  margin: 4px 0 0;
  color: #111827;
  letter-spacing: -0.03em;
}

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

.finance-field-error {
  display: block;
  min-height: 1.15em;
  margin-top: 6px;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.currency-input-wrap input[aria-invalid="true"] {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent);
}

.currency-input-wrap input[aria-invalid="true"]:focus {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

.finance-note-field {
  grid-column: 1 / -1;
}

.finance-receipt-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.finance-receipt-preview {
  overflow: hidden;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  background: #f8fafc;
  min-height: 260px;
}

.finance-receipt-preview img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.receipt-ocr-status {
  display: grid;
  gap: 12px;
  margin: 2px 0 18px;
  padding: 15px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 18px;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent-soft) 66%, var(--card)),
      color-mix(in srgb, var(--card) 94%, transparent)
    );
}

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

.receipt-ocr-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.receipt-ocr-status-copy {
  display: grid;
  flex: 1 1 auto;
  gap: 3px;
  min-width: 0;
}

.receipt-ocr-status-copy strong {
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.25;
}

.receipt-ocr-status-copy span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.receipt-ocr-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  background: var(--accent);
  color: #ffffff;
  font-size: 1rem;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 24%, transparent);
}

.receipt-ocr-percent {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.receipt-ocr-progress {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--border));
}

.receipt-ocr-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #4fb67d);
  transition: width 180ms ease;
}

.receipt-ocr-status.is-scanning .receipt-ocr-icon {
  animation: receiptOcrPulse 1.25s ease-in-out infinite;
}

.receipt-ocr-status.is-warning {
  border-color: color-mix(in srgb, var(--warning) 44%, var(--border));
  background: color-mix(in srgb, #fff7dc 70%, var(--card));
}

.receipt-ocr-status.is-warning .receipt-ocr-icon {
  background: var(--warning);
}

.receipt-ocr-status.is-error {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--border));
  background: color-mix(in srgb, #fee2e2 62%, var(--card));
}

.receipt-ocr-status.is-error .receipt-ocr-icon {
  background: var(--danger);
}

.receipt-ocr-status.is-warning .receipt-ocr-percent,
.receipt-ocr-status.is-error .receipt-ocr-percent {
  color: var(--text);
}

.receipt-ocr-status .secondary {
  justify-self: start;
  min-height: 40px;
  padding: 9px 14px;
}

.receipt-ocr-raw {
  margin: -4px 0 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--card) 95%, var(--bg));
}

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

.receipt-ocr-raw summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--text);
  font-weight: 850;
}

.receipt-ocr-raw pre {
  max-height: 240px;
  margin: 0;
  overflow: auto;
  border-top: 1px solid var(--border);
  padding: 13px 14px;
  color: var(--muted);
  font: 0.78rem/1.48 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body.receipt-scanner-open {
  overflow: hidden;
}

#receiptScannerModal.start-modal {
  z-index: 160;
  align-items: stretch;
  overflow: auto;
  padding: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(76, 175, 80, 0.2), transparent 34%),
    linear-gradient(160deg, #07140d 0%, #0d2116 52%, #07110c 100%) !important;
  color: #f8fff9;
  color-scheme: dark;
}

.receipt-scanner-shell {
  display: grid;
  width: min(1180px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: max(16px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.receipt-scanner-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.receipt-scanner-heading {
  display: grid;
  gap: 3px;
}

.receipt-scanner-kicker {
  color: #9ddaa8;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.receipt-scanner-heading h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.45rem, 4vw, 2.15rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.receipt-scanner-close {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  min-height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 0;
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  font-size: 1.25rem;
  box-shadow: none;
}

.receipt-scanner-close:hover,
.receipt-scanner-close:focus-visible {
  border-color: rgba(157, 218, 168, 0.72);
  background: rgba(157, 218, 168, 0.16);
}

.receipt-scanner-lead {
  max-width: 760px;
  margin: 0;
  color: rgba(241, 255, 244, 0.72);
  font-size: 0.92rem;
  line-height: 1.5;
}

.receipt-scanner-workspace {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: stretch;
}

.receipt-scanner-visual {
  display: grid;
  min-width: 0;
  min-height: 0;
}

.receipt-scanner-stage,
.receipt-scanner-preview {
  position: relative;
  display: grid;
  width: 100%;
  min-height: min(68dvh, 720px);
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 26px;
  background: #020604;
  box-shadow: 0 24px 65px rgba(0, 0, 0, 0.32);
}

.receipt-scanner-stage video,
.receipt-scanner-stage canvas,
.receipt-scanner-preview canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.receipt-scanner-stage video,
.receipt-scanner-overlay {
  position: absolute;
  inset: 0;
}

.receipt-scanner-stage video {
  background: #020604;
}

.receipt-scanner-overlay {
  z-index: 2;
  pointer-events: none;
}

.receipt-scanner-stage::after {
  position: absolute;
  z-index: 3;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  pointer-events: none;
  content: "";
}

.receipt-scanner-status {
  position: absolute;
  z-index: 5;
  top: 16px;
  left: 50%;
  display: inline-flex;
  width: min(88%, 520px);
  align-items: center;
  justify-content: center;
  gap: 8px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(4, 12, 8, 0.82);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 850;
  line-height: 1.3;
  text-align: center;
  backdrop-filter: blur(12px);
}

.receipt-scanner-status::before {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f7b731;
  content: "";
  box-shadow: 0 0 0 5px rgba(247, 183, 49, 0.14);
}

.receipt-scanner-status.is-ready::before {
  background: #57d083;
  box-shadow: 0 0 0 5px rgba(87, 208, 131, 0.16);
}

.receipt-scanner-status.is-error::before {
  background: #fb7185;
  box-shadow: 0 0 0 5px rgba(251, 113, 133, 0.16);
}

.receipt-scanner-error,
.receipt-scanner-processing {
  position: absolute;
  z-index: 7;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 28px;
  background: rgba(2, 8, 5, 0.92);
  color: #ffffff;
  text-align: center;
}

.receipt-scanner-error[hidden],
.receipt-scanner-processing[hidden] {
  display: none;
}

.receipt-scanner-error-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  background: rgba(251, 113, 133, 0.16);
  color: #fecdd3;
  font-size: 1.35rem;
}

.receipt-scanner-error h3 {
  max-width: 100%;
  margin: 0;
  color: #ffffff;
  font-size: 1.18rem;
  overflow-wrap: anywhere;
}

.receipt-scanner-error p {
  width: 100%;
  max-width: 520px;
  margin: 0;
  color: rgba(241, 255, 244, 0.72);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.receipt-scanner-error-actions {
  display: grid;
  width: min(100%, 430px);
  min-width: 0;
  max-width: 100%;
  gap: 9px;
  margin-top: 4px;
}

.receipt-scanner-error-actions button {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 12px 14px;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.receipt-scanner-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.16);
  border-top-color: #72dc91;
  border-radius: 50%;
  animation: receiptScannerSpin 0.8s linear infinite;
}

.receipt-scanner-processing strong {
  color: #ffffff;
}

.receipt-scanner-preview {
  min-height: min(68dvh, 720px);
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: stretch;
  padding: 10px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25% 75%, rgba(255, 255, 255, 0.04) 75%),
    #08110b;
  background-size: 22px 22px;
}

.receipt-scanner-preview[hidden],
.receipt-scanner-stage[hidden],
#receiptScannerCameraControls[hidden],
#receiptScannerPreviewControls[hidden] {
  display: none;
}

.receipt-scanner-preview canvas {
  min-height: 0;
  max-width: 100%;
  max-height: min(68dvh, 720px);
}

.receipt-scanner-preview-note {
  position: static;
  z-index: auto;
  margin: 10px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  padding: 9px 12px;
  background: rgba(4, 12, 8, 0.84);
  color: rgba(247, 255, 248, 0.84);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
  backdrop-filter: blur(10px);
}

.receipt-scanner-panel {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 26px;
  padding: 18px;
  background: rgba(8, 27, 17, 0.94);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.receipt-scanner-panel h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1rem;
}

#receiptScannerPreviewTitle:focus {
  outline: none;
}

#receiptScannerCameraControls,
#receiptScannerPreviewControls {
  display: grid;
  gap: 14px;
}

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

.receipt-scanner-quality-item {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 9px 10px;
  background: rgba(0, 0, 0, 0.28);
}

.receipt-scanner-quality-item span {
  color: rgba(241, 255, 244, 0.66);
  font-size: 0.7rem;
  font-weight: 800;
}

.receipt-scanner-quality-item strong {
  color: #ffd16b;
  font-size: 0.82rem;
}

.receipt-scanner-quality-item.is-good strong {
  color: #86e6a1;
}

.receipt-scanner-auto {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 11px 12px;
  color: rgba(249, 255, 250, 0.9);
  font-size: 0.82rem;
  font-weight: 850;
}

.receipt-scanner-auto input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  accent-color: #62cf82;
}

.receipt-scanner-actions {
  display: grid;
  gap: 9px;
}

.receipt-scanner-actions button {
  width: 100%;
  min-height: 48px;
}

.receipt-scanner-capture {
  background: linear-gradient(135deg, #4fbd70, #248c4d);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(49, 161, 87, 0.28);
}

.receipt-scanner-capture:disabled {
  cursor: wait;
  opacity: 0.62;
}

.receipt-scanner-gallery,
.receipt-scanner-retry {
  border-color: rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  box-shadow: none;
}

.receipt-scanner-privacy {
  margin: 0;
  color: rgba(241, 255, 244, 0.58);
  font-size: 0.75rem;
  line-height: 1.45;
}

#receiptScannerModal.is-camera-error .receipt-scanner-workspace {
  grid-template-columns: minmax(0, 1fr);
}

#receiptScannerModal.is-camera-error .receipt-scanner-panel {
  display: none;
}

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

@keyframes receiptOcrPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 24%, transparent);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 40%, transparent);
  }
}

@media (max-width: 820px) {
  .receipt-scanner-shell {
    display: block;
    padding: max(12px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  }

  .receipt-scanner-lead {
    margin: 8px 0 12px;
  }

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

  .receipt-scanner-stage,
  .receipt-scanner-preview {
    min-height: min(58dvh, 620px);
    border-radius: 22px;
  }

  .receipt-scanner-preview canvas {
    max-height: min(58dvh, 620px);
  }

  .receipt-scanner-panel {
    margin-top: 12px;
    border-radius: 22px;
    padding: 14px;
  }
}

@media (max-width: 460px) {
  .receipt-scanner-heading h2 {
    font-size: 1.35rem;
  }

  .receipt-scanner-kicker,
  .receipt-scanner-lead {
    display: none;
  }

  .receipt-scanner-workspace {
    gap: 10px;
  }

  .receipt-scanner-stage,
  .receipt-scanner-preview {
    min-height: 54dvh;
    border-radius: 18px;
  }

  .receipt-scanner-panel {
    gap: 10px;
    margin-top: 10px;
    border-radius: 18px;
    padding: 12px;
  }

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

  .receipt-scanner-quality-item {
    padding: 9px 7px;
    text-align: center;
  }

  .receipt-scanner-quality-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .receipt-scanner-quality-item span {
    font-size: 0.72rem;
  }

  .receipt-scanner-quality-item strong {
    font-size: 0.78rem;
  }

  #receiptScannerModal.is-camera-error .receipt-scanner-stage {
    min-height: min(68dvh, 560px);
  }

  .receipt-scanner-error {
    padding: 22px 16px;
  }

  .receipt-scanner-error h3 {
    font-size: 1.08rem;
  }

  .receipt-scanner-error-actions button {
    font-size: 0.92rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .receipt-scanner-spinner {
    animation-duration: 1.8s;
  }
}

.finance-bar-chart {
  --finance-year-min-width: 40.125rem;
  --finance-year-gap: 0.375rem;
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: repeat(var(--bar-count, 7), minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  margin-top: 18px;
  padding: 4px 2px 10px;
}

.finance-chart-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
}

.finance-chart-scroll.is-year {
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  touch-action: pan-x;
}

.finance-chart-scroll.is-year:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.finance-chart-scroll.is-year .finance-bar-chart {
  width: max(100%, var(--finance-year-min-width));
  max-width: none;
  min-width: var(--finance-year-min-width);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--finance-year-gap);
}

.finance-chart-scroll.is-year .finance-bar-item {
  scroll-snap-align: start;
}

.finance-bar-item {
  display: grid;
  grid-template-rows: minmax(24px, auto) 160px auto;
  align-items: end;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  text-align: center;
}

.finance-bar-fill-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 160px;
  border-bottom: 2px solid #d1d5db;
  border-radius: 10px 10px 0 0;
  background: repeating-linear-gradient(
    to top,
    #eef0f3 0,
    #eef0f3 1px,
    transparent 1px,
    transparent 40px
  );
  overflow: hidden;
}

.finance-bar-fill {
  width: min(38px, 72%);
  height: 0;
  border-radius: 10px 10px 3px 3px;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(47, 143, 92, 0.2);
  transition: height 220ms ease;
}

.finance-bar-label {
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-bar-value {
  align-self: end;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #111827;
  font-size: 0.74rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-category-list,
.finance-insights,
.finance-planned-list,
.finance-expense-list,
.finance-mini-stats {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 10px;
  margin-top: 16px;
}

.finance-category-row {
  display: grid;
  gap: 7px;
}

.finance-category-row-top,
.finance-expense-row,
.finance-receipt-row,
.finance-planned-row,
.finance-insight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.finance-category-row-top span:first-child,
.finance-expense-main strong,
.finance-receipt-main strong,
.finance-planned-row strong {
  color: #111827;
  font-weight: 950;
}

.finance-mini-stats {
  margin-top: 0;
}

.finance-mini-stats > div,
.finance-insight,
.finance-planned-row,
.finance-expense-row,
.finance-receipt-row {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fbfcfa;
  padding: 13px;
}

.finance-mini-stats span,
.finance-expense-meta,
.finance-receipt-meta,
.finance-planned-row span {
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.35;
}

.finance-mini-stats strong {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  margin-top: 3px;
  color: #111827;
  font-size: 1.22rem;
  letter-spacing: -0.03em;
}

.finance-insight {
  justify-content: flex-start;
  color: #14532d;
  line-height: 1.42;
  background: #f0fdf4;
}

.finance-insight-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #dcfce7;
}

.finance-expense-row,
.finance-receipt-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-items: flex-start;
}

.finance-expense-main,
.finance-receipt-main {
  flex: 1 1 180px;
  max-width: 100%;
  min-width: 0;
}

.finance-expense-main strong,
.finance-receipt-main strong,
.finance-expense-meta,
.finance-receipt-meta {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.finance-expense-amount {
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  color: #111827;
  font-size: 1.05rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.finance-expense-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
  justify-content: flex-end;
  gap: 8px;
}

.finance-expense-actions button {
  max-width: 100%;
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 8px 10px;
}

.finance-expense-actions button.danger-text {
  color: #991b1b;
}

.finance-receipt-row {
  min-height: 0 !important;
  height: auto !important;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}

.finance-receipt-main {
  flex: 1 1 auto;
}

.finance-receipt-main strong {
  display: block;
  margin-bottom: 4px;
}

.finance-expense-actions {
  align-items: center;
}

.finance-receipt-row .finance-expense-actions {
  margin-top: 0;
  align-self: flex-start;
}

.finance-receipt-row .finance-expense-actions button {
  min-height: 44px;
  padding: 8px 18px;
}

.finance-search {
  width: 100%;
  max-width: 340px;
  min-width: 0;
  border-radius: 999px;
  padding-inline: 16px;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.finance-search::placeholder {
  font-size: 0.94em;
  letter-spacing: -0.015em;
  opacity: 0.78;
}

.finance-currency-amounts,
.finance-currency-amounts > * {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.finance-empty-state {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 20px;
  margin-top: 16px;
  padding: 60px 20px 36px;
  text-align: center;
}

.finance-empty-state h3 {
  margin: 0;
  color: #111827;
  font-size: clamp(1.55rem, 6vw, 1.85rem);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.finance-empty-state p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.finance-empty-art {
  position: relative;
  width: clamp(132px, 38vw, 176px);
  height: clamp(132px, 38vw, 176px);
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 50%;
  background: linear-gradient(140deg, #e7fff1, #dff8ed);
}

.finance-empty-art .finance-empty-icon {
  width: 88%;
  height: 88%;
  background-color: transparent;
  transform: translate(7px, -1px) rotate(9deg);
}

.finance-empty-coins {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 3px rgba(123, 88, 19, 0.13));
}

.finance-empty-info-button {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 2px solid #94a0b2;
  border-radius: 50%;
  background: #ffffff;
  color: #94a0b2;
  font: 700 1.25rem/1 Georgia, serif;
  cursor: pointer;
}

.finance-empty-info-button:hover,
.finance-empty-info-button[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

.finance-empty-info-button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

#financeEntryInfo {
  position: absolute;
  z-index: 4;
  top: 58px;
  right: 14px;
  left: 14px;
  max-width: none;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
  text-align: start;
}

#financeEntryInfo[hidden] {
  display: none;
}

html[dir="rtl"] .finance-empty-info-button {
  right: auto;
  left: 16px;
}

html[data-theme="dark"] .finance-empty-state h3 {
  color: #f8fafc;
}

html[data-theme="dark"] .finance-empty-info-button,
html[data-theme="dark"] #financeEntryInfo {
  background: #111827;
  border-color: #64748b;
  color: #cbd5e1;
}

.finance-empty-actions {
  display: grid;
  width: 100%;
  gap: 12px;
  margin-top: 4px;
}

.finance-empty-actions > button {
  width: 100%;
  min-height: 58px;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 1.05rem;
  line-height: 1.25;
  font-weight: 800;
}

.finance-empty-actions > .primary {
  background: linear-gradient(110deg, #21855a, #2a8c5a);
}

.finance-empty-actions > .secondary {
  background: #f0f5ed;
  color: #168253;
}

.finance-muted-empty {
  color: var(--muted);
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  padding: 18px;
  text-align: center;
  background: #fbfcfa;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .finance-summary-grid,
  .finance-stats-grid,
  .finance-secondary-grid,
  .finance-receipt-layout {
    grid-template-columns: 1fr;
  }

  .finance-total-card {
    min-height: 180px;
  }

}

@media (max-width: 560px) {
  body.finance-only-mode #financeOverview.panel.active {
    padding-left: 14px;
    padding-right: 14px;
  }

  .finance-header-card,
  .finance-total-card,
  .finance-budget-card,
  .finance-form-card,
  .finance-stat-card,
  .finance-list-card,
  .finance-advanced-header-card,
  .finance-advanced-launch-card {
    border-radius: 20px;
    padding: 18px;
  }

  .finance-header-icon {
    display: none;
  }

  .finance-custom-range,
  .finance-action-row,
  .finance-form-grid,
  .finance-budget-input-row {
    grid-template-columns: 1fr;
  }

  .finance-advanced-launch-card {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-advanced-launch-button {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .finance-bar-item {
    grid-template-rows: minmax(22px, auto) 138px auto;
  }

  .finance-bar-chart {
    --finance-year-min-width: clamp(38rem, 165vw, 44rem);
    --finance-year-gap: 0.3125rem;
  }

  .finance-bar-fill-wrap {
    height: 138px;
  }

  .finance-card-topline,
  .finance-section-heading,
  .finance-budget-details,
  .finance-expense-row,
  .finance-receipt-row {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-search {
    max-width: none;
  }

  .finance-expense-actions {
    width: 100%;
    justify-content: stretch;
  }

  .finance-receipt-row {
    gap: 10px;
    padding: 14px;
  }

  .finance-receipt-row .finance-expense-actions {
    align-self: stretch;
  }

  .finance-expense-main,
  .finance-receipt-main,
  .finance-expense-amount {
    width: 100%;
  }

  .finance-expense-actions button {
    flex: 1 1 calc(50% - 4px);
    width: auto;
  }

  .finance-expense-actions button:last-child:nth-child(odd) {
    flex-basis: 100%;
  }
}




/* Kompaktere Ausgabenliste: weniger Leerraum, Betrag und Aktionen weiter nach oben */
.finance-expense-row,
.finance-receipt-row {
  justify-content: flex-start;
  gap: 10px;
}

.finance-expense-actions {
  align-items: center;
}

@media (max-width: 640px) {
  .finance-expense-row,
  .finance-receipt-row {
    justify-content: flex-start;
    gap: 10px;
    padding: 14px;
  }

  .finance-expense-amount {
    margin-top: -2px;
  }

  .finance-expense-actions {
    margin-top: 0;
  }
}



/* Ausgabenliste kompakter + Löschen-Dialog wie bei Listen */

#deleteExpenseModal .delete-confirm-box {
  width: min(440px, calc(100vw - 32px));
}

html[data-theme="dark"] #deleteExpenseModal .delete-confirm-box {
  background: #111827;
}

.finance-expense-row {
  min-height: 0 !important;
  height: auto !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  padding: 12px 14px !important;
}

.finance-expense-main {
  flex: 0 1 auto !important;
}

.finance-expense-meta {
  margin-top: 2px;
}

.finance-expense-amount {
  margin-top: 2px;
  line-height: 1.1;
}

.finance-expense-actions {
  align-self: flex-start;
  margin-top: 2px;
  gap: 8px;
}

@media (max-width: 640px) {
  .finance-expense-row {
    justify-content: flex-start !important;
    gap: 8px !important;
    padding: 12px 14px !important;
  }

  .finance-expense-main,
  .finance-expense-amount,
  .finance-expense-actions {
    width: 100%;
  }

  .finance-expense-actions {
    margin-top: 2px;
    align-self: stretch;
  }
}

/* ================================
   KOCHEN-BEREICH
   Moderner Rezept-, Vorrats- und Community-Screen.
   ================================ */
body.cooking-only-mode {
  background: #ffffff;
}

body.cooking-only-mode header,
body.cooking-only-mode .stats,
body.cooking-only-mode .tabs {
  display: none;
}

body.cooking-only-mode main {
  max-width: none;
  min-height: 100dvh;
  padding: 0;
  background: #ffffff;
}

body.cooking-only-mode #cookingScreen.panel.active {
  display: block !important;
  min-height: 100dvh;
  padding: 0 16px max(34px, env(safe-area-inset-bottom));
  background: #ffffff;
}

.cooking-shell {
  width: min(1020px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 0 36px;
  box-sizing: border-box;
}

.cooking-fixed-back-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  border: 0;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
  pointer-events: none;
}

body.cooking-only-mode #cookingScreen.panel.active .cooking-fixed-back-bar {
  display: block;
}

body.cooking-only-mode #cookingScreen.panel.active .cooking-shell {
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.cooking-fixed-back-inner {
  width: min(1020px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.cooking-fixed-back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font: inherit;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
  box-sizing: border-box;
  pointer-events: auto;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.cooking-fixed-back-button:hover {
  background: #e5e7eb;
  color: #4b5563;
}

.cooking-fixed-back-button:active {
  transform: translateY(1px);
}

.cooking-fixed-back-button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.choice-skip,
.paper-list-back-link,
.settings-back-button,
.auth-bottom-back,
[data-app-action="shopping-complete-back"],
.shopping-run-actions .secondary[data-app-action="shopping-run-show-lists"] {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100% !important;
  max-width: none !important;
  min-height: 48px;
  padding: 11px 18px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 999px !important;
  background: #f3f4f6 !important;
  color: #6b7280 !important;
  font: inherit;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.choice-skip,
.paper-list-back-link {
  margin: 18px auto 0;
}

.settings-back-button {
  margin: 0 auto;
}

.auth-bottom-back {
  margin: auto 0 0;
}

[data-app-action="shopping-complete-back"],
.shopping-run-actions .secondary[data-app-action="shopping-run-show-lists"] {
  margin: 0;
}

.cooking-fixed-back-button::before,
.choice-skip::before,
.paper-list-back-link::before,
.settings-back-button::before,
.auth-bottom-back::before,
[data-app-action="shopping-complete-back"]::before,
.shopping-run-actions .secondary[data-app-action="shopping-run-show-lists"]::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  content: "";
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  box-sizing: border-box;
  transform: rotate(45deg);
}

.choice-manage-lists::before {
  display: none !important;
  content: none;
}

.choice-manage-lists[hidden] {
  display: none !important;
}

.choice-skip:hover,
.paper-list-back-link:hover,
.settings-back-button:hover,
.auth-bottom-back:hover,
[data-app-action="shopping-complete-back"]:hover,
.shopping-run-actions .secondary[data-app-action="shopping-run-show-lists"]:hover {
  background: #e5e7eb !important;
  color: #4b5563 !important;
}

.choice-skip:active,
.paper-list-back-link:active,
.settings-back-button:active,
.auth-bottom-back:active,
[data-app-action="shopping-complete-back"]:active,
.shopping-run-actions .secondary[data-app-action="shopping-run-show-lists"]:active {
  transform: translateY(1px);
}

.choice-skip:focus-visible,
.paper-list-back-link:focus-visible,
.settings-back-button:focus-visible,
.auth-bottom-back:focus-visible,
[data-app-action="shopping-complete-back"]:focus-visible,
.shopping-run-actions .secondary[data-app-action="shopping-run-show-lists"]:focus-visible {
  outline: 3px solid var(--accent) !important;
  outline-offset: 2px;
}

.cooking-app {
  display: grid;
  gap: 18px;
}

.cooking-hero,
.cooking-card,
.cooking-section,
.cooking-recipe-card,
.cooking-community-card,
.cooking-detail-card,
.cooking-mode-card,
.cooking-empty-state {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(31, 41, 51, 0.08);
}

.cooking-hero {
  padding: 22px 24px 24px;
  display: grid;
  gap: 16px;
  background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
}

.cooking-kicker {
  display: inline-flex;
  width: fit-content;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cooking-hero h2,
.cooking-detail-title,
.cooking-mode-card h2,
.cooking-section h3,
.cooking-card h3 {
  color: #111827;
  letter-spacing: -0.045em;
}

.cooking-hero h2 {
  margin: 0 0 8px;
  font-size: clamp(2.25rem, 8vw, 4rem);
  line-height: 0.98;
}

.cooking-hero p,
.cooking-card p,
.cooking-section p,
.cooking-empty-state p,
.cooking-detail-subline {
  color: var(--muted);
  line-height: 1.45;
}

.cooking-hero p {
  margin: 0;
  max-width: 620px;
}

.cooking-search-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
}

.cooking-search-icon {
  color: #64748b;
  font-size: 1.1rem;
}

.cooking-search-wrap input {
  border: 0;
  background: transparent;
  padding: 10px 0;
  box-shadow: none !important;
}

.cooking-filter-row,
.cooking-quick-actions,
.cooking-meta-row,
.cooking-action-row,
.cooking-chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cooking-filter-row {
  overflow-x: auto;
  padding-bottom: 2px;
}

.cooking-filter-chip,
.cooking-pill,
.cooking-small-button {
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.cooking-filter-chip {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 9px 13px;
  white-space: nowrap;
}

.cooking-filter-chip.active,
.cooking-pill.good {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.cooking-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cooking-action-card {
  min-height: 112px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #ffffff;
  cursor: pointer;
  padding: 16px;
  text-align: left;
  display: grid;
  gap: 8px;
  align-content: center;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.cooking-action-card:hover,
.cooking-action-card:focus {
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(31, 41, 51, 0.08);
  transform: translateY(-2px);
  outline: none;
}

.cooking-action-card span:first-child {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #dcfce7;
  font-size: 1.25rem;
}

.cooking-action-card strong {
  color: #111827;
  font-size: 0.96rem;
  line-height: 1.15;
}

.cooking-section,
.cooking-card {
  padding: 20px;
}

.cooking-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.cooking-section--plain-header {
  padding-top: 24px;
}

.cooking-section--plain-header .cooking-section-header {
  align-items: flex-start;
  margin-bottom: 18px;
}

.cooking-section--plain-header .cooking-section-header h3 {
  margin-bottom: 7px;
}

.cooking-section h3,
.cooking-card h3 {
  margin: 0 0 5px;
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  line-height: 1.05;
}

.cooking-section p,
.cooking-card p {
  margin: 0;
}

.cooking-recipe-grid,
.cooking-community-grid,
.cooking-two-column,
.cooking-stats-grid {
  display: grid;
  gap: 14px;
}

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

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

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

.cooking-recipe-card,
.cooking-community-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cooking-recipe-image,
.cooking-detail-image,
.cooking-community-image {
  min-height: 150px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(47, 133, 90, 0.25), transparent 42%),
    linear-gradient(145deg, #f0fdf4, #ffffff);
  font-size: 3.2rem;
}

.cooking-detail-image {
  min-height: 240px;
  border-radius: 24px;
  font-size: 5rem;
}

.cooking-community-image {
  min-height: 170px;
}

.cooking-recipe-content,
.cooking-community-content {
  padding: 16px;
  display: grid;
  gap: 10px;
  flex: 1;
}

.cooking-recipe-content h4,
.cooking-community-content h4 {
  margin: 0;
  color: #111827;
  font-size: 1.08rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.cooking-recipe-description,
.cooking-community-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.cooking-meta-row {
  gap: 7px;
}

.cooking-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  font-size: 0.76rem;
  cursor: default;
}

.cooking-pill.warning {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.cooking-pill.danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.cooking-card-actions,
.cooking-form-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: auto;
}

.cooking-card-actions button,
.cooking-form-actions button {
  min-height: 46px;
  border-radius: 999px;
}

.cooking-pantry-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 16px;
  align-items: start;
}

.cooking-input-stack,
.cooking-form-grid,
.cooking-step-list,
.cooking-ingredient-list,
.cooking-plan-list {
  display: grid;
  gap: 10px;
}

.cooking-pantry-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cooking-select-chip {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  padding: 8px 11px;
}

.cooking-select-chip.active {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}

.cooking-check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #374151;
  font-weight: 800;
}

.cooking-check-row input {
  width: auto;
}

.cooking-detail-card,
.cooking-mode-card {
  padding: 20px;
  display: grid;
  gap: 18px;
}

.cooking-inline-back {
  margin: 0 0 4px;
}

.cooking-detail-title {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 0.98;
}

.cooking-detail-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
  align-items: start;
}

.cooking-detail-panel {
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #fbfcfa;
  padding: 16px;
}

.cooking-detail-panel h4 {
  margin: 0 0 12px;
  color: #111827;
  letter-spacing: -0.02em;
}

.cooking-ingredient-row,
.cooking-step-row,
.cooking-plan-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  padding: 11px;
}

.cooking-step-row {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.cooking-number-dot {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #dcfce7;
  color: #14532d;
  font-weight: 950;
}

.cooking-mode-step {
  min-height: 310px;
  border: 1px solid #e5e7eb;
  border-radius: 28px;
  background: linear-gradient(145deg, #ffffff, #f0fdf4);
  padding: 26px;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 18px;
  text-align: center;
}

.cooking-mode-step strong {
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  justify-self: center;
  align-self: start;
}

.cooking-mode-step p {
  margin: 0;
  color: #111827;
  font-size: clamp(1.35rem, 5vw, 2.2rem);
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: -0.04em;
  display: grid;
  place-items: center;
  align-self: stretch;
}

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

.cooking-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.cooking-ai-card {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.cooking-ai-card h3,
.cooking-ai-card p,
.cooking-ai-card label {
  color: #ffffff;
}

.cooking-ai-card p {
  opacity: 0.78;
}

.cooking-ai-card textarea {
  min-height: 96px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.cooking-ai-card textarea::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

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

.cooking-form-grid .full {
  grid-column: 1 / -1;
}

.cooking-empty-state {
  padding: 24px;
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.cooking-empty-state .empty-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: #dcfce7;
  font-size: 1.9rem;
}

.cooking-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

@media (max-width: 900px) {
  .cooking-quick-actions,
  .cooking-recipe-grid,
  .cooking-community-grid,
  .cooking-two-column,
  .cooking-pantry-layout,
  .cooking-detail-grid,
  .cooking-stats-grid {
    grid-template-columns: 1fr;
  }

  .cooking-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body.cooking-only-mode #cookingScreen.panel.active {
    padding-left: 14px;
    padding-right: 14px;
  }

  .cooking-fixed-back-inner {
    padding-right: 14px;
    padding-left: 14px;
  }

  .cooking-hero,
  .cooking-section,
  .cooking-card,
  .cooking-detail-card,
  .cooking-mode-card {
    padding: 18px;
    border-radius: 22px;
  }

  .cooking-quick-actions {
    gap: 12px;
  }

  .cooking-action-card {
    min-height: 112px;
    padding: 14px;
  }

  .cooking-card-actions,
  .cooking-form-actions {
    grid-template-columns: 1fr;
  }

  .cooking-detail-image {
    min-height: 210px;
  }

  .cooking-mode-step {
    min-height: 280px;
    padding: 20px;
  }
}

/* TheMealDB-Erweiterungen innerhalb des vorhandenen Kochen-Designs */
.cooking-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.cooking-search-button {
  min-width: 112px;
  border-radius: 999px;
}

.cooking-recipe-image,
.cooking-detail-image {
  overflow: hidden;
}

.cooking-recipe-image img,
.cooking-detail-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.cooking-recipe-image img {
  aspect-ratio: 4 / 3;
}

.cooking-detail-image img {
  max-height: 520px;
}

.cooking-image-placeholder {
  color: var(--muted);
}

.cooking-clickable-card {
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.cooking-clickable-card:hover,
.cooking-clickable-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 18px 38px rgba(31, 41, 51, 0.13);
  transform: translateY(-3px);
  outline: none;
}

.cooking-status-card {
  min-height: 260px;
  align-content: center;
}

.cooking-loader {
  width: 48px;
  height: 48px;
  border: 5px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: cooking-spin 0.8s linear infinite;
}

@keyframes cooking-spin {
  to { transform: rotate(360deg); }
}

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

.cooking-category-card {
  min-height: 220px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #ffffff;
  color: #111827;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  display: grid;
  grid-template-rows: 120px auto 1fr;
  gap: 10px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.cooking-category-card:hover,
.cooking-category-card:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  outline: none;
}

.cooking-category-card img,
.cooking-category-card > span {
  width: 100%;
  height: 120px;
  object-fit: contain;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #f0fdf4;
  font-size: 2.5rem;
}

.cooking-category-card strong {
  font-size: 1.08rem;
}

.cooking-category-card small {
  color: var(--muted);
  line-height: 1.4;
}

.cooking-match-summary {
  display: grid;
  gap: 8px;
}

.cooking-match-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #374151;
  font-size: 0.82rem;
}

.cooking-match-topline strong {
  color: var(--accent-dark);
}

.cooking-pantry-controls {
  position: sticky;
  top: 14px;
}

.cooking-pantry-controls textarea {
  min-height: 92px;
  resize: vertical;
}

.cooking-detail-meta {
  margin-top: 14px;
}

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

.cooking-instructions {
  display: grid;
  gap: 12px;
}

.cooking-instruction-paragraph {
  margin: 0;
  color: #374151;
  line-height: 1.65;
  white-space: pre-line;
}

.cooking-external-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cooking-external-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--card);
  font-weight: 900;
  text-decoration: none;
}

.cooking-mode-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.3fr);
  gap: 16px;
  align-items: stretch;
}

.cooking-mode-layout .cooking-detail-panel {
  max-height: 430px;
  overflow: auto;
}

.cooking-mode-actions {
  max-width: 680px;
  width: 100%;
  margin-inline: auto;
}

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

.cooking-selection-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #ffffff;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.cooking-selection-row:hover,
.cooking-selection-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(31, 41, 51, 0.08);
  transform: translateY(-2px);
}

.cooking-selection-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin: 0;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
}

.cooking-selection-row input[type="checkbox"]::before {
  content: "";
  width: 12px;
  height: 12px;
  transform: scale(0);
  transition: transform 0.08s ease;
  background: #ffffff;
  clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 16%, 84% 0, 37% 66%);
}

.cooking-selection-row input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.cooking-selection-row input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.cooking-selection-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cooking-selection-row span strong {
  color: #111827;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.3;
}

.cooking-selection-row small {
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 700;
}

.cooking-selection-row.selected {
  background: #f8fafc;
}

.cooking-selection-row.selected span strong {
  color: #94a3b8;
  text-decoration: none;
}

.cooking-selection-row.selected small {
  color: #94a3b8;
}

.cooking-missing-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

html[data-theme="dark"] .cooking-category-card,
html[data-theme="dark"] .cooking-selection-row {
  background: #1e293b;
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .cooking-selection-row:hover,
html[data-theme="dark"] .cooking-selection-row:focus-within {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .cooking-selection-row input[type="checkbox"] {
  border-color: #94a3b8;
  background: #ffffff;
}

html[data-theme="dark"] .cooking-selection-row.selected {
  background: #243244;
}

html[data-theme="dark"] .cooking-selection-row.selected span strong,
html[data-theme="dark"] .cooking-selection-row.selected small {
  color: #94a3b8;
}

html[data-theme="dark"] .cooking-category-card img,
html[data-theme="dark"] .cooking-category-card > span {
  background: var(--accent-soft);
}

html[data-theme="dark"] .cooking-match-topline,
html[data-theme="dark"] .cooking-instruction-paragraph {
  color: #e2e8f0;
}

html[data-theme="dark"] .cooking-match-topline strong {
  color: var(--accent);
}

html[data-theme="dark"] .cooking-pantry-controls textarea {
  background: #1e293b;
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .cooking-pantry-controls textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

@media (max-width: 900px) {
  .cooking-category-grid,
  .cooking-detail-actions,
  .cooking-mode-layout {
    grid-template-columns: 1fr;
  }

  .cooking-pantry-controls {
    position: static;
  }
}

@media (max-width: 520px) {
  .cooking-search-form {
    grid-template-columns: 1fr;
  }

  .cooking-search-button {
    width: 100%;
  }

  .cooking-category-grid {
    grid-template-columns: 1fr;
  }

  .cooking-match-topline {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* ================================
   EINKAUFSMODUS / SHOPPING RUN
   ================================ */
body.shopping-run-mode header,
body.shopping-run-mode .stats,
body.shopping-run-mode .tabs {
  display: none;
}

body.shopping-run-mode {
  background: #ffffff;
}

body.shopping-run-mode main {
  max-width: none;
  min-height: 100dvh;
  padding: 0;
  background: #ffffff;
}

body.shopping-run-mode #shoppingRunScreen.panel.active {
  display: block !important;
  min-height: 100dvh;
  padding: max(22px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  background: #ffffff;
}

.shopping-run-view {
  width: min(430px, 100%);
  margin: 0 auto;
}

.shopping-run-card,
.shopping-run-progress-card,
.shopping-run-empty-card,
.shopping-run-done-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(31, 41, 51, 0.08);
}

.shopping-run-card {
  padding: 22px;
}

.shopping-run-header {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.shopping-run-kicker {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shopping-run-header h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(1.9rem, 8vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.shopping-run-date,
.shopping-run-subtitle,
.shopping-run-meta {
  color: var(--muted);
  line-height: 1.45;
}

.shopping-run-progress-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  margin: 18px 0;
  background: linear-gradient(145deg, #ffffff, #f0fdf4);
}

.shopping-run-progress-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.shopping-run-percent {
  color: #111827;
  font-size: 1.45rem;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.shopping-run-count {
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 850;
  text-align: right;
}

.shopping-run-progress-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.shopping-run-progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.shopping-run-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.shopping-run-product {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fbfcfa;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}

.shopping-run-product input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin: 0;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
}

.shopping-run-product input[type="checkbox"]::before {
  content: "";
  width: 12px;
  height: 12px;
  transform: scale(0);
  transition: transform 0.08s ease;
  background: #ffffff;
  clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 16%, 84% 0, 37% 66%);
}

.shopping-run-product input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.shopping-run-product input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.shopping-run-product-name {
  min-width: 0;
  color: #111827;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.3;
}

.shopping-run-product.done {
  background: #f8fafc;
}

.shopping-run-product.done .shopping-run-product-name {
  color: #94a3b8;
  text-decoration: line-through;
}

.shopping-run-done-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 18px;
  margin: 18px 0 0;
  text-align: center;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.shopping-run-done-card strong {
  color: #14532d;
  font-size: 1.1rem;
}

.shopping-run-done-card span {
  color: #166534;
  line-height: 1.4;
}


.shopping-run-finish-card {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #d9e2d0;
  border-radius: 22px;
  background: #fbfcfa;
}

.shopping-run-finish-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

.shopping-run-finish-card .primary {
  width: 100%;
  border-radius: 999px;
  min-height: 50px;
}

.shopping-run-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.38);
}

.shopping-run-confirm-box {
  width: min(390px, 100%);
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 22px 55px rgba(31, 41, 51, 0.22);
  text-align: center;
}

.shopping-run-confirm-box h3 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 1.55rem;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.shopping-run-confirm-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.shopping-run-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.shopping-run-confirm-actions button {
  width: 100%;
  border-radius: 999px;
}

.shopping-complete-card,
.shopping-expense-card,
.shopping-receipt-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(31, 41, 51, 0.08);
}

.shopping-complete-header {
  display: grid;
  gap: 8px;
  text-align: center;
}

.shopping-complete-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 22px;
  background: #dcfce7;
  color: #14532d;
  font-size: 1.8rem;
}

.shopping-complete-header h2,
.shopping-expense-card h2,
.shopping-receipt-card h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(1.85rem, 7vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.shopping-complete-header p,
.shopping-expense-card p,
.shopping-receipt-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.shopping-summary-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #d9e2d0;
  border-radius: 20px;
  background: linear-gradient(145deg, #ffffff, #f0fdf4);
}

.shopping-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #64748b;
  font-weight: 800;
}

.shopping-summary-row strong {
  color: #111827;
  text-align: right;
}

.shopping-complete-actions,
.shopping-expense-actions {
  display: grid;
  gap: 12px;
}

.shopping-complete-actions button,
.shopping-expense-actions button,
.shopping-expense-card .primary,
.shopping-receipt-card .primary,
.shopping-receipt-card .secondary {
  width: 100%;
  border-radius: 999px;
  min-height: 50px;
}

.shopping-expense-form {
  display: grid;
  gap: 12px;
}

.shopping-expense-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.shopping-expense-form .full,
.shopping-expense-form-grid .full {
  grid-column: 1 / -1;
}

.shopping-receipt-preview {
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
  background: #f8fafc;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.shopping-receipt-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
}

.shopping-skip-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: center;
}

.shopping-run-empty-card {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 26px 20px;
  margin-top: 18px;
  text-align: center;
}

.shopping-run-empty-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #dcfce7;
  font-size: 1.8rem;
}

.shopping-run-empty-card h3 {
  margin: 0;
  color: #111827;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}

.shopping-run-empty-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.shopping-run-actions {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.shopping-run-actions .primary,
.shopping-run-actions .secondary {
  width: 100%;
  border-radius: 999px;
}

.cooking-missing-list-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cooking-missing-list-overlay .shopping-run-empty-card {
  width: min(390px, 100%);
  margin: 0;
  box-shadow: 0 22px 55px rgba(31, 41, 51, 0.22);
}

.cooking-missing-list-overlay .shopping-run-actions {
  width: 100%;
}

.cooking-feedback-message {
  position: fixed;
  left: 50%;
  bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));
  z-index: 140;
  width: max-content;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.28);
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.cooking-feedback-message.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.cooking-list-picker {
  width: min(430px, 100%);
  margin: 0 auto;
}

.cooking-section.cooking-list-picker {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.cooking-list-picker-card {
  padding: 22px;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(31, 41, 51, 0.08);
}

.cooking-list-picker-card h3 {
  margin: 0 0 18px;
  color: #111827;
  font-size: clamp(1.45rem, 6vw, 1.9rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.cooking-list-picker-lists {
  display: grid;
  gap: 10px;
}

.cooking-list-picker-button {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px 14px;
  color: #111827;
  text-align: left;
  cursor: pointer;
  font: inherit;
  box-sizing: border-box;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.cooking-list-picker-button:hover,
.cooking-list-picker-button:focus-visible {
  border-color: var(--accent);
  background: #f9fafb;
  box-shadow: 0 10px 24px rgba(31, 41, 51, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.cooking-list-picker-button .saved-list-title-row {
  font-weight: 900;
}

html[data-theme="dark"] .cooking-section.cooking-list-picker {
  background: transparent;
  border: none;
  box-shadow: none;
}

html[data-theme="dark"] .cooking-list-picker-card,
html[data-theme="dark"] .cooking-list-picker-button {
  background: #111827;
  border-color: #334155;
  color: #f8fafc;
}

html[data-theme="dark"] .cooking-list-picker-button:hover,
html[data-theme="dark"] .cooking-list-picker-button:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.shopping-run-back-link {
  margin: 18px auto 0;
}

@media (max-width: 380px) {
  .shopping-run-card {
    padding: 18px;
    border-radius: 22px;
  }

  .shopping-run-progress-top {
    display: grid;
    gap: 4px;
  }

  .shopping-run-count {
    text-align: left;
  }

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

  .shopping-run-confirm-actions {
    grid-template-columns: 1fr;
  }
}

/* ================================
   DARK MODE FEINSCHLIFF
   ================================ */
html[data-theme="dark"] body {
  background: #0f172a;
  color: #f8fafc;
}

html[data-theme="dark"] .start-modal,
html[data-theme="dark"] #settingsPanel.start-modal,
html[data-theme="dark"] #startShoppingScreen.start-modal,
html[data-theme="dark"] body.list-only-mode,
html[data-theme="dark"] body.manager-mode,
html[data-theme="dark"] body.finance-only-mode,
html[data-theme="dark"] body.finance-only-mode main,
html[data-theme="dark"] body.finance-only-mode #financeOverview.panel.active {
  background: #0f172a !important;
}

html[data-theme="dark"] .hero-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .item,
html[data-theme="dark"] .recipe,
html[data-theme="dark"] .day,
html[data-theme="dark"] .simple-list-card,
html[data-theme="dark"] .simple-list-row,
html[data-theme="dark"] .choice-card,
html[data-theme="dark"] .start-shopping-list-button,
html[data-theme="dark"] .start-shopping-empty,
html[data-theme="dark"] .list-manager-card,
html[data-theme="dark"] .list-preview-paper,
html[data-theme="dark"] .saved-list-summary,
html[data-theme="dark"] .finance-header-card,
html[data-theme="dark"] .finance-period-card,
html[data-theme="dark"] .finance-total-card,
html[data-theme="dark"] .finance-budget-card,
html[data-theme="dark"] .finance-form-card,
html[data-theme="dark"] .finance-stat-card,
html[data-theme="dark"] .finance-list-card,
html[data-theme="dark"] .finance-empty-state,
html[data-theme="dark"] .finance-advanced-header-card,
html[data-theme="dark"] .finance-advanced-launch-card,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .reset-confirm-box,
html[data-theme="dark"] .import-preview-box,
html[data-theme="dark"] .startup-recovery-box,
html[data-theme="dark"] #deleteListModal .delete-confirm-box,
html[data-theme="dark"] #currencyConfirmModal .delete-confirm-box,
html[data-theme="dark"] #emptyListConfirmModal .delete-confirm-box {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .tabs {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.86));
}

html[data-theme="dark"] .tab,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .paper-list-name,
html[data-theme="dark"] .start-shopping-list-button,
html[data-theme="dark"] .saved-list-summary,
html[data-theme="dark"] .list-edit-button,
html[data-theme="dark"] .list-delete-button,
html[data-theme="dark"] .paper-back-button,
html[data-theme="dark"] .standard-shopping-check,
html[data-theme="dark"] .finance-small-action,
html[data-theme="dark"] .finance-icon-button,
html[data-theme="dark"] #settingsPanel select {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .hero-card p,
html[data-theme="dark"] .card p.help,
html[data-theme="dark"] .item-meta,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .settings-header p,
html[data-theme="dark"] .settings-row-description,
html[data-theme="dark"] .start-shopping-list-meta,
html[data-theme="dark"] .start-shopping-list-preview,
html[data-theme="dark"] .finance-header-card p,
html[data-theme="dark"] .finance-form-header p,
html[data-theme="dark"] .finance-total-card p,
html[data-theme="dark"] .finance-advanced-header-card p,
html[data-theme="dark"] .finance-advanced-launch-card p,
html[data-theme="dark"] .finance-budget-hint,
html[data-theme="dark"] #resetConfirmModal p,
html[data-theme="dark"] #deleteListModal p,
html[data-theme="dark"] #currencyConfirmModal p,
html[data-theme="dark"] #emptyListConfirmModal p {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .settings-header h2,
html[data-theme="dark"] .settings-card h3,
html[data-theme="dark"] .settings-row-title,
html[data-theme="dark"] #resetConfirmModal h2,
html[data-theme="dark"] #deleteListModal h2,
html[data-theme="dark"] #deleteExpenseModal h2,
html[data-theme="dark"] #currencyConfirmModal h2,
html[data-theme="dark"] #emptyListConfirmModal h2,
html[data-theme="dark"] .start-shopping-empty strong,
html[data-theme="dark"] .simple-list-header h2,
html[data-theme="dark"] .finance-header-card h2,
html[data-theme="dark"] .finance-advanced-header-card h2,
html[data-theme="dark"] .finance-advanced-launch-card h3,
html[data-theme="dark"] .finance-form-card h3,
html[data-theme="dark"] .finance-list-card h3,
html[data-theme="dark"] .finance-total-card strong,
html[data-theme="dark"] .finance-bar-value,
html[data-theme="dark"] .finance-category-row-top span:first-child,
html[data-theme="dark"] .finance-expense-main strong,
html[data-theme="dark"] .finance-receipt-main strong,
html[data-theme="dark"] .finance-planned-row strong,
html[data-theme="dark"] .paper-list-date,
html[data-theme="dark"] .settings-back-button:hover,
html[data-theme="dark"] .settings-back-button:focus {
  color: #f8fafc !important;
}

html[data-theme="dark"] .settings-row,
html[data-theme="dark"] .simple-list-header,
html[data-theme="dark"] .list-preview-row {
  border-color: #334155 !important;
}

html[data-theme="dark"] .settings-switch-slider {
  background: #334155;
  border-color: #475569;
}

html[data-theme="dark"] .finance-bar-fill-wrap {
  border-color: #475569;
  background: repeating-linear-gradient(
    to top,
    #334155 0,
    #334155 1px,
    transparent 1px,
    transparent 40px
  );
}

html[data-theme="dark"] .settings-back-button,
html[data-theme="dark"] .choice-skip,
html[data-theme="dark"] .paper-list-back-link,
html[data-theme="dark"] .auth-bottom-back,
html[data-theme="dark"] [data-app-action="shopping-complete-back"],
html[data-theme="dark"] .shopping-run-actions .secondary[data-app-action="shopping-run-show-lists"] {
  border-color: var(--border) !important;
  background: var(--accent-soft) !important;
  color: var(--muted) !important;
}

html[data-theme="dark"] .settings-back-button:hover,
html[data-theme="dark"] .settings-back-button:focus-visible,
html[data-theme="dark"] .choice-skip:hover,
html[data-theme="dark"] .paper-list-back-link:hover,
html[data-theme="dark"] .paper-list-back-link:focus-visible,
html[data-theme="dark"] .auth-bottom-back:hover,
html[data-theme="dark"] .auth-bottom-back:focus-visible,
html[data-theme="dark"] [data-app-action="shopping-complete-back"]:hover,
html[data-theme="dark"] [data-app-action="shopping-complete-back"]:focus-visible,
html[data-theme="dark"] .shopping-run-actions .secondary[data-app-action="shopping-run-show-lists"]:hover,
html[data-theme="dark"] .shopping-run-actions .secondary[data-app-action="shopping-run-show-lists"]:focus-visible {
  background: var(--card) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] button.secondary {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

html[data-theme="dark"] button.danger,
html[data-theme="dark"] .settings-danger-button {
  background: #3f1d24 !important;
  border-color: #7f1d1d !important;
  color: #fecaca !important;
}

html[data-theme="dark"] button.settings-danger-button {
  color: var(--ios-action-red) !important;
}

html[data-theme="dark"] .pill,
html[data-theme="dark"] .badge {
  background: #1e293b !important;
  color: #bfdbfe !important;
}

html[data-theme="dark"] .tip,
html[data-theme="dark"] .meal {
  background: #123225 !important;
  border-color: #22543d !important;
  color: #bbf7d0 !important;
}

html[data-theme="dark"] .paper-write-line {
  border-color: #475569 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .paper-list-date-label {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .paper-list-date {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .paper-list-date:hover,
html[data-theme="dark"] .paper-list-date:focus {
  background: #263449 !important;
  border-color: #60a5fa !important;
}

html[data-theme="dark"] .paper-list-date-past-hint {
  color: #fbbf24 !important;
}

html[data-theme="dark"] .paper-line-remove {
  color: #94a3b8;
}

html[data-theme="dark"] .paper-line-remove:hover,
html[data-theme="dark"] .paper-line-remove:focus {
  background: #3f1d24 !important;
  color: #fecaca !important;
}

html[data-theme="dark"] #addNewListButton[data-mode="add"],
html[data-theme="dark"] #addNewListButton[data-mode="auto-save"] {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  color: #ffffff !important;
}


/* ================================
   DARK MODE: STARTSCREEN + KOCHEN
   Nutzt ausschließlich die bestehende data-theme="dark"-Logik.
   ================================ */

/* Startscreen */
html[data-theme="dark"] #startModal.start-modal {
  background: var(--bg) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] #startModal .start-box {
  background: transparent !important;
  color: var(--text) !important;
}

html[data-theme="dark"] #startModal #startTitle,
html[data-theme="dark"] #startModal .choice-card h3,
html[data-theme="dark"] #startModal #chooseFinance h3 {
  color: var(--text) !important;
}

html[data-theme="dark"] #startModal .choice-card {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] #startModal .choice-card:hover,
html[data-theme="dark"] #startModal .choice-card:focus-visible {
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
  box-shadow: var(--shadow) !important;
  outline: none !important;
}

html[data-theme="dark"] #startModal .choice-icon {
  background: var(--accent-soft) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] #startModal #settingsButton,
html[data-theme="dark"] #startModal .settings-entry {
  color: var(--text) !important;
}

html[data-theme="dark"] #startModal #settingsButton:hover,
html[data-theme="dark"] #startModal #settingsButton:focus-visible,
html[data-theme="dark"] #startModal .settings-entry:hover,
html[data-theme="dark"] #startModal .settings-entry:focus-visible {
  background: var(--accent-soft) !important;
  color: var(--text) !important;
  outline: none !important;
}

/* Kochen-Screen: Seitenflächen und große Cards */
html[data-theme="dark"] body.cooking-only-mode,
html[data-theme="dark"] body.cooking-only-mode main,
html[data-theme="dark"] body.cooking-only-mode #cookingScreen.panel.active {
  background: var(--bg) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .cooking-hero,
html[data-theme="dark"] .cooking-card,
html[data-theme="dark"] .cooking-section,
html[data-theme="dark"] .cooking-recipe-card,
html[data-theme="dark"] .cooking-community-card,
html[data-theme="dark"] .cooking-detail-card,
html[data-theme="dark"] .cooking-mode-card,
html[data-theme="dark"] .cooking-empty-state {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow) !important;
}

html[data-theme="dark"] .cooking-hero {
  background: linear-gradient(145deg, var(--card) 0%, var(--accent-soft) 100%) !important;
}

/* Kochen-Screen: Überschriften und Sekundärtexte */
html[data-theme="dark"] .cooking-hero h2,
html[data-theme="dark"] .cooking-detail-title,
html[data-theme="dark"] .cooking-mode-card h2,
html[data-theme="dark"] .cooking-section h3,
html[data-theme="dark"] .cooking-card h3,
html[data-theme="dark"] .cooking-recipe-content h4,
html[data-theme="dark"] .cooking-community-content h4,
html[data-theme="dark"] .cooking-action-card strong,
html[data-theme="dark"] .cooking-detail-panel h4,
html[data-theme="dark"] .cooking-mode-step p {
  color: var(--text) !important;
}

html[data-theme="dark"] .cooking-kicker,
html[data-theme="dark"] .cooking-hero p,
html[data-theme="dark"] .cooking-card p,
html[data-theme="dark"] .cooking-section p,
html[data-theme="dark"] .cooking-empty-state p,
html[data-theme="dark"] .cooking-detail-subline,
html[data-theme="dark"] .cooking-recipe-description,
html[data-theme="dark"] .cooking-community-caption,
html[data-theme="dark"] .cooking-search-icon {
  color: var(--muted) !important;
}

html[data-theme="dark"] .cooking-fixed-back-bar {
  border: 0;
  background: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .cooking-fixed-back-button {
  border-color: var(--border);
  background: var(--accent-soft);
  color: var(--muted);
}

html[data-theme="dark"] .cooking-fixed-back-button:hover {
  background: var(--card);
  color: var(--text);
}

/* Kochen-Screen: Suche und Formulare */
html[data-theme="dark"] .cooking-search-wrap {
  background: #1e293b !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .cooking-search-wrap input,
html[data-theme="dark"] .cooking-form-grid input,
html[data-theme="dark"] .cooking-form-grid select,
html[data-theme="dark"] .cooking-form-grid textarea {
  background: #1e293b !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .cooking-search-wrap input {
  background: transparent !important;
}

html[data-theme="dark"] .cooking-search-wrap input::placeholder,
html[data-theme="dark"] .cooking-form-grid input::placeholder,
html[data-theme="dark"] .cooking-form-grid textarea::placeholder {
  color: var(--muted) !important;
  opacity: 1;
}

/* Kochen-Screen: Filter, Pills und Schnellaktionen */
html[data-theme="dark"] .cooking-filter-chip,
html[data-theme="dark"] .cooking-pill,
html[data-theme="dark"] .cooking-small-button,
html[data-theme="dark"] .cooking-select-chip {
  background: #1e293b !important;
  border-color: var(--border) !important;
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .cooking-filter-chip.active,
html[data-theme="dark"] .cooking-pill.good,
html[data-theme="dark"] .cooking-select-chip.active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .cooking-pill.warning {
  background: #422006 !important;
  border-color: #92400e !important;
  color: #fde68a !important;
}

html[data-theme="dark"] .cooking-pill.danger {
  background: #3f1d24 !important;
  border-color: #7f1d1d !important;
  color: #fecaca !important;
}

html[data-theme="dark"] .cooking-action-card {
  background: #1e293b !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .cooking-action-card:hover,
html[data-theme="dark"] .cooking-action-card:focus {
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
  box-shadow: var(--shadow) !important;
}

html[data-theme="dark"] .cooking-action-card span:first-child,
html[data-theme="dark"] .cooking-empty-state .empty-icon,
html[data-theme="dark"] .cooking-number-dot {
  background: var(--accent-soft) !important;
  color: #bfdbfe !important;
}

/* Kochen-Screen: Rezeptbilder, Detailbereiche, Reihen und Linien */
html[data-theme="dark"] .cooking-recipe-image,
html[data-theme="dark"] .cooking-detail-image,
html[data-theme="dark"] .cooking-community-image {
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.2), transparent 42%),
    linear-gradient(145deg, #1e293b, var(--card)) !important;
}

html[data-theme="dark"] .cooking-detail-panel {
  background: #1e293b !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .cooking-ingredient-row,
html[data-theme="dark"] .cooking-step-row,
html[data-theme="dark"] .cooking-plan-row {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .cooking-check-row {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .cooking-mode-step {
  background: linear-gradient(145deg, #1e293b, var(--card)) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .cooking-progress {
  background: #334155 !important;
}

/* Die KI-Card ist bereits dunkel; nur an das bestehende Dark Theme angleichen. */
html[data-theme="dark"] .cooking-ai-card {
  background: #0b1220 !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .cooking-ai-card textarea {
  background: #1e293b !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

/* ================================
   ONBOARDING / KONTO / PROFIL
   ================================ */
#authLoadingScreen,
#onboardingScreen,
#accountScreen {
  align-items: stretch;
  justify-content: center;
  overflow-y: auto;
  padding: 0 16px;
  background: #f6f7f2;
}

.auth-loading-card {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: #374151;
}

.auth-loader {
  width: 48px;
  height: 48px;
  border: 5px solid #dcfce7;
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: auth-spin 0.8s linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

.auth-shell {
  width: min(520px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(30px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.onboarding-shell {
  justify-content: center;
}

.auth-brand-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background: #dcfce7;
  color: #14532d;
  font-size: 2.2rem;
  box-shadow: 0 16px 32px rgba(47, 133, 90, 0.13);
}

.auth-brand-icon.small {
  width: 54px;
  height: 54px;
  border-radius: 19px;
  font-size: 1.4rem;
}

.auth-heading,
.auth-view-header {
  display: grid;
  gap: 9px;
}

.auth-heading h1,
.auth-view-header h2,
.auth-confirm-card h2 {
  margin: 0;
  color: #111827;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.auth-heading h1 {
  font-size: clamp(2.45rem, 10vw, 4.2rem);
}

.auth-view-header h2,
.auth-confirm-card h2 {
  font-size: clamp(2rem, 8vw, 3rem);
}

.auth-heading p,
.auth-view-header p,
.auth-confirm-card p,
.auth-privacy-note,
.auth-supporting-text {
  margin: 0;
  color: #64748b;
  line-height: 1.5;
}

.auth-kicker {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-signed-in-badge {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  align-self: flex-start;
  width: fit-content;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #e6f8ed;
  color: #22784f;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.035em;
}

.auth-signed-in-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #218452;
}

.onboarding-benefits {
  display: grid;
  gap: 10px;
}

.onboarding-benefits > div {
  min-height: 52px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 11px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(31, 41, 51, 0.05);
}

.onboarding-benefits span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-weight: 950;
}

.onboarding-benefits strong {
  color: #1f2937;
  line-height: 1.3;
}

.auth-primary-actions,
.auth-confirm-actions,
.auth-card-actions,
.auth-form,
.auth-fields {
  display: grid;
  gap: 11px;
}

.auth-primary-actions button,
.auth-confirm-actions button,
.auth-card-actions button,
.auth-card-actions .auth-legal-link,
.auth-form > button,
.auth-submit-button {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
}

.auth-text-button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 9px 14px;
}

.auth-text-button:hover,
.auth-text-button:focus-visible {
  background: #f3f4f6;
  color: #111827;
  outline: none;
}

.auth-login-links {
  display: grid;
  gap: 2px;
}

.auth-privacy-note {
  font-size: 0.84rem;
  text-align: center;
}

#startModal .start-box {
  position: relative;
}

#startModal #startTitle {
  padding-inline: 56px;
}

.profile-button {
  position: absolute;
  z-index: 4;
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #1f2937;
  cursor: pointer;
  font: inherit;
  font-size: 1.08rem;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(31, 41, 51, 0.09);
}

.profile-button:hover,
.profile-button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 133, 90, 0.16);
  outline: none;
}

.profile-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-silhouette-icon {
  position: relative;
  display: block;
  width: 27px;
  height: 27px;
  color: currentColor;
}

.profile-silhouette-icon::before,
.profile-silhouette-icon::after {
  position: absolute;
  display: block;
  content: "";
  background: currentColor;
}

.profile-silhouette-icon::before {
  top: 1px;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translateX(-50%);
}

.profile-silhouette-icon::after {
  right: 2px;
  bottom: 2px;
  left: 2px;
  height: 14px;
  border-radius: 50% 50% 18% 18% / 72% 72% 24% 24%;
}

.auth-avatar .profile-silhouette-icon {
  width: 38px;
  height: 38px;
  color: currentColor;
}

.auth-avatar .profile-silhouette-icon::before {
  width: 13px;
  height: 13px;
}

.auth-avatar .profile-silhouette-icon::after {
  right: 3px;
  bottom: 3px;
  left: 3px;
  height: 20px;
}

.auth-card,
.auth-profile-card,
.auth-form-card,
.auth-transfer-card,
.auth-confirm-card {
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(31, 41, 51, 0.09);
  padding: 20px;
}

.auth-status-row,
.auth-profile-summary {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 24px;
  background: #dcfce7;
  color: #14532d;
  font-size: 1.45rem;
  font-weight: 950;
}

.auth-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-status-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.auth-status-copy strong {
  color: #111827;
}

.auth-status-copy span {
  color: #64748b;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.auth-profile-summary .auth-avatar {
  background: #eceef1;
  color: #475569;
}

.auth-profile-summary .auth-status-copy strong {
  font-size: 1.22rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.auth-profile-details {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.auth-detail-row {
  display: grid;
  grid-template-columns: 32px auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #edf2f7;
}

.auth-detail-row span {
  color: #64748b;
  font-size: 0.8rem;
}

.auth-detail-row strong {
  color: #111827;
  font-size: 0.88rem;
  text-align: end;
  overflow-wrap: anywhere;
  min-width: 0;
}

.auth-detail-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #f4f5f7;
}

.auth-detail-icon svg {
  width: 18px;
  height: 18px;
}

.auth-email-row {
  grid-template-columns: 32px minmax(0, 1fr) max-content;
  column-gap: 8px;
}

.auth-email-row strong {
  font-size: clamp(0.56rem, 3vw, 0.75rem);
  letter-spacing: -0.025em;
  white-space: nowrap;
  overflow-wrap: normal;
}

@media (max-width: 360px) {
  .auth-email-row {
    grid-template-columns: 28px minmax(0, 1fr) max-content;
    column-gap: 6px;
  }

  .auth-email-row .auth-detail-icon {
    width: 28px;
    height: 28px;
  }

  .auth-email-row > span:nth-child(2) {
    font-size: 0.72rem;
  }
}

.auth-card-actions .auth-logout-button,
.auth-card-actions .auth-delete-account-button {
  padding: 12px 14px;
  font: inherit;
  cursor: pointer;
  border: 1px solid #e2e5e9;
}

.auth-card-actions .auth-logout-button {
  background: #f8f9fb;
  color: var(--ios-action-red);
}

.auth-card-actions .auth-delete-account-button {
  background: #f8f9fb;
  color: var(--ios-action-red);
}

.auth-card-actions .auth-logout-button:focus-visible,
.auth-card-actions .auth-delete-account-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

html[data-theme="dark"] .auth-signed-in-badge {
  background: #163b2b;
  color: #86efac;
}

html[data-theme="dark"] .auth-signed-in-badge::before {
  background: #4ade80;
}

html[data-theme="dark"] .auth-detail-icon,
html[data-theme="dark"] .auth-card-actions .auth-logout-button {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

html[data-theme="dark"] .auth-card-actions .auth-delete-account-button {
  background: #3f1d24;
  border-color: #7f1d1d;
}

.auth-development-note {
  border: 1px solid #fde68a;
  border-radius: 16px;
  background: #fffbeb;
  color: #92400e;
  padding: 11px 13px;
  font-size: 0.84rem;
  line-height: 1.4;
}

.auth-field {
  display: grid;
  gap: 7px;
  color: #374151;
  font-weight: 850;
}

.auth-field input {
  width: 100%;
  min-height: 49px;
  border: 1px solid #d1d5db;
  border-radius: 15px;
  background: #fbfcfa;
  color: #111827;
  padding: 12px 14px;
  font: inherit;
}

.auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 133, 90, 0.12);
  outline: none;
}

.auth-field-error,
.auth-form-message {
  min-height: 1.1em;
  color: #b91c1c;
  font-size: 0.82rem;
  font-weight: 750;
}

.auth-form-message.success {
  color: #166534;
}

.auth-password-hint {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
}

.auth-transfer-options {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.auth-data-summary {
  border-radius: 16px;
  background: #f0fdf4;
  color: #166534;
  padding: 12px 14px;
  line-height: 1.45;
}

.auth-bottom-back {
  align-self: center;
  margin-top: auto;
}

#accountRequiredModal,
#logoutConfirmModal,
#deleteAccountConfirmModal {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.46);
}

#accountRequiredModal.hidden,
#logoutConfirmModal.hidden,
#deleteAccountConfirmModal.hidden {
  display: none !important;
}

#accountRequiredModal .auth-confirm-card {
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
}

html:has(#accountRequiredModal:not(.hidden)),
body:has(#accountRequiredModal:not(.hidden)),
html:has(#logoutConfirmModal:not(.hidden)),
body:has(#logoutConfirmModal:not(.hidden)),
html:has(#deleteAccountConfirmModal:not(.hidden)),
body:has(#deleteAccountConfirmModal:not(.hidden)) {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.auth-confirm-card {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
}

.auth-logout-dialog {
  width: min(430px, 100%);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: clamp(20px, 5vw, 28px);
  border: 1px solid #e5e7eb;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  display: grid;
  gap: 24px;
}

.auth-logout-dialog .auth-view-header {
  gap: 16px;
}

.auth-logout-dialog .auth-signed-in-badge {
  padding: 8px 12px;
  font-size: 0.74rem;
}

.auth-logout-actions {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(31, 41, 51, 0.06);
}

.auth-logout-actions .auth-confirm-actions button {
  min-height: 54px;
  font: inherit;
  font-size: 1.08rem;
  cursor: pointer;
}

.auth-logout-confirm {
  border: 1px solid #dce2ea;
  background: #ffffff;
  color: #ff3b30;
}

.auth-logout-actions .primary {
  border: 0;
  background: linear-gradient(120deg, #138855, #159363);
  color: #ffffff;
  font-weight: 800 !important;
}

.auth-logout-actions .auth-form-message:empty {
  display: none;
}

html[data-theme="dark"] .auth-logout-dialog,
html[data-theme="dark"] .auth-logout-actions,
html[data-theme="dark"] .auth-logout-confirm {
  background: #111827;
  border-color: #334155;
}

html[data-theme="dark"] .auth-logout-dialog h2 {
  color: #f8fafc;
}

html[data-theme="dark"] .auth-logout-dialog .auth-view-header p {
  color: #94a3b8;
}

html[data-theme="dark"] #authLoadingScreen,
html[data-theme="dark"] #onboardingScreen,
html[data-theme="dark"] #accountScreen {
  background: #0f172a !important;
}

html[data-theme="dark"] .auth-loading-card,
html[data-theme="dark"] .auth-heading h1,
html[data-theme="dark"] .auth-view-header h2,
html[data-theme="dark"] .auth-confirm-card h2,
html[data-theme="dark"] .auth-status-copy strong,
html[data-theme="dark"] .auth-detail-row strong,
html[data-theme="dark"] .onboarding-benefits strong {
  color: #f8fafc;
}

html[data-theme="dark"] .auth-heading p,
html[data-theme="dark"] .auth-view-header p,
html[data-theme="dark"] .auth-confirm-card p,
html[data-theme="dark"] .auth-privacy-note,
html[data-theme="dark"] .auth-supporting-text,
html[data-theme="dark"] .auth-status-copy span,
html[data-theme="dark"] .auth-detail-row span {
  color: #cbd5e1;
}

html[data-theme="dark"] .onboarding-benefits > div,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .auth-profile-card,
html[data-theme="dark"] .auth-form-card,
html[data-theme="dark"] .auth-transfer-card,
html[data-theme="dark"] .auth-confirm-card {
  background: #111827;
  border-color: #334155;
  color: #f8fafc;
}

html[data-theme="dark"] .profile-button {
  background: #1e293b;
  border-color: #475569;
  color: #f8fafc;
}

html[data-theme="dark"] .auth-field {
  color: #e2e8f0;
}

html[data-theme="dark"] .auth-field input {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .auth-detail-row {
  border-color: #334155;
}

html[data-theme="dark"] .auth-development-note {
  background: #422006;
  border-color: #92400e;
  color: #fde68a;
}

html[data-theme="dark"] .auth-data-summary {
  background: #123225;
  color: #bbf7d0;
}

html[data-theme="dark"] .auth-text-button:hover,
html[data-theme="dark"] .auth-text-button:focus-visible {
  background: #1e293b;
  color: #f8fafc;
}

@media (max-width: 520px) {
  #authLoadingScreen,
  #onboardingScreen,
  #accountScreen {
    padding-inline: 14px;
  }

  .auth-shell {
    padding-top: max(22px, env(safe-area-inset-top));
  }

  .auth-heading h1 {
    font-size: clamp(2.35rem, 13vw, 3.35rem);
  }

  .profile-button {
    top: 14px;
    right: 14px;
    width: 46px;
    height: 46px;
  }

  #startModal #startTitle {
    padding-inline: 48px;
  }

}

/* Onboarding / Erststart – neues Welcome-Layout ohne schwarze Ecken. */
#onboardingScreen {
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  background: #f6f7f2;
}

.onboarding-shell {
  width: min(480px, 100%);
  min-height: 100svh;
  justify-content: center;
  gap: 18px;
  padding-top: max(28px, env(safe-area-inset-top));
  padding-bottom: max(26px, env(safe-area-inset-bottom));
}

.onboarding-panel {
  width: 100%;
  display: grid;
  gap: 18px;
  padding: 22px 18px 24px;
  border-radius: 34px;
  background: #ffffff;
  border: 1px solid #e9ede5;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.06);
}

.onboarding-shell .auth-heading {
  gap: 12px;
}

.onboarding-shell .auth-kicker {
  color: #2f855a;
  font-size: 0.72rem;
  line-height: 1.25;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 900;
}

.onboarding-shell .auth-heading h1 {
  max-width: 100%;
  font-size: clamp(3.1rem, 11.5vw, 5.1rem);
  line-height: 0.94;
  letter-spacing: -0.075em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.onboarding-shell .auth-heading p {
  max-width: 430px;
  font-size: 1rem;
  line-height: 1.55;
  color: #64748b;
  text-wrap: pretty;
}

.onboarding-shell .onboarding-benefits {
  gap: 12px;
  margin-block: 2px 2px;
}

.onboarding-shell .onboarding-benefits > div {
  min-height: 86px;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid #e8ece7;
  background: #ffffff;
  box-shadow: none;
}

.onboarding-shell .onboarding-benefits span {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #e8f5ea;
  color: #1f8b57;
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
}

.onboarding-shell .onboarding-benefits strong {
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.3;
}

.onboarding-shell .auth-primary-actions {
  gap: 12px;
  margin-top: 6px;
}

.onboarding-shell .auth-primary-actions button {
  min-height: 62px;
  border-radius: 21px;
  font-size: 0.98rem;
  font-weight: 850;
}

#onboardingRegisterButton {
  background: linear-gradient(135deg, #2f8d58 0%, #309a5b 100%);
  color: #ffffff;
  border: 2px solid #2f8d58;
  box-shadow: 0 14px 32px rgba(47, 141, 88, 0.17);
}

#onboardingRegisterButton:hover,
#onboardingRegisterButton:focus-visible {
  background: linear-gradient(135deg, #28794a 0%, #2f8d58 100%);
  border-color: #28794a;
}

#continueAsGuestButton {
  background: #ffffff;
  color: #2f8d58;
  border: 2px solid #2f8d58;
  box-shadow: none;
}

#continueAsGuestButton:hover,
#continueAsGuestButton:focus-visible {
  background: #f5fcf7;
  border-color: #28794a;
  color: #28794a;
}

.onboarding-login-action {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  min-height: 40px;
  color: #667085;
  font-weight: 750;
  text-align: center;
  padding: 2px 8px;
  margin-top: 2px;
}

.onboarding-login-action strong {
  color: #2f8d58;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.onboarding-login-action:hover strong,
.onboarding-login-action:focus-visible strong {
  color: #226e43;
}

.onboarding-note-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  margin-top: 2px;
}

.onboarding-note-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e8f5ea;
  color: #2f8d58;
  font-size: 1.35rem;
  font-weight: 800;
  flex-shrink: 0;
}

.onboarding-shell .auth-privacy-note {
  width: 100%;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #64748b;
  text-wrap: pretty;
}

#onboardingScreen button:focus-visible {
  outline: 3px solid rgba(47, 141, 88, 0.22);
  outline-offset: 3px;
}

html[data-theme="dark"] #onboardingScreen {
  background: #0f172a;
}

html[data-theme="dark"] .onboarding-panel {
  background: #111827;
  border-color: #233143;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .onboarding-shell .auth-kicker {
  color: #86efac;
}

html[data-theme="dark"] .onboarding-shell .auth-heading h1,
html[data-theme="dark"] .onboarding-shell .onboarding-benefits strong {
  color: #f8fafc;
}

html[data-theme="dark"] .onboarding-shell .auth-heading p,
html[data-theme="dark"] .onboarding-shell .auth-privacy-note,
html[data-theme="dark"] .onboarding-login-action {
  color: #cbd5e1;
}

html[data-theme="dark"] .onboarding-shell .onboarding-benefits > div {
  background: #0f172a;
  border-color: #233143;
}

html[data-theme="dark"] .onboarding-shell .onboarding-benefits span,
html[data-theme="dark"] .onboarding-note-icon {
  background: #123225;
  color: #86efac;
}

html[data-theme="dark"] #onboardingRegisterButton {
  background: linear-gradient(135deg, #2f8d58 0%, #38a169 100%) !important;
  border-color: #4ade80 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] #continueAsGuestButton {
  background: #111827 !important;
  border-color: #4ade80 !important;
  color: #bbf7d0 !important;
}

html[data-theme="dark"] #continueAsGuestButton:hover,
html[data-theme="dark"] #continueAsGuestButton:focus-visible {
  background: #123225 !important;
  color: #dcfce7 !important;
}

html[data-theme="dark"] .onboarding-login-action strong,
html[data-theme="dark"] .onboarding-login-action:hover strong,
html[data-theme="dark"] .onboarding-login-action:focus-visible strong {
  color: #86efac;
}

@media (max-width: 520px) {
  .onboarding-panel {
    padding: 20px 16px 22px;
    border-radius: 30px;
  }

  .onboarding-shell .auth-heading h1 {
    font-size: clamp(2.85rem, 12vw, 4rem);
  }
}

@media (max-width: 430px) {
  .onboarding-shell {
    gap: 14px;
  }

  .onboarding-panel {
    gap: 16px;
    padding: 18px 15px 20px;
    border-radius: 28px;
  }

  .onboarding-shell .auth-kicker {
    font-size: 0.68rem;
    letter-spacing: 0.15em;
  }

  .onboarding-shell .auth-heading h1 {
    font-size: clamp(2.55rem, 11.4vw, 3.55rem);
  }

  .onboarding-shell .auth-heading p {
    font-size: 0.96rem;
  }

  .onboarding-shell .onboarding-benefits > div {
    min-height: 78px;
    gap: 14px;
    padding: 14px 15px;
    border-radius: 20px;
  }

  .onboarding-shell .onboarding-benefits span,
  .onboarding-note-icon {
    width: 42px;
    height: 42px;
    font-size: 1.45rem;
  }

  .onboarding-shell .auth-primary-actions button {
    min-height: 58px;
    border-radius: 19px;
  }
}

@media (max-width: 360px) {
  #onboardingScreen {
    padding-inline: 10px;
  }

  .onboarding-panel {
    padding: 16px 13px 18px;
    border-radius: 24px;
  }

  .onboarding-shell .auth-heading h1 {
    font-size: clamp(2.28rem, 11.2vw, 3rem);
  }

  .onboarding-shell .onboarding-benefits strong {
    font-size: 0.92rem;
  }

  .onboarding-note-row {
    gap: 11px;
  }
}

@media (max-height: 760px) {
  .onboarding-shell {
    justify-content: flex-start;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}


/* Erststart: Inhalte direkt auf dem Hintergrund, ohne äußere Karte. */
#onboardingScreen {
  width: 100% !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  padding: max(28px, 8.5dvh, env(safe-area-inset-top)) clamp(20px, 6.8vw, 32px) max(24px, env(safe-area-inset-bottom)) !important;
  background: radial-gradient(ellipse at 90% 0%, #eefaf3 0%, #f7fcf9 48%, #ffffff 100%) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain !important;
  -webkit-overflow-scrolling: touch;
}

#onboardingScreen .onboarding-shell {
  position: relative;
  width: min(480px, 100%);
  height: auto;
  min-height: 100%;
  max-height: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: visible;
}

#onboardingScreen .onboarding-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: none;
  min-height: 0;
  padding: 0;
  gap: clamp(18px, 2.8dvh, 28px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  box-sizing: border-box;
}

.onboarding-leaves {
  position: absolute;
  top: -40px;
  right: -18px;
  width: clamp(110px, 32vw, 165px);
  height: auto;
  opacity: 0.65;
  pointer-events: none;
}

#onboardingScreen .auth-heading {
  gap: 16px;
  min-width: 0;
}

#onboardingScreen .auth-kicker {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  max-width: 100%;
  padding: 10px 13px;
  border-radius: 999px;
  background: #dff6eb;
  color: #168852;
  font-size: clamp(0.58rem, 2.4vw, 0.72rem);
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: 0.11em;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

#onboardingScreen .auth-kicker::before {
  content: "";
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2eb773, #087d47);
}

#onboardingScreen .auth-heading h1 {
  font-size: clamp(2.25rem, 10.6vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

#onboardingScreen .auth-heading p {
  font-size: clamp(0.95rem, 4vw, 1.1rem);
  line-height: 1.4;
  color: #758097;
}

#onboardingScreen .onboarding-benefits {
  gap: 12px;
  min-width: 0;
  margin: 0;
}

#onboardingScreen .onboarding-benefits > div {
  min-height: 64px;
  height: auto;
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid #e7f1eb;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 22px rgba(36, 100, 66, 0.035);
}

#onboardingScreen .onboarding-benefits span {
  width: 44px;
  height: 44px;
  background: #e5f5eb;
}

#onboardingScreen .onboarding-benefits strong {
  font-size: clamp(0.87rem, 3.85vw, 1.05rem);
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

#onboardingScreen .auth-primary-actions {
  gap: 12px;
  margin-top: 0;
}

#onboardingScreen .auth-primary-actions button {
  min-height: 52px;
  height: auto;
  padding: 13px 16px;
  border-radius: 17px;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.3;
}

#onboardingScreen #continueAsGuestButton {
  background: transparent;
}

#onboardingScreen .onboarding-login-action {
  min-height: 36px;
  height: auto;
  padding: 4px 0;
  margin-top: 0;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
}

html[data-theme="dark"] #onboardingScreen {
  background: #0f172a !important;
}

html[data-theme="dark"] #onboardingScreen .auth-heading p {
  color: #cbd5e1;
}

html[data-theme="dark"] #onboardingScreen .auth-kicker {
  background: #123225;
  color: #86efac;
}

html[data-theme="dark"] #onboardingScreen .onboarding-benefits > div {
  background: #0f172a;
  border-color: #233143;
}

html[data-theme="dark"] #onboardingScreen .onboarding-benefits span {
  background: #123225;
}

#onboardingScreen::-webkit-scrollbar {
  display: none;
}

@media (max-height: 620px) {
  #onboardingScreen {
    padding-top: max(24px, env(safe-area-inset-top)) !important;
  }

  #onboardingScreen .onboarding-panel {
    gap: 18px;
  }
}

@media (orientation: landscape) and (max-height: 600px) and (min-width: 600px) {
  #onboardingScreen .onboarding-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "heading benefits"
      "actions benefits"
      "login login";
    align-items: center;
    column-gap: 24px;
    row-gap: 16px;
  }

  #onboardingScreen .auth-heading { grid-area: heading; }
  #onboardingScreen .onboarding-benefits { grid-area: benefits; }
  #onboardingScreen .auth-primary-actions { grid-area: actions; }
  #onboardingScreen .onboarding-login-action { grid-area: login; }

  #onboardingScreen .auth-heading h1 {
    font-size: 2.15rem;
  }

  #onboardingScreen .auth-kicker {
    border-radius: 18px;
    font-size: 0.6rem;
  }
}

/* Mehrsprachigkeit, lange Beschriftungen und RTL. */
.settings-language-help {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.4;
}

.settings-card-description {
  margin: -4px 0 14px;
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.45;
}

.currency-mode-options {
  display: grid;
  gap: 9px;
}

.currency-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 58px;
  padding: 12px;
  border: 1px solid #dbe3dc;
  border-radius: 16px;
  background: #fbfcfa;
  cursor: pointer;
}

.currency-mode-option:has(input:checked) {
  border-color: var(--accent);
  background: #f0fdf4;
  box-shadow: 0 0 0 2px rgba(47, 133, 90, 0.1);
}

.currency-mode-option input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.currency-mode-option input:focus-visible {
  outline: 3px solid rgba(47, 133, 90, 0.22);
  outline-offset: 3px;
}

.currency-mode-option span,
.currency-mode-option strong,
.currency-mode-option small {
  display: block;
  min-width: 0;
}

.currency-mode-option small {
  margin-top: 3px;
  color: #64748b;
  line-height: 1.35;
}

.currency-manual-select {
  margin-top: 13px;
}

.currency-manual-select.is-disabled {
  opacity: 0.62;
}

.currency-input-wrap {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.currency-input-wrap input {
  min-width: 0;
  border-start-end-radius: 0 !important;
  border-end-end-radius: 0 !important;
}

.currency-code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 58px;
  padding-inline: 10px;
  border: 1px solid #d1d5db;
  border-inline-start: 0;
  border-start-end-radius: 14px;
  border-end-end-radius: 14px;
  background: #eef6ed;
  color: #14532d;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.04em;
}

/* Einheitliches, einspaltiges Design für beide Formulare zur manuellen Ausgabenerfassung. */
.manual-expense-unified-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  min-width: 0;
}

#manualExpenseForm .manual-expense-unified-grid {
  margin: 18px 0 14px;
}

#shoppingManualExpenseForm .manual-expense-unified-grid {
  margin: 0;
}

.manual-expense-unified-grid > label {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.manual-expense-unified-grid input,
.manual-expense-unified-grid select,
.manual-expense-unified-grid textarea {
  width: 100%;
  min-width: 0;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 1rem;
  line-height: 1.25;
}

.manual-expense-unified-grid input,
.manual-expense-unified-grid select,
.manual-expense-unified-grid .app-select-trigger {
  min-height: 58px;
}

.manual-expense-unified-grid textarea {
  min-height: 114px;
  resize: vertical;
}

.manual-expense-unified-grid .app-select-trigger {
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 1rem;
}

.manual-expense-unified-grid .finance-field-error {
  margin-top: 0;
}

/* Leere Fehlermeldungszeilen dürfen keinen zusätzlichen Abstand erzeugen. */
.manual-expense-unified-grid .finance-field-error:empty {
  display: none;
  min-height: 0;
}

/* Datumswerte verwenden dieselbe Schriftstärke und denselben Schwarzton wie die Kategorieauswahl. */
#financeDate,
#shoppingExpenseDate {
  color: var(--text);
  font-weight: 850;
  -webkit-text-fill-color: var(--text);
  opacity: 1;
}

/* Betrag und Währung bilden in beiden manuellen Formularen ein gemeinsames Feld. */
.expense-amount-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  width: 100%;
  min-height: 58px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fbfcfa;
}

.expense-amount-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 133, 90, 0.12);
}

.expense-amount-input-wrap input,
.expense-amount-input-wrap input:focus {
  min-height: 56px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.expense-amount-input-wrap .currency-code-badge {
  align-self: stretch;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding-inline: 16px;
}

.finance-currency-amounts {
  display: grid;
  gap: 2px;
}

.finance-total-card strong.finance-currency-amounts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.12em 0.3em;
}

.finance-total-card strong.finance-currency-amounts > span {
  display: inline-block;
}

.finance-currency-note {
  margin-top: 6px;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.4;
}

html[data-theme="dark"] .settings-card-description,
html[data-theme="dark"] .currency-mode-option small,
html[data-theme="dark"] .finance-currency-note,
html[data-theme="dark"] .storage-status-card {
  color: #cbd5e1;
}

html[data-theme="dark"] .currency-mode-option {
  border-color: #334155;
  background: #111827;
}

html[data-theme="dark"] .currency-mode-option:has(input:checked) {
  border-color: #4ade80;
  background: #123225;
}

html[data-theme="dark"] .storage-status-card {
  border-color: #334155;
  background: #111827;
}

html[data-theme="dark"] .storage-alert {
  border-color: #f59e0b;
  background: #422006;
  color: #fef3c7;
}

html[data-theme="dark"] .storage-alert[data-level="error"] {
  border-color: #fb7185;
  background: #4c0519;
  color: #ffe4e6;
}

html[data-theme="dark"] .currency-code-badge {
  border-color: #475569;
  background: #1e293b;
  color: #bbf7d0;
}

html[dir="rtl"] .currency-code-badge {
  border-inline-start: 1px solid #d1d5db;
  border-inline-end: 0;
  border-radius: 14px 0 0 14px;
}

html[dir="rtl"] .currency-input-wrap input {
  border-radius: 0 14px 14px 0 !important;
}

html[data-theme="dark"] .settings-language-help {
  color: #cbd5e1;
}

html[dir="rtl"] body {
  direction: rtl;
}

html[dir="rtl"] .profile-button {
  right: auto;
  left: 18px;
}

html[dir="rtl"] .settings-switch-slider::before {
  left: auto;
  right: 4px;
}

html[dir="rtl"] .settings-switch input:checked + .settings-switch-slider::before {
  transform: translateX(-22px);
}

html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] .settings-row-main,
html[dir="rtl"] .auth-status-copy,
html[dir="rtl"] .item-main,
html[dir="rtl"] .finance-section-heading,
html[dir="rtl"] .cooking-app {
  text-align: start;
}

html[dir="rtl"] [data-directional-icon],
html[dir="rtl"] .cooking-fixed-back-button::before,
html[dir="rtl"] .paper-list-back-link::before,
html[dir="rtl"] .choice-skip::before,
html[dir="rtl"] .settings-back-button::before,
html[dir="rtl"] .auth-bottom-back::before,
html[dir="rtl"] [data-app-action="shopping-complete-back"]::before,
html[dir="rtl"] .shopping-run-actions .secondary[data-app-action="shopping-run-show-lists"]::before {
  transform: rotate(225deg);
}

button,
.choice-card,
.settings-row-title,
.settings-row-description,
.auth-supporting-text,
.finance-card-label {
  overflow-wrap: anywhere;
}

button,
.choice-card {
  height: auto;
  min-height: 44px;
  white-space: normal;
}

.cooking-fixed-back-button {
  min-height: 48px;
}

html.app-overlay-open,
body.app-overlay-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body.app-screen-open > header,
body.app-screen-open > main {
  visibility: hidden !important;
  pointer-events: none !important;
}

.start-modal[data-app-screen]:not(.hidden) {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  overflow-x: hidden !important;
  overscroll-behavior: none !important;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.start-modal:not([data-app-screen]):not(.hidden) {
  z-index: 80 !important;
  overscroll-behavior: none !important;
}

#shoppingChoiceModal.start-modal:not(.hidden) {
  background: #ffffff !important;
  overflow-y: auto !important;
}

#shoppingChoiceModal.start-modal:not(.hidden) .start-box {
  background: #ffffff;
  box-sizing: border-box;
}

:where(
  button,
  [role="button"],
  a[href],
  summary,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  input[type="checkbox"],
  input[type="radio"],
  .standard-shopping-check,
  .currency-mode-option,
  .receipt-scanner-auto,
  .shopping-run-product,
  .cooking-selection-row
) {
  -webkit-tap-highlight-color: transparent;
  background-clip: padding-box;
}

input[type="checkbox"],
input[type="radio"] {
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: none;
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  input[type="checkbox"]:focus-visible {
    border-radius: 5px;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  }

  input[type="radio"]:focus-visible {
    border-radius: 50%;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  }
}

@media (hover: none) and (pointer: coarse) {
  :where(
    button:not(:disabled),
    [role="button"],
    a[href],
    summary,
    input[type="button"]:not(:disabled),
    input[type="submit"]:not(:disabled),
    input[type="reset"]:not(:disabled),
    .standard-shopping-check,
    .currency-mode-option,
    .receipt-scanner-auto,
    .shopping-run-product,
    .cooking-selection-row
  ):active {
    filter: brightness(0.94);
  }
}

@media (max-width: 520px) {
  html[dir="rtl"] .profile-button {
    right: auto;
    left: 14px;
  }
}


/* ================================
   EINHEITLICHER SHOPPILOT-KALENDER
   Alle date-Inputs behalten intern ISO-Werte (YYYY-MM-DD). Die sichtbare
   Darstellung und sämtliche Kalendertexte folgen currentLanguage.
   ================================ */
input.shop-calendar-native {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  min-inline-size: 1px !important;
  min-block-size: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  pointer-events: none !important;
}

.shop-calendar-field {
  position: relative;
  width: 100%;
  min-width: 0;
}

.shop-calendar-trigger {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 11px 13px 11px 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fbfcfa;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: start;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.shop-calendar-trigger:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
  background: var(--card);
}

.shop-calendar-trigger:focus-visible,
.shop-calendar-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}

.shop-calendar-trigger:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.shop-calendar-trigger-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-calendar-trigger-placeholder {
  color: var(--muted);
  font-weight: 700;
}

.shop-calendar-trigger-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent-dark);
}

.shop-calendar-trigger-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shop-calendar-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.38);
  -webkit-backdrop-filter: blur(8px) saturate(0.94);
  backdrop-filter: blur(8px) saturate(0.94);
}

.shop-calendar-overlay[hidden] {
  display: none !important;
}

body.shop-calendar-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.shop-calendar-dialog {
  width: min(404px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 24px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 28px 75px rgba(15, 23, 42, 0.28);
}

.shop-calendar-header {
  position: sticky;
  top: 0;
  z-index: 5;
  /* Kein <header>-Element: App-Modi blenden globale header-Tags aus. */
  display: grid !important;
  visibility: visible !important;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 2px 0 10px;
  background: var(--card);
}

.shop-calendar-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.shop-calendar-period {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.shop-calendar-period-select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 6%, var(--card));
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: start;
  cursor: pointer;
}

.shop-calendar-period-select:hover,
.shop-calendar-period-select:focus-visible {
  border-color: var(--accent);
  outline: none;
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.shop-calendar-month-select {
  min-width: 110px;
}

.shop-calendar-year-select {
  width: 88px;
}

.shop-calendar-nav {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
  color: var(--accent-dark);
  font: inherit;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.shop-calendar-nav:hover:not(:disabled),
.shop-calendar-nav:focus-visible {
  border-color: var(--accent);
  outline: none;
  background: color-mix(in srgb, var(--accent) 15%, var(--card));
}

.shop-calendar-nav:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.shop-calendar-weekdays,
.shop-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.shop-calendar-weekdays {
  margin-bottom: 6px;
}

.shop-calendar-weekday {
  min-width: 0;
  padding: 4px 1px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-calendar-day-placeholder {
  min-height: 42px;
}

.shop-calendar-day {
  aspect-ratio: 1;
  min-width: 0;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.shop-calendar-day:hover:not(:disabled),
.shop-calendar-day:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  outline: none;
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
}

.shop-calendar-day.is-today {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  color: var(--accent-dark);
}

.shop-calendar-day.is-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 28%, transparent);
}

.shop-calendar-day:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}

.shop-calendar-nav-icon {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.16s ease;
}

/* In RTL-Sprachen zeigen die Pfeile weiterhin in die zeitlich richtige Richtung. */
html[dir="rtl"] .shop-calendar-nav-icon {
  transform: scaleX(-1);
}

html[data-theme="dark"] .shop-calendar-trigger {
  background: #172033;
  color: var(--text);
}

html[data-theme="dark"] .shop-calendar-trigger:hover:not(:disabled) {
  background: #1e293b;
}

html[data-theme="dark"] .shop-calendar-dialog {
  background: #111827;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

@media (max-width: 520px) {
  .shop-calendar-overlay {
    align-items: end;
    padding: 10px;
  }

  .shop-calendar-dialog {
    width: 100%;
    border-radius: 24px 24px 18px 18px;
    padding: 16px;
  }

  .shop-calendar-header {
    gap: 7px;
    margin-bottom: 10px;
  }

  .shop-calendar-period {
    gap: 6px;
  }

  .shop-calendar-period-select {
    min-height: 42px;
    padding: 8px;
    font-size: 0.86rem;
  }

  .shop-calendar-month-select {
    min-width: 0;
  }

  .shop-calendar-year-select {
    width: 78px;
  }

  .shop-calendar-day,
  .shop-calendar-day-placeholder {
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shop-calendar-trigger {
    transition: none;
  }
}


/* Shared shopping lists */
#sharedListScreen {
  z-index: 170;
  overflow-y: auto;
  background: #f7f9f6;
  padding: max(20px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.shared-list-shell {
  width: min(100%, 720px);
  min-height: calc(100dvh - 48px);
  margin: 0 auto;
}

.shared-list-app {
  display: grid;
  gap: 18px;
}

.shared-list-header,
.shared-list-panel,
.shared-list-join-card,
.shared-list-state-card {
  border: 1px solid #dfe5dd;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 38px rgba(31, 41, 51, 0.08);
}

.shared-list-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: start;
  gap: 12px;
  padding: 18px;
}

.shared-list-heading {
  min-width: 0;
}

.shared-list-kicker,
.shared-list-role {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 850;
}

.shared-list-heading h1 {
  margin: 8px 0 4px;
  font-size: clamp(1.65rem, 7vw, 2.35rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.shared-list-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.shared-list-icon-button,
.list-share-button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  border: 1px solid #dfe5dd;
  border-radius: 50%;
  background: #ffffff;
  color: var(--accent-dark);
  display: inline-grid;
  place-items: center;
  padding: 0;
  font: inherit;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.08);
}

.shared-list-icon-button:hover,
.shared-list-icon-button:focus-visible,
.list-share-button:hover,
.list-share-button:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: 3px solid color-mix(in srgb, var(--accent) 24%, transparent);
  outline-offset: 2px;
}

.shared-list-icon-button:disabled,
.list-share-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.shared-list-panel,
.shared-list-join-card,
.shared-list-state-card {
  padding: clamp(18px, 4vw, 26px);
}

.shared-list-state-card {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
}

.shared-list-state-card h2,
.shared-list-join-card h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.shared-list-state-card p,
.shared-list-join-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.shared-list-loader {
  width: 34px;
  height: 34px;
  margin: 0 auto 16px;
  border: 4px solid #dfe5dd;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

.shared-list-join-form,
.shared-list-add-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.shared-list-field {
  display: grid;
  gap: 7px;
  color: #374151;
  font-weight: 800;
}

.shared-list-field input,
.shared-list-add-form input,
.shared-list-item-text {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfd7cd;
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  padding: 11px 13px;
  font: inherit;
}

.shared-list-field input:focus,
.shared-list-add-form input:focus,
.shared-list-item-text:focus {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
  outline-offset: 1px;
}

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

.shared-list-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid #e3e8e1;
  border-radius: 12px;
  background: #fbfcfa;
}

.shared-list-item.done .shared-list-item-text {
  color: var(--muted);
  text-decoration: line-through;
}

.shared-list-item input[type="checkbox"] {
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--accent);
}

.shared-list-item-text {
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid #cfd7cd;
  border-radius: 0;
  background: transparent;
  padding: 7px 2px;
}

.shared-list-item-text:read-only {
  border-bottom-color: transparent;
}

.shared-list-delete-item {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #991b1b;
  display: inline-grid;
  place-items: center;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.shared-list-delete-item:hover,
.shared-list-delete-item:focus-visible {
  background: #fee2e2;
  outline: none;
}

.shared-list-empty {
  padding: 28px 16px;
  border: 1px dashed #cfd7cd;
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.shared-list-add-form {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 16px;
}

.shared-list-sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.shared-list-sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f59e0b;
}

.shared-list-sync-status[data-state="connected"] .shared-list-sync-dot {
  background: #22c55e;
}

.shared-list-sync-status[data-state="syncing"] .shared-list-sync-dot {
  background: #2563eb;
  animation: shared-list-sync-pulse 1.2s ease-in-out infinite;
}

.shared-list-sync-status[data-state="offline"] .shared-list-sync-dot {
  background: #f59e0b;
}

.shared-list-sync-status[data-state="error"] .shared-list-sync-dot {
  background: #dc2626;
}

.shared-list-shell {
  width: min(100%, 390px);
}

.shared-simple-list-view {
  width: 100%;
  max-width: 390px;
}

.shared-list-paper-card {
  min-height: min(760px, calc(100dvh - 48px));
}

.shared-list-paper-card .shared-list-items {
  display: grid;
  gap: 9px;
}

.shared-list-paper-card .shared-list-item,
.shared-list-paper-card .shared-list-new-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.shared-list-paper-card .shared-list-item input[type="checkbox"],
.shared-list-paper-card .shared-list-new-item input[type="checkbox"] {
  width: 11px;
  height: 11px;
  margin: 0;
  accent-color: #111827;
}

.shared-list-paper-card .shared-list-item-text,
.shared-list-paper-card .shared-list-new-item .paper-write-line {
  width: 100%;
  min-height: 18px;
  height: 18px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid #9ca3af;
  border-radius: 0;
  background: transparent;
  font-size: 0.9rem;
  line-height: 18px;
}

.shared-list-paper-card .shared-list-item.done .shared-list-item-text {
  color: var(--muted);
  text-decoration: line-through;
}

.shared-list-paper-card .paper-line-remove {
  width: 44px;
  height: 44px;
}

.shared-list-paper-card .shared-list-sync-status {
  justify-content: center;
  margin: 2px 0 0;
  text-align: left;
}

html[data-theme="dark"] .shared-list-paper-card .shared-list-item,
html[data-theme="dark"] .shared-list-paper-card .shared-list-new-item {
  border: 0;
  background: transparent;
}

@keyframes shared-list-sync-pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}

.saved-list-card .saved-list-summary {
  padding-right: 14px;
}

.saved-list-card .saved-list-title-row {
  min-height: 34px;
  padding-right: 122px;
}

.start-shopping-list-card .saved-list-title-row {
  padding-right: 80px;
}

.list-share-button {
  position: absolute;
  top: 10px;
  right: 52px;
  z-index: 2;
}

.saved-list-card .list-share-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

.saved-list-card .list-edit-button {
  right: 94px;
}

.start-shopping-list-card .start-shopping-list-button {
  padding-right: 14px;
}

.start-shopping-list-card .list-edit-button {
  right: 52px;
}

.saved-list-share-message {
  display: block;
  margin-top: 0.35rem;
  color: #b42318;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

html[data-theme="dark"] .saved-list-share-message {
  color: #fda29b;
}

.saved-list-share-message[data-state="success"] {
  color: #166534;
}

html[data-theme="dark"] .saved-list-share-message[data-state="success"] {
  color: #86efac;
}

.saved-list-shared-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 0.72rem;
  font-weight: 850;
}

.share-list-feedback {
  min-height: 0;
  margin-top: 8px !important;
  font-size: 0.78rem;
  line-height: 1.4;
}

.share-list-feedback:empty {
  display: none;
}

.share-list-feedback[data-state="success"] {
  color: #166534;
}

.share-list-feedback[data-state="error"] {
  color: #991b1b;
}

html[data-theme="dark"] #sharedListScreen {
  background: #0f172a;
}

html[data-theme="dark"] .shared-list-header,
html[data-theme="dark"] .shared-list-panel,
html[data-theme="dark"] .shared-list-join-card,
html[data-theme="dark"] .shared-list-state-card,
html[data-theme="dark"] .shared-list-icon-button,
html[data-theme="dark"] .list-share-button {
  background: #111827;
  border-color: #334155;
  color: #f8fafc;
}

html[data-theme="dark"] .shared-list-item {
  background: #172033;
  border-color: #334155;
}

html[data-theme="dark"] .shared-list-field {
  color: #e5e7eb;
}

html[data-theme="dark"] .shared-list-field input,
html[data-theme="dark"] .shared-list-add-form input,
html[data-theme="dark"] .shared-list-item-text {
  background: #1e293b;
  border-color: #475569;
  color: #f8fafc;
}

@media (max-width: 560px) {
  #sharedListScreen {
    padding-inline: 12px;
  }

  .shared-list-header {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    padding: 14px;
  }

  .shared-list-add-form {
    grid-template-columns: 1fr;
  }

  .shared-list-add-form button {
    width: 100%;
  }

}

/* Final modal visibility guard: must stay at the end of the CSS.
   Mobile #startModal rules use display:flex !important, so hidden also needs !important. */
.start-modal.hidden,
#startModal.start-modal.hidden,
#shoppingChoiceModal.start-modal.hidden,
#settingsPanel.start-modal.hidden,
#resetConfirmModal.start-modal.hidden,
#importPreviewModal.start-modal.hidden,
#startupRecoveryModal.start-modal.hidden,
#receiptScannerModal.start-modal.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


/* ShopPilot-Funktionsicons: eindeutige Zuordnung der bereitgestellten Bilddateien.
   Die bestehenden Icon-Container behalten Größe, Position, Radius und Klickfläche. */
:root {
  --shop-pilot-icon-plan: url("./assets/icons/shopping-plan.png");
  --shop-pilot-icon-shopping: url("./assets/icons/shopping-start.png");
  --shop-pilot-icon-finance: url("./assets/icons/finance-overview.png");
  --shop-pilot-icon-saved: url("./assets/icons/recipe-saved.png");
  --shop-pilot-icon-categories: url("./assets/icons/recipe-categories.png");
  --shop-pilot-icon-cooking: url("./assets/icons/cooking.png");
  --shop-pilot-icon-pantry: url("./assets/icons/recipe-pantry.png");
  --shop-pilot-icon-random: url("./assets/icons/recipe-random.png");
  --custom-icon-manual-plan: url("./assets/icons/custom-manual-plan.png");
  --custom-icon-auto-plan: url("./assets/icons/custom-auto-plan.png");
  --custom-icon-empty-expenses: url("./assets/icons/custom-empty-expenses.png");
  --custom-action-icon-edit: url("./assets/icons/custom-action-edit.png");
  --custom-action-icon-share: url("./assets/icons/custom-action-share.png");
  --custom-action-icon-delete: url("./assets/icons/custom-action-delete.png");
}

/* Vom Nutzer bereitgestellte Funktionssymbole. Die vorhandenen Containermaße
   bleiben unverändert; nur die bisher verwendeten Emoji/Glyphen werden ersetzt. */
.custom-feature-icon {
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 140% 140% !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  overflow: hidden;
}

.custom-feature-icon-manual {
  background-image: var(--custom-icon-manual-plan) !important;
}

.custom-feature-icon-auto {
  background-image: var(--custom-icon-auto-plan) !important;
}

.custom-feature-icon-expenses {
  background-image: var(--custom-icon-empty-expenses) !important;
}

.custom-action-icon {
  display: block;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}

.custom-action-icon-edit {
  background-image: var(--custom-action-icon-edit);
}

.custom-action-icon-share {
  background-image: var(--custom-action-icon-share);
}

.custom-action-icon-delete {
  background-image: var(--custom-action-icon-delete);
}

.list-edit-button .custom-action-icon,
.list-share-button .custom-action-icon,
.list-delete-button .custom-action-icon,
.shared-list-icon-button .custom-action-icon,
.shared-list-delete-item .custom-action-icon {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}

.paper-list-edit-icon.custom-action-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}


.shop-pilot-feature-icon {
  background-image: var(--shop-pilot-feature-icon) !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
  font-size: 0 !important;
  line-height: 0 !important;
  color: transparent !important;
  overflow: hidden;
}

/* Höhere Spezifität als die vorhandenen responsiven und Dark-Mode-Regeln,
   damit deren background-Kurzschreibweise nur die Hintergrundfarbe ändert. */
#startModal .choice-card .choice-icon.shop-pilot-feature-icon,
html .cooking-action-card > span.shop-pilot-feature-icon:first-child,
.finance-header-icon.shop-pilot-feature-icon {
  background-image: var(--shop-pilot-feature-icon) !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
}

#startModal .choice-card .choice-icon.shop-pilot-feature-icon {
  position: relative !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  background-color: #dcfce7 !important;
  background-image: none !important;
}

#startModal .choice-card .choice-icon.shop-pilot-feature-icon::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 24px;
  background: #ffffff;
}

#startModal .choice-card .choice-icon.shop-pilot-feature-icon::after {
  content: "";
  position: absolute;
  inset: 10px;
  background-image: var(--shop-pilot-feature-icon);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.shop-pilot-icon-plan { --shop-pilot-feature-icon: var(--shop-pilot-icon-plan); }
.shop-pilot-icon-shopping { --shop-pilot-feature-icon: var(--shop-pilot-icon-shopping); }
.shop-pilot-icon-finance { --shop-pilot-feature-icon: var(--shop-pilot-icon-finance); }
.shop-pilot-icon-saved { --shop-pilot-feature-icon: var(--shop-pilot-icon-saved); }
.shop-pilot-icon-categories { --shop-pilot-feature-icon: var(--shop-pilot-icon-categories); }
.shop-pilot-icon-cooking { --shop-pilot-feature-icon: var(--shop-pilot-icon-cooking); }
.shop-pilot-icon-pantry { --shop-pilot-feature-icon: var(--shop-pilot-icon-pantry); }
.shop-pilot-icon-random { --shop-pilot-feature-icon: var(--shop-pilot-icon-random); }

/* Koch-Icons: nur das eigentliche Symbol sichtbar machen und innerhalb der bestehenden grünen Fläche maximal vergrößern. */
html .cooking-action-card > span.shop-pilot-feature-icon:first-child {
  overflow: hidden !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
}

html .cooking-action-card > span.shop-pilot-icon-random.shop-pilot-feature-icon:first-child,
html .cooking-action-card > span.shop-pilot-icon-saved.shop-pilot-feature-icon:first-child,
html .cooking-action-card > span.shop-pilot-icon-categories.shop-pilot-feature-icon:first-child,
html .cooking-action-card > span.shop-pilot-icon-pantry.shop-pilot-feature-icon:first-child {
  background-color: #dcfce7 !important;
  background-size: 100% !important;
  background-position: center center !important;
}

/* Kategorien-Kachel optisch auf dieselbe Höhe wie "Zufälliges Rezept" bringen. */
html .cooking-action-card[data-cooking-action="show-categories"] > span.shop-pilot-feature-icon:first-child {
  transform: translateY(-10px);
}

html .cooking-action-card[data-cooking-action="show-categories"] > strong {
  transform: translateY(-10px);
}

/* Extra-große Funktionsicons auf dem Startscreen. */
#startModal .choice-card {
  gap: 10px !important;
}

@media (max-width: 640px) {
  #startModal .choice-card .choice-icon.shop-pilot-feature-icon::before {
    inset: 14px;
    border-radius: 22px;
  }

  #startModal .choice-card .choice-icon.shop-pilot-feature-icon::after {
    inset: 9px;
  }
}

@media (max-width: 430px) {
  #startModal .choice-card .choice-icon.shop-pilot-feature-icon::before {
    inset: 12px;
    border-radius: 20px;
  }

  #startModal .choice-card .choice-icon.shop-pilot-feature-icon::after {
    inset: 8px;
  }
}

@media (max-width: 430px) {
  #startModal .choice-card {
    gap: 8px !important;
  }
}



/* Finale kompakte Darstellung der Ausgabenliste auf kleinen Displays. */
@media (max-width: 640px) {
  #financeExpenseList {
    align-items: start;
  }

  #financeExpenseList .finance-expense-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    justify-content: start !important;
    min-height: 0 !important;
    height: auto !important;
    gap: 8px !important;
    padding: 12px 14px !important;
  }

  #financeExpenseList .finance-expense-main {
    display: block !important;
    flex: none !important;
    min-height: 0 !important;
    height: auto !important;
    width: 100% !important;
  }

  #financeExpenseList .finance-expense-amount {
    width: auto !important;
    margin: 2px 0 0 !important;
    line-height: 1.15 !important;
  }

  #financeExpenseList .finance-expense-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    align-self: start !important;
    justify-content: stretch !important;
    width: 100% !important;
    margin: 4px 0 0 !important;
    gap: 8px !important;
  }

  #financeExpenseList .finance-expense-actions button {
    width: 100% !important;
    min-height: 44px !important;
  }

  #financeExpenseList .finance-expense-actions button:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

/* Startscreen bleibt auch auf kurzen Smartphones vollständig erreichbar. */
@media (max-width: 600px) {
  #startModal.start-modal:not(.hidden) {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch;
  }

  #startModal .start-box {
    height: auto !important;
    min-height: 100dvh !important;
    max-height: none !important;
  }
}

/* Kassenzettel bleiben in der App und lassen sich jederzeit wieder schliessen. */
#receiptImageViewerModal.receipt-image-viewer-modal {
  z-index: 220 !important;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  background: rgba(15, 23, 42, 0.78) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.receipt-image-viewer-dialog {
  width: min(760px, 100%);
  height: min(900px, calc(100dvh - 24px));
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.38);
}

.receipt-image-viewer-header,
.receipt-image-viewer-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #ffffff;
}

.receipt-image-viewer-header {
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
}

.receipt-image-viewer-header h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(1.2rem, 4vw, 1.55rem);
  line-height: 1.2;
}

.receipt-image-viewer-icon-button {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #dbe2ea;
  border-radius: 50%;
  color: #111827;
  background: #f8fafc;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
}

.receipt-image-viewer-stage {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  background: #111827;
}

.receipt-image-viewer-stage img {
  display: block;
  width: min(100%, 720px);
  height: auto;
  min-height: 1px;
  margin: 0 auto;
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
}

.receipt-image-viewer-footer {
  justify-content: stretch;
  border-top: 1px solid #e2e8f0;
}

.receipt-image-viewer-footer button {
  width: 100%;
  min-height: 48px;
}

.receipt-image-viewer-dialog :is(button, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
}

/* Mehrere Währungen in den Kennzahlen immer zeilenweise darstellen. */
.finance-mini-stats strong.finance-currency-amounts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 2px;
}

.finance-mini-stats strong.finance-currency-amounts > span {
  display: block;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 600px) {
  #receiptImageViewerModal.receipt-image-viewer-modal {
    padding: 0;
  }

  .receipt-image-viewer-dialog {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .receipt-image-viewer-header {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .receipt-image-viewer-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* Einkauf planen: gleich grosse Auswahlkarten mit separat bedienbaren Infos. */
#shoppingChoiceModal .shopping-plan-grid {
  grid-auto-rows: 1fr;
  align-items: stretch;
}

#shoppingChoiceModal .shopping-plan-choice {
  position: relative;
  min-width: 0;
  min-height: 248px;
  isolation: isolate;
}

#shoppingChoiceModal .shopping-plan-choice:has(.shopping-plan-info-button[aria-expanded="true"]) {
  z-index: 3;
}

#shoppingChoiceModal .shopping-plan-choice .choice-card {
  height: 100%;
  min-height: 248px;
  padding: 17px 20px 18px;
  justify-content: flex-start;
  align-items: flex-start;
  background: #fbfcfa;
}

#shoppingChoiceModal .shopping-plan-choice .choice-card h3 {
  margin: 1px 0 5px;
  font-size: clamp(1.14rem, 4.9vw, 1.32rem);
  line-height: 1.16;
  letter-spacing: -0.025em;
}

#shoppingChoiceModal .shopping-plan-choice .choice-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

#shoppingChoiceModal .shopping-plan-art {
  display: block;
  width: 136px;
  height: 136px;
  flex: 0 0 136px;
  margin: -5px 0 3px -7px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

#shoppingChoiceModal .shopping-plan-art-manual {
  background-image: url("./assets/icons/shopping-plan-manual-v2.png");
}

#shoppingChoiceModal .shopping-plan-art-auto {
  background-image: url("./assets/icons/shopping-plan-auto-v2.png");
}

#shoppingChoiceModal .shopping-plan-info-button {
  position: absolute;
  top: 17px;
  right: 17px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 2px solid #9aabc0;
  border-radius: 50%;
  background: #fbfcfa;
  color: #8195ad;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

#shoppingChoiceModal .shopping-plan-info-button:hover,
#shoppingChoiceModal .shopping-plan-info-button[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

#shoppingChoiceModal .shopping-plan-info-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 3px;
}

#shoppingChoiceModal .shopping-plan-info {
  position: absolute;
  top: 55px;
  right: 14px;
  left: 14px;
  z-index: 3;
  margin: 0;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

#shoppingChoiceModal .shopping-plan-info[hidden] {
  display: none;
}

html[dir="rtl"] #shoppingChoiceModal .shopping-plan-info-button {
  right: auto;
  left: 17px;
}

@media (max-width: 360px) {
  #shoppingChoiceModal .shopping-plan-choice,
  #shoppingChoiceModal .shopping-plan-choice .choice-card {
    min-height: 258px;
  }
}

/* Profil bearbeiten: Bildauswahl und Name in einer gemeinsamen Karte. */
#accountScreen .auth-edit-header {
  gap: 13px;
  margin: 10px 0 6px;
}

#accountScreen .auth-edit-kicker {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: fit-content;
  gap: 9px;
  padding: 7px 13px;
  border-radius: 999px;
  background: #e4f7ee;
  color: #16855b;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

#accountScreen .auth-edit-kicker::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #169366;
}

#accountScreen .profile-edit-form {
  gap: 18px;
}

#accountScreen .profile-edit-card {
  padding: 20px;
}

#accountScreen .profile-edit-card h3 {
  margin: 0;
  color: #111827;
  font-size: 1.18rem;
  line-height: 1.2;
}

#accountScreen .profile-photo-picker {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 14px auto 18px;
}

#accountScreen .profile-photo-preview {
  display: grid;
  place-items: center;
  width: 152px;
  height: 152px;
  overflow: hidden;
  border-radius: 50%;
  background: #def7ec;
  color: #075c41;
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
}

#accountScreen .profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#accountScreen .profile-photo-remove {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  padding: 11px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #ffe9e7;
  color: var(--ios-action-red);
  box-shadow: 0 5px 15px rgba(156, 44, 32, 0.16);
  cursor: pointer;
}

#accountScreen .profile-photo-remove svg {
  width: 25px;
  height: 25px;
}

#accountScreen .profile-photo-remove:hover:not(:disabled) {
  background: #ffdad6;
}

#accountScreen .profile-photo-remove:disabled {
  opacity: 0.45;
  cursor: default;
}

html[data-theme="dark"] #accountScreen .profile-photo-remove {
  background: #4c2325 !important;
  color: #ff8a80 !important;
  border-color: #111827;
}

#accountScreen .profile-photo-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  gap: 10px;
  padding: 10px 16px;
  border: 0;
  border-radius: 15px;
  background: #e4f7ee;
  color: #09855d;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

#accountScreen .profile-photo-add svg {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
}

#accountScreen .profile-photo-add:hover,
#accountScreen .profile-photo-add:focus-visible {
  background: #d5f1e3;
}

#accountScreen .profile-photo-remove:focus-visible,
#accountScreen .profile-photo-add:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

#accountScreen .profile-edit-divider {
  height: 1px;
  margin: 27px 0 20px;
  background: #e5e7eb;
}

#accountScreen .profile-edit-card .auth-field input {
  min-height: 56px;
  background: #ffffff;
}

#accountScreen .profile-edit-card .auth-form-message:empty {
  min-height: 0;
}

#accountScreen .profile-edit-save {
  min-height: 58px;
  border-radius: 17px;
}

/* Profile overview: separate information cards and iOS-style action rows. */
#accountScreen:has(.auth-profile-header) {
  background: #f3f8fa;
}

#accountScreen .auth-shell:has(.auth-profile-header) {
  gap: 14px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

#accountScreen .auth-profile-header {
  gap: 9px;
  margin-bottom: 2px;
}

#accountScreen .auth-profile-card {
  border-color: #edf1f4;
  border-radius: 19px;
  background: #ffffff;
  box-shadow: 0 8px 25px rgba(36, 57, 72, 0.07);
}

#accountScreen .auth-profile-identity-card {
  padding: 16px;
}

#accountScreen .auth-profile-summary {
  gap: 17px;
}

#accountScreen .auth-profile-summary .auth-avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: #d9f5e9;
  color: #075a3e;
  font-size: 1.75rem;
}

#accountScreen .auth-profile-summary .auth-status-copy strong {
  font-size: 1.24rem;
}

#accountScreen .auth-profile-details-card {
  padding: 5px 16px;
}

#accountScreen .auth-profile-details {
  gap: 0;
  margin-top: 0;
}

#accountScreen .auth-detail-row,
#accountScreen .auth-email-row {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  min-height: 61px;
  padding: 9px 0;
  border-top: 0;
}

#accountScreen .auth-detail-row + .auth-detail-row {
  border-top: 1px solid #e9eef2;
}

#accountScreen .auth-detail-icon,
#accountScreen .auth-email-row .auth-detail-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f2f4f6;
  color: #66788f;
}

#accountScreen .auth-detail-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

#accountScreen .auth-detail-copy span {
  font-size: 0.75rem;
  line-height: 1.15;
}

#accountScreen .auth-detail-copy strong {
  font-size: 0.98rem;
  line-height: 1.2;
  text-align: start;
}

#accountScreen .auth-email-row strong {
  width: max-content;
  max-width: 100%;
  font-size: clamp(0.62rem, 3vw, 0.84rem);
  letter-spacing: -0.025em;
  white-space: nowrap;
}

#accountScreen .auth-profile-actions {
  gap: 11px;
  margin-top: 1px;
}

#accountScreen .auth-profile-actions .auth-profile-action {
  min-height: 56px;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-radius: 14px;
  text-align: start;
  font-size: 0.98rem;
  font-weight: 700;
  box-shadow: 0 5px 17px rgba(36, 57, 72, 0.06);
}

#accountScreen .auth-profile-actions .primary {
  border-color: #178b60;
  background: linear-gradient(110deg, #0b8558, #0f9a65);
  color: #ffffff;
}

#accountScreen .auth-profile-actions .auth-logout-button,
#accountScreen .auth-profile-actions .auth-delete-account-button {
  border-color: #edf1f4;
  background: #ffffff;
  color: var(--ios-action-red);
}

#accountScreen .auth-profile-actions .auth-action-icon {
  width: 25px;
  height: 25px;
}

#accountScreen .auth-profile-actions .auth-action-chevron {
  width: 17px;
  height: 17px;
  justify-self: end;
}

html[data-theme="dark"] #accountScreen .auth-profile-card,
html[data-theme="dark"] #accountScreen .auth-profile-actions .auth-logout-button,
html[data-theme="dark"] #accountScreen .auth-profile-actions .auth-delete-account-button {
  background: #111827;
  border-color: #334155;
}

html[data-theme="dark"] #accountScreen .auth-profile-summary .auth-avatar {
  background: #164c39;
  color: #a7f3d0;
}

/* Guest overview uses the same green identity and action language as the profile. */
#accountScreen:has(.auth-guest-header) {
  background: #ffffff;
}

#accountScreen .auth-guest-header {
  gap: 14px;
  margin-bottom: 2px;
}

#accountScreen .auth-guest-header .auth-signed-in-badge {
  padding: 7px 13px;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  background: #e0f8ed;
  color: #07875a;
}

#accountScreen .auth-guest-header h2 {
  font-weight: 900;
}

#accountScreen .auth-guest-card {
  padding: 18px;
  border-color: #e7ecf0;
  box-shadow: 0 12px 30px rgba(36, 57, 72, 0.06);
}

#accountScreen .auth-guest-card .auth-status-row {
  gap: 16px;
}

#accountScreen .auth-guest-card .auth-avatar {
  width: clamp(68px, 20vw, 96px);
  height: clamp(68px, 20vw, 96px);
  border-radius: 50%;
  background: #dff8ec;
  color: #096338;
}

#accountScreen .auth-guest-card .auth-status-copy {
  gap: 6px;
}

#accountScreen .auth-guest-card .auth-status-copy strong {
  font-size: 1.12rem;
  line-height: 1.25;
  font-weight: 800;
}

#accountScreen .auth-guest-card .auth-status-copy span {
  font-size: 0.98rem;
  line-height: 1.4;
}

#accountScreen .auth-guest-actions {
  gap: 14px;
}

#accountScreen .auth-guest-actions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 16px 24px;
  border: 1px solid #e7ecf0;
  border-radius: 18px;
  font: inherit;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: start;
  box-shadow: 0 10px 25px rgba(36, 57, 72, 0.06);
}

#accountScreen .auth-guest-actions .primary {
  border-color: #07875a;
  background: linear-gradient(110deg, #07875a, #009866);
  color: #ffffff;
}

#accountScreen .auth-guest-actions .secondary {
  background: #ffffff;
  color: #07875a;
}

#accountScreen .auth-guest-actions button:hover {
  filter: brightness(0.97);
}

#accountScreen .auth-guest-chevron {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
}

html[data-theme="dark"] #accountScreen .auth-guest-card {
  background: #111827;
  border-color: #334155;
}

html[data-theme="dark"] #accountScreen .auth-guest-card .auth-avatar {
  background: #164c39;
  color: #a7f3d0;
}

html[data-theme="dark"] #accountScreen .auth-guest-actions .primary {
  background: linear-gradient(110deg, #07875a, #009866) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] #accountScreen .auth-guest-actions .secondary {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #a7f3d0 !important;
}
