/* ==========================================================================
   My Space & Finder — Interactive Prototype
   Design system: minimal, liquid-glass (macOS-inspired)
   ========================================================================== */

:root {
  /* Ambient wallpaper */
  --bg-deep: #0b0f0d;
  --aurora-1: #29ae6bc3;   /* emerald */
  --aurora-2: #218630be;   /* coral */
  --aurora-3: #34b299c4;   /* teal */
  --aurora-4: #45c968c3;   /* orchid */

  /* Glass surfaces */
  --glass-fill: rgba(255, 255, 255, 0.09);
  --glass-fill-strong: rgba(255, 255, 255, 0.15);
  --glass-fill-soft: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.28);
  --glass-border-soft: rgba(255, 255, 255, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.5);

  /* Text */
  --text-primary: #f5f6fb;
  --text-secondary: rgba(245, 246, 251, 0.68);
  --text-tertiary: rgba(245, 246, 251, 0.42);

  /* Accents */
  --accent: #29ae6b;
  --accent-soft: rgba(41, 174, 107, 0.22);
  --mint: #34b299;
  --coral: #ff8f70;
  --violet: #c945c7;

  /* Type */
  --font-display: 'Bricolage Grotesque', 'Work Sans', sans-serif;
  --font-body: 'Work Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* Radii */
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 9px;
  --r-pill: 999px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: inherit;
}

input {
  font: inherit;
  color: inherit;
}

/* ==========================================================================
   Ambient background — aurora blobs + grain
   ========================================================================== */

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg-deep);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}

.blob-a { width: 720px; height: 720px; background: var(--aurora-1); top: -220px; left: -160px; animation: drift-a 34s ease-in-out infinite; }
.blob-b { width: 640px; height: 640px; background: var(--aurora-2); top: 10%; right: -220px; animation: drift-b 40s ease-in-out infinite; }
.blob-c { width: 560px; height: 560px; background: var(--aurora-3); bottom: -180px; left: 8%; animation: drift-c 38s ease-in-out infinite; }
.blob-d { width: 500px; height: 500px; background: var(--aurora-4); bottom: 4%; right: 6%; animation: drift-d 44s ease-in-out infinite; }

/* Landing page only: an intentionally lopsided arrangement (varied
   width/height per blob, off-grid positions) instead of the neat
   one-per-corner layout the rest of the app uses. */
.landing-aurora .blob-a { width: 880px; height: 740px; top: -300px; left: -280px; }
.landing-aurora .blob-b { width: 480px; height: 620px; top: -80px; right: -100px; }
.landing-aurora .blob-c { width: 660px; height: 440px; bottom: -240px; left: 26%; opacity: 0.5; }
.landing-aurora .blob-d { width: 320px; height: 360px; bottom: 14%; right: -60px; top: auto; opacity: 0.65; }

@keyframes drift-a { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,40px) scale(1.08); } }
@keyframes drift-b { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px,60px) scale(1.05); } }
@keyframes drift-c { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,-50px) scale(1.1); } }
@keyframes drift-d { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-40px,-30px) scale(1.06); } }

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 1;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.landing-grain { opacity: 0.12; }

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Prototype note + page frame
   ========================================================================== */

.app-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  border-radius: 0;
  background: var(--glass-fill-soft);
  border: none;
  box-shadow: none;
  padding: 20px clamp(18px, 2.5vw, 40px) 28px;
  overflow: hidden;
  box-sizing: border-box;
}

.app-shell::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
  opacity: 0.5;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
}

.topbar .top-segmented { justify-self: center; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 14px;
  border-radius: var(--r-pill);
  transition: background .15s ease;
}

.profile-trigger:hover { background: var(--glass-fill-soft); }

.notif-btn { position: relative; flex-shrink: 0; }

.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--coral);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--bg-deep);
}

.notif-badge[hidden] { display: none; }

.profile-trigger-name {
  font-size: 12.5px;
  color: var(--text-secondary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-body {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.app-body[hidden] { display: none; }
.app-body.single { display: block; }
.app-body.single[hidden] { display: none; }

.view[hidden] { display: none; }

/* Segmented control */

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
}

.seg-btn {
  font-size: 14.5px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: var(--r-pill);
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}

.seg-btn:hover:not(.active) { color: var(--text-primary); }

.seg-btn.active {
  background: var(--glass-fill-strong);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--glass-border), 0 4px 14px -4px rgba(0,0,0,0.4);
}

.seg-btn.small { font-size: 13px; padding: 7px 16px; font-weight: 500; }

.sub-segmented { margin-bottom: 16px; }

/* Icon rail */

.icon-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 60px;
  flex-shrink: 0;
  padding: 12px 0;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-lg);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
}

