:root,
html.theme-dark,
.theme-dark {
  --bg: #0b1220;
  --surface: #111827;
  --surface2: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --success: #34d399;
  --danger: #f87171;
  --radius: 12px;
  --font: "Pretendard Variable", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --heat-cell-size: 14px;
}

/* Light Theme (Day) */
html.theme-light,
.theme-light {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --accent: #0284c7;
  --success: #10b981;
  --danger: #f43f5e;
}

@media (min-width: 480px) {
  :root {
    --heat-cell-size: 16px;
  }
}
@media (min-width: 600px) {
  :root {
    --heat-cell-size: 18px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  background-color: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  background-image:
    radial-gradient(circle at 10% 10%, rgba(255, 107, 107, 0.18) 0%, transparent 60%),
    radial-gradient(circle at 90% 10%, rgba(255, 217, 61, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(77, 150, 255, 0.18) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(155, 89, 182, 0.15) 0%, transparent 50%);
  background-size: 250% 250%;
  background-attachment: fixed;
  animation: bgAurora 20s infinite alternate ease-in-out;
  line-height: 1.5;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
}

@keyframes bgAurora {
  0% { background-position: 0% 0%; }
  33% { background-position: 100% 0%; }
  66% { background-position: 100% 100%; }
  100% { background-position: 0% 100%; }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.is-hidden {
  display: none !important;
}

.landing-page {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: #0b1121;
  background-image:
    radial-gradient(circle at 10% 10%, rgba(255, 107, 107, 0.15) 0%, transparent 60%),
    radial-gradient(circle at 90% 10%, rgba(255, 217, 61, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(77, 150, 255, 0.15) 0%, transparent 60%);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(2rem + env(safe-area-inset-top, 0px)) 1.5rem calc(2rem + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  box-sizing: border-box;
}

#landing-lang-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.25rem 0.35rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: fit-content;
}

.lang-chip {
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.lang-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
}

.lang-chip.active {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35);
}

@media (max-width: 768px) {
  .landing-page {
    align-items: flex-start;
    padding-top: calc(2rem + env(safe-area-inset-top, 0px));
    padding-bottom: 2rem;
  }
  #landing-lang-bar {
    margin: 0 auto 1.25rem auto;
    width: max-content;
    max-width: 95vw;
    gap: 0.2rem;
    padding: 0.2rem 0.3rem;
  }
  .lang-chip {
    font-size: 0.7rem;
    padding: 0.25rem 0.45rem;
  }
  .landing-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
    margin: 0;
  }
  .landing-hero {
    display: flex;
    justify-content: center;
  }
  .hero-image {
    max-width: 75%;
    height: auto;
  }
  .landing-text h1 {
    font-size: 1.85rem;
  }
}

.landing-content {
  max-width: 960px;
  width: 100%;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 3rem;
  align-items: center;
  margin: auto 0;
  animation: fadeInScale 0.8s ease-out;
}

.landing-hero {
  position: relative;
}

.hero-image {
  width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.landing-text h1 {
  font-size: 2.35rem;
  font-weight: 800;
  margin: 0 0 1rem;
  line-height: 1.2;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-desc {
  font-size: 1.1rem;
  color: #cbd5e1;
  margin-bottom: 2rem;
  line-height: 1.6;
  font-weight: 500;
}

.landing-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.feat-item {
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  font-weight: 600;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.feat-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #ffffff;
  transform: translateX(4px);
}

.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.landing-actions .btn {
  padding: 1rem;
  font-size: 1rem;
  border-radius: 12px;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.header {
  margin-bottom: 1.25rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.brand-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.brand-title-box {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  min-width: 0;
}

.brand-title-text-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
  min-width: 0;
}

.brand-emblem {
  font-size: 1.35rem;
  color: #38bdf8;
  filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.65));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.brand-myeongjo-h1 {
  margin: 0;
  font-family: "Noto Serif KR", "Nanum Myeongjo", "Batang", serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  white-space: nowrap;
}

.brand-dual-badge {
  font-family: var(--font);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -0.01em;
  margin-left: 0.2rem;
  white-space: nowrap;
}

.brand-main-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn-support-chip {
  background: #FFDD00;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.72rem;
  padding: 0.25rem 0.45rem;
  height: 28px;
  line-height: 1;
  text-decoration: none;
  color: #000000;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  box-shadow: 0 2px 5px rgba(255, 221, 0, 0.25);
  transition: transform 0.15s ease;
  white-space: nowrap;
}
.btn-support-chip:hover {
  transform: translateY(-1px);
}

.brand-main-actions .btn {
  font-size: 0.72rem;
  padding: 0.25rem 0.5rem;
  height: 28px;
  line-height: 1;
  border-radius: 6px;
  white-space: nowrap;
}

.brand-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.brand-sub-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.tagline {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: -0.01em;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-utility-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.header-select-chip {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.2rem 0.35rem;
  height: 26px;
  line-height: 1;
  font-family: inherit;
  transition: all 0.2s ease;
}
.header-select-chip:hover {
  border-color: var(--accent);
}

@media (max-width: 540px) {
  .brand-sub-row {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .brand-sub-left {
    width: 100%;
    order: 2;
  }
  .brand-utility-controls {
    width: 100%;
    justify-content: flex-end;
    order: 1;
  }
  .brand-myeongjo-h1 {
    font-size: 1.25rem;
  }
  .brand-dual-badge {
    font-size: 0.7rem;
  }
  .tagline {
    font-size: 0.72rem;
  }
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  background: var(--surface2);
  color: var(--text);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  vertical-align: middle;
  margin-left: 0.4rem;
  margin-bottom: 0.15rem;
  white-space: nowrap;
}

.auth-badge.logged-in {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.2);
}

.motivation-banner {
  text-align: center;
  padding: 0.65rem 1.1rem;
  margin-bottom: 0.85rem;
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.motivation-text {
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f1f5f9;
  font-style: italic;
  animation: motivFade 1s ease-in-out;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes motivFade {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  background: var(--surface);
  padding: 0.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  min-width: 4.5rem;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--surface2);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--border);
}

main {
  flex: 1;
}

.panel[hidden] {
  display: none !important;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
}

.card h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.hint {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.form-grid input,
.form-grid select,
textarea {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}

.form-grid input[type="color"] {
  height: 2.5rem;
  padding: 0.2rem;
  cursor: pointer;
}

.span-2 {
  grid-column: span 2;
}

.btn {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn.primary {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border-color: transparent;
  color: #fff;
}

.btn.danger {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}

.btn.small {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
}

.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

textarea#global-memo {
  width: 100%;
  resize: vertical;
  min-height: 180px;
}

.routine-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.85rem;
}

.routine-item {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  position: relative;
}

.routine-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--routine-color, var(--accent));
}

.routine-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.5rem 1.15rem;
}

.routine-title {
  font-weight: 700;
  font-size: 1rem;
}

.routine-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.routine-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* 루틴 기간 및 정렬 관련 스타일 */
.routine-item.routine-ended {
  opacity: 0.55;
  background: var(--surface2);
}

.routine-ended-badge {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  margin-left: 0.35rem;
  display: inline-block;
  vertical-align: middle;
}

.routine-drag-handle {
  cursor: grab;
  padding: 0.25rem 0.5rem;
  color: var(--muted);
  font-size: 1.1rem;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.routine-drag-handle:hover {
  color: var(--text);
}

.routine-drag-handle:active {
  cursor: grabbing;
}

.routine-dragging {
  opacity: 0.4;
  border: 2px dashed var(--accent) !important;
  pointer-events: none !important;
}

.routine-manual-sort .routine-item {
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

.ring-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem 1rem 1.15rem;
}

.progress-ring {
  flex-shrink: 0;
}

.progress-ring svg {
  transform: rotate(-90deg);
}

.ring-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.ring-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #fcd34d;
  margin-top: 0.25rem;
}

.memo-inline {
  margin: 0 1rem 0.75rem 1.15rem;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.5rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px dashed var(--border);
}

.memo-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.memo-item {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.memo-item .memo-text {
  white-space: pre-wrap;
  font-size: 0.9rem;
  color: var(--text);
}

.memo-item .memo-meta {
  margin-top: 0.4rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.memo-item .memo-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.memo-item .memo-actions .btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
}

/* ===== MONTHLY CALENDAR ===== */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cal-weekday-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-top: 0.35rem;
}

.cal-cell {
  min-height: 3.2rem;
  border-radius: 8px;
  padding: 0.2rem 0.15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.8rem;
  position: relative;
}

.cal-cell:hover {
  background: var(--surface2);
}

.cal-cell.today {
  border: 1.5px solid var(--accent);
  border-radius: 8px;
}

.cal-cell.selected {
  background: rgba(56, 189, 248, 0.15);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.3);
}

