

/* ---------- SMARTGOAL RESPONSIVE & ROUTINE EXTENSIONS ---------- */
:root { --content-gutter: clamp(14px, 2.6vw, 35px); }
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
img, svg, video, canvas { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, .nav-link, .icon-button { touch-action: manipulation; }
#content, .content-area, .card, .dashboard-grid > *, .stats-grid > *, .store-grid > * { min-width: 0; }
.main-area { padding-left: var(--content-gutter); padding-right: var(--content-gutter); }
.content-area { width: 100%; }
.routine-card { overflow: hidden; }
.routine-list { display: grid; gap: 0; }
.routine-item { display: grid; grid-template-columns: 76px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 13px 4px; border-top: 1px solid var(--border); }
.routine-item time { color: var(--primary); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.routine-item-content { display: grid; gap: 4px; min-width: 0; }
.routine-item-content strong { overflow-wrap: anywhere; }
.routine-item-content small { color: var(--text-muted); line-height: 1.5; overflow-wrap: anywhere; }
.routine-item-actions { display: flex; gap: 5px; }
.routine-ai { display: grid; gap: 12px; margin-top: 18px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.routine-ai > div { display: grid; gap: 4px; }
.routine-ai > div strong { display: flex; align-items: center; gap: 7px; }
.routine-ai > div small { color: var(--text-muted); line-height: 1.5; }
.routine-ai textarea { width: 100%; min-width: 0; resize: vertical; }
.routine-ai .primary-button { justify-self: start; }
.ai-message, .card-description, .goal-item, .task-info { overflow-wrap: anywhere; }
@media (min-width: 1600px) {
  .content-area { max-width: 1600px; }
}
@media (max-width: 1180px) {
  .main-area { padding-left: 22px; padding-right: 22px; }
  .dashboard-grid { grid-template-columns: minmax(0,1fr); }
  .store-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .main-area { margin-left: 0; padding: 0 18px; }
  .sidebar { transform: translateX(-105%); width: min(var(--sidebar-width), 86vw); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 0 999px rgba(15,23,42,.42), 12px 0 40px rgba(15,23,42,.16); }
  .content-area { padding-top: 20px; }
  .topbar { gap: 10px; }
  .topbar-left, .topbar-right { gap: 9px; }
}
@media (max-width: 640px) {
  .main-area { padding-left: 13px; padding-right: 13px; }
  .topbar { min-height: 64px; }
  .page-date { display: none; }
  .topbar-left, .topbar-right { min-width: 0; }
  .content-area { min-height: calc(100vh - 100px); padding: 18px 0 28px; }
  .stats-grid, .store-grid { grid-template-columns: minmax(0,1fr); gap: 11px; }
  .dashboard-grid { gap: 13px; }
  .card { padding: 16px; border-radius: 15px; }
  .card-header { align-items: flex-start; flex-wrap: wrap; }
  .page-heading, .page-header { gap: 10px; flex-wrap: wrap; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .form-field.full-width { grid-column: auto; }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal { max-height: min(88dvh, 760px); border-radius: 18px 18px 12px 12px; }
  .modal-body { overflow-y: auto; overscroll-behavior: contain; }
  .profile-main-card { padding-left: 16px; padding-right: 16px; }
  .profile-meta, .profile-actions { flex-wrap: wrap; }
  .routine-item { grid-template-columns: 58px minmax(0,1fr); gap: 9px; }
  .routine-item-actions { grid-column: 2; justify-self: end; }
  .routine-ai .primary-button { width: 100%; }
  .ai-input-row { gap: 8px; }
  .ai-input-row input { min-width: 0; }
  .app-footer { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .main-area { padding-left: 9px; padding-right: 9px; }
  .card { padding: 13px; }
  .primary-button, .secondary-button { min-height: 43px; padding-left: 13px; padding-right: 13px; }
  .stats-grid { grid-template-columns: minmax(0,1fr); }
  .routine-item { grid-template-columns: 52px minmax(0,1fr); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .sidebar { overflow-y: auto; overscroll-behavior: contain; }
  .modal { max-height: 94dvh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 640px), (prefers-reduced-motion: reduce) {
  .store-item:hover, .primary-button:hover { transform: none; box-shadow: none; }
}

/* =========================================================
   SMARTGOAL — PREMIUM DESIGN SYSTEM
   Version 2.0
========================================================= */

/* ---------- ROOT ---------- */

:root {
  color-scheme: light;

  --font-main: "DM Sans", sans-serif;
  --font-heading: "Manrope", sans-serif;

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f7;

  --text: #172033;
  --text-secondary: #68738a;
  --text-muted: #98a1b3;

  --primary: #6658e8;
  --primary-hover: #5547d5;
  --primary-soft: #eeecff;

  --accent: #16b8a6;
  --accent-soft: #e4f8f4;

  --blue: #4187ee;
  --blue-soft: #eaf2ff;

  --orange: #f39b4a;
  --orange-soft: #fff3e7;

  --red: #e45c70;
  --red-soft: #fff0f2;

  --green: #22a879;
  --green-soft: #e7f8f0;

  --border: #e8ebf2;
  --border-strong: #dce1eb;

  --sidebar-width: 264px;
  --topbar-height: 84px;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(26, 36, 60, .04);
  --shadow-md: 0 8px 28px rgba(26, 36, 60, .07);
  --shadow-lg: 0 20px 60px rgba(26, 36, 60, .12);

  --transition: .22s ease;
}

/* ---------- DARK THEME ---------- */

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #111522;
  --surface: #191f2f;
  --surface-2: #202739;
  --surface-3: #293247;

  --text: #f1f3fa;
  --text-secondary: #aab3c6;
  --text-muted: #77839a;

  --primary: #9285ff;
  --primary-hover: #a69cff;
  --primary-soft: #302c50;

  --accent: #35cdb9;
  --accent-soft: #183e3c;

  --blue: #71aaff;
  --blue-soft: #233750;

  --orange: #ffb46e;
  --orange-soft: #463324;

  --red: #ff8091;
  --red-soft: #482b38;

  --green: #55d5a2;
  --green-soft: #1d4038;

  --border: #2d3548;
  --border-strong: #3a455c;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .12);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, .18);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .28);
}

/* ---------- THEMES ---------- */

[data-color-theme="ocean"] {
  --primary: #2788cb;
  --primary-hover: #1675b8;
  --primary-soft: #e4f3ff;
}

[data-color-theme="emerald"] {
  --primary: #159b78;
  --primary-hover: #0c8062;
  --primary-soft: #e0f7ef;
}

[data-color-theme="sunset"] {
  --primary: #df7957;
  --primary-hover: #c96443;
  --primary-soft: #fff0e9;
}

[data-color-theme="rose"] {
  --primary: #d65c94;
  --primary-hover: #bc467e;
  --primary-soft: #ffedf5;
}

[data-color-theme="violet"] {
  --primary: #6658e8;
  --primary-hover: #5547d5;
  --primary-soft: #eeecff;
}

/* ---------- RESET ---------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.55;
  transition: background var(--transition), color var(--transition);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(102, 88, 232, .24);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

.app {
  min-height: 100vh;
}

/* ---------- BRAND ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.8px;
}

.brand-large {
  font-size: 27px;
}

.brand-accent {
  color: var(--primary);
}

.brand-mark {
  width: 39px;
  height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--primary);
  color: white;
  box-shadow: 0 7px 18px rgba(102, 88, 232, .24);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

/* ---------- AUTH SCREEN ---------- */

.auth-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--surface);
}

.auth-layout {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-decoration {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(2px);
}

.auth-decoration-one {
  width: 460px;
  height: 460px;
  top: -240px;
  left: -180px;
  background: rgba(102, 88, 232, .08);
}

.auth-decoration-two {
  width: 380px;
  height: 380px;
  right: -180px;
  bottom: -200px;
  background: rgba(22, 184, 166, .08);
}

.auth-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 48px clamp(30px, 6vw, 100px);
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 85% 20%, rgba(142, 129, 255, .35), transparent 35%),
    radial-gradient(circle at 10% 85%, rgba(22, 184, 166, .20), transparent 35%),
    linear-gradient(145deg, #171b39, #27245d 60%, #343078);
}

.auth-showcase::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -180px;
  bottom: -180px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
}

.auth-showcase::after {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  right: -105px;
  bottom: -105px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
}

.auth-showcase .brand {
  position: relative;
  z-index: 2;
  color: white;
}

.auth-showcase .brand-accent {
  color: #a9a0ff;
}

.auth-showcase .brand-mark {
  background: rgba(255,255,255,.15);
  box-shadow: none;
}

.auth-showcase-content {
  position: relative;
  z-index: 2;
  max-width: 540px;
  margin: 50px 0;
}

.eyebrow {
  display: inline-block;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.auth-showcase .eyebrow {
  color: #b9b2ff;
}

.auth-showcase h1 {
  max-width: 550px;
  margin-top: 22px;
  font-family: var(--font-heading);
  font-size: clamp(34px, 4.3vw, 58px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -2.2px;
}

.auth-showcase-content > p {
  max-width: 440px;
  margin-top: 20px;
  color: rgba(255,255,255,.72);
  font-size: 15px;
  line-height: 1.8;
}

.auth-feature-list {
  display: grid;
  gap: 24px;
  margin-top: 52px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 16px;
}

.feature-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 14px;
  background: rgba(255,255,255,.09);
  color: #c6c0ff;
}

.feature-icon svg {
  width: 21px;
  height: 21px;
}

.auth-feature strong,
.auth-feature span {
  display: block;
}

.auth-feature strong {
  font-size: 14px;
  font-weight: 700;
}

.auth-feature div > span {
  margin-top: 3px;
  color: rgba(255,255,255,.58);
  font-size: 12px;
}

.auth-showcase-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: rgba(255,255,255,.55);
  font-size: 11px;
}

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 55px 35px;
  background: var(--surface);
}

.auth-form-container {
  width: 100%;
  max-width: 430px;
}

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 35px;
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 800;
}

.auth-heading h2 {
  margin-top: 12px;
  font-family: var(--font-heading);
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -.8px;
}

.auth-heading p {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 13px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 30px 0;
  padding: 5px;
  border-radius: 13px;
  background: var(--surface-2);
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: grid;
  gap: 19px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field > label {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.form-field small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 49px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  transition: border var(--transition), box-shadow var(--transition);
}

.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 88, 232, .10);
}

