/* app.css */



    :root {
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      color-scheme: dark;
    }
    * {
      box-sizing: border-box;
    }

    html, body {
      margin: 0;
      padding: 0;
      padding-right: 26px;
      width: 100%;
      max-width: 100%;
      overflow-x: hidden;
      touch-action: pan-y;
      background: #050508;
      color: #eee;
      -webkit-overflow-scrolling: touch;
    }

    #app-root {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      padding-top: max(0px, env(safe-area-inset-top));
      padding-bottom: max(0px, env(safe-area-inset-bottom));
    }

    .app-shell {
      max-width: 320px;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      width: 100%;
    }

    header {
      padding: 10px 12px;
      padding-top: max(10px, env(safe-area-inset-top));
      border-bottom: 1px solid #222;
      background: #050508;
      max-width: 100%;
      position: relative;
    }
    header h1 {
      margin: 0 0 4px;
      font-size: 17px;
      font-weight: 600;
    }
    header p {
      margin: 0;
      font-size: 12px;
      color: #aaa;
    }
	
	#header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

#header-title-block {
  display: flex;
  flex-direction: column;
}

/* Optional: tighten subtitle a bit in header */
#header-title-block p {
  margin-top: 2px;
}

    #status-line {
      margin-top: 4px;
      font-size: 12px;
      color: #7be57b;
    }

    /* ---------- Fish-scale group tabs ---------- */
    #group-tabs {
      margin-top: 6px;
      display: flex;
      gap: 0;
      overflow-x: auto;
      padding-bottom: 2px;
    }
    .group-tab {
      position: relative;
      padding: 3px 10px;
      font-size: 11px;
      background: #11121a;
      border: 1px solid #444;
      border-radius: 999px;
      margin-right: -10px; /* overlap -> fish-scale */
      cursor: pointer;
      white-space: nowrap;
      z-index: 1;
      color: #ddd;
      transition:
        transform 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease,
        opacity 0.15s ease;
    }
    .group-tab:first-child {
      margin-left: 0;
    }
    .group-tab.active {
      background: #2e7dff;
      border-color: #2e7dff;
      color: #fff;
      z-index: 2;
      transform: translateY(-1px);
    }

    /* dot for unread / new messages */
    .group-tab-badge {
      position: absolute;
      top: 2px;
      right: 4px;
      width: 6px;
      height: 6px;
      border-radius: 999px;
      background: #ff5c5c;
      box-shadow: 0 0 0 4px rgba(255, 92, 92, 0.2);
      opacity: 0;
      pointer-events: none;
    }
    .group-tab.tab-has-new .group-tab-badge {
      opacity: 1;
      animation: tabBadgePulse 1.3s ease-in-out infinite;
    }
    @keyframes tabBadgePulse {
      0%   { transform: scale(1);   box-shadow: 0 0 0 2px rgba(255,92,92,0.5); }
      50%  { transform: scale(1.2); box-shadow: 0 0 0 6px rgba(255,92,92,0.1); }
      100% { transform: scale(1);   box-shadow: 0 0 0 2px rgba(255,92,92,0.0); }
    }

    main {
      flex: 1;
      display: flex;
      flex-direction: column;
      padding: 8px 6px;
      padding-bottom: calc(90px + max(8px, env(safe-area-inset-bottom)));
      width: 100%;
      max-width: 100%;
      margin: 0;
    }

    #chat {
      flex: 1;
      overflow-y: auto;
      padding: 4px;
      border-radius: 10px;
      background: radial-gradient(circle at top, #151523 0, #050508 60%);
      max-width: 100%;
      -webkit-overflow-scrolling: touch;
    }

    .msg {
      margin: 6px 0;
      padding: 6px 8px;
      border-radius: 8px;
      background: rgba(15, 15, 25, 0.9);
      border: 1px solid rgba(80, 80, 120, 0.4);
    }
    .msg-meta {
      font-size: 11px;
      color: #aaa;
      margin-bottom: 4px;
    }
    .msg-body {
      font-size: 13px;
      line-height: 1.4;
      word-wrap: break-word;
    }

    .msg-image,
    .msg-video {
      display: block;
      max-width: 100%;
      width: 100%;
      border-radius: 10px;
      margin-top: 4px;
      margin-left: auto;
      margin-right: auto;
    }
    .msg-image {
      height: auto;
    }
    .msg-video {
      background: #000;
      object-fit: contain;
    }

    #bottom-bar {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      background: #050508;
      border-top: 1px solid #222;
      padding: 6px 8px;
      padding-bottom: max(8px, env(safe-area-inset-bottom));
      box-sizing: border-box;
      z-index: 999;
    }
    #bottom-inner {
      max-width: 320px;
      width: 100%;
      margin: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    #qr-buttons {
      display: flex;
      gap: 6px;
      justify-content: flex-start;
      margin-bottom: 2px;
      flex-wrap: wrap;
    }
    .qr-btn,
    #send-btn,
    #file-btn {
      border-radius: 999px;
      border: 1px solid #444;
      padding: 4px 8px;
      font-size: 16px;
      cursor: pointer;
      background: #11121a;
      color: #eee;
      white-space: nowrap;
      max-width: 100%;
      touch-action: manipulation;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .qr-btn:hover {
      background: #1b1c28;
    }
    .qr-btn:disabled {
      opacity: 0.4;
      cursor: default;
    }

    #input-row {
      display: flex;
      gap: 4px;
      align-items: center;
    }

    #text-input {
      flex: 1;
      min-width: 0;
      padding: 7px 10px;
      border-radius: 999px;
      border: 1px solid #444;
      background: #11121a;
      color: #eee;
      font-size: 16px !important;
      line-height: 1.2;
    }
    #send-btn,
    #file-btn {
      border: none;
      padding: 7px 10px;
      font-size: 16px;
      background: #2e7dff;
      color: white;
      flex-shrink: 0;
    }
    #file-btn {
      background: #333;
    }
    #send-btn:disabled {
      opacity: 0.4;
      cursor: default;
    }
    #file-input {
      display: none;
    }
    #meta-line {
      font-size: 10px;
      color: #777;
      margin-top: 4px;
      text-align: right;
    }

    #qr-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.8);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      box-sizing: border-box;
      padding: 16px;
      padding-top: max(16px, env(safe-area-inset-top));
      padding-bottom: max(16px, env(safe-area-inset-bottom));
      max-width: 100%;
      touch-action: pan-y;
    }
    #qr-overlay[hidden] {
      display: none;
    }
	
	/* 👇 ADD THIS */