.cal-cell.other-month {
  opacity: 0.25;
}

.cal-cell-day {
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1;
  margin-bottom: 1px;
}

.cal-cell.today .cal-cell-day {
  color: var(--accent);
}

.cal-dots {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-mood {
  font-size: 0.6rem;
  line-height: 1;
}

/* ===== CALENDAR DETAIL PANEL ===== */
.cal-detail-card {
  animation: slideUpFade 0.25s ease-out;
}

.cal-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.cal-detail-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.cal-detail-section {
  margin-bottom: 1rem;
}

.cal-detail-section:last-child {
  margin-bottom: 0;
}

.cal-detail-section-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cal-routine-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
}

.cal-routine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-routine-name {
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.cal-routine-value {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.cal-routine-status {
  font-size: 0.75rem;
  font-weight: 600;
}

.cal-routine-status.done {
  color: var(--success);
}

.cal-routine-status.partial {
  color: var(--accent);
}

.cal-routine-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
  font-style: italic;
}

.cal-routine-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.cal-mood-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
}

.cal-mood-emoji {
  font-size: 1.2rem;
}

.cal-mood-body {
  flex: 1;
  min-width: 0;
}

.cal-mood-name {
  font-weight: 600;
}

.cal-mood-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.cal-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.heatmap {
  display: flex;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.heatmap-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 auto;
}