.rail-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  color: var(--text-tertiary);
  transition: background .15s ease, color .15s ease;
}

.rail-btn:hover:not(.active) { color: var(--text-secondary); background: var(--glass-fill-soft); }

.rail-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(41,174,107,0.35);
}

/* Panel (main content glass card) */

.panel {
  flex: 1;
  min-width: 0;
  border-radius: var(--r-lg);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(34px) saturate(170%);
  -webkit-backdrop-filter: blur(34px) saturate(170%);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  top: -40%; left: -20%;
  width: 70%; height: 70%;
  background: radial-gradient(circle, var(--glass-highlight), transparent 70%);
  opacity: 0.06;
  pointer-events: none;
}

.panel-inner { position: relative; padding: 18px; height: 100%; }

/* ==========================================================================
   Messages
   ========================================================================== */

.messages-layout {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 14px;
  height: calc(100vh - 240px);
  min-height: 420px;
}

.requests-layout { grid-template-columns: 260px 1fr; }

.conv-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-md);
  width: 100%;
  transition: background .15s ease;
}

.conv-item:hover:not(.active) { background: var(--glass-fill-soft); }

.conv-item.active {
  background: var(--glass-fill-strong);
  box-shadow: inset 0 0 0 1px var(--glass-border-soft);
}

.conv-text { min-width: 0; flex: 1; text-align: left; }

.conv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.conv-name { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.conv-time { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-tertiary); flex-shrink: 0; }
.conv-preview {
  font-size: 12.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unread {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: rgba(10,14,26,0.85);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}

.avatar.md { width: 44px; height: 44px; font-size: 14px; }
.avatar.lg { width: 56px; height: 56px; font-size: 17px; }
.avatar.xl { width: 84px; height: 84px; font-size: 26px; }
.avatar.group .icon { width: 16px; height: 16px; }

.avatar.img-wrap { background: var(--glass-fill-strong); padding: 0; overflow: hidden; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.chat-view {
  position: relative;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--glass-border-soft);
  border-right: 1px solid var(--glass-border-soft);
  padding: 0 16px;
  min-width: 0;
  min-height: 0;
}

/* Floating pill that jumps a scrolled-up thread to its newest message. Sits
   just above the composer; hidden until .visible is toggled by the scroll
   handler. pointer-events off while hidden so it can't be clicked mid-fade. */
.chat-jump-btn {
  position: absolute;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%) translateY(6px);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border-soft);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 3;
}

.chat-jump-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.request-preview { border-right: none; padding-right: 0; }

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border-soft);
  margin-bottom: 14px;
}

.chat-name { font-family: var(--font-display); font-size: 15.5px; font-weight: 600; }
.chat-status { font-size: 12px; color: var(--text-tertiary); display: flex; align-items: center; gap: 6px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); display: inline-block; }

.chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 4px 2px;
  min-height: 0;
}

.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  position: relative;
}

.bubble.in {
  align-self: flex-start;
  background: var(--glass-fill-strong);
  border-bottom-left-radius: 5px;
  color: var(--text-primary);
}

.bubble.out {
  align-self: flex-end;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--out-color, var(--accent)) 75%, white 10%),
    color-mix(in srgb, var(--out-color, var(--accent)) 55%, white 5%));
  border-bottom-right-radius: 5px;
  color: #fff;
}

/* Delete-your-own-message control — sits just outside the bubble on its inner
   side, revealed on hover (always shown on touch). Only rendered on out bubbles. */
.bubble-del {
  position: absolute;
  top: 50%;
  left: -30px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-tertiary);
  background: var(--glass-fill-strong);
  opacity: 0;
  transition: opacity .15s ease, color .15s ease, background .15s ease;
}

.bubble:hover .bubble-del { opacity: 1; }
.bubble-del:hover { color: var(--coral); background: var(--glass-fill-strong); }
@media (hover: none) { .bubble-del { opacity: 1; } }

.bubble .sender {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 3px;
}

.chat-input-bar, .finder-search, .todo-add-bar, .event-add-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-pill);
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border-soft);
  margin-top: 12px;
  color: var(--text-tertiary);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.chat-input-bar:focus-within, .finder-search:focus-within, .todo-add-bar:focus-within, .event-add-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.text-input.date {
  flex: none;
  width: 132px;
  color-scheme: dark;
}

.text-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
}

.text-input::placeholder { color: var(--text-tertiary); }

.send-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .15s ease, filter .15s ease;
}

.send-btn:hover { filter: brightness(1.1); transform: scale(1.05); }

