@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@500;700;900&family=Noto+Sans+KR:wght@400;500;700&display=swap');

:root {
  /* --- 색상 토큰 --- */
  --ink-900: #12172C;
  --ink-800: #1B2340;
  --ink-700: #242D52;
  --ink-600: #313B63;
  --hairline: rgba(243, 239, 230, 0.10);

  --gold: #C89B3C;
  --gold-bright: #F3D98B;
  --amber: #E1A94C;
  --sage: #4C8C6B;
  --heart-red: #C1443C;

  --paper: #F3EFE6;
  --paper-dim: rgba(243, 239, 230, 0.62);
  --paper-faint: rgba(243, 239, 230, 0.36);

  /* --- 타이포 --- */
  --font-display: 'Noto Serif KR', serif;
  --font-body: 'Noto Sans KR', sans-serif;

  /* --- 레이아웃 --- */
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --nav-h: 78px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink-900);
  color: var(--paper);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input {
  font-family: inherit;
}

::selection { background: var(--gold); color: var(--ink-900); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ================= 레이아웃 공통 ================= */

.app-shell {
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.top-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, var(--ink-900) 70%, rgba(18,23,44,0));
}

.top-header .lamp-mark {
  width: 34px; height: 34px; flex-shrink: 0;
}

.top-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.35;
  margin: 0;
  letter-spacing: -0.2px;
  flex: 1;
}

.top-header .accent { color: var(--gold-bright); }

.logout-icon-btn {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: var(--ink-700);
  color: var(--paper-dim);
  display: flex; align-items: center; justify-content: center;
}
.logout-icon-btn svg { width: 17px; height: 17px; }
.logout-icon-btn:active { transform: scale(0.94); }

.view {
  flex: 1;
  display: none;
  flex-direction: column;
  padding: 4px 20px calc(var(--nav-h) + 28px);
  animation: fadeIn .28s ease;
}
.view.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= 하단 내비게이션 ================= */

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 520px;
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--ink-800);
  border-top: 1px solid var(--hairline);
  display: flex;
  z-index: 20;
}

.nav-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--paper-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 500;
  padding-top: 6px;
}

.nav-btn svg { width: 23px; height: 23px; stroke: currentColor; }

.nav-btn.active { color: var(--gold-bright); }
.nav-btn.active svg { stroke: var(--gold-bright); }

/* ================= 인증 화면 ================= */

.auth-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 26px;
  min-height: 100dvh;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}

.auth-hero {
  text-align: center;
  margin-bottom: 40px;
}

.auth-hero .lamp-mark { width: 60px; height: 60px; margin: 0 auto 18px; display: block; }

.auth-hero h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.5;
  margin: 0 0 8px;
}

.auth-hero p {
  color: var(--paper-dim);
  font-size: 14px;
  margin: 0;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12.5px;
  color: var(--paper-dim);
  margin-bottom: 7px;
  font-weight: 500;
}

.field input {
  width: 100%;
  background: var(--ink-700);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  color: var(--paper);
  padding: 14px 16px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: var(--gold); }

.btn-primary {
  width: 100%;
  background: var(--gold);
  color: var(--ink-900);
  border: none;
  border-radius: var(--radius-md);
  padding: 15px;
  font-size: 15.5px;
  font-weight: 700;
  margin-top: 8px;
  transition: transform .12s, background .15s;
}
.btn-primary:active { transform: scale(0.98); background: var(--gold-bright); }

.btn-ghost {
  width: 100%;
  background: none;
  border: 1px solid var(--hairline);
  color: var(--paper);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 14.5px;
  font-weight: 500;
  margin-top: 10px;
}

.auth-switch {
  text-align: center;
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--paper-dim);
}
.auth-switch button {
  background: none; border: none; color: var(--gold-bright);
  font-weight: 700; font-size: 13.5px; padding: 0 4px;
}

.error-msg {
  background: rgba(193, 68, 60, 0.15);
  border: 1px solid rgba(193, 68, 60, 0.4);
  color: #E8908A;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.error-msg.show { display: block; }

/* ================= 홈 ================= */

.greeting {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  margin: 10px 0 4px;
  line-height: 1.5;
}
.greeting .name { color: var(--gold-bright); }

.home-streak-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-bright);
  font-size: 13.5px;
  font-weight: 700;
  margin: 0 0 6px;
}
.home-streak-line::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-bright);
  flex-shrink: 0;
}

.date-sub {
  color: var(--paper-dim);
  font-size: 13.5px;
  margin: 0 0 26px;
}

.home-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.home-card {
  background: var(--ink-700);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  color: var(--paper);
  position: relative;
  overflow: hidden;
}