.input-wrap > svg {
  width: 17px;
  height: 17px;
  margin-left: 15px;
  color: var(--text-muted);
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  height: 47px;
  padding: 0 13px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.input-wrap input::placeholder {
  color: var(--text-muted);
}

.input-wrap input:focus-visible {
  outline: none;
}

.input-action {
  width: 42px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
}

.input-action svg {
  width: 17px;
  height: 17px;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkbox-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
}

.checkbox-label input {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.terms-label {
  margin-top: 1px;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.text-button:hover {
  text-decoration: underline;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.primary-button:hover {
  transform: translateY(-2px);
  background: var(--primary-hover);
  box-shadow: 0 8px 20px rgba(102, 88, 232, .2);
}

.primary-button svg {
  width: 17px;
  height: 17px;
}

.auth-submit {
  width: 100%;
  margin-top: 5px;
}

.auth-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 27px 0 20px;
  color: var(--text-muted);
  font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  padding: 0 14px;
}

.auth-switch-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
}

.auth-legal {
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 10px;
  text-align: center;
}

/* ---------- APP SHELL ---------- */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 25px 17px 17px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  transition: transform .3s ease, background var(--transition);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 25px;
}

.sidebar-close {
  display: none !important;
}

.sidebar-profile {
  padding: 13px 8px;
  margin-bottom: 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.profile-mini {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  text-align: left;
}

.avatar {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.avatar svg {
  width: 45%;
  height: 45%;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-small {
  width: 37px;
  height: 37px;
}

.avatar-medium {
  width: 42px;
  height: 42px;
}

.avatar-large {
  width: 90px;
  height: 90px;
}

.profile-mini-info {
  min-width: 0;
  flex: 1;
}

.profile-mini-info strong,
.profile-mini-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-mini-info strong {
  font-size: 12px;
  font-weight: 800;
}

.profile-mini-info small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.profile-chevron {
  width: 15px;
  color: var(--text-muted);
}

.main-navigation {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.nav-section-label {
  display: block;
  padding: 12px 12px 9px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.3px;
}

.nav-section-spaced {
  margin-top: 15px;
}

.nav-link {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  margin-bottom: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}

.nav-link > svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.nav-link.active > svg {
  color: var(--primary);
}

.nav-badge {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
}

.notification-dot {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--red);
}

.sidebar-bottom {
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.sidebar-points {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--orange-soft);
}

.points-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(243, 155, 74, .17);
  color: var(--orange);
}

.points-icon svg {
  width: 18px;
}

.sidebar-points small,
.sidebar-points strong {
  display: block;
}

.sidebar-points small {
  color: var(--text-secondary);
  font-size: 10px;
}

.sidebar-points strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.sidebar-logout {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
}

.sidebar-logout:hover {
  background: var(--red-soft);
  color: var(--red);
}

.sidebar-logout svg {
  width: 17px;
}

/* ---------- MAIN CONTENT ---------- */

.main-area {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 0 35px;
  transition: margin var(--transition);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.page-date {
  display: block;
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 10px;
}

.page-heading h1 {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.5px;
}

.topbar-right {
  gap: 13px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-secondary);
  transition: var(--transition);
}

.icon-button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.menu-toggle {
  display: none;
}

.notification-button {
  position: relative;
}

.notification-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--surface);
  border-radius: 50%;
  background: var(--red);
}

.topbar-divider {
  width: 1px;
  height: 30px;
  background: var(--border);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.topbar-user:hover {
  background: var(--surface-2);
}

.topbar-user-name {
  max-width: 140px;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user > svg {
  width: 14px;
  color: var(--text-muted);
}

.global-search {
  position: sticky;
  z-index: 15;
  top: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.global-search > svg {
  width: 18px;
  color: var(--text-muted);
}

.global-search input {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}

.content-area {
  width: 100%;
  max-width: 1500px;
  min-height: calc(100vh - 145px);
  padding: 29px 0 45px;
  margin: 0 auto;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 0 22px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
}

/* ---------- CARDS ---------- */

.card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  border-color: var(--border-strong);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.3px;
}

.card-description {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.card-action svg {
  width: 14px;
}

/* ---------- PAGE HEADINGS ---------- */

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.7px;
}

.section-heading p {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 12px;
}

.section-label {
  display: block;
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* ---------- DASHBOARD ---------- */

.welcome-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  min-height: 190px;
  padding: 30px 34px;
  margin-bottom: 23px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.18), transparent 30%),
    linear-gradient(110deg, #5145cf, #7969ef 70%, #9182fa);
  color: white;
}

.welcome-banner::before,
.welcome-banner::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  pointer-events: none;
}

.welcome-banner::before {
  width: 290px;
  height: 290px;
  right: 8%;
  top: -180px;
}

.welcome-banner::after {
  width: 210px;
  height: 210px;
  right: 2%;
  bottom: -160px;
}

.welcome-content {
  position: relative;
  z-index: 2;
  max-width: 590px;
}

.welcome-content .eyebrow {
  color: rgba(255,255,255,.7);
}

.welcome-content h2 {
  margin-top: 10px;
  font-family: var(--font-heading);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -.8px;
}

.welcome-content p {
  max-width: 490px;
  margin-top: 8px;
  color: rgba(255,255,255,.76);
  font-size: 12px;
  line-height: 1.7;
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 19px;
}

.welcome-banner .primary-button {
  background: white;
  color: #5145cf;
}

.welcome-banner .primary-button:hover {
  background: #f2f0ff;
}

.welcome-visual {
  position: relative;
  z-index: 2;
  width: 145px;
  height: 145px;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 34px;
  background: rgba(255,255,255,.11);
  transform: rotate(8deg);
}

.welcome-visual svg {
  width: 75px;
  height: 75px;
  color: white;
  stroke-width: 1.4;
  transform: rotate(-8deg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  position: relative;
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.stat-icon svg {
  width: 19px;
  height: 19px;
}

.stat-icon.purple {
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.stat-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.stat-icon.orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.stat-label {
  margin-top: 17px;
  color: var(--text-secondary);
  font-size: 11px;
}

.stat-value {
  margin-top: 3px;
  font-family: var(--font-heading);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.7px;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.stat-change svg {
  width: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .9fr);
  gap: 20px;
}

.dashboard-column {
  display: grid;
  align-content: start;
  gap: 20px;
}

/* ---------- PROGRESS ---------- */

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 30px;
  background: var(--surface-3);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .5s ease;
}

.progress-fill.green {
  background: var(--green);
}

.progress-fill.orange {
  background: var(--orange);
}

.progress-fill.blue {
  background: var(--blue);
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.progress-row span {
  color: var(--text-secondary);
  font-size: 11px;
}

.progress-row strong {
  font-size: 11px;
}

/* ---------- TASKS ---------- */

.task-list {
  display: grid;
  gap: 10px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  transition: var(--transition);
}

.task-item:hover {
  background: var(--surface-2);
}

.task-checkbox {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.task-info {
  min-width: 0;
  flex: 1;
}

.task-info strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-info small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.task-completed .task-info strong {
  color: var(--text-muted);
  text-decoration: line-through;
}

.task-reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.task-reward svg {
  width: 12px;
  height: 12px;
}

/* ---------- GOALS ---------- */

.goal-list {
  display: grid;
  gap: 14px;
}

.goal-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.goal-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 13px;
}

.goal-item-header strong {
  font-size: 12px;
  font-weight: 800;
}

.goal-item-header small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.goal-percentage {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.goal-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 10px;
}

/* ---------- CHARTS ---------- */

.chart-container {
  position: relative;
  width: 100%;
  min-height: 210px;
}

.chart-container svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.chart-label {
  fill: var(--text-muted);
  font-size: 10px;
  font-family: var(--font-main);
}

.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: url(#chartGradient);
  opacity: .2;
}

.chart-point {
  fill: var(--primary);
  stroke: var(--surface);
  stroke-width: 3;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 17px;
  margin-top: 15px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 10px;
}

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

/* ---------- PROFILE ---------- */

.profile-cover {
  position: relative;
  min-height: 185px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 80% 15%, rgba(255,255,255,.2), transparent 25%),
    linear-gradient(120deg, #5145cf, #9282f6);
}

.profile-cover::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  top: -150px;
  right: 15%;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
}

.profile-main-card {
  position: relative;
  padding: 0 25px 25px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.profile-avatar-wrap {
  position: relative;
  width: fit-content;
  margin-top: -48px;
}

.profile-avatar-wrap .avatar {
  width: 100px;
  height: 100px;
  border: 5px solid var(--surface);
  background: var(--primary-soft);
}

.profile-edit-avatar {
  position: absolute;
  right: 3px;
  bottom: 4px;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--primary);
  color: white;
}

.profile-edit-avatar svg {
  width: 14px;
}

.profile-name {
  margin-top: 13px;
  font-family: var(--font-heading);
  font-size: 23px;
  font-weight: 800;
}

.profile-username {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.profile-bio {
  max-width: 600px;
  margin-top: 13px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.8;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 10px;
}

.profile-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-meta svg {
  width: 14px;
  color: var(--text-muted);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  transition: var(--transition);
}

.secondary-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.secondary-button svg {
  width: 15px;
}

.level-card {
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.level-number {
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 35px;
  font-weight: 800;
}

.level-title {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
}

.level-description {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.7;
}

/* ---------- BADGES AND ACHIEVEMENTS ---------- */

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 13px;
}

.achievement-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 145px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  text-align: center;
}

.achievement-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
}

.achievement-icon svg {
  width: 23px;
  height: 23px;
}

.achievement-card strong {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 800;
}

.achievement-card small {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 9px;
}

.achievement-card.locked {
  opacity: .5;
  filter: grayscale(.7);
}

/* ---------- STORE ---------- */

.store-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}

.store-item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  transition: transform var(--transition), box-shadow var(--transition);
}

.store-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.store-preview {
  position: relative;
  min-height: 135px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-2);
}

.store-preview svg {
  width: 47px;
  height: 47px;
  color: var(--primary);
  stroke-width: 1.5;
}

.store-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-content {
  padding: 15px;
}

.store-content h3 {
  font-size: 12px;
  font-weight: 800;
}

.store-content p {
  min-height: 32px;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 10px;
}

.store-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
}

.store-price strong {
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
}

/* ---------- COMMUNITY ---------- */

.user-list {
  display: grid;
  gap: 11px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.user-item-info {
  flex: 1;
  min-width: 0;
}

.user-item-info strong {
  display: block;
  font-size: 12px;
}

.user-item-info small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.user-rank {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
}

/* ---------- FORMS ---------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  transition: var(--transition);
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 88, 232, .1);
}

.field-textarea {
  min-height: 100px;
  resize: vertical;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

/* ---------- SETTINGS ---------- */

.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 20px;
}

.settings-nav {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}

.settings-nav button {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
}

.settings-nav button.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.settings-nav button svg {
  width: 16px;
}

.settings-panel {
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}

.settings-section + .settings-section {
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid var(--border);
}

.settings-section h3 {
  font-size: 14px;
  font-weight: 800;
}

.settings-section > p {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-info {
  min-width: 0;
}

.setting-info strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.setting-info small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.toggle {
  position: relative;
  width: 43px;
  height: 24px;
  flex-shrink: 0;
  border: 0;
  border-radius: 30px;
  background: var(--surface-3);
  transition: background var(--transition);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: transform var(--transition);
}

.toggle.active {
  background: var(--primary);
}

.toggle.active::after {
  transform: translateX(19px);
}

.theme-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 13px;
}

.theme-option {
  width: 39px;
  height: 39px;
  border: 3px solid var(--surface);
  border-radius: 12px;
  outline: 1px solid var(--border-strong);
  cursor: pointer;
}

.theme-option.active {
  outline: 2px solid var(--primary);
}

.theme-option[data-color-theme="violet"] {
  background: #6658e8;
}

.theme-option[data-color-theme="ocean"] {
  background: #2788cb;
}

.theme-option[data-color-theme="emerald"] {
  background: #159b78;
}

.theme-option[data-color-theme="sunset"] {
  background: #df7957;
}

.theme-option[data-color-theme="rose"] {
  background: #d65c94;
}

/* ---------- MODAL ---------- */

.modal-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13, 18, 35, .58);
  backdrop-filter: blur(5px);
  animation: fadeIn .2s ease;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: min(85vh, 750px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 23px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin-top: 4px;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
}

.modal-body {
  overflow-y: auto;
  padding: 23px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 23px;
  border-top: 1px solid var(--border);
}

/* ---------- TOAST ---------- */

.toast-container {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  width: min(370px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
}

.toast-icon {
  width: 34px;
  height: 34px;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
}

.toast-icon svg {
  width: 18px;
}

.toast-message {
  flex: 1;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.toast-close {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
}

.toast-close svg {
  width: 15px;
}

/* ---------- EMPTY AND LOADING STATES ---------- */

.empty-state,
.loading-state {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
}

.empty-state-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--primary-soft);
  color: var(--primary);
}

.empty-state-icon svg {
  width: 25px;
}

.empty-state h3 {
  font-size: 14px;
  font-weight: 800;
}

.empty-state p,
.loading-state p {
  max-width: 330px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.7;
}

.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ---------- AI SECTION ---------- */

.ai-panel {
  position: relative;
  padding: 27px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 10%, rgba(255,255,255,.18), transparent 25%),
    linear-gradient(120deg, #26254f, #5145cf);
  color: white;
}

.ai-panel h2 {
  max-width: 600px;
  margin-top: 12px;
  font-family: var(--font-heading);
  font-size: 25px;
  font-weight: 800;
}

.ai-panel p {
  max-width: 550px;
  margin-top: 9px;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  line-height: 1.8;
}

.ai-chat {
  display: grid;
  gap: 13px;
  margin-top: 20px;
}

.ai-message {
  max-width: 85%;
  padding: 13px 15px;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
}

.ai-message.user {
  justify-self: end;
  background: var(--primary-soft);
  color: var(--primary);
}

.ai-input-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.ai-input-row input {
  flex: 1;
  min-width: 0;
  height: 37px;
  padding: 0 10px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

/* ---------- NOTIFICATIONS ---------- */

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.notification-item.unread {
  border-left: 3px solid var(--primary);
  background: var(--surface-2);
}

.notification-item > div:last-child {
  flex: 1;
}

.notification-item strong {
  display: block;
  font-size: 12px;
}

.notification-item p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
}

.notification-item small {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 9px;
}

/* ---------- CALENDAR ---------- */

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.calendar-day {
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px;
}

.calendar-day.today {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.calendar-day small {
  font-size: 9px;
}

/* ---------- ANIMATIONS ---------- */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- RESPONSIVE: TABLET ---------- */

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 235px;
  }

  .main-area {
    padding: 0 25px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(250px, .9fr);
  }

  .auth-showcase {
    padding: 40px;
  }
}

/* ---------- RESPONSIVE: SMALL TABLET ---------- */

