/* ─── Layout ─────────────────────────────────────────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--s-6); }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--s-6); }
.row { display: flex; gap: var(--s-4); }
.col { display: flex; flex-direction: column; gap: var(--s-3); }
.center { display: flex; align-items: center; justify-content: center; }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.stack > * + * { margin-top: var(--s-4); }
.grid { display: grid; gap: var(--s-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px){ .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
  --bg: var(--c-brand-500);
  --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r-md);
  background: var(--bg); color: var(--fg);
  border: 1px solid transparent;
  font-weight: 600; font-size: var(--fs-base);
  cursor: pointer; user-select: none;
  transition: transform var(--t-fast), background var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  box-shadow: var(--sh-1);
  white-space: nowrap;
}
.btn:hover { background: var(--c-brand-600); transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(0); }
.btn.lg { padding: 14px 22px; font-size: var(--fs-md); border-radius: var(--r-lg); }
.btn.sm { padding: 7px 12px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn.ghost { background: transparent; color: var(--c-text); border-color: var(--c-line); box-shadow: none; }
.btn.ghost:hover { background: var(--c-surface-2); }
.btn.subtle { background: var(--c-brand-50); color: var(--c-brand-700); }
.btn.subtle:hover { background: var(--c-brand-100); }
.btn.outline { background: transparent; color: var(--c-brand-600); border-color: var(--c-brand-200); }
.btn.outline:hover { background: var(--c-brand-50); }
.btn.dark { background: var(--c-text); color: #fff; }
.btn.dark:hover { background: #000; }
.btn.glow { box-shadow: var(--sh-glow); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .ico { width: 18px; height: 18px; }

/* ─── Inputs ──────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--fs-sm); color: var(--c-text-soft); font-weight: 500; }
.input, .textarea, .select {
  width: 100%; padding: 12px 14px; font-size: var(--fs-base);
  background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--c-line); border-radius: var(--r-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--c-brand-400);
  box-shadow: 0 0 0 4px rgba(91,108,255,.15);
}
.textarea { resize: vertical; min-height: 96px; }
.help { font-size: var(--fs-xs); color: var(--c-text-mute); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
@media (max-width: 640px){ .field-row { grid-template-columns: 1fr; } }

/* OTP / token boxes */
.otp { display: flex; gap: 10px; justify-content: center; }
.otp input {
  width: 52px; height: 60px; text-align: center;
  font-size: 28px; font-weight: 700;
  border: 1px solid var(--c-line); border-radius: var(--r-md);
  background: var(--c-surface);
}

