:root {
  color-scheme: light;
  --paper: #f4f4f6;
  --white: #fff;
  --ink: #1b1b21;
  --muted: #555560;
  --line: #e1e1e7;
  --accent: #493cb1;
  --accent-hover: #382c91;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
h1,h2,h3,p,figure { margin: 0; }
h1,h2,h3 { line-height: 1.06; letter-spacing: -.055em; font-weight: 660; }
h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(1.55rem, 3.1vw, 2.2rem); margin-bottom: 1rem; }
h3 { font-size: 1.4rem; margin-bottom: .6rem; }
a { color: inherit; text-underline-offset: .2em; }
button,input,textarea,select { font: inherit; }
button,.action {
  display: inline-flex; justify-content: center; align-items: center;
  min-height: 44px; padding: .65rem 1.15rem; border: 0; border-radius: 999px;
  color: white; background: var(--accent); text-decoration: none; font-weight: 640; cursor: pointer;
}
button:hover,.action:hover { background: var(--accent-hover); }
button.secondary { color: var(--ink); background: #ebebf0; }
button.secondary:hover { background: #dedee8; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #7767e0; outline-offset: 3px; }
input,textarea,select { display: block; width: 100%; min-width: 0; min-height: 46px; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: #fafafc; color: var(--ink); }
textarea { min-height: 102px; resize: vertical; }
label { display: block; font-weight: 620; }
label input,label textarea,label select { margin-top: .35rem; font-weight: 400; }
small,.muted { color: var(--muted); }
header {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .7rem max(5%, calc((100% - 1280px) / 2));
  background: #fbfbfd; border-bottom: 1px solid var(--line);
}
.brand { font-size: 1.75rem; font-weight: 720; letter-spacing: -.075em; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--accent); }
#identity,.top-links,.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
#identity { justify-content: flex-end; font-size: .9rem; }
.top-links { gap: 1.2rem; }
.top-links > a:not(.action) { text-decoration: none; }
.top-links .action { min-height: 40px; }
main { padding: 2rem 1.25rem 3.5rem; margin: auto; }
footer { text-align: center; border-top: 1px solid var(--line); color: var(--muted); padding: 1.15rem; font-size: .875rem; }

.landing { max-width: 1336px; }
.landing-hero { isolation: isolate; position: relative; display: grid; align-items: center; min-height: clamp(500px, 57vw, 705px); overflow: hidden; border-radius: 22px; color: white; background: #20232f; }
.landing-copy { z-index: 1; position: relative; max-width: 710px; padding: clamp(1.5rem, 6vw, 6rem); }
.kicker { margin-bottom: 1rem; font-weight: 620; color: #f0eefb; }
.landing h1 { font-size: clamp(2.75rem, 7.2vw, 6.3rem); line-height: .98; letter-spacing: -.075em; }
.landing-copy > p:not(.kicker) { max-width: 39ch; margin: 1.3rem 0 1.75rem; color: #f1f1f7; font-size: 1.1rem; }
.landing-copy .action { background: white; color: #21194d; }
.landing-copy .action:hover { background: #eeebff; }
.landing-photo,.landing-photo img,.landing-hero::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.landing-photo { z-index: -2; }
.landing-photo img,.auth-photo img { object-fit: cover; object-position: center; }
.landing-hero::after { content: ''; z-index: -1; background: linear-gradient(90deg,#0f1224e8 0%,#11162dc4 35%,#181a291f 85%); pointer-events: none; }
.photo-credit { position: absolute; right: .75rem; bottom: .65rem; padding: .2rem .5rem; background: #1c1c26dc; color: white; border-radius: .3rem; font-size: .76rem; text-decoration: none; }
.landing-photo figcaption { position: absolute; inset: auto 0 0; z-index: 1; }
.feature-section { padding-top: clamp(2.5rem, 6vw, 5rem); }
.features { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .9rem; }
.feature-copy,.approach { border: 1px solid var(--line); border-radius: 19px; background: var(--white); padding: clamp(1.25rem, 3vw, 2.45rem); }
.feature-copy p,.approach p { color: var(--muted); }
.approach { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1rem; background: #eae7f9; border-color: #e2def5; }
.approach p { max-width: 64ch; }
.approach details { margin-top: .9rem; }
.approach summary { cursor: pointer; font-weight: 620; }
.approach .action { flex: none; }

.auth { max-width: 1130px; }
.auth-shell { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--white); }
.auth-panel { padding: clamp(1.5rem, 5vw, 4rem); }
.auth-panel h1 { font-size: clamp(2.25rem, 4.4vw, 3.9rem); margin-bottom: .55rem; }
.auth-panel form { margin-top: 1.65rem; }
.auth-photo { position: relative; background: #daddd9; }
.auth-photo img { position: absolute; width: 100%; height: 100%; }
.demo-access { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.demo-access p { margin-bottom: .65rem; }
.demo-access button { font-size: .875rem; padding-inline: .8rem; }
.demo-access button[aria-pressed="true"] { color: #302078; background: #e6e0ff; }

.workspace { max-width: 1080px; }
.workspace nav { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.workspace nav button { color: var(--muted); background: transparent; }
.workspace nav button:hover { background: #e9e7f2; }
.workspace nav button.active { color: #302078; background: #e6e0ff; }
.workspace h1 { margin-bottom: 1.15rem; }
.card { padding: clamp(1.15rem, 3vw, 2rem); margin-bottom: 1rem; border-radius: 19px; border: 1px solid var(--line); background: var(--white); min-width: 0; }
.card p + button { margin-top: 1rem; }
.hero { background: linear-gradient(105deg, #211b42, #39305f); color: white; }
.hero h1 { font-size: clamp(2.7rem, 6vw, 4.5rem); }
.hero button { background: white; color: #21194d; }
.hero button:hover { background: #eeebff; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(145px,100%),1fr)); gap: .8rem; }
.metric { font-size: 2.15rem; font-weight: 680; letter-spacing: -.07em; }
.stack { display: grid; gap: .85rem; }
.reflection-form button { justify-self: start; }
.notice { color: var(--muted); font-size: .875rem; margin-top: 1rem; }
.error { color: #a62739; }
.error:empty { display: none; }
.row input { flex: 1 1 160px; }
.chatlog { min-height: 175px; max-height: 52vh; overflow: auto; padding: .7rem; background: #f6f5fa; border-radius: 14px; margin-bottom: 1rem; }
.bubble { width: fit-content; max-width: 88%; margin: .45rem 0; padding: .7rem .9rem; border-radius: 14px; background: white; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.user { margin-left: auto; background: #4a3ab3; color: white; }
.entry { padding-block: .9rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.entry:last-child { border-bottom: 0; }
.entry-text { margin: .55rem 0; white-space: pre-wrap; }
table { width: 100%; border-collapse: collapse; font-size: .925rem; }
td,th { text-align: left; padding: .65rem .45rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }

@media (max-width: 700px) {
  main { padding: 1rem .9rem 2rem; }
  header { padding-inline: .9rem; }
  .landing-hero { min-height: 490px; align-items: end; }
  .landing-hero::after { background: linear-gradient(0deg,#0f1224f2,#11162d82 68%,#11162d20); }
  .landing-copy { padding-bottom: 3rem; }
  .features,.auth-shell { grid-template-columns: minmax(0,1fr); }
  .auth-photo { min-height: 170px; }
  .approach { flex-direction: column; align-items: start; }
  .workspace nav button { padding-inline: .65rem; }
  .top-links a:first-child:not(:only-child) { display: none; }
}

/* Signed-in application */
.signed-in { background: #f6f7fb; }
.signed-in > header { padding-block: .55rem; }
.signed-in > footer { display: none; }
.signed-in .account-shortcut,.profile-avatar {
  display: inline-grid; place-items: center; padding: 0; width: 42px; height: 42px;
  min-height: 0; border-radius: 50%; color: #392d85; background: #e9e6fb;
}
.signed-in .account-shortcut:hover { background: #ded8f7; }
.workspace { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: clamp(1rem,4vw,3rem); max-width: 1250px; }
.app-main { min-width: 0; }
.workspace nav.app-navigation {
  display: flex; flex-direction: column; align-items: stretch; align-self: start; gap: 4px;
  position: sticky; top: 1.25rem; padding: .65rem; margin: 0; border: 1px solid #e8e8ef; border-radius: 18px; background: white;
}
.workspace nav button { justify-content: start; gap: .65rem; padding: .6rem .75rem; border-radius: 10px; font-size: .9rem; }
.navigation-icon { display: grid; place-items: center; min-width: 1.25em; font-size: 1.25rem; line-height: 1; }
.workspace nav button.active { background: #eeeafb; color: #382a88; }
.workspace .today-heading { margin-bottom: 1.15rem; }
.today-heading h1,.workspace h1 { font-size: clamp(2rem,4vw,3.5rem); margin: 0 0 .3rem; }
.today-date { color: #555560; text-transform: capitalize; font-size: .875rem; font-weight: 650; margin-bottom: .35rem; }
.coach-feature { isolation: isolate; overflow: hidden; position: relative; padding: clamp(1.35rem,4.8vw,3.15rem); border-radius: 24px; color: white; background: linear-gradient(112deg,#1f1944,#413281); }
.coach-feature h2 { font-size: clamp(1.85rem,3.9vw,3.1rem); max-width: 15ch; }
.feature-label { font-weight: 650; font-size: .875rem; color: #e7e1ff; margin-bottom: .5rem; }
.coach-feature button { background: #fff; color: #29204d; }
.coach-feature button:hover { background: #eeebff; }
.coach-rings { position:absolute; z-index:-1; right: -5%; top: 50%; transform: translateY(-50%); width: min(44%,290px); aspect-ratio:1; border-radius:50%; border:1px solid #b9a7ff66; box-shadow: 0 0 0 22px #b9a7ff22,0 0 0 47px #b9a7ff15,0 0 0 75px #b9a7ff10; background: radial-gradient(circle at 39% 38%,#a592ea50,#6954b12b 60%, transparent); }
.mood-section { margin-top: 1rem; padding: 1.15rem 1.4rem; background: #fff; border: 1px solid #e8e8ef; border-radius: 20px; }
.mood-section h2 { font-size: 1.3rem; margin-bottom: .6rem; }
.mood-options { display:flex; gap:.45rem; }
.mood-options button { flex:1; max-width: 62px; min-width: 0; padding: .4rem; border-radius: 13px; background:#f3f3f8; font-size:1.25rem; }
.mood-options button:hover,.mood-options button[aria-pressed="true"] { background:#e9e2ff; box-shadow:inset 0 0 0 1px #9e89df; }
.mood-section p { font-size:.85rem; margin-top:.55rem; }
.today-overview { margin-top: 1rem; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
button.overview-link { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .65rem; text-align:left; border-radius: 17px; border: 1px solid #e8e8ef; background: white; color:var(--ink); padding: .75rem; }
button.overview-link:hover { background: #f2effd; }
.overview-link strong,.overview-link small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.overview-icon { display:grid; place-items:center; width: 39px; height:39px; border-radius:12px; background:#eee9fc; color:#4d398d; font-size:1.2rem; }
.journal-icon { background:#e7f1ed; color:#27614d; }
.overview-mark { color:var(--muted); }
.thread { border:1px solid #e8e8ef; background:#fff; border-radius:22px; overflow:hidden; }
.signed-in .thread-heading { display:block; padding: 1.1rem 1.4rem; background:#fff; border-bottom:1px solid #eeeef4; }
.thread-heading h1 { font-size:clamp(1.5rem,3vw,2.2rem); }
.thread-heading p,.chat-status { font-size:.875rem; color:var(--muted); }
.thread .chatlog { background:#fff; margin:0; min-height: 290px; max-height: 52vh; padding: 1.15rem 1.4rem; border-radius:0; }
.thread-empty { display:grid; place-items:center; padding: 2.5rem 0; font-weight:620; text-align:center; font-size:1.2rem; }
.message-row { display:flex; align-items:start; flex-direction:column; margin:0 0 .95rem; }
.message-row.from-user { align-items:end; }
.message-author { font-weight:650; font-size:.8rem; color:var(--muted); }
.thread .bubble { margin:.2rem 0 0; background:#f1eff8; }
.thread .bubble.user { background:#493cb1; }
.composer { display:flex; gap:.55rem; align-items:end; margin:.45rem 1rem; }
.composer textarea { min-height: 46px; max-height: 140px; padding-block:.65rem; }
.chat-status { margin: .4rem 1rem .85rem; }
.record-layout { display:grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap:1rem; align-items:start; }
.record-layout h2,.profile-actions h2 { font-size:1.35rem; }
.profile-card { display:flex; gap:1rem; align-items:center; }
.profile-avatar { width:62px; height:62px; font-size:1.5rem; font-weight:650; flex:none; }
.profile-card h2 { margin:0 0 .35rem; }
.table-wrap { overflow-x:auto; }
.workspace .error:not(:empty) { padding-top:.6rem; }
@media (max-width: 740px) {
  .signed-in > header { padding-inline: 1rem; }
  .workspace { display:block; padding:1rem 1rem calc(85px + env(safe-area-inset-bottom)); }
  .workspace nav.app-navigation { position:fixed; z-index:5; inset:auto 0 0; display:flex; flex-direction:row; gap:0; border-radius:0; border-width:1px 0 0; padding:.3rem .25rem calc(.35rem + env(safe-area-inset-bottom)); background:#fffffff5; }
  .workspace nav button { flex:1; min-width:0; justify-content:center; flex-direction:column; gap:.18rem; padding:.35rem .1rem; min-height:50px; font-size:.74rem; }
  .navigation-icon { font-size:1.3rem; }
  .today-overview,.record-layout { grid-template-columns: minmax(0,1fr); }
  .thread .chatlog { min-height: 220px; max-height: 43dvh; }
}
