:root {
  --v4-violet: #7768c8;
  --v4-rose: #f58b99;
  --v4-ink: #252438;
  --v4-muted: #6e6b7b;
  --v4-surface: rgba(255, 255, 255, .92);
  --v4-line: rgba(89, 77, 124, .14);
  --v4-bottom-height: 76px;
  --v4-radius: 24px;
}

body.v4-upgrade {
  background:
    radial-gradient(circle at 8% 2%, rgba(135, 118, 213, .18), transparent 26%),
    radial-gradient(circle at 96% 6%, rgba(245, 139, 153, .18), transparent 26%),
    #faf8fc;
}

body.v4-upgrade button,
body.v4-upgrade a,
body.v4-upgrade input,
body.v4-upgrade select,
body.v4-upgrade textarea {
  -webkit-tap-highlight-color: transparent;
}

body.v4-upgrade button,
body.v4-upgrade .button-link {
  min-height: 44px;
}

body.v4-upgrade:not(.welcome-mode):not(.intro-only) .app {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow: visible;
  background: rgba(255, 253, 250, .88);
  box-shadow: none;
}

body.v4-upgrade:not(.welcome-mode):not(.intro-only) .sidebar > #nav {
  display: none !important;
}

body.welcome-mode #v4ContextBar,
body.intro-only #v4ContextBar,
body.welcome-mode #v4BottomNav,
body.intro-only #v4BottomNav,
body.welcome-mode #v4AiFab,
body.intro-only #v4AiFab {
  display: none !important;
}

.v4-version-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  margin-top: 4px;
  color: #5d4fb0;
  background: #eeeafe;
  border: 1px solid rgba(119, 104, 200, .16);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#v4ContextBar {
  position: sticky;
  top: 0;
  z-index: 34;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  margin: -2px -2px 18px;
  padding: 7px 10px;
  border: 1px solid var(--v4-line);
  border-radius: 18px;
  background: rgba(255, 253, 250, .9);
  box-shadow: 0 10px 30px rgba(54, 43, 73, .08);
  backdrop-filter: blur(18px);
}

#v4ContextBar[data-home="true"] .v4-back {
  visibility: hidden;
}

#v4ContextBar .v4-back,
#v4ContextBar .v4-context-action {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--v4-line);
  border-radius: 14px;
  color: var(--v4-ink);
  background: #fff;
  font-weight: 900;
}

.v4-context-copy {
  min-width: 0;
  flex: 1;
}

.v4-context-copy strong,
.v4-context-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-context-copy strong {
  font-size: 15px;
}

.v4-context-copy span {
  color: var(--v4-muted);
  font-size: 12px;
}

#v4Dashboard {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.v4-dashboard-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--v4-line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(239, 235, 255, .95), rgba(255, 242, 238, .96)),
    #fff;
  box-shadow: 0 18px 48px rgba(68, 53, 94, .11);
}

.v4-dashboard-card::after {
  content: "";
  position: absolute;
  right: -54px;
  top: -62px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  pointer-events: none;
}

.v4-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6557b2;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.v4-dashboard-card h2 {
  max-width: 720px;
  margin: 8px 0 7px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(30px, 7vw, 46px);
  line-height: .98;
  letter-spacing: -.035em;
}

.v4-dashboard-card > p {
  max-width: 650px;
  margin: 0;
  color: var(--v4-muted);
  font-size: 15px;
  line-height: 1.5;
}

.v4-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.v4-status-item {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(119, 104, 200, .13);
  border-radius: 17px;
  background: rgba(255, 255, 255, .72);
}

.v4-status-item span,
.v4-status-item strong {
  display: block;
}