@media (max-width: 850px) {
  .sidebar {
    z-index: 80;
    transform: translateX(-105%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-grid !important;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 70;
    inset: 0;
    display: none;
    background: rgba(10, 15, 30, .45);
    backdrop-filter: blur(2px);
  }

  .sidebar.open ~ .sidebar-backdrop {
    display: block;
  }

  .main-area {
    margin-left: 0;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    grid-template-columns: .8fr 1fr;
  }

  .auth-showcase {
    padding: 35px 28px;
  }

  .auth-showcase h1 {
    font-size: 36px;
  }

  .auth-feature-list {
    gap: 18px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .settings-nav button {
    justify-content: center;
    padding: 7px;
    font-size: 10px;
  }
}

/* ---------- RESPONSIVE: MOBILE ---------- */

@media (max-width: 600px) {
  body {
    font-size: 13px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    display: none;
  }

  .auth-form-side {
    min-height: 100vh;
    align-items: flex-start;
    padding: 35px 22px;
  }

  .auth-form-container {
    max-width: 450px;
    margin: auto;
  }

  .auth-mobile-brand {
    display: flex;
  }

  .auth-heading h2 {
    font-size: 25px;
  }

  .auth-tabs {
    margin: 24px 0;
  }

  .auth-legal {
    margin-top: 28px;
  }

  .main-area {
    padding: 0 15px;
  }

  .topbar {
    min-height: 70px;
    gap: 8px;
  }

  .topbar-left {
    gap: 9px;
  }

  .topbar-right {
    gap: 7px;
  }

  .page-heading h1 {
    font-size: 16px;
  }

  .page-date {
    font-size: 9px;
  }

  .topbar-user-name,
  .topbar-user > svg,
  .topbar-divider {
    display: none;
  }

  .topbar-user {
    padding: 0;
  }

  .icon-button {
    width: 35px;
    height: 35px;
  }

  .content-area {
    min-height: calc(100vh - 130px);
    padding-top: 20px;
  }

  .welcome-banner {
    min-height: 0;
    padding: 23px;
    border-radius: 19px;
  }

  .welcome-content h2 {
    font-size: 23px;
  }

  .welcome-content p {
    font-size: 11px;
  }

  .welcome-visual {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-label {
    font-size: 10px;
  }

  .card {
    padding: 17px;
    border-radius: 16px;
  }

  .section-heading h2 {
    font-size: 18px;
  }

  .section-heading p {
    font-size: 10px;
  }

  .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .store-preview {
    min-height: 100px;
  }

  .store-content {
    padding: 11px;
  }

  .store-content h3 {
    font-size: 11px;
  }

  .badge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-cover {
    min-height: 125px;
  }

  .profile-main-card {
    padding: 0 17px 19px;
  }

  .profile-name {
    font-size: 20px;
  }

  .profile-avatar-wrap .avatar {
    width: 83px;
    height: 83px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full-width {
    grid-column: auto;
  }

  .settings-panel {
    padding: 16px;
  }

  .settings-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-nav button {
    justify-content: flex-start;
  }

  .calendar-grid {
    gap: 4px;
  }

  .calendar-day {
    min-height: 52px;
    border-radius: 8px;
    font-size: 10px;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 17px;
    padding-right: 17px;
  }

  .app-footer {
    font-size: 9px;
  }
}

/* ---------- VERY SMALL SCREENS ---------- */

@media (max-width: 370px) {
  .main-area {
    padding: 0 11px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    padding: 11px;
  }

  .stat-value {
    font-size: 19px;
  }

  .welcome-banner {
    padding: 18px;
  }

  .welcome-content h2 {
    font-size: 20px;
  }

  .topbar-right {
    gap: 5px;
  }
}/* =========================================================
   SMARTGOAL — PREMIUM DESIGN SYSTEM
   Version 2.0
========================================================= */

/* ---------- ROOT ---------- */

:root {
  color-scheme: light;

  --font-main: "DM Sans", sans-serif;
  --font-heading: "Manrope", sans-serif;

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f7;

  --text: #172033;
  --text-secondary: #68738a;
  --text-muted: #98a1b3;

  --primary: #6658e8;
  --primary-hover: #5547d5;
  --primary-soft: #eeecff;

  --accent: #16b8a6;
  --accent-soft: #e4f8f4;

  --blue: #4187ee;
  --blue-soft: #eaf2ff;

  --orange: #f39b4a;
  --orange-soft: #fff3e7;

  --red: #e45c70;
  --red-soft: #fff0f2;

  --green: #22a879;
  --green-soft: #e7f8f0;

  --border: #e8ebf2;
  --border-strong: #dce1eb;

  --sidebar-width: 264px;
  --topbar-height: 84px;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(26, 36, 60, .04);
  --shadow-md: 0 8px 28px rgba(26, 36, 60, .07);
  --shadow-lg: 0 20px 60px rgba(26, 36, 60, .12);

  --transition: .22s ease;
}

/* ---------- DARK THEME ---------- */

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #111522;
  --surface: #191f2f;
  --surface-2: #202739;
  --surface-3: #293247;

  --text: #f1f3fa;
  --text-secondary: #aab3c6;
  --text-muted: #77839a;

  --primary: #9285ff;
  --primary-hover: #a69cff;
  --primary-soft: #302c50;

  --accent: #35cdb9;
  --accent-soft: #183e3c;

  --blue: #71aaff;
  --blue-soft: #233750;

  --orange: #ffb46e;
  --orange-soft: #463324;

  --red: #ff8091;
  --red-soft: #482b38;

  --green: #55d5a2;
  --green-soft: #1d4038;

  --border: #2d3548;
  --border-strong: #3a455c;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .12);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, .18);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .28);
}

/* ---------- THEMES ---------- */

[data-color-theme="ocean"] {
  --primary: #2788cb;
  --primary-hover: #1675b8;
  --primary-soft: #e4f3ff;
}

[data-color-theme="emerald"] {
  --primary: #159b78;
  --primary-hover: #0c8062;
  --primary-soft: #e0f7ef;
}

[data-color-theme="sunset"] {
  --primary: #df7957;
  --primary-hover: #c96443;
  --primary-soft: #fff0e9;
}

[data-color-theme="rose"] {
  --primary: #d65c94;
  --primary-hover: #bc467e;
  --primary-soft: #ffedf5;
}

[data-color-theme="violet"] {
  --primary: #6658e8;
  --primary-hover: #5547d5;
  --primary-soft: #eeecff;
}

/* ---------- RESET ---------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.55;
  transition: background var(--transition), color var(--transition);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(102, 88, 232, .24);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

.app {
  min-height: 100vh;
}

/* ---------- BRAND ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.8px;
}

.brand-large {
  font-size: 27px;
}

.brand-accent {
  color: var(--primary);
}

.brand-mark {
  width: 39px;
  height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--primary);
  color: white;
  box-shadow: 0 7px 18px rgba(102, 88, 232, .24);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

/* ---------- AUTH SCREEN ---------- */

.auth-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--surface);
}

.auth-layout {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-decoration {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(2px);
}

.auth-decoration-one {
  width: 460px;
  height: 460px;
  top: -240px;
  left: -180px;
  background: rgba(102, 88, 232, .08);
}

.auth-decoration-two {
  width: 380px;
  height: 380px;
  right: -180px;
  bottom: -200px;
  background: rgba(22, 184, 166, .08);
}

.auth-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 48px clamp(30px, 6vw, 100px);
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 85% 20%, rgba(142, 129, 255, .35), transparent 35%),
    radial-gradient(circle at 10% 85%, rgba(22, 184, 166, .20), transparent 35%),
    linear-gradient(145deg, #171b39, #27245d 60%, #343078);
}

.auth-showcase::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -180px;
  bottom: -180px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
}

.auth-showcase::after {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  right: -105px;
  bottom: -105px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
}

.auth-showcase .brand {
  position: relative;
  z-index: 2;
  color: white;
}

.auth-showcase .brand-accent {
  color: #a9a0ff;
}

.auth-showcase .brand-mark {
  background: rgba(255,255,255,.15);
  box-shadow: none;
}

.auth-showcase-content {
  position: relative;
  z-index: 2;
  max-width: 540px;
  margin: 50px 0;
}

.eyebrow {
  display: inline-block;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.auth-showcase .eyebrow {
  color: #b9b2ff;
}

.auth-showcase h1 {
  max-width: 550px;
  margin-top: 22px;
  font-family: var(--font-heading);
  font-size: clamp(34px, 4.3vw, 58px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -2.2px;
}

.auth-showcase-content > p {
  max-width: 440px;
  margin-top: 20px;
  color: rgba(255,255,255,.72);
  font-size: 15px;
  line-height: 1.8;
}

.auth-feature-list {
  display: grid;
  gap: 24px;
  margin-top: 52px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 16px;
}

.feature-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 14px;
  background: rgba(255,255,255,.09);
  color: #c6c0ff;
}

.feature-icon svg {
  width: 21px;
  height: 21px;
}

.auth-feature strong,
.auth-feature span {
  display: block;
}

.auth-feature strong {
  font-size: 14px;
  font-weight: 700;
}

.auth-feature div > span {
  margin-top: 3px;
  color: rgba(255,255,255,.58);
  font-size: 12px;
}

.auth-showcase-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: rgba(255,255,255,.55);
  font-size: 11px;
}

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 55px 35px;
  background: var(--surface);
}

.auth-form-container {
  width: 100%;
  max-width: 430px;
}

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 35px;
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 800;
}

.auth-heading h2 {
  margin-top: 12px;
  font-family: var(--font-heading);
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -.8px;
}

.auth-heading p {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 13px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 30px 0;
  padding: 5px;
  border-radius: 13px;
  background: var(--surface-2);
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: grid;
  gap: 19px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field > label {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.form-field small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 49px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  transition: border var(--transition), box-shadow var(--transition);
}

.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 88, 232, .10);
}

.input-wrap > svg {
  width: 17px;
  height: 17px;
  margin-left: 15px;
  color: var(--text-muted);
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  height: 47px;
  padding: 0 13px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.input-wrap input::placeholder {
  color: var(--text-muted);
}

.input-wrap input:focus-visible {
  outline: none;
}

.input-action {
  width: 42px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
}

.input-action svg {
  width: 17px;
  height: 17px;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkbox-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
}

.checkbox-label input {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.terms-label {
  margin-top: 1px;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.text-button:hover {
  text-decoration: underline;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.primary-button:hover {
  transform: translateY(-2px);
  background: var(--primary-hover);
  box-shadow: 0 8px 20px rgba(102, 88, 232, .2);
}

.primary-button svg {
  width: 17px;
  height: 17px;
}

.auth-submit {
  width: 100%;
  margin-top: 5px;
}

.auth-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 27px 0 20px;
  color: var(--text-muted);
  font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  padding: 0 14px;
}

.auth-switch-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
}

.auth-legal {
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 10px;
  text-align: center;
}

/* ---------- APP SHELL ---------- */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 25px 17px 17px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  transition: transform .3s ease, background var(--transition);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 25px;
}

.sidebar-close {
  display: none !important;
}

.sidebar-profile {
  padding: 13px 8px;
  margin-bottom: 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.profile-mini {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  text-align: left;
}

.avatar {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.avatar svg {
  width: 45%;
  height: 45%;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-small {
  width: 37px;
  height: 37px;
}

.avatar-medium {
  width: 42px;
  height: 42px;
}

.avatar-large {
  width: 90px;
  height: 90px;
}

.profile-mini-info {
  min-width: 0;
  flex: 1;
}

.profile-mini-info strong,
.profile-mini-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-mini-info strong {
  font-size: 12px;
  font-weight: 800;
}

.profile-mini-info small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.profile-chevron {
  width: 15px;
  color: var(--text-muted);
}

.main-navigation {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.nav-section-label {
  display: block;
  padding: 12px 12px 9px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.3px;
}

.nav-section-spaced {
  margin-top: 15px;
}

.nav-link {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  margin-bottom: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}

.nav-link > svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.nav-link.active > svg {
  color: var(--primary);
}

.nav-badge {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
}

.notification-dot {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--red);
}

.sidebar-bottom {
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.sidebar-points {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--orange-soft);
}

.points-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(243, 155, 74, .17);
  color: var(--orange);
}

.points-icon svg {
  width: 18px;
}

.sidebar-points small,
.sidebar-points strong {
  display: block;
}

.sidebar-points small {
  color: var(--text-secondary);
  font-size: 10px;
}

.sidebar-points strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.sidebar-logout {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
}

.sidebar-logout:hover {
  background: var(--red-soft);
  color: var(--red);
}

.sidebar-logout svg {
  width: 17px;
}

/* ---------- MAIN CONTENT ---------- */

.main-area {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 0 35px;
  transition: margin var(--transition);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.page-date {
  display: block;
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 10px;
}

.page-heading h1 {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.5px;
}

.topbar-right {
  gap: 13px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-secondary);
  transition: var(--transition);
}

.icon-button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.menu-toggle {
  display: none;
}

.notification-button {
  position: relative;
}

.notification-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--surface);
  border-radius: 50%;
  background: var(--red);
}

.topbar-divider {
  width: 1px;
  height: 30px;
  background: var(--border);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.topbar-user:hover {
  background: var(--surface-2);
}

.topbar-user-name {
  max-width: 140px;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user > svg {
  width: 14px;
  color: var(--text-muted);
}

.global-search {
  position: sticky;
  z-index: 15;
  top: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.global-search > svg {
  width: 18px;
  color: var(--text-muted);
}

.global-search input {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}

.content-area {
  width: 100%;
  max-width: 1500px;
  min-height: calc(100vh - 145px);
  padding: 29px 0 45px;
  margin: 0 auto;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 0 22px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
}

/* ---------- CARDS ---------- */

.card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  border-color: var(--border-strong);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.3px;
}

.card-description {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.card-action svg {
  width: 14px;
}

/* ---------- PAGE HEADINGS ---------- */

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.7px;
}

.section-heading p {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 12px;
}

.section-label {
  display: block;
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* ---------- DASHBOARD ---------- */

.welcome-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  min-height: 190px;
  padding: 30px 34px;
  margin-bottom: 23px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.18), transparent 30%),
    linear-gradient(110deg, #5145cf, #7969ef 70%, #9182fa);
  color: white;
}

.welcome-banner::before,
.welcome-banner::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  pointer-events: none;
}

.welcome-banner::before {
  width: 290px;
  height: 290px;
  right: 8%;
  top: -180px;
}

.welcome-banner::after {
  width: 210px;
  height: 210px;
  right: 2%;
  bottom: -160px;
}

.welcome-content {
  position: relative;
  z-index: 2;
  max-width: 590px;
}

.welcome-content .eyebrow {
  color: rgba(255,255,255,.7);
}

.welcome-content h2 {
  margin-top: 10px;
  font-family: var(--font-heading);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -.8px;
}

.welcome-content p {
  max-width: 490px;
  margin-top: 8px;
  color: rgba(255,255,255,.76);
  font-size: 12px;
  line-height: 1.7;
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 19px;
}

.welcome-banner .primary-button {
  background: white;
  color: #5145cf;
}

.welcome-banner .primary-button:hover {
  background: #f2f0ff;
}

.welcome-visual {
  position: relative;
  z-index: 2;
  width: 145px;
  height: 145px;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 34px;
  background: rgba(255,255,255,.11);
  transform: rotate(8deg);
}

.welcome-visual svg {
  width: 75px;
  height: 75px;
  color: white;
  stroke-width: 1.4;
  transform: rotate(-8deg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  position: relative;
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.stat-icon svg {
  width: 19px;
  height: 19px;
}

.stat-icon.purple {
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.stat-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.stat-icon.orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.stat-label {
  margin-top: 17px;
  color: var(--text-secondary);
  font-size: 11px;
}

.stat-value {
  margin-top: 3px;
  font-family: var(--font-heading);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.7px;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.stat-change svg {
  width: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .9fr);
  gap: 20px;
}

.dashboard-column {
  display: grid;
  align-content: start;
  gap: 20px;
}

/* ---------- PROGRESS ---------- */

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 30px;
  background: var(--surface-3);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .5s ease;
}

.progress-fill.green {
  background: var(--green);
}

.progress-fill.orange {
  background: var(--orange);
}

.progress-fill.blue {
  background: var(--blue);
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.progress-row span {
  color: var(--text-secondary);
  font-size: 11px;
}

.progress-row strong {
  font-size: 11px;
}

/* ---------- TASKS ---------- */

.task-list {
  display: grid;
  gap: 10px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  transition: var(--transition);
}

.task-item:hover {
  background: var(--surface-2);
}

.task-checkbox {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.task-info {
  min-width: 0;
  flex: 1;
}

.task-info strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-info small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.task-completed .task-info strong {
  color: var(--text-muted);
  text-decoration: line-through;
}

.task-reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.task-reward svg {
  width: 12px;
  height: 12px;
}

/* ---------- GOALS ---------- */

.goal-list {
  display: grid;
  gap: 14px;
}

.goal-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.goal-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 13px;
}

.goal-item-header strong {
  font-size: 12px;
  font-weight: 800;
}

.goal-item-header small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.goal-percentage {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.goal-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 10px;
}

/* ---------- CHARTS ---------- */

.chart-container {
  position: relative;
  width: 100%;
  min-height: 210px;
}

.chart-container svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.chart-label {
  fill: var(--text-muted);
  font-size: 10px;
  font-family: var(--font-main);
}

.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: url(#chartGradient);
  opacity: .2;
}

.chart-point {
  fill: var(--primary);
  stroke: var(--surface);
  stroke-width: 3;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 17px;
  margin-top: 15px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 10px;
}

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

/* ---------- PROFILE ---------- */

.profile-cover {
  position: relative;
  min-height: 185px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 80% 15%, rgba(255,255,255,.2), transparent 25%),
    linear-gradient(120deg, #5145cf, #9282f6);
}

.profile-cover::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  top: -150px;
  right: 15%;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
}

.profile-main-card {
  position: relative;
  padding: 0 25px 25px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.profile-avatar-wrap {
  position: relative;
  width: fit-content;
  margin-top: -48px;
}

.profile-avatar-wrap .avatar {
  width: 100px;
  height: 100px;
  border: 5px solid var(--surface);
  background: var(--primary-soft);
}

.profile-edit-avatar {
  position: absolute;
  right: 3px;
  bottom: 4px;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--primary);
  color: white;
}

.profile-edit-avatar svg {
  width: 14px;
}

.profile-name {
  margin-top: 13px;
  font-family: var(--font-heading);
  font-size: 23px;
  font-weight: 800;
}

.profile-username {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.profile-bio {
  max-width: 600px;
  margin-top: 13px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.8;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 10px;
}

.profile-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-meta svg {
  width: 14px;
  color: var(--text-muted);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  transition: var(--transition);
}

.secondary-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.secondary-button svg {
  width: 15px;
}

.level-card {
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.level-number {
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 35px;
  font-weight: 800;
}

.level-title {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
}

.level-description {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.7;
}

/* ---------- BADGES AND ACHIEVEMENTS ---------- */

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 13px;
}

.achievement-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 145px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  text-align: center;
}

.achievement-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
}

.achievement-icon svg {
  width: 23px;
  height: 23px;
}

.achievement-card strong {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 800;
}

.achievement-card small {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 9px;
}

.achievement-card.locked {
  opacity: .5;
  filter: grayscale(.7);
}

/* ---------- STORE ---------- */

.store-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}

.store-item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  transition: transform var(--transition), box-shadow var(--transition);
}