/* ==========================================================================
   Attachments — composer picker tray + sent media (chat, groups, posts)
   ========================================================================== */

.attach-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: color .15s ease, background .15s ease;
}
.attach-btn:hover { color: var(--accent); background: var(--accent-soft); }
.attach-btn:disabled, .send-btn:disabled { opacity: .5; cursor: default; }
.attach-btn:disabled:hover { background: none; transform: none; }

.chat-composer { margin-top: 12px; }
.chat-composer .chat-input-bar { margin-top: 0; }

.attach-error { color: var(--coral); font-size: 12px; margin: 0 6px 6px; }
.attach-error:empty { display: none; }

/* Picked-but-not-sent files */
.tray-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tray-item {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-fill-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tray-item img, .tray-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tray-item.file { padding: 6px; }
.tray-file { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; overflow: hidden; color: var(--text-secondary); }
.tray-file-name { font-size: 9px; line-height: 1.2; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-size {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 9px;
  padding: 2px 4px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .6));
  text-align: center;
}
.tray-item.file .tray-size { position: static; background: none; color: var(--text-tertiary); padding: 0; }
.tray-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; pointer-events: none; }
.tray-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tray-remove:hover { background: rgba(0, 0, 0, .85); }
.tray-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--glass-border-soft);
  border-top-color: var(--accent);
  animation: tray-spin .7s linear infinite;
}
@keyframes tray-spin { to { transform: rotate(360deg); } }

/* Sent attachments inside a message bubble or post */
.att-grid { display: flex; flex-direction: column; gap: 6px; }
.bubble .att-grid { margin-bottom: 4px; }
.att-media { display: block; border-radius: 10px; overflow: hidden; max-width: 260px; }
.att-media img, video.att-media { display: block; width: 100%; max-height: 280px; object-fit: cover; border-radius: 10px; }
.att-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border-soft);
  color: var(--text-primary);
  max-width: 260px;
}
.bubble.out .att-file { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); color: #fff; }
.att-file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.att-file-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file-size { font-size: 10.5px; opacity: .7; }
.att-file-dl { flex-shrink: 0; opacity: .7; }
.bubble-text { display: block; }

/* Post media gallery reuses the attachment styles, but goes full width */
.post-media { margin-bottom: 12px; }
.post-media .att-grid { gap: 8px; }
.post-media .att-media, .post-media .att-file { max-width: 100%; }
.post-media .att-media img, .post-media video.att-media { max-height: 460px; }

.request-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

/* Chat settings panel */

.chat-settings { padding-left: 2px; overflow-y: auto; }

.chat-settings h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.swatch-row { display: flex; gap: 6px; }
.swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
  transition: transform .15s ease, box-shadow .15s ease;
}
.swatch:hover { transform: scale(1.15); }
.swatch.active { box-shadow: 0 0 0 2px var(--bg-deep), 0 0 0 4px rgba(255,255,255,0.7); }

.toggle {
  width: 34px;
  height: 20px;
  border-radius: var(--r-pill);
  background: var(--accent);
  position: relative;
  display: inline-block;
}

.toggle.off { background: var(--glass-fill-strong); }

.toggle-knob {
  position: absolute;
  top: 2px; right: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
}

.toggle.off .toggle-knob { right: auto; left: 2px; background: var(--text-tertiary); }

.settings-divider { height: 1px; background: var(--glass-border-soft); margin: 16px 0; }

.setting-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
  padding: 9px 0;
  width: 100%;
  transition: color .15s ease;
}

.setting-link:hover { color: var(--text-primary); }

.settings-back {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 18px;
  transition: color .15s ease;
}

.settings-back:hover { color: var(--text-primary); }

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 8px 4px 4px;
}

.profile-name { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin-top: 10px; }
.profile-tag { font-size: 11.5px; color: var(--text-tertiary); }
.profile-bio { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; margin-top: 10px; }

.group-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.group-pick-item {
  text-align: left;
  font-size: 12.5px;
  color: var(--text-secondary);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--glass-fill-soft);
  transition: background .15s ease, color .15s ease;
}

.group-pick-item:hover { color: var(--text-primary); background: var(--glass-fill-strong); }

.added-note {
  font-size: 11px;
  color: var(--mint);
  margin-top: 6px;
}

.mini-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.mini-list-item { font-size: 12.5px; color: var(--text-secondary); }
.mini-list-item.dim { color: var(--text-tertiary); }

.mini-flag { font-size: 11px; margin-left: 3px; }

/* Empty state */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
  gap: 6px;
  padding: 20px;
}

