/* Loaded once here so every app that imports this stylesheet gets Inter —
   sub-apps no longer need their own Google Fonts <link>. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* === Canonical design tokens — single source of truth for our-hub === */

  /* 1. Core palette & global accent (default: Hub Rose) */
  --hub-bg: #0b0f19;
  --hub-surface: rgba(25, 33, 53, 0.7);
  --hub-surface-solid: #192135;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);

  --accent: #ff4d6d;        /* Overridable per sub-app */
  --accent-glow: rgba(255, 77, 109, 0.3);
  --accent-bright: #ff758f; /* Hub-only secondary tone; not part of the inherited contract */

  /* Shared calendar event ownership colors — hub-only, not part of the
     inherited contract. --owner-us intentionally aliases --accent rather
     than repeating the pink, so it stays in sync if --accent ever changes. */
  --owner-harun: #0a84ff;
  --owner-jordan: #af52de;
  --owner-us: var(--accent);

  /* 2. Spacing scale */
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;

  /* 3. Border radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* 4. Glass-blur treatment */
  --glass-bg: rgba(15, 23, 42, 0.65);
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
  --glass-blur: blur(16px);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  /* 5. Mobile safe areas & touch targets */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --min-touch-target: 44px;

  /* --- Legacy aliases: hub.html / index.html read these names directly.
     Kept as aliases onto the canonical tokens above so existing markup
     doesn't break — treat the canonical names as authoritative. --- */
  --bg-color: var(--hub-bg);
  --card-bg: var(--glass-bg);
  --card-hover: var(--hub-surface);
  --text-main: var(--text-primary);
  --text-sub: var(--text-secondary);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color); /* Kept your dark theme background; falls back to #fff5f5 if custom layouts dictate */
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  
  /* Use safe areas for notch/home indicators, fallback to standard paddings */
  padding-top: calc(env(safe-area-inset-top, 0px) + 2rem);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 2.5rem);
  padding-left: calc(env(safe-area-inset-left, 0px) + 1.2rem);
  padding-right: calc(env(safe-area-inset-right, 0px) + 1.2rem);
  
  /* Fixes iOS Safari address bar height cutoff issues */
  min-height: 100dvh; 
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  
  /* Ensure fluid scrolling inside app frame without broken side-swipes */
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  /* Plain full-page navigations (there's no SPA router here — moving
     between hub.html and a sub-app is a real page load) can't animate
     across the navigation itself, but fading the new page in gives
     continuity rather than the flat instant-swap default. Kept to a
     simple opacity fade rather than the newer cross-document View
     Transitions API, since this hub has been burned by iOS-version-
     gated feature support before (see the standalone-PWA sign-in
     history) — a plain animation works identically everywhere. */
  animation: hubFadeIn 0.28s ease;
}

@keyframes hubFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

h1 {
  font-family: 'Playfair Display', serif;
}

/* Perfect portrait scaling for your vertical image */
.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* height: 100% on a fixed element resolves against the large viewport on
     iOS Safari — as if the address bar were always hidden — even while it's
     showing, so the background renders taller than what's actually visible
     and scrolling (which hides the toolbar) reveals the rest. 100dvh tracks
     the real, currently-visible viewport instead; kept as a second
     declaration so older browsers without dvh support silently keep 100%. */
  height: 100dvh;
  background-image: linear-gradient(rgba(5, 5, 5, 0.55), rgba(5, 5, 5, 0.75)), url('../images/background.png');
  /* contain shows the whole collage uncropped — this leaves letterbox gaps
     on most aspect ratios, filled by background-color (matches the dark
     theme, not the old pink leftover). background-attachment: fixed is
     deliberately NOT set: it's redundant with this div already being
     position: fixed, and iOS Safari's implementation of that property
     specifically is known to be unreliable — it's what was causing the
     background to not stay glued on scroll. position: fixed alone is the
     spec-correct, reliable way to pin this to the viewport. */
  background-color: var(--hub-bg);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -2;
}

.container {
  width: 100%;
  max-width: 480px; /* Fits all iPhone models nicely without stretching */
  z-index: 2;
}

