/* 루틴 강화 — 루틴 화면
   금빛 한 가지 색을 진하기로 나눠 쓴다 (기록 달력: 옅을수록 덜 함 → 진할수록 다 함). 빨강(--bad)은 '안 한 날' 표시에만.
   테마 토큰은 app.css(밤의 학당)와 같다. */
:root {
  --done: var(--accent-strong);
  --half: color-mix(in srgb, var(--gold-2) 55%, var(--surface-2));
  --part: color-mix(in srgb, var(--gold-2) 30%, var(--surface-2));
  --lv1: color-mix(in srgb, var(--gold-2) 28%, var(--surface-2));
  --lv2: color-mix(in srgb, var(--gold-2) 52%, var(--surface-2));
  --lv3: color-mix(in srgb, var(--gold-2) 76%, var(--surface-2));
  --miss-line: color-mix(in srgb, var(--bad) 55%, transparent);
  --me: color-mix(in srgb, var(--gold-2) 14%, transparent);
}

/* ---------------------------------------------------------------- 공통 */
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.tiny { font-size: 12px; }
.card-title { font-size: 19px; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.row-between > .card-title { margin-bottom: 0; }
.small-title { font-size: 15px; margin: 6px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2 > .card { min-width: 0; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; display: inline-block; vertical-align: -3px; margin-right: 6px; }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.disabled { opacity: 0.35; pointer-events: none; }
.btn.danger { color: var(--bad); }
.tag { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); font-weight: 700; }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.soft-sep { border: 0; border-top: 1px dashed var(--line); margin: 4px 0; width: 100%; }
.advanced summary { cursor: pointer; font-weight: 700; color: var(--ink-2); padding: 6px 0; }
.advanced[open] summary { margin-bottom: 10px; }
.page-head .btn { white-space: nowrap; flex-shrink: 0; }
.emoji { display: inline-grid; place-items: center; font-size: 20px; line-height: 1; width: 1.3em; flex-shrink: 0; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.emoji.lg { font-size: 28px; }
.emoji.xl { font-size: 44px; }
.meter { display: inline-block; width: 64px; height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; vertical-align: middle; }
.meter i { display: block; height: 100%; background: var(--gold-2); border-radius: 4px; }
.streak-chip { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; color: var(--warn-ink); }
.tip { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 14px; padding: 6px 4px; }
.tip-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* 마크다운 · AI 글 */
.md { font-size: 16px; line-height: 1.8; }
.md h3 { font-size: 18px; margin: 22px 0 8px; color: var(--brand-ink); padding-bottom: 6px; border-bottom: 1px solid color-mix(in srgb, var(--gold) 25%, var(--line)); }
.md h3:first-child { margin-top: 0; }
.md p { margin: 0 0 12px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 4px; }
.md b { color: var(--ink); }
.reading-head h2 { font-size: 20px; display: inline-flex; align-items: center; gap: 4px; }
.reading-body { display: grid; gap: 14px; margin-top: 10px; }
.reading-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: pulse 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; } .typing i:nth-child(3) { animation-delay: 0.4s; }

/* ---------------------------------------------------------------- 오늘 */
.today-head { align-items: flex-end; }
.day-nav { display: flex; align-items: center; gap: 6px; }
.today-hero { display: flex; align-items: center; gap: 20px; }
.today-hero .ring { color: var(--gold-2); flex-shrink: 0; }
.today-hero .ring-label { font-size: 18px; }
.today-hero.perfect { background: linear-gradient(135deg, color-mix(in srgb, var(--gold-2) 16%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.today-hero.perfect .ring { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { filter: drop-shadow(0 0 10px var(--glow)); } }
.hero-text { display: grid; gap: 8px; min-width: 0; }
.hero-msg { font-family: var(--serif); font-size: 21px; line-height: 1.4; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px; }

.slot-group { display: grid; gap: 8px; }
.slot-title { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 8px 2px 0; }
.slot-title small { font-family: var(--font); font-weight: 600; font-size: 13px; }
.off-group summary { cursor: pointer; list-style: none; }
.off-group summary::-webkit-details-marker { display: none; }
.off-group summary::after { content: "펼치기"; margin-left: auto; font-family: var(--font); font-size: 13px; color: var(--muted); font-weight: 600; }
.off-group[open] summary::after { content: "접기"; }
.off-group .habit-list { margin-top: 8px; }

.habit-list { display: grid; gap: 8px; }
.habit-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 12px 12px 14px; box-shadow: var(--shadow-1);
  transition: background 0.2s, border-color 0.2s;
}
.habit-row.is-done { background: color-mix(in srgb, var(--gold-2) 9%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); }
.habit-row.is-done .habit-name b { color: var(--ink-2); }
.habit-row.st-skip { opacity: 0.75; }
.check-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--gold) 45%, var(--line)); background: var(--surface);
  color: transparent; display: grid; place-items: center; transition: transform 0.15s, background 0.2s; flex-shrink: 0;
}
.check-btn:hover { color: color-mix(in srgb, var(--gold) 50%, transparent); }
.check-btn:active { transform: scale(0.92); }
.check-btn.on { background: linear-gradient(180deg, #e9c477, #b8862f); border-color: transparent; color: #2a1a08; animation: pop 0.3s; }
.check-btn.on.mini { background: var(--half); color: var(--ink); }
@keyframes pop { 40% { transform: scale(1.15); } }
.count-ctl { display: flex; align-items: center; gap: 4px; }
.count-val {
  min-width: 66px; height: 46px; border-radius: 14px; border: 2px solid color-mix(in srgb, var(--gold) 40%, var(--line)); background: var(--surface);
  display: inline-flex; align-items: baseline; justify-content: center; gap: 1px; padding: 0 8px; line-height: 44px;
}
.count-val b { font-size: 18px; }
.count-val small { font-size: 12px; color: var(--muted); font-weight: 600; }
.count-val.on { background: linear-gradient(180deg, #e9c477, #b8862f); border-color: transparent; color: #2a1a08; }
.count-val.on small { color: #4a3210; }
.count-ctl .plus.on { color: var(--muted); }
.habit-main { display: grid; gap: 3px; text-decoration: none; min-width: 0; }
.habit-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.habit-name b { font-size: 16px; }
.habit-plan { font-size: 13px; line-height: 1.45; }
.habit-note { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; color: var(--ink-2); }
.habit-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.habit-badges:empty { display: none; }
.week-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--muted); }
.week-chip i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--gold) 50%, var(--line)); }
.week-chip i.on { background: var(--gold-2); border-color: var(--gold-2); }
.week-chip.on { color: var(--brand-ink); }
.habit-side { display: flex; align-items: center; gap: 4px; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 4px; border: 1px dashed color-mix(in srgb, var(--gold) 45%, var(--line)); background: none; border-radius: 99px;
  padding: 6px 10px; font-size: 12px; font-weight: 700; color: var(--ink-2); max-width: 170px;
}
.mini-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-btn:hover { background: var(--me); }
@media (max-width: 600px) {
  .habit-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
  .habit-side { flex-direction: column; align-items: flex-end; }
  .mini-btn { max-width: 96px; padding: 5px 8px; }
  .count-ctl { flex-direction: column-reverse; gap: 2px; }
  .count-ctl .icon-btn.sm { width: 30px; height: 26px; border-radius: 8px; }
  .count-val { min-width: 58px; height: 40px; line-height: 38px; }
  .today-hero { gap: 14px; }
  .hero-msg { font-size: 18px; }
}