.heatmap-row {
  display: flex;
  gap: 2px;
  align-items: center;
}

.heatmap-label {
  width: 1.75rem;
  font-size: 0.65rem;
  color: var(--muted);
  flex-shrink: 0;
}

.heatmap-cells {
  display: flex;
  gap: 2px;
}

.heat-cell {
  width: var(--heat-cell-size);
  height: var(--heat-cell-size);
  border-radius: 3px;
  background: var(--surface2);
  flex-shrink: 0;
  cursor: default;
  border: 1px solid transparent;
}

.heat-cell.has {
  border-color: rgba(255, 255, 255, 0.08);
}

.legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.legend-cells {
  display: flex;
  gap: 2px;
}

.legend-cells span {
  width: var(--heat-cell-size);
  height: var(--heat-cell-size);
  border-radius: 3px;
  background: var(--surface2);
}

.legend-cells span:nth-child(1) {
  opacity: 0.3;
  background: var(--accent);
}
.legend-cells span:nth-child(2) {
  opacity: 0.5;
  background: var(--accent);
}
.legend-cells span:nth-child(3) {
  opacity: 0.7;
  background: var(--accent);
}
.legend-cells span:nth-child(4) {
  opacity: 0.9;
  background: var(--accent);
}
.legend-cells span:nth-child(5) {
  opacity: 1;
  background: var(--accent);
}

.heatmap-header-cells {
  display: flex;
  gap: 2px;
}