.empty-state strong { color: var(--text-secondary); font-size: 14px; font-weight: 600; }
.empty-state.full { grid-column: 1 / -1; max-width: 360px; margin: 0 auto; }

/* ==========================================================================
   Calendar
   ========================================================================== */

.calendar-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 18px;
  height: calc(100vh - 200px);
  min-height: 420px;
}

.calendar-main { display: flex; flex-direction: column; min-height: 0; }

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.calendar-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; }

/* Calendar switcher (list of owned + shared calendars, above the toolbar) */

.calendar-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.cal-chip-group { display: inline-flex; align-items: center; gap: 2px; }

.cal-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 8px 6px 12px;
  border-radius: var(--r-pill);
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border-soft);
  color: var(--text-tertiary);
  transition: color .15s ease, border-color .15s ease;
}

.cal-chip.active { color: var(--text-primary); border-color: var(--glass-border); }

.cal-chip .cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dc);
  flex-shrink: 0;
}

.cal-chip .cal-role {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cal-chip-manage {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px 0 6px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border-soft);
  flex-shrink: 0;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.cal-chip-manage:hover { color: var(--text-primary); background: var(--glass-fill-strong); border-color: var(--glass-border); }

.cal-chip-add.ghost { color: var(--text-secondary); background: var(--glass-fill-soft); }
.cal-chip-add.ghost:hover { color: var(--text-primary); }

.cal-chip-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  color: var(--accent);
  background: var(--accent-soft);
  transition: filter .15s ease;
}

.cal-chip-add:hover { filter: brightness(1.1); }

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border-soft);
  flex-shrink: 0;
  transition: background .15s ease, color .15s ease;
}

.icon-btn:hover { background: var(--glass-fill-strong); color: var(--text-primary); }

.calendar-toolbar-actions { display: flex; align-items: center; gap: 12px; }

.view-switcher {
  display: flex;
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-pill);
  padding: 2px;
}

.view-switch-btn {
  padding: 5px 13px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  transition: color .15s ease, background .15s ease;
}

.view-switch-btn.active { background: var(--glass-fill-strong); color: var(--text-primary); }

/* ---- Month view ---- */

.calendar-grid.month-grid { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.cal-dow-row { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }

.cal-dow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-tertiary);
  text-align: center;
  padding-bottom: 6px;
}

.cal-weeks { flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 0; }

.cal-week {
  flex: 1;
  min-height: 68px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: min-content;
  row-gap: 3px;
  column-gap: 6px;
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-sm);
  padding: 6px;
}

.cal-week .cal-day {
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 50%;
  background: none;
  border: none;
  justify-self: start;
  transition: background .15s ease;
}

.cal-week .cal-day.dim { color: var(--text-tertiary); opacity: 0.35; }
.cal-week .cal-day:not(.dim):hover { background: var(--glass-fill-strong); }

.cal-week .cal-day.today { background: var(--accent); color: #fff; font-weight: 700; }

.cal-week .cal-day.selected { box-shadow: inset 0 0 0 1.5px var(--text-primary); }

.cal-event-bar {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--ec) 28%, transparent);
  border-left: 2px solid var(--ec);
  border-radius: 4px;
  padding: 2px 6px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-event-bar:hover { filter: brightness(1.15); }
.cal-event-bar.readonly { cursor: default; }

.cal-more {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-align: left;
  padding: 1px 6px;
}

.cal-more:hover { color: var(--text-primary); }

/* ---- Week / day views: hourly grid ---- */

.time-grid { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.time-grid-gutter-spacer { width: 48px; flex-shrink: 0; font-size: 10px; color: var(--text-tertiary); display: flex; align-items: flex-end; padding-bottom: 4px; }

.time-grid-header { display: flex; }

.time-grid-headcols { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); }

.time-grid-day-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--glass-border-soft);
}

.tgdh-name { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; }