/* Floating Animation Hearts */
.hearts-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.floating-heart {
  position: absolute;
  bottom: -20px;
  color: var(--accent);
  opacity: 0.5;
  font-size: 1.1rem;
  filter: drop-shadow(0 0 5px var(--accent-glow));
  animation: floatUp 6s linear infinite;
}

@keyframes floatUp {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.4; }
  /* Combined target framework dynamically relative to dvh and random-x elements */
  100% { transform: translateY(-105dvh) translateX(var(--random-x, 30px)) rotate(360deg); opacity: 0; }
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2.5rem;
}

header h1 {
  font-size: 3.5rem; 
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 0.2rem;
  
  /* Gradient text effect */
  background: linear-gradient(135deg, #ffffff 0%, #ff758f 50%, #ff4d6d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  
  /* Soft glow effect */
  filter: drop-shadow(0 0 15px rgba(255, 77, 109, 0.3));
  
  /* Ensure it looks good on mobile */
  line-height: 1.1;
}

header h1 span {
  /* Subtle highlight for just the "+" sign if you wrap it in a span */
  color: var(--accent);
}

.header-heart-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

/* Pulsing Header Hearts */
.heart-pulse {
  color: var(--accent);
  display: inline-block;
  animation: heartbeat 1.4s infinite ease-in-out;
}
.heart-pulse:nth-child(2) { animation-delay: 0.2s; color: var(--accent-bright); }
.heart-pulse:nth-child(3) { animation-delay: 0.4s; }

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.2); }
  50% { transform: scale(1.05); }
  70% { transform: scale(1.2); }
}

/* Timeline: Clean 2x2 Touch Grid */
.timeline-nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  margin-bottom: 2.5rem;
}

.timeline-btn {
  background: var(--card-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  text-decoration: none;
  padding: 1.1rem 0.5rem;
  min-height: 44px;
  text-align: center;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, transform 0.1s;
}

.timeline-btn:active {
  transform: scale(0.96);
  background: var(--card-hover);
}

.timeline-btn span {
  font-size: 0.9rem;
}

/* Section Headings */
.section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-bright);
  font-weight: 700;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Spaces App Cards: Vertical Tap Stack */
.apps-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 2.5rem;
}

