/* 주거 강화 — 화면 (두뇌 · 신체 강화의 공통 부품을 가져옴)
   금빛 한 가지 색을 진하기로 나눠 쓴다 (달력: 옅을수록 적게 → 진할수록 많이). 빨강(--bad)은 틀림 표시에만.
   테마 토큰은 app.css(밤의 학당)와 같다. */
:root {
  --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));
  --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; }


/* ---------------------------------------------------------------- 공통 부품 (루틴 강화와 같은 모양) */
.onboard-mark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--me); color: var(--brand-ink); }
.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); } }
.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 .goal-list { margin-top: 10px; }
.amount-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 320px; }
.amount-row:empty { display: none; }
.choice-chip { display: inline-flex; align-items: center; gap: 5px; }
.danger-row { justify-content: space-between; }

.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; } }
.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; }
.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.lv1 { background: var(--lv1); }
.heat-cell.lv2 { background: var(--lv2); }
.heat-cell.lv3 { background: var(--lv3); }
.heat-cell.lv4 { background: var(--accent-strong); }
.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 { display: block; max-width: 100%; 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; }

/* ---------------------------------------------------------------- 더보기 (휴대폰) */
.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); }


.tag.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }
.notice.ok { background: var(--ok-bg); margin-top: 0; }
.tip { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 14px; padding: 6px 4px; flex-wrap: wrap; }
.tip-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.slot-title { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 8px 2px 0; }
.session-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.session-list li { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.session-list li:last-child { border-bottom: 0; }
@media (max-width: 520px) { .session-list li { grid-template-columns: 1fr auto; } .session-list li > small { grid-column: 1 / -1; } }
.line-chart .pt { fill: var(--gold-2); stroke: var(--surface); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
@media (max-width: 560px) { .page-head.row-between { flex-wrap: wrap; } }

/* ---------------------------------------------------------------- 더보기 (휴대폰) */
.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); }


/* ---------------------------------------------------------------- 모집 공고 */
.housing .page-head p { max-width: 60ch; }
.alert-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--ink);
  background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); font-size: 14px; }
.alert-bar > span:nth-child(2) { flex: 1; min-width: 0; }
.alert-bar .btn { flex-shrink: 0; }
.alert-bar.on { background: var(--ok-bg); border-color: transparent; color: var(--ok-ink); }
.alert-bar.on b { color: inherit; }
@media (max-width: 560px) { .alert-bar { flex-wrap: wrap; } .alert-bar .btn { width: 100%; justify-content: center; } }

.latest { display: grid; gap: 6px; text-decoration: none; color: inherit; border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); }
.latest.fresh { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold-2) 55%, transparent), var(--shadow-1); }
.latest:hover { border-color: var(--gold-2); }
.latest-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--brand-ink); }
.latest-title { font-size: 19px; line-height: 1.45; }
.latest-go { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--brand-ink); font-size: 14px; }

.src-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .src-grid { grid-template-columns: 1fr; } }
.src-card { display: grid; gap: 10px; padding: 14px 16px; }
.src-card.bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.src-status { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.src-card.bad .src-status { color: var(--bad); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex-shrink: 0; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.dot.bad { background: var(--bad); }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.list-head .segmented .seg small { margin-left: 2px; font-weight: 600; }
.notice-list { list-style: none; margin: 0 0 10px; padding: 0; }
.notice-row { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); align-items: start; }
.notice-row:last-child { border-bottom: 0; }
.notice-date { display: grid; gap: 2px; font-variant-numeric: tabular-nums; font-size: 14px; }
.notice-date small { font-size: 12px; }
.notice-main { display: grid; gap: 6px; min-width: 0; }
.notice-title { color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.notice-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.notice-row.kind-recruit .notice-title { font-weight: 800; }
.notice-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.notice-tags .tag { font-size: 11.5px; padding: 1px 8px; }
.tag.new { background: var(--gold-2); color: #fff; border-color: transparent; }
.empty-line { padding: 18px 4px; }
@media (max-width: 520px) { .notice-row { grid-template-columns: 1fr; gap: 4px; } .notice-date { grid-auto-flow: column; justify-content: start; gap: 8px; } }

/* ---------------------------------------------------------------- 알림 */
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; line-height: 1.6; }
.steps .icon { vertical-align: -2px; }
.device-list { list-style: none; margin: 0; padding: 0; }
.device-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.device-list li:last-child { border-bottom: 0; }
.device-list .tag { margin-left: 6px; font-size: 11.5px; }
.list-head .choice-chips { gap: 6px; }
.list-head .choice-chip { padding: 6px 12px; font-size: 14px; }