.tgdh-num {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.tgdh-num.today { background: var(--accent); color: #fff; }

.time-grid-allday { display: flex; border-bottom: 1px solid var(--glass-border-soft); padding-bottom: 4px; min-height: 20px; }

.time-grid-allday-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: min-content; row-gap: 3px; column-gap: 6px; align-content: start; }

.time-grid-allday-grid.single { grid-template-columns: 1fr; }

.time-grid-body { flex: 1; display: flex; overflow-y: auto; min-height: 0; }

.time-grid-gutter { position: relative; width: 48px; flex-shrink: 0; }

.hour-label {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.time-grid-columns { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); column-gap: 6px; position: relative; }

.time-grid-columns.single { grid-template-columns: 1fr; }

.time-grid-col {
  position: relative;
  background-image: repeating-linear-gradient(to bottom, var(--glass-border-soft) 0, var(--glass-border-soft) 1px, transparent 1px, transparent var(--hour-h, 48px));
  border-left: 1px solid var(--glass-border-soft);
}

.timed-event {
  position: absolute;
  border-radius: 5px;
  background: color-mix(in srgb, var(--ec) 30%, transparent);
  border-left: 2px solid var(--ec);
  padding: 3px 6px;
  text-align: left;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.timed-event:hover { filter: brightness(1.15); }
.timed-event.readonly { cursor: default; }

.timed-event-title { font-size: 11px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timed-event-time { font-size: 9.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.current-time-line {
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 1.5px solid var(--coral);
  z-index: 2;
}

.current-time-line::before {
  content: '';
  position: absolute;
  left: -4px; top: -4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--coral);
}

.upcoming-panel {
  border-left: 1px solid var(--glass-border-soft);
  padding-left: 16px;
  overflow-y: auto;
}

.upcoming-panel h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 14px;
}

.event-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border-soft);
  border-left: 2px solid var(--ec);
  padding-left: 10px;
  margin-bottom: 4px;
}

.event-row.cal-event-clickable:hover { background: var(--glass-fill-soft); }

.event-time span { display: block; font-size: 9.5px; color: var(--text-tertiary); opacity: 0.8; }

.event-time {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-tertiary);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 46px;
}

.event-text { flex: 1; min-width: 0; }
.event-title { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.event-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* ==========================================================================
   To-do
   ========================================================================== */

.todo-layout { display: flex; gap: 18px; align-items: flex-start; padding: 8px 0; }

/* Folder sidebar */

.folder-list {
  width: 210px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.new-folder-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px;
  margin-bottom: 6px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  transition: filter .15s ease;
  flex-shrink: 0;
}

.new-folder-btn:hover { filter: brightness(1.12); }

.folder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  text-align: left;
  transition: background .15s ease, color .15s ease;
}

.folder-item:hover:not(.active) { color: var(--text-primary); background: var(--glass-fill-soft); }

.folder-item.active {
  color: var(--text-primary);
  background: var(--glass-fill-strong);
  box-shadow: inset 0 0 0 1px var(--glass-border);
}

.folder-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dc); flex-shrink: 0; }

.folder-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 500;
}

/* Task pane */

.todo-main { flex: 1; min-width: 0; max-width: 560px; display: flex; flex-direction: column; }

.todo-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.todo-main-head h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  min-width: 0;
}

.folder-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 6px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border-soft);
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.folder-edit-btn:hover { color: var(--text-primary); background: var(--glass-fill-strong); border-color: var(--glass-border); }

.todo-items { margin-bottom: 10px; }

/* Move-to-folder: drag handle state + per-task menu */

.todo-item { position: relative; }
.todo-item[draggable="true"] { cursor: grab; }
.todo-item.dragging { opacity: 0.45; cursor: grabbing; }

.folder-item.drag-over {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}

.todo-move { position: relative; display: flex; flex-shrink: 0; }

.row-move {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity .15s ease, color .15s ease, background .15s ease;
}

.todo-item:hover .row-move { opacity: 1; }
.row-move:hover { color: var(--accent); background: var(--glass-fill-strong); }
@media (hover: none) { .row-move { opacity: 1; } }

.move-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 160px;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--r-md);
  background: var(--glass-fill-strong);
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 30px -8px rgba(0,0,0,0.5);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
}

.move-menu-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  padding: 4px 8px 6px;
}

.move-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
  transition: background .15s ease, color .15s ease;
}

.move-menu-item:hover { background: var(--glass-fill-soft); color: var(--text-primary); }

.move-menu-empty { padding: 6px 8px; font-size: 12px; color: var(--text-tertiary); }

/* Multi-select for moving several tasks at once */

.todo-label { cursor: pointer; }
.todo-label:hover { color: var(--accent); }

.todo-item.selected {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: var(--r-sm);
  border-bottom-color: transparent;
}

.todo-selbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.todo-selbar-clear {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
  transition: filter .15s ease;
}

.todo-selbar-clear:hover { filter: brightness(1.15); }

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--glass-border-soft);
  font-size: 13.5px;
  color: var(--text-primary);
}

.todo-item.done .todo-label { color: var(--text-tertiary); text-decoration: line-through; }

.check-box {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1.5px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  transition: background .15s ease, border-color .15s ease;
}

.check-box:hover { border-color: var(--accent); }

.todo-item.done .check-box { background: var(--accent); border-color: var(--accent); }

