/* =========================================================================
   Moh OS V3 — Polish Layer
   Futuristic, warm, creative. Layered on top of base styles.
   - Ambient gradients (time-of-day responsive)
   - Glass/depth cards
   - Animated counters
   - Subtle motion
   - Hero typography
   ========================================================================= */

/* Ambient body — soft animated gradient that breathes */
body {
  background:
    radial-gradient(1200px 800px at 0% 0%, rgba(184,137,90,0.08) 0%, transparent 60%),
    radial-gradient(1000px 700px at 100% 100%, rgba(197,165,114,0.06) 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* Time-of-day ambient tints (set via [data-mood] on body in JS) */
body[data-mood="morning"] {
  background:
    radial-gradient(1200px 800px at 0% 0%, rgba(245,200,150,0.18) 0%, transparent 60%),
    radial-gradient(1000px 700px at 100% 100%, rgba(255,220,180,0.10) 0%, transparent 55%),
    #faf6ee;
}
body[data-mood="afternoon"] {
  background:
    radial-gradient(1200px 800px at 0% 0%, rgba(184,137,90,0.10) 0%, transparent 60%),
    radial-gradient(1000px 700px at 100% 100%, rgba(197,165,114,0.08) 0%, transparent 55%),
    var(--bg);
}
body[data-mood="evening"] {
  background:
    radial-gradient(1200px 800px at 0% 0%, rgba(138,100,64,0.12) 0%, transparent 60%),
    radial-gradient(1000px 700px at 100% 100%, rgba(96,68,42,0.08) 0%, transparent 55%),
    #f4ede0;
}
body[data-mood="night"] {
  background:
    radial-gradient(1200px 800px at 0% 0%, rgba(74,63,53,0.18) 0%, transparent 60%),
    radial-gradient(1000px 700px at 100% 100%, rgba(42,37,32,0.12) 0%, transparent 55%),
    #efe7d6;
}

/* Topbar — frosted, depth-of-field */
.topbar {
  background: rgba(247,243,236,0.7) !important;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(232,223,209,0.6);
}

.brand-mark {
  background: linear-gradient(135deg, #8a6440 0%, #b8895a 50%, #c5a572 100%) !important;
  box-shadow: 0 4px 16px rgba(138,100,64,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

.brand-text {
  background: linear-gradient(135deg, #2a2520 0%, #4a3f35 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sidebar — subtle gradient overlay */
.sidebar {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(251,247,240,0.2) 100%),
    var(--bg-2) !important;
  backdrop-filter: blur(8px);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(184,137,90,0.18) 0%, rgba(184,137,90,0.04) 100%) !important;
  position: relative;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--gold));
  border-radius: 0 2px 2px 0;
}

/* KPI tiles — glassmorphic depth */
.kpi {
  background: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(251,247,240,0.65) 100%) !important;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(232,223,209,0.6) !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 8px 24px -8px rgba(42,37,32,0.08) !important;
  transition: transform 220ms cubic-bezier(.2,.7,.2,1), box-shadow 220ms;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(197,165,114,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 16px 36px -8px rgba(42,37,32,0.12) !important;
}
.kpi-value {
  background: linear-gradient(135deg, #2a2520 0%, #4a3f35 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Cards — soft depth + warmth */
.card {
  background: linear-gradient(135deg, rgba(255,255,255,0.92) 0%, rgba(251,247,240,0.78) 100%) !important;
  backdrop-filter: blur(8px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 12px 32px -12px rgba(42,37,32,0.10) !important;
  transition: box-shadow 200ms;
}
.card:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 16px 40px -12px rgba(42,37,32,0.14) !important; }

/* Page title — dramatic serif */
.page-title {
  font-size: 32px !important;
  letter-spacing: -0.02em !important;
  line-height: 1.05 !important;
}
.page-title em {
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: italic;
}
@media (max-width: 600px) { .page-title { font-size: 26px !important; } }

/* Buttons — premium feel */
.btn-primary {
  background: linear-gradient(135deg, #2a2520 0%, #3a2f25 100%) !important;
  box-shadow: 0 4px 14px -4px rgba(42,37,32,0.4), inset 0 1px 0 rgba(255,255,255,0.06) !important;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4a3f35 0%, #5a4f45 100%) !important;
  transform: translateY(-1px);
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%) !important;
  box-shadow: 0 6px 20px -6px rgba(138,100,64,0.5), inset 0 1px 0 rgba(255,255,255,0.15) !important;
}

/* Status pills — refined */
.pill {
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 11px !important;
  border-radius: 999px !important;
  text-transform: uppercase;
  font-size: 10px !important;
  letter-spacing: 0.08em !important;
}

/* Live pulse for "connected" status pills */
.pill-done::before, .pill-connected::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 5px;
  vertical-align: middle;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Row cards — warmth on hover */
.row-card {
  background: rgba(255,255,255,0.75) !important;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(232,223,209,0.5) !important;
  transition: all 200ms cubic-bezier(.2,.7,.2,1);
}
.row-card:hover {
  background: rgba(255,255,255,0.95) !important;
  border-color: var(--accent-2) !important;
  transform: translateX(2px);
  box-shadow: 0 4px 14px -4px rgba(42,37,32,0.10);
}

/* Modal — premium */
.modal-backdrop { backdrop-filter: blur(8px) !important; background: rgba(26,23,20,0.5) !important; }
.modal {
  box-shadow: 0 24px 80px -16px rgba(42,37,32,0.45) !important;
  border: 1px solid rgba(255,255,255,0.6);
}

/* Animated counter base */
.kpi-value[data-target] {
  animation: count-up 800ms cubic-bezier(.2,.7,.2,1) both;
}
@keyframes count-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card entrance — staggered */
.main > .card,
.main > .kpi-grid {
  animation: card-enter 500ms cubic-bezier(.2,.7,.2,1) both;
}
.main > .card:nth-child(2) { animation-delay: 60ms; }
.main > .card:nth-child(3) { animation-delay: 120ms; }
.main > .card:nth-child(4) { animation-delay: 180ms; }
.main > .card:nth-child(5) { animation-delay: 240ms; }
@keyframes card-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Chat bubble polish */
#chat-stream > div > div[style*="background:var(--ink)"] {
  background: linear-gradient(135deg, #2a2520 0%, #3a2f25 100%) !important;
  box-shadow: 0 4px 14px -4px rgba(42,37,32,0.3);
}

/* Toast — floating glass */
.toast {
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.94) !important;
  box-shadow: 0 12px 36px -12px rgba(42,37,32,0.2), 0 1px 0 rgba(255,255,255,0.6) inset !important;
}

/* Loading state — shimmer */
.loading {
  background: linear-gradient(90deg, transparent, rgba(184,137,90,0.06), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  0% { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

/* Tab underline — gradient */
.tab.active { border-bottom-color: transparent !important; position: relative; }
.tab.active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 2px;
}

/* Wedding hero block (for /weddings/:id page-head) */
.wedding-hero {
  background: linear-gradient(135deg, rgba(184,137,90,0.08) 0%, rgba(197,165,114,0.04) 100%);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  margin: -8px 0 18px;
}
.wedding-countdown {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

/* Confetti / sparkle on success — enabled via JS class */
@keyframes sparkle-rise {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), -200px) rotate(360deg); opacity: 0; }
}
.sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 18px;
  animation: sparkle-rise 1.4s cubic-bezier(.2,.7,.2,1) forwards;
}

/* Scrollbar — minimal */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

/* =========================================================================
   HEARTBEAT — topbar pulse widgets (one-glance daily status)
   ========================================================================= */
/* Heartbeat strip — HIDDEN per user request. Re-enable via Settings if you want
   the daily pulse back. The data still updates in background; just visually muted. */
.heartbeat-strip { display: none !important; }
.hb-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  font-size: 11px;
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 500;
  transition: all 180ms;
}
.hb-item:hover { background: var(--surface); transform: translateY(-1px); border-color: var(--line-2); }
.hb-num { font-family: var(--serif); font-weight: 700; font-size: 13px; color: var(--ink); }
.hb-lbl { font-size: 10px; letter-spacing: 0.04em; color: var(--muted); }
.hb-dot { width: 7px; height: 7px; border-radius: 50%; }
.hb-dot-good { background: #4a7c4e; box-shadow: 0 0 8px rgba(74,124,78,0.5); animation: pulse-dot 2.4s ease-in-out infinite; }
.hb-dot-warn { background: #d97706; box-shadow: 0 0 6px rgba(217,119,6,0.45); }
.hb-dot-urgent { background: #c0392b; box-shadow: 0 0 8px rgba(192,57,43,0.55); animation: pulse-dot 1s ease-in-out infinite; }

@media (max-width: 700px) {
  .hb-lbl { display: none; }
  .heartbeat-strip { gap: 2px; }
  .hb-item { padding: 5px 8px; }
}

/* =========================================================================
   DAILY MOTIVATOR — the morning fire widget
   ========================================================================= */
.motivator {
  position: relative;
  border-radius: 18px;
  padding: 22px 24px 20px;
  margin-bottom: 18px;
  overflow: hidden;
  background:
    radial-gradient(900px 300px at 0% 0%, rgba(212, 168, 106, 0.30), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(192, 136, 88, 0.25), transparent 60%),
    linear-gradient(135deg, #fbf3df 0%, #f4ecd8 100%);
  border: 1px solid rgba(184, 137, 90, 0.22);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 16px 40px -16px rgba(138, 100, 64, 0.20);
  transition: transform 280ms cubic-bezier(.2,.7,.2,1), box-shadow 280ms;
  animation: motivator-fade-in 600ms ease-out;
}
.motivator:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 60px -16px rgba(138, 100, 64, 0.30);
}

/* Mood variants — subtle color shift behind the gradient */
.motivator[data-mood="hustle"] {
  background:
    radial-gradient(900px 300px at 0% 0%, rgba(192, 88, 56, 0.18), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(212, 130, 90, 0.20), transparent 60%),
    linear-gradient(135deg, #fbeede 0%, #f4d8c8 100%);
}
.motivator[data-mood="whisper"] {
  background:
    radial-gradient(900px 300px at 0% 0%, rgba(168, 138, 90, 0.14), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(212, 168, 106, 0.16), transparent 60%),
    linear-gradient(135deg, #fbf6e8 0%, #f0e5cc 100%);
}
.motivator[data-mood="brag"] {
  background:
    radial-gradient(900px 300px at 0% 0%, rgba(212, 168, 106, 0.32), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(240, 210, 144, 0.30), transparent 60%),
    linear-gradient(135deg, #fbf3df 0%, #f4d896 100%);
}
.motivator[data-mood="poetic"] {
  background:
    radial-gradient(900px 300px at 0% 0%, rgba(184, 137, 90, 0.22), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(168, 88, 138, 0.16), transparent 60%),
    linear-gradient(135deg, #faedde 0%, #f0d9d4 100%);
}

/* Shimmering highlight that sweeps across slowly */
.motivator-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
    transparent 0%, transparent 40%,
    rgba(255, 255, 255, 0.50) 50%,
    transparent 60%, transparent 100%
  );
  background-size: 200% 100%;
  pointer-events: none;
  animation: motivator-shimmer 6s ease-in-out infinite;
  opacity: 0.6;
}
@keyframes motivator-shimmer {
  0%   { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}
@keyframes motivator-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.motivator-eyebrow {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent, #8b5e34);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.motivator-emoji {
  font-size: 18px;
  letter-spacing: 0;
  text-transform: none;
  display: inline-block;
  animation: motivator-pulse 2.6s ease-in-out infinite;
}
@keyframes motivator-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

.motivator-headline {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
  color: var(--ink);
}
.motivator-headline em {
  font-style: italic;
  background: linear-gradient(135deg, var(--accent, #8b5e34) 0%, var(--gold, #d4a86a) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.motivator-body {
  position: relative;
  z-index: 1;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2, #4a3a2a);
  max-width: 720px;
}

.motivator-refresh {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(184, 137, 90, 0.30);
  background: rgba(255, 255, 255, 0.6);
  color: var(--accent, #8b5e34);
  font-size: 16px;
  cursor: pointer;
  transition: transform 600ms ease, background 200ms;
  display: grid;
  place-items: center;
}
.motivator-refresh:hover { background: rgba(255, 255, 255, 0.9); }
.motivator-refresh:disabled { opacity: 0.6; cursor: progress; }

@media (max-width: 600px) {
  .motivator { padding: 18px 18px 16px; }
  .motivator-headline { font-size: 20px; }
  .motivator-body { font-size: 13px; }
}

/* Dark mode: warm midnight motivator */
body[data-theme="dark"] .motivator {
  background:
    radial-gradient(900px 300px at 0% 0%, rgba(212, 168, 106, 0.20), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(192, 136, 88, 0.15), transparent 60%),
    linear-gradient(135deg, rgba(45, 33, 22, 0.85) 0%, rgba(34, 24, 16, 0.85) 100%);
  border-color: rgba(212, 168, 106, 0.25);
}
body[data-theme="dark"] .motivator-eyebrow { color: var(--gold, #d4a86a); }
body[data-theme="dark"] .motivator-headline { color: #fff; }
body[data-theme="dark"] .motivator-headline em {
  background: linear-gradient(135deg, var(--gold, #d4a86a) 0%, #fff5e0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
body[data-theme="dark"] .motivator-body { color: var(--ink-2, #d8c5a3); }
body[data-theme="dark"] .motivator-refresh {
  background: rgba(212, 168, 106, 0.10);
  border-color: rgba(212, 168, 106, 0.30);
  color: var(--gold);
}

/* =========================================================================
   STUDIO HERO — the new Hub centerpiece
   3-tile composition: countdown · viral all-time · top this quarter
   ========================================================================= */
.studio-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
  gap: 12px;
  margin-bottom: 18px;
  position: relative;
}
/* Push the countdown number + label + meta to the BOTTOM of the tile,
   keeping "NEXT WEDDING" eyebrow at the top — symmetric, no awkward middle gap */
.studio-tile-countdown .studio-countdown-number { margin-top: auto; margin-bottom: 8px; }
.studio-tile-countdown::before {
  /* faint sparkle pattern fills empty real estate elegantly */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(184,137,90,0.20), transparent),
    radial-gradient(2px 2px at 70% 22%, rgba(184,137,90,0.14), transparent),
    radial-gradient(2px 2px at 40% 18%, rgba(184,137,90,0.12), transparent),
    radial-gradient(2px 2px at 85% 35%, rgba(184,137,90,0.16), transparent),
    radial-gradient(2px 2px at 55% 28%, rgba(184,137,90,0.10), transparent);
  pointer-events: none;
  opacity: 0.6;
}
.studio-tile-countdown > * { position: relative; z-index: 1; }
/* Container-query friendly fallback: when the main column gets squeezed
   (artifact panel open), tiles re-flow neatly instead of stretching. */
@container (max-width: 480px) { .studio-hero { grid-template-columns: 1fr; } }

.studio-tile {
  position: relative;
  border-radius: 16px;
  padding: 20px 22px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  /* Belt-and-suspenders: even if inline-style flex layouts inside try to
     overflow on narrow phones, force them to wrap to next line. */
}
/* Any direct flex child of viral/recent tiles wraps + respects parent width.
   Targets inline-style flex containers used in the JS template. */
.studio-tile-viral > div,
.studio-tile-recent > div {
  max-width: 100%;
  min-width: 0;
}
.studio-tile-viral > div > div,
.studio-tile-recent > div > div {
  min-width: 0;
  flex-wrap: wrap !important;
}
@media (max-width: 480px) {
  /* On narrow phones, stack the right-column stats below the reach number */
  .studio-tile-viral > div[style*="display:flex"],
  .studio-tile-viral > div[style*="display: flex"],
  .studio-tile-recent > div[style*="display:flex"],
  .studio-tile-recent > div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }
  .studio-tile-viral > div[style*="display:flex"] > div[style*="text-align:right"],
  .studio-tile-recent > div[style*="display:flex"] > div[style*="text-align:right"] {
    text-align: left !important;
  }
  min-height: 200px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: transform 280ms cubic-bezier(.2,.7,.2,1), box-shadow 280ms;
  cursor: pointer;
  border: 1px solid var(--line);
}
.studio-tile:hover { transform: translateY(-3px); box-shadow: 0 24px 60px -16px rgba(42,37,32,0.22); }

.studio-tile-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.studio-tile-countdown {
  background:
    radial-gradient(800px 400px at 0% 100%, rgba(184,137,90,0.18) 0%, transparent 50%),
    linear-gradient(135deg, #fbf7f0 0%, #f4ecd8 100%);
  box-shadow: 0 16px 40px -16px rgba(138,100,64,0.18), 0 1px 0 rgba(255,255,255,0.7) inset;
  border: 1px solid rgba(184,137,90,0.18);
  text-align: left;
}
.studio-countdown-number {
  font-family: var(--serif);
  font-size: 96px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 50%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 4px 0 12px;
  text-shadow: 0 2px 24px rgba(184,137,90,0.15);
}
@media (max-width: 600px) { .studio-countdown-number { font-size: 72px; } }
.studio-tile-label {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.studio-tile-label em {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.studio-tile-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.studio-tile-viral, .studio-tile-recent {
  background: linear-gradient(135deg, #3a2f25 0%, #2a2520 100%);
  color: #fff;
}
.studio-tile-viral .studio-tile-eyebrow,
.studio-tile-recent .studio-tile-eyebrow { color: rgba(255,255,255,0.85); }

/* =========================================================================
   WEDDING SECTIONS — confirmed first, inquiries collapsed below
   ========================================================================= */
.wed-section { margin-bottom: 28px; }
.wed-section-head {
  margin: 8px 0 14px;
  display: flex;
  align-items: baseline;
}
.sec-toggle {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  width: 100%;
  text-align: left;
}
.sec-chev {
  font-size: 11px;
  color: var(--muted);
  transition: transform 200ms;
  width: 12px;
  display: inline-block;
}
.sec-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.sec-sub {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  letter-spacing: 0.04em;
}

/* =========================================================================
   DISPATCH — Approval Inbox
   ========================================================================= */
.dispatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}
.dispatch-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 200ms, box-shadow 200ms;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 4px 16px -8px rgba(42,37,32,0.08);
}
.dispatch-card:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -16px rgba(42,37,32,0.18); }
.dispatch-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 10px;
}
.dispatch-emoji { font-size: 22px; }
.dispatch-kind {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.dispatch-ctx {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  font-family: var(--serif);
}
.dispatch-ctx strong {
  color: var(--ink);
  font-style: italic;
  font-weight: 500;
}
.dispatch-subj {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.dispatch-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2, var(--ink));
  white-space: pre-wrap;
  background: rgba(184,137,90,0.04);
  padding: 10px 12px;
  border-radius: 8px;
  max-height: 260px;
  overflow-y: auto;
}
.dispatch-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.dispatch-sched {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

/* =========================================================================
   P&L — wedding-detail Expenses tab + Studio Profit page
   ========================================================================= */
.pnl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  padding: 6px 2px 2px;
}
.pnl-item .lbl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.pnl-num {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
  line-height: 1.1;
}
.exp-cat { margin: 14px 0 6px; }
.exp-cat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.exp-row {
  margin-bottom: 4px;
  background: var(--surface);
}

/* Studio P&L table */
.pnl-table { display: flex; flex-direction: column; }
.pnl-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 0.6fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  transition: background 160ms;
}
.pnl-row:last-child { border-bottom: none; }
.pnl-row:not(.pnl-head):hover { background: rgba(184,137,90,0.05); }
.pnl-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 14px;
  background: rgba(184,137,90,0.04);
}
.pnl-name { font-family: var(--serif); font-size: 15px; font-weight: 500; }
.pnl-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
@media (max-width: 700px) {
  .pnl-row { grid-template-columns: 2fr 1fr 1fr; }
  .pnl-row > div:nth-child(3),
  .pnl-row > div:nth-child(5) { display: none; }
}

/* Sort dropdown — same height/look as buttons */
.sort-select {
  height: 36px;
  max-width: 200px;
  width: auto;
  padding: 0 30px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%23847362' d='M3 4l3 4 3-4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 160ms;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.sort-select:hover { border-color: var(--accent, #8a6440); }
@media (max-width: 600px) {
  .sort-select { font-size: 12px; padding: 0 24px 0 8px; max-width: 160px; }
}

/* Page head should wrap nicely on narrow viewports */
.page-head {
  flex-wrap: wrap;
  gap: 12px;
}
.page-head > .row {
  flex-wrap: wrap;
  gap: 8px;
}

/* View toggle pill */
.view-toggle {
  display: inline-flex;
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  padding: 2px;
  margin-right: 4px;
}
.vt-btn {
  background: transparent;
  border: none;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--muted);
  border-radius: 8px;
  transition: background 160ms, color 160ms;
}
.vt-btn.active { background: var(--accent, #8a6440); color: #fff; }
.vt-btn:hover:not(.active) { color: var(--ink); }

/* =========================================================================
   WEDDING LIST (compact rows) — dense, scannable
   ========================================================================= */
.wed-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.wed-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 160ms;
}
.wed-row:last-child { border-bottom: none; }
.wed-row:hover { background: rgba(184,137,90,0.06); }
.wed-row-main { flex: 1; min-width: 0; }
.wed-row-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wed-row-name em {
  font-style: italic;
  background: linear-gradient(135deg, var(--accent, #8a6440) 0%, var(--accent-2, #c5a572) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.wed-row-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wed-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.row-countdown {
  background: linear-gradient(135deg, var(--accent, #8a6440) 0%, var(--accent-2, #c5a572) 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.row-overdue {
  background: rgba(212, 73, 73, 0.12);
  color: #b13a3a;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}
.row-prog {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent, #8a6440);
  letter-spacing: 0.04em;
}
.wed-row-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2, var(--ink));
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .wed-row { padding: 10px 12px; gap: 8px; }
  .wed-row-meta { font-size: 11px; }
  .wed-row-right .row-prog,
  .wed-row-right .wed-row-value { display: none; }
}

/* =========================================================================
   WEDDING CARDS 2.0 — visual hero grid
   ========================================================================= */
.wed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.wed-card {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: transform 240ms cubic-bezier(.2,.7,.2,1), box-shadow 240ms;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 8px 24px -10px rgba(42,37,32,0.10);
}
.wed-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 24px 50px -16px rgba(42,37,32,0.22);
}
.wed-card-thumb {
  position: relative;
  height: 140px;
  background: linear-gradient(135deg, #8a6440 0%, #b8895a 50%, #c5a572 100%);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.wed-card-thumb-grad {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at top right, rgba(255,255,255,0.3) 0%, transparent 60%);
  pointer-events: none;
}
.wed-card-initials {
  font-family: var(--serif);
  font-size: 56px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  letter-spacing: -0.04em;
  text-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.wed-card-countdown {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(255,255,255,0.95);
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.wed-card-countdown small { font-size: 10px; font-weight: 500; opacity: 0.7; margin-left: 1px; }
.wed-ring {
  position: absolute;
  bottom: 12px; right: 12px;
  width: 44px; height: 44px;
}
.wed-ring-num {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.wed-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.wed-card-couple {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.wed-card-couple em {
  font-style: italic;
  background: linear-gradient(135deg, var(--ink) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.wed-card-meta { font-size: 12px; color: var(--muted); }
.wed-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  font-size: 12px;
  color: var(--ink-2);
  gap: 8px;
  min-width: 0;
}
.wed-card-foot > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.wed-card-foot .pill { flex-shrink: 0; }
.wed-card-value {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  color: var(--accent);
  margin-top: 6px;
}

/* =========================================================================
   CHARTS — bar + sparkline visualizations
   ========================================================================= */
.chart-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.chart-title {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 10px;
}
.chart-bars { display: flex; flex-direction: column; gap: 10px; }
.chart-bar-row { display: grid; grid-template-columns: 110px 1fr; column-gap: 12px; row-gap: 2px; align-items: center; }
.chart-bar-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.chart-bar-track {
  position: relative;
  height: 24px;
  background: var(--bg-2);
  border-radius: 6px;
  overflow: hidden;
}
.chart-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 800ms cubic-bezier(.2,.7,.2,1);
  animation: bar-grow 900ms cubic-bezier(.2,.7,.2,1) both;
  border-radius: 6px;
}
@keyframes bar-grow { from { width: 0 !important; } }
.chart-bar-value {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}
.chart-bar-meta { grid-column: 2; font-size: 11px; color: var(--muted); margin-top: 2px; }

.chart-spark {
  display: flex;
  height: 80px;
  align-items: flex-end;
  gap: 4px;
  padding: 6px 0;
}
.chart-spark-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.chart-spark-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent), var(--gold));
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 600ms cubic-bezier(.2,.7,.2,1);
  animation: spark-grow 800ms cubic-bezier(.2,.7,.2,1) both;
}
@keyframes spark-grow { from { height: 0 !important; } }
.chart-spark-x { font-size: 9px; color: var(--muted); font-weight: 600; }

@media (max-width: 600px) {
  .chart-bar-row { grid-template-columns: 80px 1fr; }
  .chart-bar-label { font-size: 10px; }
}

/* Print proposal — keep clean */
@media print {
  .topbar, .sidebar, .sidebar-overlay, .toast-stack { display: none !important; }
  body { background: #fff; }
}
