:root {
  --mist: #F7F1EC;
  --paper: #FFFCF9;
  --ink: #231A33;
  --ink-soft: #6E6680;
  --lake: #4A3763;
  --lake-deep: #231A33;
  --lake-wash: #EFEBF5;
  --lilac: #A87B2F;
  --lilac-wash: #F7EEDD;
  --line: #E6DDE6;
  --danger: #A8443A;
  --radius-s: 12px;
  --radius-m: 20px;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--mist); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--lilac); outline-offset: 2px; }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; margin: 0 0 .4em; }
h1 { font-size: 2rem; line-height: 1.15; }
h2 { font-size: 1.35rem; }
.hint { color: var(--ink-soft); font-size: .92rem; margin: 0 0 .75rem; }
.fine { color: var(--ink-soft); font-size: .8rem; line-height: 1.45; }
.stack { display: grid; gap: .6rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; }
.spacer { flex: 1; }

/* Buttons */
.btn { border: 1px solid transparent; border-radius: 999px; padding: .55rem 1.05rem; cursor: pointer; background: none; font-weight: 500; line-height: 1.2; }
.btn.primary { background: var(--lake); color: #fff; }
.btn.primary:hover { background: var(--lake-deep); }
.btn.primary:disabled { opacity: .55; cursor: default; }
.btn.ghost { border-color: var(--line); background: var(--paper); }
.btn.ghost:hover { border-color: var(--lake); }
.btn.link { color: var(--ink-soft); text-decoration: underline; padding: .3rem; }
.btn.danger { border-color: var(--danger); color: var(--danger); background: var(--paper); }
.btn.wide { width: 100%; }
.field { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-s); padding: .6rem .7rem; background: var(--paper); margin: .4rem 0; }
label { font-size: .9rem; font-weight: 500; }
input[type=email], input[type=password] { border: 1px solid var(--line); border-radius: var(--radius-s); padding: .75rem .8rem; background: var(--paper); }

/* Auth & pay */
.screen.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(120% 60% at 50% 100%, var(--lake-wash), transparent 70%), var(--mist); }
.auth-card { max-width: 440px; width: 100%; }
.auth-mark { width: 56px; height: 56px; color: var(--lake); margin-bottom: 1rem; }
.lede { font-family: var(--serif); font-size: 1.12rem; line-height: 1.6; color: var(--ink); margin: 0 0 1.5rem; }
.price { font-family: var(--serif); font-size: 1.4rem; margin: 0 0 1rem; }