.todo-label { flex: 1; text-align: left; }

.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--tc) 20%, transparent);
  color: var(--tc);
  flex-shrink: 0;
}

.todo-add-bar { max-width: 100%; }

.inline-error {
  font-size: 11.5px;
  color: var(--coral);
  margin: 8px 2px 0;
  min-height: 1em;
}

.add-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: color .15s ease;
}

.add-icon-btn:hover { color: var(--accent); }

/* ==========================================================================
   Finder
   ========================================================================== */

.finder-panel { padding: 18px; }

.finder-head { text-align: center; margin-bottom: 22px; }
.finder-head h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0 0 8px; }
.finder-head p { font-size: 13.5px; color: var(--text-secondary); margin: 0; }

.finder-search-row {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 16px;
  align-items: center;
}

.finder-search { flex: 1; margin-top: 0; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 26px;
}

.chip-row.tight { justify-content: flex-start; margin-bottom: 10px; gap: 6px; }

.chip {
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border-soft);
  color: var(--text-secondary);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.chip:hover:not(.active) { color: var(--text-primary); border-color: var(--glass-border); }

.chip.active {
  background: var(--accent-soft);
  border-color: rgba(41,174,107,0.5);
  color: var(--text-primary);
}

.chip.xs { font-size: 10.5px; padding: 4px 10px; }

.chip.custom { display: inline-flex; align-items: center; gap: 6px; }
.chip.custom .chip-x { font-size: 9px; opacity: .6; }
.chip.custom:hover .chip-x { opacity: 1; }

.interest-add-row { display: flex; gap: 8px; margin-top: 10px; }
.interest-add-row .text-input { flex: 1; }
.interest-add-row .btn { flex-shrink: 0; }

.people-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.person-card {
  position: relative;
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  transition: transform .15s ease, background .15s ease;
}

.person-card:hover { transform: translateY(-2px); background: var(--glass-fill); }

.match-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.match-badge .icon { width: 11px; height: 11px; }

.person-card-open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.person-name { font-family: var(--font-display); font-size: 14.5px; font-weight: 600; margin-top: 10px; }

.person-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}

.person-bio {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 8px 0 14px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: filter .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}

.btn.lg { padding: 14px 28px; font-size: 14.5px; }

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(41,174,107,0.6);
}

.btn-accent:hover { filter: brightness(1.08); }

.btn-accent.requested {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.btn-ghost {
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.btn-ghost:hover { color: var(--text-primary); }

.btn.block { width: 100%; margin-top: auto; }

/* ==========================================================================
   Icons
   ========================================================================== */

.icon { width: 20px; height: 20px; }
.icon.sm { width: 16px; height: 16px; }
.icon.xs { width: 12px; height: 12px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .messages-layout { grid-template-columns: 200px 1fr; height: auto; }
  .chat-settings { display: none; }
  .requests-layout { grid-template-columns: 1fr; }
  .calendar-layout { grid-template-columns: 1fr; height: auto; }
  .upcoming-panel { border-left: none; border-top: 1px solid var(--glass-border-soft); padding-left: 0; padding-top: 16px; }
  .people-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .app-body { flex-direction: column; }
  .icon-rail { flex-direction: row; width: 100%; justify-content: center; }
  .messages-layout { grid-template-columns: 1fr; }
  .conv-list { flex-direction: row; overflow-x: auto; }
  .chat-view { border: none; padding: 0; }
  .people-grid { grid-template-columns: 1fr; }
  .todo-layout { flex-direction: column; }
  .folder-list { width: 100%; flex-direction: row; overflow-x: auto; }
  .folder-item { width: auto; flex-shrink: 0; }
  .todo-main { max-width: 100%; width: 100%; }
}

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Marketing shell — brand, site nav, footer (index / signup / login)
   ========================================================================== */

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-decoration: none;
}

.brand.small { font-size: 14px; }

.site-nav {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 24px auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
}

.site-nav-links { display: flex; align-items: center; gap: 18px; }

.nav-link {
  color: var(--text-secondary);
  font-size: 13.5px;
  text-decoration: none;
  transition: color .15s ease;
}

.nav-link:hover { color: var(--text-primary); }

.site-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px 60px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0 0 16px;
}

.hero {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 60px auto 0;
  text-align: center;
  padding: 0 24px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5.5vw, 54px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  max-width: 720px;
  margin: 0 auto 40px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

/* Floating UI-fragment collage */

.hero-visual {
  position: relative;
  height: 220px;
  max-width: 640px;
  margin: 0 auto 90px;
}

.hv-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.5);
  font-size: 12.5px;
  text-align: left;
}