.heat-header-cell {
  width: var(--heat-cell-size);
  flex-shrink: 0;
  font-size: 0.65rem;
  color: var(--muted);
  text-align: left;
  overflow: visible;
  white-space: nowrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

@media (min-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  text-align: center;
}

.stat-chip .num {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-chip .lbl {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.stats-routines {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-row .name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.footer {
  margin-top: 1.5rem;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

.modal {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: min(92vw, 400px);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.modal-inner {
  padding: 1.25rem;
  border: none;
  margin: 0;
}

.modal-inner h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.modal-inner label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.modal-inner input {
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.hidden {
  display: none !important;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 50;
}

.auth-card {
  width: min(92vw, 420px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
}

.auth-card input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.auth-helper-text {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.4;
  display: block;
}

.auth-overlay.is-hidden {
  display: none;
}

/* Delete Mode UI */
.delete-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px)) 1rem;
  z-index: 40;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

.delete-action-bar:not(.hidden) {
  display: block !important;
  transform: translateY(0);
}

.delete-action-content {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.delete-action-btns {
  display: flex;
  gap: 0.5rem;
}

.item-checkbox-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem 0 1rem;
  cursor: pointer;
}

.item-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: var(--danger);
}

/* Full Page Overlays (Trash) */
.full-page {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
}

.full-page.is-hidden {
  display: none !important;
}

.full-page-inner {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.full-page-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.full-page-content {
  flex: 1;
}

#page-trash {
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #3f1e1e 0%, var(--bg) 55%);
}

/* ===== MOOD FEATURE ===== */

/* Mood Widget (Today tab) */
.mood-widget-card {
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.12), rgba(99, 102, 241, 0.05), var(--surface));
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.mood-widget-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #a78bfa, #818cf8, #6366f1, #818cf8, #a78bfa);
  background-size: 200% auto;
  animation: moodGradientGlow 4s linear infinite;
}

@keyframes moodGradientGlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.mood-widget-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.mood-today-logs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.mood-today-logs:empty {
  margin-top: 0;
}

.mood-log-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.06));
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 10px;
  font-size: 0.82rem;
  backdrop-filter: blur(4px);
  transition: transform 0.2s, box-shadow 0.2s;
}

.mood-log-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.12);
}

.mood-log-chip .mood-emoji {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.mood-log-chip .mood-chip-body {
  flex: 1;
  min-width: 0;
}

.mood-log-chip .mood-chip-name {
  font-weight: 600;
}

.mood-log-chip .mood-chip-intensity {
  display: inline-flex;
  gap: 2px;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.mood-log-chip .mood-chip-intensity .dot-filled {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.mood-log-chip .mood-chip-intensity .dot-empty {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.mood-log-chip .mood-chip-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.mood-log-chip .mood-chip-reasons .reason-tag-sm {
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.mood-log-chip .mood-chip-time {
  font-size: 0.7rem;
  color: var(--muted);
  flex-shrink: 0;
}

.mood-log-chip .mood-chip-del {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem;
  flex-shrink: 0;
}

.mood-log-chip .mood-chip-del:hover {
  color: var(--danger);
}

/* Mood Modal */
.mood-modal {
  max-width: min(94vw, 460px);
}

.mood-modal-inner {
  max-height: 80dvh;
  overflow-y: auto;
}

.mood-section {
  margin-bottom: 1rem;
}

.mood-section-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* Emotion grid */
.mood-emotion-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.mood-emotion-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.55rem 0.3rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.mood-emotion-btn .mood-btn-emoji {
  font-size: 1.5rem;
}

.mood-emotion-btn .mood-btn-name {
  font-size: 0.68rem;
  font-weight: 600;
}

.mood-emotion-btn:hover {
  border-color: var(--accent);
  background: var(--surface2);
}

.mood-emotion-btn.selected {
  border-color: var(--mood-color, var(--accent));
  background: var(--surface2);
  color: var(--text);
  box-shadow: 0 0 12px rgba(var(--mood-r, 56), var(--mood-g, 189), var(--mood-b, 248), 0.25);
}

/* Intensity slider */
.mood-intensity-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mood-int-label {
  font-size: 0.72rem;
  color: var(--muted);
  flex-shrink: 0;
}

.mood-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  border-radius: 3px;
  background: var(--border);
  cursor: pointer;
}

.mood-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #6366f1);
  border: 2px solid var(--text);
  cursor: grab;
}

.mood-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #6366f1);
  border: 2px solid var(--text);
  cursor: grab;
}

/* Reason tags */
.mood-reason-groups {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.mood-reason-category {
  margin: 0;
}

.mood-reason-category-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.mood-reason-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.mood-reason-tag {
  padding: 0.3rem 0.6rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.mood-reason-tag:hover {
  border-color: var(--accent);
  color: var(--text);
}

.mood-reason-tag.selected {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(167, 139, 250, 0.2));
  border-color: #a78bfa;
  color: var(--text);
}

.mood-reason-tag.highlighted {
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.3);
}

.mood-custom-input {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
}

/* Mood stats */
.mood-stats-section {
  margin-bottom: 1.25rem;
}

.mood-stats-section:last-child {
  margin-bottom: 0;
}

.mood-stats-section h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  color: var(--text);
}

.mood-dist-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
}