.v4-status-item span {
  margin-bottom: 3px;
  color: var(--v4-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.v4-status-item strong {
  overflow: hidden;
  color: var(--v4-ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-primary-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.v4-primary-actions button {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--v4-line);
  border-radius: 16px;
  color: var(--v4-ink);
  background: rgba(255, 255, 255, .88);
  text-align: left;
  font-weight: 800;
}

.v4-primary-actions button:first-child {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #7564c8, #9a76d4);
  box-shadow: 0 12px 24px rgba(104, 83, 177, .24);
}

.v4-primary-actions .v4-action-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(119, 104, 200, .1);
  font-size: 20px;
}

.v4-primary-actions button:first-child .v4-action-icon {
  background: rgba(255, 255, 255, .18);
}

.v4-emotion-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(245, 139, 153, .24);
  border-radius: 23px;
  background: linear-gradient(135deg, #fff, #fff3f3);
}

.v4-emotion-card h3,
.v4-emotion-card p {
  margin: 0;
}

.v4-emotion-card h3 {
  margin-bottom: 5px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
}

.v4-emotion-card p {
  color: var(--v4-muted);
  font-size: 13px;
  line-height: 1.45;
}

.v4-emotion-card button {
  padding: 11px 15px;
  border: 0;
  border-radius: 14px;
  color: #573d58;
  background: #ffe3e6;
  font-weight: 900;
  white-space: nowrap;
}

.v4-ai-home-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(119, 104, 200, .22);
  border-radius: 23px;
  background: linear-gradient(135deg, #f2efff, #fff 58%, #fff0f2);
  box-shadow: 0 12px 34px rgba(76, 58, 118, .08);
}

.v4-ai-home-card h3,
.v4-ai-home-card p {
  margin: 0;
}

.v4-ai-home-card h3 {
  margin-bottom: 3px;
  font-size: 17px;
}

.v4-ai-home-card p {
  color: var(--v4-muted);
  font-size: 12px;
  line-height: 1.45;
}

.v4-ai-mark {
  display: grid;
  min-width: 76px;
  min-height: 48px;
  place-items: center;
  padding: 8px 11px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #7768c8, #ef8797);
  font-size: 12px;
  font-weight: 900;
}

.v4-ai-home-card button {
  min-width: 104px;
  padding: 11px 15px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: #6557b2;
  font-weight: 900;
}

#v4AiFab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--v4-bottom-height) + 22px);
  z-index: 58;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #6e5fc0, #e77f95);
  box-shadow: 0 16px 35px rgba(86, 62, 145, .32);
  font-size: 13px;
}

#v4AiFab span {
  font-size: 20px;
  line-height: 1;
}

#v4AiFab.active {
  box-shadow: 0 0 0 4px rgba(119, 104, 200, .18), 0 16px 35px rgba(86, 62, 145, .32);
}

#v4AiFab.v4-phase-hidden {
  display: none !important;
}

#v4DesktopNav .v4-ai-nav {
  color: #fff;
  background: linear-gradient(135deg, #7667c6, #9c72cd);
  box-shadow: 0 9px 20px rgba(100, 78, 170, .2);
}

#v4DesktopNav .v4-ai-nav:hover,
#v4DesktopNav .v4-ai-nav.active {
  color: #fff;
  background: linear-gradient(135deg, #6756ba, #de7e9c);
}

#v4DesktopNav .v4-premium-nav {
  color: #8f4258;
  border: 1px solid rgba(240, 143, 164, .24);
  background: #fff0f2;
}

#assistant .ai-local-note {
  display: grid;
  gap: 2px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(119, 104, 200, .16);
  border-radius: 15px;
  color: #51476d;
  background: #f2efff;
  font-size: 12px;
}

#assistant .ai-open-label {
  display: block;
  margin: 15px 0 7px;
  font-weight: 800;
}

#assistant #chatInput {
  width: 100%;
  min-height: 118px;
  border-radius: 16px;
}

#assistant .ai-send-actions {
  align-items: center;
}

#assistant .ai-send-actions .primary {
  flex: 0 0 auto;
}

.ai-evaluation {
  display: block;
  width: fit-content;
  margin: 0 0 8px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #5546a0;
  background: #efecff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ai-evaluation.urgent {
  color: #8b2131;
  background: #ffe0e5;
}

.ai-evaluation.attention {
  color: #7a4b09;
  background: #fff0cf;
}

.ai-evaluation.practical {
  color: #36566f;
  background: #e8f3ff;
}

#home .today-panel,
#home .home-compact-section,
#home .home-packages-panel,
#home #fatherHomePanel,
#home .journey-compact,
#home .journey-compact .day-path,
#home .journey-compact .milestones,
#home .journey-compact #firstYearOffer,
#home .journey-compact #memoryNudge {
  display: none !important;
}