.status-list { display: grid; gap: 6px; }
.status-opt { display: flex; align-items: center; gap: 8px; text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; font-weight: 600; }
.status-opt.on { border-color: var(--gold-2); background: var(--me); }

.onboard { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 34px 22px; }
.onboard-mark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--me); color: var(--brand-ink); }
.onboard p { max-width: 520px; }

/* 다 했을 때 불꽃 */
.burst { position: fixed; left: 50%; top: 32%; width: 0; height: 0; pointer-events: none; z-index: 60; }
.burst i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 8px var(--glow);
  animation: burst 1.1s ease-out var(--d) forwards; transform: rotate(var(--a)) translateY(0); opacity: 0; }
.burst i:nth-child(3n) { background: #f4b860; width: 6px; height: 6px; }
@keyframes burst { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-130px) scale(0.4); } }

/* ---------------------------------------------------------------- 내 루틴 */
.habit-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.habit-card { display: grid; gap: 10px; padding: 14px 16px; }
.habit-card.archived { opacity: 0.8; }
.habit-card-main { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; }
.habit-card-text { display: grid; gap: 2px; min-width: 0; }
.habit-card-text b { font-size: 16px; display: inline-flex; align-items: center; gap: 6px; }
.habit-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.strength { display: inline-flex; align-items: center; gap: 8px; }
.strength small { color: var(--muted); font-weight: 600; }
.card-actions { display: flex; gap: 4px; align-items: center; }
.archive-box summary { cursor: pointer; font-weight: 700; }
.archive-box[open] summary { margin-bottom: 8px; }
.archive-box .habit-cards { margin-top: 10px; }
@media (max-width: 420px) { .habit-cards { grid-template-columns: 1fr; } }

