@charset "UTF-8";
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable.css");
@import url("https://fonts.googleapis.com/css2?family=Gowun+Batang:wght@400;700&display=swap");

:root {
  color-scheme: light;
  --paper: #f4f1e9;
  --paper-deep: #eae5da;
  --surface: #fbfaf6;
  --surface-raised: #fffefa;
  --surface-inset: #f3f1e9;
  --sidebar: #eeece3;
  --ink: #252b25;
  --ink-soft: #515a51;
  --muted: #626b62;
  --line: #d9d8cd;
  --line-soft: #e7e5db;
  --forest: #315d4d;
  --forest-deep: #274c3e;
  --forest-wash: #e8eee8;
  --accent: #805d38;
  --accent-soft: #f1e9dd;
  --danger: #8f4439;
  --danger-wash: #f5e9e4;
  --good: #35664d;
  --focus: #8b633b;
  --shadow-card: 0 22px 56px rgb(42 43 34 / 6%), 0 2px 8px rgb(42 43 34 / 3%);
  --shadow-float: 0 26px 72px rgb(17 24 20 / 22%);
  --serif: "Gowun Batang", "AppleMyungjo", "Noto Serif KR", "Batang", serif;
  --sans: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  --text-xs: .74rem;
  --text-sm: .86rem;
  --text-base: 1rem;
  --text-lg: 1.16rem;
  --text-xl: 1.5rem;
  --text-display: clamp(2.6rem, 4.6vw, 4.3rem);
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --radius-sm: 9px;
  --radius-md: 17px;
  --radius-lg: 26px;
  --radius-pill: 999px;
  --motion-fast: 150ms ease;
  --motion-base: 240ms cubic-bezier(.2,.7,.2,1);
  --element-water: #344f68;
  --element-fire: #a95740;
  --element-wood: #58745e;
  --element-earth: #95733b;
  --element-metal: #817e73;
  --element-surface: #fbfaf6;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #131815;
    --paper-deep: #191f1b;
    --surface: #1d2421;
    --surface-raised: #232c27;
    --surface-inset: #171e1a;
    --sidebar: #171d19;
    --ink: #edf0ea;
    --ink-soft: #c6cec4;
    --muted: #a8b1a7;
    --line: #36423a;
    --line-soft: #2b352f;
    --forest: #86aa95;
    --forest-deep: #a1c0ac;
    --forest-wash: #25372d;
    --accent: #d1b58a;
    --accent-soft: #30271d;
    --danger: #e9a093;
    --danger-wash: #33231f;
    --good: #9bc6a8;
    --focus: #e5c28f;
    --shadow-card: 0 22px 56px rgb(0 0 0 / 18%), 0 2px 8px rgb(0 0 0 / 12%);
    --shadow-float: 0 26px 72px rgb(0 0 0 / 55%);
    --element-water: #91a9c1;
    --element-fire: #d08a73;
    --element-wood: #9dbda5;
    --element-earth: #d0b473;
    --element-metal: #c2baa9;
    --element-surface: #1d2421;
  }
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; scrollbar-color: var(--line) var(--paper); }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--text-base)/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 15px; color: var(--ink); background: var(--surface-raised); font-size: var(--text-sm); line-height: 1.35; cursor: pointer; transition: border-color var(--motion-fast), background-color var(--motion-fast), color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast); }
button:hover { border-color: color-mix(in srgb, var(--forest) 38%, var(--line)); background: var(--surface-inset); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .52; cursor: not-allowed; transform: none; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 62%, transparent); text-underline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); }
h2 { font: 400 var(--text-xl)/1.45 var(--serif); letter-spacing: -.035em; }
h3 { font: 400 var(--text-lg)/1.5 var(--serif); }
p { overflow-wrap: anywhere; word-break: keep-all; }
small, .muted, .method-hint { color: var(--muted); }
small { font-size: var(--text-xs); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.icon { display: inline-block; width: 18px; height: 18px; flex: 0 0 auto; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { width: 44px; min-width: 44px; padding: 0; border-color: transparent; background: transparent; }
.icon-button:hover { border-color: var(--line); background: var(--surface-raised); }
.primary { border-color: var(--forest); color: #fff; background: var(--forest); font-weight: 600; letter-spacing: .01em; }
.primary:hover { border-color: var(--forest-deep); color: #fff; background: var(--forest-deep); box-shadow: 0 7px 18px rgb(33 75 59 / 15%); }
@media (prefers-color-scheme: dark) {
  .primary { color: #17221b; }
  .primary:hover { color: #152019; }
}
.text-button { border-color: transparent; padding: 8px 7px; color: var(--muted); background: transparent; font-size: var(--text-xs); }
.text-button:hover { border-color: transparent; color: var(--ink); background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.danger { color: var(--danger) !important; }
.quiet-button { border-color: transparent; padding: 8px 11px; background: transparent; }
.quiet-button:hover { border-color: var(--line-soft); background: var(--surface-raised); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); font-size: 10px; font-weight: 650; letter-spacing: .2em; line-height: 1.5; text-transform: uppercase; }
.tag { color: var(--muted); font-size: var(--text-xs); }
.method-hint { font-size: var(--text-xs); line-height: 1.8; }
summary { position: relative; min-height: 44px; padding: 11px 34px 11px 0; color: var(--ink-soft); font-size: var(--text-sm); font-weight: 550; line-height: 1.5; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
details > summary::after { position: absolute; top: 50%; right: 8px; width: 8px; height: 8px; margin-top: -6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; content: ""; transform: rotate(45deg); transition: transform var(--motion-fast), margin var(--motion-fast); }
details[open] > summary::after { margin-top: -2px; transform: rotate(225deg); }
details > summary { transition: color var(--motion-fast); }
details > summary:hover { color: var(--ink); }

/* 상담 서랍과 고정 상단 */
.shell { display: grid; grid-template-columns: 276px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; z-index: 10; top: 0; display: flex; width: 276px; height: 100dvh; min-height: 0; flex-direction: column; gap: 23px; overflow: auto; border-right: 1px solid var(--line-soft); padding: 32px 22px 22px; background: var(--sidebar); transition: transform var(--motion-base), opacity var(--motion-base); }
.brand { display: inline-flex; min-height: 54px; align-items: center; gap: 13px; color: var(--ink); text-decoration: none; }
.tuna-seal { display: inline-flex; width: 48px; height: 48px; flex: none; align-items: center; justify-content: center; overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line)); border-radius: 50%; background: var(--surface-raised); }
.tuna-seal img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-wordmark { display: block; font: 400 19px/1.25 var(--serif); letter-spacing: -.045em; }
.brand-wordmark small { display: block; margin-top: 5px; color: var(--muted); font: 600 9px/1.4 var(--sans); letter-spacing: .24em; }
#new-session { width: 100%; box-shadow: 0 8px 18px rgb(37 73 57 / 10%); }
.aside-heading { margin: 3px 0 -11px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .17em; text-transform: uppercase; }
.history-tabs { display: flex; gap: 3px; margin-top: -11px; border: 1px solid var(--line); border-radius: 11px; padding: 3px; background: var(--surface-inset); }
.history-tabs > button { min-height: 36px; flex: 1; border: 0; padding: 6px 8px; background: transparent; font-size: 11px; }
.history-tabs > button[aria-selected="true"] { color: var(--ink); background: var(--surface-raised); box-shadow: 0 1px 4px rgb(22 31 25 / 9%); }
.friend-account-tabs { display: flex; flex: 0 0 auto; flex-wrap: nowrap; gap: 6px; min-width: 0; overflow-x: auto; margin-top: -12px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); scrollbar-width: thin; }
.friend-account-tab { min-height: 36px; flex: 0 0 auto; padding: 6px 9px; font-size: 10px; white-space: nowrap; }
.friend-account-tab[aria-selected="true"] { border-color: var(--forest); color: #fff; background: var(--forest); }
.friend-account-picker { display: grid; flex: 0 0 auto; gap: 6px; margin-top: -12px; }
.friend-account-picker select { min-height: 40px; font-size: 12px; }
@media (min-width: 721px) { .friend-account-tabs { display: none; } }
@media (max-width: 720px) { .friend-account-picker { display: none; } }
#history { display: flex; flex: 1 1 160px; min-height: 128px; flex-direction: column; gap: 5px; overflow: auto; scrollbar-width: thin; }
#history > * { flex-shrink: 0; }
.history-entry { display: flex; align-items: center; gap: 3px; }
.history-entry > button:first-child { min-width: 0; min-height: 54px; flex: 1; justify-content: flex-start; border-color: transparent; padding: 8px 10px; text-align: left; background: transparent; }
.history-entry > button:first-child:hover { border-color: var(--line-soft); background: color-mix(in srgb, var(--surface-raised) 72%, transparent); }
.history-entry > button.selected { border-color: var(--line); color: var(--ink); background: var(--surface-raised); box-shadow: 0 2px 8px rgb(30 38 31 / 5%); }
.history-entry span, .history-entry small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-entry span { font-size: 11px; font-weight: 550; }
.history-entry small { margin-top: 3px; font-size: 9px; }
.history-delete { width: 36px; min-width: 36px; min-height: 36px; border-color: transparent; padding: 3px; color: var(--muted); background: transparent; font-size: 9px; }
.empty { color: var(--muted); font-size: var(--text-xs); }
.aside-bottom { margin-top: auto; border-top: 1px solid var(--line-soft); padding-top: 19px; color: var(--muted); font-size: var(--text-xs); }
.aside-bottom > p { margin-bottom: 12px; color: var(--ink-soft); font: 400 13px/1.85 var(--serif); }
.aside-bottom > button { display: flex; min-height: 36px; justify-content: flex-start; }
.privacy-link { display: inline-block; margin-top: 10px; color: var(--muted); font-size: 10px; }
.sidebar-shade { display: none; }
main { position: relative; width: 100%; max-width: 1300px; min-width: 0; margin: 0 auto; padding: 0 clamp(26px, 6vw, 84px) 34px; }
.appbar { position: sticky; z-index: 12; top: 0; display: flex; min-height: 76px; align-items: center; gap: 10px; margin: 0 0 9px; border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(16px); }
#toggle-sidebar { display: inline-flex; }
.persona-trigger { min-width: 0; margin-right: auto; border: 0; padding: 7px 4px; text-align: left; background: transparent; }
.persona-trigger:hover { border-color: transparent; background: transparent; }
.persona-trigger strong { display: block; color: var(--ink); font: 400 15px/1.35 var(--serif); }
.persona-trigger small { display: block; max-width: 245px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.chevron { display: inline-flex; margin-left: 4px; color: var(--muted); }
.avatar { display: inline-flex; width: 42px; height: 42px; flex: none; align-items: center; justify-content: center; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 50%; color: var(--accent); background: var(--accent-soft); font: 400 18px/1 var(--serif); }
.avatar.daon { border-color: #ac8171; color: #875746; background: #efe3dd; }
.avatar.idam { border-color: #708690; color: #466470; background: #e4ecee; }
@media (prefers-color-scheme: dark) {
  .avatar.daon { border-color: #8e6d60; color: #e4b8a9; background: #372c28; }
  .avatar.idam { border-color: #637780; color: #b6ced5; background: #243137; }
}
.avatar.small { width: 34px; height: 34px; font-size: 16px; }
.persona-trigger:disabled { opacity: 1; cursor: default; }
.connected { color: var(--good); }
#connection-dot { display: inline-flex; margin-left: 4px; color: var(--good); }
#connection-dot .icon { width: 11px; height: 11px; }
.appbar .quiet-button { white-space: nowrap; }
#scroll-top { display: none; }
.page-scrolled #scroll-top { display: inline-flex; }
.sidebar-collapsed .shell { grid-template-columns: minmax(0, 1fr); }
.sidebar-collapsed .sidebar { display: none; }

/* 첫 화면과 출생 정보 */
.welcome { position: relative; display: grid; min-height: 254px; align-content: center; padding: 52px 0 41px; }
.welcome::after { position: absolute; top: 54px; right: 5%; width: 1px; height: 116px; background: linear-gradient(transparent, var(--line), transparent); content: ""; }
.welcome .eyebrow::before { width: 24px; height: 1px; background: var(--accent); content: ""; }
.welcome h1 { max-width: 15em; margin: 15px 0 13px; color: var(--ink); font: 400 var(--text-display)/1.37 var(--serif); letter-spacing: -.075em; }
.welcome p { max-width: 36em; margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.95; }
#notice { margin: 0 0 20px; border: 1px solid color-mix(in srgb, var(--danger) 32%, var(--line)); border-radius: var(--radius-sm); padding: 13px 16px; color: var(--danger); background: var(--danger-wash); font-size: var(--text-sm); }
.card { position: relative; margin-bottom: 22px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: clamp(22px, 3vw, 34px); background: var(--surface); box-shadow: var(--shadow-card); }
.provider-panel { margin: 0 0 18px; border-color: var(--line-soft); border-radius: 13px; padding: 5px 16px; background: transparent; box-shadow: none; font-size: var(--text-sm); }
.provider-panel > summary { font-size: var(--text-xs); }
#server-status { display: inline-block; margin-left: 8px; color: var(--muted); font-size: 10px; font-weight: 400; }
.connection { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 14px; }
.connection small { overflow-wrap: anywhere; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.section-head h2 { margin: 7px 0 0; }
.section-head > div:last-child { display: flex; align-items: center; gap: 12px; }
#birth-panel { overflow: visible; }
#birth-panel::before { position: absolute; top: -1px; right: 32px; left: 32px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); content: ""; }
#birth-panel > .section-head h2 { font-size: 22px; line-height: 1.55; }
#birth-form { display: grid; gap: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 22px; }
label { display: grid; gap: 8px; color: var(--ink-soft); font-size: 11px; font-weight: 600; letter-spacing: .015em; }
input, select, textarea { width: 100%; min-width: 0; min-height: 48px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; outline: 0; color: var(--ink); background: var(--surface-raised); font-size: var(--text-sm); transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background-color var(--motion-fast); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--forest) 38%, var(--line)); }
input:focus, select:focus, textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px color-mix(in srgb, var(--forest) 13%, transparent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .9; }
input:disabled, select:disabled, textarea:disabled { opacity: .58; cursor: not-allowed; }
input[type="number"] { font-variant-numeric: tabular-nums; }
.date-fields { display: grid; grid-template-columns: 1.3fr .8fr .8fr; gap: 7px; }
.date-label { align-self: start; }
.date-fields { align-items: start; }
.date-fields input { height: 48px; }
.date-fields input { min-width: 0; text-align: center; }
.check { display: flex; min-height: 36px; flex-direction: row; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 11px; font-weight: 500; letter-spacing: 0; cursor: pointer; }
.check input { position: relative; width: 19px; height: 19px; min-height: 19px; flex: none; appearance: none; border: 1px solid #8b9288; border-radius: 5px; padding: 0; background: var(--surface-raised); cursor: pointer; }
.check input::after { position: absolute; top: 4px; left: 3px; width: 10px; height: 5px; border-bottom: 2px solid #fff; border-left: 2px solid #fff; content: ""; opacity: 0; transform: rotate(-45deg); }
.check input:checked { border-color: var(--forest); background: var(--forest); }
.check input:checked::after { opacity: 1; }
.unknown-time-check { width: fit-content; margin: 3px 0 0; }
.unknown-time-check input { width: 35px; height: 19px; border-radius: var(--radius-pill); }
.unknown-time-check input::after { top: 4px; left: 4px; width: 9px; height: 9px; border: 0; border-radius: 50%; background: #fff; opacity: 1; transform: none; transition: transform var(--motion-fast); }
.unknown-time-check input:checked::after { transform: translateX(15px); }
.options { display: flex; flex-wrap: wrap; gap: 7px 20px; margin: -2px 0 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 11px 0; }
.advanced { border-top: 1px solid var(--line-soft); padding-top: 8px; }
.advanced > summary { font-size: var(--text-xs); }
.advanced > p { color: var(--muted); font-size: 10px; line-height: 1.8; }
.place-picker { position: relative; grid-column: 1 / -1; }
.place-results { position: absolute; z-index: 15; top: 100%; right: 0; left: 0; max-height: 300px; margin-top: 7px; overflow: auto; border: 1px solid var(--line); border-radius: 13px; padding: 5px; background: var(--surface-raised); box-shadow: var(--shadow-card); }
.place-option { display: flex; width: 100%; min-height: 48px; align-items: center; justify-content: space-between; gap: 16px; border-color: transparent; padding: 8px 11px; text-align: left; background: transparent; }
.place-option:hover { border-color: transparent; background: var(--surface-inset); }
.place-option strong { font-size: var(--text-sm); font-weight: 550; }
.place-option small { max-width: 55%; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.place-results > p { margin: 0; padding: 12px; font-size: var(--text-xs); }
.place-selection { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.duration-input { display: flex; align-items: center; gap: 10px; }
.duration-input span { color: var(--muted); font-size: var(--text-sm); }
.form-footer { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 18px; }
#preview-status { color: var(--muted); font-size: 11px; }
#preview-status:empty { display: none; }
.form-footer .primary { min-width: 190px; }

/* 명식 원국과 오행 분포 */
.chart-drawer { margin: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0 1px; scroll-margin-top: 86px; }
.chart-drawer > summary { min-height: 56px; padding-block: 16px; color: var(--ink); font: 400 var(--text-sm)/1.5 var(--serif); }
#chart-mini { display: inline-block; margin-left: 12px; color: var(--muted); font: 400 10px/1.5 var(--sans); }
.chart-inside { padding: 10px 0 20px; }
.chart-inside > .section-head h2 { margin-top: 4px; font-size: 20px; }
#chart-heading { max-width: 100%; overflow-wrap: normal; word-break: keep-all; font-variant-numeric: tabular-nums; }
.pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; direction: ltr; }
.pillar { min-width: 0; border: 1px solid var(--line-soft); border-radius: 13px; padding: 15px 10px 13px; text-align: center; background: var(--surface); transition: border-color var(--motion-fast), transform var(--motion-fast); }
.pillar.day { border-color: color-mix(in srgb, var(--accent) 48%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 56%, var(--surface)); box-shadow: inset 0 2px var(--accent); }
.pillar .label { display: block; margin-bottom: 11px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .13em; }
.pillar.day .label { color: var(--accent); }
.pillar-glyphs { display: grid; gap: 7px; }
.pillar-glyph { position: relative; display: grid; min-width: 0; min-height: 74px; align-content: center; justify-items: center; gap: 1px; border: 1px solid var(--line-soft); border-radius: 8px; padding: 7px 3px; background: var(--surface-raised); }
.pillar-glyph.stem { border-bottom-color: color-mix(in srgb, var(--element-color, var(--line)) 46%, var(--line)); }
.pillar-glyph.branch { background: var(--surface-inset); }
.pillar-glyph .glyph-kind { color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.pillar-glyph .hanja { color: var(--element-color, var(--ink)); font: 400 30px/1.25 var(--serif); }
.pillar-glyph .hangul { color: var(--ink-soft); font-size: 10px; }
.pillar-glyph[data-element="목"] { --element-color: var(--element-wood); }
.pillar-glyph[data-element="화"] { --element-color: var(--element-fire); }
.pillar-glyph[data-element="토"] { --element-color: var(--element-earth); }
.pillar-glyph[data-element="금"] { --element-color: var(--element-metal); }
.pillar-glyph[data-element="수"] { --element-color: var(--element-water); }
.pillar-glyph.unknown { border-style: dashed; color: var(--muted); background: var(--surface-inset); }
.pillar .god, .pillar .hidden { margin-top: 8px; color: var(--muted); font-size: 9px; line-height: 1.55; overflow-wrap: anywhere; }
.pillar .hidden { margin-top: 4px; }
.unknown-pillar { margin-top: 6px; color: var(--muted); font-size: 9px; }
.chart-summary { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, .9fr) minmax(245px, 1.25fr); gap: 12px; margin: 15px 0 8px; }
.chart-summary > div { min-width: 0; border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 15px; background: var(--surface); }
.chart-summary > div:not(:last-child) { display: flex; min-height: 0; flex-direction: column; justify-content: center; }
.chart-summary > div > span { display: block; color: var(--muted); font-size: 10px; font-weight: 550; }
.chart-summary > div > strong { display: block; margin-top: 8px; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.6; }
.element-table { width: 100%; margin-top: 8px; border-collapse: separate; border-spacing: 0 3px; text-align: left; }
.element-table caption { padding-bottom: 5px; color: var(--muted); font-size: 9px; text-align: left; }
.element-table th, .element-table td { padding: 2px 0; font-size: 10px; font-weight: 450; }
.element-table th { width: 46px; color: var(--ink-soft); }
.element-table td.element-track-cell { padding-right: 9px; }
.element-row { --element-count: attr(data-count type(<number>), 8); outline-offset: 2px; }
.element-row:focus-visible { outline: 2px solid var(--focus); }
.element-name { display: inline-flex; align-items: center; gap: 6px; }
.element-swatch { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--element-color); }
.element-track { display: block; height: 5px; overflow: visible; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--ink) 8%, var(--element-surface)); }
.element-fill { display: block; width: min(100%, calc(var(--element-count, 8) * 12.5%)); height: 5px; min-width: 0; border-radius: 0 4px 4px 0; background: var(--element-color); transition: width 420ms cubic-bezier(.2,.7,.2,1); }
.element-row[data-element="수"] { --element-color: var(--element-water); }
.element-row[data-element="화"] { --element-color: var(--element-fire); }
.element-row[data-element="목"] { --element-color: var(--element-wood); }
.element-row[data-element="토"] { --element-color: var(--element-earth); }
.element-row[data-element="금"] { --element-color: var(--element-metal); }
.element-value { width: 17px; color: var(--ink-soft); font-variant-numeric: tabular-nums; text-align: right; }
.method-display { margin: 11px 1px 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.evidence { margin: 17px 0 0; border-radius: 11px; padding: 8px 15px; background: transparent; box-shadow: none; font-size: var(--text-xs); }
.evidence p, .evidence li { color: var(--ink-soft); font-size: 10px; line-height: 1.8; }
.evidence h3 { margin: 14px 0 4px; font: 500 12px/1.5 var(--sans); }
.evidence pre { max-width: 100%; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.cycles { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.cycle { flex: none; border: 1px solid var(--line-soft); border-radius: 7px; padding: 8px 10px; color: var(--ink-soft); background: var(--surface-inset); font-size: 9px; white-space: pre; }

/* 상담 대화와 답변 */
.chat-welcome { margin: 34px auto 30px; padding: 23px 0 30px; text-align: center; }
.chat-welcome .eyebrow { justify-content: center; }
.chat-welcome h2 { max-width: 25em; margin: 13px auto 8px; font-size: 25px; line-height: 1.55; }
.chat-welcome > p:not(.eyebrow) { color: var(--muted); font-size: 12px; }
.starter-grid { display: grid; max-width: 690px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 23px auto 0; }
.starter-grid .fortune-guide-entry { grid-column: 1 / -1; }
.starter-card { display: flex; min-height: 64px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; border-color: var(--line-soft); border-radius: 12px; padding: 10px 14px; text-align: left; background: var(--surface); }
.starter-card:hover { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); background: var(--accent-soft); }
.starter-card span { color: var(--ink); font: 400 13px/1.55 var(--serif); }
.starter-card small { font-size: 10px; line-height: 1.45; }
.friend-view-note { margin: 12px 0; border-bottom: 1px solid var(--line); padding: 10px 0; color: var(--forest-deep); font-size: var(--text-xs); }
.turn-group { min-width: 0; margin: 0 0 39px; }
.message { min-width: 0; }
.message-label { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; color: var(--muted); font-size: 10px; }
.message-label .delete-turn { margin-left: 2px; }
.message.user { width: fit-content; max-width: min(78%, 34rem); margin: 28px 0 25px auto; border: 1px solid color-mix(in srgb, var(--forest) 22%, var(--line)); border-radius: 17px 17px 5px 17px; padding: 10px 15px 11px; color: var(--ink); background: var(--forest-wash); font-size: var(--text-sm); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user .message-label { justify-content: flex-end; margin-bottom: 3px; color: var(--muted); }
.delete-turn { min-height: 30px; padding: 3px 0 3px 8px; font-size: 9px; }
.message.answer { width: 100%; }
.answer-identity { display: flex; max-width: 34rem; align-items: center; gap: 10px; margin-bottom: 17px; border-bottom: 1px solid var(--line-soft); padding-bottom: 12px; color: var(--ink); }
.answer-identity strong { font: 400 14px/1.4 var(--serif); }
.answer-identity .muted { margin-left: 1px; color: var(--muted); font-size: 10px; }
.reading-copy { max-width: 34em; color: var(--ink); font: 400 17px/1.95 var(--serif); letter-spacing: -.006em; }
.reading-copy p { margin: 0 0 1.2em; }
.reading-copy h3, .reading-subtitle { margin: 1.7em 0 .5em; color: var(--ink); font: 400 19px/1.65 var(--serif); letter-spacing: -.025em; }
.reading-copy strong { color: var(--forest-deep); font-weight: 700; }
.reading-finale { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 17px; }
.answer-actions { display: flex; flex-wrap: wrap; gap: 5px; margin: 11px 0 3px; }
.message-time { display: inline-block; color: var(--muted); font: 400 11px/1.6 var(--sans); font-variant-numeric: tabular-nums; }
.message-label { flex-wrap: wrap; }
.answer-actions { align-items: center; }
.answer-actions .message-time { margin-right: 6px; }
.copy-button { min-height: 36px; border-color: transparent; padding: 6px 9px; color: var(--muted); background: transparent; font-size: 10px; }
.copy-button:hover { color: var(--ink); background: var(--surface-inset); }
.copy-button .icon { width: 14px; height: 14px; }
.reading-details { margin: 10px 0 17px; color: var(--muted); font: 10px/1.75 var(--sans); }
.reading-details > summary { width: fit-content; min-height: 38px; padding: 8px 25px 8px 0; color: var(--muted); font-size: 10px; font-weight: 550; }
.reading-details > summary::after { right: 7px; width: 6px; height: 6px; margin-top: -5px; }
.reading-details[open] > summary { color: var(--ink-soft); }
.detail-copy { max-width: min(100%, 58rem); margin-top: 10px; border: 1px solid var(--line-soft); border-radius: 11px; padding: 15px 17px; color: var(--ink-soft); background: var(--surface-inset); font: 11px/1.85 var(--sans); white-space: pre-wrap; overflow-wrap: anywhere; }
.reading-details > summary .copy-button { min-height: 30px; margin: -3px 0 -3px 6px; padding: 4px 7px; font-size: 9px; vertical-align: middle; }
.reading-details > summary:has(.copy-button)::after { margin-left: 3px; }
.action-note p { margin: 10px 0; }
.followup-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 18px 0 10px; }
.followup-chips > small { width: 100%; margin-bottom: 2px; font-size: 10px; }
.question-chip { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; border-color: var(--line); border-radius: var(--radius-pill); padding: 7px 12px; color: var(--ink-soft); background: var(--surface); font-size: 10px; white-space: nowrap; }
.question-chip:hover { border-color: color-mix(in srgb, var(--forest) 43%, var(--line)); color: var(--ink); background: var(--forest-wash); }
.question-chip .icon { width: 14px; height: 14px; }
.all-guides { border-color: color-mix(in srgb, var(--forest) 34%, var(--line)); }
.guide-insight { max-width: 34rem; margin: 13px 0 22px; border-left: 2px solid var(--accent); padding: 5px 0 6px 15px; }
.guide-insight > strong { display: block; margin: 6px 0; font: 400 14px/1.5 var(--serif); }
.guide-insight > p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.8; }
.pending, .message.error { position: relative; max-width: 34rem; margin: 20px 0; border: 1px solid var(--line-soft); border-radius: 13px; padding: 13px 16px; background: var(--surface); }
.pending::before { position: absolute; top: 17px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); content: ""; animation: waiting-pulse 1.8s ease-in-out infinite; }
.pending > div:last-child, .message.error > div:last-child { color: var(--ink-soft); font-size: 11px; line-height: 1.8; white-space: pre-line; }
.pending > .message-label { color: var(--ink); font-weight: 600; }
.message.error { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); color: var(--danger); background: var(--danger-wash); }
.message.error .message-label { color: var(--danger); }
@keyframes waiting-pulse { 0%, 100% { opacity: .42; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
.question-guides { display: flex; min-width: 0; grid-column: 1 / -1; grid-row: 1; gap: 7px; overflow-x: auto; padding: 1px 1px 4px; scrollbar-width: none; }
.question-guides::-webkit-scrollbar { display: none; }
.question-guides .question-chip { min-height: 36px; padding: 6px 11px; }
.composer .guide-hint { display: block; grid-column: 1 / -1; grid-row: 2; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.composer-advanced { grid-column: 1 / -1; grid-row: 6; }
.composer-advanced > summary { display: inline-flex; min-height: 34px; align-items: center; padding-block: 5px; color: var(--muted); font-size: 10px; font-weight: 450; }
.composer-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 2px 0 9px; }
.composer-options label { font-size: 10px; }
.composer-options select { min-height: 42px; font-size: 11px; }
.composer > .sr-only { grid-column: 1 / -1; }
.composer { position: sticky; z-index: 8; bottom: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; margin: 27px calc(-1 * clamp(26px, 6vw, 84px)) 0; border-top: 1px solid var(--line); padding: 10px clamp(26px, 6vw, 84px) max(12px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 -12px 30px color-mix(in srgb, var(--paper) 80%, transparent); backdrop-filter: blur(18px); }
.composer textarea { min-height: 48px; max-height: 160px; grid-column: 1; grid-row: 4; align-self: end; resize: none; border-radius: 12px; padding: 12px 14px; line-height: 1.5; }
.composer .form-footer { display: contents; }
.composer #generation-status { grid-column: 1 / -1; grid-row: 3; align-self: center; margin: 0; color: var(--muted); font-size: 10px; pointer-events: none; }
.composer .keyboard-hint { grid-column: 1; grid-row: 5; align-self: center; margin: 1px 0 0; color: var(--muted); font-size: 9px; }
.composer #send { min-width: 84px; min-height: 48px; grid-column: 2; grid-row: 4; align-self: end; white-space: nowrap; }
.composer #send .icon { width: 17px; height: 17px; }
.composer.is-busy #generation-status { display: block; }
.latest-jump { position: fixed; z-index: 9; right: max(24px, calc((100vw - 276px - 1300px) / 2 + 84px)); bottom: calc(var(--composer-height, 120px) + 16px + env(safe-area-inset-bottom)); border-color: var(--line); border-radius: var(--radius-pill); padding: 8px 13px; background: var(--surface-raised); box-shadow: var(--shadow-card); }
.latest-jump .icon { width: 15px; height: 15px; }
#comparison-panel { margin: 29px 0 25px; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 12px 0 0; background: transparent; box-shadow: none; font-size: var(--text-sm); }
#comparison-panel > summary { font-size: 11px; }
.comparison-result { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 15px; }
.review-card label { margin-top: 10px; }
footer { margin-top: 44px; border-top: 1px solid var(--line-soft); padding: 19px 0 4px; color: var(--muted); font-size: 10px; line-height: 1.9; }
footer a { color: var(--ink-soft); text-decoration: none; }

/* 질문 모음, 인물 선택, 접속 관리 */
dialog { width: min(720px, calc(100vw - 36px)); max-width: 100%; max-height: min(86dvh, 900px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 34px); color: var(--ink); background: var(--surface-raised); box-shadow: var(--shadow-float); }
dialog::backdrop { background: rgb(12 17 14 / 60%); backdrop-filter: blur(7px); }
#access-dialog { width: min(820px, calc(100vw - 36px)); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.dialog-head h2 { margin: 4px 0; font-size: 22px; }
.dialog-head .icon-button { margin: -6px -7px 0 0; }
dialog > .muted { margin: 7px 0 20px; font-size: var(--text-xs); line-height: 1.8; }
.library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.library-grid .starter-card span { font-size: 13px; }
.persona-card { display: flex; width: 100%; min-height: 76px; align-items: center; justify-content: flex-start; gap: 15px; margin: 9px 0; border-color: var(--line); border-radius: 14px; padding: 14px 16px; text-align: left; background: var(--surface); }
.persona-card > span:last-child { display: grid; gap: 5px; }
.persona-card > span:last-child strong { font: 400 13px/1.55 var(--serif); }
.persona-card.active { border-color: color-mix(in srgb, var(--forest) 60%, var(--line)); background: var(--forest-wash); box-shadow: inset 3px 0 var(--forest); }
.persona-card small { display: block; color: var(--muted); font-size: 10px; line-height: 1.65; }
#persona-dialog > small { display: block; margin-top: 17px; font-size: 10px; }
#compatibility-dialog form { display: grid; gap: 15px; }
#partner-error { color: var(--danger); }
#sharing-address { overflow-wrap: anywhere; font-size: var(--text-xs); }
.shared-ai-panel { margin: 14px 0; border: 1px solid var(--line-soft); border-radius: 12px; padding: 7px 14px; background: var(--surface); }
.shared-ai-panel > summary { font-size: var(--text-sm); }
.auth-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0; }
.auth-actions a { display: inline-flex; min-height: 44px; align-items: center; font-size: var(--text-xs); }
#model-save-state { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; }
#invite-form { display: grid; gap: 13px; margin: 20px 0; }
#invite-result-label { margin-top: 16px; }
#copy-invite { margin-top: 9px; }
.owner-invite, .security-panel, #blocked-members { margin: 14px 0; border: 1px solid var(--line-soft); border-radius: 12px; padding: 7px 14px; background: var(--surface); }
.owner-invite > summary, .security-panel > summary, #blocked-members > summary { font-weight: 550; }
.security-panel > button { min-height: 38px; margin: 9px 6px 8px 0; font-size: 10px; }
#members { display: grid; gap: 8px; margin-top: 18px; }
.member-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.member-row > span { flex-basis: 100%; color: var(--ink); }
.member-expiry { width: 100%; }
.member-expiry > summary { min-height: 38px; font-size: 10px; }
.member-expiry input { max-width: 180px; }
.security-event { border-top: 1px solid var(--line-soft); padding: 8px 0; }
.security-event p { margin: 7px 0; color: var(--ink-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.presence-indicator { display: inline-grid; width: 20px; height: 20px; flex: none; place-items: center; margin-right: 6px; border: 1px solid var(--line-soft); border-radius: 50%; color: var(--muted); background: var(--surface-inset); vertical-align: middle; }
.presence-indicator.is-online { border-color: color-mix(in srgb, var(--good) 50%, var(--line)); color: var(--good); background: color-mix(in srgb, var(--good) 11%, var(--surface)); }
.presence-indicator .icon { width: 11px; height: 11px; }
.member-expiry button, #blocked-members button { min-height: 38px; }

/* 초대 진입과 개인정보 안내 */
body.login-page, body:has(> .login-card) { display: grid; min-height: 100dvh; place-items: center; overflow-x: hidden; padding: max(24px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom)); background: radial-gradient(ellipse at 50% 5%, color-mix(in srgb, var(--accent-soft) 75%, transparent), transparent 42%), var(--paper); }
.login-card { position: relative; width: min(100%, 480px); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 45px clamp(25px, 7vw, 48px) 37px; background: var(--surface); box-shadow: var(--shadow-card); text-align: center; }
.login-card::before { position: absolute; top: -1px; right: 36px; left: 36px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); content: ""; }
.login-card .tuna-seal { display: flex; width: 64px; height: 64px; margin: 0 auto 12px; }
.login-card .eyebrow { display: block; width: fit-content; margin: 0 auto 14px; color: var(--accent); font-size: 9px; font-weight: 650; letter-spacing: .28em; text-align: center; }
.login-card h1 { margin: 10px 0 13px; font: 400 31px/1.55 var(--serif); letter-spacing: -.055em; }
.login-card .muted { margin: 0; font-size: 12px; }
.login-card form { display: grid; gap: 15px; margin: 24px 0 15px; text-align: left; }
.login-card form > button { width: 100%; margin-top: 3px; }
.login-card small { display: block; color: var(--muted); font-size: 10px; line-height: 1.8; }
.login-card #login-error { min-height: 1.3em; margin: 4px 0; color: var(--danger); font-size: 11px; }
.login-card .privacy-link { margin-top: 16px; }
.login-card:has(> h1:first-child) { max-width: 640px; text-align: left; }
.login-card:has(> h1:first-child) h1 { font-size: 25px; }
.login-card:has(> h1:first-child) p { color: var(--ink-soft); font-size: var(--text-sm); line-height: 1.9; }
.login-card:has(> h1:first-child) a { display: inline-flex; min-height: 44px; align-items: center; margin-top: 10px; color: var(--forest-deep); font-size: var(--text-sm); }

@media (min-width: 1500px) {
  main { padding-right: 94px; padding-left: 94px; }
  .composer { margin-right: -94px; margin-left: -94px; padding-right: 94px; padding-left: 94px; }
}
@media (max-width: 1080px) {
  .shell { grid-template-columns: 248px minmax(0, 1fr); }
  .sidebar { width: 248px; padding-right: 17px; padding-left: 17px; }
  main { padding-right: 38px; padding-left: 38px; }
  .composer { margin-right: -38px; margin-left: -38px; padding-right: 38px; padding-left: 38px; }
  .chart-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-summary > div:last-child { grid-column: 1 / -1; }
  .latest-jump { right: 24px; }
}
@media (max-width: 720px) {
  html { scroll-padding-top: 72px; }
  body { font-size: 15px; }
  .shell { display: block; }
  .sidebar { position: fixed; z-index: 31; top: 0; left: 0; width: min(88vw, 326px); height: 100dvh; padding: max(23px, env(safe-area-inset-top)) 19px max(19px, env(safe-area-inset-bottom)); box-shadow: var(--shadow-float); transform: translateX(-105%); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-shade { position: fixed; z-index: 30; inset: 0; display: block; width: 100%; height: 100%; border: 0; border-radius: 0; padding: 0; background: rgb(8 12 10 / 46%); }
  body.sidebar-open { overflow: hidden; }
  .sidebar-collapsed .sidebar { display: flex; }
  main { max-width: 700px; padding: 0 22px calc(27px + env(safe-area-inset-bottom)); }
  .appbar { min-height: 66px; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; padding: 7px 0; }
  #toggle-sidebar { width: 44px; min-width: 44px; }
  .persona-trigger { min-width: 0; flex: 1 1 116px; gap: 8px; margin-right: 0; padding: 6px 2px; }
  .persona-trigger > span:nth-child(2) { min-width: 0; }
  .persona-trigger .avatar { width: 37px; height: 37px; }
  .persona-trigger strong { font-size: 14px; }
  .persona-trigger small { max-width: 150px; font-size: 9px; }
  .appbar .quiet-button { min-width: 44px; min-height: 44px; padding: 6px 8px; font-size: 10px; }
  #open-compatibility { width: 44px; overflow: hidden; border-radius: 50%; padding: 0; font-size: 0; }
  #open-compatibility::before { width: 18px; height: 18px; flex: none; background: currentColor; content: ""; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='4'/%3E%3Cpath d='M2 20c.7-3.2 2.7-5 6-5s5.3 1.8 6 5'/%3E%3Ccircle cx='16' cy='8' r='4'/%3E%3Cpath d='M18 15c2 .5 3.4 2.1 4 5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='4'/%3E%3Cpath d='M2 20c.7-3.2 2.7-5 6-5s5.3 1.8 6 5'/%3E%3Ccircle cx='16' cy='8' r='4'/%3E%3Cpath d='M18 15c2 .5 3.4 2.1 4 5'/%3E%3C/svg%3E") center / contain no-repeat; }
  #same-chart-chat { width: 44px; gap: 0; overflow: hidden; padding: 0; font-size: 0; }
  #same-chart-chat .icon { width: 18px; height: 18px; }
  #open-settings { width: 44px; overflow: hidden; padding: 0; font-size: 0; }
  #open-settings #connection-dot { margin: 0; font-size: 0; }
  #open-settings #connection-dot::before { content: none; }
  .welcome { min-height: 238px; padding: 42px 0 31px; }
  .welcome::after { top: 42px; right: 5px; height: 76px; }
  .welcome h1 { max-width: 11em; font-size: clamp(2.3rem, 10vw, 3.25rem); line-height: 1.4; }
  .welcome p { max-width: 29em; font-size: 13px; }
  .card { margin-bottom: 17px; border-radius: 15px; padding: 22px 18px; }
  .provider-panel { padding: 5px 13px; }
  .section-head { flex-direction: column; gap: 9px; margin-bottom: 20px; }
  .section-head > div:last-child { width: 100%; flex-wrap: wrap; justify-content: space-between; }
  #birth-panel > .section-head h2 { max-width: 18em; font-size: 20px; }
  #birth-form { gap: 19px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .place-picker { grid-column: auto; }
  .options { gap: 4px 14px; }
  .form-footer { align-items: stretch; flex-direction: column; gap: 11px; }
  .form-footer .primary { width: 100%; }
  .chart-drawer { margin: 19px 0; }
  .chart-inside > .section-head { flex-direction: row; align-items: center; }
  .chart-inside > .section-head > div:last-child { width: auto; justify-content: flex-end; }
  .pillars { gap: 6px; }
  .pillar { border-radius: 10px; padding: 10px 5px 9px; }
  .pillar .label { margin-bottom: 7px; font-size: 9px; }
  .pillar-glyphs { gap: 5px; }
  .pillar-glyph { min-height: 61px; border-radius: 7px; }
  .pillar-glyph .hanja { font-size: 25px; }
  .pillar-glyph .glyph-kind { font-size: 7px; }
  .pillar-glyph .hangul { font-size: 9px; }
  .pillar .god, .pillar .hidden, .unknown-pillar { font-size: 8px; }
  .chart-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .chart-summary > div:not(:last-child) { min-height: 76px; justify-content: center; padding: 10px 11px; }
  .chart-summary > div > strong { margin-top: 4px; font-size: 14px; }
  .chart-summary > div:last-child { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr; padding: 10px 12px; }
  .chart-inside > .section-head h2 { font-size: clamp(16px, 4.6vw, 19px); word-break: keep-all; overflow-wrap: normal; }
  .element-table { max-width: 360px; }
  .chat-welcome { margin: 21px auto 24px; padding: 18px 0 23px; }
  .chat-welcome h2 { font-size: 21px; }
  .starter-grid { grid-template-columns: minmax(0, 1fr); gap: 7px; margin-top: 17px; }
  .starter-card { min-height: 54px; }
  .turn-group { margin-bottom: 28px; }
  .message.user { max-width: 88%; margin: 23px 0 22px auto; padding: 9px 12px; }
  .answer-identity { gap: 8px; margin-bottom: 13px; padding-bottom: 10px; }
  .answer-identity .muted { max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .reading-copy { max-width: 100%; font-size: 16px; line-height: 1.9; }
  .reading-copy h3, .reading-subtitle { font-size: 18px; }
  .followup-chips { gap: 6px; margin-top: 15px; }
  .question-chip { min-height: 40px; padding: 7px 10px; font-size: 10px; }
  .composer { bottom: 0; grid-template-columns: minmax(0, 1fr) 90px; gap: 2px 8px; margin: 21px -22px calc(-1 * (27px + env(safe-area-inset-bottom))); padding: 9px 14px max(12px, env(safe-area-inset-bottom)); }
  .question-guides { margin: 0 -1px 2px; }
  .question-guides .question-chip { min-height: 34px; }
  .composer textarea { min-height: 44px; grid-row: 4; padding: 10px 11px; font-size: 14px; }
  .composer #generation-status { font-size: 9px; }
  .composer .keyboard-hint { display: none; }
  .composer #send { min-width: 90px; min-height: 44px; grid-column: 2; grid-row: 4; padding: 8px 10px; }
  .composer-advanced { grid-column: 1 / -1; grid-row: 6; }
  .composer-options { grid-template-columns: minmax(0, 1fr); }
  .latest-jump { z-index: 7; right: 15px; bottom: calc(var(--composer-height, 122px) + 8px + env(safe-area-inset-bottom)); min-height: 44px; padding: 5px 9px; font-size: 10px; }
  .latest-jump .icon { width: 13px; height: 13px; }
  .history-tabs > button, .friend-account-tab, .history-delete, .aside-bottom > button, .check, .delete-turn, .copy-button, .question-chip, .question-guides .question-chip, .reading-details > summary, .reading-details > summary .copy-button, .composer-advanced > summary, .composer-options select, .security-panel > button, .member-expiry > summary, .member-expiry button, #blocked-members button { min-height: 44px; }
  #comparison-panel { margin-top: 24px; }
  footer { margin-top: 32px; padding-bottom: 8px; }
  dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 30px - env(safe-area-inset-top)); border-radius: 20px; padding: 23px 19px; }
  #access-dialog { width: calc(100vw - 24px); }
  .dialog-head h2 { font-size: 20px; }
  .library-grid { grid-template-columns: minmax(0, 1fr); }
  .login-card { padding: 38px 25px 31px; }
}
@media (max-width: 390px) {
  main { padding-right: 17px; padding-left: 17px; }
  .welcome h1 { font-size: 2.35rem; }
  .section-head > div:last-child { align-items: flex-start; gap: 5px 10px; }
  .tag { max-width: 100%; }
  .appbar .quiet-button { padding: 6px; }
  .persona-trigger small { display: none; }
  .pillar { padding-right: 3px; padding-left: 3px; }
  .chart-inside > .section-head h2 { font-size: 17px; }
  .composer { margin-right: -17px; margin-left: -17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (forced-colors: active) {
  .element-fill, .element-swatch { forced-color-adjust: none; }
  button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline-color: Highlight; }
}

/* summary: compact, align cards to content */
.chart-summary { align-items: start; }
#elements { font-family: var(--serif); letter-spacing: .02em; word-spacing: .2em; }

/* ===== Desktop refinement (≥1081px): readable type, centered conversation column ===== */
@media (min-width: 1081px) {
  .eyebrow { font-size: 12px; }
  .brand-wordmark small { font-size: 11px; }
  .aside-heading { font-size: 12px; }
  .history-tabs > button { font-size: 13px; }
  .friend-account-tab { font-size: 12px; }
  .history-entry span { font-size: 13px; }
  .history-entry small { font-size: 11px; }
  .history-delete { font-size: 11px; }
  .privacy-link { font-size: 12px; }
  .persona-trigger small { font-size: 12px; }
  #server-status { font-size: 12px; }
  label { font-size: 13px; }
  .check { font-size: 13px; }
  .advanced > p { font-size: 12px; }
  .place-option small { font-size: 12px; }
  .place-selection { font-size: 12px; }
  #preview-status { font-size: 13px; }
  #chart-mini { font-size: 12px; }
  .pillar .label { font-size: 12px; }
  .pillar-glyph .glyph-kind { font-size: 10px; }
  .pillar-glyph .hangul { font-size: 12px; }
  .pillar .god, .pillar .hidden { font-size: 11px; }
  .unknown-pillar { font-size: 11px; }
  .chart-summary > div > span { font-size: 12px; }
  .element-table caption { font-size: 11px; }
  .element-table th, .element-table td { font-size: 12px; }
  .method-display { font-size: 12px; }
  .evidence p, .evidence li { font-size: 12px; }
  .cycle { font-size: 11px; }
  .starter-card small { font-size: 12px; }
  .message-label { font-size: 12px; }
  .delete-turn { font-size: 11px; }
  .answer-identity .muted { font-size: 12px; }
  .copy-button { font-size: 12px; }
  .reading-details > summary { font-size: 12px; }
  .reading-details > summary .copy-button { font-size: 11px; }
  .followup-chips > small { font-size: 12px; }
  .question-chip { font-size: 12px; }
  .guide-insight > p { font-size: 13px; }
  .pending > div:last-child, .message.error > div:last-child { font-size: 13px; }
  .composer .guide-hint { font-size: 12px; }
  .composer-advanced > summary { font-size: 12px; }
  .composer-options label { font-size: 12px; }
  .composer-options select { font-size: 13px; }
  .composer #generation-status { font-size: 12px; }
  .composer .keyboard-hint { font-size: 11px; }
  #comparison-panel > summary { font-size: 13px; }
  footer { font-size: 12px; }
  .persona-card small { font-size: 12px; }
  #persona-dialog > small { font-size: 12px; }
  #model-save-state { font-size: 12px; }
  .security-panel > button { font-size: 12px; }
  .member-expiry > summary { font-size: 12px; }
  .login-card .eyebrow { font-size: 11px; }
  .login-card small { font-size: 12px; }
  .login-card #login-error { font-size: 13px; }
  .history-entry > button:first-child { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 58px; }
  .history-entry span, .history-entry small { max-width: 100%; }
  #conversation, .chat-welcome, #friend-view-note, #partner-chart-panel, #comparison-panel { max-width: 820px; margin-left: auto; margin-right: auto; }
  .composer { max-width: 868px; margin: 27px auto 0; border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; padding: 14px 24px max(14px, env(safe-area-inset-bottom)); }
  .reading-copy { max-width: 36em; font-size: 18px; }
  .answer-identity { max-width: 36rem; }
  .composer textarea { font-size: 15px; }
  .latest-jump { right: max(24px, calc((100vw - 276px - 820px) / 2 - 150px)); }
}
@media (min-width: 1500px) {
  main { max-width: 1180px; }
  .composer { margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }
}

/* ===== Round 3: letter card, 오행 bars, quieter composer, grouped history ===== */
/* Answer as a letter sheet: slightly warmer paper, soft edge, bronze margin rule */
.message.answer { position: relative; box-sizing: border-box; margin: 22px 0 30px; border: 1px solid var(--line-soft); border-radius: 18px; padding: 28px clamp(20px, 4vw, 40px) 22px; background: var(--letter, var(--surface-raised)); box-shadow: 0 1px 0 rgb(255 255 255 / 60%) inset, 0 14px 36px rgb(42 43 34 / 6%); }
.message.answer::before { position: absolute; top: 26px; bottom: 26px; left: 0; width: 3px; border-radius: 0 3px 3px 0; background: color-mix(in srgb, var(--accent) 55%, transparent); content: ""; }
:root { --letter: #fffdf6; }
@media (prefers-color-scheme: dark) { :root { --letter: #20271f; } .message.answer { box-shadow: 0 14px 36px rgb(0 0 0 / 22%); } }
@media (max-width: 720px) { .message.answer { margin: 16px -4px 24px; border-radius: 14px; padding: 20px 16px 16px; } .message.answer::before { top: 18px; bottom: 18px; } }

/* 오행 distribution bars (count out of 8 characters) */
.element-distribution { display: grid; gap: 7px; margin-top: 10px; }
.element-distribution .element-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 18px; align-items: center; gap: 10px; }
.element-distribution .element-name { color: var(--ink-soft); font-size: 12px; }
.element-distribution .element-track { height: 6px; overflow: hidden; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.element-distribution .element-fill { height: 6px; width: calc(var(--element-count, 0) * 12.5%); border-radius: var(--radius-pill); }
.element-distribution .element-value { width: auto; font-size: 12px; }
.chart-summary > div:last-child > span { margin-bottom: 2px; }

/* Calmer 명식판: one card per pillar, glyphs separated by a hairline instead of nested boxes */
.pillar-glyphs { gap: 0; }
.pillar-glyph { border: 0; border-radius: 0; background: transparent; padding: 9px 3px; }
.pillar-glyph.stem { border-bottom: 1px solid var(--line-soft); }
.pillar-glyph.branch { background: transparent; }
.pillar-glyph .hanja { font-size: 34px; }
.pillar-glyph.unknown { border: 0; background: transparent; }

/* Quieter composer: idle status line and keyboard hint hidden; status still shows while generating */
.composer #generation-status { display: none; }
.composer.is-busy #generation-status { display: block; }
.composer .keyboard-hint { display: none; }

/* Sidebar history: grouped by chart; each entry shows its date/time */
.history-group { margin: 12px 4px 2px; overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .02em; text-overflow: ellipsis; white-space: nowrap; }
.history-group:first-child { margin-top: 0; }
.history-entry small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.history-entry > button:first-child { min-height: 44px; }
.history-entry span { font-size: 12px; font-weight: 500; }
@media (min-width: 1081px) { .history-entry > button:first-child { min-height: 44px; } .history-entry span { font-size: 13px; } .history-group { font-size: 12px; } }

/* Developer/method line now lives inside the evidence drawer */
.evidence .method-display { margin: 0 0 12px; }
@media (min-width: 1081px) and (max-width: 1699px) {
  .latest-jump { right: auto; left: calc(276px + (100vw - 276px) / 2); transform: translateX(-50%); }
}

/* ===== Round 4: progressive-disclosure birth form ===== */
#birth-form .place-picker { grid-column: 1 / -1; }
.calendar-field { display: grid; gap: 6px; align-content: start; }
.calendar-field .check { min-height: 30px; }
#birth-form .advanced { margin-top: 22px; border-top: 1px solid var(--line-soft); padding-top: 4px; }
#birth-form .advanced > summary { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.advanced-sub { color: var(--muted); font-size: 11px; font-weight: 400; }
#birth-form .advanced .options { margin: 6px 0 4px; }
#birth-form .advanced .method-hint { margin: 0 0 16px; }
#birth-form .advanced .form-grid { margin-bottom: 8px; }
@media (min-width: 1081px) { .advanced-sub { font-size: 12px; } }

/* ===== Round 4: seal (낙관) logo ===== */
.tuna-seal { border: 0; border-radius: 11px; background: transparent; box-shadow: 0 6px 14px rgb(110 40 28 / 16%); transform: rotate(-3deg); }
.login-card .tuna-seal { border-radius: 14px; }
@media (prefers-color-scheme: dark) { .tuna-seal { box-shadow: 0 6px 16px rgb(0 0 0 / 35%); } }
#birth-form .form-grid > label, #birth-form .form-grid > div, .calendar-field > label { align-self: start; }
#birth-form .form-grid select { height: 48px; }

/* ===== Round 5: legibility first ===== */
/* Body reading text in Pretendard (screen-optimized sans); serif kept only for large display titles and hanja */
.reading-copy { font: 400 17px/1.85 var(--sans); letter-spacing: -.012em; color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; }
.reading-copy h3, .reading-subtitle { font: 650 18px/1.6 var(--sans); letter-spacing: -.02em; }
.reading-copy strong { font-weight: 650; }
.answer-identity strong, .starter-card span, .guide-insight > strong, .persona-card > span:last-child strong, .persona-trigger strong { font-family: var(--sans); font-weight: 600; letter-spacing: -.01em; }
.aside-bottom > p { font-family: var(--sans); }
.chart-drawer > summary { font-family: var(--sans); font-weight: 600; }
#elements { font-family: var(--sans); letter-spacing: 0; word-spacing: 0; }
h3 { font-family: var(--sans); font-weight: 650; }
@media (min-width: 1081px) {
  .reading-copy { font-size: 17.5px; line-height: 1.9; max-width: 38em; }
  body { -webkit-font-smoothing: auto; }
}

/* Mobile: thin app bar and compact composer so more of the answer is visible */
@media (max-width: 720px) {
  .appbar { min-height: 52px; padding: 3px 0; margin-bottom: 2px; flex-wrap: nowrap; }
  .appbar .avatar { width: 34px; height: 34px; font-size: 16px; }
  .persona-trigger { padding: 2px 4px; }
  .composer { gap: 4px 8px; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); margin-top: 18px; }
  .composer .guide-hint { display: none; }
  .question-guides .question-chip { min-height: 34px; padding: 4px 11px; font-size: 12px; }
  .composer textarea { min-height: 44px; padding: 10px 12px; font-size: 16px; }
  .composer #send { min-height: 44px; min-width: 72px; padding: 0 14px; }
  .composer-advanced > summary { min-height: 26px; padding-block: 2px; font-size: 11px; }
  .reading-copy { font-size: 16.5px; line-height: 1.8; }
  .message.answer { padding: 16px 14px 12px; }
}
@media (max-width: 720px) {
  .composer .question-guides { grid-column: 1; grid-row: 1; }
  .composer-advanced { grid-column: 2; grid-row: 1; align-self: center; }
  .composer-advanced > summary { min-height: 34px; padding: 0 2px 0 6px; white-space: nowrap; }
  .composer-advanced[open] .composer-options { position: absolute; z-index: 9; right: 12px; bottom: calc(100% + 6px); left: 12px; margin: 0; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--surface-raised); box-shadow: var(--shadow-float); }
}

/* 저장된 출생 정보 불러오기 */
.birth-reuse-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 20px; }
.birth-reuse-actions > button { border-color: var(--line); }
.birth-profile-list .starter-card { width: 100%; min-width: 0; white-space: normal; overflow-wrap: anywhere; }

/* 궁합 대화에서도 질문별 개인/궁합 풀이 선택 */
.reading-scope-control { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; margin: 0 0 6px; color: var(--muted); font-size: 11px; }
.reading-scope-control label { margin: 0; white-space: nowrap; }
.reading-scope-control select { width: auto; min-height: 30px; margin: 0; padding: 4px 25px 4px 9px; font-size: 12px; }
.reading-scope-control small { font-size: 10px; }

/* ===== Round 6: overall polish ===== */
/* 1. Answer card: name → body first; evidence drawer moves below the body */
.reading-copy { display: flex; flex-direction: column; }
.reading-copy > .reading-details { order: 99; margin: 6px 0 0; }
.answer-identity { margin-bottom: 14px; }
.answer-actions { margin-top: 4px; }
/* 2. Scannable answers: lead paragraph slightly larger, key phrases with a soft marker */
.reading-copy > p:first-of-type { font-size: 1.06em; font-weight: 500; color: var(--ink); }
.reading-copy strong { padding: 0 .08em; background: linear-gradient(transparent 60%, color-mix(in srgb, var(--accent) 22%, transparent) 60%); color: var(--ink); }
/* 3. Persona avatars as small seals, matching the 낙관 logo */
.avatar { border: 0; border-radius: 10px; color: #f5eee1; background: #9e3b2b; font-family: var(--serif); box-shadow: 0 3px 8px rgb(110 40 28 / 18%); transform: rotate(-3deg); }
.avatar.daon { border: 0; color: #f5eee1; background: #2f4a6b; box-shadow: 0 3px 8px rgb(30 50 80 / 20%); }
.avatar.idam { border: 0; color: #f5eee1; background: #315d4d; box-shadow: 0 3px 8px rgb(30 70 50 / 20%); }
.avatar.small { border-radius: 8px; }
/* 4. Destructive actions are not always on display */
@media (hover: hover) {
  .history-entry .history-delete { opacity: 0; transition: opacity var(--motion-fast, .15s); }
  .history-entry:hover .history-delete, .history-entry:focus-within .history-delete { opacity: 1; }
}
@media (hover: none) {
  .history-entry .history-delete { display: none; }
  .history-entry:has(> button.selected) .history-delete { display: inline-flex; }
}
.danger-zone { margin: 4px 0; }
.danger-zone > summary { display: inline-flex; min-height: 32px; align-items: center; color: var(--muted); font-size: 12px; font-weight: 500; }
.danger-zone[open] > summary { margin-bottom: 2px; }
.danger-zone > summary::after { content: none; }
/* 5. Ten-god glossary under the pillars */
.term-glossary { margin: 12px 0 4px; border: 1px solid var(--line-soft); border-radius: 12px; padding: 0 14px; background: var(--surface); }
.term-glossary > summary { min-height: 44px; display: flex; align-items: center; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.term-glossary dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 2px 0 14px; font-size: 13px; line-height: 1.6; }
.term-glossary dt { color: var(--accent); font-weight: 650; }
.term-glossary dd { margin: 0; color: var(--ink-soft); }
/* 8. Question chips: fade the clipped edge so it reads as scrollable */
.question-guides { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 24px; }
@media (max-width: 720px) {
  /* 6. Mobile app bar: labelled actions, redundant scroll-top removed */
  #scroll-top { display: none; }
  #open-compatibility, #same-chart-chat { width: auto; min-width: 0; gap: 4px; border-radius: 10px; padding: 0 7px; font-size: 12px; }
  #same-chart-chat .icon { width: 15px; height: 15px; }
  #open-compatibility::before { width: 16px; height: 16px; margin-right: 3px; }
  .persona-trigger small, .persona-trigger .chevron { display: none; }
  /* 7. Latest-answer jump: small round icon at the right above the composer */
  .latest-jump { width: 40px; min-width: 40px; height: 40px; min-height: 40px; justify-content: center; border-radius: 50%; padding: 0; font-size: 0; right: 12px; }
  .latest-jump .icon { width: 18px; height: 18px; }
  .term-glossary dl { font-size: 12.5px; }
}
@media (max-width: 720px) {
  .appbar #scroll-top.mobile-top { display: none !important; }
  .appbar #open-compatibility, .appbar #same-chart-chat { flex: none; }
  .appbar .persona-trigger { min-width: 0; flex: 0 1 auto; margin-right: auto; }
}
.persona-trigger strong { white-space: nowrap; }

/* ===== Round 8: guest polish, waiting state, softer hanja ===== */
.danger-zone:has(> #delete-all[hidden]) { display: none; }
.is-guest .footer-tech { display: none; }
/* Inline hanja: slightly smaller and lighter so the Korean sentence leads */
.hanja-inline { font-size: .9em; color: var(--ink-soft); letter-spacing: .01em; }
.reading-copy strong .hanja-inline, strong > .hanja-inline { color: inherit; }
/* Waiting card: 3-step progress with a gentle shimmer */
.message.pending { position: relative; overflow: hidden; border-radius: 16px; padding: 18px 20px 22px; background: var(--letter, var(--surface-raised)); }
.message.pending .message-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.message.pending > div:last-child { margin-top: 6px; color: var(--ink-soft); font-size: 13px; line-height: 1.75; white-space: pre-line; }
.message.pending::before { display: block; margin-bottom: 10px; color: var(--muted); font-size: 12px; letter-spacing: .02em; content: "질문 전달  →  명식 분석  →  답변 작성 · 보통 1분 남짓 걸려요"; }
.message.pending::after { position: absolute; left: 0; bottom: 0; height: 3px; width: 18%; border-radius: 0 3px 3px 0; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent)); content: ""; transition: width .6s ease; }
.message.pending[data-stage*="살펴보고"]::after, .message.pending[data-stage*="궁합 근거"]::after { width: 52%; }
.message.pending[data-stage*="이야기를 풀고"]::after { width: 84%; }
.message.pending[data-stage*="접수했어요"]::after, .message.pending[data-stage*="비교합니다"]::after { width: 10%; }
@media (prefers-reduced-motion: no-preference) {
  .message.pending::after { animation: pending-breathe 1.8s ease-in-out infinite; }
  @keyframes pending-breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
}
@media (max-width: 720px) { .message.pending::before { font-size: 11px; } }
.message.pending { display: block; max-width: none; border-left: 1px solid var(--line-soft); }
.message.pending::before { position: static; width: auto; height: auto; border-radius: 0; background: none; animation: none; }

/* ===== Mobile app bar: no overlap — fixed-width icon buttons with tiny labels, persona name truncates ===== */
@media (max-width: 720px) {
  .appbar { gap: 2px; }
  .appbar #toggle-sidebar { flex: none; width: 40px; min-width: 40px; padding: 0; }
  .appbar .persona-trigger { flex: 1 1 auto; min-width: 0; margin-right: 4px; overflow: hidden; gap: 8px; }
  .appbar .persona-trigger > span:not(.avatar):not(.chevron) { min-width: 0; overflow: hidden; }
  .appbar .persona-trigger strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .appbar #open-compatibility, .appbar #same-chart-chat, .appbar #remote-logout {
    flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    width: 46px; min-width: 46px; height: 44px; min-height: 44px; overflow: hidden; border: 0; border-radius: 10px; padding: 0;
    color: var(--ink-soft); background: transparent; font-size: 10px; font-weight: 500; line-height: 1; letter-spacing: -.02em; white-space: nowrap;
  }
  .appbar #open-compatibility::before { width: 18px; height: 18px; margin: 0; }
  .appbar #same-chart-chat .icon { width: 18px; height: 18px; }
  .appbar #remote-logout::before { width: 18px; height: 18px; flex: none; background: currentColor; content: "";
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h3M15 16l4-4-4-4M19 12H9'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h3M15 16l4-4-4-4M19 12H9'/%3E%3C/svg%3E") center / contain no-repeat; }
  .appbar #open-settings { flex: none; min-width: 32px; width: 32px; padding: 0; }
}
@media (max-width: 720px) { .appbar .persona-trigger { justify-content: flex-start; } }
@media (max-width: 360px) { .composer textarea { font-size: 15px; } .composer textarea::placeholder { font-size: 14px; } .composer #send { min-width: 64px; padding: 0 10px; } }

/* Make the existing counselor switch discoverable without a taller chat header. */
.appbar .persona-trigger .persona-switch-label { display: block; margin-top: 2px; color: var(--forest); font: 600 10px/1.3 var(--sans); white-space: nowrap; }
.persona-intro { margin: 0 0 22px; }
.persona-intro h3 { margin: 0 0 5px; font-size: 15px; }
.persona-intro > p { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.persona-starters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.persona-starter { flex-direction: column; justify-content: center; gap: 8px; min-width: 0; min-height: 126px; margin: 0; padding: 12px 6px; text-align: center; }
.persona-starter > span:last-child { gap: 3px; }
.persona-starter > span:last-child strong { font-size: 14px; }
.persona-starter small { font-size: 11px; word-break: keep-all; }
.persona-selection { color: var(--forest); font-size: 11px; line-height: 1.5; }
.persona-card:not(.active) .persona-selection { color: var(--muted); }
@media (max-width: 720px) {
  .appbar .persona-trigger .persona-switch-label { font-size: 10px; }
  .persona-starter .avatar { width: 32px; height: 32px; font-size: 15px; }
  .persona-starter { min-height: 122px; }
}