/* App shell */
.screen.app { height: 100%; display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--serif); font-size: 1.1rem; }
.brand svg { width: 30px; height: 30px; color: #E7C98E; }
.bar-actions { display: flex; gap: 6px; }
.bar .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.bar .btn.ghost:hover { border-color: #fff; }

.workspace { flex: 1; min-height: 0; display: flex; }
.conversation { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.thread { flex: 1; overflow-y: auto; padding: 28px 20px 8px; }
.thread > * { max-width: 720px; margin-left: auto; margin-right: auto; }

.msg { margin-bottom: 22px; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m) var(--radius-m) 4px var(--radius-m); padding: .7rem 1rem; max-width: 85%; white-space: pre-wrap; }
.msg.user img { display: block; max-width: 260px; border-radius: var(--radius-s); border: 1px solid var(--line); margin-bottom: .4rem; background: #fff; }
.msg.mate { font-family: var(--serif); font-size: 1.06rem; line-height: 1.7; padding-left: 18px; border-left: 2px solid var(--lake); }
.msg.mate p { margin: 0 0 .8em; }
.msg.mate ul, .msg.mate ol { margin: 0 0 .8em; padding-left: 1.3em; }
.msg.mate.thinking { color: var(--ink-soft); font-style: italic; border-left-style: dashed; }
.msg.mate.flag { border-left-color: var(--danger); }

.welcome { padding: 0 20px 18px; max-width: 760px; width: 100%; margin: auto auto 0; }
.welcome h2 { font-size: 1.8rem; }
.starters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: .5rem .9rem; cursor: pointer; }
.chip:hover { border-color: var(--lake); }
.chip[data-studio] { background: var(--lilac-wash); border-color: transparent; color: #7A5A22; }

.composer { padding: 10px 20px 14px; background: linear-gradient(transparent, var(--mist) 30%); }
.composer > * { max-width: 760px; margin-left: auto; margin-right: auto; }
#input { display: block; width: 100%; resize: none; border: 1px solid var(--line); border-radius: var(--radius-m); padding: .85rem 1rem; background: var(--paper); min-height: 56px; max-height: 220px; }
.composer-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.studio-btn { background: var(--lilac); color: #fff; }
.studio-btn:hover { background: #8E6826; }
.crisis { font-size: .78rem; color: var(--ink-soft); margin-top: 8px; }
.attach { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; font-size: .9rem; }
.attach img { height: 56px; border-radius: 6px; border: 1px solid var(--line); background: #fff; }

/* Studio */
.studio { width: 440px; flex-shrink: 0; background: var(--paper); border-left: 1px solid var(--line); overflow-y: auto; padding: 16px 18px 24px; }
.studio-head { display: flex; justify-content: space-between; align-items: center; }
.studio-head h2 { color: var(--lilac); margin: 0; }
.tabs { display: flex; gap: 4px; margin: 12px 0 14px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: .55rem .7rem; cursor: pointer; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--lilac); }

.canvas-wrap { border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: #fff; touch-action: none; }
#canvas { display: block; width: 100%; height: auto; cursor: crosshair; }
.draw-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 4px; }
.pens { display: flex; gap: 5px; }
.pens button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.pens button[aria-checked=true] { box-shadow: 0 0 0 2px var(--ink); }
.size { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 400; }
.size input { width: 90px; }

.colour-step { display: flex; justify-content: space-between; padding: .45rem 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.colour-step strong { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.colour-step strong i { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 14px 0 6px; }
.swatches button { aspect-ratio: 1; border-radius: 12px; border: 0; cursor: pointer; position: relative; }
.swatches button:hover::after, .swatches button:focus-visible::after { content: attr(data-name); position: absolute; left: 50%; bottom: -1.6em; transform: translateX(-50%); white-space: nowrap; font-size: .72rem; color: var(--ink); background: var(--paper); padding: 0 4px; z-index: 2; }

.shape-add { display: flex; gap: 6px; align-items: center; }
.shape-add select { border: 1px solid var(--line); border-radius: var(--radius-s); padding: .55rem; background: var(--paper); }
.shape-add .field { margin: 0; }
.board { width: 100%; height: auto; background: #FFFCF9; border: 1px solid var(--line); border-radius: var(--radius-s); margin-top: 10px; touch-action: none; }
.board g { cursor: grab; }
.board g.sel path, .board g.sel circle, .board g.sel rect { stroke: var(--ink); stroke-width: 3; }

.timer { display: flex; gap: 6px; align-items: center; margin: 10px 0 2px; }
#timer-out { font-variant-numeric: tabular-nums; color: var(--lilac); font-weight: 600; margin-left: 6px; }

.cards { display: grid; gap: 10px; margin-top: 12px; }
.card { text-align: left; border: 1px solid var(--line); border-radius: var(--radius-m); padding: .8rem .95rem; background: var(--paper); cursor: pointer; }
.card:hover { border-color: var(--lilac); }
.card b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.05rem; }
.card span { color: var(--ink-soft); font-size: .9rem; }
.card.pick { background: var(--lilac-wash); border-color: var(--lilac); }

/* Sheets */
dialog.sheet { border: 0; border-radius: var(--radius-m); padding: 20px 22px; width: min(640px, calc(100% - 32px)); max-height: 85vh; color: var(--ink); }
dialog.sheet.small { width: min(440px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(35,26,51,.42); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.journal-list { display: grid; gap: 10px; }
.entry { border: 1px solid var(--line); border-radius: var(--radius-m); padding: .8rem 1rem; }
.entry h3 { font-family: var(--serif); font-weight: 500; margin: 0 0 .2rem; font-size: 1.05rem; }
.entry time { color: var(--ink-soft); font-size: .82rem; }
.entry p { white-space: pre-wrap; margin: .5rem 0; font-size: .95rem; }
.entry .row { margin-top: .3rem; }
.confirm { background: #FBEDEA; padding: .7rem; border-radius: var(--radius-s); font-size: .9rem; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 999px; font-size: .92rem; z-index: 50; }

/* Mobile */
@media (max-width: 860px) {
  .brand span { display: none; }
  .bar { padding: 8px 12px; }
  .bar .btn { padding: .45rem .7rem; font-size: .9rem; }
  .thread { padding: 18px 16px 6px; }
  .composer { padding: 8px 16px 12px; }
  .welcome { padding: 0 16px 12px; }
  .studio { position: fixed; inset: auto 0 0 0; width: auto; max-height: 82vh; border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(35,26,51,.18); z-index: 20; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .swatches { grid-template-columns: repeat(6, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .studio { animation: rise .25s ease-out; }
  @keyframes rise { from { transform: translateY(12px); opacity: 0; } }
}

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: .6rem; }
.plan { text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius-m); padding: 1rem; cursor: pointer; }
.plan:hover { border-color: var(--lake); box-shadow: inset 0 0 0 1px var(--lake); }
.plan b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.7rem; }
.plan span { color: var(--ink-soft); font-size: .88rem; }

/* ---------- v2: navigation, pages, features ---------- */
.muted { color: var(--ink-soft); }
.nav { display: flex; gap: 2px; overflow-x: auto; padding: 0 14px; background: var(--paper); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav button { border: 0; background: none; padding: .7rem .8rem; cursor: pointer; color: var(--ink-soft); white-space: nowrap; font-weight: 500; border-bottom: 2px solid transparent; }
.nav button:hover { color: var(--ink); }
.nav button[aria-current=page] { color: var(--lake-deep); border-bottom-color: var(--lake); }
.view.page { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 20px 48px; }
.view.page > * { max-width: 920px; margin-left: auto; margin-right: auto; }
.page-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { font-size: 1.7rem; margin: 0; }
.page-head .hint { margin: 0; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; margin-bottom: 16px; }
.panel h3 { font-family: var(--serif); font-weight: 500; font-size: 1.15rem; margin: 0 0 .6rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols > .panel { margin-bottom: 0; }
.cols + .panel, .panel + .cols { margin-top: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mode-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 20px; background: var(--lilac-wash); color: #7A5A22; font-weight: 500; font-size: .92rem; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 12px; align-items: end; }
.form-grid label { display: flex; flex-direction: column; font-size: .85rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid select.field, select.field { appearance: auto; }
.field.narrow { width: auto; min-width: 180px; flex: 0 1 auto; }
.code-row { display: flex; gap: 8px; align-items: center; margin-top: .6rem; }
.code-row .field { margin: 0; flex: 1; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; font-size: .9rem; line-height: 1.45; cursor: pointer; }
.check input { margin-top: .22rem; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--lake); }
.check.inline { align-items: center; padding: .6rem 0; }
.check.inline input { margin-top: 0; }
.check.optional { color: var(--ink-soft); }
.check a { color: var(--lake-deep); }
.consent { display: grid; gap: .7rem; margin: 1rem 0; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); }
.roles { border: 0; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.roles legend { font-weight: 600; margin-bottom: .6rem; padding: 0; }
.roles label { position: relative; display: block; cursor: pointer; }
.roles input { position: absolute; opacity: 0; pointer-events: none; }
.roles span { display: block; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius-m); padding: .7rem .85rem; font-weight: 400; font-size: .85rem; color: var(--ink-soft); height: 100%; }
.roles span b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.02rem; color: var(--ink); }
.roles input:checked + span { border-color: var(--lake); box-shadow: inset 0 0 0 1px var(--lake); background: var(--lake-wash); }
.roles input:focus-visible + span { outline: 3px solid var(--lilac); outline-offset: 2px; }

/* Data display */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stats > div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; }
.stats b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.8rem; color: var(--lake-deep); line-height: 1.1; }
.stats span { color: var(--ink-soft); font-size: .85rem; }
.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: .88rem; }
.bar-row i { display: block; height: 10px; width: var(--w); background: linear-gradient(90deg, var(--lake), #8C74AE); border-radius: 999px; }
.bar-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.prog { display: grid; grid-template-columns: minmax(140px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: .9rem; padding: .3rem 0; }
.prog b { font-weight: 600; font-variant-numeric: tabular-nums; font-size: .85rem; }
.meter { height: 10px; background: var(--mist); border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--w); background: var(--lake); border-radius: 999px; }
.table-wrap { overflow-x: auto; margin-top: .6rem; }
table.log { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.log th { text-align: left; font-weight: 600; color: var(--ink-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: .5rem; border-bottom: 1px solid var(--line); }
table.log td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin: .4rem 0; }
.tags span { font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; background: var(--lake-wash); color: var(--lake-deep); }
.kind { display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--lilac); margin-bottom: .2rem; }
.q { font-family: var(--serif); font-style: italic; color: #7A5A22; background: var(--lilac-wash); padding: .5rem .7rem; border-radius: var(--radius-s); }
.notes { display: grid; gap: 6px; margin-top: .5rem; }
.note { border-left: 2px solid var(--lilac); padding: .2rem .7rem; font-size: .9rem; }
.note time { color: var(--ink-soft); font-size: .78rem; margin-left: .3rem; }
.note p { margin: .2rem 0 0; }
.report { font-family: var(--serif); font-size: 1.03rem; line-height: 1.7; margin-top: 1rem; }
.report:empty { display: none; }
.report p { margin: 0 0 .8em; }
.inline-tabs { margin-top: 0; }

/* Wellbeing chart */
.chart { width: 100%; height: auto; display: block; }
.chart path { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .l-energy { stroke: var(--lake); }
.chart .l-stress { stroke: #C77B5B; }
.chart .l-joy { stroke: var(--lilac); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: .85rem; margin-top: 6px; }
.legend span[class^=k-]::before { content: ""; display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: currentColor; }
.legend .k-energy { color: var(--lake); }
.legend .k-stress { color: #C77B5B; }
.legend .k-joy { color: var(--lilac); }
input[type=range] { accent-color: var(--lake); width: 100%; }

/* Legal pages */
body.legal { background: var(--mist); }
.legal-page { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; background: var(--paper); min-height: 100%; }
.legal-page h1 { margin-top: .6rem; }
.legal-page h2 { font-size: 1.2rem; margin-top: 1.8rem; }
.legal-page p, .legal-page li { line-height: 1.65; }
.legal-page table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: .8rem 0; display: block; overflow-x: auto; }
.legal-page th, .legal-page td { border: 1px solid var(--line); padding: .5rem .6rem; text-align: left; vertical-align: top; }
.legal-page th { background: var(--lake-wash); }
.legal-page a { color: var(--lake-deep); }
.back { color: var(--lake-deep); text-decoration: none; font-size: .92rem; }

@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; }
  .view.page { padding: 18px 16px 40px; }
  .nav { padding: 0 8px; }
  .bar-row, .prog { grid-template-columns: 1fr auto; }
  .bar-row span, .prog span { grid-column: 1 / -1; }
  .plans { grid-template-columns: 1fr; }
}
.bar-row em { grid-column: 1 / -1; font-size: .78rem; color: var(--ink-soft); margin-top: -3px; }
.auth-card.wide { max-width: 640px; }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; font-weight: 600; color: var(--lake-deep); }
.client { display: flex; align-items: center; gap: 10px; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.client span:first-child { flex: 1; }
.bar { padding-top: 0; padding-bottom: 0; min-height: 58px; }
.bar .nav { flex: 1; min-width: 0; background: transparent; border: 0; padding: 0; justify-content: center; align-self: stretch; }
.bar .nav button { color: rgba(255,255,255,.68); border-bottom-width: 3px; padding: 0 .75rem; }
.bar .nav button:hover { color: #fff; }
.bar .nav button[aria-current=page] { color: #fff; border-bottom-color: #E7C98E; }
.form-grid .check.inline { flex-direction: row; align-items: center; gap: .5rem; font-size: .9rem; }
@media (max-width: 860px) {
  .bar { flex-wrap: wrap; row-gap: 0; padding: 8px 12px 0; }
  .bar .nav { order: 3; flex-basis: 100%; justify-content: flex-start; margin: 4px -12px 0; padding: 0 6px; }
  .bar .nav button { padding: .6rem .65rem; }
}
.cols { margin-bottom: 16px; } .panel .cols { margin-bottom: 8px; }
.chip.alt { background: var(--lake-wash); border-color: transparent; color: var(--lake-deep); }
.chip.chip-studio { background: var(--lilac-wash); border-color: transparent; color: #7A5A22; }
.composer-row { flex-wrap: wrap; }
.composer-row .btn { white-space: nowrap; }
@media (max-width: 520px) {
  .composer-row { gap: 6px; }
  .composer-row .btn { padding: .45rem .75rem; font-size: .9rem; }
  .welcome h2 { font-size: 1.5rem; }
}


/* ================= Cozy layer: Daniela Aneva brand ================= */
:root { --gold: #A87B2F; --gold-soft: #E7C98E; --plum: #4A3763; --aubergine: #231A33; --lavender: #EFEBF5; --blush: #F4E6E4;
  --shadow-s: 0 1px 2px rgba(35,26,51,.05), 0 4px 14px rgba(35,26,51,.05);
  --shadow-m: 0 2px 4px rgba(35,26,51,.04), 0 14px 36px rgba(35,26,51,.09); }
body { background:
  radial-gradient(900px 520px at 8% -6%, rgba(239,235,245,.95), transparent 62%),
  radial-gradient(760px 520px at 100% 10%, rgba(247,238,221,.85), transparent 60%),
  radial-gradient(700px 600px at 50% 110%, rgba(244,230,228,.75), transparent 65%),
  var(--mist); background-attachment: fixed; }
h1, h2, .lede, .price, .plan b, .card b, .entry h3, .panel h3, .page-head h2, .roles span b, .stats b { font-family: var(--serif); font-weight: 400; letter-spacing: 0; }
h1 { font-size: 2.6rem; line-height: 1.05; }
h2 { font-size: 1.65rem; }
.page-head h2 { font-size: 2.2rem; }
.panel h3 { font-size: 1.4rem; }
.lede { font-size: 1.35rem; line-height: 1.45; color: var(--plum); }
::selection { background: var(--gold-soft); color: var(--aubergine); }
:focus-visible { outline-color: var(--gold); }

/* Buttons: soft, warm, tactile */
.btn { transition: background .2s, border-color .2s, box-shadow .2s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #57427A, var(--plum)); box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 16px rgba(74,55,99,.25); }
.btn.primary:hover { background: linear-gradient(180deg, #4A3763, var(--aubergine)); }
.btn.ghost { border-color: var(--line); background: var(--paper); }
.btn.ghost:hover { border-color: var(--gold); background: #FFF9F0; }
.studio-btn, .btn.studio-btn { background: linear-gradient(180deg, #B98B3C, var(--gold)); color: #fff; box-shadow: 0 6px 16px rgba(168,123,47,.28); }
.studio-btn:hover { background: linear-gradient(180deg, #A87B2F, #8E6826); }
.field, input[type=email], input[type=password], #input, select.field { border-color: var(--line); background: var(--paper); transition: border-color .2s, box-shadow .2s; }
.field:focus, input[type=email]:focus, input[type=password]:focus, #input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(231,201,142,.35); }

/* Header */
.bar { background: linear-gradient(100deg, var(--aubergine) 0%, #33264A 55%, var(--plum) 100%); box-shadow: 0 6px 24px rgba(35,26,51,.18); position: relative; z-index: 5; }
.brand { font-family: var(--serif); font-size: 1.45rem; }
.brand svg { color: var(--gold-soft); }
.bar .nav button[aria-current=page] { border-bottom-color: var(--gold-soft); }
.bar .btn.ghost:hover { background: rgba(255,255,255,.08); }
.auth-mark { color: var(--gold); filter: drop-shadow(0 6px 14px rgba(168,123,47,.25)); }

/* Sign-in, onboarding and plans: a warm card */
.screen.auth { background: none; }
.auth-card { background: rgba(255,252,249,.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(230,221,230,.9); border-radius: 28px; padding: 36px 34px 28px; box-shadow: var(--shadow-m); }
.consent { background: #FFF9F2; border-color: #EEDFC6; }
.check input { accent-color: var(--plum); }
.roles span { border-radius: 16px; transition: border-color .2s, background .2s, transform .15s; }
.roles label:hover span { border-color: var(--gold-soft); transform: translateY(-1px); }
.roles input:checked + span { border-color: var(--plum); box-shadow: inset 0 0 0 1px var(--plum); background: var(--lavender); }
.plan { border-radius: 20px; box-shadow: var(--shadow-s); transition: transform .15s, box-shadow .2s, border-color .2s; }
.plan:hover { border-color: var(--gold); box-shadow: var(--shadow-m); transform: translateY(-2px); }
.plan b { color: var(--plum); font-size: 2.2rem; }

/* Reflection space */
.thread { padding-top: 34px; }
.welcome { text-align: center; padding-bottom: 26px; }
.welcome h2 { font-size: 2.6rem; line-height: 1.1; color: var(--aubergine); }
.welcome h2 em { font-style: italic; color: var(--gold); }
#welcome-hint { color: var(--ink-soft); max-width: 520px; margin: .2rem auto 0; }
.starters { justify-content: center; }
.breath { width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 50% 45%, #FFF6E6 0%, var(--gold-soft) 45%, rgba(231,201,142,0) 72%); }
.breath::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff, #F2DFB8 60%, #E2C084); box-shadow: 0 0 30px rgba(231,201,142,.8); }
.breath-cap { font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin: -6px 0 14px; }
@media (prefers-reduced-motion: no-preference) {
  .breath { animation: breathe 10s ease-in-out infinite; }
  @keyframes breathe { 0%, 100% { transform: scale(.82); opacity: .8; } 45%, 55% { transform: scale(1.08); opacity: 1; } }
  .msg { animation: arrive .35s ease-out; }
  @keyframes arrive { from { opacity: 0; transform: translateY(6px); } }
}
.chip { border-radius: 999px; padding: .6rem 1.05rem; box-shadow: var(--shadow-s); border-color: transparent; background: var(--paper); transition: transform .15s, box-shadow .2s, background .2s; }
.chip:hover { border-color: transparent; transform: translateY(-1px); box-shadow: var(--shadow-m); background: #FFF9F0; }
.chip.alt { background: var(--lavender); color: var(--plum); }
.chip.chip-studio, .chip[data-studio] { background: var(--lilac-wash); color: #7A5A22; }
.msg.user .bubble { background: var(--lavender); border-color: transparent; border-radius: 22px 22px 6px 22px; box-shadow: var(--shadow-s); }
.msg.mate { font-family: var(--sans); font-size: 1.06rem; line-height: 1.75; color: var(--ink); background: var(--paper); border-left: 0; border-radius: 6px 22px 22px 22px; padding: 16px 20px 14px 52px; box-shadow: var(--shadow-s); position: relative; }
.msg.mate::before { content: ""; position: absolute; left: 16px; top: 17px; width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #FFF2D8, var(--gold-soft) 55%, var(--gold)); box-shadow: 0 0 0 4px rgba(231,201,142,.25); }
.msg.mate.thinking { background: transparent; box-shadow: none; color: var(--ink-soft); }
.msg.mate.thinking::before { animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 9px rgba(231,201,142,.15); } }
.msg.mate.flag { border-left: 3px solid var(--danger); }
.composer { background: linear-gradient(rgba(247,241,236,0), rgba(247,241,236,.92) 32%); }
#input { border-radius: 22px; box-shadow: var(--shadow-m); border-color: transparent; padding: 1rem 1.15rem; font-size: 1.02rem; }
.crisis { text-align: center; }
.mode-bar { background: var(--lilac-wash); color: #7A5A22; }

/* Studio */
.studio { background: rgba(255,252,249,.96); border-left-color: var(--line); }
.studio-head h2 { color: var(--gold); font-size: 1.9rem; }
.tabs button[aria-selected=true] { border-bottom-color: var(--gold); }
.card { border-radius: 18px; border-color: transparent; box-shadow: var(--shadow-s); transition: transform .15s, box-shadow .2s; }
.card:hover { border-color: transparent; transform: translateY(-2px); box-shadow: var(--shadow-m); }
.card b { font-size: 1.3rem; color: var(--plum); }
.card.pick { background: var(--lilac-wash); }

/* Pages */
.panel, .stats > div, .entry { background: rgba(255,252,249,.9); border-color: rgba(230,221,230,.8); border-radius: 22px; box-shadow: var(--shadow-s); }
.panel { padding: 22px 24px; }
.stats b { color: var(--plum); font-size: 2.4rem; }
.meter { background: var(--lavender); }
.meter i { background: linear-gradient(90deg, var(--plum), #8C74AE); }
.bar-row i { background: linear-gradient(90deg, var(--plum), #B9A6D3); }
.tags span { background: var(--lavender); color: var(--plum); }
.kind { color: var(--gold); }
.q { color: #6B4E1C; background: var(--lilac-wash); font-size: 1.12rem; }
.note { border-left-color: var(--gold); }
.code { color: var(--plum); }
.chart .l-energy { stroke: var(--plum); }
.chart .l-joy { stroke: var(--gold); }
.legend .k-energy { color: var(--plum); }
.legend .k-joy { color: var(--gold); }
table.log th { color: var(--ink-soft); }
dialog.sheet { border-radius: 26px; background: var(--paper); box-shadow: 0 30px 80px rgba(35,26,51,.3); }
.toast { background: var(--aubergine); box-shadow: var(--shadow-m); }
.legal-page { border-radius: 0 0 28px 28px; box-shadow: var(--shadow-s); }
.legal-page h1 { font-size: 3rem; }
.legal-page h2 { font-size: 1.6rem; color: var(--plum); }
.legal-page th { background: var(--lavender); }
@media (max-width: 860px) {
  h1 { font-size: 2.2rem; }
  .welcome h2 { font-size: 2.1rem; }
  .auth-card { padding: 28px 20px 22px; border-radius: 24px; }
  .msg.mate { padding: 14px 16px 12px 46px; }
  .msg.mate::before { left: 13px; top: 15px; width: 20px; height: 20px; }
}
.roles span b { font-size: 1.22rem; line-height: 1.2; margin-bottom: 2px; }
.breath { width: 112px; height: 112px; }
.breath::after { inset: 27px; }
.msg.mate.flag { border-left: 0; background: #FFF8F6; box-shadow: 0 0 0 1.5px #E7BDB4, var(--shadow-s); }
.screen.app { height: 100vh; height: 100dvh; overflow: hidden; }
@media (max-width: 520px) {
  .breath { width: 84px; height: 84px; margin-bottom: 10px; }
  .breath::after { inset: 20px; }
  .breath-cap { font-size: .7rem; }
  .welcome h2 { font-size: 1.9rem; }
  .starters { gap: 7px; }
  .chip { padding: .5rem .85rem; font-size: .9rem; }
  .composer-row { flex-wrap: nowrap; gap: 5px; }
  .composer-row .spacer { flex: 1 1 0; min-width: 0; }
  .composer-row .btn { padding: .42rem .62rem; font-size: .84rem; }
}
@media (max-width: 860px) { .brand span { display: inline; font-size: 1.3rem; } }

/* People portal (supervisees, mentees, clients) */
.invite-banner { background: var(--lilac-wash); border: 1px solid #EEDFC6; color: #6B4E1C; padding: .75rem 1rem; border-radius: 16px; margin: 0 0 1rem; font-size: .95rem; }
.invite-card { margin-top: 12px; padding: 14px 16px; border-radius: 18px; background: #FFF9F2; border: 1px solid #EEDFC6; }
.invite-card .field { font-family: ui-monospace, Menlo, monospace; font-size: .88rem; }
details.codes { margin-top: 14px; }
details.codes summary { cursor: pointer; font-weight: 500; color: var(--plum); }
.person-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: var(--aubergine); background: radial-gradient(circle at 35% 30%, #FFF4DE, var(--gold-soft) 70%); box-shadow: 0 0 0 4px rgba(231,201,142,.25); flex-shrink: 0; }
.who { display: flex; flex-direction: column; flex: 1; min-width: 180px; }
.who b { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; line-height: 1.15; color: var(--aubergine); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: .75rem; font-weight: 600; padding: .25rem .65rem; border-radius: 999px; background: var(--lavender); color: var(--plum); }
.badge.on { background: #E6F2EA; color: #2F6B45; }
.badge.warn { background: #FBEDEA; color: #9A3F33; }
.stats.mini { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 10px; }
.stats.mini > div { box-shadow: none; background: var(--mist); border-color: transparent; padding: 10px 12px; }
.stats.mini b { font-size: 1.25rem; font-family: var(--sans); font-weight: 600; }
.brief { margin-top: 14px; padding: 18px 20px; border-radius: 18px; background: linear-gradient(180deg, #FFF9F0, #FFFCF9); border: 1px solid #EEDFC6; }
.brief h3 { color: #7A5A22; }
.reports { display: grid; gap: 10px; margin-top: 14px; }
.sup-box { padding: 14px 16px; border-radius: 18px; background: var(--lavender); }
.sup-box h3 { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; margin: 0 0 .2rem; }
.sup-box .hint { margin-bottom: .2rem; }
#link-dlg .lede { font-size: 1.15rem; }
.entry h3 { font-size: 1.4rem; line-height: 1.2; margin-top: .1rem; }
.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; z-index: 100; }
.boot p { font-family: var(--serif); font-size: 1.6rem; color: var(--plum); margin: 0; }

/* Several roles: hats, contacts, routing */
.hats { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; padding: 5px; margin: 6px auto 14px; background: rgba(255,252,249,.85); border-radius: 999px; box-shadow: var(--shadow-s); }
.hats-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); padding: 0 10px 0 12px; }
.hats button { border: 0; background: none; border-radius: 999px; padding: .45rem .9rem; cursor: pointer; color: var(--ink-soft); font-weight: 500; transition: background .2s, color .2s; }
.hats button:hover { color: var(--plum); }
.hats button[aria-checked=true] { background: linear-gradient(180deg, #57427A, var(--plum)); color: #fff; box-shadow: 0 4px 12px rgba(74,55,99,.25); }
.roles input[type=checkbox] + span { position: relative; }
.roles input[type=checkbox]:checked + span::after { content: "✓"; position: absolute; top: 10px; right: 12px; width: 20px; height: 20px; border-radius: 50%; background: var(--plum); color: #fff; font-size: .75rem; display: grid; place-items: center; }
.acc-roles { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; }
.acc-roles legend { font-size: .9rem; font-weight: 500; padding: 0; margin-bottom: 2px; }
.contact { background: var(--paper); border-radius: 14px; padding: 10px 12px; margin: 8px 0; }
.contact-head { display: flex; align-items: center; gap: 10px; }
.contact-head .who b { font-family: var(--sans); font-weight: 600; font-size: .98rem; }
.avatar.sm { width: 32px; height: 32px; font-size: .85rem; box-shadow: none; }
.doms { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin-top: 4px; }
.doms .check.inline, .contact > .check.inline { padding: .25rem 0; font-size: .85rem; }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.contact-form .field { margin: 0; }
.contact-form select, .contact-form button { grid-column: span 1; }
.send-list { display: grid; gap: 6px; margin: 4px 0 12px; }
.send-to { background: var(--lavender); border-radius: 14px; padding: .65rem .8rem; }
.group-title { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; color: var(--plum); margin: 26px 4px 10px; }
#invite-rel { min-width: 170px; }
@media (max-width: 520px) { .contact-form { grid-template-columns: 1fr; } }
.roles legend .hint { display: inline; border: 0; background: none; padding: 0; height: auto; box-shadow: none; font-weight: 400; font-size: .85rem; margin: 0; }

/* Files, transcripts and recording links */
.files { display: flex; flex-direction: column; gap: 6px; margin: .5rem 0; }
.file { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: .5rem .8rem; border-radius: 12px; background: var(--lavender); color: var(--plum); text-decoration: none; font-weight: 500; font-size: .92rem; }
.file:hover { background: #E4DDF0; }
.page-head .btn { align-self: center; }
#case-form textarea.field { resize: vertical; min-height: 70px; }
#case-form input[type=file].field { padding: .5rem; background: var(--paper); }
[dir=rtl] .msg.mate { padding: 16px 52px 14px 20px; }
[dir=rtl] .msg.mate::before { left: auto; right: 16px; }
.report { font-family: var(--sans); font-size: 1rem; line-height: 1.7; } .report h1, .report h2, .report h3 { font-family: var(--serif); font-weight: 400; color: var(--plum); font-size: 1.3rem; margin: 1rem 0 .3rem; }