/* ─── Card / surface ──────────────────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--sh-1);
}
.card.lg { border-radius: var(--r-xl); padding: var(--s-7); }
.card.pad-md { padding: var(--s-5); }
.card.flat { box-shadow: none; }
.card.soft { background: var(--c-surface-2); border-color: var(--c-line-soft); }

/* ─── Badge / Chip ────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600;
  background: var(--c-brand-50); color: var(--c-brand-700);
}
.badge.ok   { background: rgba(37,195,114,.12); color: var(--c-ok); }
.badge.warn { background: rgba(245,165,36,.12); color: var(--c-warn); }
.badge.err  { background: rgba(239,71,97,.12); color: var(--c-err); }
.badge.mute { background: var(--c-surface-2); color: var(--c-text-mute); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%,100%{ box-shadow: 0 0 0 0 currentColor; opacity: .9; }
  50%   { box-shadow: 0 0 0 6px transparent; opacity: 1; }
}

/* ─── Nav ─────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.4) blur(10px);
  background: color-mix(in srgb, var(--c-bg) 80%, transparent);
  border-bottom: 1px solid var(--c-line-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--c-text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--c-brand-500), var(--c-accent-500));
  position: relative; box-shadow: var(--sh-glow);
}
.brand-mark::after {
  content: ""; position: absolute; inset: 6px;
  background: var(--c-surface); border-radius: 5px;
}
.nav-links { display: flex; gap: var(--s-5); align-items: center; }
.nav-links a { color: var(--c-text-soft); font-weight: 500; }
.nav-links a:hover { color: var(--c-text); }

/* ─── Sidebar icons (colorful gradient tiles) ──────────── */
.nav-ico {
  width: 22px; height: 22px; border-radius: 6px;
  display: inline-grid; place-items: center;
  flex: 0 0 auto;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.08);
}
.nav-ico svg { width: 13px; height: 13px; display: block; }
.nav-ico-home  { background: linear-gradient(135deg, #6d7cff, #4f5bd5); }
.nav-ico-rooms { background: linear-gradient(135deg, #a259ff, #7c3aed); }
.nav-ico-bot   { background: linear-gradient(135deg, #2cc1aa, #1ea58f); }
.nav-ico-cal   { background: linear-gradient(135deg, #f59e0b, #d97706); }
.nav-ico-wish  { background: linear-gradient(135deg, #ec4899, #db2777); }
.nav-ico-ach   { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.nav-ico-anal  { background: linear-gradient(135deg, #22c55e, #16a34a); }
.nav-ico-set   { background: linear-gradient(135deg, #64748b, #475569); }
.nav-ico-music { background: linear-gradient(135deg, #f43f5e, #db2777); }
.nav-ico-help  { background: linear-gradient(135deg, #06b6d4, #0891b2); }
/* Slightly desaturate non-active rows; full color on hover / active */
.side-nav a:not(.active) .nav-ico,
.rs-nav a:not(.active) .nav-ico,
.rs-foot a:not(.active) .nav-ico { filter: saturate(.9); }
.side-nav a:hover .nav-ico,
.rs-nav a:hover .nav-ico,
.rs-foot a:hover .nav-ico { filter: saturate(1.1); }

/* Signed-in user chip in public-site nav */
.nav-user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 14px 4px 4px; border-radius: 999px;
  background: var(--c-surface-2); border: 1px solid var(--c-line);
  color: var(--c-text) !important; text-decoration: none;
  font-weight: 500; font-size: var(--fs-sm);
  transition: background .12s, border-color .12s;
}
.nav-user-chip:hover {
  background: var(--c-brand-50); border-color: var(--c-brand-200);
  color: var(--c-text);
}
.nav-user-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--c-brand-500), var(--c-accent-500));
  color: #fff; font-weight: 700; font-size: 11px;
  display: grid; place-items: center; overflow: hidden;
}
.nav-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-user-name { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-burger {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; line-height: 1;
  background: transparent; color: var(--c-text);
  border: 1px solid var(--c-line); border-radius: var(--r-md);
  font-size: 18px; cursor: pointer;
}
.nav-burger:hover { background: var(--c-surface-2); }
@media (max-width: 820px){
  .nav-links { display: none; }
  .nav-links.mobile-open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--c-surface); padding: var(--s-5);
    border-bottom: 1px solid var(--c-line);
    box-shadow: var(--sh-2);
  }
  .nav-links.mobile-open a { padding: 10px 4px; }
  .nav-burger { display: inline-flex; }
}

/* ─── Section ─────────────────────────────────────────── */
.section { padding: var(--s-10) 0; }
.section.compact { padding: var(--s-9) 0; }
.eyebrow {
  display: inline-block; font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--c-brand-600); font-weight: 700;
  background: var(--c-brand-50); padding: 6px 12px; border-radius: var(--r-pill);
}
.section-head { text-align: center; max-width: 720px; margin: 0 auto var(--s-8); }
.section-head h2 { margin: var(--s-3) 0 var(--s-3); }
.section-head p { font-size: var(--fs-md); }

/* ─── Footer ──────────────────────────────────────────── */
.footer { border-top: 1px solid var(--c-line-soft); padding: var(--s-9) 0 var(--s-7); background: var(--c-bg-soft); }
.footer-grid { display: grid; gap: var(--s-7); grid-template-columns: 2fr 1fr 1fr 1fr; }
@media (max-width: 820px){ .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h5 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .1em; color: var(--c-text-mute); margin-bottom: var(--s-4); }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer ul a { color: var(--c-text-soft); }
.footer .legal { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--c-line-soft); display: flex; justify-content: space-between; color: var(--c-text-mute); font-size: var(--fs-sm); }

/* ─── Animations ─────────────────────────────────────── */
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fade-in var(--t-slow) var(--ease-out) both; }
.delay-1 { animation-delay: 80ms; } .delay-2 { animation-delay: 160ms; } .delay-3 { animation-delay: 240ms; }
.delay-4 { animation-delay: 320ms; } .delay-5 { animation-delay: 400ms; }

/* ─── Toast ───────────────────────────────────────────── */
.toast-host { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md);
  padding: 12px 16px; min-width: 240px; box-shadow: var(--sh-3); display: flex; align-items: center; gap: 10px;
  animation: fade-in 200ms var(--ease-out);
}
.toast.ok { border-left: 4px solid var(--c-ok); }
.toast.err { border-left: 4px solid var(--c-err); }
.toast.info { border-left: 4px solid var(--c-info); }

/* ─── Modal ───────────────────────────────────────────── */
.modal-host {
  position: fixed; inset: 0; background: rgba(15,17,32,.45);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 1000; padding: var(--s-5);
}
.modal-host.open { display: flex; }
.modal {
  background: var(--c-surface); border-radius: var(--r-xl); padding: var(--s-7);
  width: 100%; max-width: 520px; box-shadow: var(--sh-3);
  animation: fade-in 240ms var(--ease-out);
}
.modal-title {
  font-size: var(--fs-lg); font-weight: 700; color: var(--c-text);
  margin: 0 0 var(--s-2);
}
.modal-body {
  color: var(--c-text-soft); line-height: 1.55;
  margin-bottom: var(--s-5);
}
.modal-input {
  width: 100%; margin-bottom: var(--s-5);
}
.modal-actions {
  display: flex; gap: var(--s-2); justify-content: flex-end;
}
.modal-actions .btn { min-width: 88px; }
.modal-danger {
  background: var(--c-err); color: #fff; border-color: transparent;
}
.modal-danger:hover { background: #d63757; }

/* ─── Media type toggle ────────────────────────────────── */
.media-toggle { display: flex; gap: 6px; flex-wrap: wrap; }
.media-toggle .media-opt {
  display: flex; flex: 1; min-width: 0;
  align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--r-md);
  border: 1.5px solid var(--c-line); cursor: pointer;
  font-size: var(--fs-sm); font-weight: 500;
  background: var(--c-surface);
  transition: border-color .12s, background .12s;
}
.media-toggle .media-opt input { display: none; }
.media-toggle .media-opt:has(input:checked) {
  border-color: var(--c-brand-500); background: var(--c-brand-50); color: var(--c-brand-700);
}

/* ─── Calendar action buttons (post-create modal) ──────── */
.cal-buttons {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
@media (max-width: 560px) { .cal-buttons { grid-template-columns: 1fr; } }
.cal-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--r-md);
  background: var(--c-surface-2); border: 1px solid var(--c-line);
  color: inherit; text-decoration: none; cursor: pointer;
  font-family: inherit; text-align: left;
  transition: border-color .12s, transform .1s;
}
.cal-btn:hover { border-color: var(--c-brand-500); transform: translateY(-1px); }
.cal-ico {
  width: 38px; height: 38px; border-radius: var(--r-md); flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; font-size: 18px; font-weight: 700;
  background: linear-gradient(135deg, var(--c-brand-500), var(--c-accent-500));
}
.cal-google  .cal-ico { background: linear-gradient(135deg, #4285f4, #1a73e8); }
.cal-outlook .cal-ico { background: linear-gradient(135deg, #0078d4, #005a9e); }
.cal-office  .cal-ico { background: linear-gradient(135deg, #d83b01, #ea4300); }
.cal-ics     .cal-ico { background: linear-gradient(135deg, #6b7280, #475569); }
.cal-btn strong { display: block; font-size: var(--fs-sm); font-weight: 600; }

/* ─── Utilities ───────────────────────────────────────── */
.u-text-mute { color: var(--c-text-mute); }
.u-text-soft { color: var(--c-text-soft); }
.u-text-center { text-align: center; }
.u-mt-1{ margin-top: var(--s-1);} .u-mt-2{ margin-top: var(--s-2);} .u-mt-3{ margin-top: var(--s-3);}
.u-mt-4{ margin-top: var(--s-4);} .u-mt-5{ margin-top: var(--s-5);} .u-mt-6{ margin-top: var(--s-6);}
.u-mb-2{ margin-bottom: var(--s-2);} .u-mb-4{ margin-bottom: var(--s-4);} .u-mb-6{ margin-bottom: var(--s-6);}
.u-hide { display: none !important; }
.u-flex-1 { flex: 1; }
.u-gap-2 { gap: var(--s-2); } .u-gap-3 { gap: var(--s-3); } .u-gap-4 { gap: var(--s-4); }
.u-mono { font-family: var(--f-mono); }

/* ─── Spinner ─────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--c-line); border-top-color: var(--c-brand-500);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
