/* ==========================================================================
   99 Wisdom Insight — 사이트 컴포넌트 (v2 Light / Pastel)
   app.css 다음에 로드.

   ⚠ 스크립트 계약 — 아래는 JS가 의존하므로 변경 금지
     · 모달 열기        : .modal-backdrop.visible       (.active 아님)
     · 표시/숨김        : hidden 속성                    (display:none 기본값 금지)
     · 표지 넘기기      : .card-cover.hiding { display:none }
     · 로그인 바/소감   : .visible 클래스
     · 스낵바           : .show 클래스
   ========================================================================== */

[hidden] { display: none !important; }

/* ══════════ 오늘의 한 문장 카드 (daily.html) ══════════ */
.wisdom-card { max-width: 560px; margin: 0 auto; position: relative; }

/* 표지 */
.card-cover {
  position: relative; overflow: hidden; cursor: pointer; user-select: none;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, #fff);
  border-radius: 22px; padding: 46px 34px 40px; text-align: center;
  background:
    radial-gradient(110% 80% at 50% 0%, color-mix(in srgb, var(--accent) 20%, #fff), transparent 62%),
    var(--surface);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center;
  transition: transform .25s, box-shadow .25s;
}
.card-cover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-cover:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.card-cover.hiding { display: none; }
.card-cover > * { position: relative; z-index: 2; }

.cover-ghost-99 {
  position: absolute; z-index: 1; left: 50%; top: 44%; transform: translate(-50%,-50%);
  font-family: var(--serif-display); font-weight: 900; font-size: 11rem; line-height: 1;
  color: color-mix(in srgb, var(--accent) 12%, #fff);
  letter-spacing: -.05em; pointer-events: none;
}
.cover-streak {
  display: none;
  font-family: var(--mono); font-size: .69rem; letter-spacing: .06em;
  border-radius: 999px; padding: 5px 14px; margin-bottom: 16px;
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  color: color-mix(in srgb, var(--accent) 80%, #000);
}
.cover-label {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .24em;
  text-transform: uppercase; color: color-mix(in srgb, var(--accent) 82%, #000);
}
.cover-date { font-size: .87rem; color: var(--muted); margin-top: 7px; margin-bottom: 28px; }
.cover-ornament { margin-bottom: 18px; }
.cover-ornament svg { width: 54px; height: 54px; stroke: var(--accent); fill: none; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.cover-title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.7rem, 5.4vw, 2.1rem); line-height: 1.38;
  letter-spacing: -.02em; margin-bottom: 12px; word-break: keep-all;
}
.cover-desc { font-size: .9rem; color: var(--muted); line-height: 1.8; margin-bottom: 28px; word-break: keep-all; }
.cover-btn {
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--ink); border-radius: 999px; padding: 11px 26px;
  font-size: .87rem; cursor: pointer; transition: all .2s;
}
.card-cover:hover .cover-btn { border-color: var(--ink); box-shadow: var(--shadow); }

/* 본문 */
.card-page {
  border: 1px solid var(--line); border-radius: 22px;
  background: var(--surface); box-shadow: var(--shadow);
  padding: 32px 30px 28px;
  animation: pageIn .45s ease both;
}
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.page-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding-bottom: 15px; border-bottom: 1px solid var(--line);
}
.page-chapter {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: color-mix(in srgb, var(--accent) 82%, #000);
  display: inline-flex; align-items: center; gap: 8px;
}
.page-chapter::before { content:''; width:6px; height:6px; border-radius:50%; background: var(--accent); flex:none; }
/* hidden 속성으로 제어 — display:none 기본값 금지 */
.streak-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: .69rem; border-radius: 999px; padding: 4px 11px;
  background: color-mix(in srgb, var(--p1) 16%, #fff);
  color: color-mix(in srgb, var(--p1) 78%, #000);
}
.page-date { margin-left: auto; font-family: var(--mono); font-size: .69rem; color: var(--muted-2); }

.key-sentence { margin-top: 22px; }
.key-label {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .15em;
  text-transform: uppercase; color: var(--muted-2); display: block; margin-bottom: 10px;
}
.key-title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2.05rem); line-height: 1.34;
  letter-spacing: -.03em; word-break: keep-all;
}
.page-subtitle { font-family: var(--serif); font-size: 1rem; line-height: 1.7; color: var(--muted); margin-top: 13px; word-break: keep-all; }
.page-summary {
  font-size: .96rem; line-height: 1.92; color: var(--ink-2);
  margin-top: 19px; padding-top: 19px; border-top: 1px solid var(--line); word-break: keep-all;
}

/* 공유된 소감 */
.shared-memo-box {
  display: none; margin-top: 20px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, #fff);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 15px 18px;
}
.shared-memo-box.visible { display: block; }
.shared-memo-label {
  font-family: var(--mono); font-size: .63rem; letter-spacing: .13em;
  text-transform: uppercase; color: color-mix(in srgb, var(--accent) 80%, #000);
}
.shared-memo-text { font-size: .89rem; color: var(--ink-2); line-height: 1.8; margin-top: 7px; white-space: pre-wrap; word-break: keep-all; }

/* 액션 */
.page-actions { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.btn-read {
  background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: 14px 24px; font-size: .92rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 3px 12px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: filter .2s, transform .2s;
}
.btn-read:hover { filter: brightness(1.06); transform: translateY(-1px); }
.secondary-actions { display: flex; gap: 10px; }
.btn-save, .btn-share {
  flex: 1; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2); border-radius: 999px; padding: 11px 16px;
  font-size: .85rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all .2s;
}
.btn-save:hover, .btn-share:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn-save.saved {
  border-color: color-mix(in srgb, var(--accent) 50%, #fff);
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  color: color-mix(in srgb, var(--accent) 80%, #000);
}
.btn-reroll {
  background: transparent; border: 1px dashed var(--line-strong); color: var(--muted);
  border-radius: 999px; padding: 10px 16px; font-size: .84rem; cursor: pointer; transition: all .2s;
}
.btn-reroll:hover:not(:disabled) { color: var(--ink-2); background: var(--surface-2); }
.btn-reroll:disabled { opacity: .45; cursor: default; }
.reroll-hint { font-family: var(--mono); font-size: .69rem; color: var(--muted-2); text-align: center; }

/* ══════════ 로그인 사용자 바 · 추천인 ══════════ */
.logged-in-bar {
  display: none; max-width: 560px; margin: 20px auto 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 16px 20px;
  align-items: center; gap: 16px; flex-wrap: wrap;
}
.logged-in-bar.visible { display: flex; }
/* 바는 max-width:560px 라 뷰포트가 아무리 넓어도 이 폭을 넘지 않는다.
   버튼이 다섯 개면 그만으로 한 줄이 차서, flex:1 에 min-width:0 이던
   인사말이 0폭까지 눌려 한 글자씩 세로로 쌓였다. 뷰포트 미디어쿼리로는
   잡을 수 없는 문제라(컨테이너 폭 문제다), 아예 각자 한 줄씩 차지하게 한다. */
.logged-in-name {
  font-size: .9rem; color: var(--ink-2);
  flex: 1 0 100%; min-width: 0; word-break: keep-all;
}
.user-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.btn-goto-book {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  border-radius: 999px; padding: 8px 16px; font-size: .8rem;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  cursor: pointer; transition: all .2s;
}
.btn-goto-book:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn-goto-book.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.btn-goto-book.primary:hover { filter: brightness(1.06); }
.btn-goto-book.notify { background: #5FA97E; color: #fff; border-color: #5FA97E; font-weight: 700; }

.referral-panel {
  display: none; max-width: 560px; margin: 14px auto 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 20px 22px;
}
.referral-panel.visible { display: block; }
.referral-panel h4 { font-size: .95rem; font-weight: 600; margin-bottom: 14px; }
.referral-link-row { display: flex; gap: 9px; align-items: stretch; }
.referral-link-box {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-2); padding: 10px 13px;
  font-family: var(--mono); font-size: .76rem; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center;
}
.referral-copy-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 9px;
  padding: 10px 18px; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.referral-stats { margin-top: 13px; font-size: .83rem; color: var(--muted); line-height: 1.8; }
/* 이 뱃지는 스타일이 없어 맨글로 묻혀 있었다. */
.referral-badge {
  display: inline-block; margin-left: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .76rem; background: color-mix(in srgb, var(--accent) 13%, #fff);
  color: color-mix(in srgb, var(--accent) 72%, #000);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
}

/* ══════════ 모달 공통 ══════════ */
.modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(28,30,27,.42); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 20px;
  overflow-y: auto; opacity: 0; transition: opacity .25s;
}
.modal-backdrop.visible { display: flex; opacity: 1; }
.modal-sheet {
  width: 100%; max-width: 430px; margin: auto;
  border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface); box-shadow: 0 20px 60px rgba(28,30,27,.22);
  padding: 26px 26px 28px;
}
.modal-handle { width: 38px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 0 auto 20px; }
.modal-title { font-family: var(--serif); font-weight: 700; font-size: 1.32rem; text-align: center; letter-spacing: -.025em; }
.modal-subtitle { font-size: .86rem; color: var(--muted); text-align: center; margin-top: 9px; line-height: 1.7; word-break: keep-all; }
.modal-note { font-size: .83rem; color: var(--muted-2); text-align: center; margin: 9px 0 18px; line-height: 1.7; }
.modal-section-label { font-family: var(--mono); font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin: 0 0 11px; }
.modal-hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.modal-btn-row { display: flex; gap: 9px; }
.modal-box {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 15px 16px; margin-bottom: 18px;
}
.modal-box p { margin: 0; }

/* 탭 */
.tab-row { display: flex; gap: 6px; margin: 22px 0 18px; border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.tab-btn {
  flex: 1; background: transparent; border: none; border-radius: 999px;
  padding: 9px; font-size: .86rem; color: var(--muted); cursor: pointer; transition: all .2s;
}
.tab-btn.active { background: var(--accent); color: #fff; font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 폼 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  padding: 11px 13px; font-size: .93rem; font-family: var(--sans); transition: border-color .18s;
}
.field input:focus, .field textarea:focus, select:focus { outline: none; border-color: var(--accent); }
select { cursor: pointer; }
.btn-submit {
  width: 100%; background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: 13px; font-size: .92rem; font-weight: 600; cursor: pointer; margin-top: 6px;
  box-shadow: 0 3px 12px color-mix(in srgb, var(--accent) 28%, transparent);
  transition: filter .2s;
}
.btn-submit:hover { filter: brightness(1.06); }
.btn-submit:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn-ghost {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  border-radius: 999px; padding: 13px; font-size: .9rem; cursor: pointer; transition: all .2s;
}
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-2); }
.remember-row { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); margin-bottom: 14px; cursor: pointer; }
.remember-row input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.forgot-link { text-align: center; font-size: .8rem; color: var(--muted-2); margin-top: 15px; cursor: pointer; }
.forgot-link:hover { color: var(--muted); }

.alert { display: none; border-radius: 10px; padding: 11px 14px; font-size: .84rem; margin-bottom: 14px; line-height: 1.6; }
.alert.show { display: block; }
.alert-error   { background: color-mix(in srgb, var(--p7) 12%, #fff); border: 1px solid color-mix(in srgb, var(--p7) 38%, #fff); color: color-mix(in srgb, var(--p7) 75%, #000); }
.alert-success { background: color-mix(in srgb, var(--p2) 12%, #fff); border: 1px solid color-mix(in srgb, var(--p2) 38%, #fff); color: color-mix(in srgb, var(--p2) 75%, #000); }

.divider-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.divider-or::before, .divider-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.divider-or span { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; color: var(--muted-2); text-transform: uppercase; }


/* 요일 칩 */
.day-chip { cursor: pointer; }
.day-chip input { display: none; }
.day-chip span {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); display: grid; place-items: center;
  font-size: .83rem; color: var(--muted); background: var(--surface); transition: all .18s;
}
.day-chip input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

/* 토글 */
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute; inset: 0; border-radius: 999px; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--line); transition: all .2s;
}
.toggle-slider::before {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(28,30,27,.25); transition: transform .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* 공유 시트 */
/* 이모지 아이콘을 선 아이콘으로 바꿨다. 인스타 브랜드 그라데이션 타일이
   절제된 팔레트에서 혼자 튀었고, 이모지는 기기마다 다르게 그려진다. */
.share-option-btn, .share-opt-btn {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.share-option-btn:hover, .share-opt-btn:hover {
  border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-1px);
}
.share-option-btn:active, .share-opt-btn:active { transform: none; }
.share-option-icon, .share-opt-icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line);
}
/* 주된 행동에만 강조 색을 준다 */
.share-option-icon.accent, .share-opt-icon.accent {
  background: color-mix(in srgb, var(--accent) 11%, #fff);
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
  color: color-mix(in srgb, var(--accent) 72%, var(--ink));
}
.share-option-icon svg, .share-opt-icon svg {
  width: 21px; height: 21px; display: block;
  stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.share-option-label, .share-opt-label {
  font-size: .93rem; font-weight: 600; color: var(--ink); line-height: 1.4;
}
.share-option-label small, .share-opt-label small {
  display: block; font-size: .765rem; font-weight: 400;
  color: var(--muted-2); margin-top: 3px; letter-spacing: -.01em;
}

.share-toast, .snackbar {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 11px 22px; font-size: .86rem; font-weight: 600;
  box-shadow: 0 8px 24px rgba(28,30,27,.25);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 1300;
}
.share-toast.show, .snackbar.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 인스타 · 소감 · 마일스톤 · 공유 오버레이 */
.insta-overlay, .memo-save-overlay, .milestone-overlay, .share-overlay {
  position: fixed; inset: 0; z-index: 1250;
  background: rgba(28,30,27,.46); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto;
}
.insta-sheet, .memo-save-sheet, .milestone-box, .share-sheet {
  width: 100%; max-width: 410px; margin: auto;
  border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface); box-shadow: 0 20px 60px rgba(28,30,27,.22); padding: 24px;
}
.share-handle { width: 38px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 0 auto 18px; }
.share-title { font-family: var(--serif); font-weight: 700; font-size: 1.16rem; text-align: center; letter-spacing: -.02em; }
.share-preview-box {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 16px 18px; margin: 16px 0 18px; word-break: keep-all;
}
.share-preview-box .preview-title { font-family: var(--serif); font-weight: 700; font-size: 1.02rem; line-height: 1.45; letter-spacing: -.02em; }
.share-preview-box .preview-memo {
  font-size: .86rem; color: var(--muted); line-height: 1.8;
  margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--line); white-space: pre-wrap;
}
.share-options { display: flex; flex-direction: column; gap: 10px; }

.insta-instruction { font-size: .86rem; color: var(--muted); text-align: center; margin: 14px 0 16px; line-height: 1.7; }
.insta-instruction strong { color: var(--ink); }
.insta-preview-img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.btn-insta-open {
  width: 100%; margin-top: 16px; border: none; border-radius: 999px;
  background: linear-gradient(45deg,#f09433,#dc2743,#bc1888); color: #fff;
  padding: 13px; font-size: .9rem; font-weight: 600; cursor: pointer;
}
.btn-insta-close {
  width: 100%; margin-top: 9px; background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); border-radius: 999px; padding: 12px; font-size: .88rem; cursor: pointer;
}

.memo-save-title { font-family: var(--serif); font-weight: 700; font-size: 1.14rem; text-align: center; letter-spacing: -.02em; }
.memo-save-sub { font-size: .83rem; color: var(--muted-2); text-align: center; margin: 8px 0 16px; line-height: 1.6; }
.memo-save-textarea, .memo-textarea {
  width: 100%; min-height: 110px; resize: vertical;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); color: var(--ink);
  padding: 13px; font-size: .92rem; font-family: var(--sans); line-height: 1.75;
}
.memo-save-textarea:focus, .memo-textarea:focus { outline: none; border-color: var(--accent); }
.memo-save-charcount, .memo-char-count { text-align: right; font-family: var(--mono); font-size: .7rem; color: var(--muted-2); margin-top: 7px; }
.memo-save-actions { display: flex; gap: 9px; margin-top: 16px; }
.btn-memo-skip {
  flex: 1; background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 12px; font-size: .88rem; cursor: pointer;
}
.btn-memo-confirm {
  flex: 2; background: var(--accent); color: #fff; border: none;
  border-radius: 999px; padding: 12px; font-size: .88rem; font-weight: 600; cursor: pointer;
}

.milestone-box { text-align: center; }
.milestone-icon { font-size: 2.6rem; margin-bottom: 12px; }
.milestone-days { font-family: var(--serif-display); font-weight: 900; font-size: 2rem; color: var(--accent); }
.milestone-msg { font-size: .92rem; color: var(--ink-2); line-height: 1.85; margin-top: 12px; word-break: keep-all; }
.btn-milestone-close {
  width: 100%; margin-top: 20px; background: var(--accent); color: #fff; border: none;
  border-radius: 999px; padding: 12px; font-size: .9rem; font-weight: 600; cursor: pointer;
}

/* ══════════ 보관함 (my-wisdom.html) ══════════ */
/* .top-bar 는 지웠다. 이 페이지만 다른 머리를 써서 내비도 푸터도 없었고,
   그 때문에 다른 사이트처럼 보였다. 이제 masthead 를 공유한다. */
.streak-pill {
  font-family: var(--mono); font-size: .7rem; border-radius: 999px; padding: 4px 12px;
  background: color-mix(in srgb, var(--p1) 16%, #fff); color: color-mix(in srgb, var(--p1) 78%, #000);
}

.main { max-width: 760px; margin: 0 auto; padding: 34px 20px 70px; }
.slabel .streak-pill { margin-left: 12px; }
.section-label {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .17em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 22px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}

.loading { text-align: center; padding: 60px 20px; color: var(--muted-2); font-size: .9rem; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%; margin: 0 auto 8px;
  border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 64px 20px 60px; }
/* 이모지였던 자리. 사이트의 다른 아트가 전부 선화라 결을 맞춘다. */
svg.empty-icon {
  width: 52px; height: 52px; display: block; margin: 0 auto;
  stroke: color-mix(in srgb, var(--accent) 60%, var(--muted-2));
  fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.empty-icon { font-size: 2.6rem; opacity: .7; }
.empty-title { font-family: var(--serif); font-weight: 700; font-size: 1.26rem; margin-top: 16px; letter-spacing: -.02em; }
.empty-desc { font-size: .92rem; color: var(--muted); line-height: 1.85; margin-top: 12px; word-break: keep-all; }
.btn-go-home {
  display: inline-flex; margin-top: 24px; background: var(--accent); color: #fff;
  border-radius: 999px; padding: 12px 26px; font-size: .9rem; font-weight: 600;
  box-shadow: 0 3px 12px color-mix(in srgb, var(--accent) 28%, transparent); transition: filter .2s;
}
.btn-go-home:hover { filter: brightness(1.06); }

/* ⚠ 이 선택자는 오랫동안 .wisdom-list > div.item 이었는데, buildCard 가
   만드는 요소는 div.wisdom-item 이라 단 한 번도 적용된 적이 없었다.
   배경·테두리·여백이 전부 0 이라 카드가 아니라 글 덩어리로 보였다. */
.wisdom-list { display: grid; gap: 15px; }
.wisdom-item {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 20px 22px 18px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
/* 왼쪽 세로 띄 — 카드마다 그 장이 속한 부의 색을 입는다 */
.wisdom-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
}
.wisdom-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
/* 배경에 깔리는 장 번호 */
.item-ghost {
  position: absolute; right: 14px; top: 2px; pointer-events: none;
  font-family: var(--serif-display); font-weight: 900; font-size: 3.4rem; line-height: 1;
  letter-spacing: -.04em; color: color-mix(in srgb, var(--accent) 13%, transparent);
}
.item-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.item-chapter {
  font-family: var(--mono); font-size: .67rem; letter-spacing: .11em; text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 60%, var(--ink));
  display: inline-flex; align-items: center; gap: 7px;
}
.item-chapter::before { content:''; width:6px;height:6px;border-radius:50%;background:var(--accent);flex:none; }
.item-title {
  font-family: var(--serif); font-weight: 700; font-size: 1.22rem; margin: 10px 0 0;
  line-height: 1.42; letter-spacing: -.025em; word-break: keep-all; position: relative;
}
.item-date { font-family: var(--mono); font-size: .67rem; color: var(--muted-2); margin-left: auto; }
.item-memo {
  border-left: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border-radius: var(--radius-sm); padding: 12px 15px; margin-top: 14px;
  font-size: .89rem; color: var(--ink-2); line-height: 1.8; white-space: pre-wrap; word-break: keep-all;
}
.item-actions {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
  margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line);
}
/* 읽기·공유는 왼쪽, 소감·삭제는 오른쪽. 전에는 두 묶음이 형제
   요소라 margin-left:auto 가 무시되고 줄만 갈라졌다. 이제 같은 행에 있다. */
.item-actions-sub { display: flex; gap: 8px; margin-left: auto; }
.btn-item-read, .btn-item-share, .btn-item-remove, .btn-memo, .btn-memo-cancel, .btn-memo-save {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 8px 16px; font-size: .8rem; cursor: pointer; transition: all .2s;
}
.btn-item-read:hover, .btn-item-share:hover, .btn-memo:hover, .btn-memo-cancel:hover {
  border-color: var(--line-strong); background: var(--surface-2);
}
.btn-item-read { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.btn-item-read:hover { filter: brightness(1.06); background: var(--accent); color: #fff; }
.btn-item-remove { color: var(--muted-2); }
.btn-item-remove:hover { border-color: var(--p7); color: var(--p7); background: color-mix(in srgb, var(--p7) 8%, #fff); }
.btn-memo-save { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.btn-memo-save:hover { filter: brightness(1.06); }
.memo-edit-area { margin-top: 15px; }
.memo-edit-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 11px; }

/* ══════════ 반응형 ══════════ */
@media (max-width: 720px) {
  .card-cover { padding: 38px 24px 34px; border-radius: 18px; }
  .card-page  { padding: 26px 20px 24px; border-radius: 18px; }
  .cover-ghost-99 { font-size: 8.5rem; }
  .modal-sheet { padding: 22px 20px 24px; }
  .logged-in-bar { align-items: stretch; gap: 12px; }
  .logged-in-name { text-align: center; }
  .user-actions > * { flex: 1 1 auto; justify-content: center; }
  .main { padding: 26px 16px 60px; }
  .item-actions-sub { margin-left: 0; }
  .wisdom-item { padding: 17px 18px 16px; }
  .item-ghost { font-size: 2.8rem; right: 11px; }
  .item-date { margin-left: 0; }
}

/* ══════════ 칼럼 공유 카드 (reader.html) ══════════ */
.share-cards {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start;
}
.share-cards figure {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface);
}
.share-cards img { width: 100%; height: auto; display: block; }
.share-cards figcaption {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .06em;
  color: var(--muted-2); padding: 9px 11px; border-top: 1px solid var(--line);
  text-transform: uppercase;
}
.share-btns { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.sbtn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
  padding: 10px 17px; font-size: .84rem; cursor: pointer; transition: all .18s;
}
.sbtn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.sbtn .ic {
  width: 14px; height: 14px; border-radius: 4px; flex: none;
  background: color-mix(in srgb, var(--accent) 45%, #fff);
}
.share-msg {
  font-family: var(--mono); font-size: .74rem; color: var(--accent);
  margin-top: 11px; min-height: 18px; opacity: 0; transition: opacity .2s;
  word-break: break-all;
}
.share-msg.on { opacity: 1; }

@media (max-width: 720px) {
  .share-cards { grid-template-columns: 1fr; }
  .share-btns > * { flex: 1; justify-content: center; }
}

/* ══════════ 칼럼 머리 — 앵커 문장이 주인공 ══════════
   각 장의 대표 문장(속담)이 독자에게 가장 먼저, 가장 크게 닿도록 한다.
   칼럼 제목은 그 문장을 읽는 '각도'로서 아래에 놓인다. */
.anchor-hero { margin: 22px 0 16px; }
.anchor-hero-q {
  position: relative;
  font-family: var(--serif); font-weight: 700;
  /* 데스크톱 30.4px = 기존 50.4px의 60%.
     하한을 1.45rem로 둔 이유: 모바일에서 본문(16.6px)과 붙어 위계가 사라지기 때문. */
  font-size: clamp(1.45rem, 3.7vw, 1.9rem);
  line-height: 1.42; letter-spacing: -.03em;
  color: var(--ink); word-break: keep-all;
  padding-left: .55em; text-indent: -.55em;
}
.anchor-hero-q::before {
  content: '\201C'; color: color-mix(in srgb, var(--accent) 65%, #fff);
  font-family: var(--serif-display); margin-right: .04em;
}
.anchor-hero-q::after {
  content: '\201D'; color: color-mix(in srgb, var(--accent) 65%, #fff);
  font-family: var(--serif-display); margin-left: .02em;
}

/* 상단은 앵커만 — 여백을 줄이고 구분선으로 본문과 끊는다 */
.art-head.anchor-only { padding: 44px 0 26px; }

/* 본문 시작부 — 칼럼 제목과 메타.
   ⚠ .art-head .art-title 로 쓰면 장 페이지(chapter-view) 제목까지
     줄어드므로 반드시 .art-open 아래로 한정한다. */
.art-open { margin-bottom: 0; }
/* 칼럼 제목은 화면에서 감춘다 — 앵커와 리드가 이미 글을 소개하므로 중복.
   다만 h1 은 검색·스크린리더·공유 카드의 근거이므로 마크업에는 남긴다. */
.art-open .art-title {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.art-open-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px;
  font-family: var(--mono); font-size: .67rem; letter-spacing: .03em;
  color: var(--muted-2);
}
.art-open-meta span + span::before { content: '· '; margin-right: 6px; }

/* 리드 — 훅을 본문 첫 문단으로. 구분선 없이 본문으로 이어진다. */
.art-body .art-lead {
  font-family: var(--serif); font-size: 1.1rem; line-height: 1.8;
  color: var(--ink-2); word-break: keep-all; margin-top: 16px;
}

/* 출처 1개일 때 — 목록 대신 한 줄 */
.source-one {
  font-size: .82rem; color: var(--muted-2); line-height: 1.85;
  border-top: 1px solid var(--line); padding-top: 16px;
  margin: 0 0 40px; word-break: keep-all;
}
.source-one .k {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .14em;
  text-transform: uppercase; color: color-mix(in srgb, var(--accent) 75%, #000);
  margin-right: 10px;
}
.source-one a { color: var(--muted); border-bottom: 1px solid var(--line); }

@media (max-width: 720px) {
  .anchor-hero { margin: 16px 0 12px; }
  .anchor-hero-q { line-height: 1.46; }
}

/* ══════════ 핵심 메시지 상징 문양 ══════════
   원형 16종 × 9부 색상 조합으로 칼럼마다 고유한 마크를 갖는다. */
.art-mark { margin-top: 22px; }
.art-mark svg.mark-lead {
  width: 76px; height: 76px;
  stroke: var(--accent); fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  opacity: .85;
}
/* 끝맺음 — 같은 문양을 작게, 가운데, 흐리게 */
.mark-close { display: flex; justify-content: center; margin: 44px 0 -8px; }
.mark-close svg.mark-end {
  width: 34px; height: 34px;
  stroke: var(--accent); fill: none;
  stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round;
  opacity: .42;
}
@media (max-width: 720px) {
  .art-mark { margin-top: 18px; }
  .art-mark svg.mark-lead { width: 62px; height: 62px; }
  .mark-close { margin: 34px 0 -6px; }
}
