/* SPERA visual language — vibrant coral, aqua, and cool slate. */
:root {
  --bg: #2B3148;
  --bg2: #242A3E;
  --card: #3A425C;
  --card2: #465070;
  --card3: #545E7A;
  --s1: #3A425C;
  --s2: #465070;
  --s3: #545E7A;
  --line: #6B7594;
  --border: #6B7594;
  --border2: #818AAB;
  --text: #F4F6FF;
  --muted: #C8D0EA;
  --text2: #C8D0EA;
  --text3: #A8B2D0;
  --accent: #FF6B8A;
  --acc: #FF6B8A;
  --acc2: #FFB020;
  --accent2: #2EE6F0;
  --blue: #4CC9FF;
  --gold: #FFC107;
  --danger: #ff5d73;
  --red: #ff5d73;
  --ok: #2EE6F0;
  --grad: linear-gradient(135deg, #FF3D6E 0%, #FF8A3D 42%, #00D4C8 100%);
  --shadow: 0 10px 24px rgba(12, 16, 40, .22);
  --chrome: rgba(43, 49, 72, .92);
  --chrome-nav: rgba(43, 49, 72, .94);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #F4F6FF;
  --bg2: #E8ECFF;
  --card: #ffffff;
  --card2: #EEF1FF;
  --card3: #E2E7FA;
  --s1: #ffffff;
  --s2: #EEF1FF;
  --s3: #E2E7FA;
  --line: #D5DCF2;
  --border: #D5DCF2;
  --border2: #C4CDE8;
  --text: #14182B;
  --muted: #5C6580;
  --text2: #5C6580;
  --text3: #7A84A0;
  --accent: #FF3D6E;
  --acc: #FF3D6E;
  --acc2: #FF6B8A;
  --accent2: #00C2D4;
  --blue: #2EB8FF;
  --gold: #FFC107;
  --danger: #e11d48;
  --red: #e11d48;
  --ok: #00B3C4;
  --grad: linear-gradient(135deg, #FF4E86 0%, #FF7A45 100%);
  --shadow: 0 10px 28px rgba(80, 90, 180, .12);
  --chrome: rgba(244, 246, 255, .92);
  --chrome-nav: rgba(244, 246, 255, .94);
  color-scheme: light;
}
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}
.logo-icon { border-radius: 9px; }
.nav-ico { width: 20px; height: 20px; display: block; }

.theme-toggle {
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 10px;
  font: 700 12px inherit;
  z-index: 5;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; flex-shrink: 0; }
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }
.theme-toggle .theme-toggle-label { line-height: 1; }
html[data-theme="dark"] .theme-toggle .theme-toggle-label::after,
html:not([data-theme]) .theme-toggle .theme-toggle-label::after { content: "Light"; }
html[data-theme="light"] .theme-toggle .theme-toggle-label::after { content: "Dark"; }
.theme-toggle.fixed {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 50;
}
.theme-seg { display: flex; gap: 8px; margin-top: 8px; }
.theme-seg button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--muted);
  font: 700 13px inherit;
  cursor: pointer;
}
.theme-seg button.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--card2));
  color: var(--text);
}