#home .home-focus-grid {
  display: block;
}

#home .journey-compact {
  margin-bottom: 18px;
  padding: 20px;
  border-color: rgba(245, 139, 153, .2);
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(255,240,241,.9));
}

#home .journey-compact .journey {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
}

#home .journey-compact .ring {
  width: 88px;
  height: 88px;
}

.v4-age-note {
  display: none;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 13px;
  color: #534d67;
  background: rgba(119, 104, 200, .08);
  font-size: 12px;
}

.v4-age-note.show {
  display: block;
}

#v4DesktopNav {
  display: grid;
  gap: 7px;
}

#v4DesktopNav .v4-nav-label {
  margin: 9px 8px 2px;
  color: var(--v4-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

#v4DesktopNav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  color: #4d4a5d;
  background: transparent;
  text-align: left;
  font-weight: 800;
}

#v4DesktopNav button:hover,
#v4DesktopNav button.active {
  color: #5f50b1;
  background: #efecff;
}

#v4BottomNav {
  position: fixed;
  left: 50%;
  bottom: 10px;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr 1fr 68px 1fr 1fr;
  align-items: end;
  width: min(520px, calc(100% - 20px));
  min-height: 66px;
  padding: 7px;
  border: 1px solid var(--v4-line);
  border-radius: 23px;
  background: rgba(255, 255, 255, .93);
  box-shadow: 0 20px 50px rgba(43, 34, 67, .22);
  transform: translateX(-50%);
  backdrop-filter: blur(22px);
}

#v4BottomNav button {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 52px;
  padding: 4px 2px;
  border: 0;
  border-radius: 15px;
  color: #777284;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}

#v4BottomNav button span:first-child {
  font-size: 20px;
}

#v4BottomNav button.active {
  color: #6253b2;
  background: #f0edff;
}

#v4BottomNav .v4-add-main {
  align-self: center;
  width: 60px;
  height: 60px;
  min-height: 60px;
  margin: -21px auto 4px;
  border: 5px solid #faf8fc;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #7768c8, #ef8797);
  box-shadow: 0 14px 30px rgba(103, 79, 177, .35);
  font-size: 30px;
  line-height: 1;
}

#v4QuickSheet,
#v4ToolsSheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: end;
  justify-content: center;
  padding: 14px;
  background: rgba(29, 25, 42, .45);
  backdrop-filter: blur(8px);
}

#v4QuickSheet.open,
#v4ToolsSheet.open {
  display: flex;
}

.v4-sheet-card {
  width: min(720px, 100%);
  max-height: min(84vh, 760px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--v4-line);
  border-radius: 30px 30px 22px 22px;
  background: #fffdfa;
  box-shadow: 0 30px 90px rgba(35, 28, 54, .34);
}

.v4-sheet-head {
  position: sticky;
  top: -20px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -20px -20px 16px;
  padding: 17px 20px 13px;
  border-bottom: 1px solid var(--v4-line);
  background: rgba(255, 253, 250, .95);
  backdrop-filter: blur(18px);
}

.v4-sheet-head div {
  min-width: 0;
  flex: 1;
}

.v4-sheet-head h2,
.v4-sheet-head p {
  margin: 0;
}

.v4-sheet-head h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
}

.v4-sheet-head p {
  color: var(--v4-muted);
  font-size: 12px;
}

.v4-sheet-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--v4-line);
  border-radius: 14px;
  background: #fff;
  font-size: 22px;
}

.v4-quick-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.v4-quick-tabs button {
  padding: 9px 5px;
  border: 1px solid var(--v4-line);
  border-radius: 14px;
  color: #5f5a6b;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.v4-quick-tabs button.active {
  color: #fff;
  border-color: transparent;
  background: #7261be;
}

.v4-quick-panel {
  display: none;
}

.v4-quick-panel.active {
  display: block;
}

.v4-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.v4-form-grid label,
.v4-quick-panel > label {
  display: grid;
  gap: 6px;
  color: #5f5a6b;
  font-size: 12px;
  font-weight: 800;
}

.v4-form-grid input,
.v4-form-grid select,
.v4-quick-panel textarea,
.v4-quick-panel input,
.v4-quick-panel select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--v4-line);
  border-radius: 14px;
  color: var(--v4-ink);
  background: #fff;
}