.habit-form { gap: 18px; }
.name-row { display: flex; gap: 8px; }
.name-row .text-input { flex: 1; min-width: 0; }
.emoji-pick { width: 52px; height: 50px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); flex-shrink: 0; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.emoji-cell { font-size: 24px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.emoji-cell.on { border-color: var(--gold-2); background: var(--me); }
.amount-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 320px; }
.amount-row:empty { display: none; }
.inline-field { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.inline-field .text-input { width: auto; }
.choice-chips.sm .choice-chip { font-size: 13px; padding: 6px 12px; }
.choice-chip { display: inline-flex; align-items: center; gap: 5px; }
.strength small { white-space: nowrap; }
.dow-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.dow { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); font-weight: 800; }
.dow.on { background: linear-gradient(180deg, #e9c477, #b8862f); color: #2a1a08; border-color: transparent; }
.plan-preview { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px dashed color-mix(in srgb, var(--gold) 35%, var(--line)); line-height: 1.6; }
.plan-preview b { color: var(--brand-ink); }
.danger-row { justify-content: space-between; }


/* ---------------------------------------------------------------- 루틴 자세히 · 기록 */
.detail-title { display: flex; gap: 14px; align-items: center; }
.plan-card { display: grid; gap: 12px; }
.plan-line { font-size: 17px; line-height: 1.6; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--shadow-1); }
.stat-label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.stat-label .icon { color: var(--brand-ink); }
.stat-value { font-family: var(--serif); font-size: 26px; line-height: 1.2; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr 1fr; } }

.journey { position: relative; height: 10px; border-radius: 6px; background: var(--surface-2); margin: 6px 0 22px; }
.journey i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: linear-gradient(90deg, var(--lv2), var(--gold-2)); }
.journey-mark { position: absolute; top: 14px; transform: translateX(-100%); font-size: 12px; font-weight: 700; color: var(--muted); }

/* 좁은 화면에서 가로로 넘치면 오른쪽(최근 주)부터 보이게: 스크롤 기준을 오른쪽에 둔다 */
.heat-wrap { overflow-x: auto; padding-bottom: 4px; direction: rtl; }
.heat-wrap > .heat { direction: ltr; }
.heat { display: flex; gap: 6px; width: max-content; margin: 0 auto 0 0; }
.heat-dows { display: grid; grid-template-rows: repeat(7, 14px); gap: 3px; font-size: 10px; color: var(--muted); line-height: 14px; padding-top: 19px;
  position: sticky; left: 0; z-index: 1; background: var(--surface); padding-right: 4px; margin-right: -4px; }  /* 옆으로 밀어도 요일은 남게 */
