:root {
  --paper: #fff4f8;
  --surface: #ffffff;
  --ink: #2e2942;
  --muted: #786e82;
  --line: #f2dfe8;
  --accent: #e75480;
  --accent-deep: #cf3f6e;
  --rose-soft: #fde8f0;
  --gold: #ffd84f;
  --mint: #dff5ff;
  --positive: #21845f;
  --negative: #dc4654;
  --display: 'Bricolage Grotesque', sans-serif;
  --body: 'Be Vietnam Pro', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--body); }
button, input, textarea { font: inherit; }
img { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.shell { width: min(980px, calc(100% - 40px)); margin-inline: auto; }
.app-bar { position: sticky; top: 0; z-index: 20; background: linear-gradient(110deg, #e85d89, #df6f9c); color: var(--surface); box-shadow: 0 5px 18px #bd55782e; }
.app-bar-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #ffffff2b; color: #fff1a8; }
.brand-mark svg { width: 23px; fill: currentColor; }
.brand > span:last-child { display: grid; }
.brand strong { font: 650 .95rem/1.2 var(--display); }
.brand small { color: #fff0f5d6; font: 500 .56rem/1.5 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.admin-link { min-height: 42px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; background: #ffffff1f; color: #fff; font: 600 .62rem/1 var(--mono); text-decoration: none; text-transform: uppercase; transition: background .2s, transform .2s; }
.admin-link:hover { background: #ffffff32; transform: rotate(-2deg); }
.admin-link svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.app-shell { padding-top: 24px; }
.profile { position: relative; overflow: hidden; padding: 20px 26px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 16px 45px #9d557115; }
.profile::after { content: 'SOS'; position: absolute; right: -5px; bottom: 56px; color: #e7548008; font: 750 7rem/1 var(--display); pointer-events: none; }
.profile-topline { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--line); color: var(--muted); font: 500 .62rem/1 var(--mono); text-transform: uppercase; }
.profile-alert { position: absolute; top: 48px; right: 22px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 6px 11px; border: 0; border-radius: 999px; background: #ffe6e8; color: #e11d2e; font: 750 .67rem/1 var(--body); cursor: pointer; box-shadow: none; transition: background .2s, transform .2s; }
.profile-alert:hover { background: #ffd8dd; transform: rotate(-2deg); }
.profile-alert:active { transform: scale(.96); }
.profile-alert svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.signal { display: flex; align-items: center; gap: 7px; color: var(--positive); }
.signal i, .ledger-head span i { width: 7px; height: 7px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 0 4px #24775e17; }
.identity { display: grid; grid-template-columns: 92px 1fr; gap: 20px; align-items: center; padding: 21px 0 17px; }
.portrait { position: relative; height: 98px; background: #ffd5dc; border: 3px solid #ffe9ed; border-radius: 20px; box-shadow: 0 6px 16px #75404f1a; }
.portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }
.portrait small { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%) rotate(-2deg); width: max-content; padding: 5px 9px; border-radius: 999px; background: var(--gold); color: #513c00; font: 700 .49rem/1 var(--mono); letter-spacing: .06em; box-shadow: 0 2px 0 #b99724; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font: 600 .64rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.identity h1 { display: flex; align-items: center; gap: 9px; margin: 0; font: 650 clamp(2rem, 4.4vw, 3.25rem)/1 var(--display); letter-spacing: -.05em; }
.identity h1 b { width: 25px; height: 25px; display: grid; place-items: center; color: var(--accent); }
.identity h1 b svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.dossier-code { margin: 8px 0 10px; color: var(--muted); font-size: .76rem; }
.dossier-code strong { padding: 3px 7px; border-radius: 6px; background: var(--paper); color: var(--ink); font-family: var(--mono); }
.status-line { display: flex; flex-wrap: wrap; gap: 7px; }
.status-line span { padding: 5px 8px; border-radius: 7px; background: #f4f6ff; color: #44527a; font: 500 .62rem/1.3 var(--mono); }
.status-line #status { background: var(--rose-soft); color: var(--accent-deep); }
.profile-statement { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-block: 1px solid var(--line); }
.profile-statement p { margin: 0; padding: 20px 22px 20px 0; font-size: .88rem; }
.profile-statement p + p { padding-left: 22px; border-left: 1px solid var(--line); }
.goal { padding: 25px 0 22px; }
.goal-title { display: flex; justify-content: space-between; gap: 25px; align-items: baseline; }
.goal-title span { color: var(--muted); font: 600 .63rem/1 var(--mono); text-transform: uppercase; }
.goal-title strong { font: 650 1.05rem/1.3 var(--display); text-align: right; }
.mood-score { display: flex; align-items: baseline; gap: 8px; margin-top: 20px; }
.mood-score strong { color: var(--accent-deep); font: 700 clamp(2.5rem, 6vw, 4rem)/1 var(--display); letter-spacing: -.05em; }
.mood-score span { color: var(--muted); font: .68rem/1 var(--mono); text-transform: uppercase; }
.progress { height: 14px; overflow: hidden; margin-top: 14px; border-radius: 999px; background: #f1e6eb; }
.progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f17ba0, #de4d83); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.progress i.mood-pop { animation: mood-glow .8s ease-out; }
.progress-note { margin: 9px 0 0; color: var(--muted); font-size: .72rem; font-style: italic; text-align: center; }
.profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-inline: -26px; padding: 15px 26px; background: #fff8fb; border-top: 1px solid var(--line); }
.primary-action, .secondary-action { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 10px 20px; border: 0; border-radius: 13px; font-weight: 700; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.primary-action { background: linear-gradient(110deg, var(--accent), var(--accent-deep)); color: #fff; box-shadow: 0 8px 18px #d9497938; }
.secondary-action { border: 1px solid #e8b5c7; background: #fff; color: var(--accent-deep); }
.primary-action:hover, .secondary-action:hover { transform: translateY(-2px) rotate(-.4deg); box-shadow: 0 11px 24px #d949792b; }
.secondary-action:hover { background: #fff0f5; }
.primary-action:active, .secondary-action:active { transform: scale(.97); }
.primary-action svg, .secondary-action svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.intro-strip { display: grid; grid-template-columns: 115px 1fr; gap: 22px; align-items: start; margin: 20px 0 0; padding: 15px 20px; border: 1px solid #e5c74d; border-radius: 16px; background: #fff3b4; box-shadow: 4px 5px 0 #d9bb3a2e; }
.intro-strip span { font: 700 .64rem/1.4 var(--mono); }
.intro-strip p { margin: 0; font-size: .83rem; }
.tabs { position: sticky; top: 68px; z-index: 10; display: grid; grid-template-columns: 1fr 1fr; margin-top: 30px; background: var(--paper); border-bottom: 1px solid var(--ink); }
.tab { min-height: 55px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 650; cursor: pointer; }
.tab.active { border-color: var(--accent); color: var(--ink); }
.tab-panel { padding-block: 48px 70px; }
.panel-heading { display: grid; grid-template-columns: 1.55fr 1fr; gap: 55px; align-items: end; margin-bottom: 32px; }
.panel-heading h2, .terms h2, .closing h2 { margin: 0; font: 650 clamp(2.6rem, 5.5vw, 4.7rem)/.9 var(--display); letter-spacing: -.06em; }
.panel-heading > p { margin: 0; color: var(--muted); }
.heading-note { padding: 16px 18px; border-left: 3px solid var(--accent); border-radius: 0 14px 14px 0; background: #fff; }
.heading-note strong { font: 650 1rem/1.2 var(--display); }
.heading-note p { margin: 6px 0 0; color: var(--muted); font-size: .75rem; }
.support-list, .transaction-list { list-style: none; margin: 0; padding: 0; }
.support-list { display: grid; gap: 13px; }
.support-list li { display: grid; grid-template-columns: 52px 1fr auto 28px; gap: 17px; align-items: center; padding: 17px; border: 2px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 5px 14px #a6637b0d; cursor: pointer; transition: border-color .2s, transform .2s, box-shadow .2s; }
.support-list li:hover { border-color: #edb5c8; transform: translateY(-2px); box-shadow: 0 10px 24px #a6637b17; }
.support-list .item-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--rose-soft); color: var(--accent-deep); transition: transform .2s; }
.support-list .item-icon svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.support-list li:hover .item-icon { transform: rotate(-7deg) scale(1.08); }
.support-list h3 { margin: 0 0 4px; font: 650 1.1rem/1.2 var(--display); }
.support-list p { margin: 0; color: var(--muted); font-size: .76rem; }
.support-list strong { padding: 4px 8px; border-radius: 8px; background: #fff0f5; color: var(--accent-deep); font: 600 .76rem/1 var(--mono); white-space: nowrap; }
.support-list .arrow { color: var(--accent); font-size: 1.3rem; }
.transaction-list { border-top: 1px solid var(--ink); }
.ledger-head { display: flex; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.ledger-head span { display: flex; align-items: center; gap: 8px; color: var(--positive); font: .6rem/1 var(--mono); text-transform: uppercase; }
.transaction-list { border-top: 0; }
.transaction-list li { display: grid; grid-template-columns: 42px 1fr auto; gap: 16px; align-items: center; padding: 19px 0; border-bottom: 1px solid var(--line); }
.trans-symbol { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; font: 700 1rem/1 var(--mono); }
.trans-symbol.in { background: #d8ece3; color: var(--positive); }
.trans-symbol.out { background: #f4ddd7; color: var(--negative); }
.trans-symbol.neutral { background: #e5e1d7; color: var(--muted); }
.transaction-list h3 { margin: 0 0 3px; font-size: .86rem; }
.transaction-list p { margin: 0; color: var(--muted); font-size: .68rem; }
.transaction-list strong { font: 600 .78rem/1 var(--mono); }
.transaction-list strong.in { color: var(--positive); }
.transaction-list strong.out { color: var(--negative); }
.terms { display: grid; grid-template-columns: .85fr 1.7fr; gap: 65px; padding-block: 70px; border-top: 1px solid var(--ink); }
.terms-note { max-width: 220px; margin: 18px 0 0; color: var(--muted); font-size: .75rem; }
.terms-list { margin: 0; padding: 0; list-style: none; counter-reset: term; border-top: 1px solid var(--ink); }
.terms-list li { counter-increment: term; display: grid; grid-template-columns: 54px 1fr; gap: 12px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.terms-list li::before { content: 'Mood ' counter(term); color: var(--accent-deep); font: 600 .58rem/1.7 var(--mono); }
.terms-list p { margin: 0; font-size: .83rem; }
.closing { padding-block: 70px 60px; border-top: 1px solid var(--ink); text-align: center; }
.closing > p:not(.eyebrow) { max-width: 640px; margin: 24px auto 48px; }
.closing > div { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; font: 500 .6rem/1 var(--mono); }
.closing > div i { height: 1px; background: var(--line); }
.footer { display: flex; justify-content: space-between; gap: 25px; align-items: center; padding-block: 22px; border-top: 1px solid var(--line); color: var(--muted); font: .58rem/1.5 var(--mono); text-transform: uppercase; }
.footer p { max-width: 640px; margin: 0; }
.footer a { color: var(--accent-deep); font-weight: 600; text-decoration: none; white-space: nowrap; }
.footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
dialog { width: min(400px, calc(100% - 28px)); padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 70px #4b25364f; text-align: center; }
dialog::backdrop { background: #3c2433a3; backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: 9px; right: 12px; width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.5rem; cursor: pointer; }
.dialog-symbol { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 22px; border-radius: 50%; background: var(--rose-soft); color: var(--accent-deep); font-weight: 700; }
dialog h2 { margin: 0 0 10px; font: 650 1.8rem/1.1 var(--display); }
dialog > p:not(.eyebrow) { color: var(--muted); }
dialog > strong { display: block; margin: 22px 0; color: var(--accent-deep); font: 650 1.7rem/1 var(--display); }
dialog .primary-action { width: 100%; }
dialog small { display: block; margin-top: 13px; color: var(--muted); }
.qr-dialog { width: min(420px, calc(100% - 28px)); }
.qr-dialog h2 { margin-bottom: 20px; }
.qr-frame { width: min(260px, 100%); aspect-ratio: 1; display: grid; place-items: center; margin: 0 auto 18px; padding: 12px; border: 1px solid #efc6d4; border-radius: 24px; background: linear-gradient(145deg, #fff, #fff0f5); box-shadow: 0 12px 30px #b85f7c1c; }
.qr-frame img { width: 100%; height: 100%; border-radius: 14px; }
.qr-dialog > p:not(.eyebrow) { margin-bottom: 14px; }
.qr-preview { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 1px solid #e7b5c7; border-radius: 999px; background: var(--rose-soft); color: var(--accent-deep); font: 650 .72rem/1 var(--body); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.qr-preview:hover { transform: translateY(-2px); box-shadow: 0 8px 18px #b85f7c20; }
.toast { position: fixed; left: 50%; top: 86px; z-index: 50; transform: translateX(-50%); max-width: calc(100% - 28px); padding: 11px 17px; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: 0 10px 30px #261a2440; font-size: .76rem; text-align: center; }
@keyframes mood-glow { 50% { filter: saturate(1.35) brightness(1.12); box-shadow: 0 0 20px #e75480a6; } }
@keyframes emergency-flash { 0%, 100% { opacity: 0; } 25%, 75% { opacity: .28; } 50% { opacity: .08; } }
body.sos-flash::before { content: ''; position: fixed; inset: 0; z-index: 40; pointer-events: none; background: #ff0011; animation: emergency-flash .75s ease-out 2; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 980px); }
  .app-bar-inner { min-height: 58px; }
  .brand strong { font-size: .82rem; }
  .brand small { display: none; }
  .admin-link { font-size: .58rem; }
  .app-shell { padding-top: 14px; }
  .profile { padding: 16px 16px 0; border-radius: 20px; box-shadow: none; }
  .profile::after { display: none; }
  .profile-alert { top: 47px; right: 14px; font-size: .59rem; }
  .profile-topline > span:last-child { display: none; }
  .identity { grid-template-columns: 78px 1fr; gap: 13px; padding: 24px 0 16px; }
  .portrait { height: 84px; border-radius: 17px; }
  .portrait img { border-radius: 13px; }
  .portrait small { font-size: .43rem; }
  .identity .eyebrow { padding-right: 100px; }
  .identity h1 { font-size: 1.58rem; }
  .identity h1 b, .identity h1 b svg { width: 21px; height: 21px; }
  .status-line { display: grid; gap: 5px; }
  .status-line span { width: fit-content; font-size: .51rem; }
  .goal { padding-block: 18px; }
  .goal-title { display: block; }
  .goal-title strong { display: block; margin-top: 5px; text-align: left; }
  .profile-actions { grid-template-columns: 1fr 1fr; margin-inline: -16px; padding-inline: 16px; }
  .profile-actions .primary-action, .profile-actions .secondary-action { width: 100%; padding-inline: 10px; font-size: .77rem; }
  .intro-strip { grid-template-columns: 1fr; gap: 5px; }
  .tabs { top: 58px; margin-top: 28px; }
  .tab { font-size: .77rem; }
  .tab-panel { padding-block: 44px 65px; }
  .panel-heading { display: block; margin-bottom: 26px; }
  .panel-heading h2 { margin: 8px 0 15px; font-size: 2.55rem; }
  .panel-heading > p { font-size: .82rem; }
  .heading-note { margin-top: 20px; }
  .support-list li { grid-template-columns: 42px 1fr auto; gap: 12px; }
  .support-list .arrow { display: none; }
  .support-list strong { grid-column: 2; justify-self: start; }
  .terms { grid-template-columns: 1fr; gap: 38px; padding-block: 65px; }
  .terms h2 { font-size: 3.1rem; }
  .closing { padding-block: 65px 55px; }
  .closing h2 { font-size: 3.1rem; }
  .footer { align-items: flex-start; }
  .footer p { max-width: 65%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } body.sos-flash::before { opacity: .18; } }
