    /* --- Header (logotyp vänster, användarinfo höger) --- */
    header {
      height: var(--h-header);
      background: var(--glass-bg);
      border-bottom: 1px solid var(--border);
      color: var(--ink);
      padding: 0 12px 0 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      position: sticky;
      top: 0;
      z-index: 1000;
      backdrop-filter: saturate(180%) blur(16px);
      -webkit-backdrop-filter: saturate(180%) blur(16px);
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
      font-size: 0.98rem;
      font-weight: 700;
      letter-spacing: -0.02em;
      color: var(--ink);
    }

    /* logomark (berry + leaf) */
    .brand-mark {
      width: 26px; height: 26px;
      flex-shrink: 0;
      display: block;
    }

    .header-user {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      flex: 1;
      justify-content: flex-end;
    }
    #user-email {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 0.8rem;
      font-weight: 500;
      color: var(--ink-2);
    }
    #picker-code-badge {
      display: none;
      flex-shrink: 0;
      background: var(--primary) !important;
      color: #fff !important;
      padding: 4px 12px !important;
      border-radius: var(--radius-full) !important;
      font-weight: 800 !important;
      font-size: 0.92rem !important;
      letter-spacing: 2px !important;
      border: 1px solid var(--primary);
      font-variant-numeric: tabular-nums;
    }
    #picker-code-badge::before {
      content: "ID ";
      font-size: 0.62rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      opacity: 0.85;
    }
    .header-user button {
      background: transparent;
      border: 1px solid var(--border-strong);
      color: var(--ink-2);
      font-size: 0.76rem;
      font-weight: 600;
      padding: 6px 12px;
      min-height: 0;
      border-radius: var(--radius-full);
      cursor: pointer;
      transition: all 0.2s var(--ease-out);
      flex-shrink: 0;
      white-space: nowrap;
      -webkit-tap-highlight-color: transparent;
    }
    .header-user button:active { transform: scale(0.95); background: var(--surface-2); }

    /* --- Språkväljare i headern --- */
    .lang-switcher {
      position: relative;
      flex-shrink: 0;
    }
    .lang-switcher .lang-btn {
      padding: 4px 8px;
      font-size: 1.15rem;
      line-height: 1;
      border-radius: var(--radius-full);
      border: 1px solid var(--border-strong);
      background: transparent;
      cursor: pointer;
    }
    .lang-menu {
      display: none;
      position: absolute;
      top: calc(100% + 6px);
      right: 0;
      z-index: 1200;
      min-width: 150px;
      background: var(--surface);
      border: 1px solid var(--border-strong);
      border-radius: var(--radius-md);
      box-shadow: var(--shadow-lg, 0 8px 28px rgba(0,0,0,0.16));
      padding: 4px;
      overflow: hidden;
    }
    .lang-switcher.open .lang-menu { display: block; }
    .lang-menu .lang-menu-item {
      display: block;
      width: 100%;
      text-align: left;
      border: none;
      background: transparent;
      border-radius: var(--radius-sm);
      padding: 8px 10px;
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--ink);
      cursor: pointer;
      white-space: nowrap;
    }
    .lang-menu .lang-menu-item:hover { background: var(--surface-2); }
    .lang-menu .lang-menu-item.active {
      background: var(--primary-tint);
      color: var(--primary);
      font-weight: 700;
    }

    /* --- Offline Badge --- */
    .offline-badge {
      display: none;
      background: rgba(192,57,43,0.10);
      color: var(--danger);
      font-size: 0.55rem;
      font-weight: 700;
      padding: 2px 7px;
      border-radius: var(--radius-full);
      letter-spacing: 0.06em;
      text-transform: uppercase;
      border: 1px solid rgba(192,57,43,0.2);
    }
    body.offline .offline-badge { display: inline-flex; align-items: center; }

    /* Smal skärm: dölj e-posttext (kod + logga ut räcker), ge kartan plats */
    @media (max-width: 430px) {
      #user-email { display: none; }
    }

    /* --- Sync Bar --- */
    .sync-bar {
      display: none;
      background: rgba(197,138,30,0.12);
      color: #92670F;
      font-size: 0.8rem;
      font-weight: 600;
      padding: 9px 20px;
      text-align: center;
      cursor: pointer;
      border-bottom: 1px solid rgba(197,138,30,0.2);
      transition: background 0.2s var(--ease-out);
    }
    .sync-bar::before { content: '\21BB'; margin-right: 6px; font-weight: 800; }
    .sync-bar:active { background: rgba(197,138,30,0.2); }
    body.has-pending .sync-bar { display: block; }
    body.offline .sync-bar { display: none; }

    /* --- Bottom Navigation --- */
    nav {
      display: flex;
      height: calc(var(--h-nav) + env(safe-area-inset-bottom, 0px));
      background: var(--glass-bg);
      backdrop-filter: saturate(180%) blur(18px);
      -webkit-backdrop-filter: saturate(180%) blur(18px);
      border-top: 1px solid var(--border);
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 1000;
      padding-bottom: env(safe-area-inset-bottom, 0px);
      box-shadow: 0 -4px 20px rgba(20,35,25,0.05);
    }
    nav button {
      flex: 1;
      padding: 9px 2px 8px;
      background: none;
      border: none;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      font-size: 0.62rem;
      font-weight: 600;
      letter-spacing: -0.01em;
      color: var(--ink-3);
      position: relative;
      transition: color 0.2s var(--ease-out);
      -webkit-tap-highlight-color: transparent;
    }
    nav button .nav-icon {
      width: 24px; height: 24px;
      display: flex; align-items: center; justify-content: center;
      transition: transform 0.2s var(--ease-spring);
    }
    nav button .nav-icon svg {
      width: 23px; height: 23px;
      stroke: currentColor; fill: none;
      stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
    }
    nav button.active { color: var(--primary); }
    nav button.active .nav-icon { animation: navPop 0.32s var(--ease-spring); }
    nav button.active::before {
      content: '';
      position: absolute;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 26px; height: 3px;
      border-radius: 0 0 3px 3px;
      background: var(--primary);
    }
    nav button:active .nav-icon { transform: scale(0.88); }

    /* --- Page Structure --- */
    .page { display: none; max-width: var(--maxw); margin: 0 auto; }
    .page.active { display: block; animation: fadeInUp 0.32s var(--ease-out); }
    #page-add.active { display: block; max-width: none; animation: none; }
    .page-padded { padding: 18px 16px 24px; }

    /* --- Map (full-screen, no scroll) --- */
    #page-add {
      position: relative;
      height: calc(100vh - var(--h-header) - var(--h-nav));
      height: calc(100dvh - var(--h-header) - var(--h-nav));
      overflow: hidden;
    }
    body.page-add-active {
      overflow: hidden;
      position: fixed;
      width: 100%;
    }
    #pick-map {
      width: 100%; height: 100%;
      position: absolute; inset: 0;
      z-index: 1;
      background: var(--forest-50);
    }

    .map-hint {
      position: absolute;
      top: 12px;
      left: 12px;
      z-index: 520;
      font-size: 0.74rem;
      line-height: 1.25;
      color: var(--ink);
      background: var(--glass-bg);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      padding: 8px 14px;
      border-radius: var(--radius-lg);
      font-weight: 600;
      box-shadow: var(--shadow-md);
      pointer-events: none;
      max-width: calc(100% - 175px);
      border: 1px solid var(--border);
    }

    /* --- Bottom Sheet --- */
    .bottom-sheet {
      position: absolute;
      bottom: 0; left: 0; right: 0;
      z-index: 600;
      display: flex;
      flex-direction: column;
      /* Panelen växer med innehållet (full bredd, nere) så alla bär + anteckningar
         + spara-knapp alltid syns. Taket hindrar bara att den äter hela kartan. */
      max-height: 70%;
      background: var(--surface);
      border-radius: var(--radius-xl) var(--radius-xl) 0 0;
      box-shadow: 0 -10px 40px rgba(20,35,25,0.16);
      overflow: hidden;
      padding-bottom: env(safe-area-inset-bottom, 0px);
      border-top: 1px solid var(--border);
      touch-action: pan-y;
      will-change: transform;
    }
    .bottom-sheet.animating { transition: transform 0.35s var(--ease-out); }

    /* Diskret "dra mig"-hint: gummibandskänsla — dra ut (med motstånd),
       fjädra tillbaka, dra ut igen, tillbaka, vila. Relativt panelens viloläge
       (--rest-y) och riktning/styrka (--tug, signerad). */
    @keyframes sheetTug {
      0%   { transform: translateY(var(--rest-y, 0px)); animation-timing-function: cubic-bezier(.33,0,.2,1); }
      16%  { transform: translateY(calc(var(--rest-y, 0px) + var(--tug, 0px))); animation-timing-function: cubic-bezier(.34,1.5,.5,1); }
      38%  { transform: translateY(var(--rest-y, 0px)); animation-timing-function: cubic-bezier(.33,0,.2,1); }
      54%  { transform: translateY(calc(var(--rest-y, 0px) + var(--tug, 0px) * 0.85)); animation-timing-function: cubic-bezier(.34,1.5,.5,1); }
      76%  { transform: translateY(var(--rest-y, 0px)); }
      100% { transform: translateY(var(--rest-y, 0px)); }
    }
    .bottom-sheet.sheet-tug { animation: sheetTug 1.7s both; }
    /* Grön "grip-list" överst — enda som syns i ihopfällt läge */
    .sheet-grip {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      height: 34px;
      background: var(--primary);
      cursor: grab;
      touch-action: none;
    }
    .sheet-grip:active { cursor: grabbing; }
    .bottom-sheet-handle {
      width: 48px; height: 5px;
      background: #11150f;
      border-radius: var(--radius-full);
      pointer-events: none;
    }
    .bottom-sheet .page-padded {
      flex: 1 1 auto;
      min-height: 0;
      width: 100%;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding: 6px 18px 10px;
      max-width: 640px;
      margin: 0 auto;
    }
    /* Fast fot: Spara-knappen ligger utanför scroll-ytan så den alltid syns
       medan bärväljaren/anteckningar scrollar i den höjdbegränsade panelen. */
    .sheet-footer {
      flex-shrink: 0;
      width: 100%;
      max-width: 640px;
      margin: 0 auto;
      padding: 10px 18px calc(12px + env(safe-area-inset-bottom, 0px));
      border-top: 1px solid var(--border);
      background: var(--surface);
    }

    .form-group { margin-bottom: 16px; }
    .bottom-sheet .form-group { margin-bottom: 12px; }

    /* --- GPS Status (map overlay) — uppe till höger, bredvid hinten --- */
    .gps-status {
      position: absolute;
      top: 12px; right: 12px;
      z-index: 500;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      font-size: 0.76rem;
      font-weight: 600;
      color: var(--ink);
      padding: 8px 13px;
      border-radius: var(--radius-full);
      background: var(--glass-bg);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      transition: all 0.3s var(--ease-out);
      border: 1px solid var(--border);
      box-shadow: var(--shadow-sm);
    }
    .gps-dot {
      width: 8px; height: 8px;
      border-radius: 50%;
      background: var(--bark-400);
      transition: all 0.3s var(--ease-out);
    }
    .gps-dot.active {
      background: var(--success);
      box-shadow: 0 0 0 3px rgba(45,138,94,0.18);
    }

    /* --- Map GPS Buttons (höger, under GPS-chipet) --- */
    .map-gps-buttons {
      position: absolute;
      top: 60px; right: 12px;
      z-index: 500;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .map-gps-btn {
      width: 54px; height: 54px;
      border-radius: var(--radius-lg);
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--primary);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: var(--shadow-md);
      transition: all 0.22s var(--ease-out);
      -webkit-tap-highlight-color: transparent;
    }
    .map-gps-btn:active { transform: scale(0.92); }
    .map-gps-btn.gps-active { color: var(--success); border-color: rgba(45,138,94,0.3); }
    .map-gps-btn.gps-active svg { stroke: var(--success); }
    .map-gps-btn.gps-error { color: var(--danger); border-color: rgba(192,57,43,0.3); }
    .map-gps-btn.gps-error svg { stroke: var(--danger); }
    .map-gps-btn.hidden { display: none; }
    .map-gps-btn svg {
      width: 26px; height: 26px;
      stroke: currentColor; stroke-width: 2; fill: none;
      stroke-linecap: round; stroke-linejoin: round;
    }

    /* --- GPS person marker + saved pins --- */
    @keyframes gps-person-pulse {
      0% { transform: scale(1); opacity: 0.5; }
      70% { transform: scale(2.6); opacity: 0; }
      100% { transform: scale(2.6); opacity: 0; }
    }
    .gps-person-marker { filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3)); }
    .saved-pick-pin {
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--surface);
      border: 2px solid var(--surface);
      border-radius: 50% 50% 50% 0;
      transform: rotate(-45deg);
      width: 32px; height: 32px;
      box-shadow: 0 3px 8px rgba(20,35,25,0.3);
    }
    .saved-pick-pin .berry-icon {
      width: 20px; height: 20px;
      transform: rotate(45deg);
    }