html[data-theme="light"] .chip.blue { color: #0369a1; }
html[data-theme="light"] .chip.gold { color: #c48900; }

html[data-theme="light"] .btn,
html[data-theme="light"] button.go {
  background: linear-gradient(135deg, #FF4E86, #FF7A45);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(255, 61, 110, .28);
}
html[data-theme="light"] .btn.sec {
  background: #fff;
  color: #C7184E;
  border: 2px solid #FF4E86;
  box-shadow: none;
}
html[data-theme="light"] .btn.danger {
  background: #fff;
  color: var(--danger);
  border: 2px solid color-mix(in srgb, var(--danger) 55%, #fff);
  box-shadow: none;
}
html[data-theme="light"] .seg button,
html[data-theme="light"] .theme-seg button,
html[data-theme="light"] .who-tabs button,
html[data-theme="light"] .tabs button {
  background: #fff;
  color: #14182B;
  border-color: #C5CEEA;
}
html[data-theme="light"] .seg button.on,
html[data-theme="light"] .theme-seg button.on,
html[data-theme="light"] .who-tabs button.on,
html[data-theme="light"] .tabs button.on,
html[data-theme="light"] .ev .rsvp button.on {
  background: #FF4E86;
  border-color: #FF4E86;
  color: #fff;
}
html[data-theme="light"] .home-action {
  color: #14182B;
  background: #fff;
}
html[data-theme="light"] .home-action.daily {
  background: linear-gradient(160deg, #FFD2E0 0%, #fff 62%);
}
html[data-theme="light"] .home-action.attendance {
  background: linear-gradient(160deg, #C5FBF5 0%, #fff 62%);
}
html[data-theme="light"] .home-action-kicker { color: #C7184E; }
html[data-theme="light"] .home-action-note { color: #3A4460; }
html[data-theme="light"] .btn-g {
  background: #fff;
  color: #C7184E;
  border: 2px solid #FF4E86;
}
html[data-theme="light"] .sh-send {
  background: #FF4E86;
  color: #fff;
}
html[data-theme="light"] .nav.scrolled {
  background: rgba(244, 246, 255, .92);
  border-bottom-color: var(--line);
}
html[data-theme="light"] .sg-scrim { background: rgba(243, 246, 245, .62); }
html[data-theme="light"] .back-piros:hover { color: var(--text); }

/* ---------- help bot ---------- */
#spera-help {
  position: fixed;
  right: 14px;
  bottom: calc(var(--nav-h, 64px) + 16px + env(safe-area-inset-bottom));
  z-index: 80;
  font-family: inherit;
}
#spera-help[hidden],
#spera-help.by-guide { display: none; }
body:has(.chat-compose) #spera-help {
  bottom: calc(var(--nav-h, 64px) + 86px + env(safe-area-inset-bottom));
}
.sh-launch {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--card);
  padding: 0;
  background: var(--grad);
  box-shadow: 0 12px 28px rgba(255, 61, 110, .38);
  cursor: pointer;
  overflow: hidden;
}
.sh-launch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sh-launch:hover { transform: translateY(-1px); }
.sh-dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ok);
  border: 2px solid var(--card);
  pointer-events: none;
}
.sh-panel {
  display: none;
  width: min(380px, calc(100vw - 28px));
  height: min(520px, calc(100dvh - 120px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .32);
  overflow: hidden;
  flex-direction: column;
}
#spera-help.open .sh-panel { display: flex; }
#spera-help.open .sh-launch,
#spera-help.open .sh-dot { display: none; }
.sh-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,61,110,.16), rgba(46,196,182,.10));
}
.sh-head img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.sh-head b { display: block; font-size: 14px; }
.sh-head span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.sh-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--muted);
  cursor: pointer;
}
.sh-msgs {
  flex: 1;
  overflow: auto;
  padding: 12px;
}
.sh-msg { display: flex; flex-direction: column; margin-bottom: 10px; align-items: flex-start; }
.sh-msg.user { align-items: flex-end; }
.sh-bubble {
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.5;
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--text);
}
.sh-msg.user .sh-bubble {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.sh-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sh-actions button {
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--card2));
  color: var(--text);
  border-radius: 99px;
  padding: 6px 10px;
  font: 700 11px inherit;
  cursor: pointer;
}
.sh-quick {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
}
.sh-quick button {
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--muted);
  border-radius: 99px;
  padding: 7px 10px;
  font: 700 11px inherit;
  cursor: pointer;
}
.sh-compose {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.sh-compose input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 11px;
  font: 13px inherit;
  outline: none;
}
.sh-compose input:focus { border-color: var(--accent); }
.sh-send {
  width: 38px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.sh-send:disabled { opacity: .5; }
.sh-note {
  padding: 0 12px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
@media (min-width: 900px) {
  #spera-help,
  body:has(.chat-compose) #spera-help {
    right: 22px;
    bottom: 22px;
  }
}

/* ---------- events calendar ---------- */
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.cal-month {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -.02em;
}
.cal-legend {
  display: flex;
  gap: 14px;
  margin: 0 2px 10px;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pip {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--accent);
}
.pip.mile { background: var(--gold); }
.pip.event { background: var(--accent); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 14px;
}
.cal-dow {
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0 6px;
}
.cal-cell {
  min-height: 64px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 6px 5px 5px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
.cal-cell:hover { border-color: var(--accent); }
.cal-cell.out { opacity: .38; cursor: default; }
.cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-cell.sel { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.cal-cell .n { font-size: 12px; font-weight: 750; }
.cal-cell .pips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.cal-cell .mini {
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.3;
  overflow: hidden;
  max-height: 2.6em;
}
.cal-day-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
}
.cal-day-head h3 { font-size: 15px; margin: 0; }
@media (max-width: 640px) {
  .cal-cell { min-height: 52px; padding: 5px 4px; }
  .cal-cell .mini { display: none; }
}

.card {
  background: var(--card);
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.btn {
  border-radius: 12px;
  font-weight: 750;
  letter-spacing: -0.01em;
}
.btn.sec {
  background: var(--card2);
}
.chip {
  letter-spacing: .02em;
}
.chip.green { background: rgba(46,196,182,.16); color: var(--ok); }
.chip.blue { background: rgba(62,190,245,.16); color: #3EBEF5; }
.chip.gold { background: rgba(245,185,66,.14); color: var(--gold); }
.chip.red { background: rgba(255,93,115,.14); color: var(--danger); }

.seg.moods button {
  font-size: 12.5px;
  font-weight: 700;
  padding: 10px 6px;
}
.list-item .ico { display: none; }
.list-item { font-weight: 600; }
.empty .big { display: none; }
.empty { padding: 28px 16px; font-size: 13.5px; }

.home-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.home-action {
  display: flex;
  min-width: 0;
  min-height: 112px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 5px;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.home-action.daily {
  background: linear-gradient(155deg, color-mix(in srgb, #FF3D6E 30%, var(--card)), var(--card) 72%);
}
.home-action.attendance {
  background: linear-gradient(155deg, color-mix(in srgb, #00D4C8 26%, var(--card)), var(--card) 72%);
}
.home-action:hover { border-color: var(--accent); transform: translateY(-1px); }
.home-action:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.home-action-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent2);
}
.home-action b { font-size: 15px; line-height: 1.15; }
.home-action-note { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.home-calendar { padding: 14px; }
.home-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.home-calendar-head h3 { margin: 1px 0 0; font-size: 19px; }
.home-calendar-kicker {
  color: var(--accent2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.home-calendar #home-cal-day-list .card {
  background: var(--card2);
  box-shadow: none;
}
.home-calendar #home-cal-day-list .empty { padding: 20px 12px 10px; }
.sob-celebrate {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
}
.sob-celebrate h3 { color: var(--gold); }
.daily-checkin-panel { padding-top: 4px; }
@media (max-width: 380px) {
  .home-action { min-height: 104px; padding: 14px 11px; }
  .home-action b { font-size: 14px; }
  .home-action-note { font-size: 10.5px; }
  .home-calendar { padding: 12px 9px; }
}
.rw-tier { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rw-tier:last-child { border-bottom: none; }
.rw-bar { height: 8px; border-radius: 99px; background: var(--card3); overflow: hidden; }
.rw-bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }

.post .acts button.liked { color: var(--accent); }
.ribbon {
  color: var(--text);
  background: linear-gradient(135deg, rgba(16,185,129,.16), rgba(14,165,233,.10));
  border-color: rgba(16,185,129,.35);
  font-weight: 750;
  font-size: 12.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.celebrate {
  border-color: rgba(16,185,129,.4);
  background: linear-gradient(160deg, rgba(16,185,129,.12), rgba(14,165,233,.08));
}
.celebrate h3 { color: var(--text); }

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16,185,129,.12);
}

#toast {
  background: var(--card);
  border-color: var(--line);
  font-size: 13px;
}
.hic:empty,
.feat .ic:empty {
  background: linear-gradient(135deg, rgba(16,185,129,.22), rgba(14,165,233,.16)) !important;
  font-size: 0;
}

/* ---------- first-login guide ---------- */
#spera-guide {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
#spera-guide[hidden] { display: none; }
.sg-scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 16, .58);
}
.sg-card {
  position: relative;
  width: min(520px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(18px + env(safe-area-inset-bottom));
  margin-bottom: calc(var(--nav-h, 64px) + env(safe-area-inset-bottom));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .4);
}
.sg-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.sg-card h2 {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.02em;
  margin: 0 0 8px;
}
.sg-card p {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 18px;
}
.sg-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.sg-dots span {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--card3);
}
.sg-dots span.on {
  width: 18px;
  background: var(--accent);
}
.sg-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.sg-actions .btn { flex: 1; }
.sg-actions .btn.sec { flex: 0 0 auto; }
nav button.sg-spot {
  color: var(--text);
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
}
@media (min-width: 900px) {
  #spera-guide { align-items: center; }
  .sg-card {
    border-radius: 18px;
    margin: 0 24px 0 calc(200px + 24px);
  }
}

/* ---------- brand + social chrome ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.brand-mark,
img.logo-mark,
.logo-row .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  object-fit: cover;
  flex: none;
  box-shadow: 0 4px 14px rgba(255, 61, 110, .28);
}
header .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
header h1 {
  letter-spacing: .08em !important;
  font-size: 16px !important;
  font-weight: 800;
}
.logo-name {
  letter-spacing: .12em !important;
  font-weight: 800;
}
nav button {
  border-radius: 16px;
}
nav button.on {
  color: var(--accent);
}
nav button.on .nav-ico { color: var(--accent); }
@media (min-width: 900px) {
  nav button.on {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    box-shadow: inset 3px 0 0 var(--accent);
  }
}
.card {
  border-radius: 20px;
}
.avatar {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--card) 80%, transparent);
}
.post {
  border: none;
  box-shadow: var(--shadow);
  border-radius: 22px;
  overflow: hidden;
}
.post img.photo {
  margin-top: 10px;
  max-height: 520px;
  border-radius: 0;
}
.post .acts {
  border-top: none;
  padding: 4px 8px 10px;
  gap: 2px;
}
.post .acts button {
  border-radius: 99px;
  padding: 8px 12px;
}
.post .acts button.liked { color: #FF5A6A; }
.post .acts .ico-heart { width: 18px; height: 18px; }
.compose {
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: none;
}
.stories {
  margin: 0 0 12px;
  overflow: hidden;
}
.stories-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
}
.stories-row::-webkit-scrollbar { display: none; }
.story {
  flex: none;
  width: 72px;
  background: none;
  border: 0;
  color: var(--text);
  cursor: pointer;
  font: 700 11px inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.story-ring {
  padding: 3px;
  border-radius: 50%;
  background: var(--grad);
}
.story-ring .avatar {
  width: 56px;
  height: 56px;
  font-size: 16px;
  border: 2px solid var(--bg);
}
.story span {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.home-launch .launch .kicker { color: var(--accent); }
.btn { border-radius: 999px; }
.btn.sm { border-radius: 999px; }
.list-item { border-radius: 16px; border: none; box-shadow: var(--shadow); }
.banner {
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,61,110,.16), rgba(46,196,182,.10));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.sob-card .glow {
  background: radial-gradient(400px 200px at 85% -20%, rgba(255,61,110,.22), transparent 70%) !important;
}
html[data-theme="light"] body {
  background-image:
    radial-gradient(900px 420px at 8% -8%, rgba(255,61,110,.16), transparent 58%),
    radial-gradient(800px 380px at 100% 0%, rgba(0,212,200,.14), transparent 55%),
    radial-gradient(600px 320px at 70% 100%, rgba(76,201,255,.10), transparent 50%);
  background-attachment: fixed;
}
html[data-theme="dark"] body {
  background-image:
    radial-gradient(900px 420px at 8% -8%, rgba(255,61,110,.18), transparent 58%),
    radial-gradient(800px 380px at 100% 0%, rgba(46,230,240,.14), transparent 55%),
    radial-gradient(600px 320px at 70% 100%, rgba(76,201,255,.10), transparent 50%);
}