.mood-dist-emoji {
  font-size: 1.1rem;
  width: 1.6rem;
  text-align: center;
  flex-shrink: 0;
}

.mood-dist-name {
  width: 3.5rem;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.mood-dist-bar-bg {
  flex: 1;
  height: 14px;
  background: var(--surface2);
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}

.mood-dist-bar-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.4s ease;
}

.mood-dist-pct {
  width: 2.5rem;
  text-align: right;
  font-size: 0.75rem;
  color: var(--muted);
  flex-shrink: 0;
}

.mood-trend-svg {
  width: 100%;
  height: 140px;
  display: block;
}

.mood-weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}

.mood-weekday-cell {
  text-align: center;
  padding: 0.55rem 0.25rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.mood-weekday-cell .wd-label {
  font-size: 0.7rem;
  color: var(--muted);
}

.mood-weekday-cell .wd-emoji {
  font-size: 1.2rem;
  display: block;
  margin: 0.15rem 0;
}

.mood-weekday-cell .wd-score {
  font-size: 0.68rem;
  color: var(--muted);
}

.mood-top-reasons {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mood-top-reason-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.mood-top-reason-row .rank {
  font-weight: 700;
  color: var(--accent);
  width: 1.2rem;
  flex-shrink: 0;
}

.mood-top-reason-row .reason-name {
  flex: 1;
}

.mood-top-reason-row .reason-count {
  color: var(--muted);
  font-size: 0.75rem;
}

/* Responsive Routine Layout */
.progress-ring {
  width: 56px;
  height: 56px;
}




/* ===== MOOD STATS ENHANCEMENTS ===== */

.card-header-with-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.segmented-control {
  display: flex;
  background: var(--bg);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.segmented-control .control-item {
  padding: 0.35rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.segmented-control .control-item:hover {
  color: var(--text);
}

.segmented-control .control-item.active {
  background: var(--surface2);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.segmented-control.small .control-item {
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  min-width: 3.5rem;
}

.stats-filters {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.mood-detailed-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ===== Ultra-Compact Mood Stream (간단히 모드) ===== */
.mood-stream-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mood-stream-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.mood-stream-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 52px;
  padding: 4px 2px;
  border-radius: 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  user-select: none;
  position: relative;
}

.mood-stream-item:hover,
.mood-stream-item.active {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  border-color: var(--mood-color, var(--primary)) !important;
}

.mood-stream-emoji {
  font-size: 1.35rem;
  line-height: 1.1;
  display: block;
}

.mood-stream-date {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-light);
  margin-top: 3px;
  letter-spacing: -0.3px;
  line-height: 1;
  display: block;
}

/* Quick preview bar when an emoji is clicked */
.mood-stream-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  animation: fadeIn 0.18s ease-out;
  position: relative;
}

.mood-stream-preview::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 3px;
  background: var(--preview-color, var(--primary));
  border-radius: 0 4px 4px 0;
}

.mood-stream-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mood-stream-preview-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mood-stream-preview-emoji {
  font-size: 1.4rem;
}

.mood-stream-preview-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.mood-stream-preview-date {
  font-size: 0.75rem;
  color: var(--muted);
}

.mood-stream-preview-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.mood-stream-preview-note {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.35;
  padding: 0.4rem 0.6rem;
  background: var(--surface2);
  border-radius: 6px;
}

@media (max-width: 480px) {
  .mood-stream-list {
    gap: 0.35rem;
  }
  .mood-stream-item {
    width: 42px;
    height: 46px;
    border-radius: 8px;
  }
  .mood-stream-emoji {
    font-size: 1.15rem;
  }
  .mood-stream-date {
    font-size: 0.58rem;
    margin-top: 2px;
  }
}

.mood-detailed-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
}

.mood-detailed-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1rem;
  bottom: 1rem;
  width: 3px;
  background: var(--mood-color, var(--accent));
  border-radius: 0 4px 4px 0;
}