.home-card .icon-badge {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(200,155,60,0.16);
}
.home-card .icon-badge svg { width: 24px; height: 24px; stroke: var(--gold-bright); }

.home-card .card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin: 0 0 3px;
}
.home-card .card-sub { font-size: 12.5px; color: var(--paper-dim); margin: 0; }

.home-card .status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--paper-faint);
  margin-left: auto; flex-shrink: 0;
}
.home-card .status-dot.done { background: var(--sage); }

/* 홈 화면 랭킹 섹션 */
#home-ranking-section {
  margin-top: 30px;
  background: var(--ink-700);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.ranking-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 4px;
  color: var(--gold-bright);
}
#home-ranking-list .rank-row:first-child { padding-top: 12px; }

/* ================= 콘텐츠 뷰(오늘의 구속사 / 말씀) ================= */

.content-view-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.content-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  margin: 6px 0 18px;
}

.image-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.image-stack img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline);
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--paper-faint);
  padding: 60px 20px;
  gap: 10px;
}
.empty-state svg { width: 40px; height: 40px; stroke: var(--paper-faint); }
.empty-state p { margin: 0; font-size: 14px; }

.verse-card {
  background: var(--ink-700);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  margin-bottom: 20px;
}
.verse-ref {
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: 0.3px;
}
.verse-text {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 2;
  white-space: pre-wrap;
  margin: 0;
}

.complete-btn {
  width: 100%;
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold-bright);
  border-radius: var(--radius-md);
  padding: 15px;
  font-size: 15px;
  font-weight: 700;
  margin-top: auto;
  transition: background .15s, transform .12s;
}
.complete-btn:active { transform: scale(0.98); }
.complete-btn.done {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--paper);
}

/* 완료 오버레이 */
.done-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18,23,44,0.86);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.done-overlay.show { opacity: 1; pointer-events: auto; }

.done-overlay .heart {
  width: 84px; height: 84px;
  animation: heartPop .5s cubic-bezier(.2,1.4,.4,1);
}
@keyframes heartPop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.done-overlay p {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin: 18px 0 0;
  text-align: center;
  padding: 0 30px;
}

/* ================= 캘린더 ================= */

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 20px;
}
.calendar-header h2 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0;
}
.cal-nav-btn {
  background: var(--ink-700);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--paper);
}
.cal-nav-btn svg { width: 16px; height: 16px; }

.cal-weekdays, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-weekdays div {
  text-align: center;
  font-size: 11.5px;
  color: var(--paper-faint);
  padding-bottom: 10px;
  font-weight: 500;
}
.cal-grid { gap: 6px; }

.cal-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--ink-700);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  gap: 5px;
  position: relative;
  color: var(--paper);
  padding: 0;
  transition: transform .12s;
}
.cal-cell.clickable { cursor: pointer; }
.cal-cell.clickable:active { transform: scale(0.93); }
.cal-cell.empty { background: transparent; border: none; }
.cal-cell.today { border-color: var(--gold); }
.cal-cell .dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.cal-cell.status-green { background: rgba(76,140,107,0.28); border-color: var(--sage); }
.cal-cell.status-green .dot { background: var(--sage); }
.cal-cell.status-yellow { background: rgba(225,169,76,0.22); border-color: var(--amber); }
.cal-cell.status-yellow .dot { background: var(--amber); }

.cal-legend {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--paper-dim);
}
.cal-legend span { display: flex; align-items: center; gap: 6px; }
.cal-legend .lg-dot { width: 9px; height: 9px; border-radius: 50%; }

/* ================= 날짜 상세 화면 (캘린더에서 진입) ================= */

.day-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 18px;
}
.back-btn {
  background: none;
  border: none;
  color: var(--paper-dim);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  padding: 0;
}
.back-btn svg { width: 16px; height: 16px; }
.day-detail-date {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  margin: 0;
}

/* ================= 관리자 페이지 전용 ================= */

.admin-shell { max-width: 640px; width: 100%; margin: 0 auto; padding: 0 20px calc(var(--nav-h) + 28px); }

.admin-top-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 0 20px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, var(--ink-900) 78%, rgba(18,23,44,0));
}
.admin-top-header h1 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0;
}
.admin-top-header .logout-icon-btn { margin-top: 2px; }

.admin-view { display: none; animation: fadeIn .28s ease; }
.admin-view.active { display: block; }

/* 날짜 이동 바 (컨텐츠 업로드 탭 상단) */
.date-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink-700);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 10px;
  margin-bottom: 20px;
}
.date-nav-arrow {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 11px;
  border: 1px solid var(--hairline);
  background: var(--ink-800);
  color: var(--paper-dim);
  display: flex; align-items: center; justify-content: center;
}
.date-nav-arrow svg { width: 16px; height: 16px; }
.date-nav-arrow:active { transform: scale(0.92); background: var(--ink-700); }

