*,
    *::before,
    *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      scrollbar-width: none;
      /* Firefox */
    }

    *::-webkit-scrollbar {
      display: none;
      /* Chrome/Safari */
    }

    :root {
      --bg: #F5F7F5;
      --surface: #FFFFFF;
      --card: #FFFFFF;
      --border: rgba(127, 176, 105, 0.15);
      --primary: #7FB069;
      --primary-l: #9BC288;
      --accent: #E5A93B;
      --danger: #E07A5F;
      --text: #2D3A2D;
      --muted: #7A8E7A;
      --dim: #A1B5A1;
      --shadow: 0 4px 16px rgba(127, 176, 105, 0.08);
      --font: 'Inter', sans-serif;
    }

    html,
    body {
      height: 100%;
      overflow: hidden;
      background: var(--bg);
      color: var(--text);
      font-family: var(--font);
      -webkit-font-smoothing: antialiased;
      position: relative;
    }

    body::before {
      content: '';
      position: fixed;
      top: 0; left: 0; right: 0; height: 350px;
      background: linear-gradient(to bottom, #FFFFFF 0%, rgba(244, 247, 244, 0) 100%);
      pointer-events: none;
      z-index: -1;
    }

    #app {
      display: flex;
      flex-direction: column;
      height: 100vh;
      max-width: 480px;
      margin: 0 auto;
      position: relative;
      overflow: hidden
    }

    /* PULL TO REFRESH LOADER */
    #pullLoader {
      height: 0;
      overflow: hidden;
      display: flex;
      justify-content: center;
      align-items: center;
      background: var(--bg);
      transition: height 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .spinner {
      margin-top: 10px;
      margin-bottom: 6px;
      width: 24px;
      height: 24px;
      border: 3px solid rgba(127, 176, 105, 0.2);
      border-radius: 50%;
      border-top-color: var(--primary);
      animation: spin 0.8s linear infinite;
    }

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

    /* HEADER */
    .header {
      background: transparent;
      padding: 16px 20px 0;
      flex-shrink: 0;
      position: relative;
      z-index: 10;
    }

    .header::before {
      content: '';
      position: absolute;
      top: -50%;
      left: -50%;
      width: 200%;
      height: 200%;
      background: radial-gradient(circle at 70% 50%, rgba(127, 176, 105, .08) 0%, transparent 60%);
      pointer-events: none;
      z-index: -1;
    }

    .header-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 14px
    }

    .app-brand {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .brand-square {
      width: 24px;
      height: 24px;
      background: url('icon.jpg') center/cover no-repeat;
      border-radius: 6px;
      box-shadow: 0 4px 12px rgba(127, 176, 105, 0.4);
    }

    .app-title {
      font-size: 22px;
      font-weight: 800;
      color: var(--primary);
      letter-spacing: -0.5px;
    }

    .app-sub {
      font-size: 11px;
      color: var(--muted);
      margin-top: 1px
    }

    .month-nav {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: rgba(127, 176, 105, 0.08);
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      border-radius: 14px;
      padding: 10px 16px;
      margin-bottom: 12px;
    }

    .month-btn {
      background: none;
      border: none;
      color: var(--primary-l);
      font-size: 22px;
      cursor: pointer;
      width: 34px;
      height: 34px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      transition: background .2s
    }

    .month-btn:hover {
      background: rgba(127, 176, 105, .2)
    }

    .month-display {
      text-align: center;
      flex: 1
    }

    .month-name {
      font-size: 19px;
      font-weight: 700;
      color: var(--text);
      text-transform: capitalize
    }

    .month-stats {
      font-size: 12px;
      color: var(--muted);
      margin-top: 2px
    }

    /* STATS */
    .stats-bar {
      display: flex;
      gap: 10px;
      padding: 12px 16px;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      flex-shrink: 0
    }

    .stat-card {
      flex: 1;
      background: var(--card);
      border-radius: 12px;
      padding: 12px;
      border: 1px solid var(--border)
    }

    .stat-label {
      font-size: 9px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .5px;
      font-weight: 600
    }

    .stat-value {
      font-size: 21px;
      font-weight: 700;
      margin-top: 3px;
      background: linear-gradient(135deg, #2D3A2D, #7FB069);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text
    }

    .stat-sub {
      font-size: 11px;
      color: var(--dim);
      margin-top: 2px
    }

    /* ===================== SLIDER / CAROUSEL ===================== */
    .slider-viewport {
      flex: 1;
      overflow: hidden;
      position: relative;
      touch-action: pan-y;
    }

    .slider-track {
      display: flex;
      width: 300%;
      height: 100%;
      will-change: transform;
      transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    .slider-track.no-transition {
      transition: none;
    }

    .slide {
      width: calc(100% / 3);
      height: 100%;
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      flex-shrink: 0;
      transform: translateZ(0);
    }

    .slide-content {
      padding: 0 16px 100px;
    }

    @keyframes skeleton-pulse {
      0% {
        opacity: 1;
      }

      50% {
        opacity: 0.5;
      }

      100% {
        opacity: 1;
      }
    }

    /* #receiptList is now the slideCurrent element — no dedicated rule needed */

    .empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 60%;
      gap: 14px;
      text-align: center;
      padding: 24px
    }

    .empty-icon {
      font-size: 56px;
      opacity: .25
    }

    .empty-title {
      font-size: 18px;
      font-weight: 600;
      color: var(--dim)
    }

    .empty-text {
      font-size: 14px;
      color: var(--muted);
      line-height: 1.6
    }

    .receipt-card {
      background: var(--card);
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      border-radius: 16px;
      margin-bottom: 10px;
      overflow: hidden;
      transition: border-color .3s, box-shadow .3s;
    }

    .receipt-card:hover {
      border-color: rgba(127, 176, 105, .35);
      box-shadow: 0 8px 24px rgba(127, 176, 105, 0.15)
    }

    .receipt-header {
      padding: 14px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer
    }

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

    .r-icon {
      width: 40px;
      height: 40px;
      border-radius: 12px;
      background: linear-gradient(135deg, rgba(127, 176, 105, .2), rgba(155, 194, 136, .2));
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      flex-shrink: 0
    }

    .r-info {
      flex: 1;
      min-width: 0
    }

    .r-store {
      font-size: 15px;
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis
    }

    .r-date {
      font-size: 12px;
      color: var(--muted);
      margin-top: 2px
    }

    .r-right {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 3px
    }

    .r-total {
      font-size: 18px;
      font-weight: 700;
      color: var(--primary-l)
    }

    .r-count {
      font-size: 11px;
      color: var(--muted)
    }

    .r-chev {
      color: var(--muted);
      font-size: 13px;
      margin-left: 8px;
      transition: transform .3s;
      display: inline-block
    }

    .is-recurring-tag {
      font-size: 10px;
      margin-left: 6px;
      color: var(--primary);
    }

    @keyframes dopamine-entry {
      0% { opacity: 0; transform: translateY(40px) scale(0.93) rotateX(-10deg); }
      60% { opacity: 1; transform: translateY(-3px) scale(1.02) rotateX(0deg); }
      100% { opacity: 1; transform: translateY(0) scale(1); }
    }
    .dopamine-card {
      animation: dopamine-entry 0.65s cubic-bezier(0.2, 0.9, 0.2, 1) both;
    }

    .receipt-card.expanded .r-chev {
      transform: rotate(180deg)
    }

    .receipt-items {
      border-top: 1px solid var(--border);
      display: none
    }

    .receipt-card.expanded .receipt-items {
      display: block
    }

    .r-item {
      display: flex;
      align-items: center;
      padding: 9px 14px;
      border-bottom: 1px solid rgba(127, 176, 105, 0.08);
      gap: 8px
    }

    .r-item:last-child {
      border-bottom: none
    }

    .cat-badge {
      font-size: 8px;
      padding: 2px 6px;
      border-radius: 5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .4px;
      white-space: nowrap;
      flex-shrink: 0
    }

    .i-info {
      flex: 1;
      min-width: 0
    }

    .i-name {
      font-size: 13px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis
    }

    .i-qty {
      font-size: 11px;
      color: var(--muted)
    }

    .i-price {
      font-size: 14px;
      font-weight: 600;
      color: var(--dim);
      flex-shrink: 0
    }

    .r-actions {
      display: flex;
      gap: 10px;
      padding: 10px 14px;
      border-top: 1px solid var(--border)
    }

    .btn-del {
      flex: 1;
      padding: 8px;
      background: rgba(244, 63, 94, .1);
      border: 1px solid rgba(244, 63, 94, .2);
      color: var(--danger);
      border-radius: 10px;
      font-size: 13px;
      cursor: pointer;
      font-weight: 500;
      transition: background .2s;
      font-family: var(--font)
    }

    .btn-del:hover {
      background: rgba(244, 63, 94, .2)
    }

    /* FABs */
    .fab-wrap {
      position: fixed;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 100%;
      max-width: 480px;
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      padding: 0 24px 28px;
      pointer-events: none;
      z-index: 100
    }

    /* === ANNUAL DASHBOARD FAB === */
    .fab-annual-dashboard {
      pointer-events: all;
      position: relative;
      width: 76px;
      height: 76px;
      border: none;
      background: var(--surface);
      border-radius: 50%;
      box-shadow: 0 10px 30px rgba(127, 176, 105, 0.4);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
    }

    .fab-annual-dashboard:active {
      transform: scale(0.92);
      box-shadow: 0 4px 12px rgba(127, 176, 105, 0.3);
    }

    .fab-annual-dashboard svg.ring-bg,
    .fab-annual-dashboard svg.ring-fill {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      transform: rotate(-90deg);
      pointer-events: none;
    }

    .fab-annual-dashboard .ring-bg circle {
      fill: none;
      stroke: rgba(127, 176, 105, 0.15);
      stroke-width: 5;
    }

    .fab-annual-dashboard .ring-fill circle {
      fill: none;
      stroke: var(--primary);
      stroke-width: 5;
      stroke-linecap: round;
      stroke-dasharray: 283;
      /* 2 * PI * 45 ≈ 283 */
      stroke-dashoffset: 283;
      transition: stroke-dashoffset 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .fab-annual-dashboard .fab-icon {
      z-index: 2;
      color: var(--primary-d);
      margin-bottom: 2px;
      display: flex;
    }

    .fab-annual-dashboard .fab-text {
      z-index: 2;
      font-size: 10px;
      font-weight: 800;
      color: var(--primary-d);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    @keyframes dashboard-spin-in {
      0% {
        transform: rotate(-120deg) scale(0.6);
        opacity: 0;
      }

      100% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
      }
    }

    .zoomin .fab-annual-dashboard {
      animation: dashboard-spin-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }

    .zoom-btn {
      position: relative;
      background: none;
      border: 1.5px solid var(--border);
      color: var(--text);
      border-radius: 50%;
      width: 38px;
      height: 38px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .zoom-btn:hover {
      background: rgba(127, 176, 105, 0.1);
      border-color: var(--border);
    }

    .zoom-btn.active {
      background: rgba(127, 176, 105, 0.15);
      color: var(--text);
      border-color: var(--border);
      box-shadow: 0 4px 12px rgba(127, 176, 105, 0.2);
      transform: scale(1.05) translateY(-1px);
    }

    .zoom-btn.active::after {
      content: '';
      position: absolute;
      top: -3px;
      right: -3px;
      width: 10px;
      height: 10px;
      background: var(--accent);
      border: 2px solid #fff;
      border-radius: 50%;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .fab {
      pointer-events: all;
      border: none;
      cursor: pointer;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all .3s cubic-bezier(.34, 1.56, .64, 1);
      font-size: 24px
    }

    .fab:active {
      transform: scale(.9)
    }

    .fab-main {
      width: 66px;
      height: 66px;
      background: linear-gradient(135deg, #7FB069, #9BC288);
      box-shadow: 0 8px 30px rgba(127, 176, 105, .5)
    }

    .fab-main:hover {
      transform: scale(1.08);
      box-shadow: 0 12px 40px rgba(127, 176, 105, .6)
    }

    .fab-chart {
      width: 50px;
      height: 50px;
      background: linear-gradient(135deg, #06d6a0, #0891b2);
      box-shadow: 0 6px 24px rgba(6, 214, 160, .4)
    }

    .fab-chart:hover {
      transform: scale(1.08)
    }

    .fab-export {
      width: 50px;
      height: 50px;
      background: linear-gradient(135deg, #f59e0b, #ea580c);
      box-shadow: 0 6px 24px rgba(245, 158, 11, .4)
    }

    .fab-export:hover {
      transform: scale(1.08)
    }

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

    .settings-back-btn {
      flex-shrink: 0;
      position: relative;
      z-index: 2;
      min-width: 44px;
      min-height: 44px;
      padding: 0 10px;
      margin: -10px 0 -10px -12px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: none;
      background: transparent;
      color: var(--text);
      font-size: 22px;
      line-height: 1;
      cursor: pointer;
      border-radius: 10px;
      -webkit-tap-highlight-color: transparent;
    }

    .settings-back-btn:active {
      background: rgba(0, 0, 0, 0.07);
    }

    .rec-add-cat-amount-row {
      display: flex;
      gap: 8px;
      align-items: stretch;
      margin-bottom: 10px;
      min-width: 0;
      width: 100%;
      box-sizing: border-box;
    }

    .rec-add-cat-amount-row select {
      min-width: 0;
    }

    .rec-add-cat-amount-row input[type="number"] {
      flex: 0 0 96px;
      width: 96px;
      max-width: 96px;
      min-width: 0;
    }

    .s-title {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .s-desc {
      font-size: 13px;
      color: var(--muted);
      line-height: 1.5;
    }

    .action-icon {
      background: rgba(127, 176, 105, 0.1);
      border: 1px solid rgba(127, 176, 105, 0.2);
      color: var(--primary);
      width: 28px;
      height: 28px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .action-icon:hover {
      background: rgba(127, 176, 105, 0.2);
    }

    /* === ZOOM BUTTON === */
    .zoom-btn {
      width: 38px;
      height: 38px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--primary), var(--primary-l));
      border: none;
      color: white;
      font-size: 17px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 4px 14px rgba(127, 176, 105, 0.4);
      transition: all 0.25s cubic-bezier(.32, .72, 0, 1);
      flex-shrink: 0;
    }

    .zoom-btn:hover {
      transform: scale(1.08);
      box-shadow: 0 6px 20px rgba(127, 176, 105, 0.5);
    }

    .zoom-btn:active {
      transform: scale(0.94);
    }

    /* === YEAR VIEW === */
    #yearView {
      position: fixed;
      inset: 0;
      background: var(--bg);
      z-index: 150;
      display: none;
      flex-direction: column;
      overflow: hidden;
      transform-origin: center center;
    }

    #yearView.zoomin {
      animation: zoomInView 0.42s cubic-bezier(.32, .72, 0, 1) forwards;
    }

    #yearView.zoomout {
      animation: zoomOutView 0.38s cubic-bezier(.32, .72, 0, 1) forwards;
    }

    @keyframes zoomInView {
      from {
        opacity: 0;
        transform: scale(0.7);
      }

      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    @keyframes zoomOutView {
      from {
        opacity: 1;
        transform: scale(1);
      }

      to {
        opacity: 0;
        transform: scale(0.7);
      }
    }

    #mainView.zoom-shrink {
      animation: mainShrink 0.42s cubic-bezier(.32, .72, 0, 1) forwards;
    }

    #mainView.zoom-grow {
      animation: mainGrow 0.38s cubic-bezier(.32, .72, 0, 1) forwards;
    }

    @keyframes mainShrink {
      from {
        opacity: 1;
        transform: scale(1);
      }

      to {
        opacity: 0;
        transform: scale(1.12);
      }
    }

    @keyframes mainGrow {
      from {
        opacity: 0;
        transform: scale(1.12);
      }

      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    .year-header {
      background: var(--card);
      border-bottom: 1px solid var(--border);
      padding: 14px 20px 10px;
      flex-shrink: 0;
    }

    .year-stats-bar {
      display: flex;
      gap: 10px;
      padding: 12px 20px;
      flex-shrink: 0;
    }

    .year-stat-card {
      flex: 1;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 14px 12px;
      text-align: center;
      box-shadow: var(--shadow);
    }

    .year-stat-label {
      font-size: 11px;
      color: var(--muted);
      font-weight: 500;
      margin-bottom: 4px;
    }

    .year-stat-value {
      font-size: 18px;
      font-weight: 800;
      color: var(--text);
    }

    .year-stat-sub {
      font-size: 10px;
      color: var(--muted);
      margin-top: 2px;
    }

    .year-month-list {
      flex: 1;
      overflow-y: auto;
      padding: 12px 20px 100px;
    }

    .year-month-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 16px;
      margin-bottom: 10px;
      overflow: hidden;
      box-shadow: var(--shadow);
    }

    .year-month-header {
      display: flex;
      align-items: center;
      padding: 14px 16px;
      cursor: pointer;
      transition: background 0.2s;
    }

    .year-month-header:hover {
      background: rgba(127, 176, 105, 0.05);
    }

    .year-month-emoji {
      font-size: 20px;
      margin-right: 12px;
    }

    .year-month-name {
      flex: 1;
      font-weight: 700;
      font-size: 15px;
      color: var(--text);
    }

    .year-month-total {
      font-weight: 800;
      font-size: 15px;
      color: var(--text);
      margin-right: 10px;
    }

    .year-month-chev {
      font-size: 11px;
      color: var(--muted);
      transition: transform 0.25s;
    }

    .year-month-chev.open {
      transform: rotate(180deg);
    }

    .year-month-cat-list {
      display: none;
      flex-direction: column;
      padding: 4px 16px 14px;
      border-top: 1px solid var(--border);
      background: rgba(127, 176, 105, 0.03);
    }

    /* === ANNUAL DASHBOARD OVERLAY === */
    #annualDashOverlay {
      position: fixed;
      inset: 0;
      z-index: 350;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: flex-end;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #annualDashOverlay.active {
      display: flex;
      opacity: 1;
      pointer-events: auto;
    }

    #annualDashSheet {
      background: var(--surface);
      border-radius: 28px 28px 0 0;
      width: 100%;
      max-width: 480px;
      max-height: 88vh;
      overflow-y: auto;
      padding: 8px 0 40px;
      transform: translateY(100%);
      transition: transform 0.42s cubic-bezier(.32, .72, 0, 1);
      border-top: 1px solid var(--border);
    }

    #annualDashOverlay.active #annualDashSheet {
      transform: translateY(0);
    }

    .sort-badge {
      font-size: 10px;
      color: var(--primary);
      font-weight: 600;
      margin-right: 6px;
    }

    .cal-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 6px;
      margin-top: 14px;
    }

    .cal-day {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 6px 2px;
      text-align: center;
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-height: 48px;
      justify-content: center;
    }

    .cal-day.empty {
      background: transparent;
      border: none;
    }

    .cal-num {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
    }

    .cal-amt {
      font-size: 9px;
      font-weight: 700;
      color: var(--primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      padding: 0 1px;
    }

    .cal-amt.none {
      color: transparent;
    }

    .cal-header {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 6px;
      text-align: center;
      font-size: 11px;
      font-weight: 600;
      color: var(--muted);
      margin-top: 10px;
    }

    /* MODAL */
    .overlay {
      position: fixed;
      inset: 0;
      z-index: 300;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      display: none;
      align-items: center;
      justify-content: flex-end;
      flex-direction: column;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .overlay.active {
      display: flex;
      opacity: 1;
      pointer-events: auto;
    }

    .sheet {
      background: var(--surface);
      border-radius: 28px 28px 0 0;
      width: 100%;
      max-width: 480px;
      max-height: 92vh;
      overflow-y: auto;
      padding: 8px 20px 36px;
      transform: translateY(100%);
      transition: transform .4s cubic-bezier(.32, .72, 0, 1);
      border-top: 1px solid var(--border)
    }

    .overlay.active .sheet {
      transform: translateY(0)
    }

    .handle {
      width: 36px;
      height: 4px;
      background: rgba(45, 58, 45, 0.15);
      border-radius: 2px;
      margin: 12px auto 18px
    }

    .modal-title {
      font-size: 19px;
      font-weight: 700;
      margin-bottom: 18px
    }

    /* UPLOAD */
    .upload-zone {
      border: 2px dashed rgba(127, 176, 105, .4);
      border-radius: 18px;
      padding: 36px 20px;
      text-align: center;
      background: rgba(127, 176, 105, .05);
      cursor: pointer;
      transition: all .3s;
      margin-bottom: 16px
    }

    .upload-zone:hover {
      border-color: rgba(127, 176, 105, .8);
      background: rgba(127, 176, 105, .1)
    }

    .upload-icon {
      font-size: 44px;
      margin-bottom: 10px
    }

    .upload-txt {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 6px
    }

    .upload-sub {
      font-size: 13px;
      color: var(--muted)
    }

    .btn-row {
      display: flex;
      gap: 10px;
      margin-top: 4px
    }

    .btn-cam {
      flex: 1;
      padding: 14px;
      border-radius: 13px;
      font-size: 15px;
      font-weight: 600;
      cursor: pointer;
      border: none;
      background: linear-gradient(135deg, #7FB069, #9BC288);
      color: #fff;
      font-family: var(--font);
      transition: all .2s
    }

    .btn-gal {
      flex: 1;
      padding: 14px;
      border-radius: 13px;
      font-size: 15px;
      font-weight: 600;
      cursor: pointer;
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      background: var(--card);
      color: var(--text);
      font-family: var(--font);
      transition: all .2s
    }

    .btn-cam:hover,
    .btn-gal:hover,
    .btn-danger:hover {
      opacity: .85
    }

    .btn-danger {
      flex: 1;
      padding: 14px;
      border-radius: 13px;
      font-size: 15px;
      font-weight: 600;
      cursor: pointer;
      border: none;
      background: linear-gradient(135deg, var(--danger), #f28d72);
      color: #fff;
      font-family: var(--font);
      transition: all .2s
    }

    /* PREVIEW & LOADING */
    .preview-img {
      width: 100%;
      max-height: 220px;
      object-fit: contain;
      border-radius: 14px;
      margin-bottom: 14px;
      background: #FFFFFF !important
    }

    .loading {
      text-align: center;
      padding: 32px 20px
    }

    .spinner {
      width: 46px;
      height: 46px;
      border: 3px solid rgba(127, 176, 105, .2);
      border-top-color: var(--primary-l);
      border-radius: 50%;
      animation: spin .8s linear infinite;
      margin: 0 auto 14px
    }

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

    .loading-txt {
      font-size: 15px;
      color: var(--dim);
      font-weight: 500
    }

    .loading-sub {
      font-size: 13px;
      color: var(--muted);
      margin-top: 5px
    }

    /* FORM */
    .section-ttl {
      font-size: 11px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .5px;
      font-weight: 600;
      margin-bottom: 8px;
      margin-top: 16px
    }

    label.flabel {
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 5px;
      display: block
    }

    .finput {
      width: 100%;
      background: var(--card);
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      border-radius: 11px;
      padding: 11px 13px;
      color: var(--text);
      font-size: 14px;
      font-family: var(--font);
      transition: border-color .2s;
      -webkit-appearance: none;
      appearance: none;
    }

    .finput:focus {
      outline: none;
      border-color: var(--primary-l)
    }

    .fselect {
      width: 100%;
      background: var(--card);
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      border-radius: 11px;
      padding: 11px 13px;
      color: var(--text);
      font-size: 14px;
      font-family: var(--font);
      cursor: pointer;
      -webkit-appearance: none;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%23A1B5A1' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 13px center
    }

    .fselect option {
      background: #FFFFFF
    }

    .item-card {
      background: var(--card);
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      border-radius: 13px;
      padding: 12px;
      margin-bottom: 8px;
      position: relative
    }

    .item-card.has-reorder .item-grid,
    .item-card.has-reorder .item-line-total {
      margin-left: 36px
    }

    .item-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 7px
    }

    .item-grid .fw {
      grid-column: 1/-1
    }

    .item-line-total {
      text-align: right;
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid var(--border)
    }

    .btn-item-menu {
      position: absolute;
      top: 9px;
      left: 9px;
      width: 30px;
      height: 30px;
      border: none;
      border-radius: 8px;
      background: rgba(127, 176, 105, .12);
      color: var(--primary);
      font-size: 15px;
      line-height: 1;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font);
      z-index: 2
    }

    .item-reorder-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin: 0 0 10px 36px;
      padding: 6px 0 0 0
    }

    .item-reorder-bar[hidden] {
      display: none !important
    }

    .btn-item-move {
      flex: 1;
      min-width: 120px;
      padding: 8px 10px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--card);
      font-size: 13px;
      font-family: var(--font);
      cursor: pointer;
      color: var(--text)
    }

    .img-preview-hint {
      font-size: 13px;
      color: var(--muted);
      text-align: center;
      margin: 6px 12px 10px;
      flex-shrink: 0;
      line-height: 1.35
    }

    .img-zoom-outer {
      overflow: hidden;
      position: relative;
      flex: 1;
      min-height: 120px;
      display: flex;
      align-items: center;
      justify-content: center
    }

    .img-zoom-state-preview {
      max-height: 240px;
      touch-action: manipulation
    }

    .img-zoom-state-preview .img-zoom-target {
      max-height: 210px;
      width: auto;
      max-width: 100%
    }

    .img-zoom-state-expanded {
      min-height: 48vh;
      max-height: 78vh;
      touch-action: none
    }

    .img-zoom-state-expanded .img-zoom-target {
      max-height: min(76vh, 100%);
      max-width: 100%
    }

    .img-pan-wrapper {
      width: 100%;
      height: 100%;
      min-height: inherit;
      display: flex;
      align-items: center;
      justify-content: center;
      transform-origin: center center;
      will-change: transform
    }

    .img-zoom-target {
      object-fit: contain;
      border-radius: 12px;
      background: #fff !important;
      pointer-events: none;
      user-select: none;
      -webkit-user-drag: none
    }

    .btn-rm {
      position: absolute;
      top: 9px;
      right: 9px;
      background: rgba(244, 63, 94, .15);
      border: none;
      color: var(--danger);
      width: 24px;
      height: 24px;
      border-radius: 7px;
      cursor: pointer;
      font-size: 13px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font)
    }

    .btn-add-i {
      width: 100%;
      padding: 11px;
      background: rgba(127, 176, 105, .1);
      border: 1px dashed rgba(127, 176, 105, .4);
      border-radius: 11px;
      color: var(--primary-l);
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: all .2s;
      margin-top: 4px;
      font-family: var(--font)
    }

    .btn-add-i:hover {
      background: rgba(127, 176, 105, .2)
    }

    .btn-confirm {
      width: 100%;
      padding: 16px;
      background: linear-gradient(135deg, #7FB069, #9BC288);
      border: none;
      border-radius: 15px;
      color: #fff;
      font-size: 16px;
      font-weight: 700;
      cursor: pointer;
      transition: all .3s;
      box-shadow: 0 8px 24px rgba(127, 176, 105, .4);
      margin-top: 14px;
      font-family: var(--font)
    }

    .btn-confirm:hover {
      transform: translateY(-2px);
      box-shadow: 0 12px 32px rgba(127, 176, 105, .5)
    }

    .btn-confirm:active {
      transform: none
    }

    .err-box {
      background: rgba(244, 63, 94, .1);
      border: 1px solid rgba(244, 63, 94, .3);
      border-radius: 11px;
      padding: 12px 14px;
      color: #fda4af;
      font-size: 13px;
      margin-bottom: 14px
    }

    /* CHART OVERLAY (aligné qualité / flou sur le bilan annuel) */
    .chart-ov {
      position: fixed;
      inset: 0;
      z-index: 300;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-end;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .chart-ov.active {
      opacity: 1;
      pointer-events: auto;
    }

    .chart-sheet {
      background: var(--surface);
      border-radius: 28px 28px 0 0;
      width: 100%;
      max-width: 480px;
      max-height: 88vh;
      overflow-y: auto;
      padding: 8px 20px 36px;
      transform: translateY(100%) scale(0.96);
      transition: transform 0.42s cubic-bezier(.32, .72, 0, 1);
      border-top: 1px solid var(--border);
      transform-origin: bottom center;
      -webkit-font-smoothing: antialiased;
    }

    .chart-ov.active .chart-sheet {
      transform: translateY(0) scale(1);
    }

    .chart-title {
      font-size: 18px;
      font-weight: 700;
      text-align: center;
      margin-bottom: 6px
    }

    .chart-month {
      font-size: 13px;
      color: var(--muted);
      text-align: center;
      margin-bottom: 18px;
      text-transform: capitalize
    }

    .chart-wrap {
      position: relative;
      height: 210px;
      margin-bottom: 18px;
      transform: translateZ(0);
      backface-visibility: hidden;
    }

    .rec-emoji-preview {
      width: 48px;
      height: 48px;
      min-width: 48px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      line-height: 1;
      background: rgba(139, 157, 131, 0.35);
      border: 2px solid rgba(139, 157, 131, 0.55);
      box-shadow: 0 4px 14px rgba(45, 58, 45, 0.12);
    }

    .rec-color-swatches {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 10px 8px;
      justify-items: center;
      margin-bottom: 12px;
    }

    @keyframes drawPlusVert {
      0% { transform: scaleY(0); }
      100% { transform: scaleY(1); }
    }
    @keyframes drawMinusVert {
      0% { transform: scaleY(1); }
      100% { transform: scaleY(0); }
    }
    .loupe-vert {
      transform-origin: 11px 11px;
    }
    #yearView.zoomin .loupe-vert {
      animation: drawPlusVert 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }
    #mainView.zoom-grow .loupe-vert {
      animation: drawMinusVert 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }

    .rec-color-swatch {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      border: 2px solid rgba(255, 255, 255, 0.65);
      cursor: pointer;
      padding: 0;
      flex-shrink: 0;
      box-shadow: 0 2px 8px rgba(45, 58, 45, 0.12);
      transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease;
    }

    .rec-color-swatch.selected {
      transform: scale(1.12);
      box-shadow: 0 0 0 2px var(--surface), 0 2px 14px rgba(45, 58, 45, 0.22);
      border-color: var(--text);
    }

    .chart-ttl-box {
      text-align: center;
      margin-bottom: 16px
    }

    .chart-ttl-amt {
      font-size: 30px;
      font-weight: 800;
      background: linear-gradient(135deg, #7FB069, #9BC288);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text
    }

    .chart-ttl-lbl {
      font-size: 12px;
      color: var(--muted)
    }

    .cat-list {
      display: flex;
      flex-direction: column;
      gap: 7px
    }

    .cat-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 13px;
      background: var(--card);
      border-radius: 11px;
      border: 1px solid var(--border)
    }

    .cat-dot {
      width: 11px;
      height: 11px;
      border-radius: 50%;
      flex-shrink: 0
    }

    .cat-name {
      flex: 1;
      font-size: 14px;
      font-weight: 500
    }

    .cat-pct {
      font-size: 12px;
      color: var(--muted);
      font-weight: 500
    }

    .cat-amt {
      font-size: 15px;
      font-weight: 700;
      color: var(--primary-l)
    }

    /* TOAST */
    .toast {
      position: fixed;
      bottom: 108px;
      left: 50%;
      transform: translateX(-50%) translateY(16px);
      background: rgba(30, 45, 30, 0.9);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid rgba(127, 176, 105, 0.2);
      color: #fff;
      padding: 12px 24px;
      border-radius: 14px;
      font-size: 14px;
      font-weight: 600;
      z-index: 9999;
      opacity: 0;
      transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
      pointer-events: none;
      max-width: 340px;
      text-align: center;
      white-space: nowrap;
    }

    .toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    .toast.success {
      background: rgba(40, 70, 45, 0.95);
      border-color: var(--primary);
    }

    .toast.error {
      background: rgba(80, 30, 30, 0.95);
      border-color: #f43f5e;
    }

    input[type=number]::-webkit-inner-spin-button,
    input[type=number]::-webkit-outer-spin-button {
      -webkit-appearance: none;
      appearance: none;
    }

    /* PIN SCREEN */
    #pinScreen {
      position: fixed;
      inset: 0;
      background: var(--bg);
      z-index: 9999;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .pin-title {
      font-size: 24px;
      font-weight: 700;
      margin-bottom: 30px;
      background: linear-gradient(135deg, #7FB069, #9BC288);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .pin-display {
      display: flex;
      gap: 12px;
      margin-bottom: 40px;
      height: 16px;
      justify-content: center;
    }

    .pin-dot {
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: rgba(127, 176, 105, 0.05);
      border: 2px solid rgba(127, 176, 105, 0.4);
      transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .pin-dot.filled {
      background: var(--primary);
      border-color: var(--primary);
      box-shadow: 0 0 12px rgba(127, 176, 105, 0.5);
      transform: scale(1.2);
    }

    .pin-pad {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 20px;
      margin-bottom: 20px;
    }

    .pin-btn {
      width: 70px;
      height: 70px;
      border-radius: 50%;
      background: var(--card);
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      font-size: 26px;
      color: var(--text);
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      font-family: var(--font);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .pin-btn:active {
      background: var(--surface);
      transform: scale(0.9);
      border-color: var(--primary);
    }

    .pin-btn-empty {
      visibility: hidden;
    }

    .pin-err {
      color: var(--danger);
      font-size: 14px;
      height: 20px;
      font-weight: 500;
      text-align: center;
    }

    /* WELCOME SCREEN */
    #welcomeScreen {
      position: fixed;
      inset: 0;
      z-index: 9998;
      background: var(--bg);
      display: none;
      align-items: center;
      justify-content: center;
      flex-direction: column;
    }

    .welcome-content {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      opacity: 0;
      transform: scale(0.8) translateY(20px);
    }

    #welcomeScreen.welcome-active .welcome-content {
      animation: welcomeFadeIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
    }

    .welcome-icon {
      margin-bottom: 12px;
      opacity: 0;
      transform: scale(0.5) rotate(-15deg);
    }

    #welcomeScreen.welcome-active .welcome-icon {
      animation: welcomeIconIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
    }

    .welcome-text {
      font-size: 18px;
      color: var(--muted);
      font-weight: 500;
    }

    .welcome-brand {
      font-size: 42px;
      font-weight: 800;
      background: linear-gradient(135deg, #7FB069, #9BC288);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      letter-spacing: -1px;
    }

    .welcome-sub {
      font-size: 14px;
      color: var(--dim);
      margin-top: 4px;
    }

    #welcomeScreen.welcome-fade-out {
      animation: welcomeFadeOut 0.5s ease forwards;
    }

    @keyframes welcomeFadeIn {
      to { opacity: 1; transform: scale(1) translateY(0); }
    }

    @keyframes welcomeIconIn {
      to { opacity: 1; transform: scale(1) rotate(0deg); }
    }

    @keyframes welcomeFadeOut {
      to { opacity: 0; transform: scale(1.05); pointer-events: none; }
    }