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

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

    :root {
      --bg: #F7F6F2;
      --surface: #FFFFFF;
      --card: #FFFFFF;
      --border: rgba(114, 47, 55, 0.15);
      --primary: #722F37;
      --primary-l: #9B4A54;
      --accent: #E5D5D8;
      --danger: #cf4f4f;
      --text: #2B1619;
      --muted: #722F37;
      --dim: #9B4A54;
      --shadow: 0 4px 16px rgba(114, 47, 55, 0.08);
      --font: 'Quicksand', sans-serif;
      --font-logo: 'Quicksand', sans-serif;
    }

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

    body::before {
      content: '';
      position: fixed;
      top: 0; left: 0; right: 0; height: 78vh;
      background: linear-gradient(
        to bottom,
        rgba(229, 213, 216, 0.92) 0%,
        rgba(229, 213, 216, 0.78) 24%,
        rgba(229, 213, 216, 0.52) 48%,
        rgba(229, 213, 216, 0.24) 68%,
        rgba(229, 213, 216, 0.08) 84%,
        rgba(229, 213, 216, 0.00) 100%
      );
      pointer-events: none;
      z-index: -1;
    }

    body::after {
      content: '';
      position: fixed;
      left: 0;
      right: 0;
      top: 36vh;
      height: 44vh;
      background: radial-gradient(ellipse at top, rgba(229, 213, 216, 0.14) 0%, rgba(229, 213, 216, 0) 68%);
      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(114, 47, 55, 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(114, 47, 55, .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: 28px;
      height: 28px;
      background-color: var(--primary);
      background-image: url('DESIGN/RED%20LOGO.png');
      background-repeat: no-repeat;
      background-position: center;
      background-size: 72%;
      border-radius: 8px;
      border: 1px solid rgba(114, 47, 55, 0.25);
      box-shadow: 0 4px 12px rgba(114, 47, 55, 0.22);
    }

    .app-logo-white {
      height: 30px;
      width: auto;
      display: block;
      background: #722F37;
      border-radius: 10px;
      padding: 5px 10px;
      box-shadow: 0 6px 18px rgba(114, 47, 55, 0.28);
    }

    .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(114, 47, 55, 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(114, 47, 55, .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, #722F37);
      -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(114, 47, 55, .35);
      box-shadow: 0 8px 24px rgba(114, 47, 55, 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(114, 47, 55, .2), rgba(155, 74, 84, .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(114, 47, 55, 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-logo)
    }

    .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(114, 47, 55, 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(114, 47, 55, 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(114, 47, 55, 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(114, 47, 55, 0.1);
      border-color: var(--border);
    }

    .zoom-btn.active {
      background: rgba(114, 47, 55, 0.15);
      color: var(--text);
      border-color: var(--border);
      box-shadow: 0 4px 12px rgba(114, 47, 55, 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, #722F37, #9B4A54);
      box-shadow: 0 8px 30px rgba(114, 47, 55, .5)
    }

    .fab-main:hover {
      transform: scale(1.08);
      box-shadow: 0 12px 40px rgba(114, 47, 55, .6)
    }

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

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

    .fab-export {
      width: 50px;
      height: 50px;
      background: linear-gradient(135deg, #722F37, #5A232A);
      box-shadow: 0 6px 24px rgba(114, 47, 55, .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-chapter-title {
      font-size: 11px;
      letter-spacing: .08em;
      text-transform: uppercase;
      font-weight: 800;
      color: var(--muted);
      margin: 16px 2px 8px;
    }

    .settings-panels-host {
      position: relative;
      flex: 1;
      min-height: 0;
      overflow: hidden;
      padding: 20px;
    }

    .settings-panel {
      position: absolute;
      inset: 20px;
      overflow-y: auto;
      transition: transform .32s cubic-bezier(.32, .72, 0, 1), opacity .22s ease;
      transform: translateX(0);
      opacity: 1;
    }

    .settings-subpanel {
      transform: translateX(100%);
      opacity: 0;
      pointer-events: none;
    }

    .settings-menu-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .settings-menu-item {
      width: 100%;
      padding: 16px 14px;
      border-radius: 14px;
      border: 1px solid var(--border);
      background: var(--card);
      box-shadow: var(--shadow);
      display: flex;
      align-items: center;
      justify-content: space-between;
      color: var(--text);
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
    }

    .settings-menu-item i {
      color: var(--muted);
      width: 16px;
      height: 16px;
    }

    .settings-subpanel-head {
      position: sticky;
      top: 0;
      z-index: 2;
      background: var(--bg);
      padding: 0 0 12px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .settings-sub-back {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      font-size: 18px;
      line-height: 1;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .settings-sub-title {
      font-size: 17px;
      font-weight: 800;
      color: var(--text);
    }

    .settings-subpanel-body {
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding-bottom: 20px;
    }

    .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(114, 47, 55, 0.1);
      border: 1px solid rgba(114, 47, 55, 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(114, 47, 55, 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(114, 47, 55, 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(114, 47, 55, 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(114, 47, 55, 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(114, 47, 55, 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(8px);
      -webkit-backdrop-filter: blur(8px);
      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;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      line-height: 1;
    }

    .sort-badge-label {
      line-height: 1;
    }

    .sort-badge-chevron {
      width: 0.95em;
      height: 0.95em;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .sort-badge-chevron svg {
      width: 100%;
      height: 100%;
      transition: transform .22s ease;
      transform-origin: 50% 50%;
    }

    .sort-badge.is-asc .sort-badge-chevron svg {
      transform: rotate(180deg);
    }

    .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(8px);
      -webkit-backdrop-filter: blur(8px);
      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(43, 22, 25, 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(114, 47, 55, .4);
      border-radius: 18px;
      padding: 36px 20px;
      text-align: center;
      background: rgba(114, 47, 55, .05);
      cursor: pointer;
      transition: all .3s;
      margin-bottom: 16px
    }

    .upload-zone:hover {
      border-color: rgba(114, 47, 55, .8);
      background: rgba(114, 47, 55, .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, #722F37, #9B4A54);
      color: #fff;
      font-family: var(--font-logo);
      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-logo);
      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-logo);
      transition: all .2s
    }

    /* Logout confirm action should follow Tecera DA */
    #btnConfirmLogout {
      background: linear-gradient(135deg, #722F37, #9B4A54);
      color: #fff;
      border: none;
      box-shadow: 0 8px 22px rgba(114, 47, 55, .35);
    }

    /* 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(114, 47, 55, .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-logo);
      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-logo);
      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
    }

    .modern-select {
      width: 100%;
      height: 52px;
      border: 1px solid var(--border);
      border-radius: 14px;
      background-color: rgba(255, 255, 255, 0.86);
      color: var(--text);
      box-shadow: 0 6px 18px rgba(114, 47, 55, 0.07);
      padding: 0 44px 0 14px;
      font-size: 15px;
      font-weight: 600;
      font-family: var(--font-logo);
      -webkit-appearance: none;
      appearance: none;
      background-image:
        linear-gradient(45deg, transparent 50%, rgba(43, 22, 25, 0.85) 50%),
        linear-gradient(135deg, rgba(43, 22, 25, 0.85) 50%, transparent 50%);
      background-position:
        calc(100% - 18px) 22px,
        calc(100% - 12px) 22px;
      background-size: 6px 6px, 6px 6px;
      background-repeat: no-repeat;
      transition: border-color .2s, box-shadow .2s, background-color .2s;
    }

    .modern-select:focus {
      outline: none;
      border-color: var(--primary-l);
      box-shadow: 0 0 0 3px rgba(114, 47, 55, 0.10), 0 6px 18px rgba(114, 47, 55, 0.10);
      background-color: #fff;
    }

    .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(114, 47, 55, .12);
      color: var(--primary);
      font-size: 15px;
      line-height: 1;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-logo);
      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-logo);
      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-logo)
    }

    .btn-add-i {
      width: 100%;
      padding: 11px;
      background: rgba(114, 47, 55, .1);
      border: 1px dashed rgba(114, 47, 55, .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-logo)
    }

    .btn-add-i:hover {
      background: rgba(114, 47, 55, .2)
    }

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

    .btn-confirm:hover {
      transform: translateY(-2px);
      box-shadow: 0 12px 32px rgba(114, 47, 55, .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(8px);
      -webkit-backdrop-filter: blur(8px);
      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;
    }

    .data-preview-wrap {
      max-height: 54vh;
      overflow: auto;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--card);
      box-shadow: var(--shadow);
      scrollbar-width: thin;
      scrollbar-color: rgba(114, 47, 55, 0.35) rgba(114, 47, 55, 0.08);
    }

    .data-preview-wrap::-webkit-scrollbar {
      display: block;
      width: 8px;
      height: 8px;
    }

    .data-preview-wrap::-webkit-scrollbar-track {
      background: rgba(114, 47, 55, 0.08);
      border-radius: 999px;
    }

    .data-preview-wrap::-webkit-scrollbar-thumb {
      background: rgba(114, 47, 55, 0.35);
      border-radius: 999px;
    }

    .data-preview-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
      color: var(--text);
    }

    .data-preview-table thead th {
      position: sticky;
      top: 0;
      z-index: 2;
      background: rgba(247, 246, 242, 0.97);
      border-bottom: 1px solid var(--border);
      padding: 10px 8px;
      text-align: left;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: .05em;
      color: var(--muted);
    }

    .data-preview-table td {
      border-bottom: 1px solid rgba(114, 47, 55, 0.08);
      padding: 9px 8px;
      vertical-align: top;
    }

    .data-preview-table tbody tr:last-child td {
      border-bottom: none;
    }

    #mainView,
    #yearView,
    #settingsPage,
    .sheet,
    .chart-sheet,
    #annualDashSheet,
    .welcome-content,
    .slider-track {
      will-change: transform, opacity;
      backface-visibility: hidden;
      transform: translateZ(0);
    }

    .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(155, 74, 84, 0.35);
      border: 2px solid rgba(155, 74, 84, 0.55);
      box-shadow: 0 4px 14px rgba(43, 22, 25, 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: 32px;
      height: 32px;
      border-radius: 50%;
      border: none;
      cursor: pointer;
      padding: 0;
      flex-shrink: 0;
      box-shadow: 0 2px 8px rgba(43, 22, 25, 0.1);
      transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
    }
    
    .swatch-check {
      color: white;
      opacity: 0;
      transform: scale(0.5);
      transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
      width: 18px;
      height: 18px;
    }

    .rec-color-swatch.selected .swatch-check {
      opacity: 1;
      transform: scale(1);
    }

    .rec-color-swatch.selected {
      transform: scale(1.08);
      box-shadow: 0 4px 14px rgba(43, 22, 25, 0.2);
    }

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

    .chart-ttl-amt {
      font-size: 30px;
      font-weight: 800;
      background: linear-gradient(135deg, #722F37, #9B4A54);
      -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(43, 22, 25, 0.9);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid rgba(114, 47, 55, 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(43, 22, 25, 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, #722F37, #9B4A54);
      -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(114, 47, 55, 0.05);
      border: 2px solid rgba(114, 47, 55, 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(114, 47, 55, 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-logo);
      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: 10px;
      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: 4px;
      opacity: 0;
      transform: scale(0.58) translateY(12px);
    }

    #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, #722F37, #9B4A54);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      letter-spacing: -1px;
    }

    .welcome-logo-shell {
      width: 88px;
      height: 88px;
      border-radius: 24px;
      background: linear-gradient(145deg, #7D3440, #5F242C);
      box-shadow: 0 16px 36px rgba(114, 47, 55, 0.24);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .welcome-logo-white {
      width: 54px;
      height: 54px;
      object-fit: contain;
      filter: drop-shadow(0 2px 6px rgba(0,0,0,0.12));
    }

    .welcome-brand-letters {
      display: flex;
      gap: 1px;
      align-items: baseline;
      font-family: var(--font-logo);
      font-size: clamp(42px, 10vw, 56px);
      font-weight: 700;
      letter-spacing: -1px;
      color: var(--primary);
      line-height: 1;
      margin-top: 2px;
    }

    .welcome-brand-letters span {
      opacity: 0;
      transform: translateY(14px) scale(0.92);
      will-change: transform, opacity;
    }

    #welcomeScreen.welcome-active .welcome-brand-letters span {
      animation: welcomeLetterIn 0.56s cubic-bezier(.2, .85, .24, 1) forwards;
      animation-delay: calc(0.34s + var(--i) * 0.065s);
    }

    .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) translateY(0); }
    }

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

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