.v4-quick-panel textarea {
  min-height: 84px;
  resize: vertical;
}

.v4-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.v4-sheet-actions button {
  padding: 11px 15px;
  border: 1px solid var(--v4-line);
  border-radius: 14px;
  background: #fff;
  font-weight: 900;
}

.v4-sheet-actions .primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #7768c8, #9977d3);
}

.v4-live-timer {
  display: grid;
  place-items: center;
  min-height: 150px;
  margin: 10px 0;
  border-radius: 24px;
  background: linear-gradient(135deg, #eeebff, #fff1ee);
  text-align: center;
}

.v4-live-timer strong {
  display: block;
  font-size: clamp(34px, 10vw, 54px);
  font-variant-numeric: tabular-nums;
}

.v4-live-timer span {
  display: block;
  margin-top: 3px;
  color: var(--v4-muted);
  font-size: 12px;
}

.v4-warning-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 15px;
  color: #704d2e;
  background: #fff3df;
  font-size: 12px;
  line-height: 1.45;
}

.v4-tool-groups {
  display: grid;
  gap: 18px;
}

.v4-tool-group h3 {
  margin: 0 0 8px;
  color: #5f57a4;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.v4-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.v4-tool-grid button {
  min-width: 0;
  padding: 13px 10px;
  border: 1px solid var(--v4-line);
  border-radius: 16px;
  color: var(--v4-ink);
  background: #fff;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.v4-tool-grid button span {
  display: block;
  margin-bottom: 4px;
  font-size: 22px;
}

body.v4-upgrade #home .home-compact-section {
  display: none !important;
}

.v4-home-apps {
  padding: 20px;
  border: 1px solid var(--v4-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 34px rgba(64, 50, 87, .06);
}

.v4-home-apps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.v4-home-apps-head h3 {
  margin: 3px 0 0;
  font-size: 20px;
}

.v4-home-apps-head > button {
  padding: 8px 12px;
  border: 1px solid rgba(119, 104, 200, .18);
  border-radius: 13px;
  color: #6255ad;
  background: #f2effd;
  font-size: 12px;
  font-weight: 900;
}

.v4-home-app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.v4-home-app-grid button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--v4-line);
  border-radius: 17px;
  color: var(--v4-ink);
  background: linear-gradient(135deg, #fff, #faf8ff);
  text-align: left;
}

.v4-home-app-grid button > span {
  grid-row: 1 / 3;
  font-size: 22px;
}

.v4-home-app-grid strong,
.v4-home-app-grid small {
  display: block;
  min-width: 0;
}

.v4-home-app-grid strong {
  font-size: 12px;
}

.v4-home-app-grid small {
  color: var(--v4-muted);
  font-size: 10px;
  line-height: 1.35;
}

#v4Apps {
  display: grid;
  gap: 16px;
}

.v4-apps-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 25px;
  border: 1px solid var(--v4-line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(239, 235, 255, .96), rgba(255, 241, 239, .95));
  box-shadow: 0 18px 48px rgba(68, 53, 94, .09);
}

.v4-apps-head h1 {
  margin: 6px 0 5px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(38px, 6vw, 54px);
  line-height: 1;
  letter-spacing: -.04em;
}

.v4-apps-head p {
  max-width: 660px;
  margin: 0;
  color: var(--v4-muted);
  font-size: 14px;
}

.v4-apps-head > button {
  flex: 0 0 auto;
  padding: 11px 15px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #6758ba, #9974d0);
  font-size: 12px;
  font-weight: 900;
}

.v4-app-category-nav {
  display: flex;
  gap: 7px;
  padding: 4px 1px 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.v4-app-category-nav button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--v4-line);
  border-radius: 999px;
  color: #5f57a4;
  background: rgba(255, 255, 255, .86);
  font-size: 11px;
  font-weight: 900;
}

.v4-app-category-nav button.tier-free {
  color: #5d4fb0;
  background: #f0edff;
}

.v4-app-category-nav button.tier-premium {
  color: #9b485d;
  background: #fff0f2;
}

.v4-app-category-nav button.tier-addon {
  color: #875a2f;
  background: #fff5e7;
}