.mood-detailed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.mood-detailed-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mood-detailed-emoji {
  font-size: 1.5rem;
}

.mood-detailed-info {
  display: flex;
  flex-direction: column;
}

.mood-detailed-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.mood-detailed-date {
  font-size: 0.72rem;
  color: var(--muted);
}

.mood-detailed-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mood-detailed-note {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
  padding: 0.6rem 0.75rem;
  background: var(--surface2);
  border-radius: 8px;
  border-left: 2px solid var(--border);
}

/* Share Card Styles */
#share-card-container {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 540px;
  z-index: -100;
  pointer-events: none;
}

.share-card-inner {
  width: 100%;
  background: linear-gradient(145deg, #0f172a 0%, #1a1f3a 50%, #1e293b 100%);
  border-radius: 20px;
  padding: 1.8rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  box-sizing: border-box;
  color: #f8fafc;
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  font-family: inherit;
}

.share-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.share-card-brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(to right, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.share-card-date {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}

.share-card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 핵심 요약 수치 카드 그리드 */
.share-card-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.sc-stat-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 0.75rem 0.6rem;
  text-align: center;
}

.sc-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.sc-stat-label {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.5);
  margin-top: 0.2rem;
  letter-spacing: 0.02em;
}

/* 루틴 Top 성과 */
.share-card-top-routines {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sc-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.15rem;
}

.sc-routine-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
}

.sc-routine-color {
  width: 4px;
  height: 28px;
  border-radius: 2px;
  flex-shrink: 0;
}

.sc-routine-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-routine-stats {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
}

.sc-routine-streak {
  font-size: 0.75rem;
  color: #fbbf24;
  font-weight: 700;
  white-space: nowrap;
}

/* 마음 상태 요약 */
.share-card-mood-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}

.sc-mood-emoji {
  font-size: 1.4rem;
}

.sc-mood-text {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.4;
}

.sc-mood-text strong {
  color: #f8fafc;
}

#share-card-heatmap {
  width: 100%;
  padding: 0.8rem;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: center;
}

.mood-detailed-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.mood-detailed-date {
  font-size: 0.72rem;
  color: var(--muted);
}

.mood-detailed-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mood-detailed-note {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
  padding: 0.6rem 0.75rem;
  background: var(--surface2);
  border-radius: 8px;
  border-left: 2px solid var(--border);
}

/* Share Card Styles */
#share-card-container {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 540px;
  z-index: -100;
  pointer-events: none;
}

.share-card-inner {
  width: 100%;
  background: linear-gradient(145deg, #0f172a 0%, #1a1f3a 50%, #1e293b 100%);
  border-radius: 20px;
  padding: 1.8rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  box-sizing: border-box;
  color: #f8fafc;
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  font-family: inherit;
}

.share-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.share-card-brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(to right, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.share-card-date {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}

.share-card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 핵심 요약 수치 카드 그리드 */
.share-card-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.sc-stat-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 0.75rem 0.6rem;
  text-align: center;
}

.sc-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.sc-stat-label {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.5);
  margin-top: 0.2rem;
  letter-spacing: 0.02em;
}