.hv-text { display: flex; flex-direction: column; gap: 2px; }
.hv-text strong { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.hv-text span { font-size: 11px; color: var(--text-tertiary); display: flex; align-items: center; gap: 4px; }

.hv-1 { top: 0; left: 6%; transform: rotate(-4deg); }
.hv-2 { top: 18px; right: 8%; transform: rotate(3deg); max-width: 220px; }
.hv-3 { bottom: 30px; left: 18%; transform: rotate(-2deg); gap: 6px; padding: 10px 14px; }
.hv-4 { bottom: 0; right: 14%; transform: rotate(4deg); }

.avatar.sm { width: 30px; height: 30px; font-size: 11px; }

/* ==========================================================================
   Features
   ========================================================================== */

.features {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-lg);
  padding: 26px 22px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

/* ==========================================================================
   CTA band
   ========================================================================== */

.cta-band {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto 90px;
  padding: 56px 32px;
  text-align: center;
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-xl);
}

.cta-band h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 10px;
}

.cta-band p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 24px;
}

/* ==========================================================================
   Auth pages (signup / login)
   ========================================================================== */

.auth-main {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 68vh;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 36px 32px;
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
  text-align: center;
}

.auth-sub {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin: 0 0 28px;
  line-height: 1.5;
}

.auth-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
  margin: 18px 0 0;
}

.auth-error {
  font-size: 12.5px;
  color: var(--coral);
  text-align: center;
  margin: 14px 0 0;
  min-height: 1em;
}

.auth-error.ok { color: var(--mint); }

.auth-switch {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin: 20px 0 0;
}

.auth-switch a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field-pair { display: flex; gap: 10px; align-items: flex-start; }
.field-pair .field { flex: 1; min-width: 0; }

.all-day-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.all-day-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }

.color-custom-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

.color-custom-row input[type="color"] {
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  overflow: hidden;
  background: none;
  cursor: pointer;
}

.color-custom-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-custom-row input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }

.text-input.boxed.mono { font-family: var(--font-mono); font-size: 12.5px; flex: 1; }

.field span {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.field-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin: 8px 2px 0;
}

.field .chip-row.tight { margin-bottom: 0; }

.text-input.boxed {
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-md);
  padding: 12px 14px;
  width: 100%;
  font-size: 13.5px;
}

.text-input.boxed:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ==========================================================================
   Marketing responsive
   ========================================================================== */

@media (max-width: 900px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .hero-visual { display: none; }
}

@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .site-nav { margin: 16px; }
  .hero { margin-top: 40px; }
}

/* ==========================================================================
   Profile modal
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6, 8, 16, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop[hidden] { display: none; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 32px 28px 28px;
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.6);
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  background: var(--glass-fill-soft);
  transition: color .15s ease, background .15s ease;
}

.modal-close:hover { color: var(--text-primary); background: var(--glass-fill-strong); }

.modal-card h2 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 22px;
  text-align: center;
}

.modal-divider { height: 1px; background: var(--glass-border-soft); margin: 20px 0 16px; }

.profile-avatar-edit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

textarea.text-input.boxed {
  resize: vertical;
  min-height: 70px;
  font-family: inherit;
  line-height: 1.5;
}

.btn.sm { padding: 7px 14px; font-size: 12px; }

/* ==========================================================================
   Calendar sharing (manage-calendar modal)
   ========================================================================== */

.member-row, .invite-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.member-row .member-name, .invite-result-row .invite-name { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-primary); }
.member-row .member-name-you { color: var(--text-tertiary); font-size: 11px; margin-left: 4px; }

.role-select {
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 11.5px;
  padding: 5px 8px;
  flex-shrink: 0;
}

.invite-results {
  display: flex;
  flex-direction: column;
  max-height: 160px;
  overflow-y: auto;
  margin-top: 8px;
}

.invite-empty { font-size: 11.5px; color: var(--text-tertiary); padding: 6px 0; }

/* ==========================================================================
   Profile page & posts
   ========================================================================== */

.profile-page { max-width: 560px; margin: 0 auto; padding: 8px 0 24px; }

.profile-page-back {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  transition: color .15s ease;
}

.profile-page-back:hover { color: var(--text-primary); }

.profile-page-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 28px;
}

.profile-page-name { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-top: 12px; }
.profile-page-bio { font-size: 13px; color: var(--text-secondary); line-height: 1.55; max-width: 420px; margin: 4px 0 4px; }

.profile-page-actions { display: flex; gap: 10px; margin-top: 10px; }

.post-list { display: flex; flex-direction: column; gap: 18px; }