#holiday-share-overlay[hidden] {
  display: none !important;
}

    #qr-card {
      background: #11121a;
      border-radius: 12px;
      padding: 16px;
      width: 100%;
      max-width: 320px;
      box-sizing: border-box;
      border: 1px solid #333;
      text-align: center;
      margin: 0 auto;
    }
    #qr-title {
      font-size: 14px;
      margin-bottom: 8px;
    }
    #qr-subtitle {
      font-size: 12px;
      color: #aaa;
      margin-bottom: 12px;
    }

    #qr-display {
      display: none;
      width: min(240px, 90vw);
      height: min(240px, 90vw);
      background: #fff;
      border-radius: 8px;
      margin: 0 auto 10px;
      image-rendering: pixelated;
    }

    #qr-video-wrap {
      display: none;
      margin-bottom: 8px;
    }
    #qr-video {
      width: min(240px, 90vw);
      height: min(240px, 90vw);
      max-width: 100%;
      object-fit: cover;
      border-radius: 8px;
      background: #000;
      transform: scaleX(-1);
    }

    #qr-close-btn {
      margin-top: 6px;
      border-radius: 999px;
      border: none;
      padding: 6px 12px;
      font-size: 13px;
      cursor: pointer;
      background: #333;
      color: #eee;
      touch-action: manipulation;
    }
    #qr-error {
      font-size: 12px;
      color: #f88;
      margin-top: 6px;
      min-height: 1em;
    }
    #qr-debug {
      font-size: 11px;
      color: #7bbdff;
      margin-top: 4px;
      min-height: 1.2em;
      word-break: break-all;
    }

    @media (max-width: 400px) {
      header h1 {
        font-size: 16px;
      }
      header p {
        font-size: 11px;
      }
      .msg-body {
        font-size: 12px;
      }
    }

    /* ---------- Hiking panel ---------- */
    #hike-section {
      margin-bottom: 8px;
      padding: 6px;
      border-radius: 10px;
      background: radial-gradient(circle at top, #101422 0, #050508 60%);
      border: 1px solid #22263a;
    }

    #hike-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
    }

    #hike-toggle-btn {
      border-radius: 999px;
      border: 1px solid #3b82f6;
      background: #11121a;
      color: #e5f0ff;
      padding: 4px 10px;
      font-size: 13px;
      cursor: pointer;
    }

    #hike-toggle-btn.active {
      background: #3b82f6;
      color: #fff;
    }

    #hike-status-label {
      font-size: 11px;
      color: #9ca3af;
    }

    #hike-map-wrap {
      border-radius: 10px;
      overflow: hidden;
      border: 1px solid #22263a;
    }

    #hike-map {
      width: 100%;
      height: 200px;
    }

    #hike-members {
      padding: 6px 8px;
      border-top: 1px solid #1f2937;
      background: rgba(5, 5, 8, 0.9);
    }

    .hike-members-title {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #9ca3af;
      margin-bottom: 4px;
    }

    #hike-members-list {
      list-style: none;
      padding: 0;
      margin: 0;
      max-height: 80px;
      overflow-y: auto;
    }

    #hike-members-list li {
      font-size: 11px;
      color: #e5e7eb;
      margin-bottom: 2px;
    }

    #hike-search {
      display: flex;
      gap: 6px;
      margin-bottom: 6px;
    }

    #hike-search-input {
      flex: 1;
      min-width: 0;
      padding: 4px 8px;
      border-radius: 999px;
      border: 1px solid #374151;
      background: #0b0c12;
      color: #e5e7eb;
      font-size: 13px;
    }

    #hike-search-btn {
      border-radius: 999px;
      border: 1px solid #374151;
      background: #11121a;
      color: #e5e7eb;
      padding: 4px 8px;
      font-size: 14px;
      cursor: pointer;
    }

    /* ---------- Shopping / To-do panel ---------- */
    #shopping-section {
      margin-bottom: 8px;
      padding: 6px;
      border-radius: 10px;
      background: radial-gradient(circle at top, #101018 0, #050508 60%);
      border: 1px solid #22263a;
      font-size: 12px;
    }

    #shopping-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
    }

    #shopping-title {
      font-size: 13px;
      font-weight: 500;
    }

    #shopping-location-buttons {
      display: flex;
      gap: 4px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .shopping-location-btn {
      border-radius: 999px;
      border: 1px solid #374151;
      background: #11121a;
      color: #e5e7eb;
      padding: 3px 8px;
      font-size: 11px;
      cursor: pointer;
    }
    .shopping-location-btn.active {
      background: #3b82f6;
      border-color: #3b82f6;
      color: #fff;
    }

    #shopping-body {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    #shopping-add-row {
      display: flex;
      gap: 4px;
    }

    #shopping-add-input {
      flex: 1;
      min-width: 0;
      padding: 4px 8px;
      border-radius: 999px;
      border: 1px solid #374151;
      background: #0b0c12;
      color: #e5e7eb;
      font-size: 13px;
    }
	
	#shopping-qty-input {
  width: 60px;
  padding: 4px 6px;
  border-radius: 999px;
  border: 1px solid #374151;
  background: #0b0c12;
  color: #e5e7eb;
  font-size: 13px;
  text-align: center;
}

    #shopping-add-btn {
      border-radius: 999px;
      border: 1px solid #3b82f6;
      background: #2563eb;
      color: #fff;
      padding: 4px 10px;
      font-size: 12px;
      cursor: pointer;
    }

    #shopping-items,
    #shopping-ghost-items {
      list-style: none;
      margin: 0;
      padding: 0;
    }

    .shopping-item-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      padding: 4px 6px;
      border-radius: 8px;
      background: rgba(15, 15, 25, 0.9);
      border: 1px solid rgba(55, 65, 81, 0.7);
      margin-bottom: 3px;
    }

    .shopping-item-main {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .shopping-item-title {
      font-size: 12px;
    }

    .shopping-item-tags {
      display: flex;
      gap: 4px;
      flex-wrap: wrap;
      font-size: 10px;
    }

    .shopping-tag {
      padding: 1px 5px;
      border-radius: 999px;
      border: 1px solid #4b5563;
      color: #9ca3af;
    }

    .shopping-tag.due {
      border-color: #f97316;
      color: #fed7aa;
    }
    .shopping-tag.upcoming {
      border-color: #22c55e;
      color: #bbf7d0;
    }
    .shopping-tag.maintenance {
      border-color: #6366f1;
      color: #c7d2fe;
    }

    .shopping-item-actions {
      display: flex;
      flex-direction: column;
      gap: 3px;
      flex-shrink: 0;
    }

    .shopping-done-btn {
      border-radius: 999px;
      border: 1px solid #16a34a;
      background: #16a34a;
      color: #f9fafb;
      padding: 3px 8px;
      font-size: 11px;
      cursor: pointer;
    }

    .shopping-done-btn:disabled {
      opacity: 0.5;
      cursor: default;
    }

    .shopping-ghost-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 8px;
      border-radius: 999px;
      border: 1px solid #4b5563;
      background: #11121a;
      color: #e5e7eb;
      font-size: 11px;
      margin: 2px 2px 2px 0;
      cursor: pointer;
    }
    .shopping-ghost-pill span.count {
      font-size: 10px;
      color: #9ca3af;
    }

    /* ---------- Holiday Shopping Center ---------- */
    #holiday-section {
      margin-top: 10px;
      padding: 6px;
      border-radius: 10px;
      background: radial-gradient(circle at top, #131024 0, #050508 60%);
      border: 1px solid #22263a;
      font-size: 12px;
    }

    #holiday-header {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-bottom: 6px;
    }

    #holiday-title-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    #holiday-title {
      font-size: 13px;
      font-weight: 500;
    }

    #holiday-holiday-select {
      width: 100%;
      border-radius: 999px;
      border: 1px solid #374151;
      background: #11121a;
      color: #e5e7eb;
      padding: 3px 8px;
      font-size: 11px;
    }

    #holiday-category-tabs {
      display: flex;
      gap: 4px;
      margin-top: 4px;
    }

    .holiday-cat-tab {
      flex: 1;
      border-radius: 999px;
      border: 1px solid #374151;
      background: #11121a;
      color: #e5e7eb;
      padding: 3px 6px;
      font-size: 11px;
      cursor: pointer;
    }
    .holiday-cat-tab.active {
      background: #f97316;
      border-color: #f97316;
      color: #111827;
    }

    #holiday-body {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 4px;
    }

    #holiday-add-row {
      display: flex;
      gap: 4px;
    }

    #holiday-add-input {
      flex: 1;
      min-width: 0;
      padding: 4px 8px;
      border-radius: 999px;
      border: 1px solid #374151;
      background: #0b0c12;
      color: #e5e7eb;
      font-size: 13px;
    }

    #holiday-add-btn {
      border-radius: 999px;
      border: 1px solid #f97316;
      background: #ea580c;
      color: #fff;
      padding: 4px 10px;
      font-size: 12px;
      cursor: pointer;
    }

    #holiday-items-list {
      list-style: none;
      margin: 0;
      padding: 0;
    }

    .holiday-item-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      padding: 4px 6px;
      border-radius: 8px;
      background: rgba(15, 15, 25, 0.9);
      border: 1px solid rgba(55, 65, 81, 0.7);
      margin-bottom: 3px;
    }

    .holiday-item-main {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .holiday-item-title {
      font-size: 12px;
    }

    .holiday-item-tags {
      display: flex;
      gap: 4px;
      flex-wrap: wrap;
      font-size: 10px;
    }

    .holiday-tag {
      padding: 1px 5px;
      border-radius: 999px;
      border: 1px solid #4b5563;
      color: #9ca3af;
    }
    .holiday-tag.ghost {
      border-color: #22c55e;
      color: #bbf7d0;
    }
    .holiday-tag.purchased {
      border-color: #16a34a;
      color: #bbf7d0;
    }

    .holiday-item-actions {
      display: flex;
      flex-direction: column;
      gap: 3px;
      flex-shrink: 0;
    }

    .holiday-btn {
      border-radius: 999px;
      border: 1px solid #4b5563;
      background: #11121a;
      color: #e5e7eb;
      padding: 2px 6px;
      font-size: 10px;
      cursor: pointer;
    }

    .holiday-btn.primary {
      border-color: #16a34a;
      background: #16a34a;
      color: #f9fafb;
    }

    .holiday-btn.danger {
      border-color: #b91c1c;
      background: #7f1d1d;
      color: #fee2e2;
    }

    #holiday-ghost-container {
  margin-top: 4px;
}