.v4-app-groups {
  display: grid;
  gap: 14px;
}

.v4-app-group {
  scroll-margin-top: 88px;
  padding: 20px;
  border: 1px solid var(--v4-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, .87);
  box-shadow: 0 11px 32px rgba(64, 50, 87, .05);
}

.v4-app-group.tier-free {
  border-top: 4px solid #9b8edc;
}

.v4-app-group.tier-premium {
  border-top: 4px solid #f08fa4;
}

.v4-app-group.tier-addon {
  border-top: 4px solid #e8ad68;
}

.v4-app-group > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.v4-app-group > header > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.v4-app-group > header .v4-tier-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #5d4fb0;
  background: #efebff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}

.v4-app-group.tier-premium > header .v4-tier-badge {
  color: #fff;
  background: linear-gradient(135deg, #7666c4, #f08fa4);
}

.v4-app-group.tier-addon > header .v4-tier-badge {
  color: #7d5127;
  background: #fff0d9;
}

.v4-app-group h2 {
  margin: 0;
  font-size: 21px;
}

.v4-app-group > header p {
  max-width: 470px;
  margin: 0;
  color: var(--v4-muted);
  font-size: 11px;
  text-align: right;
}

.v4-app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.v4-app-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px 11px;
  min-width: 0;
  min-height: 137px !important;
  padding: 15px;
  border: 1px solid var(--v4-line);
  border-radius: 18px;
  color: var(--v4-ink);
  background: linear-gradient(145deg, #fff, #faf8ff);
  text-align: left;
}

.v4-app-card:hover {
  border-color: rgba(119, 104, 200, .3);
  box-shadow: 0 10px 24px rgba(73, 58, 105, .08);
  transform: translateY(-1px);
}

.v4-app-icon {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  border-radius: 14px;
  background: linear-gradient(135deg, #efebff, #fff0ed);
  font-size: 20px;
}

.v4-app-copy strong,
.v4-app-copy small {
  display: block;
}

.v4-app-copy strong {
  margin-top: 1px;
  font-size: 13px;
}

.v4-app-copy small {
  margin-top: 4px;
  color: var(--v4-muted);
  font-size: 10px;
  line-height: 1.4;
}

.v4-app-open {
  grid-column: 2;
  align-self: end;
  color: #7064bd;
  font-size: 10px;
  font-weight: 900;
}

.v4-app-open i {
  margin-right: 5px;
  padding: 3px 5px;
  border-radius: 999px;
  color: #6659b1;
  background: #f0edff;
  font-size: 7px;
  font-style: normal;
  letter-spacing: .06em;
}

.tier-premium .v4-app-open i {
  color: #9b485d;
  background: #fff0f2;
}

.tier-addon .v4-app-open i {
  color: #875a2f;
  background: #fff5e7;
}

.v4-app-open b {
  font-size: 17px;
}

#profileModal .v4-profile-actions {
  position: sticky;
  top: -1px;
  z-index: 5;
  justify-content: flex-end;
  margin: 0 -4px 14px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--v4-line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
}

#profileModal .v4-profile-actions button {
  min-width: 112px;
}

#v4Reports {
  display: grid;
  gap: 16px;
}

.v4-reports-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--v4-line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(239, 235, 255, .96), rgba(255, 241, 239, .95));
  box-shadow: 0 18px 48px rgba(68, 53, 94, .09);
}

.v4-reports-head h2 {
  margin: 6px 0 5px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1;
  letter-spacing: -.035em;
}

.v4-reports-head p {
  max-width: 680px;
  margin: 0;
  color: var(--v4-muted);
  font-size: 14px;
  line-height: 1.5;
}

.v4-report-range {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(119, 104, 200, .14);
  border-radius: 15px;
  background: rgba(255, 255, 255, .68);
}