/* 루틴 Top 성과 */
.share-card-top-routines {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sc-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.15rem;
}

.sc-routine-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
}

.sc-routine-color {
  width: 4px;
  height: 28px;
  border-radius: 2px;
  flex-shrink: 0;
}

.sc-routine-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-routine-stats {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
}

.sc-routine-streak {
  font-size: 0.75rem;
  color: #fbbf24;
  font-weight: 700;
  white-space: nowrap;
}

/* 마음 상태 요약 */
.share-card-mood-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}

.sc-mood-emoji {
  font-size: 1.4rem;
}

.sc-mood-text {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.4;
}

.sc-mood-text strong {
  color: #f8fafc;
}

#share-card-heatmap {
  width: 100%;
  padding: 0.8rem;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: center;
}

.share-card-footer {
  display: flex;
  justify-content: center;
  padding-top: 0.3rem;
}

.share-card-watermark {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.05em;
}

/* ===== LIGHT THEME SPECIFIC OVERRIDES ===== */

html.theme-light body,
.theme-light body {
  background-color: #f8fafc;
  background-image:
    radial-gradient(circle at 10% 10%, rgba(253, 164, 186, 0.3) 0%, transparent 60%),
    radial-gradient(circle at 90% 10%, rgba(254, 240, 138, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(186, 230, 253, 0.35) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(216, 180, 254, 0.2) 0%, transparent 50%);
  color: #0f172a;
}

html.theme-light .landing-page,
.theme-light .landing-page {
  background-color: #f8fafc;
  background-image:
    radial-gradient(circle at 10% 10%, rgba(253, 164, 186, 0.2) 0%, transparent 60%),
    radial-gradient(circle at 90% 10%, rgba(254, 240, 138, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(186, 230, 253, 0.25) 0%, transparent 60%);
  color: #0f172a;
}

html.theme-light .landing-text h1,
.theme-light .landing-text h1 {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.theme-light .landing-desc,
.theme-light .landing-desc {
  color: #334155;
}

html.theme-light .feat-item,
.theme-light .feat-item {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

html.theme-light .feat-item:hover,
.theme-light .feat-item:hover {
  background: #f8fafc;
  border-color: #0284c7;
  color: #0284c7;
}

html.theme-light #landing-lang-bar,
.theme-light #landing-lang-bar {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: none;
}

html.theme-light .lang-chip,
.theme-light .lang-chip {
  background: transparent;
  border-color: transparent;
  color: #475569;
}

html.theme-light .lang-chip:hover,
.theme-light .lang-chip:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

html.theme-light .lang-chip.active,
.theme-light .lang-chip.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

html.theme-light .motivation-banner,
.theme-light .motivation-banner {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

html.theme-light .motivation-text,
.theme-light .motivation-text {
  color: #0f172a;
  font-weight: 600;
  text-shadow: none;
}

html.theme-light .mood-widget-card,
.theme-light .mood-widget-card {
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.7), rgba(245, 243, 255, 0.7), #ffffff);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}

html.theme-light ::-webkit-scrollbar-track,
.theme-light ::-webkit-scrollbar-track {
  background: #f1f5f9;
}
html.theme-light ::-webkit-scrollbar-thumb,
.theme-light ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}
html.theme-light ::-webkit-scrollbar-thumb:hover,
.theme-light ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Account Settings View/Edit Modes */
.settings-card-section {
  position: relative;
}

.settings-view-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.settings-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.settings-info-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  flex-shrink: 0;
}

.settings-info-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  text-align: right;
}

.settings-info-value.muted-value {
  color: var(--text-light);
  font-weight: 400;
  font-style: italic;
}

.btn-edit-toggle {
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.settings-edit-form {
  margin-top: 0.5rem;
  padding: 0.85rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.settings-verify-subbox {
  background: var(--bg);
  border: 1px dashed var(--primary);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  animation: fadeInSubbox 0.2s ease-out;
}

@keyframes fadeInSubbox {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


