:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-elevated: rgba(15, 23, 42, 0.92);
  --bg-elevated-soft: rgba(15, 23, 42, 0.8);
  --border-subtle: rgba(148, 163, 184, 0.3);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-strong: rgba(56, 189, 248, 0.35);
  --text-main: #e5e7eb;
  --text-soft: #94a3b8;
  --danger: #f87171;
  --muted: #1f2937;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text',
    'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.16), transparent 55%),
    linear-gradient(135deg, #020617, #020617 40%, #030712);
  color: var(--text-main);
}

.app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.app-header h1 {
  font-size: 26px;
  margin: 0;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.today {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
  backdrop-filter: blur(18px);
}

.today-label {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  background: radial-gradient(circle at 0% 0%, rgba(15, 23, 42, 0.95), #020617 65%);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  padding: 18px 18px 16px;
  box-shadow:
    0 22px 60px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.9);
  min-height: 160px;
  overflow: hidden;
  transition:
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out,
    border-color 0.15s ease-out,
    background 0.2s ease-out;
}

.card.tall {
  min-height: 260px;
}

.card::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: radial-gradient(circle at 0% 0%, var(--accent-strong), transparent 55%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow:
    0 26px 70px rgba(15, 23, 42, 0.95),
    0 0 0 1px rgba(15, 23, 42, 0.9);
}

.card:hover::before {
  opacity: 1;
}

.card.wide {
  grid-column: 1 / -1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.card-header h2 {
  font-size: 15px;
  margin: 0;
  letter-spacing: -0.02em;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  font-size: 13px;
}

.placeholder {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-soft);
  border: 1px dashed rgba(51, 65, 85, 0.9);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list-item {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(30, 64, 175, 0.7);
}

.list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.list-item-title {
  font-size: 13px;
  font-weight: 500;
}

.list-item-meta {
  font-size: 11px;
  color: var(--text-soft);
}

.list-item-body {
  font-size: 12px;
  color: var(--text-soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(30, 64, 175, 0.9);
  background: rgba(15, 23, 42, 0.9);
  color: #bfdbfe;
  margin-bottom: 2px;
}

.badge-danger {
  border-color: rgba(248, 113, 113, 0.9);
  color: #fecaca;
}

.ghost-button {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-soft);
  font-size: 11px;
  padding: 6px 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(14px);
  transition:
    border-color 0.15s ease-out,
    background 0.15s ease-out,
    color 0.15s ease-out,
    transform 0.12s ease-out;
}

.ghost-button:hover {
  border-color: rgba(148, 163, 184, 0.9);
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.98);
  transform: translateY(-0.5px);
}

input[type='month'],
input[type='date'] {
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  background: rgba(15, 23, 42, 0.98);
  color: var(--text-main);
  font-size: 12px;
  padding: 6px 10px;
}

input[type='month']::-webkit-calendar-picker-indicator,
input[type='date']::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.metric-label {
  font-size: 12px;
  color: var(--text-soft);
}

.metric-value {
  font-size: 13px;
  font-weight: 500;
}

.metric-positive {
  color: #4ade80;
}

.metric-negative {
  color: #f97373;
}

.metric-neutral {
  color: #e5e7eb;
}

.json-raw {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #020617;
  border: 1px solid rgba(30, 64, 175, 0.8);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 11px;
  max-height: 220px;
  overflow: auto;
}

.error {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(127, 29, 29, 0.95);
  border: 1px solid rgba(248, 113, 113, 0.95);
  font-size: 12px;
}

@media (max-width: 768px) {
  .app {
    padding: 18px 12px 28px;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ----- Light theme overrides based on reference design ----- */

body {
  background: radial-gradient(circle at 0 0, #ffffff, #f4f4f7 38%, #eceff4 100%);
  color: #111827;
}

.app {
  max-width: 1200px;
  padding: 32px 24px 40px;
}

.app-header h1 {
  font-size: 32px;
  font-weight: 600;
  color: #111827;
}

.subtitle {
  font-size: 14px;
  color: #6b7280;
}

.today {
  background: rgba(255, 255, 255, 0.92);
  border-color: #e5e7eb;
  color: #4b5563;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.today-label {
  background: #eef2ff;
  color: #4f46e5;
}

.grid {
  gap: 20px;
}

.card {
  background: #ffffff;
  border-radius: 22px;
  border: 1px solid #e5e7eb;
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.04),
    0 0 0 1px rgba(15, 23, 42, 0.01);
}

.card::before {
  display: none;
}

.card:hover {
  transform: translateY(-2px);
  border-color: #d1d5db;
  box-shadow:
    0 24px 50px rgba(15, 23, 42, 0.07),
    0 0 0 1px rgba(15, 23, 42, 0.02);
}

.card-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.card-body {
  font-size: 13px;
  color: #374151;
}

.placeholder {
  background: #f9fafb;
  color: #6b7280;
  border-color: #e5e7eb;
}

.list-item {
  background: #f9fafb;
  border-color: #e5e7eb;
}

.list-item-title {
  color: #111827;
}

.list-item-meta,
.list-item-body {
  color: #6b7280;
}

.badge {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4f46e5;
}

.badge-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.ghost-button {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #4b5563;
}

.ghost-button:hover {
  background: #111827;
  border-color: #111827;
  color: #f9fafb;
}

input[type='month'],
input[type='date'] {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #111827;
}

.metric-label {
  color: #6b7280;
}

.metric-neutral {
  color: #111827;
}

.json-raw {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #111827;
}

.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

@media (max-width: 768px) {
  .app {
    padding: 20px 16px 32px;
  }
}

/* To Do 전용 스타일 */

.todo-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}

.todo-progress-label {
  font-weight: 500;
}

.todo-progress-value {
  font-variant-numeric: tabular-nums;
}

.todo-progress-bar {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin-bottom: 10px;
}

.todo-progress-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5, #6366f1);
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.todo-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.todo-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1.5px solid #d1d5db;
  background: #ffffff;
}

.todo-checkbox-done {
  border-color: #4f46e5;
  background: radial-gradient(circle at 50% 50%, #4f46e5 0, #4f46e5 60%, transparent 61%);
}

.todo-text {
  font-size: 13px;
  color: #111827;
}

.todo-text-done {
  color: #9ca3af;
  text-decoration: line-through;
}

/* 유저 선택 (Pages용) */
.user-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
}
.user-select-label {
  font-weight: 500;
}
.user-select {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
  font-size: 12px;
  cursor: pointer;
}

