:root {
  --bg: #050816;
  --bg-soft: #081020;
  --surface: #0d1629;
  --surface-2: #111d33;
  --surface-3: #15233b;
  --text: #f8fbff;
  --muted: #a7b0c2;
  --muted-2: #667087;
  --rose: #f45b91;
  --rose-bright: #ff7cab;
  --rose-soft: #ffb6ce;
  --teal: #35d0c4;
  --teal-soft: #79e6dc;
  --card-gap: 20px;
  --radius: 22px;
}

html,
body {
  background: #050816 !important;
  scrollbar-width: thin;
  scrollbar-color: var(--rose) #050816;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #050816;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--rose-bright), var(--rose));
  border: 2px solid #050816;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--teal-soft), var(--teal));
}

body {
  background:
    radial-gradient(circle at 10% -5%, rgba(244,91,145,.10), transparent 27%),
    radial-gradient(circle at 96% 8%, rgba(53,208,196,.07), transparent 25%),
    linear-gradient(180deg, #050816 0%, #070b18 48%, #040711 100%) !important;
}

.app-shell {
  background:
    radial-gradient(circle at 16% 0%, rgba(244,91,145,.055), transparent 25%),
    linear-gradient(180deg, rgba(8,13,28,.99), rgba(5,8,20,.995)) !important;
}

.hero-card,
.compact-card,
.brief-card,
.leaderboard,
.session-card,
.routine-card,
.mika-note,
.message.mika-message,
.login-card,
.modal-card {
  border: 0 !important;
  background: linear-gradient(145deg, rgba(17,29,51,.96), rgba(9,16,32,.98)) !important;
  box-shadow:
    0 18px 38px rgba(0,0,0,.30),
    0 3px 9px rgba(0,0,0,.24),
    inset 0 1px 0 rgba(255,255,255,.035) !important;
}

.hero-card,
.brief-card,
.leaderboard,
.session-card,
.routine-card,
.mika-note {
  transform: translateY(-2px);
}

.rose-card {
  background:
    radial-gradient(circle at 90% 10%, rgba(244,91,145,.16), transparent 34%),
    linear-gradient(145deg, rgba(76,24,58,.86), rgba(16,24,45,.98)) !important;
  box-shadow:
    0 20px 42px rgba(0,0,0,.34),
    0 7px 22px rgba(244,91,145,.08),
    inset 0 1px 0 rgba(255,182,206,.07) !important;
}

.teal-card,
.session-card {
  background:
    radial-gradient(circle at 90% 0%, rgba(53,208,196,.11), transparent 36%),
    linear-gradient(145deg, rgba(10,31,48,.98), rgba(9,17,34,.99)) !important;
  box-shadow:
    0 20px 42px rgba(0,0,0,.32),
    0 6px 20px rgba(53,208,196,.06),
    inset 0 1px 0 rgba(121,230,220,.05) !important;
}

.two-up {
  gap: 16px !important;
  margin-bottom: 20px !important;
}

.hero-card,
.brief-card,
.leaderboard,
.session-card {
  margin-bottom: 20px !important;
}

.view[data-view="briefs"] > .compact-card + .compact-card {
  margin-top: 20px !important;
}

.view[data-view="briefs"] .brief-card + .compact-card {
  margin-top: 0 !important;
}

.mika-note {
  margin-top: 0 !important;
}

.compact-card {
  padding: 19px !important;
}

.brief-card {
  padding: 22px !important;
}

.icon-button,
.segment,
.preview-pill,
.date-chip,
.online-pill,
.chat-input {
  border-color: rgba(255,255,255,.07) !important;
}

.segment {
  background: rgba(12,21,39,.82) !important;
}

.segment.active {
  background: rgba(244,91,145,.15) !important;
  border-color: rgba(244,91,145,.28) !important;
}

.mini-grid div,
.brief-tags span {
  background: rgba(3,8,20,.36) !important;
}

.leaderboard-head {
  background: rgba(244,91,145,.075) !important;
}

.weak-board .leaderboard-head {
  background: rgba(255,101,125,.065) !important;
}

.leader-row,
.routine-row {
  border-color: rgba(255,255,255,.045) !important;
}

.bottom-nav {
  background: rgba(5,8,20,.94) !important;
  border-top-color: rgba(255,255,255,.055) !important;
}

.nav-item.active {
  background: rgba(244,91,145,.11) !important;
}

.login-body {
  background:
    radial-gradient(circle at 50% 5%, rgba(244,91,145,.12), transparent 30%),
    radial-gradient(circle at 90% 90%, rgba(53,208,196,.07), transparent 28%),
    #050816 !important;
}

.login-card {
  background: linear-gradient(155deg, rgba(17,29,51,.98), rgba(6,11,25,.995)) !important;
}

.avatar,
.login-avatar,
.mika-message img {
  object-fit: cover;
}

.session-card-copy {
  min-width: 0;
}

.session-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}

.secondary-button {
  min-height: 48px;
  border: 0;
  border-radius: 15px;
  background: rgba(53,208,196,.085);
  color: var(--teal-soft);
  font-weight: 750;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(53,208,196,.13);
}

.session-live-status {
  display: inline-flex;
  margin: 14px 0 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size: 10px;
}

.icon-button.alerts-on .notification-dot {
  background: var(--teal);
  box-shadow: 0 0 12px var(--teal);
}

.routine-card {
  overflow: hidden;
}

button.routine-row {
  width: 100%;
  appearance: none;
  color: var(--text);
  text-align: left;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  cursor: pointer;
}

button.routine-row:hover {
  background: rgba(255,255,255,.018);
}

.routine-row.done {
  background: linear-gradient(90deg, rgba(53,208,196,.035), transparent 55%);
}

#psychSummary[data-state="green"] { color: var(--teal-soft); }
#psychSummary[data-state="amber"] { color: #ffd18a; }
#psychSummary[data-state="red"] { color: #ff91a5; }

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 18px;
  background: rgba(2,5,14,.78);
  backdrop-filter: blur(12px);
}

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

.modal-card {
  width: min(100%, 480px);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  border-radius: 28px;
  padding: 24px;
  background:
    radial-gradient(circle at 95% 0%, rgba(53,208,196,.10), transparent 30%),
    linear-gradient(155deg, rgba(17,29,51,.995), rgba(6,11,25,.995)) !important;
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.modal-heading h2 {
  margin-top: 6px;
}

.modal-close {
  width: 42px;
  height: 42px;
  flex: none;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.055);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-intro {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.psych-form {
  display: grid;
  gap: 13px;
}

.range-row {
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.028);
}

.range-row.pressure {
  background: rgba(244,91,145,.035);
}

.range-row label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.range-row output {
  min-width: 28px;
  text-align: center;
  color: var(--teal-soft);
  font-variant-numeric: tabular-nums;
}

.range-row input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.notes-label {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.notes-label span {
  color: var(--muted);
  font-weight: 500;
}

.psych-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 76px;
  border: 0;
  outline: 0;
  border-radius: 16px;
  padding: 13px 14px;
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.psych-form textarea:focus {
  box-shadow: inset 0 0 0 1px rgba(53,208,196,.45), 0 0 0 3px rgba(53,208,196,.08);
}

@media (min-width: 700px) {
  .app-shell {
    border: 0 !important;
    box-shadow: 0 28px 80px rgba(0,0,0,.42) !important;
  }

  .modal-backdrop {
    align-items: center;
  }
}