.post-card {
  position: relative;
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-lg);
  padding: 16px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  text-align: left;
}

.post-author-text { display: flex; flex-direction: column; }
.post-author-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.post-time { font-size: 11px; color: var(--text-tertiary); font-family: var(--font-mono); margin-top: 1px; }

.post-image {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: var(--r-md);
  display: block;
  margin-bottom: 12px;
}

.post-caption { font-size: 13.5px; color: var(--text-primary); line-height: 1.55; margin-bottom: 12px; white-space: pre-wrap; }

.post-footer { display: flex; align-items: center; gap: 16px; }

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  transition: color .15s ease;
}

.like-btn:hover { color: var(--coral); }
.like-btn.active { color: var(--coral); }
.like-btn.active .icon { fill: var(--coral); }

.post-delete {
  position: absolute;
  top: 12px;
  right: 12px;
}

.post-composer-preview {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: var(--r-md);
  display: block;
  margin-top: 10px;
}

/* ==========================================================================
   Row delete buttons (to-do, calendar events)
   ========================================================================== */

.row-delete {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-tertiary);
  opacity: 0;
  flex-shrink: 0;
  transition: opacity .15s ease, color .15s ease, background .15s ease;
}

.todo-item:hover .row-delete,
.event-row:hover .row-delete,
.member-row:hover .row-delete,
.post-card:hover .row-delete { opacity: 1; }

.row-delete:hover { color: var(--coral); background: var(--glass-fill-strong); }

@media (hover: none) {
  .row-delete { opacity: 1; }
}

/* ==========================================================================
   Forgot-password link
   ========================================================================== */

.field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.forgot-link {
  font-size: 11.5px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color .15s ease;
}

.forgot-link:hover { color: var(--accent); }

/* ==========================================================================
   Notification center (control-center style popover) + broadcasts
   ========================================================================== */

.notif-anchor { position: relative; }

.notif-center {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-width: 88vw;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--glass-fill-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  z-index: 45;
  overflow: hidden;
  animation: notif-pop .16s ease;
}
.notif-center[hidden] { display: none; }

@keyframes notif-pop {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-center-head { padding: 14px 16px 6px; }
.notif-center-head h3 { margin: 0; font-family: var(--font-display); font-size: 15px; font-weight: 600; }

.notif-center-scroll { overflow-y: auto; padding: 2px 8px 10px; min-height: 0; }

.notif-section { padding: 6px 0; }
.notif-section + .notif-section { border-top: 1px solid var(--glass-border-soft); }

.notif-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.notif-post-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  transition: filter .15s ease;
}
.notif-post-btn:hover { filter: brightness(1.15); }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: var(--r-md);
}
button.notif-item { cursor: pointer; transition: background .15s ease; }
button.notif-item:hover { background: var(--glass-fill-soft); }

.notif-item-body { min-width: 0; flex: 1; }
.notif-item-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.notif-item-text {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.notif-item-meta { font-size: 10.5px; color: var(--text-tertiary); margin-top: 3px; font-family: var(--font-mono); }

.notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-item.update:not(.unseen) .notif-dot { visibility: hidden; }

.notif-empty { padding: 7px 10px; font-size: 12px; color: var(--text-tertiary); }

/* Unread markers in the main conversation list */
.conv-item.unread .conv-name { font-weight: 700; }
.conv-item.unread .conv-preview { color: var(--text-primary); }
.conv-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  align-self: center;
}

/* One-time update popup */
.update-popup-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  margin-bottom: 12px;
}
.update-popup-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  white-space: pre-wrap;
  margin: 0 0 16px;
}

@media (max-width: 640px) {
  .notif-center { width: 88vw; }
}

/* ---- Groups: New group button + member picker ---- */
.new-group-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px;
  margin-bottom: 6px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  transition: filter .15s ease;
  flex-shrink: 0;
}
.new-group-btn:hover { filter: brightness(1.12); }

.chat-name-lg { font-size: 15px; font-weight: 650; margin-bottom: 4px; }

.setting-link.danger { color: #ff6b6b; }
.setting-link.danger:hover { color: #ff8a8a; }

.dim-note { font-size: 12.5px; color: var(--text-tertiary); line-height: 1.5; margin: 4px 0 0; }

.member-pick-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 6px;
}
.member-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border-radius: var(--r-md);
  text-align: left;
  transition: background .15s ease;
}
.member-pick:hover { background: var(--glass-fill-soft); }
.member-pick-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-pick-box {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 7px;
  border: 1.5px solid var(--glass-border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.member-pick.checked .member-pick-box { background: var(--accent); border-color: var(--accent); }