.heat-main { display: grid; gap: 5px; }
.heat-months { display: flex; gap: 3px; height: 14px; }
.heat-months span { flex: 0 0 14px; width: 14px; font-size: 10px; line-height: 14px; color: var(--muted); white-space: nowrap; overflow: visible; }
.heat-cols { display: flex; gap: 3px; }
.heat-col { display: grid; grid-template-rows: repeat(7, 14px); gap: 3px; }
.heat-cell { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-2); display: inline-block; }
.heat-cell.s-done, .heat-cell.lv4 { background: var(--done); }
.heat-cell.s-mini, .heat-cell.lv3 { background: var(--lv3); }
.heat-cell.s-mini { background: var(--half); }
.heat-cell.s-partial, .heat-cell.lv1 { background: var(--lv1); }
.heat-cell.lv2 { background: var(--lv2); }
.heat-cell.s-skip { background: repeating-linear-gradient(135deg, var(--surface-2) 0 3px, var(--line) 3px 5px); }
.heat-cell.s-miss { background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--miss-line); }
.heat-cell.s-none { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.heat-cell.s-today { background: transparent; box-shadow: inset 0 0 0 1.5px var(--gold-2); }
.heat-cell.off, .heat-cell.future { background: transparent; }
.heat-cell.future { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 50%, transparent); }
.heat-cols .heat-cell[title] { cursor: default; }
.heat-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.heat-legend > span { display: inline-flex; align-items: center; gap: 5px; }

.line-chart { position: relative; }
.line-chart svg { width: 100%; height: 150px; display: block; touch-action: pan-y; }
.line-chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.line-chart .axis { fill: var(--muted); font-size: 11px; }
.line-chart .area { fill: color-mix(in srgb, var(--gold-2) 16%, transparent); }
.line-chart .line { fill: none; stroke: var(--gold-2); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.line-chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.line-chart .dot { fill: var(--gold-2); stroke: var(--surface); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-tip { position: absolute; top: -6px; padding: 4px 8px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 700; white-space: nowrap; pointer-events: none; }

.bar-list { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 52px 1fr 44px; align-items: center; gap: 10px; font-size: 14px; }
.bar-label { color: var(--ink-2); font-weight: 600; }
.bar-track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--gold-2); border-radius: 0 5px 5px 0; }
.bar-val { text-align: right; font-size: 13px; }
.bar-row.weak .bar-track i { background: color-mix(in srgb, var(--bad) 70%, var(--gold-2)); }
.bar-row.weak .bar-label::after { content: " ↓"; color: var(--bad); }