.date-nav-center {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.date-nav-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  margin: 0;
  color: var(--gold-bright);
  pointer-events: none;
  white-space: nowrap;
}
.date-nav-center input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  background: none;
  border: none;
  color: var(--paper-faint);
  font-size: 11.5px;
  text-align: center;
  padding: 2px 0 0;
  margin: 0;
  width: 100%;
  max-width: 160px;
}

.admin-bottom-nav { max-width: 640px; }

.admin-sub { color: var(--paper-dim); font-size: 13px; margin: 0 0 26px; }

.admin-card {
  background: var(--ink-700);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 18px;
}
.admin-card h2 {
  font-family: var(--font-display);
  font-size: 15.5px;
  margin: 0 0 16px;
  color: var(--gold-bright);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

textarea {
  width: 100%;
  background: var(--ink-800);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  color: var(--paper);
  padding: 13px 15px;
  font-size: 14.5px;
  font-family: var(--font-body);
  min-height: 110px;
  resize: vertical;
  outline: none;
}
textarea:focus, select:focus { border-color: var(--gold); }

select {
  width: 100%;
  background: var(--ink-800);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  color: var(--paper);
  padding: 13px 15px;
  font-size: 14.5px;
  outline: none;
}

.file-drop {
  display: block;
  border: 1.5px dashed var(--hairline);
  border-radius: var(--radius-md);
  padding: 26px;
  text-align: center;
  color: var(--paper-dim);
  font-size: 13.5px;
  cursor: pointer;
}
.file-drop:hover { border-color: var(--gold); }

.thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.thumb {
  position: relative;
  width: 80px; height: 80px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--hairline);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .del-btn {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px;
  background: rgba(18,23,44,0.8);
  border: none; border-radius: 50%;
  color: var(--paper); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.thumb .order-controls {
  position: absolute; bottom: 3px; left: 3px; right: 3px;
  display: flex; justify-content: space-between; gap: 3px;
}
.thumb .order-btn {
  flex: 1;
  background: rgba(18,23,44,0.75);
  border: none; border-radius: 6px;
  color: var(--paper); font-size: 11px;
  padding: 3px 0;
  display: flex; align-items: center; justify-content: center;
}
.thumb .order-btn:disabled { opacity: 0.3; }

.admin-cal-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--ink-800);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  gap: 3px;
  color: var(--paper);
  cursor: pointer;
  transition: transform .12s;
}
.admin-cal-cell:active { transform: scale(0.93); }
.admin-cal-cell.empty { background: transparent; border: none; cursor: default; }
.admin-cal-cell.has-content { border-color: var(--gold); }
.admin-cal-cell.selected { background: rgba(200,155,60,0.22); border-color: var(--gold); }
.admin-cal-cell .badge {
  font-size: 10px;
  color: var(--paper-dim);
  background: rgba(243,239,230,0.08);
  border-radius: 20px;
  padding: 1px 6px;
}
.admin-cal-cell.has-completions .badge { color: var(--sage); background: rgba(76,140,107,0.2); }

/* 회원 목록 */
.user-block { border-bottom: 1px solid var(--hairline); }
.user-block:last-child { border-bottom: none; }
.user-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  gap: 12px;
}
.user-row .user-info p { margin: 0; }
.user-row .user-name { font-size: 14px; font-weight: 500; }
.user-row .user-id { font-size: 12px; color: var(--paper-dim); }
.user-row .user-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.user-row .exclude-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--paper-dim); white-space: nowrap;
}
.edit-btn {
  background: none; border: 1px solid var(--hairline); border-radius: 8px;
  color: var(--paper-dim); font-size: 12px; padding: 6px 10px; white-space: nowrap;
}
.edit-btn:active { transform: scale(0.96); }

.user-edit-form {
  display: none;
  padding: 4px 0 16px;
}
.user-edit-form.show { display: block; }
.user-edit-form .grid-2 { margin-bottom: 0; }
.user-edit-form .field { margin-bottom: 10px; }
.user-edit-form .edit-actions { display: flex; gap: 10px; margin-top: 4px; }
.user-edit-form .edit-actions button { flex: 1; padding: 11px; font-size: 13px; }

/* 토글(체크박스) */
.toggle-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; cursor: pointer;
}
.toggle-row input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--gold);
}

/* 랭킹 탭 */
.rank-tab { font-size: 13px; padding: 11px 4px; }
.rank-tab.active { border-color: var(--gold); color: var(--gold-bright); background: rgba(200,155,60,0.1); }