.v4-report-range button {
  min-height: 38px !important;
  padding: 8px 12px;
  border: 0;
  border-radius: 11px;
  color: var(--v4-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.v4-report-range button.active {
  color: #fff;
  background: linear-gradient(135deg, #7768c8, #9277d0);
  box-shadow: 0 7px 18px rgba(119, 104, 200, .25);
}

.v4-report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.v4-report-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  min-width: 0;
  min-height: 124px !important;
  padding: 15px;
  border: 1px solid var(--v4-line);
  border-radius: 20px;
  color: var(--v4-ink);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 10px 28px rgba(64, 50, 87, .06);
  text-align: left;
}

.v4-report-card:hover {
  border-color: rgba(119, 104, 200, .28);
  transform: translateY(-1px);
}

.v4-report-card-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: linear-gradient(135deg, #efebff, #fff0ed);
  font-size: 19px;
}

.v4-report-card-copy,
.v4-report-card-copy small,
.v4-report-card-copy strong,
.v4-report-card-copy em {
  display: block;
  min-width: 0;
}

.v4-report-card-copy small {
  margin-bottom: 3px;
  color: var(--v4-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.v4-report-card-copy strong {
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.1;
}

.v4-report-card-copy em {
  margin-top: 5px;
  color: var(--v4-muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.v4-report-arrow {
  color: #8a7dcc;
  font-size: 24px;
  line-height: 1;
}

.v4-report-layout {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(340px, 1.1fr);
  gap: 12px;
}

.v4-report-panel,
.v4-report-shortcuts {
  padding: 20px;
  border: 1px solid var(--v4-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 12px 34px rgba(64, 50, 87, .06);
}

.v4-report-panel-head,
.v4-report-shortcuts {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.v4-report-panel-head span,
.v4-report-shortcuts > div:first-child span {
  color: #7064bd;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.v4-report-panel-head h3,
.v4-report-shortcuts h3 {
  margin: 3px 0 0;
  font-size: 18px;
}

.v4-report-panel-head > strong {
  color: var(--v4-muted);
  font-size: 12px;
  white-space: nowrap;
}

.v4-report-bars {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-height: 176px;
  margin-top: 16px;
  padding: 12px 5px 0;
  border-top: 1px solid rgba(119, 104, 200, .1);
}

.v4-report-bar {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.v4-report-bar > span {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: min(100%, 34px);
  min-height: 7px;
  border-radius: 10px 10px 5px 5px;
  background: linear-gradient(180deg, #8a79d8, #f08fa4);
  box-shadow: 0 7px 16px rgba(119, 104, 200, .18);
}

.v4-report-bar b {
  padding-top: 5px;
  color: #fff;
  font-size: 10px;
}

.v4-report-bar small {
  color: var(--v4-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.v4-report-list {
  display: grid;
  gap: 3px;
  max-height: 245px;
  margin: 13px -4px -5px;
  padding: 0 4px 0 0;
  overflow-y: auto;
  list-style: none;
}

.v4-report-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 5px;
  border-bottom: 1px solid rgba(119, 104, 200, .09);
}

.v4-report-list-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: #f3effb;
  font-size: 15px;
}

.v4-report-list strong,
.v4-report-list small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-report-list strong {
  font-size: 12px;
}

.v4-report-list small,
.v4-report-list time {
  color: var(--v4-muted);
  font-size: 10px;
}

.v4-report-list time {
  white-space: nowrap;
}

.v4-report-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 20px;
  text-align: center;
}

.v4-report-empty > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #7768c8, #f08fa4);
  font-size: 26px;
}

.v4-report-empty p {
  max-width: 320px;
  margin: 5px 0 12px;
  color: var(--v4-muted);
  font-size: 12px;
}

.v4-report-empty button,
.v4-report-shortcuts button {
  padding: 9px 13px;
  border: 1px solid rgba(119, 104, 200, .18);
  border-radius: 13px;
  color: #6255ad;
  background: #f2effd;
  font-size: 12px;
  font-weight: 900;
}

.v4-report-shortcuts {
  align-items: center;
}

.v4-report-shortcuts > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.role-switch,
#fatherHomePanel {
  display: none !important;
}

body.night #v4ContextBar,
body.night #v4BottomNav,
body.night .v4-sheet-card,
body.night .v4-sheet-head,
body.night .v4-primary-actions button:not(:first-child),
body.night .v4-tool-grid button,
body.night .v4-form-grid input,
body.night .v4-form-grid select,
body.night .v4-quick-panel textarea,
body.night .v4-quick-panel input,
body.night .v4-quick-panel select,
body.night .v4-sheet-close,
body.night .v4-sheet-actions button:not(.primary) {
  color: #eef0f8 !important;
  border-color: rgba(255,255,255,.12) !important;
  background: #20283a !important;
}

body.night .v4-dashboard-card,
body.night .v4-emotion-card,
body.night .v4-ai-home-card,
body.night .v4-home-apps,
body.night .v4-home-app-grid button,
body.night .v4-apps-head,
body.night .v4-app-group,
body.night .v4-app-card,
body.night .v4-reports-head,
body.night .v4-report-card,
body.night .v4-report-panel,
body.night .v4-report-shortcuts,
body.night #home .journey-compact,
body.night .v4-live-timer {
  color: #f5f6fb !important;
  border-color: rgba(255,255,255,.12) !important;
  background: linear-gradient(135deg, #222b3e, #2c2940) !important;
}

body.night .v4-status-item {
  color: #f5f6fb;
  border-color: rgba(255,255,255,.1);
  background: rgba(255,255,255,.06);
}

body.night .v4-status-item strong,
body.night .v4-context-copy strong,
body.night .v4-primary-actions button:not(:first-child),
body.night .v4-emotion-card h3,
body.night .v4-home-apps h3,
body.night .v4-home-app-grid strong,
body.night .v4-apps-head h1,
body.night .v4-app-group h2,
body.night .v4-app-card,
body.night .v4-app-copy strong,
body.night .v4-report-card,
body.night .v4-report-card-copy strong,
body.night .v4-report-panel h3,
body.night .v4-report-shortcuts h3,
body.night .v4-report-list strong {
  color: #f5f6fb;
}

body.night #assistant .ai-local-note,
body.night #assistant #chatInput {
  color: #eef0f8;
  border-color: rgba(255,255,255,.12);
  background: #20283a;
}

body.night .v4-dashboard-card > p,
body.night .v4-emotion-card p,
body.night .v4-context-copy span,
body.night .v4-status-item span,
body.night .v4-sheet-head p,
body.night .v4-home-app-grid small,
body.night .v4-apps-head p,
body.night .v4-app-group > header p,
body.night .v4-app-copy small,
body.night .v4-reports-head p,
body.night .v4-report-card-copy small,
body.night .v4-report-card-copy em,
body.night .v4-report-panel-head > strong,
body.night .v4-report-list small,
body.night .v4-report-list time,
body.night .v4-report-bar small {
  color: #b8c0d2;
}

body.night .v4-report-range,
body.night .v4-home-apps-head > button,
body.night .v4-app-category-nav button,
body.night .v4-report-list-icon,
body.night .v4-report-shortcuts button,
body.night .v4-report-empty button {
  border-color: rgba(255,255,255,.12);
  background: #2a3245;
}

body.night #profileModal .v4-profile-actions {
  border-color: rgba(255,255,255,.12);
  background: rgba(32, 42, 58, .96);
}

body.night #v4QuickSheet,
body.night #v4ToolsSheet {
  background: rgba(5, 8, 16, .7);
}

@media (max-width: 959px) {
  body.v4-upgrade:not(.welcome-mode):not(.intro-only) {
    padding-bottom: calc(var(--v4-bottom-height) + 18px);
  }

  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .sidebar {
    position: sticky;
    top: 0;
    z-index: 42;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 74px;
    padding: 9px 13px;
    border-bottom: 1px solid var(--v4-line);
    background: rgba(255, 253, 250, .92);
    backdrop-filter: blur(20px);
  }

  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .sidebar .brand {
    min-width: 0;
  }

  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .brand-logo {
    width: 126px;
  }

  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .sidebar > .baby-card,
  body.v4-upgrade:not(.welcome-mode):not(.intro-only) #v4DesktopNav,
  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .mobile-home-action,
  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .brand-copy {
    display: none !important;
  }

  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .side-actions {
    display: flex;
    gap: 7px;
  }

  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .side-actions button {
    width: 44px;
    min-width: 44px;
  }

  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .main {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 12px 12px 24px;
  }

  #v4ContextBar {
    top: 78px;
  }

  .v4-primary-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v4-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v4-app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v4-report-layout {
    grid-template-columns: 1fr;
  }

  #home .journey-compact .journey {
    grid-template-columns: 1fr;
  }

  #home .journey-compact .ring {
    display: none;
  }
}

@media (min-width: 960px) {
  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .app {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    max-width: 1440px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(86, 72, 110, .08), 0 28px 100px rgba(49, 38, 73, .12);
  }

  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    padding: 20px 16px;
    overflow-y: auto;
    border-right: 1px solid var(--v4-line);
    border-bottom: 0;
    background: rgba(255, 253, 250, .94);
  }

  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .brand-logo {
    width: 154px;
  }

  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .sidebar > .baby-card {
    display: block;
  }

  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .main {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 30px 50px;
  }

  body.v4-upgrade:not(.welcome-mode):not(.intro-only) .side-actions {
    margin-top: auto;
  }

  #v4BottomNav {
    display: none;
  }

  #v4AiFab {
    right: 28px;
    bottom: 28px;
  }

  #v4ContextBar {
    top: 14px;
  }

  #v4QuickSheet,
  #v4ToolsSheet {
    align-items: center;
  }

  .v4-sheet-card {
    border-radius: 30px;
  }
}