#holiday-ghost-label {
  font-size: 11px;
  color: #9ca3af;
}

/* new: label + button in one row */
#holiday-ghost-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

#holiday-ghost-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}


    .holiday-ghost-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 8px;
      border-radius: 999px;
      border: 1px solid #4b5563;
      background: #11121a;
      color: #e5e7eb;
      font-size: 11px;
      cursor: pointer;
    }

    .holiday-ghost-pill span.meta {
      font-size: 10px;
      color: #9ca3af;
    }

    /* Hide / show views */
    .view { display: none; }
    .view.active { display: block; }

    /* Top nav tabs */
    #top-tabs {
  display: flex;
  gap: 6px;
}

    .top-tab {
  cursor: pointer;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 999px;
  background: #11121a;
  border: 1px solid #333;
  color: #ccc;
  white-space: nowrap;
}


    .top-tab.active {
      background: #2e7dff;
      border-color: #2e7dff;
      color: #fff;
    }

    /* Summary card */
    .card {
      background: #111621;
      border-radius: 10px;
      padding: 12px;
      margin: 12px 0;
      border: 1px solid #222;
    }

    .card-title {
      font-weight: 600;
      margin-bottom: 8px;
    }

    .section-title {
      margin: 14px 0 8px 0;
      font-weight: 600;
      font-size: 16px;
    }
	
	    #home-birthdays .birthday-add-row {
      display: flex;
      gap: 8px;
      margin-bottom: 8px;
    }

    #birthday-name-input,
    #birthday-date-input {
      min-width: 0;
      padding: 6px 8px;
      border-radius: 8px;
      border: 1px solid #333;
      background: #020617;
      color: #f9fafb;
      font-size: 13px;
    }

    #birthday-name-input {
      flex: 1.2;
    }

    #birthday-date-input {
      flex: 0.8;
    }

    #birthday-add-btn {
      width: 100%;
      margin-top: 4px;
      padding: 6px 8px;
      border-radius: 999px;
      border: 1px solid #16a34a;
      background: #16a34a;
      color: #f9fafb;
      font-size: 13px;
      cursor: pointer;
    }

    #birthday-add-btn:active {
      transform: translateY(1px);
    }

    .birthday-hint {
      display: block;
      margin-top: 4px;
      font-size: 11px;
      color: #9ca3af;
    }

 