:root {
  --ink: #26352f;
  --muted: #718078;
  --paper: #fbfbf7;
  --cream: #f6f4eb;
  --sage: #8eaa98;
  --sage-dark: #607f6b;
  --sage-soft: #e8f0e9;
  --peach: #f5d8c6;
  --peach-soft: #fff1e8;
  --lavender: #dcd8ed;
  --yellow: #f4e9b8;
  --rose: #e8b9b3;
  --white: #fff;
  --line: #e7e8e1;
  --shadow: 0 12px 36px rgba(60, 80, 67, .08);
  --radius: 22px;
  --sidebar: 248px;
  --chart-aura: #c95f7e;
  --chart-trend: #7c8580;
  --chart-value: #36463f;
  --weekend-sunday: #bd4f58;
  --weekend-saturday: #3f6fa5;
  --coachmark-surface: rgba(30, 51, 40, .84);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.65; word-break: keep-all; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(104, 141, 118, .28); outline-offset: 2px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 20; padding: 28px 20px 22px; display: flex; flex-direction: column; background: #f1f1e9; border-right: 1px solid rgba(52, 70, 60, .07); }
.brand, .mobile-brand { border: 0; background: transparent; display: flex; align-items: center; gap: 12px; text-align: left; padding: 0; }
.brand-mark { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 14px 14px 14px 5px; color: #fff; font-family: Georgia, serif; font-size: 21px; background: var(--sage-dark); box-shadow: 0 7px 18px rgba(65, 101, 77, .18); }
.brand strong { display: block; font-family: Georgia, "Noto Serif KR", serif; font-size: 15px; line-height: 1.1; letter-spacing: -.2px; }
.brand small { display: block; color: var(--sage-dark); font-size: 13px; margin-top: 4px; }
.side-nav { display: grid; gap: 7px; margin-top: 50px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 13px; padding: 12px 14px; border: 0; border-radius: 13px; background: transparent; color: #66746c; font-weight: 650; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.6); }
.nav-item.active { color: var(--sage-dark); background: #fff; box-shadow: 0 6px 20px rgba(65, 88, 73, .07); }
.nav-icon { width: 25px; display: grid; place-items: center; line-height: 1; }
.nav-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-card { width: 100%; margin-top: auto; border: 0; background: transparent; display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 3px; }
.avatar { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 50%; background: var(--peach); color: #805f51; font-weight: 800; }
.reply-persona-avatar { overflow: hidden; }
.reply-persona-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.profile-card strong, .profile-card small { display: block; }
.profile-card strong { font-size: 13px; }
.profile-card small { color: #88908a; font-size: 11px; }
.profile-card .more { margin-left: auto; color: #96a098; letter-spacing: 2px; }
.profile-menu { position: fixed; z-index: 90; left: 18px; bottom: 78px; width: 212px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 16px 45px rgba(38,53,47,.18); }
.profile-menu button { width: 100%; padding: 10px 12px; border: 0; border-radius: 9px; color: #44554c; background: transparent; font-size: 13px; font-weight: 700; text-align: left; }
.profile-menu button:hover { color: var(--sage-dark); background: var(--sage-soft); }
.profile-menu #logoutButton { color: #a66561; }
.profile-menu #logoutButton:hover { background: var(--peach-soft); }

#profileModal[data-section="account"] .profile-agent-section { display: none; }
#profileModal[data-section="agents"] .profile-account-section,
#profileModal[data-section="agents"] #passwordForm { display: none; }
#profileModal[data-section="agents"] #profileForm { margin-top: 22px; }

.main-content { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { height: 78px; padding: 0 clamp(28px, 5vw, 74px); display: flex; justify-content: flex-end; align-items: center; position: sticky; top: 0; z-index: 15; background: rgba(251,251,247,.9); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(54, 76, 62, .05); }
.top-actions { display: flex; align-items: center; gap: 18px; }
.weather { display: flex; align-items: center; gap: 10px; padding-right: 18px; border-right: 1px solid var(--line); }
.weather-icon { font-size: 25px; color: #d7aa55; }
.weather strong, .weather small { display: block; line-height: 1.35; }
.weather strong { font-size: 13px; }
.weather small { color: var(--muted); font-size: 10px; }
.weather-unavailable-copy { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.weather-unavailable-copy strong { color: var(--muted); font-weight: 600; }
.weather-location-action { padding: 0; border: 0; color: #008f40; background: transparent; font: inherit; font-size: 12px; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.weather-location-action:hover, .weather-location-action:focus-visible { color: #006f32; outline: 2px solid rgba(0,143,64,.2); outline-offset: 2px; }
.icon-button, .mobile-avatar { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; position: relative; }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button i { position: absolute; right: 6px; top: 4px; width: 6px; height: 6px; border: 2px solid #fff; border-radius: 50%; background: var(--rose); }
.mobile-brand, .mobile-avatar { display: none; }
.page { display: none; max-width: 1240px; margin: 0 auto; padding: 52px clamp(28px, 5vw, 74px) 90px; animation: pageIn .35s ease both; }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(5px); } }

.home-heading { display: flex; align-items: center; justify-content: space-between; min-height: 235px; }
.eyebrow { margin: 0 0 9px; color: var(--sage-dark) !important; font-size: 12px !important; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.home-heading h1, .page-heading h1 { margin: 0; font-family: Georgia, "Noto Serif KR", serif; font-size: clamp(34px, 4vw, 50px); line-height: 1.35; letter-spacing: -2px; font-weight: 600; }
.home-heading h1 em { color: var(--sage-dark); font-style: normal; }
.home-heading p, .page-heading p { color: var(--muted); font-size: 15px; margin: 17px 0 0; }
.mind-orbit { position: relative; width: 200px; height: 190px; margin-right: 25px; display: grid; place-items: center; }
.orbit { position: absolute; border: 1px solid #d9e2d9; border-radius: 50%; }
.orbit-one { width: 178px; height: 126px; transform: rotate(-18deg); }
.orbit-two { width: 160px; height: 145px; transform: rotate(24deg); border-color: #eee3d2; }
.orbit-core { width: 98px; height: 98px; display: grid; place-items: center; text-align: center; line-height: 1.35; border-radius: 50%; background: #eaf0e9; color: var(--sage-dark); font-family: Georgia, "Noto Serif KR", serif; font-size: 14px; box-shadow: inset 0 0 0 8px rgba(255,255,255,.3); }
.mind-orbit i { position: absolute; top: 23px; right: 22px; color: #d8b681; font-style: normal; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.home-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.quick-write { border: 0; padding: 25px 27px; display: flex; justify-content: space-between; align-items: center; color: #fff; text-align: left; background: var(--sage-dark); }
.quick-write:hover .round-arrow { transform: translateX(4px); }
.quick-copy { display: flex; align-items: center; gap: 18px; }
.soft-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; font-size: 23px; background: rgba(255,255,255,.14); }
.quick-write h2 { margin: 0 0 4px; font-family: Georgia, "Noto Serif KR", serif; font-size: 19px; }
.quick-write p { margin: 0; color: rgba(255,255,255,.72); font-size: 12px; }
.round-arrow { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--sage-dark); transition: .2s ease; }
.streak-card { padding: 22px 24px; box-shadow: none; }
.card-title-row { display: flex; justify-content: space-between; align-items: flex-start; }
.mini-label { color: var(--sage-dark); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.streak-card h3 { margin: 3px 0 12px; font-size: 15px; }
.streak-card h3 b { color: var(--sage-dark); font-size: 23px; }
.leaf { color: #91aa99; font-size: 25px; }
.week-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day-dot { text-align: center; color: #8d968f; font-size: 9px; }
.day-dot i { width: 25px; height: 25px; margin: 4px auto 0; display: grid; place-items: center; border-radius: 50%; background: #f0f1eb; font-size: 10px; font-style: normal; }
.day-dot.done i { color: #fff; background: var(--sage); }
.day-dot.today i { box-shadow: 0 0 0 3px #dfe9e1; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 47px 0 19px; }
.section-heading h2 { margin: 0; font-family: Georgia, "Noto Serif KR", serif; font-size: 23px; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.section-heading button { border: 0; background: transparent; color: var(--sage-dark); font-weight: 700; font-size: 12px; }
.recent-list { display: grid; gap: 10px; }
.diary-row { display: grid; grid-template-columns: 58px 1fr auto auto; gap: 17px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; transition: .2s ease; }
.diary-row:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.date-box { text-align: center; border-right: 1px solid var(--line); }
.date-box strong, .date-box small { display: block; }
.date-box strong { font-family: Georgia, serif; font-size: 20px; }
.date-box small { color: var(--muted); font-size: 9px; }
.diary-copy h3 { margin: 0; font-size: 14px; }
.diary-copy p { margin: 3px 0 0; max-width: 480px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emotion-chips { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.emotion-chip { padding: 4px 9px; border-radius: 99px; font-size: 9px; font-weight: 400; background: var(--sage-soft); color: var(--sage-dark); }
.emotion-chip.negative { background: var(--peach-soft); color: #a86c62; }
.row-more { color: #a3aaa5; }
.care-banner { margin-top: 35px; min-height: 165px; padding: 27px 36px; display: grid; grid-template-columns: 145px 1fr auto; align-items: center; gap: 28px; border-radius: 25px; overflow: hidden; background: #f2eee6; }
.care-illustration { position: relative; height: 110px; display: grid; place-items: center; border-radius: 50%; background: #e5ebe3; }
.care-illustration span { color: #fff; font-size: 65px; line-height: 1; }
.care-illustration b { position: absolute; font-size: 24px; }
.care-illustration i { position: absolute; right: 13px; top: 12px; color: #d3aa70; font-style: normal; }
.care-banner blockquote { margin: 5px 0 0; font-family: Georgia, "Noto Serif KR", serif; font-size: 17px; line-height: 1.8; }
.care-banner button { padding: 10px 16px; border: 1px solid #d3d9d1; border-radius: 99px; background: rgba(255,255,255,.5); color: var(--sage-dark); font-size: 11px; font-weight: 700; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 34px; }
.page-heading h1 { font-size: clamp(30px, 3.4vw, 43px); }
.date-pill { display: flex; align-items: center; gap: 7px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 99px; background: #fff; }
.date-pill input { border: 0; background: transparent; color: var(--ink); font-weight: 700; font-size: 12px; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; }
.editor-card { padding: 27px; }
.editor-datetime { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -3px 0 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); color: var(--sage-dark); }
.editor-datetime > span { font-size: 17px; }
.editor-datetime time { font-family: Georgia, "Noto Serif KR", serif; font-size: 14px; font-weight: 700; letter-spacing: -.1px; }
.editor-datetime input { display: none; }
.editor-meta { display: flex; justify-content: space-between; align-items: center; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.editor-weather { display: flex; align-items: center; gap: 16px; min-width: 0; }
.weather-compact { display: flex; align-items: center; gap: 9px; }
.weather-compact > span:first-child { font-size: 25px; }
.weather-compact small, .weather-compact strong { display: block; line-height: 1.35; }
.weather-compact small { color: var(--muted); font-size: 9px; }
.weather-compact strong { font-size: 11px; }
.editor-weather-copy { display: block; min-width: 0; }
.editor-weather-button { display: block; max-width: 230px; padding: 0; border: 0; color: var(--ink); background: transparent; text-align: left; }
.editor-weather-button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-weather-button:not(:disabled):hover strong { color: #008f40; text-decoration: underline; text-underline-offset: 3px; }
.editor-weather-button.location-action strong { color: #008f40; text-decoration: underline; text-underline-offset: 3px; white-space: normal; }
.editor-weather-button:disabled { cursor: default; }
.inline-weather-input { width: 180px; padding: 2px 0 4px; border: 0; border-bottom: 2px solid #03b854; border-radius: 0; color: var(--ink); background: transparent; font-size: 14px; font-weight: 750; outline: 0; }
.inline-weather-input:focus { box-shadow: 0 2px 0 rgba(3,184,84,.12); }
.title-wrap { position: relative; margin-top: 22px; }
.title-wrap label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.title-wrap input { width: 100%; padding: 5px 120px 10px 0; border: 0; border-bottom: 1px solid var(--line); font-family: Georgia, "Noto Serif KR", serif; font-size: 21px; color: var(--ink); background: transparent; }
.title-wrap input::placeholder { color: #b8beb9; }
.title-wrap button { position: absolute; right: 0; bottom: 9px; border: 0; color: var(--sage-dark); background: var(--sage-soft); border-radius: 99px; padding: 5px 10px; font-size: 9px; font-weight: 700; }
#diaryContent { width: 100%; min-height: 330px; resize: vertical; padding: 25px 2px; border: 0; background: repeating-linear-gradient(to bottom, transparent 0, transparent 34px, #f0f0ea 35px); color: #3e4943; line-height: 35px; font-family: Georgia, "Noto Serif KR", serif; font-size: 16px; }
#diaryContent::placeholder { color: #adb5af; }
.editing-entry #diaryContent { min-height: 120px; resize: none; }
.editor-footer { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.save-status { color: var(--sage-dark); }
.editor-actions { display: flex; align-items: center; gap: 9px; margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); }
.editor-save-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.saved-analysis { margin: 28px -27px -27px; padding: 25px 27px 28px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: #fafaf6; }
.saved-analysis-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.saved-analysis-head > span.sample { color: #6f668e; background: #efedf8; }
.saved-analysis-head .eyebrow { margin-bottom: 2px; }
.saved-analysis-head h2 { margin: 0; font-family: Georgia, "Noto Serif KR", serif; font-size: 18px; }
.saved-analysis-head > span { padding: 5px 9px; border-radius: 99px; color: var(--sage-dark); background: var(--sage-soft); font-size: 10px; font-weight: 700; }
.saved-analysis-head > span.fallback { color: #8a685e; background: var(--peach-soft); }
.saved-emotion-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; }
.saved-emotion-tags .emotion-chip { padding: 4px 11px; font-size: 10px; }
.saved-analysis-summary { margin: 0 0 20px; padding: 14px 16px; border-left: 3px solid var(--sage); border-radius: 4px 12px 12px 4px; color: #53635a; background: #f1f5f0; font-size: 13px; line-height: 1.8; }
.saved-analysis-summary > p { margin: 0; }
.saved-agent-replies { display: grid; gap: 9px; }
.saved-reply { position: relative; padding: 15px 16px 15px 55px; border: 1px solid var(--line); border-radius: 16px 16px 16px 5px; background: #fff; }
.saved-reply > .avatar { position: absolute; left: 13px; top: 14px; width: 31px; height: 31px; flex-basis: 31px; font-size: 9px; }
.saved-reply-head { display: flex; align-items: center; gap: 7px; }
.saved-reply-head strong { flex: 1; font-size: 11px; }
.saved-reply-head small { color: var(--muted); font-size: 8px; }
.saved-reply-head button { width: 29px; height: 29px; border: 0; border-radius: 50%; color: var(--muted); background: #f1f2ed; }
.saved-reply-head button.liked { color: #b56360; background: #f9e7e4; }
.saved-reply p { margin: 7px 0 0; color: #626f67; font-size: 11px; line-height: 1.8; }
.ghost-button, .primary-button { border-radius: 12px; padding: 10px 16px; font-size: 12px; font-weight: 750; }
.ghost-button { border: 1px solid var(--line); background: #fff; }
.ghost-button.danger { color: #b06562; }
.primary-button { border: 1px solid var(--sage-dark); color: #fff; background: var(--sage-dark); }
.primary-button:hover { background: #516e5d; }
.primary-button:disabled { cursor: wait; opacity: .68; }
.primary-button.full { width: 100%; }
.writing-aside { display: grid; gap: 14px; }
.prompt-card, .agent-preview { border-radius: 20px; padding: 20px; }
.prompt-card { display: flex; gap: 12px; background: #f1eee6; }
.prompt-card > span { color: #c9a26b; }
.prompt-card small, .agent-preview small { color: var(--muted); font-size: 9px; }
.prompt-card h3 { margin: 6px 0 12px; font-family: Georgia, "Noto Serif KR", serif; font-size: 14px; line-height: 1.7; }
.prompt-card button { border: 0; padding: 0; color: var(--sage-dark); background: transparent; font-size: 10px; font-weight: 700; }
.agent-preview { border: 1px solid var(--line); background: #fff; }
.agent-preview h3 { margin: 0; font-size: 17px; }
.agent-stack { display: grid; gap: 8px; margin: 14px 0; }
.agent-mini { display: flex; align-items: center; gap: 9px; padding: 7px; border-radius: 12px; background: #f8f8f4; }
.agent-mini .avatar { width: 31px; height: 31px; flex-basis: 31px; font-size: 10px; }
.agent-mini strong, .agent-mini small { display: block; line-height: 1.45; }
.agent-mini strong { font-size: 11px; }
.agent-mini small { font-size: 8px; }
.agent-preview > p { margin: 0; color: var(--muted); font-size: 9px; }
.archive-head, .stats-head { align-items: center; }
.archive-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; margin-bottom: 15px; box-shadow: none; }
.month-control, .view-toggle, .period-toggle { display: flex; align-items: center; gap: 5px; }
.month-control button { width: 30px; height: 30px; border: 0; background: transparent; font-size: 20px; }
.month-control strong { min-width: 120px; text-align: center; }
.view-toggle, .period-toggle { padding: 4px; border-radius: 10px; background: #f0f1ec; }
.view-toggle button, .period-toggle button { padding: 7px 12px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; }
.view-toggle button.active, .period-toggle button.active { background: #fff; color: var(--sage-dark); box-shadow: 0 2px 7px rgba(50,60,55,.08); }
.chart-range-toggle button { min-width: 58px; min-height: 44px; padding: 9px 13px; font-size: 12px; }
.calendar-card { padding: 20px; box-shadow: none; }
.calendar-week, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-week span { padding: 8px; text-align: center; color: var(--muted); font-size: 10px; }
.calendar-week span:first-child { color: var(--weekend-sunday); }
.calendar-week span:last-child { color: var(--weekend-saturday); }
.calendar-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-day { min-height: 105px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.calendar-day.outside { background: #fafaf7; color: #b9beba; }
.calendar-day.today .day-number { width: 25px; height: 25px; display: grid; place-items: center; margin: -3px 0 2px -4px; color: #fff; border-radius: 50%; background: var(--sage-dark); }
.day-number { font-size: 10px; }
.calendar-entry { display: block; width: 100%; margin-top: 4px; padding: 5px 6px; overflow: hidden; border: 0; border-radius: 7px; background: var(--sage-soft); color: var(--sage-dark); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.calendar-entry.negative { background: var(--peach-soft); color: #a36761; }
.archive-list { display: grid; gap: 10px; }

.stat-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.summary-card { position: relative; overflow: hidden; min-height: 135px; padding: 19px; border-radius: 18px; }
.summary-card.positive { background: #e9f0e9; }
.summary-card.negative { background: #f8e8e0; }
.summary-card.top-emotion { background: #f1f3f2; }
.summary-card span { color: var(--muted); font-size: 9px; font-weight: 750; }
.summary-card strong { display: block; margin: 2px 0; font-family: Georgia, "Noto Serif KR", serif; font-size: 29px; }
.summary-card strong small { font-size: 13px; }
.summary-card p { margin: 0; color: var(--muted); font-size: 9px; }
.aura-current #auraTotalChange { font-size: 11px; font-weight: 750; }
.summary-card p b { color: var(--sage-dark); }
.summary-card > i { position: absolute; right: 18px; bottom: 15px; color: rgba(80,100,87,.28); font-size: 31px; font-style: normal; }
.chart-card { margin-top: 15px; padding: 24px; box-shadow: none; }
.chart-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 28px; align-items: end; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.chart-title { min-width: 0; max-width: 610px; }
.chart-head h2 { margin: 0; font-size: 18px; }
.chart-head p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.chart-title .chart-range-summary { margin-top: 10px; color: var(--sage-dark); font-size: 12px; font-weight: 800; }
.chart-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 11px; }
.chart-control-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; padding: 7px 10px; border-radius: 10px; color: var(--muted); background: #f7f8f4; font-size: 9px; }
.legend span { display: flex; align-items: center; gap: 4px; }
.legend b { font: inherit; }
.legend i { width: 9px; height: 4px; display: inline-block; border-radius: 9px; }
.dot-positive { background: #789b83; }
.dot-negative { background: #d59a91; }
.line-short { height: 2px !important; background: #c59b4f; }
.line-long { height: 2px !important; background: #8d86b1; }
.chart-wrap { height: 265px; margin-top: 14px; }
.chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.chart-empty-state { min-height: 100%; display: grid; place-content: center; gap: 7px; padding: 30px; border-radius: 14px; color: var(--muted); background: #f7f8f4; text-align: center; }
.chart-empty-state strong { color: var(--ink); font-size: 15px; }
.chart-empty-state p { max-width: 420px; margin: 0; font-size: 12px; line-height: 1.65; }
.chart-text-summary { margin: 18px 0 0; padding: 16px 18px; border: 1px solid #dfe5e1; border-radius: 2px; color: #53635a; background: #f7f9f8; font-size: 12px; line-height: 1.75; }
.chart-text-summary:empty { display: none; }
.chart-text-summary strong, .chart-text-summary span { display: block; }
.chart-text-summary strong { margin-bottom: 5px; color: #26352f; font-size: 1.08em; }
.chart-analysis-keyword {
  display: inline;
  margin: 0 .04em;
  padding: 0 .08em;
  color: #315945;
  background: linear-gradient(transparent 58%, #dcebe2 58%);
  font-weight: 800;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.chart-analysis-keyword-positive { color: #187443; background-image: linear-gradient(transparent 58%, #d8efe1 58%); }
.chart-analysis-keyword-negative { color: #376a98; background-image: linear-gradient(transparent 58%, #dce9f6 58%); }
.chart-analysis-keyword-warning { color: #98600b; background-image: linear-gradient(transparent 58%, #f8e7bd 58%); }
.chart-analysis-keyword-risk { color: #a33e46; background-image: linear-gradient(transparent 58%, #f5dadd 58%); }
.chart-hit-point:focus { outline: none; fill: rgba(201,95,126,.14); stroke: var(--chart-aura); stroke-width: 3; }
.chart-signal { pointer-events: none; --signal-color: #8a6508; --signal-bg: #fff8d8; }
.chart-signal-caution { --signal-color: #b45d16; --signal-bg: #fff0df; }
.chart-signal-risk { --signal-color: #b43f3a; --signal-bg: #fde9e7; }
.chart-signal rect,
.chart-signal polygon {
  fill: var(--signal-bg);
  stroke: var(--signal-color);
  stroke-width: 1.5;
}
.chart-signal text {
  fill: var(--signal-color);
  font-size: 13px;
  font-weight: 800;
}
.liked-responses { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.liked-card { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.liked-card p { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.liked-page-heading { align-items: center; }
.liked-count { min-width: 118px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; text-align: center; background: #fff; }
.liked-count strong, .liked-count span { display: block; }
.liked-count strong { color: var(--sage-dark); font-family: Georgia, "Noto Serif KR", serif; font-size: 26px; }
.liked-page-list .liked-card p { font-size: 12px; line-height: 1.7; }
.liked-count span { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 700; }
.liked-page-list { margin-top: 4px; }
.liked-page-list .liked-card { min-height: 132px; padding: 20px; }

.bottom-nav { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(34, 46, 39, .42); backdrop-filter: blur(5px); }
.modal { width: min(600px, 100%); max-height: 90vh; overflow-y: auto; position: relative; padding: 35px; border-radius: 25px; background: var(--paper); box-shadow: 0 25px 80px rgba(32, 46, 38, .25); animation: modalIn .3s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-close { position: absolute; right: 17px; top: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #eceee9; font-size: 23px; }
.result-modal { text-align: center; }
.result-modal h2, .signup-modal h2 { margin: 0; font-family: Georgia, "Noto Serif KR", serif; font-size: 26px; }
.result-celebrate { width: 58px; height: 58px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 50%; background: var(--sage-soft); color: #c49a54; font-size: 25px; }
.modal-desc { color: var(--muted); font-size: 11px; }
.analysis-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin: 17px 0 13px; }
.analysis-tags .emotion-chip { font-size: 11px; padding: 5px 12px; }
.analysis-summary { margin: 0 0 20px; color: #53635a; font-size: 13px; line-height: 1.8; text-align: left; }
.agent-replies { display: grid; gap: 10px; margin-bottom: 20px; text-align: left; }
.agent-reply { padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.reply-head { display: flex; align-items: center; gap: 9px; }
.reply-head strong { font-size: 11px; }
.reply-head span:nth-child(2) { flex: 1; }
.reply-head button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #f1f2ed; }
.reply-head .like-button.liked { color: #bb6f6b; background: #f9e7e4; }
.agent-reply p { margin: 10px 0 0; color: #637068; font-size: 11px; line-height: 1.8; }
.signup-modal { text-align: left; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin: 22px 0; }
.form-grid label > span, fieldset legend { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 700; }
.form-grid input, .form-grid select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font-size: 11px; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
fieldset legend { font-size: 11px; color: var(--ink); }
fieldset legend small { color: var(--muted); }
.agent-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.agent-option { padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: center; font-size: 9px; }
.agent-option span { width: 31px; height: 31px; display: grid; place-items: center; margin: 0 auto 3px; border-radius: 50%; background: #f0eee7; }
.agent-option.selected { border-color: var(--sage-dark); color: var(--sage-dark); background: var(--sage-soft); font-weight: 700; }
.agent-option.fixed { position: relative; cursor: default; opacity: 1; }
.agent-option.fixed small { display: block; margin-top: 2px; color: #4b7c60; font-size: 9px; font-weight: 600; }
.toast { position: fixed; z-index: 400; left: 50%; bottom: 24px; width: max-content; max-width: calc(100vw - 32px); transform: translate(-50%, 20px); display: flex; align-items: center; gap: 8px; padding: 10px 17px; border-radius: 99px; color: #fff; background: #344a3c; box-shadow: var(--shadow); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); pointer-events: auto; transition-delay: 0s; }
.toast-message { display: flex; align-items: center; gap: 8px; min-width: 0; }
.toast-icon { flex: 0 0 auto; }
.toast p { flex: 1; min-width: 0; margin: 0; font-size: 11px; font-weight: 700; line-height: 1.5; white-space: normal; }
.toast-countdown { flex: 0 0 auto; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.24); color: rgba(255,255,255,.78); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.toast-close { display: grid; flex: 0 0 auto; width: 24px; height: 24px; padding: 0; place-items: center; border: 0; border-radius: 50%; color: inherit; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; opacity: .78; }
.toast-close:hover, .toast-close:focus-visible { background: rgba(255,255,255,.14); opacity: 1; outline: none; }

.auth-gate { position: fixed; inset: 0; z-index: 300; display: grid; grid-template-columns: minmax(360px, .9fr) 1.1fr; min-height: 100dvh; background: var(--paper); overflow-y: auto; }
.auth-gate.hidden { display: none; }
.auth-visual { position: relative; min-height: 100%; overflow: hidden; padding: 45px clamp(35px, 6vw, 80px); display: flex; flex-direction: column; justify-content: flex-start; background: linear-gradient(145deg, #e9f0e8 0%, #f3efe5 58%, #eee8f4 100%); }
.auth-visual::before, .auth-visual::after { content: ''; position: absolute; border: 1px solid rgba(97,127,107,.17); border-radius: 50%; pointer-events: none; }
.auth-visual::before { width: 420px; height: 420px; right: -180px; top: 18%; }
.auth-visual::after { width: 280px; height: 280px; right: -45px; top: 33%; border-color: rgba(193,158,104,.2); }
.auth-brand { position: relative; z-index: 1; white-space: nowrap; }
.auth-brand strong { font-size: clamp(13px, 1.3vw, 18px); }
.auth-message { position: relative; z-index: 1; margin: 80px 0; }
.auth-message h1 { margin: 0; font-family: Georgia, "Noto Serif KR", serif; font-size: clamp(38px, 4.6vw, 62px); line-height: 1.38; letter-spacing: -2.5px; font-weight: 500; }
.auth-message-copy { margin: 22px 0 0; color: var(--muted); font-size: 14px; line-height: 1.9; }
.auth-privacy-note { position: relative; z-index: 1; margin: auto 0 0; max-width: 540px; color: #427158; font-size: 12px; font-weight: 650; line-height: 1.7; }
.auth-trust { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; width: fit-content; padding: 14px 17px; border: 1px solid rgba(255,255,255,.65); border-radius: 16px; background: rgba(255,255,255,.48); }
.auth-trust > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; color: var(--sage-dark); background: #fff; }
.auth-trust p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.auth-trust strong { color: var(--ink); }
.auth-panel { min-height: 100%; display: grid; place-items: center; padding: 45px clamp(25px, 7vw, 110px); background: #fff; }
.auth-box { width: min(520px, 100%); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 36px; padding: 4px; border-radius: 13px; background: #f0f1ec; }
.auth-tabs button { padding: 10px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 750; }
.auth-tabs button.active { color: var(--sage-dark); background: #fff; box-shadow: 0 3px 10px rgba(47,67,55,.08); }
.auth-form { display: grid; gap: 16px; }
.auth-form h2 { margin: 0; font-family: Georgia, "Noto Serif KR", serif; font-size: 31px; }
.auth-form > div > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.auth-form > label > span { display: block; margin-bottom: 5px; color: #59685f; font-size: 10px; font-weight: 750; }
.auth-form > label input { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fbfbf8; font-size: 13px; }
.auth-form input:focus, .auth-form select:focus { border-color: var(--sage); background: #fff; }
.auth-grid { margin: 3px 0 0; }
.auth-grid label > span small { color: #9aa29c; font-size: 8px; }
.auth-submit { margin-top: 3px; min-height: 46px; }
.form-error { min-height: 18px; margin: -5px 0 0; color: #b2605c; font-size: 10px; }
.logout-button { width: 100%; margin-top: 10px; padding: 10px; border: 0; color: #a66561; background: transparent; font-size: 10px; font-weight: 700; }
.password-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.password-heading { grid-column: 1 / -1; }
.password-heading h3 { margin: 0; font-size: 14px; }
.password-heading p { margin: 2px 0 8px; color: var(--muted); font-size: 9px; }
.password-form label > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 700; }
.password-form input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font-size: 11px; }
.password-form .form-error, .password-form button { grid-column: 1 / -1; }
.signup-modal input[readonly] { color: var(--muted); background: #f1f2ee; }
.loading-button { opacity: .7; pointer-events: none; }

@media (max-width: 1020px) {
  :root { --sidebar: 210px; }
  .page { padding-left: 35px; padding-right: 35px; }
  .topbar { padding-left: 35px; padding-right: 35px; }
  .mind-orbit { margin-right: 0; transform: scale(.85); }
  .editor-layout { grid-template-columns: 1fr; }
  .writing-aside { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; padding-bottom: 72px; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .topbar { height: 66px; padding: 0 17px; justify-content: space-between; }
  .mobile-brand, .mobile-avatar { display: flex; }
  .mobile-brand strong { font-family: Georgia, "Noto Serif KR", serif; font-size: 14px; }
  .mobile-brand .brand-mark { width: 33px; height: 33px; flex-basis: 33px; font-size: 17px; border-radius: 11px 11px 11px 4px; }
  .mobile-avatar { display: grid; border: 0; color: #805f51; background: var(--peach); font-size: 12px; font-weight: 800; }
  .icon-button { display: none; }
  .weather { padding-right: 0; border: 0; }
  .weather strong { font-size: 11px; }
  .weather small { display: none; }
  .weather-icon { font-size: 21px; }
  .page { padding: 31px 17px 45px; }
  .home-heading { min-height: auto; }
  .home-heading h1, .page-heading h1 { font-size: 32px; letter-spacing: -1.5px; }
  .home-heading > div:first-child { width: 100%; }
  .home-heading p, .page-heading p { font-size: 13px; }
  .mind-orbit { display: none; }
  .home-grid { grid-template-columns: 1fr; margin-top: 35px; }
  .quick-write { padding: 21px; }
  .quick-write h2 { font-size: 17px; }
  .quick-write p { font-size: 11px; }
  .soft-icon { width: 43px; height: 43px; }
  .streak-card { padding: 19px; }
  .section-heading { margin-top: 37px; }
  .diary-row { grid-template-columns: 45px 1fr auto; gap: 11px; padding: 14px 12px; }
  .diary-row .emotion-chips { display: none; }
  .diary-copy p { max-width: 190px; }
  .care-banner { grid-template-columns: 1fr; padding: 25px; text-align: center; }
  .care-illustration { width: 120px; margin: auto; }
  .care-banner button { justify-self: center; }
  .page-heading { display: block; }
  .page-heading > .primary-button, .page-heading > .date-pill, .page-heading > .period-toggle { margin-top: 18px; }
  .date-pill { width: fit-content; }
  .editor-card { padding: 19px 16px; }
  .saved-analysis { margin: 25px -16px -19px; padding: 22px 16px 24px; }
  .saved-analysis-head { display: block; }
  .saved-analysis-head > span { display: inline-block; margin-top: 8px; }
  #diaryContent { min-height: 310px; font-size: 15px; }
  .writing-aside { grid-template-columns: 1fr; }
  .archive-toolbar { align-items: stretch; gap: 12px; flex-direction: column; }
  .month-control { justify-content: space-between; }
  .view-toggle button { flex: 1; }
  .calendar-card { padding: 7px; border-radius: 15px; overflow-x: auto; }
  .calendar-week, .calendar-grid { min-width: 560px; }
  .calendar-day { min-height: 88px; }
  .stat-summary { grid-template-columns: 1fr 1fr; }
  .summary-card:last-child { grid-column: 1 / -1; }
  .chart-head { grid-template-columns: 1fr; gap: 15px; align-items: stretch; }
  .chart-tools { align-items: stretch; }
  .chart-control-row { justify-content: space-between; }
  .legend { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; }
  .chart-wrap { height: 220px; overflow-x: auto; }
  .chart-wrap svg { min-width: 560px; }
  .liked-responses { grid-template-columns: 1fr; }
  .liked-count { width: fit-content; margin-top: 18px; }
  .bottom-nav { position: fixed; inset: auto 0 0; z-index: 30; width: 100%; max-width: none; height: 68px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid #3d5046; background: rgba(35,49,42,.98); box-shadow: 0 -8px 24px rgba(20,31,25,.18); backdrop-filter: blur(14px); }
  .bottom-nav button { position: relative; border: 0; padding: 0 2px; background: transparent; display: flex; align-items: center; justify-content: center; color: #c6d0ca; font-size: 11px; font-weight: 750; }
  .bottom-nav button.active { color: #fff; background: rgba(255,255,255,.11); }
  .bottom-nav-label { font-size: 11px; line-height: 1.3; white-space: nowrap; }
  .modal { padding: 29px 18px 22px; border-radius: 21px; }
  .form-grid { grid-template-columns: 1fr; }
  .agent-options { grid-template-columns: repeat(3, 1fr); }
  .password-form { grid-template-columns: 1fr; }
  .password-form label, .password-form .form-error, .password-form button { grid-column: 1; }
  .auth-gate { display: block; }
  .auth-visual { min-height: auto; padding: 24px 20px 30px; }
  .auth-message { margin: 50px 0 30px; }
  .auth-message h1 { font-size: 35px; letter-spacing: -1.8px; }
  .auth-message-copy { font-size: 12px; }
  .auth-trust { display: none; }
  .auth-panel { min-height: auto; padding: 28px 20px 50px; }
  .auth-tabs { margin-bottom: 27px; }
  .auth-form h2 { font-size: 27px; }
  .auth-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* Readability and brand refinement */
:root {
  --ink: #1f3129;
  --muted: #596b62;
  --line: #dce1da;
  --shadow: 0 12px 36px rgba(43, 65, 52, .10);
}
body {
  color: var(--ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
.card, .diary-row, .agent-reply, .liked-card {
  border-color: #d9dfd8;
}
.brand, .mobile-brand { gap: 13px; }
.brand-mark {
  position: relative;
  isolation: isolate;
  width: 46px;
  height: 46px;
  flex-basis: 46px;
  overflow: visible;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 17px 17px 17px 6px;
  background: linear-gradient(145deg, #789987 0%, #4e715d 100%);
  box-shadow: 0 9px 22px rgba(57, 89, 69, .24), inset 0 1px 0 rgba(255,255,255,.28);
}
.brand-mark::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 14px;
  height: 9px;
  right: 1px;
  top: -6px;
  border: 2px solid var(--paper);
  border-radius: 90% 10% 90% 10%;
  background: #d8be78;
  transform: rotate(28deg);
}
.sidebar .brand-mark::before { border-color: #f1f1e9; }
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px 12px 12px 4px;
}
.brand-mark > span {
  position: relative;
  z-index: 1;
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 22px;
  font-weight: 700;
}
.brand-copy { min-width: 0; }
.brand strong {
  color: #24372e;
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -.5px;
}
.brand small {
  margin-top: 4px;
  color: #607269;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.profile-card small, .weather small, .quick-write p,
.mini-label, .day-dot, .section-heading p, .section-heading button,
.date-box small, .emotion-chip, .date-pill input, .weather-compact small,
.title-wrap label, .editor-footer,
.saved-analysis-head > span, .saved-reply-head small, .prompt-card small,
.agent-preview small, .prompt-card button, .agent-mini small,
.agent-preview > p, .view-toggle button,
.period-toggle button, .calendar-week span, .day-number,
.summary-card span,
.summary-card p, .chart-head p, .legend, .liked-card p,
.modal-desc, .form-grid label > span, fieldset legend,
.agent-option, .toast p, .auth-form > div > p:last-child,
.auth-form > label > span, .auth-grid label > span small, .form-error,
.password-heading p, .password-form label > span, .logout-button {
  font-size: 12px;
}
.profile-card strong, .weather strong, .diary-copy p,
.weather-compact strong, .saved-reply p,
.agent-reply p,
.liked-card p, .modal-desc {
  font-size: 13px;
}
.diary-copy h3 { font-size: 16px; }
.saved-reply-head strong, .reply-head strong, .agent-mini strong { font-size: 13px; }
.ghost-button, .primary-button { min-height: 42px; font-size: 14px; }
.form-grid input, .form-grid select, .password-form input {
  min-height: 43px;
  font-size: 14px;
}
.agent-option { min-height: 76px; }
.auth-tabs button { min-height: 42px; font-size: 14px; }
.auth-form > label input {
  min-height: 48px;
  font-size: 14px;
}
.form-error { min-height: 20px; line-height: 1.55; }
.form-message {
  margin: -2px 0 0;
  padding: 11px 13px;
  border-radius: 10px;
  color: #456654;
  background: var(--sage-soft);
  font-size: 12px;
  line-height: 1.6;
}
.form-message:empty { display: none; }
.auth-text-button, .auth-back-button {
  width: fit-content;
  border: 0;
  padding: 2px 0;
  color: var(--sage-dark);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}
.auth-text-button { justify-self: end; }
.login-help-actions { display: grid; justify-items: end; gap: 7px; margin-top: -8px; }
.login-help-actions .auth-text-button { margin: 0; }
.login-submit-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.login-submit-actions .auth-submit { width: 100%; margin: 0; }
.test-login-wrap { position: relative; display: flex; }
.test-login-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--sage-dark);
  border-radius: 12px;
  color: var(--sage-dark);
  background: linear-gradient(135deg, #fff 0%, #f4fff8 50%, #fff 100%);
  box-shadow: 0 5px 14px rgba(0, 143, 64, .12);
  font-size: 14px;
  font-weight: 800;
  transition: color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .2s ease;
  animation: testButtonGlow 3.2s ease-in-out infinite;
}
.test-login-wrap.coachmark-active .test-login-button {
  outline: 3px solid rgba(3, 184, 84, .18);
  outline-offset: 3px;
}
.test-login-coachmark {
  position: absolute;
  right: 0;
  bottom: calc(100% + 11px);
  z-index: 20;
  width: min(214px, calc(100vw - 32px));
  padding: 12px 31px 29px 13px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 9px;
  color: #fff;
  background: var(--coachmark-surface);
  box-shadow: 0 9px 22px rgba(27,48,37,.16);
  -webkit-backdrop-filter: blur(10px) saturate(110%);
  backdrop-filter: blur(10px) saturate(110%);
  animation: testCoachmarkIn .32s ease-out both;
}
.test-login-coachmark::after {
  content: '';
  position: absolute;
  right: 23px;
  bottom: -8px;
  width: 16px;
  height: 8px;
  background: var(--coachmark-surface);
  -webkit-backdrop-filter: blur(10px) saturate(110%);
  backdrop-filter: blur(10px) saturate(110%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.test-login-coachmark strong,
.test-login-coachmark span { display: block; }
.test-login-coachmark strong { font-size: 13px; line-height: 1.4; }
.test-login-coachmark span { margin-top: 3px; color: rgba(255,255,255,.76); font-size: 11px; line-height: 1.5; }
.test-login-coachmark-close {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 1;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  color: rgba(255,255,255,.66);
  background: transparent;
  font-size: 18px;
  line-height: 1;
}
.test-login-coachmark-close:hover { color: #fff; }
.coachmark-never-show {
  position: absolute;
  right: 11px;
  bottom: 7px;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  color: rgba(255,255,255,.56);
  background: transparent;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.coachmark-never-show:hover,
.coachmark-never-show:focus-visible { color: #fff; }
.test-login-button::after {
  content: '';
  position: absolute;
  z-index: 0;
  inset: -55% auto -55% -65%;
  width: 42%;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(128,244,179,.7), rgba(255,255,255,.95), transparent);
  filter: blur(.5px);
  pointer-events: none;
  animation: testButtonShine 3.2s ease-in-out infinite;
}
.test-login-button:hover {
  color: #fff;
  background: var(--sage-dark);
  box-shadow: 0 9px 20px rgba(0, 143, 64, .24);
  transform: translateY(-2px);
}
.test-login-button:active { box-shadow: 0 3px 8px rgba(0, 143, 64, .18); transform: translateY(0) scale(.98); }
@keyframes testButtonShine {
  0%, 18% { left: -65%; opacity: 0; }
  28% { opacity: .95; }
  58%, 100% { left: 135%; opacity: 0; }
}
@keyframes testButtonGlow {
  0%, 100% { box-shadow: 0 5px 14px rgba(0, 143, 64, .12); }
  42% { box-shadow: 0 7px 20px rgba(0, 174, 78, .23); }
}
@keyframes testCoachmarkIn {
  from { opacity: 0; transform: translateY(7px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .test-login-button, .test-login-button::after, .test-login-coachmark { animation: none !important; }
  .test-login-button { transition: none; }
}
.auth-back-button { justify-self: center; margin-top: 2px; }
.auth-text-button:hover, .auth-back-button:hover { text-decoration: underline; }

.diary-date {
  display: block;
  margin-bottom: 2px;
  color: var(--sage-dark);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .01em;
}
.diary-copy h3 { margin-top: 1px; }
.calendar-day { min-height: 118px; padding: 9px; }
.calendar-entry {
  display: grid;
  gap: 1px;
  min-height: 43px;
  padding: 6px 7px;
  white-space: normal;
  text-align: left;
}
.calendar-emotions { display: flex; flex-wrap: wrap; gap: 3px 6px; }
.calendar-emotion {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-emotion i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #6e9279;
}
.calendar-entry.negative .calendar-emotion i { background: #c47f75; }
.calendar-entry-title {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .mobile-brand .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 14px 14px 14px 5px;
  }
  .mobile-brand .brand-mark > span { font-size: 18px; }
  .mobile-brand strong { font-size: 16px; }
  .home-heading p, .page-heading p { font-size: 14px; }
  .quick-write p { font-size: 13px; }
  .diary-row { grid-template-columns: 48px 1fr auto; }
  .diary-copy p { font-size: 13px; }
  #diaryContent { font-size: 16px; }
  .bottom-nav-label { font-size: 11px; }
  .auth-message-copy { font-size: 14px; }
}
.title-wrap button, .saved-reply > .avatar, .auth-trust p { font-size: 12px; }
.day-dot i { font-size: 11px; }

.agent-profile-list { display: grid; gap: 9px; margin: 12px 0; }
.agent-profile-editor { display: grid; grid-template-columns: minmax(170px,1fr) 110px 110px; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--white); }
.agent-profile-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.agent-profile-identity strong, .agent-profile-identity small { display: block; }
.agent-profile-identity strong { font-size: 13px; }
.agent-profile-identity small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.agent-profile-editor label > span:first-child { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }
.agent-profile-editor select, .agent-profile-editor input { width: 100%; min-height: 40px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--paper); font-size: 13px; }
.agent-profile-editor select:disabled { opacity: .75; cursor: not-allowed; }
.age-input { position: relative; display: block; }
.age-input input { padding-right: 29px; }
.age-input b { position: absolute; right: 9px; top: 50%; color: var(--muted); font-size: 12px; transform: translateY(-50%); }

.summary-card.aura-current { background: #eaf6ef; }
.summary-card.aura-change { background: #f6f7f6; }
.summary-card strong small { margin-left: 4px; font-family: inherit; font-size: 12px; }
.legend i.aura-line, .legend i.trend-line { width: 18px; height: 3px; border-radius: 0; }
.aura-line { background: var(--chart-aura); }
.legend i.trend-line { height: 0; border-top: 3px dashed var(--chart-trend); background: transparent; }
.change-up { color: #b85329 !important; }
.change-down { color: #2f6fb8 !important; }
.summary-card.aura-change.change-up { background: #fff3eb; }
.summary-card.aura-change.change-down { background: #edf4fc; }
.chart-card .chart-wrap { height: 340px; }

@media (max-width: 760px) {
  .agent-profile-editor { grid-template-columns: 1fr 1fr; }
  .agent-profile-identity { grid-column: 1 / -1; }
  .chart-head { grid-template-columns: 1fr; gap: 14px; }
  .chart-tools { align-items: stretch; }
  .chart-range-toggle button { min-width: 0; flex: 1; padding-inline: 8px; }
  .chart-card .chart-wrap { height: 290px; overflow-x: auto; }
  .chart-wrap svg { min-width: 720px; }
  .profile-menu { left: auto; right: 14px; top: 58px; bottom: auto; width: 190px; }
  .diary-row { grid-template-columns: 48px minmax(0,1fr) auto; }
  .diary-row .date-box { grid-row: 1 / span 2; }
  .diary-row .diary-copy { grid-column: 2; }
  .diary-row .emotion-chips { display: flex; grid-column: 2; justify-content: flex-start; }
  .diary-row .row-more { grid-column: 3; grid-row: 1; }
  .auth-brand { white-space: nowrap; }
  .auth-brand strong { font-size: 13px; }
}

/* Text-first portal redesign */
:root {
  --ink: #1f2321;
  --muted: #666d69;
  --paper: #ffffff;
  --cream: #f6f8f7;
  --sage: #03c75a;
  --sage-dark: #009f47;
  --sage-soft: #eefaf3;
  --peach-soft: #fff4f1;
  --white: #ffffff;
  --line: #e5e8e6;
  --shadow: none;
  --radius: 4px;
  --page-gutter: clamp(32px, 4.6vw, 72px);
}

html { background: #fff; }
body {
  color: var(--ink);
  background: #fff;
  font-family: Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -.012em;
}
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid rgba(3, 199, 90, .42);
  outline-offset: 2px;
}

.sidebar {
  --header-gutter: var(--page-gutter);
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  height: 146px;
  z-index: 40;
  display: block;
  padding: 0;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.brand {
  position: absolute;
  top: 19px;
  left: var(--header-gutter);
  height: 45px;
  gap: 0;
}
.brand-mark, .nav-icon { display: none; }
.brand strong {
  color: #0c9f4a;
  font-family: inherit;
  font-size: 24px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -.055em;
}
.brand small {
  margin-top: 4px;
  color: #727976;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -.01em;
}
.side-nav {
  position: absolute;
  left: var(--header-gutter);
  bottom: 0;
  height: 62px;
  display: flex;
  align-items: stretch;
  gap: 36px;
  margin: 0;
}
.nav-item {
  position: relative;
  gap: 0;
  padding: 0;
  border-radius: 0;
  color: #292d2b;
  background: transparent;
  font-size: 15px;
  font-weight: 650;
}
.nav-item:hover { color: #009f47; background: transparent; }
.nav-item.active {
  color: #008f40;
  background: transparent;
  box-shadow: none;
}
.nav-item.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #03c75a;
}
.profile-card {
  position: absolute;
  top: 17px;
  right: var(--header-gutter);
  width: auto;
  min-width: 142px;
  margin: 0;
  padding: 3px 0 3px 12px;
  border-left: 1px solid var(--line);
  border-radius: 0;
}
.profile-card .avatar {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border: 2px solid #fff;
  color: #fff;
  background: #03b854;
  box-shadow: 0 0 0 3px #e1f5e9, 0 5px 14px rgba(0,143,64,.2);
  font-size: 14px;
  font-weight: 850;
  transition: transform .2s ease, box-shadow .2s ease;
}
.profile-card:hover .avatar,
.profile-card:focus-visible .avatar { box-shadow: 0 0 0 4px #d8f3e3, 0 7px 18px rgba(0,143,64,.26); transform: translateY(-1px); }
.profile-card strong { font-size: 13px; font-weight: 700; }
.profile-card small { color: #747b77; font-size: 11px; }
.profile-card .more { display: none; }
.profile-menu {
  left: auto;
  right: var(--page-gutter);
  top: 66px;
  bottom: auto;
  width: 190px;
  padding: 6px;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .1);
}
.profile-menu button { border-radius: 2px; font-weight: 600; }

.main-content {
  min-height: 100vh;
  margin-left: 0;
  padding-top: 146px;
}
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: calc(var(--page-gutter) + 175px);
  z-index: 41;
  height: 82px;
  justify-content: flex-end;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}
.top-actions { gap: 12px; pointer-events: auto; }
.weather {
  gap: 10px;
  padding-right: 0;
  border-right: 0;
  text-align: right;
}
.weather-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(78,103,89,.1);
  border-radius: 50%;
  color: #64736b;
  background: #f3f6f4;
  box-shadow: 0 3px 10px rgba(45,67,54,.08);
  font-size: 20px;
  line-height: 1;
}
.weather-icon-sun { color: #b87908; background: #fff6d9; }
.weather-icon-cloud { color: #63798b; background: #edf3f7; }
.weather-icon-rain { color: #3f75a5; background: #eaf3fb; }
.weather-icon-snow { color: #4e8297; background: #edf8fb; }
.weather-icon-thunder { color: #7863a4; background: #f2eefb; }
.weather-icon-fog { color: #6f7773; background: #f1f3f2; }
.icon-button { display: none; }
.weather strong { color: #313633; font-size: 12px; font-weight: 700; }
.weather small { color: #7a817d; font-size: 10px; }
.mobile-brand, .mobile-avatar { display: none; }

.page {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 46px var(--page-gutter) 96px;
  animation: none;
}
.page-heading {
  align-items: flex-end;
  margin-bottom: 34px;
}
.page-heading .eyebrow, .home-heading .eyebrow { display: none; }
.home-heading h1, .page-heading h1,
.section-heading h2, .quick-write h2, .care-banner blockquote,
.title-wrap input, .editor-datetime time, .saved-analysis-head h2,
.prompt-card h3, .summary-card strong, .result-modal h2, .signup-modal h2,
.auth-message h1, .auth-form h2 {
  font-family: inherit;
}
.page-heading h1 {
  font-size: clamp(30px, 2.6vw, 38px);
  line-height: 1.25;
  letter-spacing: -.045em;
  font-weight: 780;
}
.page-heading p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}
.card, .liked-card, .agent-reply {
  border-color: var(--line);
  border-radius: 0;
  box-shadow: none;
}
.primary-button, .ghost-button {
  min-height: 42px;
  padding: 9px 17px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 700;
}
.primary-button {
  border-color: #03b854;
  background: #03b854;
}
.primary-button:hover { background: #00a94d; }
.ghost-button:hover { border-color: #a9b1ad; background: #f8faf9; }

/* Archive: the selected timeline direction */
.archive-head {
  min-height: 116px;
  align-items: flex-start;
  margin-bottom: 0;
}
.archive-head > .primary-button {
  min-width: 126px;
  min-height: 48px;
  margin-top: 6px;
}
.archive-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0;
  padding: 20px 0 17px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid #d9dddb;
  background: transparent;
}
.month-control { gap: 12px; }
.month-control strong {
  min-width: 126px;
  color: #252927;
  font-size: 21px;
  font-weight: 750;
  text-align: center;
}
.month-control button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 2px;
  color: #49504c;
  background: transparent;
  font-size: 24px;
}
.month-control button:hover { color: #009f47; background: #f2f7f4; }
.archive-summary {
  margin: 5px 0 0;
  color: #606864;
  font-size: 13px;
}
.view-toggle, .period-toggle {
  gap: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}
.view-toggle button, .period-toggle button {
  min-height: 38px;
  padding: 7px 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: #747b77;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}
.view-toggle button.active, .period-toggle button.active {
  color: #008f40;
  border-bottom-color: #03c75a;
  background: transparent;
  box-shadow: none;
}
.archive-list { display: grid; gap: 0; }
.diary-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) minmax(150px, 230px);
  gap: 24px;
  align-items: center;
  min-height: 116px;
  padding: 22px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .16s ease;
}
.diary-row:hover { transform: none; background: #fafcfb; box-shadow: none; }
.date-box {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 18px;
  border-right: 1px solid #dfe3e1;
  text-align: left;
}
.date-box small {
  order: 0;
  color: #5c645f;
  font-size: 12px;
  font-weight: 600;
}
.date-box strong {
  order: 1;
  margin-top: -1px;
  color: #1e2220;
  font-family: inherit;
  font-size: 34px;
  font-weight: 520;
  line-height: 1.25;
}
.date-box.weekend-sunday small,
.date-box.weekend-sunday strong { color: var(--weekend-sunday); }
.date-box.weekend-saturday small,
.date-box.weekend-saturday strong { color: var(--weekend-saturday); }
.diary-date { display: none; }
.diary-copy { min-width: 0; }
.diary-copy h3 {
  margin: 0;
  color: #202422;
  font-size: 17px;
  font-weight: 730;
  line-height: 1.45;
}
.diary-copy h3 small { color: #009f47; font-size: 12px; font-weight: 650; }
.diary-copy p {
  display: -webkit-box;
  max-width: 720px;
  margin: 7px 0 0;
  overflow: hidden;
  color: #5c6460;
  font-size: 14px;
  line-height: 1.7;
  white-space: normal;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.emotion-chips {
  display: flex;
  justify-content: flex-end;
  gap: 4px 6px;
}
.archive-list .emotion-chips { gap: 3px; }
.emotion-chip,
.emotion-chip.negative {
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--emotion-fg, #59645e);
  background: var(--emotion-bg, #f1f3f2);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
  filter: saturate(.88);
}
.emotion-chip.negative { color: var(--emotion-fg, #59645e); background: var(--emotion-bg, #f1f3f2); }
.emotion-joy { --emotion-bg: #fff4cc; --emotion-fg: #8a5a00; }
.emotion-anticipation { --emotion-bg: #f1ecff; --emotion-fg: #6845b8; }
.emotion-calm { --emotion-bg: #eaf7ef; --emotion-fg: #257447; }
.emotion-comfort { --emotion-bg: #e7f7f5; --emotion-fg: #216f69; }
.emotion-happiness { --emotion-bg: #ffebe1; --emotion-fg: #a9431f; }
.emotion-gratitude { --emotion-bg: #fdebf2; --emotion-fg: #98385d; }
.emotion-pride { --emotion-bg: #eeeafd; --emotion-fg: #55489d; }
.emotion-courage { --emotion-bg: #fee9e7; --emotion-fg: #a83733; }
.emotion-warmth { --emotion-bg: #fff0dc; --emotion-fg: #96520f; }
.emotion-sadness { --emotion-bg: #eaf2ff; --emotion-fg: #315f99; }
.emotion-anxiety { --emotion-bg: #f0eff8; --emotion-fg: #575178; }
.emotion-anger { --emotion-bg: #fee9e7; --emotion-fg: #a92e2e; }
.emotion-fatigue { --emotion-bg: #eef1f4; --emotion-fg: #505d67; }
.emotion-loneliness { --emotion-bg: #eceffd; --emotion-fg: #49599a; }
.emotion-neutral { --emotion-bg: #f1f3f2; --emotion-fg: #59645e; }
.row-more { display: none; }
.calendar-card {
  margin-top: 22px;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
}
.calendar-grid { border-color: var(--line); }
.calendar-day {
  min-height: 116px;
  border-color: var(--line);
  background: #fff;
}
.calendar-day.outside { background: #fafbfa; }
.calendar-day.today .day-number { border-radius: 2px; background: #03b854; }
.calendar-day.weekend-sunday:not(.today) .day-number { color: var(--weekend-sunday); }
.calendar-day.weekend-saturday:not(.today) .day-number { color: var(--weekend-saturday); }
.calendar-day.outside .day-number { opacity: .55; }
.calendar-entry, .calendar-entry.negative {
  border-radius: 2px;
  color: #272c29;
  background: #fff;
}
.calendar-entry.negative { color: #272c29; background: #fff; }
.calendar-emotions { gap: 3px; }
.calendar-emotion,
.calendar-emotion.negative {
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--emotion-fg, #59645e);
  background: var(--emotion-bg, #f1f3f2);
  filter: saturate(.88);
}
.calendar-emotion.negative { color: var(--emotion-fg, #59645e); background: var(--emotion-bg, #f1f3f2); }
.calendar-emotion i { display: none; }
.calendar-entry-title { color: #272c29; }

/* Writing */
.editor-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; }
.editor-card {
  padding: 30px 32px;
  border: 1px solid var(--line);
  background: #fff;
}
.editor-datetime {
  justify-content: flex-start;
  margin: 0 0 18px;
  color: #4f5752;
}
.editor-datetime > span, .weather-compact > span:first-child,
.prompt-card > span, .leaf, .summary-card > i { display: none; }
.editor-meta { padding-bottom: 17px; }
.title-wrap input {
  padding-top: 7px;
  border-bottom-color: #cfd4d1;
  font-size: 22px;
  font-weight: 700;
}
.title-wrap button {
  border-radius: 2px;
  color: #008f40;
  background: #eef9f3;
}
#diaryContent {
  min-height: 350px;
  margin-top: 14px;
  padding: 18px 0;
  border: 0;
  background: #fff;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.9;
}
.saved-analysis {
  border-radius: 0;
  background: #fafcfb;
}
.saved-analysis-summary { border-radius: 0; background: #f1f8f4; }
.saved-reply { border-radius: 2px; }
.prompt-card, .agent-preview {
  padding: 20px;
  border-radius: 2px;
}
.prompt-card { border: 1px solid #dfe8e3; background: #f5faf7; }
.prompt-card h3 { font-size: 15px; }
.agent-mini { border-radius: 2px; background: #f7f9f8; }

/* Saved replies and statistics */
.liked-responses, .liked-page-list { grid-template-columns: 1fr; gap: 0; }
.liked-page-list .liked-card {
  min-height: 0;
  padding: 22px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.liked-count strong { color: #009f47; font-family: inherit; }
.stat-summary {
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.summary-card,
.summary-card.aura-current,
.summary-card.aura-change,
.summary-card.top-emotion {
  min-height: 128px;
  padding: 24px;
  border-radius: 0;
  background: #fff;
}
.summary-card + .summary-card { border-left: 1px solid var(--line); }
.summary-card strong { font-size: 28px; }
.summary-card.aura-current {
  background: linear-gradient(90deg, #fff 0%, #fff 70%, #f2faf5 100%);
}
.summary-card.aura-change { background: #fff; }
.summary-card.aura-change.change-up {
  background: linear-gradient(90deg, #fff 0%, #fff 76%, #fff5ef 100%);
}
.summary-card.aura-change.change-down {
  background: linear-gradient(90deg, #fff 0%, #fff 76%, #eff6ff 100%);
}
.summary-card.top-emotion {
  background: linear-gradient(90deg, #fff 0%, #fff 70%, var(--emotion-bg, #f1f3f2) 100%);
}
.summary-card.top-emotion #topEmotion { color: var(--emotion-fg, #59645e); }
.aura-current #currentAura { color: #087d42; }
.aura-current #auraTotalChange { color: #68716c; }
.aura-current.aura-up #auraTotalChange { color: #287a4b; }
.aura-current.aura-down #auraTotalChange { color: #356eb3; }
.aura-change #todayAuraChange { color: #68716c; }
.aura-change.change-up #todayAuraChange { color: #b85329; }
.aura-change.change-down #todayAuraChange { color: #2f6fb8; }
.summary-card.aura-current > span,
.summary-card.aura-current > strong,
.summary-card.aura-current > p { position: relative; z-index: 1; }
#auraMoodWatermark,
#todayMoodWatermark {
  position: absolute;
  top: 50%;
  right: 24px;
  bottom: auto;
  display: none;
  width: 52px;
  height: 52px;
  border: 3px solid currentColor;
  border-radius: 50%;
  color: rgba(8, 125, 66, .1);
  background:
    radial-gradient(circle at 36% 38%, currentColor 0 2.5px, transparent 3px),
    radial-gradient(circle at 64% 38%, currentColor 0 2.5px, transparent 3px);
  transform: translateY(-50%);
  pointer-events: none;
}
#auraMoodWatermark::after,
#todayMoodWatermark::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 27px;
  width: 20px;
  height: 10px;
  border-bottom: 3px solid currentColor;
  border-radius: 0 0 20px 20px;
  transform: translateX(-50%);
}
.aura-current.aura-down #auraMoodWatermark::after,
.aura-change.change-down #todayMoodWatermark::after {
  top: 31px;
  border-top: 3px solid currentColor;
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
}
.aura-current.aura-up #auraMoodWatermark { display: block; color: rgba(8, 125, 66, .1); }
.aura-current.aura-down #auraMoodWatermark { display: block; color: rgba(53, 110, 179, .1); }
.aura-change.change-up #todayMoodWatermark { display: block; color: rgba(184, 83, 41, .1); }
.aura-change.change-down #todayMoodWatermark { display: block; color: rgba(47, 111, 184, .1); }
.chart-card {
  margin-top: 28px;
  padding: 28px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.chart-head { border-bottom-color: var(--line); }
.legend { border-radius: 2px; background: #f7f9f8; }
.legend i.aura-line { background: var(--chart-aura); }
.legend i.trend-line { height: 0; border-top: 3px dashed var(--chart-trend); background: transparent; }
/* Quiet home treatment for legacy entry points */
.home-heading { min-height: 180px; }
.home-heading h1 { font-size: 38px; font-weight: 760; letter-spacing: -.045em; }
.mind-orbit, .care-illustration { display: none; }
.home-grid { grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quick-write, .streak-card {
  min-height: 140px;
  padding: 24px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: #fff;
}
.quick-write { border-right: 1px solid var(--line); }
.quick-write p { color: var(--muted); }
.soft-icon, .round-arrow { display: none; }
.care-banner {
  min-height: 0;
  padding: 24px 0;
  grid-template-columns: 1fr auto;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #f8faf9;
}

/* Dialogs and authentication */
.modal-backdrop { background: rgba(21, 28, 24, .48); backdrop-filter: none; }
.modal {
  padding: 34px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .16);
}
.modal-close { border-radius: 2px; }
.agent-option, .agent-profile-editor,
.form-grid input, .form-grid select,
.password-form input, .auth-form > label input,
.auth-tabs { border-radius: 3px; }
.agent-option.selected { border-color: #03b854; color: #008f40; background: #eef9f3; }
.auth-gate {
  grid-template-columns: minmax(380px, .82fr) minmax(520px, 1.18fr);
  background: #fff;
}
.auth-visual {
  padding: 46px clamp(36px, 5.5vw, 76px);
  border-right: 1px solid var(--line);
  background: #f7faf8;
}
.auth-visual::before, .auth-visual::after { display: none; }
.auth-brand { position: static; }
.auth-brand .brand-mark { display: none; }
.auth-brand strong {
  color: #079d4b;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -.045em;
}
.auth-message { margin: 106px 0 42px; }
.auth-message h1 {
  font-size: clamp(36px, 3.6vw, 52px);
  line-height: 1.32;
  letter-spacing: -.055em;
  font-weight: 760;
}
.auth-trust { border-radius: 3px; background: #fff; }
.auth-panel { background: #fff; }
.auth-box { width: min(480px, 100%); }
.auth-tabs {
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.auth-tabs button {
  border-radius: 0;
  border-bottom: 2px solid transparent;
}
.auth-tabs button.active {
  color: #008f40;
  border-bottom-color: #03c75a;
  background: transparent;
  box-shadow: none;
}
.auth-form > label input { background: #fff; }
.toast {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 3px;
  background: rgba(32,45,38,.88);
  box-shadow: 0 12px 32px rgba(25,36,30,.22);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

@media (max-width: 1020px) {
  :root { --page-gutter: 32px; }
  .side-nav { gap: 24px; }
  .nav-item { font-size: 14px; }
  .editor-layout { grid-template-columns: 1fr; }
  .writing-aside { grid-template-columns: 1fr 1fr; }
  .diary-row { grid-template-columns: 96px minmax(0, 1fr) minmax(130px, 190px); }
}

@media (max-width: 760px) {
  :root { --page-gutter: 20px; }
  body { padding-bottom: 65px; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding-top: 0; }
  .topbar {
    position: sticky;
    inset: 0 0 auto;
    height: 64px;
    padding: 0 18px;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.97);
    pointer-events: auto;
  }
  .mobile-brand { display: flex; }
  .mobile-brand .brand-mark { display: none; }
  .mobile-brand strong {
    color: #079d4b;
    font-family: inherit;
    font-size: 18px;
    font-weight: 850;
    letter-spacing: -.045em;
  }
  .mobile-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: #03b854;
    box-shadow: 0 0 0 3px #e1f5e9, 0 4px 12px rgba(0,143,64,.18);
    font-weight: 850;
  }
  .weather { display: none; }
  .page { padding: 30px 20px 52px; }
  .page-heading { margin-bottom: 26px; }
  .page-heading h1, .home-heading h1 { font-size: 29px; letter-spacing: -.045em; }
  .page-heading p { font-size: 14px; }
  .archive-head { min-height: 126px; }
  .archive-head > .primary-button { width: fit-content; margin-top: 18px; }
  .archive-toolbar { align-items: stretch; padding-top: 16px; }
  .month-control { justify-content: flex-start; }
  .month-control strong { font-size: 19px; }
  .view-toggle { width: 100%; margin-top: 12px; border-top: 1px solid var(--line); }
  .view-toggle button { flex: 1; }
  .diary-row {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 15px;
    min-height: 0;
    padding: 20px 0;
  }
  .date-box { padding-left: 5px; }
  .date-box strong { font-size: 29px; }
  .diary-copy h3 { font-size: 16px; }
  .diary-copy p { font-size: 14px; -webkit-line-clamp: 2; }
  .diary-row .emotion-chips {
    display: flex;
    grid-column: 2;
    justify-content: flex-start;
    margin-top: -8px;
  }
  .calendar-card { overflow-x: auto; }
  .editor-card { padding: 22px 18px; }
  .editor-meta { align-items: flex-start; gap: 15px; }
  #diaryContent { min-height: 310px; }
  .writing-aside { grid-template-columns: 1fr; }
  .stat-summary { grid-template-columns: 1fr; }
  .summary-card + .summary-card { border-left: 0; border-top: 1px solid var(--line); }
  .summary-card:last-child { grid-column: auto; }
  .chart-card { padding-top: 22px; }
  .chart-control-row { display: block; }
  .chart-range-toggle { display: grid; grid-template-columns: repeat(5, 1fr); }
  .bottom-nav {
    height: 65px;
    border-top: 1px solid #dce1de;
    background: rgba(255,255,255,.98);
    box-shadow: 0 -4px 18px rgba(0,0,0,.06);
    backdrop-filter: none;
  }
  .bottom-nav button { color: #676f6a; background: transparent; font-size: 11px; }
  .bottom-nav button.active { color: #008f40; background: #f1faf5; }
  .bottom-nav-label { font-size: 11px; }
  .profile-menu { right: 14px; top: 58px; }
  .modal { padding: 28px 20px 22px; border-radius: 4px; }
  .auth-gate { display: block; }
  .auth-visual {
    min-height: auto;
    padding: 28px 22px 34px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .auth-message { margin: 54px 0 18px; }
  .auth-message h1 { font-size: 33px; }
  .auth-panel { min-height: auto; padding: 32px 22px 54px; }
  .auth-trust { display: none; }
}

/* Balanced typography scale and stronger mobile navigation */
body { font-size: 16px; }
.brand small { font-size: 13px; }
.nav-item { font-size: 16px; }
.profile-card strong, .weather strong { font-size: 14px; }
.profile-card small, .weather small { font-size: 12px; }
.profile-menu button { font-size: 14px; }
.page-heading p, .home-heading p { font-size: 15px; }
.primary-button, .ghost-button { min-height: 44px; font-size: 14px; }
.mini-label, .section-heading p, .section-heading button,
.archive-summary, .date-box small,
.view-toggle button, .period-toggle button { font-size: 13px; }
.emotion-chip, .emotion-chip.negative { font-size: 13px; }
.section-heading h2 { font-size: 23px; }
.quick-write h2 { font-size: 19px; }
.quick-write p { font-size: 14px; }
.day-dot, .day-dot i { font-size: 12px; }
.diary-copy h3 { font-size: 16px; }
.diary-copy h3 small { font-size: 12px; }
.diary-copy p { font-size: 14px; }
.calendar-week span, .day-number { font-size: 12px; }
.calendar-emotion, .calendar-entry-title { font-size: 12px; }
.editor-datetime time { font-size: 14px; }
.weather-compact small, .title-wrap label,
.editor-footer, .prompt-card small, .agent-preview small,
.agent-mini small { font-size: 12px; }
.weather-compact strong,
.prompt-card button, .agent-mini strong, .agent-preview > p { font-size: 13px; }
.inline-weather-input { font-size: 14px; }
.title-wrap input { font-size: 22px; }
.title-wrap button { font-size: 12px; }
#diaryContent { font-size: 16px; line-height: 1.85; }
.saved-analysis-summary, .saved-reply p,
.saved-reply-head strong, .saved-reply-head small { font-size: 14px; }
.summary-card span, .summary-card p,
.aura-current #auraTotalChange { font-size: 13px; }
.summary-card strong small { font-size: 14px; }
.chart-head h2 { font-size: 18px; }
.chart-head p, .chart-title .chart-range-summary,
.legend,
.chart-empty-state p, .chart-text-summary { font-size: 13px; }
.liked-card p, .liked-page-list .liked-card p { font-size: 15px; }
.liked-count span { font-size: 12px; }
.modal-desc, .analysis-summary, .agent-reply p,
.reply-head strong { font-size: 14px; }
.form-grid label > span, fieldset legend,
.password-form label > span, .password-heading p { font-size: 12px; }
.form-grid input, .form-grid select, .password-form input,
.agent-profile-editor select, .agent-profile-editor input { font-size: 14px; }
.agent-option, .agent-profile-identity small,
.agent-profile-editor label > span:first-child { font-size: 12px; }
.agent-profile-identity strong { font-size: 14px; }
.toast p, .form-error, .form-message,
.auth-form > div > p:last-child, .auth-form > label > span,
.auth-text-button, .auth-back-button, .auth-trust p { font-size: 13px; }
.auth-tabs button { font-size: 14px; }
.auth-form > label input { font-size: 16px; }
.auth-message-copy { font-size: 15px; }

@media (max-width: 1020px) {
  .nav-item { font-size: 15px; }
}

@media (max-width: 760px) {
  body { padding-bottom: 72px; font-size: 16px; }
  .mobile-brand strong { font-size: 19px; }
  .mobile-avatar { font-size: 13px; }
  .page-heading h1, .home-heading h1 { font-size: 28px; }
  .page-heading p, .home-heading p { font-size: 14px; line-height: 1.6; }
  .primary-button, .ghost-button { min-height: 46px; font-size: 15px; }
  .month-control strong { font-size: 19px; }
  .archive-summary { font-size: 13px; }
  .view-toggle button, .period-toggle button { min-height: 42px; font-size: 14px; }
  .date-box small { font-size: 12px; }
  .date-box strong { font-size: 28px; }
  .diary-copy h3 { font-size: 16px; }
  .diary-copy p { font-size: 14px; line-height: 1.7; }
  .emotion-chip, .emotion-chip.negative { font-size: 12px; }
  .calendar-week span, .day-number,
  .calendar-emotion, .calendar-entry-title { font-size: 12px; }
  .calendar-week, .calendar-grid { min-width: 650px; }
  #diaryContent { font-size: 16px; }
  .editor-meta { flex-direction: column; align-items: stretch; }
  .inline-weather-input { width: min(190px, 52vw); }
  .chart-range-toggle button { font-size: 14px; }
  .bottom-nav {
    height: 74px;
    border-top: 2px solid #03b854;
    background: #e7f5ed;
    box-shadow: 0 -6px 20px rgba(0, 82, 37, .14);
  }
  .bottom-nav button {
    color: #315343;
    background: #e7f5ed;
    font-size: 13px;
    font-weight: 750;
  }
  .bottom-nav button + button { border-left: 1px solid rgba(0, 120, 53, .14); }
  .bottom-nav button.active {
    color: #fff;
    background: #03a94f;
    box-shadow: inset 0 3px 0 #69eba2;
  }
  .bottom-nav-label { font-size: 13px; line-height: 1.35; }
  .auth-message-copy { font-size: 15px; }
  .auth-privacy-note { margin: 18px 0 0; font-size: 13px; }
  .login-submit-actions { grid-template-columns: minmax(0, 1fr) auto; }
  .test-login-button { min-height: 46px; font-size: 14px; }
}

/* Mobile archive: compact header and a balanced month navigator */
@media (max-width: 760px) {
  .archive-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "archive-title archive-action"
      "archive-description archive-description";
    align-items: center;
    gap: 6px 16px;
    min-height: 0;
    margin-bottom: 24px;
  }
  .archive-head > div { display: contents; }
  .archive-head h1 {
    grid-area: archive-title;
    margin: 0;
  }
  .archive-head > div > p:not(.eyebrow) {
    grid-area: archive-description;
    margin: 0;
  }
  .archive-head > .primary-button {
    grid-area: archive-action;
    width: auto;
    min-width: 96px;
    min-height: 42px;
    margin: 0;
    padding: 8px 16px;
  }
  .archive-toolbar {
    align-items: stretch;
    gap: 0;
    padding: 14px 0 0;
  }
  .archive-toolbar > div:first-child { width: 100%; }
  .month-control {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 12px;
    width: 100%;
  }
  .month-control strong { min-width: 0; }
  .month-control button {
    width: 40px;
    height: 40px;
    color: #167b43;
    background: #f2f7f4;
  }
  .month-control button:hover {
    color: #087b39;
    background: #e8f3ed;
  }
  .archive-summary {
    margin-top: 5px;
    text-align: center;
  }
  .view-toggle {
    margin: 14px 0 0;
  }
}

/* Desktop sign-in: calm journaling photography with a copy-safe veil */

/* Background diary analysis */
.analysis-progress-banner {
  position: sticky;
  top: 78px;
  z-index: 14;
  width: calc(100% - clamp(56px, 10vw, 148px));
  max-width: 1092px;
  margin: 16px auto 0;
  padding: 13px 16px 11px;
  border: 1px solid #cce7d7;
  border-radius: 10px;
  color: #24553a;
  background: rgba(242, 251, 246, .96);
  box-shadow: 0 9px 25px rgba(27, 94, 57, .1);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.analysis-progress-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.analysis-progress-spinner {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 2px solid #b9ddc8;
  border-top-color: #039849;
  border-radius: 50%;
  animation: analysis-progress-spin .85s linear infinite;
}
.analysis-progress-copy { min-width: 0; flex: 1; }
.analysis-progress-copy > strong { display: block; font-size: 14px; line-height: 1.4; }
.analysis-progress-copy p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 1px 0 0;
  color: #60766a;
  font-size: 12px;
  line-height: 1.45;
}
.analysis-progress-copy p b { color: #087c3d; white-space: nowrap; }
.analysis-progress-percent { color: #087c3d; font-size: 13px; font-weight: 800; }
.analysis-progress-track {
  height: 4px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dceee3;
}
.analysis-progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #03b854, #58cc88);
  transition: width .35s ease;
}
#saveDiary.analysis-in-progress {
  min-width: 286px;
  white-space: nowrap;
}
@keyframes analysis-progress-spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .analysis-progress-banner {
    top: 64px;
    width: calc(100% - 24px);
    margin-top: 10px;
    padding: 12px 13px 10px;
    border-radius: 6px;
  }
  .analysis-progress-main { align-items: flex-start; gap: 10px; }
  .analysis-progress-spinner { width: 18px; height: 18px; flex-basis: 18px; margin-top: 2px; }
  .analysis-progress-copy > strong { font-size: 13px; }
  .analysis-progress-copy p { display: grid; gap: 1px; font-size: 11px; }
  .analysis-progress-percent { font-size: 12px; }
  .editor-save-actions { flex-wrap: wrap; justify-content: flex-end; }
  #saveDiary.analysis-in-progress {
    width: 100%;
    min-width: 0;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .analysis-progress-spinner { animation: none; }
  .analysis-progress-track > span { transition: none; }
}
@media (min-width: 761px) {
  .auth-visual {
    background-color: #f7faf8;
    background-image:
      linear-gradient(90deg, rgba(247, 250, 248, .9) 0%, rgba(247, 250, 248, .7) 58%, rgba(247, 250, 248, .16) 100%),
      linear-gradient(180deg, rgba(247, 250, 248, .02) 64%, rgba(247, 250, 248, .78) 100%),
      url("assets/auth-journal-background.webp");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
  }
}

/* Statistics: historical psychology and philosophy perspectives */
.masters-analysis {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.masters-analysis-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.masters-analysis-head h3 {
  margin: 0;
  color: #202824;
  font-size: 20px;
  letter-spacing: -.025em;
}
.masters-analysis-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.masters-analysis-head > span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid #dbe5df;
  border-radius: 2px;
  color: #52705e;
  background: #f5f9f6;
  font-size: 12px;
  font-weight: 700;
}
.master-persona-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}
.master-persona-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 6px 11px 6px 7px;
  border: 1px solid #dce2de;
  border-radius: 8px;
  color: #606964;
  background: #fff;
  font-size: 13px;
  font-weight: 650;
}
.master-persona-tabs button.has-report::after {
  content: '✓';
  width: 17px;
  height: 17px;
  display: grid;
  flex: 0 0 17px;
  place-items: center;
  margin-left: 1px;
  border: 1px solid #a8d8ba;
  border-radius: 50%;
  color: #087d42;
  background: #eaf7ef;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.master-persona-tabs button.active.has-report::after {
  border-color: #6cbd8b;
  background: #dff3e7;
}
.master-persona-tabs button img,
.master-blend-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid #dce4df;
  border-radius: 50%;
}
.master-persona-tabs button img {
  display: block;
  object-fit: cover;
  filter: saturate(.72) contrast(.96);
}
.master-blend-mark {
  display: grid;
  place-items: center;
  color: #26734a;
  background: #e8f4ec;
  font-size: 12px;
  font-weight: 800;
}
.master-persona-tabs button:hover {
  border-color: #86b99c;
  color: #087d42;
  background: #f6faf7;
}
.master-persona-tabs button.active {
  border-color: #16aa58;
  color: #087d42;
  background: #edf8f1;
  box-shadow: inset 0 -2px 0 #03b854;
}
.master-persona-tabs button.active img,
.master-persona-tabs button.active .master-blend-mark {
  border-color: #65b784;
  filter: none;
}
.master-analysis-content { margin-top: 18px; }
.master-analysis-loading,
.master-analysis-empty {
  min-height: 150px;
  padding: 28px;
  display: grid;
  place-content: center;
  justify-items: center;
  border: 1px solid #e0e5e2;
  color: var(--muted);
  background: #f8faf9;
  text-align: center;
}
.master-analysis-loading span {
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  border: 3px solid #d7e8de;
  border-top-color: #03a94f;
  border-radius: 50%;
  animation: masterAnalysisSpin .8s linear infinite;
}
.master-analysis-loading strong,
.master-analysis-empty strong { color: #28342e; font-size: 15px; }
.master-analysis-loading p,
.master-analysis-empty p { max-width: 520px; margin: 7px 0 0; font-size: 13px; line-height: 1.65; }
.master-prompt-check { color: #087d42; }
.master-result {
  border: 1px solid #dce2de;
  background: #fff;
}
.master-result-safety { border-color: #ddb9b4; }
.master-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
  background: #fafcfb;
}
.master-result-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}
.master-result-identity > div { min-width: 0; }
.master-result-portrait {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border: 1px solid #d8e0db;
  border-radius: 50%;
  object-fit: cover;
  background: #eef2ef;
  filter: saturate(.8) contrast(.97);
}
.master-result-portrait-stack {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 2px;
  padding: 3px;
  overflow: hidden;
}
.master-result-portrait-stack img {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  object-fit: cover;
}
.master-result-head strong,
.master-result-head small { display: block; }
.master-result-head strong { color: #202824; font-size: 16px; }
.master-result-head small { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.master-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 750;
}
.master-status.positive { color: #167044; background: #e8f5ed; }
.master-status.stable { color: #52635a; background: #edf1ef; }
.master-status.variable { color: #6c5a20; background: #f7f0d9; }
.master-status.negative { color: #975044; background: #f8e8e4; }
.master-status.safety { color: #a23e38; background: #fae3e1; }
.master-flow,
.master-analysis-block,
.master-question,
.master-result-foot { padding: 20px 22px; }
.master-flow,
.master-analysis-block { border-bottom: 1px solid var(--line); }
.master-flow h4,
.master-analysis-block h4 {
  margin: 0 0 8px;
  color: #2d3832;
  font-size: 13px;
}
.master-flow p,
.master-analysis-block p {
  margin: 0;
  color: #4f5c55;
  font-size: 14px;
  line-height: 1.78;
}
.master-change-grid,
.master-reading-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  border-bottom: 1px solid var(--line);
}
.master-change-grid .master-analysis-block,
.master-reading-grid .master-analysis-block { border-bottom: 0; }
.master-change-grid .master-analysis-block + .master-analysis-block,
.master-reading-grid .master-analysis-block + .master-analysis-block { border-left: 1px solid var(--line); }
.master-analysis-block ul,
.master-analysis-block ol {
  margin: 0;
  padding-left: 20px;
  color: #4f5c55;
  font-size: 14px;
  line-height: 1.7;
}
.master-analysis-block li + li { margin-top: 5px; }
.master-improved { background: #fbfdfb; }
.master-worsened { background: #fdfbfb; }
.master-confrontation { background: #fffaf7; }
.master-actions { background: #f5faf7; }
.master-question {
  display: grid;
  gap: 7px;
  border-bottom: 1px solid var(--line);
  background: #f8faf9;
}
.master-question span { color: #657169; font-size: 12px; font-weight: 700; }
.master-question strong { color: #213129; font-size: 15px; line-height: 1.65; }
.master-result-foot { color: #737c77; background: #fafbfa; }
.master-result-foot p { margin: 0; font-size: 12px; line-height: 1.65; }
.master-result-foot p + p { margin-top: 4px; }
.master-result-foot b { color: #4d5c54; }
@keyframes masterAnalysisSpin { to { transform: rotate(360deg); } }
.chart-text-summary.is-loading { opacity: .68; }

@media (max-width: 760px) {
  .masters-analysis { margin-top: 24px; padding-top: 24px; }
  .masters-analysis-head { display: block; }
  .masters-analysis-head h3 { font-size: 18px; }
  .masters-analysis-head > span { display: inline-block; margin-top: 12px; }
  .master-persona-tabs {
    flex-wrap: nowrap;
    margin-left: -20px;
    margin-right: -20px;
    padding: 0 20px 5px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .master-persona-tabs::-webkit-scrollbar { display: none; }
  .master-persona-tabs button { flex: 0 0 auto; min-height: 42px; font-size: 13px; }
  .master-result-head { align-items: flex-start; padding: 17px 16px; }
  .master-result-identity { align-items: flex-start; gap: 10px; }
  .master-result-portrait { width: 46px; height: 46px; flex-basis: 46px; }
  .master-result-portrait-stack { padding: 3px; }
  .master-result-portrait-stack img { width: 18px; height: 18px; }
  .master-status { margin-top: 1px; }
  .master-flow,
  .master-analysis-block,
  .master-question,
  .master-result-foot { padding: 17px 16px; }
  .master-change-grid,
  .master-reading-grid { grid-template-columns: 1fr; }
  .master-change-grid .master-analysis-block + .master-analysis-block,
  .master-reading-grid .master-analysis-block + .master-analysis-block {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .master-flow p,
  .master-analysis-block p,
  .master-analysis-block ul,
  .master-analysis-block ol { font-size: 14px; }
  .master-analysis-loading,
  .master-analysis-empty { min-height: 140px; padding: 24px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .master-analysis-loading span { animation: none; }
}

/* Mobile statistics: fit the complete chart inside the card without horizontal scrolling. */
@media (max-width: 760px) {
  .chart-card .chart-wrap {
    width: 100%;
    height: 300px;
    overflow: hidden;
  }
  .chart-wrap svg {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100%;
  }
}