@media (max-width: 560px) {
  .v4-home-apps {
    padding: 16px;
    border-radius: 20px;
  }

  .v4-home-apps-head {
    align-items: flex-start;
  }

  .v4-home-apps-head > button {
    max-width: 110px;
  }

  .v4-home-app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v4-home-app-grid button {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .v4-home-app-grid button > span {
    grid-row: auto;
  }

  .v4-apps-head {
    display: grid;
    padding: 18px;
    border-radius: 23px;
  }

  .v4-apps-head h1 {
    font-size: 42px;
  }

  .v4-apps-head > button {
    width: 100%;
  }

  .v4-app-group {
    padding: 15px;
    border-radius: 20px;
  }

  .v4-app-group > header {
    display: grid;
    gap: 5px;
  }

  .v4-app-group > header p {
    text-align: left;
  }

  .v4-app-grid {
    grid-template-columns: 1fr;
  }

  .v4-app-card {
    min-height: 112px !important;
  }

  #profileModal .v4-profile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  #profileModal .v4-profile-actions button {
    width: 100%;
    min-width: 0;
  }

  .v4-reports-head {
    display: grid;
    padding: 18px;
    border-radius: 23px;
  }

  .v4-reports-head h2 {
    font-size: 36px;
  }

  .v4-report-range {
    width: 100%;
  }

  .v4-report-range button {
    flex: 1;
  }

  .v4-report-card {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    min-height: 132px !important;
    padding: 13px;
  }

  .v4-report-card-icon {
    width: 34px;
    height: 34px;
  }

  .v4-report-card-copy {
    grid-column: 1 / -1;
  }

  .v4-report-card-copy strong {
    font-size: 16px;
  }

  .v4-report-panel,
  .v4-report-shortcuts {
    padding: 16px;
    border-radius: 20px;
  }

  .v4-report-shortcuts {
    display: grid;
  }

  .v4-report-shortcuts > div:last-child {
    justify-content: flex-start;
  }

  .v4-report-list li {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .v4-report-list time {
    display: none;
  }

  .v4-dashboard-card {
    padding: 18px;
    border-radius: 23px;
  }

  .v4-dashboard-card h2 {
    font-size: 34px;
  }

  .v4-status-grid,
  .v4-form-grid {
    grid-template-columns: 1fr;
  }

  .v4-emotion-card {
    grid-template-columns: 1fr;
  }

  .v4-ai-home-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .v4-ai-home-card button {
    grid-column: 1 / -1;
    width: 100%;
  }

  #v4AiFab {
    right: 12px;
    bottom: calc(var(--v4-bottom-height) + 20px);
    min-width: 48px;
    padding: 8px 11px;
  }

  #v4AiFab strong {
    font-size: 11px;
  }

  #assistant .ai-send-actions .primary {
    width: 100%;
  }

  .v4-emotion-card button {
    width: 100%;
  }

  .v4-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v4-sheet-card {
    padding: 16px;
  }

  .v4-sheet-head {
    top: -16px;
    margin: -16px -16px 14px;
    padding: 14px 16px 11px;
  }
}