.store-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.store-preview {
  position: relative;
  min-height: 135px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-2);
}

.store-preview svg {
  width: 47px;
  height: 47px;
  color: var(--primary);
  stroke-width: 1.5;
}

.store-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-content {
  padding: 15px;
}

.store-content h3 {
  font-size: 12px;
  font-weight: 800;
}

.store-content p {
  min-height: 32px;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 10px;
}

.store-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
}

.store-price strong {
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
}

/* ---------- COMMUNITY ---------- */

.user-list {
  display: grid;
  gap: 11px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.user-item-info {
  flex: 1;
  min-width: 0;
}

.user-item-info strong {
  display: block;
  font-size: 12px;
}

.user-item-info small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.user-rank {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
}

/* ---------- FORMS ---------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  transition: var(--transition);
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 88, 232, .1);
}

.field-textarea {
  min-height: 100px;
  resize: vertical;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

/* ---------- SETTINGS ---------- */

.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 20px;
}

.settings-nav {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}

.settings-nav button {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
}

.settings-nav button.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.settings-nav button svg {
  width: 16px;
}

.settings-panel {
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}

.settings-section + .settings-section {
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid var(--border);
}

.settings-section h3 {
  font-size: 14px;
  font-weight: 800;
}

.settings-section > p {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-info {
  min-width: 0;
}

.setting-info strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.setting-info small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.toggle {
  position: relative;
  width: 43px;
  height: 24px;
  flex-shrink: 0;
  border: 0;
  border-radius: 30px;
  background: var(--surface-3);
  transition: background var(--transition);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: transform var(--transition);
}

.toggle.active {
  background: var(--primary);
}

.toggle.active::after {
  transform: translateX(19px);
}

.theme-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 13px;
}

.theme-option {
  width: 39px;
  height: 39px;
  border: 3px solid var(--surface);
  border-radius: 12px;
  outline: 1px solid var(--border-strong);
  cursor: pointer;
}

.theme-option.active {
  outline: 2px solid var(--primary);
}

.theme-option[data-color-theme="violet"] {
  background: #6658e8;
}

.theme-option[data-color-theme="ocean"] {
  background: #2788cb;
}

.theme-option[data-color-theme="emerald"] {
  background: #159b78;
}

.theme-option[data-color-theme="sunset"] {
  background: #df7957;
}

.theme-option[data-color-theme="rose"] {
  background: #d65c94;
}

/* ---------- MODAL ---------- */

.modal-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13, 18, 35, .58);
  backdrop-filter: blur(5px);
  animation: fadeIn .2s ease;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: min(85vh, 750px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 23px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin-top: 4px;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
}

.modal-body {
  overflow-y: auto;
  padding: 23px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 23px;
  border-top: 1px solid var(--border);
}

/* ---------- TOAST ---------- */

.toast-container {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  width: min(370px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
}

.toast-icon {
  width: 34px;
  height: 34px;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
}

.toast-icon svg {
  width: 18px;
}

.toast-message {
  flex: 1;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.toast-close {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
}

.toast-close svg {
  width: 15px;
}

/* ---------- EMPTY AND LOADING STATES ---------- */

.empty-state,
.loading-state {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
}

.empty-state-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--primary-soft);
  color: var(--primary);
}

.empty-state-icon svg {
  width: 25px;
}

.empty-state h3 {
  font-size: 14px;
  font-weight: 800;
}

.empty-state p,
.loading-state p {
  max-width: 330px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.7;
}

.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ---------- AI SECTION ---------- */

.ai-panel {
  position: relative;
  padding: 27px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 10%, rgba(255,255,255,.18), transparent 25%),
    linear-gradient(120deg, #26254f, #5145cf);
  color: white;
}

.ai-panel h2 {
  max-width: 600px;
  margin-top: 12px;
  font-family: var(--font-heading);
  font-size: 25px;
  font-weight: 800;
}

.ai-panel p {
  max-width: 550px;
  margin-top: 9px;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  line-height: 1.8;
}

.ai-chat {
  display: grid;
  gap: 13px;
  margin-top: 20px;
}

.ai-message {
  max-width: 85%;
  padding: 13px 15px;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
}

.ai-message.user {
  justify-self: end;
  background: var(--primary-soft);
  color: var(--primary);
}

.ai-input-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.ai-input-row input {
  flex: 1;
  min-width: 0;
  height: 37px;
  padding: 0 10px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

/* ---------- NOTIFICATIONS ---------- */

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.notification-item.unread {
  border-left: 3px solid var(--primary);
  background: var(--surface-2);
}

.notification-item > div:last-child {
  flex: 1;
}

.notification-item strong {
  display: block;
  font-size: 12px;
}

.notification-item p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
}

.notification-item small {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 9px;
}

/* ---------- CALENDAR ---------- */

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.calendar-day {
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px;
}

.calendar-day.today {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.calendar-day small {
  font-size: 9px;
}

/* ---------- ANIMATIONS ---------- */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- RESPONSIVE: TABLET ---------- */

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 235px;
  }

  .main-area {
    padding: 0 25px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(250px, .9fr);
  }

  .auth-showcase {
    padding: 40px;
  }
}

/* ---------- RESPONSIVE: SMALL TABLET ---------- */