.week-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.week-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 14px; }
.week-row small { grid-column: 1 / -1; }
.week-row.w-met { background: var(--me); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.week-row.w-missed { box-shadow: inset 3px 0 0 var(--miss-line); }
.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.note-list li { display: grid; gap: 2px; border-left: 3px solid var(--line); padding-left: 10px; }

.insights ul { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; }
.habit-table { display: grid; gap: 2px; }
.ht-row { display: grid; grid-template-columns: minmax(120px, 1.3fr) minmax(170px, 2fr) 54px 110px 54px; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; text-decoration: none; font-size: 14px; }
a.ht-row:hover { background: var(--surface-2); }
.ht-head { font-size: 12px; color: var(--muted); font-weight: 700; }
.ht-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ht-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht-strength { display: inline-flex; align-items: center; gap: 6px; }
.ht-strength .meter { width: 50px; }
@media (max-width: 720px) {
  .ht-row { grid-template-columns: 1fr auto; grid-template-areas: "name rate" "dots dots"; gap: 4px 10px; }
  .ht-head { display: none; }
  .ht-row > :nth-child(1) { grid-area: name; }
  .ht-row > :nth-child(2) { grid-area: dots; }
  .ht-row > :nth-child(3) { grid-area: rate; }
  .ht-row > :nth-child(4), .ht-row > :nth-child(5) { display: none; }
}
.dot-strip { display: inline-flex; gap: 2px; flex-wrap: nowrap; }
.dot-strip i { width: 7px; height: 14px; border-radius: 2px; background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.dot-strip i.done { background: var(--done); box-shadow: none; }
.dot-strip i.half { background: var(--half); box-shadow: none; }
.dot-strip i.skip { background: repeating-linear-gradient(135deg, var(--surface-2) 0 2px, var(--line) 2px 4px); }
.dot-strip i.miss { box-shadow: inset 0 0 0 1.5px var(--miss-line); }
.dot-strip i.off { box-shadow: none; opacity: 0; }

/* ---------------------------------------------------------------- 코치 */
.chat-layout { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; }
.chat-side { display: grid; gap: 10px; padding: 14px; }
.chat-history { display: grid; gap: 2px; max-height: 60vh; overflow-y: auto; }
.chat-h { display: flex; align-items: center; gap: 4px; border-radius: 10px; }
.chat-h a { flex: 1; min-width: 0; padding: 8px 10px; text-decoration: none; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-h.on, .chat-h:hover { background: var(--surface-2); }
.chat-h .icon-btn { width: 30px; height: 30px; color: var(--muted); }
.chat-main { display: flex; flex-direction: column; gap: 10px; min-height: 60vh; padding: 16px; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 64vh; padding: 4px; }
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-bubble { max-width: 86%; padding: 12px 16px; border-radius: 18px; line-height: 1.7; }
.chat-msg.user .chat-bubble { background: var(--accent-strong); color: var(--on-accent); border-radius: 18px 4px 18px 18px; white-space: pre-wrap; }
.chat-msg.assistant .chat-bubble { background: var(--surface-2); border-radius: 4px 18px 18px 18px; }
.chat-bubble .md { font-size: 15px; }
.chat-bubble .md p:last-child, .chat-bubble .md ul:last-child { margin-bottom: 0; }
.chat-empty { display: grid; justify-items: center; gap: 12px; text-align: center; margin: auto; padding: 24px 8px; color: var(--ink-2); }
.chat-empty .choice-chips { justify-content: center; }
.chat-empty .choice-chip { font-size: 14px; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; }
.chat-input { flex: 1; resize: none; min-height: 52px; max-height: 160px; }
.chat-compose .send { width: 52px; height: 52px; padding: 0; flex-shrink: 0; }
@media (max-width: 820px) { .chat-layout { grid-template-columns: 1fr; } .chat-side { order: 2; } .chat-log { max-height: none; } }

/* ---------------------------------------------------------------- 습관의 과학 */
.guide-item { display: grid; gap: 10px; }
.guide-item .card-title { margin: 0; }
.level { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.level-strong { background: var(--ok-bg); color: var(--ok-ink); }
.level-study { background: var(--me); color: var(--brand-ink); }
.level-tip { background: var(--surface-2); color: var(--muted); }
.ref { border-top: 1px solid var(--line); padding-top: 8px; }
.guide-kv { grid-template-columns: 84px 1fr; }
.guide-kv dd { font-weight: 400; line-height: 1.6; }

@media print {
  .sidenav, .tabbar, .mobile-subnav, .verify-banner, .theme-toggle { display: none !important; }
  body { background: #fff !important; color: #000; }
  .card { box-shadow: none; break-inside: avoid; border-color: #ccc; }
}

/* ---------------------------------------------------------------- 더보기 (휴대폰) */
.more-list { display: grid; padding: 6px; }
.more-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px 12px; border-radius: 12px; text-decoration: none; font-weight: 600; }
a.more-item:hover { background: var(--surface-2); }
.more-item + .more-item { border-top: 1px solid var(--line); }