.app-card {
  background: var(--card-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.3rem;
  text-decoration: none;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, transform 0.1s;
}

.app-card:active {
  transform: scale(0.98);
  background: var(--card-hover);
}

.app-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.app-desc {
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.35;
  padding-right: 0.8rem;
}

.app-arrow {
  color: var(--accent);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Memory Box Wrap */
.gallery-wrap {
  background: var(--card-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px dashed rgba(255, 77, 109, 0.35);
  border-radius: 20px;
  padding: 1.8rem 1rem;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.gallery-wrap p {
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.photo-placeholder {
  aspect-ratio: 1;
  background: rgba(10, 10, 10, 0.4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-tap-highlight-color: transparent;
}

/* --- Calendar Styles --- */
.calendar-wrap {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  padding: 1.5rem;
  color: #1a1a1a;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-weight: 700; }
.calendar-header button { background: none; border: none; color: var(--accent); font-size: 1.2rem; cursor: pointer; font-weight: bold; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 0.7rem; color: #888; margin-bottom: 0.8rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.5rem; margin-top: 10px; }

.day {
  aspect-ratio: 1; 
  display: flex; 
  flex-direction: column;
  align-items: center; 
  justify-content: center;
  border-radius: 50%; 
  font-size: 1.05rem; 
  cursor: pointer; 
  color: #000000; 
  font-weight: 600;
  position: relative;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.day:hover { background: rgba(0,0,0,0.05); }
.day:active { transform: scale(0.9); }
/* Was a solid --accent fill before per-owner colors existed — now that a
   day's dots can be a mix of blue/purple/pink, filling the whole circle
   with one fixed color would both misrepresent whose day it is and wash
   out the dots sitting on top of it. A neutral tint just marks "something
   is here"; the dots themselves carry the actual color-coded info. */
.day.has-event { background-color: rgba(0,0,0,0.06); font-weight: 700; }

/* Today Highlight (Using fallback color if variable is missing) */
.today-highlight {
  border: 2px solid #0a84ff !important;
  background-color: rgba(10, 132, 255, 0.2) !important;
  color: #0a84ff !important;
  font-weight: 800 !important;
}

/* Ring around whichever day's events are currently filtered into the
   agenda list below (see selectedDay in the calendar script) — a
   box-shadow rather than a border so it can coexist with
   .today-highlight's own border when a selected day is also today. */
.day-selected { box-shadow: inset 0 0 0 2px var(--accent); }

/* Event Dot Indicator — background-color is set inline per event's owner
   (see ownerColorVar() in the calendar script), so the base rule here is
   just shape/size; --owner-us is the fallback for any dot rendered
   without an inline color at all. */
.event-dot {
  width: 5px;
  height: 5px;
  background-color: var(--owner-us);
  border-radius: 50%;
}

/* Apple-style bottom sheet. Base state stays in the DOM/layout at all
   times (display never toggles) — visibility is controlled by opacity on
   the backdrop and a transform on the sheet itself, which is what makes
   the slide-up/down animation possible; toggling display:none/block (the
   old approach) can't be animated at all. */
.hidden-overlay {
  position: fixed;
  inset: 0;
  /* 2000, not 100: this is shared across every app that imports this
     stylesheet, and movie-tracker's sticky header alone already sits at
     z-index:1000 — a lower value here would render this sheet behind it. */
  z-index: 2000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.hidden-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.overlay-content {
  width: 100%;
  max-width: 480px;
  background: #1c1c1e;
  color: white;
  border-radius: 20px 20px 0 0;
  padding: 0.5rem 1.25rem calc(var(--safe-bottom) + 1.5rem);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  text-align: left;
  max-height: 85vh;
  overflow-y: auto;
  box-sizing: border-box;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
.hidden-overlay.show .overlay-content {
  transform: translateY(0);
}
.sheet-grabber {
  width: 36px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  margin: 0.6rem auto 1rem;
}
.sheet-title {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  text-align: center;
}
/* Event rows — used by the agenda list.
   Delete is swipe-to-reveal (like iOS Mail/Reminders): the visible row
   slides left to expose a red action underneath, which you then tap —
   not an instant swipe-to-delete, since accidental data loss on a shared
   calendar is worse than one extra tap. */
.event-row { border-radius: 14px; overflow: hidden; }
.event-row-swipe-wrap { position: relative; }
.event-row-delete-action {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 84px;
  background: #ff453a;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.event-row-main {
  position: relative;
  background: #2c2c2e;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  touch-action: pan-y;
  box-sizing: border-box;
  width: 100%;
}
/* opacity, not transform — this row's transform is driven directly by
   the swipe-to-delete drag logic (attachSwipeToDelete in hub.html), so
   a :active transform here would fight it. Inline style always wins
   over a stylesheet rule regardless, so there's no real conflict during
   an actual drag, but opacity sidesteps the question entirely and still
   reads clearly as "this row registered your tap." */
.event-row-main:active { opacity: 0.85; }
/* Task check-off — a plain iOS-style square, not owner-colored (the
   accent bar already carries ownership color; the checkbox's job is just
   done-or-not). The button itself is a full 44px tap target (matches
   every other tappable control in this hub) — the small square people
   actually see is drawn separately via ::before, sized in CSS rather
   than fought over with the global button{min-height:44px} rule, which
   was previously stretching a 22px-tall button into a 44px-tall oval.
   Fades out during an active swipe (see attachSwipeToDelete) since it
   sits at the row's right edge, the same place the revealed Delete
   button lives — without that, checking off a task mid-swipe meant
   tapping through/over the delete action underneath it. */
.task-checkbox {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  position: relative;
}
.task-checkbox::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 5px;
  border: 2px solid var(--text-sub);
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s;
}
.task-checkbox.checked::before {
  border-color: #34c759;
  background: #34c759;
}
.task-checkbox.checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  pointer-events: none;
}

.event-row-main.task-completed .event-row-title {
  text-decoration: line-through;
  color: var(--text-sub);
  opacity: 0.65;
}
.event-row-main.task-completed .event-row-notes { opacity: 0.65; }
/* Deliberately not opacity on .event-row-main itself: that would make
   its own solid background translucent too, letting the swipe-revealed
   Delete button underneath bleed through even at rest — dimming just the
   text content gets the same "done" look without affecting compositing. */

.event-row-accent {
  width: 4px;
  align-self: stretch;
  border-radius: 3px;
  background: var(--accent);
  flex-shrink: 0;
}
.event-row-time-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 3.4rem;
  flex-shrink: 0;
  font-size: 0.78rem;
  color: #aaa;
  padding-top: 0.1rem;
}
.event-row-time-end { color: #777; }
.event-row-allday {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.7rem;
}
.event-row-body { flex: 1; min-width: 0; }
.event-row-title {
  font-weight: 600;
  font-size: 0.98rem;
  overflow-wrap: break-word;
}
.event-row-notes {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: #999;
  font-style: italic;
  overflow-wrap: break-word;
}
.event-row-chevron {
  color: #666;
  font-size: 1.1rem;
  flex-shrink: 0;
  padding-top: 0.1rem;
}

.add-event-btn {
  width: 100%; background: var(--accent); color: white; padding: 12px;
  border-radius: 12px; border: none; margin-top: 15px; font-weight: bold;
}
.add-event-btn:active { transform: scale(0.98); }
.delete-event-btn {
  width: 100%; background: transparent; color: #ff453a; padding: 12px;
  border-radius: 12px; border: none; margin-top: 10px; font-weight: 600;
}
.delete-event-btn:active { opacity: 0.6; }
.close-btn { background: transparent; color: #888; border: none; margin-top: 10px; font-size: 0.9rem; width: 100%; }
.close-btn:active { opacity: 0.6; }

/* Segmented control (Upcoming / Previous) */
.segmented-control {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 10px;
}
.segmented-option {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-sub);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.segmented-option.active { background: var(--accent); color: white; }
.segmented-option:active { transform: scale(0.95); }

/* Day-filter chip — replaces the Upcoming/Previous segmented control
   (rather than sitting alongside it) whenever a specific day is tapped
   on the calendar grid, so there's never ambiguity about which filter is
   actually active. */
.day-filter-chip {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}
.day-filter-chip button {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 1rem;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}

.recurrence-note {
  font-size: 0.78rem;
  color: var(--text-sub);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 0.85rem;
}

/* iOS-style action sheet — used for the recurring-entry delete choice,
   where a plain confirm() can't offer more than two options. Reuses
   .hidden-overlay for the dimmed backdrop + bottom anchoring; this is
   just the sheet content itself. */
.action-sheet {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 10px calc(10px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
.hidden-overlay.show .action-sheet {
  transform: translateY(0);
}
.action-sheet-group {
  background: #2c2c2e;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 8px;
}
.action-sheet-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 1rem;
  font-weight: 500;
  padding: 14px;
  min-height: 44px;
  box-sizing: border-box;
  cursor: pointer;
}
.action-sheet-btn:last-child { border-bottom: none; }
.action-sheet-btn.destructive { color: #ff453a; }
.action-sheet-btn.cancel {
  background: #2c2c2e;
  border-radius: 14px;
  font-weight: 700;
}

/* Owner filter for the agenda list — shared across Upcoming, Previous,
   and a selected day. Same chip language and colors as .owner-picker
   below (reused, not duplicated), just scoped to filtering the list
   rather than assigning an event's owner. Wider gap and wrap than the
   add-form picker since this row has a 4th ("All") pill and needs room
   to breathe rather than stay maximally compact. */
.agenda-owner-filter { margin-top: 20px; margin-bottom: 10px; }
.agenda-owner-filter .owner-picker { gap: 8px; flex-wrap: wrap; }
.agenda-owner-filter .owner-chip[data-owner="all"].active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Event ownership chips (Harun / Jordan / Us) — same compact chip
   language as the segmented control above, but each option keeps its own
   color when active instead of sharing one accent. */
.owner-picker { display: flex; gap: 6px; }
.owner-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid transparent;
  color: #aaa;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.owner-chip:active { transform: scale(0.94); }
.owner-chip[data-owner="harun"].active { background: var(--owner-harun); border-color: var(--owner-harun); color: white; }
.owner-chip[data-owner="jordan"].active { background: var(--owner-jordan); border-color: var(--owner-jordan); color: white; }
.owner-chip[data-owner="us"].active { background: var(--owner-us); border-color: var(--owner-us); color: white; }

/* KITCHEN FRIDGE NOTE — up to 3 literal warm-paper Post-its, newest on
   top, as a plain vertical reminder list rather than an overlapping
   stack. All the text-on-paper colors below are hardcoded, not the
   --text-primary/--text-sub tokens, since those are tuned for light
   text on this app's dark theme and would be close to invisible on
   light paper. */
.fridge-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 1.5rem 0 1.2rem;
}

.fridge-note-card {
  position: relative;
  box-sizing: border-box;
  color: #4a3f2a;
  border-radius: 4px;
  padding: 1.1rem 1.3rem 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.fridge-note-card--yellow { background: #fdf3c7; }
.fridge-note-card--mint   { background: #d6f5e3; }
.fridge-note-card--pink   { background: #fbdce6; }

.fridge-note-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 70px;
  height: 22px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transform: translateX(-50%) rotate(2deg);
  pointer-events: none;
}

.fridge-note-text {
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.6rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.fridge-note-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(74, 63, 42, 0.65);
}

/* Leave a Note / Archive — sit below the stack now, on the hub's dark
   background, so these reuse the app-card glass treatment rather than
   the paper-toned buttons that used to sit on top of the note itself. */
.fridge-stack-actions { display: flex; gap: 0.6rem; margin-bottom: 2rem; }
.fridge-stack-btn {
  flex: 1;
  background: var(--card-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-radius: 12px;
  padding: 0.7rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.fridge-stack-btn--ghost {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: var(--text-sub);
}
.fridge-stack-btn:active { transform: scale(0.97); }

/* Color picker in the Leave a Note form */
.note-color-picker { display: flex; gap: 8px; }
.note-color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
}
.note-color-swatch--yellow { background: #fdf3c7; }
.note-color-swatch--mint   { background: #d6f5e3; }
.note-color-swatch--pink   { background: #fbdce6; }
.note-color-swatch.active  { border-color: var(--accent); }

/* Past Notes archive list */
.note-archive-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-height: 55vh;
  overflow-y: auto;
  padding: 0.2rem 0.1rem 0.5rem;
}
.note-archive-item { border-radius: 10px; padding: 0.8rem 0.9rem; color: #4a3f2a; }
.note-archive-item--yellow { background: #fdf3c7; }
.note-archive-item--mint   { background: #d6f5e3; }
.note-archive-item--pink   { background: #fbdce6; }
.note-archive-text {
  font-family: 'Caveat', cursive;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.note-archive-meta { font-size: 0.75rem; font-weight: 600; color: rgba(74, 63, 42, 0.65); }

/* Grouped iOS-Settings-style form */
.ios-form { text-align: left; margin-top: 15px; }
.ios-list-group {
  background: #2c2c2e;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}
.ios-list-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 44px;
  box-sizing: border-box;
}
.ios-list-row:last-child { border-bottom: none; }
.ios-list-row label { color: #aaa; font-size: 0.92rem; flex-shrink: 0; }
.ios-input, .ios-textarea {
  background: transparent;
  border: none;
  color: white;
  font-size: 1rem;
  width: 100%;
  padding: 0;
  outline: none;
  font-family: inherit;
}
.ios-textarea { resize: none; height: 4.5rem; padding-top: 0.5rem; }
.ios-toggle-row, .ios-datetime-row { justify-content: space-between; }
.ios-datetime-inputs { display: flex; gap: 0.4rem; flex-wrap: nowrap; }
.ios-datetime-inputs input[type="date"],
.ios-datetime-inputs input[type="time"] {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: white;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.85rem;
  min-height: 32px;
}
/* Real iOS behavior: the time row disappears entirely when All-day is on,
   instead of sitting there empty like it did before. */
.ios-form.all-day .ios-time-input { display: none; }

.ios-select {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: white;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.85rem;
  min-height: 32px;
  font-family: inherit;
  outline: none;
}
.ios-select option { background: #2c2c2e; color: white; }

.ios-switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 48px;
  height: 28px;
  min-width: 48px;
  background: #39393d;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.ios-switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.ios-switch:checked { background: #34c759; }
.ios-switch:checked::before { transform: translateX(20px); }

.agenda-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

/* Shared empty/loading/error state — icon + message, used anywhere a
   list has nothing to show. Originally calendar-only (buildAgendaEmptyState
   in hub.html); now reused by movie-tracker and tier-list too, so it's
   named generically rather than "agenda-*". Replaces what used to be a
   single plain gray <p style="color:#888"> line per app with something
   that reads as an intentional, friendly "nothing here" moment rather
   than a missing-content gap. */
.hub-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-sub);
}
.hub-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.6rem;
  opacity: 0.6;
}
.hub-empty-state p {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

input { background: #2c2c2e; border: 1px solid #444; color: white; border-radius: 8px; padding: 8px; }
/* #eventForm's own box styling and #eventForm input's field styling were
   removed — superseded by .ios-form / .ios-list-group / .ios-input above,
   which are class-based and would otherwise lose to these old ID-selector
   rules on specificity regardless of source order. */

.dots-container {
  display: flex;
  gap: 2px; /* Space between dots */
  margin-top: 2px;
  justify-content: center;
}

/* ============================================================
   Global touch-target enforcement
   This stylesheet is imported by every sub-app, so these rules
   apply everywhere automatically. They guarantee a >=44x44px hit
   area on standard controls without dictating each app's own
   colors/padding — sub-app stylesheets still own the visual style
   and are loaded after this one, so their declarations win on any
   property they also set.
   ============================================================ */
button {
  min-height: var(--min-touch-target);
  min-width: var(--min-touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

a.back-btn,
.action-btn,
.filter-btn,
.delete-board-btn,
.icon-btn {
  min-height: var(--min-touch-target);
  min-width: var(--min-touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Icon-only controls (e.g. calendar Edit/close, prev/next chevrons) that
   carry no other class — opt in with class="icon-btn" */
.icon-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* ============================================================
   Shared glass-card utility — available to every sub-app that
   imports this stylesheet; opt in with class="glass-card".
   ============================================================ */
.glass-card {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--card-shadow);
}

/* ============================================================
   Shared write-feedback toast — see ui-toast.js. Bottom-anchored,
   respects the safe-area inset so it clears the home indicator.
   ============================================================ */
.hub-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 24px);
  transform: translateX(-50%) translateY(12px);
  background: var(--hub-surface-solid);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--card-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 5000;
  max-width: min(90vw, 360px);
  text-align: center;
}
.hub-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hub-toast-success { border-color: rgba(58, 154, 92, 0.4); color: #3a9a5c; }
.hub-toast-error { border-color: rgba(192, 57, 43, 0.4); color: #ff8a7a; }

/* Offline banner — see ui-toast.js. Top-anchored (the write-feedback
   toast above owns the bottom), persistent while offline rather than a
   timed flash, and a notch higher z-index so it's never hidden behind
   a toast that happens to be showing at the same moment. */
.hub-offline-banner {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-top) + 14px);
  transform: translateX(-50%) translateY(-12px);
  background: rgba(255, 159, 10, 0.15);
  color: #ffb340;
  border: 1px solid rgba(255, 159, 10, 0.35);
  border-radius: var(--radius-full);
  padding: 0.5rem 1.05rem;
  font-size: 0.78rem;
  font-weight: 600;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 5001;
  max-width: min(90vw, 360px);
  text-align: center;
}
.hub-offline-banner.show { opacity: 1; transform: translateX(-50%) translateY(0); }