@media (max-width: 850px) {
  .sidebar {
    z-index: 80;
    transform: translateX(-105%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-grid !important;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 70;
    inset: 0;
    display: none;
    background: rgba(10, 15, 30, .45);
    backdrop-filter: blur(2px);
  }

  .sidebar.open ~ .sidebar-backdrop {
    display: block;
  }

  .main-area {
    margin-left: 0;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    grid-template-columns: .8fr 1fr;
  }

  .auth-showcase {
    padding: 35px 28px;
  }

  .auth-showcase h1 {
    font-size: 36px;
  }

  .auth-feature-list {
    gap: 18px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .settings-nav button {
    justify-content: center;
    padding: 7px;
    font-size: 10px;
  }
}

/* ---------- RESPONSIVE: MOBILE ---------- */

@media (max-width: 600px) {
  body {
    font-size: 13px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    display: none;
  }

  .auth-form-side {
    min-height: 100vh;
    align-items: flex-start;
    padding: 35px 22px;
  }

  .auth-form-container {
    max-width: 450px;
    margin: auto;
  }

  .auth-mobile-brand {
    display: flex;
  }

  .auth-heading h2 {
    font-size: 25px;
  }

  .auth-tabs {
    margin: 24px 0;
  }

  .auth-legal {
    margin-top: 28px;
  }

  .main-area {
    padding: 0 15px;
  }

  .topbar {
    min-height: 70px;
    gap: 8px;
  }

  .topbar-left {
    gap: 9px;
  }

  .topbar-right {
    gap: 7px;
  }

  .page-heading h1 {
    font-size: 16px;
  }

  .page-date {
    font-size: 9px;
  }

  .topbar-user-name,
  .topbar-user > svg,
  .topbar-divider {
    display: none;
  }

  .topbar-user {
    padding: 0;
  }

  .icon-button {
    width: 35px;
    height: 35px;
  }

  .content-area {
    min-height: calc(100vh - 130px);
    padding-top: 20px;
  }

  .welcome-banner {
    min-height: 0;
    padding: 23px;
    border-radius: 19px;
  }

  .welcome-content h2 {
    font-size: 23px;
  }

  .welcome-content p {
    font-size: 11px;
  }

  .welcome-visual {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-label {
    font-size: 10px;
  }

  .card {
    padding: 17px;
    border-radius: 16px;
  }

  .section-heading h2 {
    font-size: 18px;
  }

  .section-heading p {
    font-size: 10px;
  }

  .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .store-preview {
    min-height: 100px;
  }

  .store-content {
    padding: 11px;
  }

  .store-content h3 {
    font-size: 11px;
  }

  .badge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-cover {
    min-height: 125px;
  }

  .profile-main-card {
    padding: 0 17px 19px;
  }

  .profile-name {
    font-size: 20px;
  }

  .profile-avatar-wrap .avatar {
    width: 83px;
    height: 83px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full-width {
    grid-column: auto;
  }

  .settings-panel {
    padding: 16px;
  }

  .settings-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-nav button {
    justify-content: flex-start;
  }

  .calendar-grid {
    gap: 4px;
  }

  .calendar-day {
    min-height: 52px;
    border-radius: 8px;
    font-size: 10px;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 17px;
    padding-right: 17px;
  }

  .app-footer {
    font-size: 9px;
  }
}

/* ---------- VERY SMALL SCREENS ---------- */

@media (max-width: 370px) {
  .main-area {
    padding: 0 11px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    padding: 11px;
  }

  .stat-value {
    font-size: 19px;
  }

  .welcome-banner {
    padding: 18px;
  }

  .welcome-content h2 {
    font-size: 20px;
  }

  .topbar-right {
    gap: 5px;
  }
}
.memory-image { display:block; width:min(100%,360px); max-height:260px; object-fit:cover; margin:10px 0; border-radius:12px; border:1px solid var(--border); }
.store-categories { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0; }
.store-category { min-height:38px; padding:0 14px; border:1px solid var(--border); border-radius:999px; background:var(--surface); color:var(--text-secondary); font-size:12px; font-weight:700; }
.store-category.active { border-color:var(--primary); background:var(--primary); color:#fff; }
.user-profile-link { display:block; padding:0; border:0; background:transparent; color:var(--text); text-align:left; cursor:pointer; }
.user-profile-link:hover strong { color:var(--primary); text-decoration:underline; }
.public-profile-cover { height:110px; margin:-22px -22px 0; border-radius:16px 16px 0 0; }
.public-profile-body { position:relative; padding:0 4px 8px; text-align:center; }
.public-profile-avatar { width:84px; height:84px; display:grid; place-items:center; overflow:hidden; margin:-42px auto 10px; border:4px solid var(--surface); border-radius:50%; background:var(--surface-2); }
.public-profile-avatar img { width:100%; height:100%; object-fit:cover; }
.public-profile-body h2 { margin:5px 0; }
.public-profile-stats { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin:18px 0; }
.public-profile-stats > div { display:grid; gap:4px; padding:12px 5px; border:1px solid var(--border); border-radius:12px; }
.public-profile-stats strong { font-size:19px; }
.public-profile-stats small { color:var(--text-muted); font-size:10px; }
.profile-public-stat { display:flex; justify-content:center; gap:7px; align-items:center; color:var(--text-secondary); font-size:12px; }
.avatar-frame-premium { outline:3px solid #a78bfa; outline-offset:2px; }
.avatar-frame-gold { outline:3px solid #d6a83e; outline-offset:2px; box-shadow:0 0 0 5px rgba(214,168,62,.18); }
@media(max-width:900px) { .public-profile-stats { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:520px) { .public-profile-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } .public-profile-cover { margin-left:-16px; margin-right:-16px; } }

.ai-context-pills { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.ai-context-pills span { display:inline-flex; align-items:center; gap:6px; padding:7px 10px; border:1px solid rgba(255,255,255,.22); border-radius:999px; color:inherit; font-size:11px; }
.ai-quick-prompts { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 16px; }
.ai-quick-prompts button { padding:8px 11px; border:1px solid var(--border); border-radius:999px; background:var(--surface-2); color:var(--text-secondary); font-size:11px; font-weight:700; }
.ai-quick-prompts button:hover { border-color:var(--primary); color:var(--primary); }
.goal-progress-detail { display:flex; justify-content:space-between; gap:10px; margin-top:8px; color:var(--text-muted); font-size:11px; line-height:1.5; }
.goal-progress-analytics { display:grid; gap:8px; padding:14px 0; border-top:1px solid var(--border); }
.task-load-more { display:flex; margin:18px auto 0; }
.task-extra-settings { padding:12px; border:1px solid var(--border); border-radius:12px; }
.task-extra-settings summary { color:var(--primary); font-size:12px; font-weight:700; cursor:pointer; }
.task-extra-settings[open] summary { margin-bottom:12px; }
.profile-loading { padding:30px 12px; text-align:center; color:var(--text-muted); }
@media(max-width:640px) { .goal-progress-detail { flex-direction:column; gap:3px; } .ai-quick-prompts { gap:6px; } .ai-quick-prompts button { max-width:100%; } }

html[data-font-size="small"] { zoom: .96; }
html[data-font-size="large"] { zoom: 1.06; }
@supports not (zoom: 1) {
  html[data-font-size="small"] { font-size: 15px; }
  html[data-font-size="large"] { font-size: 18px; }
}
@supports(padding: env(safe-area-inset-left)) {
  .main-area { padding-left: max(var(--content-gutter), env(safe-area-inset-left)); padding-right: max(var(--content-gutter), env(safe-area-inset-right)); }
  .modal-overlay { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

.daily-coach-card { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:15px; margin:18px 0 20px; }
.daily-coach-icon { width:44px; height:44px; display:grid; place-items:center; border-radius:14px; background:var(--primary-soft); color:var(--primary); }
.daily-coach-card h3 { margin:3px 0 5px; font-size:15px; }
.daily-coach-card p { margin:0; color:var(--text-secondary); font-size:12px; line-height:1.6; }
@media(max-width:700px) { .daily-coach-card { grid-template-columns:auto minmax(0,1fr); } .daily-coach-card > button { grid-column:1/-1; width:100%; } }

.profile-active-badge { display:inline-flex; align-items:center; gap:5px; margin:5px 0 8px; padding:5px 10px; border:1px solid var(--border); border-radius:999px; color:var(--primary); background:var(--surface-2); font-size:10px; font-weight:800; }

.task-item, .goal-item, .achievement-card, .notification-item { content-visibility:auto; contain-intrinsic-size:auto 88px; }

[data-color-theme="sky"] { --primary:#3c9ed8; --primary-hover:#2585c0; --primary-soft:#e5f5ff; }

/* ---------- SMARTGOAL DEVICE + PERFORMANCE HARDENING ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 84px; }
body { max-width: 100%; overflow-x: hidden; overscroll-behavior-x: none; }
#app-shell, .main-area, .content-area, .dashboard-grid, .dashboard-column,
.card, .settings-layout, .settings-panel, .profile-main-card { min-width: 0; }
img, video, canvas, svg { max-width: 100%; }
.content-area { overflow-wrap: anywhere; }
.card, .stat-card, .store-item, .goal-item, .routine-item, .notification-item,
.achievement-card { min-width: 0; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full-width { grid-column: 1 / -1; }
.field-input, .field-select, .field-textarea, input, select, textarea { max-width: 100%; }
.modal-body { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.ai-chat { max-width: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.ai-message { max-width: min(88%, 760px); overflow-wrap: anywhere; word-break: break-word; }
.daily-coach-actions { display: grid; gap: 8px; justify-items: stretch; min-width: 0; }
.daily-coach-actions button { white-space: normal; }
.daily-ai-advice-output { margin-top: 12px; }
.daily-ai-advice-output #daily-ai-advice-output { white-space: pre-wrap; line-height: 1.7; overflow-wrap: anywhere; }
.routine-item-content, .task-info, .user-item-info, .store-content { min-width: 0; overflow-wrap: anywhere; }
.task-item { min-width: 0; }
.task-item > * { min-width: 0; }
.store-item, .stat-card, .goal-progress-analytics { content-visibility: auto; contain-intrinsic-size: auto 210px; }
button, .nav-link, .icon-button, input[type="checkbox"] { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 62%, transparent);
  outline-offset: 2px;
}
@media (max-width: 1100px) {
  .main-area { min-width: 0; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-column { min-width: 0; }
  .daily-coach-card { grid-template-columns: auto minmax(0, 1fr); }
  .daily-coach-actions { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .main-area { width: 100%; min-width: 0; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .content-area { width: 100%; min-width: 0; }
  .section-heading, .card-header { align-items: flex-start; flex-wrap: wrap; }
  .card-header > * { min-width: 0; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .full-width { grid-column: auto; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { display: flex; overflow-x: auto; max-width: 100%; padding-bottom: 5px; scrollbar-width: thin; }
  .settings-nav button { flex: 0 0 auto; min-height: 40px; }
  .daily-coach-card { grid-template-columns: auto minmax(0, 1fr); }
  .daily-coach-actions { grid-template-columns: minmax(0, 1fr); }
  .routine-item { grid-template-columns: 58px minmax(0, 1fr) auto; }
  .task-item { grid-template-columns: auto minmax(0, 1fr) auto; }
  .task-item .task-reward { grid-column: 2 / -1; }
  .ai-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .ai-input-row input { min-width: 0; width: 100%; }
  .app-footer { flex-wrap: wrap; gap: 6px 12px; }
}
@media (max-width: 430px) {
  .main-area { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .topbar { min-width: 0; }
  .page-heading { min-width: 0; }
  .page-heading h1 { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stats-grid, .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { min-width: 0; padding: 12px; }
  .stat-value { overflow-wrap: anywhere; }
  .store-content { padding: 10px; }
  .store-price { flex-wrap: wrap; gap: 8px; }
  .store-price button { width: 100%; }
  .public-profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .routine-item { grid-template-columns: 48px minmax(0, 1fr); }
  .routine-item-actions { grid-column: 2; justify-content: flex-end; }
  .task-item { grid-template-columns: auto minmax(0, 1fr); }
  .task-item .task-reward { grid-column: 2; }
  .task-item > .icon-button { grid-row: auto; }
  .modal { width: 100%; max-height: min(92dvh, 900px); }
  .modal-body { max-height: calc(92dvh - 150px); overflow-y: auto; }
  .ai-message { max-width: 94%; }
}
@media (max-width: 340px) {
  .stats-grid, .store-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar-right { gap: 3px; }
  .icon-button { flex: 0 0 auto; }
  .card { padding: 13px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .modal { max-height: 96dvh; }
  .modal-body { max-height: calc(96dvh - 140px); overflow-y: auto; }
  .auth-form-side { min-height: 100dvh; }
}
@media (hover: none) and (pointer: coarse) {
  button, .nav-link, .icon-button, .store-category { min-height: 42px; }
  .nav-link { padding-top: 10px; padding-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.community-leaderboard-card { overflow:hidden; }
.leaderboard-row { display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:12px; padding:12px 3px; border-top:1px solid var(--border); }
.leaderboard-rank { width:32px; height:32px; display:grid; place-items:center; border-radius:10px; background:var(--surface-2); color:var(--primary); font-size:12px; font-weight:900; }
.leaderboard-user { min-width:0; display:grid; gap:4px; }
.leaderboard-user small { color:var(--text-muted); font-size:10px; overflow-wrap:anywhere; }
.leaderboard-xp { color:var(--primary); font-size:12px; white-space:nowrap; }
@media(max-width:420px) { .leaderboard-row { grid-template-columns:34px minmax(0,1fr); } .leaderboard-xp { grid-column:2; justify-self:start; } }

/* Expanded profile customization and level progress */
.avatar-frame-neon { outline:3px solid #67e8f9; outline-offset:3px; box-shadow:0 0 0 6px rgba(103,232,249,.16),0 0 22px rgba(103,232,249,.35); }
.public-profile-level { display:grid; gap:8px; margin:16px auto 8px; max-width:460px; text-align:left; }
.public-profile-level-head { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--text-secondary); font-size:12px; }
.public-profile-level > small { color:var(--text-muted); font-size:11px; }
@media(max-width:520px) {
  .public-profile-level { margin-left:0; margin-right:0; }
  .daily-coach-actions { width:100%; }
}

.profile-decoration-score { display:block; margin:4px 0 8px; color:var(--text-muted); font-size:10px; }

@media (min-width: 761px) { .stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }


/* ---------- SmartGoal: additional themes, device coverage and rendering efficiency ---------- */
[data-color-theme="lavender"] { --primary:#8b70d6; --primary-hover:#7659c5; --primary-soft:#f0eaff; }
[data-color-theme="mint"] { --primary:#239b86; --primary-hover:#167d6c; --primary-soft:#e3f7f1; }
[data-theme="dark"][data-color-theme="lavender"] { --primary:#b49af5; --primary-hover:#c2adff; --primary-soft:#332b4c; }
[data-theme="dark"][data-color-theme="mint"] { --primary:#54cbb2; --primary-hover:#70ddc5; --primary-soft:#1d403b; }
.theme-option[data-color-theme="lavender"] { background:linear-gradient(135deg,#8b70d6,#d8c8ff); }
.theme-option[data-color-theme="mint"] { background:linear-gradient(135deg,#239b86,#b3eadb); }

.avatar-frame-crystal { outline:3px solid #b9e5ff; outline-offset:3px; box-shadow:0 0 0 6px rgba(185,229,255,.18),0 0 24px rgba(111,190,255,.42); }
.avatar-frame-flame { outline:3px solid #ff9a5c; outline-offset:3px; box-shadow:0 0 0 6px rgba(255,154,92,.18),0 0 22px rgba(244,92,54,.32); }

.ai-message-error { border:1px solid var(--red); background:var(--red-soft); color:var(--text); }

html, body, #app, .app, .app-shell, .main-area, .content-area, #content {
  min-width:0;
  max-width:100%;
}
html { min-width:280px; }
body { min-width:280px; overflow-x:clip; }
.main-area { width:100%; }
.content-area { width:100%; max-width:1600px; margin-inline:auto; }
.card, .stat-card, .store-item, .task-item, .routine-item, .goal-item,
.notification-item, .achievement-card, .user-item, .leaderboard-row,
.form-field, .setting-row, .page-heading, .card-header {
  min-width:0;
}
.task-info, .setting-info, .user-item-info, .leaderboard-user,
.routine-item-content, .profile-bio, .card-description {
  overflow-wrap:anywhere;
}
.field-input, .field-select, .field-textarea, input, textarea, select { max-width:100%; }
button, .nav-link, .icon-button { touch-action:manipulation; }
.task-item, .routine-item, .goal-progress-analytics, .notification-item,
.achievement-card, .leaderboard-row {
  content-visibility:auto;
  contain-intrinsic-size:auto 88px;
}
.store-item { content-visibility:auto; contain-intrinsic-size:auto 250px; }
.memory-image { width:min(100%,520px); max-height:360px; object-fit:contain; border-radius:12px; margin-top:10px; }

@media (min-width:1440px) {
  .content-area { max-width:1680px; }
  .dashboard-grid { gap:24px; }
}
@media (max-width:1024px) {
  .main-area { min-width:0; }
  .dashboard-grid { grid-template-columns:minmax(0,1fr); }
  .settings-layout { grid-template-columns:minmax(0,1fr); }
  .settings-nav { max-width:100%; overflow-x:auto; }
  .store-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:640px) {
  .main-area { padding-left:max(10px,env(safe-area-inset-left)); padding-right:max(10px,env(safe-area-inset-right)); }
  .content-area { padding-bottom:max(24px,env(safe-area-inset-bottom)); }
  .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .store-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .store-item { min-width:0; }
  .store-content { min-width:0; }
  .store-content h3, .store-content p { overflow-wrap:anywhere; }
  .page-heading h1 { max-width:100%; overflow-wrap:anywhere; }
  .section-heading, .page-header, .card-header { min-width:0; }
  .modal-overlay { padding: max(8px,env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom)); }
  .modal { width:100%; max-width:100%; max-height:calc(100dvh - 16px); }
  .modal-body { min-height:0; overflow-y:auto; overscroll-behavior:contain; }
  .ai-chat { max-height:min(52dvh,520px); }
  .ai-input-row { grid-template-columns:minmax(0,1fr) 46px; }
  .ai-input-row input { width:100%; min-width:0; }
}
@media (max-width:390px) {
  .stats-grid, .store-grid { grid-template-columns:minmax(0,1fr); }
  .public-profile-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .topbar-right { gap:4px; }
  .topbar-right > * { min-width:0; }
  .profile-name { overflow-wrap:anywhere; }
  .routine-item { grid-template-columns:48px minmax(0,1fr); }
  .task-item { grid-template-columns:auto minmax(0,1fr); }
  .task-item .task-reward { grid-column:2; }
}
@media (max-width:320px) {
  .main-area { padding-left:7px; padding-right:7px; }
  .card { padding:11px; }
  .topbar { gap:5px; }
  .brand { gap:6px; font-size:17px; }
  .brand-mark { width:32px; height:32px; }
  .modal-overlay { padding-left:5px; padding-right:5px; }
}
@media (orientation:landscape) and (max-height:520px) {
  .sidebar { max-height:100dvh; overflow-y:auto; }
  .modal { max-height:96dvh; }
  .modal-body { max-height:calc(96dvh - 120px); overflow-y:auto; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; }
}


/* SmartGoal routine tracking, readable AI messages and privacy controls */
.auth-retry-status {
  margin: 10px 0 0;
  color: var(--red, #d94b58);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.routine-progress-summary { display:grid; gap:9px; margin:18px 0 8px; padding:14px; border:1px solid var(--border); border-radius:14px; background:var(--surface-2); }
.routine-progress-head, .routine-progress-legend { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.routine-progress-head strong { font-size:14px; }
.routine-progress-head span { color:var(--text-secondary); font-size:13px; font-weight:700; }
.routine-progress-track { display:flex; height:10px; width:100%; overflow:hidden; border-radius:99px; background:var(--border); }
.routine-progress-done { display:block; height:100%; background:#20a66a; transition:width .2s ease; }
.routine-progress-missed { display:block; height:100%; background:#dc535d; transition:width .2s ease; }
.routine-progress-legend { color:var(--text-muted); font-size:11px; }
.routine-legend-done { color:#168653; font-weight:700; }
.routine-legend-missed { color:#d34a55; font-weight:700; }
.routine-item { min-width:0; }
.routine-item-done { background:rgba(32,166,106,.035); }
.routine-item-missed { background:rgba(220,83,93,.035); }
.routine-status-pill { display:inline-flex; align-items:center; width:max-content; max-width:100%; margin-top:5px; padding:3px 8px; border-radius:99px; font-size:11px; font-weight:700; }
.routine-status-pill.done { color:#168653; background:rgba(32,166,106,.12); }
.routine-status-pill.missed { color:#d34a55; background:rgba(220,83,93,.12); }
.routine-status-pill.upcoming { color:var(--text-muted); background:var(--surface-2); }
.routine-mark-button { display:inline-grid; place-items:center; width:30px; height:30px; padding:0; border:1px solid var(--border); border-radius:9px; background:var(--surface); color:var(--text-secondary); cursor:pointer; font-size:17px; font-weight:800; }
.routine-mark-done { color:#168653; border-color:rgba(32,166,106,.35); }
.routine-mark-missed, .routine-mark-time { color:#d34a55; border-color:rgba(220,83,93,.35); }
.routine-item-actions { align-items:center; flex-wrap:wrap; }
.public-showcase { display:grid; gap:10px; margin-top:18px; padding:15px; border:1px solid var(--border); border-radius:14px; background:var(--surface-2); }
.public-showcase h3 { margin:0; font-size:14px; }
.public-showcase-list { display:flex; flex-wrap:wrap; gap:8px; min-width:0; }
.public-showcase-chip { display:inline-flex; align-items:center; gap:6px; max-width:100%; padding:7px 10px; border:1px solid var(--border); border-radius:99px; background:var(--surface); color:var(--text-secondary); font-size:12px; overflow-wrap:anywhere; }
.data-delete-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:16px 0 4px; }
.data-delete-options label { display:flex; align-items:center; gap:9px; min-width:0; padding:10px; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); font-size:13px; }
.data-delete-options input { flex:0 0 auto; accent-color:var(--primary); }
.ai-message p { margin:0 0 9px; line-height:1.7; }
.ai-message p:last-child { margin-bottom:0; }
.ai-message h3 { margin:13px 0 7px; font-size:16px; line-height:1.4; }
.ai-message ol, .ai-message ul { display:grid; gap:6px; margin:8px 0 10px; padding-left:23px; line-height:1.65; }
.ai-message li { padding-left:3px; }
.ai-message strong { font-weight:800; color:var(--text); }
.ai-message code { padding:2px 5px; border-radius:5px; background:var(--surface-2); font-size:.9em; overflow-wrap:anywhere; }
.daily-ai-advice-output { min-width:0; overflow-wrap:anywhere; line-height:1.7; }
.daily-ai-advice-output h3 { margin:12px 0 6px; font-size:15px; }
.daily-ai-advice-output ol, .daily-ai-advice-output ul { padding-left:22px; line-height:1.7; }
@media (max-width:560px) {
  .data-delete-options { grid-template-columns:minmax(0,1fr); }
  .routine-progress-legend { justify-content:flex-start; gap:7px 12px; }
  .routine-progress-head { align-items:flex-start; }
  .routine-item-actions { grid-column:2; justify-content:flex-end; }
  .public-showcase-chip { font-size:11px; padding:6px 8px; }
}

.dashboard-routine-list { display:grid; gap:0; }
.dashboard-routine-row { display:grid; grid-template-columns:58px minmax(0,1fr) auto; align-items:center; gap:9px; padding:10px 0; border-top:1px solid var(--border); }
.dashboard-routine-row time { color:var(--primary); font-weight:800; font-size:12px; font-variant-numeric:tabular-nums; }
.dashboard-routine-row strong { min-width:0; font-size:13px; overflow-wrap:anywhere; }
.dashboard-routine-row .routine-status-pill { margin:0; }
@media (max-width:420px) {
  .dashboard-routine-row { grid-template-columns:48px minmax(0,1fr); }
  .dashboard-routine-row .routine-status-pill { grid-column:2; justify-self:start; }
}

.routine-progress-no-time { display:block; height:100%; background:#ef8b55; transition:width .2s ease; }
.routine-legend-time { color:#d8793d; font-weight:700; }


/* ---------- GLOBAL RESPONSIVE SAFETY ---------- */
html, body, #app, .app-shell, .main-area, .content-area {
  min-width: 0;
  max-width: 100%;
}
body { overflow-x: hidden; }
img, video, canvas, svg { max-width: 100%; }
button, input, select, textarea { max-width: 100%; }
.settings-layout, .settings-layout > *, .settings-panel, .settings-section,
.setting-row, .setting-info, .form-field, .card, .modal, .modal-body {
  min-width: 0;
}
.settings-panel, .modal-body, .card, .content-area { overflow-wrap: anywhere; }
.setting-info { flex: 1 1 180px; }
.setting-row > :last-child { flex: 0 1 auto; }
.profile-name, .profile-username, .page-heading h1, .card-title,
.goal-title, .task-title, .routine-item-content, .notification-item > div {
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { min-width: 0; max-width: 100%; }
  .settings-panel { padding: clamp(12px, 3vw, 20px); }
  .setting-row { flex-wrap: wrap; align-items: flex-start; gap: 9px 12px; }
  .setting-row > :last-child { max-width: 100%; }
  .modal { width: min(100% - 20px, 560px); max-height: calc(100dvh - 20px); }
  .modal-body { max-height: calc(100dvh - 170px); overflow-y: auto; }
}
@media (max-width: 430px) {
  .settings-nav button { flex: 0 0 auto; white-space: nowrap; }
  .topbar-right { min-width: 0; }
  .topbar-user-name { display: none; }
  .routine-item { min-width: 0; }
  .form-grid, .dashboard-grid, .stats-grid, .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid .full-width { grid-column: 1 / -1; }
}
@media (max-width: 340px) {
  .stats-grid, .store-grid, .public-profile-stats {
    grid-template-columns: minmax(0, 1fr);
  }
  .topbar { gap: 6px; }
  .topbar-right { gap: 4px; }
  .settings-panel { padding: 10px; }
}


/* SMARTGOAL PATCH: settings actions and robust responsive chat */
.settings-layout,
.settings-panel,
.settings-section,
.setting-row,
.setting-info { min-width: 0; }
.settings-panel { width: 100%; }
.setting-row { flex-wrap: wrap; align-items: center; }
.setting-info { flex: 1 1 220px; }
.setting-row > .secondary-button,
.setting-row > .field-select {
  display: inline-flex !important;
  flex: 0 0 auto;
  min-width: 116px;
  max-width: min(100%, 190px) !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  z-index: 1;
}
.setting-row > .secondary-button { white-space: nowrap; }
.settings-section .theme-options { min-width: 0; }
.ai-chat-card { min-width: 0; width: 100%; overflow: hidden; }
.ai-chat {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: min(58vh, 680px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 1px;
}
.ai-message {
  width: fit-content;
  max-width: min(88%, 760px);
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ai-message p, .ai-message li, .ai-message h1, .ai-message h2, .ai-message h3 {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.ai-input-row { width: 100%; min-width: 0; }
.ai-input-row input { flex: 1 1 0; width: 1%; min-width: 0; }
.settings-nav, .settings-panel { min-width: 0; }
@media (max-width: 760px) {
  .settings-layout { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .settings-nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .settings-nav button { min-width: 0; justify-content: flex-start; }
  .settings-panel { padding: 15px; }
  .setting-row { align-items: flex-start; gap: 10px; }
  .setting-info { flex-basis: 100%; }
  .setting-row > .secondary-button,
  .setting-row > .field-select { max-width: 100% !important; }
  .ai-message { max-width: 94%; }
}
@media (max-width: 380px) {
  .settings-nav { grid-template-columns: minmax(0,1fr); }
  .setting-row > .secondary-button,
  .setting-row > .field-select { width: 100%; max-width: 100% !important; }
}


/* SMARTGOAL PROFESSIONAL RESPONSIVE LAYER */
:root { --sg-focus: 0 0 0 3px rgba(103,87,217,.22); --sg-ease: 180ms ease; }
* { box-sizing: border-box; }
html, body, #app, .app { width:100%; min-width:320px; }
body { min-width:320px; overflow-x:hidden; }
button,input,select,textarea,a { -webkit-tap-highlight-color:transparent; }
button,[role="button"],.nav-link,.icon-button,.primary-button,.secondary-button,.card-action,.store-category { cursor:pointer; transition:transform var(--sg-ease),box-shadow var(--sg-ease),background-color var(--sg-ease),border-color var(--sg-ease),opacity var(--sg-ease); }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline:none; box-shadow:var(--sg-focus); }
button:disabled { cursor:not-allowed; opacity:.55; }
.primary-button,.secondary-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:42px; padding:10px 16px; border-radius:11px; font-weight:700; line-height:1.25; white-space:normal; }
.primary-button:hover:not(:disabled),.secondary-button:hover:not(:disabled),.card-action:hover:not(:disabled) { transform:translateY(-1px); }
.card-action { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:40px; padding:8px 12px; }
input[type=file] { width:100%; min-width:0; max-width:100%; color:var(--text-muted); }
input[type=file]::file-selector-button { margin-right:10px; padding:10px 14px; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); color:var(--text); font:inherit; font-weight:700; cursor:pointer; }
.file-picker { display:grid; gap:8px; padding:14px; border:1px dashed var(--border); border-radius:14px; background:var(--surface-2); }
.file-picker>span { display:inline-flex; align-items:center; gap:8px; font-weight:700; }
.file-picker input { padding:6px 0; }
.notification-toolbar { align-items:center; gap:14px; }
.notification-item { min-width:0; align-items:center; gap:14px; }
.notification-item>div:nth-child(2) { min-width:0; overflow-wrap:anywhere; }
.notification-read-button,.notification-read-state { flex:0 0 auto; white-space:nowrap; }
.notification-read-state { display:inline-flex; align-items:center; gap:5px; color:var(--text-muted); font-size:12px; }
.achievements-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,205px),1fr)); }
.achievement-card { min-width:0; min-height:170px; display:flex; flex-direction:column; align-items:flex-start; gap:9px; padding:17px; border:1px solid var(--border); border-radius:16px; background:var(--surface); }
.achievement-card.earned { border-color:rgba(103,87,217,.4); background:linear-gradient(145deg,rgba(103,87,217,.08),var(--surface)); }
.achievement-card strong,.achievement-card small { overflow-wrap:anywhere; }
.store-categories { display:flex; flex-wrap:wrap; gap:9px; margin:18px 0; }
.store-category { min-height:42px; padding:9px 15px; border:1px solid var(--border); border-radius:11px; background:var(--surface); color:var(--text); font-weight:700; }
.store-category.active { background:var(--primary); border-color:var(--primary); color:#fff; }
.store-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,245px),1fr)); }
.store-item { min-width:0; overflow:hidden; border:1px solid var(--border); border-radius:18px; }
.store-content { min-width:0; }
.store-content h3,.store-content p { overflow-wrap:anywhere; }
.store-price { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; }
.settings-layout { min-width:0; }
.settings-nav { display:flex; flex-wrap:wrap; gap:8px; }
.settings-nav button { min-height:42px; border-radius:11px; padding:9px 13px; }
.community-leaderboard-card,#community-results,#community-relations { min-width:0; overflow-wrap:anywhere; }
.leaderboard-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:12px; }
.leaderboard-user { min-width:0; overflow-wrap:anywhere; }
.modal-overlay { z-index:1000; }
.modal { width:min(100%,620px); max-width:calc(100vw - 24px); }
.modal-body,.modal-content,.form-field { min-width:0; }
.form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.form-field.full-width { grid-column:1/-1; }
.sidebar,.main-area,.content-area,#content,.topbar { min-width:0; }
.topbar button,.topbar .icon-button { flex:0 0 auto; }
.routine-item { grid-template-columns:64px minmax(0,1fr) auto; }
.routine-item-actions { flex-wrap:wrap; justify-content:flex-end; }
@media (max-width:1100px) {
 .dashboard-grid { grid-template-columns:minmax(0,1fr); }
 .main-area { margin-left:0; }
 .sidebar { z-index:1100; }
}
@media (max-width:760px) {
 .main-area { width:100%; padding-left:16px; padding-right:16px; }
 .content-area { width:100%; }
 .page-header,.page-heading { align-items:flex-start; flex-wrap:wrap; }
 .stats-grid,.store-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .routine-item { grid-template-columns:56px minmax(0,1fr); gap:9px; }
 .routine-item-actions { grid-column:2; justify-content:flex-start; }
 .routine-item-actions button { min-width:38px; min-height:38px; }
 .notification-item { display:grid; grid-template-columns:auto minmax(0,1fr); }
 .notification-item>button,.notification-item>span { grid-column:2; justify-self:start; }
 .notification-toolbar { align-items:flex-start; flex-direction:column; }
 .form-grid,.settings-layout { grid-template-columns:minmax(0,1fr); }
 .form-field.full-width { grid-column:1; }
 .settings-nav { overflow-x:auto; flex-wrap:nowrap; padding-bottom:5px; }
 .settings-nav button { flex:0 0 auto; }
}
@media (max-width:480px) {
 .main-area { padding-left:12px; padding-right:12px; }
 .topbar { gap:6px; }
 .topbar-left,.topbar-right { gap:6px; }
 .topbar .icon-button { width:38px; min-width:38px; height:38px; }
 .stats-grid,.store-grid { grid-template-columns:minmax(0,1fr); }
 .store-categories { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
 .store-category { width:100%; }
 .routine-progress-legend { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
 .leaderboard-row { grid-template-columns:auto minmax(0,1fr); }
 .leaderboard-xp { grid-column:2; }
 .card-header { gap:10px; }
 .modal-overlay { padding:8px; }
 .modal { max-width:calc(100vw - 16px); }
}
@media (max-width:340px) {
 .main-area { padding-left:8px; padding-right:8px; }
 .routine-progress-legend { grid-template-columns:minmax(0,1fr); }
 .routine-item { grid-template-columns:48px minmax(0,1fr); }
 .topbar .icon-button { width:34px; min-width:34px; }
}
@media (prefers-reduced-motion:reduce) {
 *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; transition-duration:.01ms!important; }
}

[data-color-theme="graphite"] { --primary:#536174; --primary-hover:#3f4d60; --primary-soft:#e9edf2; }
[data-color-theme="ice"] { --primary:#2586c8; --primary-hover:#176da9; --primary-soft:#e5f5ff; }
[data-color-theme="amber"] { --primary:#c58a21; --primary-hover:#a66f12; --primary-soft:#fff4dc; }

.avatar-frame-prism { box-shadow:0 0 0 3px #b48cff,0 0 0 6px #65d8e8,0 0 16px rgba(101,216,232,.5); }
.avatar-frame-carbon { box-shadow:0 0 0 4px #344054,0 0 0 6px #8a98a9; }
.avatar-frame-aurora { box-shadow:0 0 0 3px #5fc7a8,0 0 0 6px #8b70d7,0 0 18px rgba(95,199,168,.45); }

.public-memory-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr)); gap:12px; margin-top:12px; }
.public-memory-card { min-width:0; padding:13px; border:1px solid var(--border); border-radius:14px; background:var(--surface-2); }
.public-memory-card>div { display:grid; gap:4px; }
.public-memory-card small { color:var(--text-muted); }
.public-memory-card img { display:block; width:100%; max-height:220px; margin-top:10px; object-fit:contain; border-radius:10px; background:var(--surface); }
.public-memory-card p { margin:10px 0 0; overflow-wrap:anywhere; }


/* SMARTGOAL DESKTOP SETTINGS VISIBILITY FIX */
@media (min-width: 761px) {
  .settings-layout {
    display: grid !important;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) !important;
    align-items: stretch;
    gap: 18px !important;
  }
  .settings-nav {
    display: grid !important;
    align-content: start;
    min-height: 260px;
  }
  .settings-panel {
    display: block !important;
    min-height: 260px;
    padding: clamp(20px, 2vw, 30px) !important;
    font-size: 14px;
  }
  .settings-panel .settings-section,
  .settings-panel .setting-row,
  .settings-panel .setting-info {
    display: block;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .settings-panel .setting-row {
    display: grid !important;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) !important;
    align-items: center;
    gap: 16px !important;
    min-height: 76px;
    padding: 16px 0 !important;
  }
  .settings-panel .setting-info {
    min-width: 0;
  }
  .settings-panel .setting-info strong {
    display: block !important;
    font-size: 14px !important;
    line-height: 1.45;
  }
  .settings-panel .setting-info small {
    display: block !important;
    margin-top: 5px;
    font-size: 12px !important;
    line-height: 1.5;
  }
  .settings-panel .setting-row > .field-select,
  .settings-panel .setting-row > select,
  .settings-panel .setting-row > .secondary-button,
  .settings-panel .setting-row > button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    justify-self: end;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 150px !important;
    max-width: 220px !important;
    min-height: 44px !important;
    padding: 10px 14px !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: 11px !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    font-size: 13px !important;
    line-height: 1.35;
    z-index: 2;
  }
  .settings-panel .setting-row > select {
    appearance: auto !important;
    cursor: pointer;
  }
  .settings-panel h3 {
    font-size: 17px !important;
    line-height: 1.4;
  }
  .settings-panel > .settings-section > p,
  .settings-panel .settings-section > p {
    font-size: 13px !important;
    line-height: 1.55;
  }
}


/* SMARTGOAL GLOBAL WIDTH / HORIZONTAL CLIPPING FIX
   The desktop main area previously used width:100% while also having
   a left sidebar margin. This made the real layout wider than the viewport;
   body overflow-x then clipped controls on the right. */
html, body, #app, .app, .app-shell {
  width: 100%;
  max-width: 100%;
}
body {
  overflow-x: hidden;
}
.app-shell {
  width: 100%;
  min-width: 0;
  overflow-x: clip;
}
@media (min-width: 901px) {
  .main-area {
    width: calc(100% - var(--sidebar-width)) !important;
    max-width: calc(100% - var(--sidebar-width)) !important;
    min-width: 0 !important;
    margin-left: var(--sidebar-width) !important;
    box-sizing: border-box;
  }
  .content-area {
    width: 100% !important;
    max-width: 1680px;
    min-width: 0 !important;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }
}
@media (max-width: 900px) {
  .main-area {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    box-sizing: border-box;
  }
  .content-area {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }
  .settings-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .settings-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }
  .settings-nav button { flex: 0 0 auto; }
  .settings-panel { width: 100%; min-width: 0; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .settings-layout {
    grid-template-columns: minmax(170px, 205px) minmax(0, 1fr) !important;
    gap: 14px !important;
  }
  .settings-panel { padding: 18px !important; }
  .settings-panel .setting-row {
    grid-template-columns: minmax(0, 1fr) minmax(130px, 180px) !important;
    gap: 10px !important;
  }
  .settings-panel .setting-row > .field-select,
  .settings-panel .setting-row > select,
  .settings-panel .setting-row > .secondary-button,
  .settings-panel .setting-row > button {
    min-width: 0 !important;
    max-width: 180px !important;
  }
}
/* Keep every page section and common grid inside the available content width. */
.content-area > *, #content > *, .dashboard-grid > *,
.stats-grid > *, .store-grid > *, .settings-layout > *,
.ai-chat-card, .ai-chat, .ai-input-row,
.community-grid > *, .profile-layout > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.dashboard-grid, .stats-grid, .store-grid, .settings-layout,
.form-grid, .community-grid, .profile-layout {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
@media (min-width: 901px) {
  .settings-layout {
    grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
  }
}
.stats-grid > *, .store-grid > *, .dashboard-grid > *,
.settings-panel, .settings-nav, .ai-chat-card, .community-leaderboard-card {
  min-width: 0;
}
.ai-chat-card, .ai-chat { width: 100%; max-width: 100%; }
.ai-input-row { display: flex; width: 100%; min-width: 0; }
.ai-input-row input { flex: 1 1 0; width: 1%; min-width: 0; }
img, video, canvas, iframe { max-width: 100%; }

/* SmartGoal visual polish */
.auth-feature { align-items:center; min-width:0; }
.auth-feature .feature-icon { flex:0 0 46px; align-self:center; }
.auth-feature > div { min-width:0; }
.auth-feature strong { line-height:1.45; }
.terms-consent { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.terms-label { flex:1 1 240px; min-width:0; }
.terms-details { flex:0 0 auto; padding:7px 10px; border-radius:8px; background:var(--primary-soft); }
.terms-document { color:var(--text); font-size:13px; line-height:1.75; }
.terms-document ol { padding-left:22px; display:grid; gap:10px; margin:12px 0; }
.terms-document li { padding-left:4px; }
.toggle { position:relative; display:inline-flex; align-items:center; justify-content:flex-end; padding:0 5px; width:64px; min-width:64px; height:30px; border:1px solid var(--border-strong); border-radius:999px; background:#e8eaf2; color:#64708a; cursor:pointer; }
.toggle::after { top:4px; left:4px; width:20px; height:20px; }
.toggle.active { justify-content:flex-start; background:var(--primary); border-color:var(--primary); }
.toggle.active::after { transform:translateX(34px); }
.toggle-state { position:relative; z-index:1; font-size:8px; font-weight:800; letter-spacing:.4px; }
.toggle.active .toggle-state { color:#fff; margin-left:3px; }
.toggle:not(.active) .toggle-state { margin-right:1px; }
.theme-options { display:grid; grid-template-columns:repeat(auto-fill,minmax(46px,1fr)); gap:13px; }
.theme-option { position:relative; display:grid; place-items:center; width:46px; height:46px; border:2px solid var(--surface); border-radius:14px; color:#fff; box-shadow:0 0 0 1px var(--border-strong),0 3px 9px rgba(20,30,60,.08); transition:transform .18s ease; }
.theme-option svg { width:16px; height:16px; filter:drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.theme-option:hover { transform:translateY(-2px); }
.theme-option.active { outline:2px solid var(--primary); outline-offset:3px; }
.theme-option[data-action="locked-theme"] { filter:saturate(.78); }
.theme-option[data-color-theme="lavender"] { background:#a78bfa; }
.theme-option[data-color-theme="mint"] { background:#36b99a; }
.theme-option[data-color-theme="graphite"] { background:#475569; }
.theme-option[data-color-theme="ice"] { background:#77bfe8; }
.theme-option[data-color-theme="amber"] { background:#d69b2d; }
.settings-panel .field-select { min-width:145px; min-height:42px; padding:9px 36px 9px 12px; border-radius:12px; background-color:var(--surface-2); border:1px solid var(--border-strong); color:var(--text); font-weight:650; cursor:pointer; }
.setting-row { align-items:center; min-height:66px; }
.setting-info strong { font-size:13px; }
.setting-info small { font-size:11px; line-height:1.55; }
select option { padding:9px; background:var(--surface); color:var(--text); }
@media(max-width:760px){.auth-feature-list{gap:19px;margin-top:34px}.auth-feature .feature-icon{flex-basis:44px;width:44px;height:44px}.setting-row{align-items:flex-start}.settings-panel{padding:16px}}

.file-picker { position:relative; display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:12px; border:1px dashed var(--border-strong); border-radius:14px; background:var(--surface-2); cursor:pointer; transition:border-color .2s ease,background .2s ease; }
.file-picker:hover { border-color:var(--primary); background:var(--primary-soft); }
.file-picker>span { display:inline-flex; align-items:center; gap:9px; padding:9px 12px; border:1px solid var(--border); border-radius:11px; background:var(--surface); color:var(--primary); font-weight:750; }
.file-picker>small { flex-basis:100%; color:var(--text-muted); line-height:1.5; }
.file-picker input[type="file"] { position:absolute; width:1px; height:1px; opacity:0; overflow:hidden; clip:rect(0,0,0,0); }
.file-picker:focus-within { outline:3px solid color-mix(in srgb,var(--primary) 25%,transparent); outline-offset:2px; }
.file-picker-icon { min-height:72px; }
.file-picker-icon>span { border:0; background:transparent; }

.file-picker { position:relative; display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:12px; border:1px dashed var(--border-strong); border-radius:14px; background:var(--surface-2); cursor:pointer; transition:border-color .2s ease,background .2s ease; }
.file-picker:hover { border-color:var(--primary); background:var(--primary-soft); }
.file-picker>span { display:inline-flex; align-items:center; gap:9px; padding:9px 12px; border:1px solid var(--border); border-radius:11px; background:var(--surface); color:var(--primary); font-weight:750; }
.file-picker>small { flex-basis:100%; color:var(--text-muted); line-height:1.5; }
.file-picker input[type="file"] { position:absolute; width:1px; height:1px; opacity:0; overflow:hidden; clip:rect(0,0,0,0); }
.file-picker:focus-within { outline:3px solid color-mix(in srgb,var(--primary) 25%,transparent); outline-offset:2px; }
.file-picker-icon { min-height:72px; }
.file-picker-icon>span { border:0; background:transparent; }
.terms-consent { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.terms-consent .terms-label { flex:1 1 250px; }


/* SMARTGOAL CONTROL REFINEMENT — eye, switches and select fields */
.terms-details{display:inline!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;color:#2563eb!important;text-decoration:underline!important;text-underline-offset:3px;font-weight:650;cursor:pointer;white-space:nowrap}
.terms-details:hover{color:#1d4ed8!important}
.terms-document{font-size:13px;line-height:1.78;overflow-wrap:anywhere}
.terms-document>p{margin:0 0 12px;color:var(--text-secondary)}
.terms-document ol{padding-left:22px;display:grid;gap:12px;margin:14px 0}
.terms-document li{padding-left:3px}
.terms-document li strong{color:var(--text)}
.input-wrap .input-action{display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;border:0;border-radius:9px;background:transparent;color:var(--text-muted);cursor:pointer}
.input-wrap .input-action:hover{background:var(--surface-2);color:var(--primary)}
.input-wrap .input-action svg{width:19px;height:19px}
.settings-panel .setting-row>.field-select,.settings-panel .setting-row>select.field-select,.settings-panel .setting-row>select{appearance:none!important;-webkit-appearance:none!important;min-height:46px!important;width:100%!important;max-width:220px!important;min-width:150px!important;padding:10px 40px 10px 14px!important;border:1px solid var(--border-strong)!important;border-radius:13px!important;background-color:var(--surface-2)!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:right 13px center!important;color:var(--text)!important;font-size:13px!important;font-weight:650!important;box-shadow:0 1px 2px rgba(15,23,42,.04)!important;cursor:pointer!important;transition:border-color .18s ease,box-shadow .18s ease,background-color .18s ease!important}
.settings-panel .setting-row>.field-select:hover,.settings-panel .setting-row>select:hover{border-color:var(--primary)!important;background-color:var(--surface)!important}
.settings-panel .setting-row>.field-select:focus,.settings-panel .setting-row>select:focus{outline:0!important;border-color:var(--primary)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 17%,transparent)!important}
.settings-panel .setting-row>select option{padding:10px;background:var(--surface);color:var(--text)}
.settings-panel .setting-row>.toggle{position:relative!important;display:inline-flex!important;align-items:center!important;justify-content:flex-start!important;flex:0 0 58px!important;width:58px!important;min-width:58px!important;height:32px!important;min-height:32px!important;padding:0!important;border:1px solid var(--border-strong)!important;border-radius:999px!important;background:#d7dce5!important;color:#475569!important;box-shadow:inset 0 1px 2px rgba(15,23,42,.12)!important;overflow:hidden!important}
.settings-panel .setting-row>.toggle::after{content:""!important;position:absolute!important;top:4px!important;left:4px!important;right:auto!important;width:22px!important;height:22px!important;border-radius:50%!important;background:#fff!important;box-shadow:0 1px 4px rgba(15,23,42,.28)!important;transform:translateX(0)!important;transition:transform .2s ease!important}
.settings-panel .setting-row>.toggle.active{background:var(--primary)!important;border-color:var(--primary)!important}
.settings-panel .setting-row>.toggle.active::after{transform:translateX(26px)!important}
.settings-panel .setting-row>.toggle .toggle-state{position:absolute!important;top:50%!important;right:5px!important;left:auto!important;z-index:1!important;margin:0!important;padding:0!important;transform:translateY(-50%)!important;color:#475569!important;font-size:8px!important;font-weight:850!important;letter-spacing:.2px!important;line-height:1!important}
.settings-panel .setting-row>.toggle.active .toggle-state{right:auto!important;left:6px!important;color:#fff!important}
@media(max-width:760px){.settings-panel .setting-row>.field-select,.settings-panel .setting-row>select{max-width:100%!important;min-width:0!important}.terms-consent{align-items:flex-start}}


/* SmartGoal integration: community tabs and authentication focus refinement */
#login-form .input-wrap:focus-within,
#register-form .input-wrap:focus-within {
  border-color: var(--border-strong) !important;
  box-shadow: none !important;
}
#login-form .input-wrap input:focus,
#register-form .input-wrap input:focus {
  outline: none !important;
  box-shadow: none !important;
}
.community-hub {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.community-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.community-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.community-tab:hover { background: var(--surface); color: var(--text); }
.community-tab.active {
  border-color: var(--border);
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 7px rgba(15,23,42,.05);
}
.community-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
}
.community-panel { padding: 22px; }
.community-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.community-panel-heading h3 { font-size: 16px; font-weight: 850; }
.community-panel-heading p,
.community-note {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}
.community-results,
.community-active-list { margin-top: 18px; }
.community-note {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
}
@media (max-width: 600px) {
  .settings-reset-row {
    align-items: flex-start !important;
    flex-direction: column !important;
  }
  .settings-reset-row .secondary-button { width: 100%; }
}
@media (max-width: 560px) {
  .community-panel { padding: 15px; }
  .community-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .community-tab:last-child { grid-column: 1 / -1; }
  .community-panel-heading { flex-direction: column; }
  .community-panel-heading .card-action { align-self: flex-start; }
}


/* SMARTGOAL — polished native dropdowns */
.field-select, select.field-select, .settings-panel select, .form-field select {
  appearance:none; -webkit-appearance:none; min-height:46px; padding:11px 42px 11px 14px;
  border:1px solid var(--border-strong); border-radius:13px; background-color:var(--surface);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center; color:var(--text);
  font:inherit; font-size:13px; font-weight:650; line-height:1.4;
  box-shadow:0 2px 7px rgba(15,23,42,.045); cursor:pointer;
  transition:border-color .18s ease,box-shadow .18s ease,background-color .18s ease;
}
.field-select:hover, .settings-panel select:hover, .form-field select:hover { border-color:var(--primary); background-color:var(--surface-2); }
.field-select:focus, .settings-panel select:focus, .form-field select:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 16%,transparent),0 3px 10px rgba(15,23,42,.06); }
.field-select:disabled, .settings-panel select:disabled, .form-field select:disabled { opacity:.58; cursor:not-allowed; }
select option, .field-select option { padding:12px 14px; background:#fff; color:#182235; font-weight:550; }
select option:checked, .field-select option:checked { background:#eeeaff; color:#5145cf; font-weight:750; }
@media(max-width:640px) { .field-select, .settings-panel select, .form-field select { min-height:44px; padding-left:12px; border-radius:11px; } }

/* Community: discovery and public profiles only */
.community-hub { overflow:hidden; }
.community-tabs { gap:9px; }
.community-tab { min-width:170px; }
.community-tab.active { border-color:color-mix(in srgb,var(--primary) 24%,var(--border)); background:var(--surface); color:var(--primary); box-shadow:0 2px 8px rgba(20,20,50,.06); }
.community-panel { min-width:0; }
.community-results, .community-active-list { display:grid; gap:10px; }
.community-user-result { align-items:center; }
.community-user-result .card-action { flex:0 0 auto; }
@media(max-width:560px) {
  .community-tab { min-width:0; }
  .community-user-result { align-items:flex-start; flex-wrap:wrap; }
  .community-user-result .user-item-info { flex:1 1 calc(100% - 64px); min-width:0; }
  .community-user-result .card-action { margin-left:56px; }
}


/* Prominent profile cosmetics: make earned shop items visible at a glance. */
.file-picker.file-picker-icon { display:flex; flex-direction:column; align-items:flex-start; gap:7px; }
.file-picker.file-picker-icon > span { display:inline-flex; align-items:center; gap:9px; }
.file-picker.file-picker-icon small { display:block; max-width:100%; line-height:1.55; color:var(--text-muted); }
.profile-cosmetics-section .card-header > div { min-width:0; }
.profile-cosmetics-section .card-description { margin-top:5px; }
.cosmetic-showcase-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:13px; margin-top:14px; }
.cosmetic-showcase-card { position:relative; display:flex; align-items:center; gap:13px; min-width:0; padding:15px; border:1px solid var(--border); border-radius:16px; background:var(--surface-2); }
.cosmetic-showcase-card.is-equipped { border-color:var(--primary); background:var(--primary-soft); box-shadow:0 0 0 1px color-mix(in srgb,var(--primary) 16%,transparent); }
.cosmetic-showcase-icon { width:54px; height:54px; flex:0 0 54px; display:grid; place-items:center; border-radius:15px; background:var(--surface); color:var(--primary); box-shadow:0 5px 18px rgba(20,25,50,.08); }
.cosmetic-showcase-info { min-width:0; flex:1; }
.cosmetic-showcase-info small { display:block; margin-bottom:4px; color:var(--text-muted); font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; }
.cosmetic-showcase-info strong { display:block; color:var(--text); font-size:13px; line-height:1.35; overflow-wrap:anywhere; }
.cosmetic-showcase-info p { margin:4px 0 0; color:var(--text-secondary); font-size:11px; line-height:1.5; }
.cosmetic-showcase-status { display:inline-flex; align-items:center; gap:4px; flex:0 0 auto; align-self:flex-start; padding:5px 8px; border-radius:999px; background:var(--surface); color:var(--text-muted); font-size:9px; font-weight:800; }
.is-equipped .cosmetic-showcase-status { color:var(--primary); }
.cosmetic-showcase-empty { margin-top:12px; padding:20px; border:1px dashed var(--border-strong); border-radius:14px; color:var(--text-muted); text-align:center; font-size:12px; }
.public-showcase .cosmetic-showcase-grid { grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); text-align:left; }
.public-showcase .cosmetic-showcase-card { min-height:108px; }
@media(max-width:520px) {
  .cosmetic-showcase-grid,.public-showcase .cosmetic-showcase-grid { grid-template-columns:minmax(0,1fr); }
  .cosmetic-showcase-card { padding:12px; gap:10px; }
  .cosmetic-showcase-icon { width:48px; height:48px; flex-basis:48px; }
  .cosmetic-showcase-status { font-size:8px; }
}


/* Planner AI recommendations: readable, high-contrast output in light and dark themes. */
.ai-plan-output {
  margin: 14px 0 18px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
  font-weight: 500;
  overflow-wrap: anywhere;
  white-space: normal;
}
.ai-plan-output:empty { display: none; }
.ai-plan-output p { margin: 0 0 12px; color: var(--text); }
.ai-plan-output p:last-child { margin-bottom: 0; }
.ai-plan-output h3 {
  margin: 18px 0 9px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
  font-weight: 800;
}
.ai-plan-output h3:first-child { margin-top: 0; }
.ai-plan-output ol, .ai-plan-output ul {
  margin: 8px 0 16px;
  padding-left: 26px;
  color: var(--text);
}
.ai-plan-output li {
  margin: 7px 0;
  padding-left: 4px;
  color: var(--text);
}
.ai-plan-output strong { color: var(--text); font-weight: 800; }
.ai-plan-output em { color: var(--text-secondary); }
.ai-plan-output code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text);
}
@media (max-width: 640px) {
  .ai-plan-output { padding: 14px; font-size: 14px; line-height: 1.75; }
  .ai-plan-output h3 { font-size: 15px; }
}