.rank-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--hairline);
}
.rank-row:last-child { border-bottom: none; }
.rank-row .rank-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink-800);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--paper-dim);
  flex-shrink: 0;
}
.rank-row.top1 .rank-num { background: var(--gold); color: var(--ink-900); }
.rank-row.top2 .rank-num { background: #9AA5C4; color: var(--ink-900); }
.rank-row.top3 .rank-num { background: #B08D57; color: var(--ink-900); }
.rank-row .rank-name { flex: 1; font-size: 13.5px; }
.rank-row .rank-score { font-size: 12.5px; color: var(--paper-dim); }
.rank-row.excluded { opacity: 0.4; }
.rank-row .rank-excluded-tag {
  font-size: 10px; background: rgba(193,68,60,0.18); color: #E28A83;
  padding: 2px 7px; border-radius: 20px; margin-left: 6px;
}

.completion-list { font-size: 13.5px; }
.completion-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--hairline);
}
.completion-row:last-child { border-bottom: none; }
.tag { font-size: 11px; padding: 3px 9px; border-radius: 20px; }
.tag.gusoksa { background: rgba(200,155,60,0.2); color: var(--gold-bright); }
.tag.verse { background: rgba(76,140,107,0.25); color: #9FD3B8; }

.tag-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag-cancel-btn {
  border: none; background: rgba(193,68,60,0.18); color: #E28A83;
  font-size: 10.5px; padding: 3px 8px; border-radius: 20px; cursor: pointer;
}
.tag-cancel-btn:active { transform: scale(0.95); }

.verse-item {
  padding: 10px 0; border-bottom: 1px solid var(--hairline);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.verse-item:last-child { border-bottom: none; }
.verse-item .verse-item-ref { font-size: 12.5px; color: var(--gold-bright); margin: 0 0 3px; }
.verse-item .verse-item-text { font-size: 13px; color: var(--paper-dim); margin: 0; }
.verse-item .del-btn {
  flex-shrink: 0;
  width: 22px; height: 22px;
  background: rgba(18,23,44,0.8);
  border: none; border-radius: 50%;
  color: var(--paper); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink-700);
  border: 1px solid var(--hairline);
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

.hidden { display: none !important; }

/* ================= 홈: 연속 완료 / 주간 기록 ================= */
.streak-summary {
  margin-top: 22px;
  padding: 22px 20px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(200, 155, 60, 0.24);
  background:
    radial-gradient(circle at 90% 0%, rgba(243, 217, 139, 0.12), transparent 42%),
    linear-gradient(145deg, rgba(49, 59, 99, 0.98), rgba(36, 45, 82, 0.96));
  box-shadow: 0 12px 28px rgba(5, 8, 20, 0.18);
}

.streak-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-bottom: 20px;
  text-align: center;
}

.streak-label {
  margin: 0;
  color: var(--paper-dim);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.streak-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  margin: 0;
  color: var(--gold-bright);
  line-height: 1;
}

.streak-value strong {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -2px;
}

.streak-value span {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.streak-message {
  max-width: 100%;
  margin: 2px 0 0;
  color: var(--paper-dim);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.week-progress {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.week-label {
  color: var(--paper-faint);
  font-size: 11px;
  font-weight: 700;
}

.week-check {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(243, 239, 230, 0.10);
  border: 1px solid rgba(243, 239, 230, 0.08);
  color: var(--ink-900);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.week-check svg { width: 18px; height: 18px; }

.week-day.completed .week-label { color: var(--gold-bright); }
.week-day.completed .week-check {
  background: linear-gradient(145deg, var(--gold-bright), var(--gold));
  border-color: rgba(243, 217, 139, 0.72);
  box-shadow: 0 5px 14px rgba(200, 155, 60, 0.26);
}

.week-day.today .week-check {
  outline: 2px solid rgba(243, 217, 139, 0.28);
  outline-offset: 3px;
}

@media (max-width: 360px) {
  .streak-summary { padding-left: 16px; padding-right: 16px; }
  .week-progress { gap: 5px; }
  .week-check { width: 31px; height: 31px; }
}

/* 완료 메시지 이후 표시되는 연속 완료 화면 */
.done-simple {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.overlay-streak {
  width: min(calc(100% - 36px), 430px);
  margin: 0;
  animation: summaryPop .38s cubic-bezier(.2,1.2,.4,1);
}

.overlay-guide {
  margin: 16px 0 0;
  color: var(--paper-faint);
  font-size: 11px;
  text-align: center;
}

@keyframes summaryPop {
  from { transform: translateY(14px) scale(.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
