:root {
  --bg: #f0f4f8;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --primary: #1a56db;
  --primary-hover: #1648b8;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --border: #e2e8f0;
  --surface-muted: #e2e8f0;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --tab-bar-height: 3.75rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

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

.main-content {
  flex: 1;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 1000;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: 0.625rem 0.25rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.625rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}

.tab-btn.active {
  color: var(--primary);
}

.tab-icon-wrap {
  position: relative;
  display: inline-flex;
}

.tab-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.tab-badge {
  position: absolute;
  top: -0.2rem;
  right: -0.45rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
  pointer-events: none;
}

.tab-badge.hidden {
  display: none;
}

.tab-label {
  max-width: 3.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-section {
  margin-bottom: 1.25rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.progress-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.progress-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
}

.progress-track {
  height: 8px;
  background: var(--surface-muted, #e2e8f0);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress-fill.urgent {
  background: var(--warning);
}

.progress-fill.ready {
  background: var(--success);
}

.progress-fill.overtime {
  background: #dc2626;
}

.progress-fill.done {
  background: var(--success);
}

.progress-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.wifi-suggest {
  margin-bottom: 1rem;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.wifi-suggest-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.wifi-suggest-text {
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.wifi-suggest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  width: auto;
  min-width: 5.5rem;
}

.actions .btn-sm,
.time-actions .btn-sm {
  flex: 1;
}

.header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.network-banner {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  display: inline-block;
  background: #f1f5f9;
  color: var(--text-muted);
}

.network-banner.ok {
  background: #d1fae5;
  color: #065f46;
}

.network-banner.warn {
  background: #fef3c7;
  color: #92400e;
}

.network-banner.blocked {
  background: #fee2e2;
  color: #991b1b;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-today {
  border-top: 4px solid var(--primary);
}

.card-today.card-field-work {
  border-top-color: #d97706;
}

.date-badges {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.badge-field {
  background: #ffedd5;
  color: #c2410c;
}

.badge-field.working {
  background: #fed7aa;
  color: #9a3412;
}

.badge-field.done {
  background: #fef3c7;
  color: #92400e;
}

.network-banner.field {
  background: #ffedd5;
  color: #9a3412;
}

.field-work-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.875rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
}

.field-work-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.field-work-toggle input {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: #d97706;
}

.field-work-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.field-memo,
.field-memo-display {
  margin-bottom: 1rem;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.field-memo-title,
.field-memo-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 0.25rem;
}

.field-memo-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.625rem;
}

.field-memo-input {
  width: 100%;
  font-size: 0.875rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  font-family: inherit;
  resize: vertical;
  min-height: 4.5rem;
  margin-bottom: 0.625rem;
}

.field-memo-text {
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.field-memo-actions {
  display: flex;
  gap: 0.5rem;
}

.week-field-tag {
  display: inline-block;
  margin-left: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #c2410c;
  background: #ffedd5;
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
  vertical-align: middle;
}

.week-memo {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
  line-height: 1.4;
}

.week-item.field-work .day {
  font-weight: 600;
}

.card-profile {
  border-top: 4px solid #0ea5e9;
}

.card-install {
  border-top: 4px solid #7c3aed;
  background: linear-gradient(180deg, #faf5ff 0%, var(--card) 40%);
}

.install-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.install-guide {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
}

.install-guide summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  padding: 0.5rem 0;
}

.install-steps {
  margin: 0.75rem 0 0.75rem 1.25rem;
  color: var(--text);
  line-height: 1.7;
}

.install-steps li {
  margin-bottom: 0.5rem;
}

.install-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #f8fafc;
  padding: 0.625rem;
  border-radius: 8px;
  line-height: 1.6;
}

.install-note code {
  font-size: 0.7rem;
  background: #e2e8f0;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.card-install.hidden {
  display: none;
}

.card-compact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

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

.card-header-row .card-title {
  margin-bottom: 0;
}

.week-summary {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

.date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.date {
  font-size: 0.9375rem;
  font-weight: 600;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text-muted);
}

.badge.working {
  background: #dbeafe;
  color: var(--primary);
}

.badge.done {
  background: #d1fae5;
  color: var(--success);
}

.badge-streak {
  background: #ffe4e6;
  color: #be123c;
}

.badge-umbrella {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-heat {
  background: #ffedd5;
  color: #c2410c;
}

.week-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.week-strip-dots {
  display: flex;
  gap: 0.375rem;
}

.week-strip-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--surface-muted);
}

.week-strip-dot.done {
  background: var(--success);
}

.week-strip-dot.today {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.week-strip-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.week-heatmap {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.375rem;
  height: 2.5rem;
  margin: 0.375rem 0 0.5rem;
  padding: 0 0.125rem;
}

.week-heatmap-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  min-width: 0;
  height: 100%;
}

.week-heatmap-bar {
  width: 100%;
  max-width: 1.75rem;
  min-height: 2px;
  border-radius: 3px 3px 1px 1px;
  background: var(--primary);
  opacity: 0.85;
  transition: height 0.2s ease;
}

.week-heatmap-col.empty .week-heatmap-bar {
  background: var(--border);
  opacity: 0.45;
}

.week-heatmap-col.today .week-heatmap-bar {
  outline: 1px solid var(--primary);
  outline-offset: 1px;
}

.week-heatmap-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  line-height: 1;
}

.month-summary-text {
  margin: -0.5rem 0 1rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
}

.yesterday-summary-text {
  margin-top: -0.75rem;
}

/* ── 퇴근 시간 알림 배너 ── */
.leave-alert {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  border-radius: var(--radius);
  padding: 0.875rem;
  margin-bottom: 1rem;
  animation: leave-alert-fadein 0.4s ease-out;
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3);
}
.leave-alert-body {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.leave-alert-icon {
  font-size: 1.75rem;
  line-height: 1;
  animation: leave-alert-bounce 1s ease-in-out infinite;
}
.leave-alert-texts {
  flex: 1;
}
.leave-alert-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.leave-alert-desc {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.85);
  margin-top: 0.125rem;
}
.leave-alert-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.625rem;
}
.leave-alert-actions .btn-primary {
  background: #fff;
  color: #16a34a;
  border: none;
}
.leave-alert-actions .btn-primary:hover {
  background: #f0fdf4;
}
.leave-alert-actions .btn-ghost {
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.3);
}
.leave-alert-actions .btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
@keyframes leave-alert-fadein {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes leave-alert-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.time-panel {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 0;
}

.time-row-leave {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.time-row-elapsed {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.time-value {
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-color);
  text-align: right;
  flex: 1;
  min-width: 0;
}

.time-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 4.5rem;
}

.leave-value {
  font-size: 1.375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  text-align: right;
  flex: 1;
  min-width: 0;
}

.time-input {
  flex: 1;
  min-width: 0;
  max-width: 10rem;
  margin-left: auto;
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.625rem;
  background: white;
  color: var(--text);
  font-family: inherit;
  min-height: 2.75rem;
}

.time-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.time-input:disabled {
  opacity: 0.7;
  background: #f1f5f9;
}

.edit-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
  line-height: 1.4;
}

.arrow {
  display: none;
}

.time-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.time-block {
  text-align: center;
  flex: 1;
}

.time-block .label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.time-block .value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.time-block.highlight .value {
  color: var(--primary);
}

.countdown {
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-muted);
  min-height: 1.5rem;
  margin-bottom: 1.25rem;
}

.countdown.urgent {
  color: var(--warning);
  font-weight: 600;
}

.countdown.ready {
  color: var(--success);
  font-weight: 600;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 0.875rem 1rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.98);
}

.actions .btn,
.card > .btn,
.card-compact > .btn {
  display: flex;
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  padding: 0.625rem 1rem;
}

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

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-of-type {
  border-bottom: none;
  margin-bottom: 0.75rem;
}

.setting-row label {
  font-size: 0.875rem;
}

.setting-row select {
  font-size: 0.875rem;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-family: inherit;
  max-width: 58%;
  min-width: 0;
}

.setting-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.setting-field label {
  font-size: 0.875rem;
  font-weight: 500;
}

.setting-row-col {
  flex-direction: column;
  align-items: stretch;
  gap: 0.375rem;
}

.setting-row-col label {
  font-size: 0.875rem;
}

.text-input {
  width: 100%;
  font-size: 0.875rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

.field-hint.backup-hint-warn {
  color: var(--warning, #c2410c);
}

.app-version {
  margin-top: 0.75rem;
  text-align: center;
}

.feature-notes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-notes li {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.feature-notes li:last-child {
  border-bottom: none;
}

.sync-status {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  min-height: 1.25rem;
}

.sync-status.ok { color: var(--success); }
.sync-status.err { color: var(--danger); }

.sub-title {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}

.team-list {
  list-style: none;
  font-size: 0.8125rem;
}

.team-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.team-item:last-child { border-bottom: none; }

.team-item .name { font-weight: 600; }
.team-item .detail { color: var(--text-muted); text-align: right; }

#btnRestore {
  position: relative;
  cursor: pointer;
}

.week-list {
  list-style: none;
}

.week-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.week-item:last-child {
  border-bottom: none;
}

.week-item .day {
  font-weight: 500;
  min-width: 4rem;
}

.week-item .times {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  flex: 1;
}

.week-item .hours {
  font-weight: 600;
  min-width: 3rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.week-item.today {
  background: #f8fafc;
  margin: 0 -1.25rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  border-radius: 8px;
}

.week-item.off .times {
  color: #cbd5e1;
}

.footer {
  text-align: center;
  padding: 1rem;
}

.footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --surface-muted: #334155;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  }
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --surface-muted: #334155;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    .badge {
      background: #334155;
    }

    .badge.working {
      background: #1e3a5f;
      color: #93c5fd;
    }

    .badge.done {
      background: #064e3b;
      color: #6ee7b7;
    }

    .badge-streak {
      background: #4c0519;
      color: #fda4af;
    }

    .btn-secondary {
      background: #334155;
      color: var(--text);
    }

    .time-row {
      background: #334155;
      border-color: #475569;
    }

    .time-row-leave {
      background: #1e3a5f;
      border-color: #1d4ed8;
    }

    .time-row-elapsed {
      background: #064e3b;
      border-color: #10b981;
    }

    .time-input {
      background: #1e293b;
      color: var(--text);
      border-color: #475569;
    }

    .time-input:focus {
      background: #0f172a;
    }

    .time-input:disabled {
      background: #334155;
    }

    .setting-row select {
      background: #334155;
      color: var(--text);
      border-color: #475569;
    }

    .text-input {
      background: #334155;
      color: var(--text);
      border-color: #475569;
    }

    .week-item.today {
      background: #334155;
    }

    .install-note {
      background: #334155;
    }

    .install-note code {
      background: #475569;
    }

    .card-install {
      background: linear-gradient(180deg, #2e1065 0%, var(--card) 40%);
    }

    .network-banner {
      background: #334155;
      color: var(--text-muted);
    }

    .network-banner.ok {
      background: #064e3b;
      color: #6ee7b7;
    }

    .network-banner.warn {
      background: #78350f;
      color: #fcd34d;
    }

    .network-banner.blocked {
      background: #7f1d1d;
      color: #fca5a5;
    }

    .wifi-suggest {
      background: #1e3a5f;
      border-color: #1d4ed8;
    }

    .field-work-row,
    .field-memo,
    .field-memo-display {
      background: #431407;
      border-color: #9a3412;
    }

    .field-memo-input {
      background: #1e293b;
      color: var(--text);
      border-color: #92400e;
    }

    .network-banner.field {
      background: #431407;
      color: #fdba74;
    }

    .badge-field {
      background: #431407;
      color: #fdba74;
    }

    .badge-field.working {
      background: #7c2d12;
      color: #fed7aa;
    }

    .badge-field.done {
      background: #78350f;
      color: #fde68a;
    }

    .week-field-tag {
      background: #431407;
      color: #fdba74;
    }
  }
}

[data-theme="dark"] {
  .badge {
    background: #334155;
  }

  .badge.working {
    background: #1e3a5f;
    color: #93c5fd;
  }

  .badge.done {
    background: #064e3b;
    color: #6ee7b7;
  }

  .badge-streak {
    background: #4c0519;
    color: #fda4af;
  }

  .badge-umbrella {
    background: #1e3a5f;
    color: #93c5fd;
  }

  .badge-heat {
    background: #431407;
    color: #fdba74;
  }

  .btn-secondary {
    background: #334155;
    color: var(--text);
  }

  .time-row {
    background: #334155;
    border-color: #475569;
  }

  .time-row-leave {
    background: #1e3a5f;
    border-color: #1d4ed8;
  }

  .time-row-elapsed {
    background: #064e3b;
    border-color: #10b981;
  }

  .time-input {
    background: #1e293b;
    color: var(--text);
    border-color: #475569;
  }

  .time-input:focus {
    background: #0f172a;
  }

  .time-input:disabled {
    background: #334155;
  }

  .setting-row select {
    background: #334155;
    color: var(--text);
    border-color: #475569;
  }

  .text-input {
    background: #334155;
    color: var(--text);
    border-color: #475569;
  }

  .week-item.today {
    background: #334155;
  }

  .install-note {
    background: #334155;
  }

  .install-note code {
    background: #475569;
  }

  .card-install {
    background: linear-gradient(180deg, #2e1065 0%, var(--card) 40%);
  }

  .network-banner {
    background: #334155;
    color: var(--text-muted);
  }

  .network-banner.ok {
    background: #064e3b;
    color: #6ee7b7;
  }

  .network-banner.warn {
    background: #78350f;
    color: #fcd34d;
  }

  .network-banner.blocked {
    background: #7f1d1d;
    color: #fca5a5;
  }

  .wifi-suggest {
    background: #1e3a5f;
    border-color: #1d4ed8;
  }

  .field-work-row,
  .field-memo,
  .field-memo-display {
    background: #431407;
    border-color: #9a3412;
  }

  .field-memo-input {
    background: #1e293b;
    color: var(--text);
    border-color: #92400e;
  }

  .network-banner.field {
    background: #431407;
    color: #fdba74;
  }

  .badge-field {
    background: #431407;
    color: #fdba74;
  }

  .badge-field.working {
    background: #7c2d12;
    color: #fed7aa;
  }

  .badge-field.done {
    background: #78350f;
    color: #fde68a;
  }

  .week-field-tag {
    background: #431407;
    color: #fdba74;
  }
}

/* ── Fun 탭 ── */

.quote-card {
  border-top: 4px solid #f472b6;
  background: linear-gradient(165deg, #fdf2f8 0%, var(--card) 50%);
  margin-bottom: 0.875rem;
}

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

.quote-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #db2777;
}

.quote-card-tag {
  font-size: 0.75rem;
  color: #be185d;
  background: #fce7f3;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

.daily-quote {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.65;
  color: var(--text);
  quotes: none;
}

.daily-quote::before,
.daily-quote::after {
  content: none;
}

/* ── 오늘의 색 ── */

.color-card {
  border-top: 4px solid #0ea5e9;
  background: linear-gradient(165deg, #f0f9ff 0%, var(--card) 50%);
  margin-bottom: 0.875rem;
}

.color-card-header {
  margin-bottom: 0.75rem;
}

.color-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0369a1;
}

.color-card-body {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.color-swatch {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.color-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.color-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.color-hex {
  margin: 0;
  font-size: 0.8125rem;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ── 오늘의 행운 숫자 ── */

.lucky-card {
  border-top: 4px solid #16a34a;
  background: linear-gradient(165deg, #f0fdf4 0%, var(--card) 50%);
  margin-bottom: 0.875rem;
}

.lucky-card-header {
  margin-bottom: 0.75rem;
}

.lucky-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #15803d;
}

.lucky-card-body {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.lucky-number {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #16a34a;
  color: #fff;
  font-size: 1.375rem;
  font-weight: 800;
}

.lucky-hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── 동전 던지기 ── */

.coin-card {
  border-top: 4px solid #ca8a04;
  background: linear-gradient(165deg, #fefce8 0%, var(--card) 50%);
  margin-bottom: 0.875rem;
}

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

.coin-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #a16207;
}

.coin-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #fef9c3;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.coin-flipping {
  animation: coin-spin 0.5s linear;
}

@keyframes coin-spin {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(1080deg); }
}

.coin-result {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.coin-result-face {
  font-size: 2.5rem;
  line-height: 1;
  margin: 0 0 0.5rem;
}

.coin-result-text {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

/* ── 가위바위보 ── */

.rps-card {
  border-top: 4px solid #2563eb;
  background: linear-gradient(165deg, #eff6ff 0%, var(--card) 50%);
  margin-bottom: 0.875rem;
}

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

.rps-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1d4ed8;
}

.rps-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #dbeafe;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.rps-idle {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.rps-choices {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.btn-rps {
  width: 3.25rem;
  height: 3.25rem;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  background: #dbeafe;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.btn-rps:active {
  transform: scale(0.92);
  background: #bfdbfe;
}

.rps-result {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.rps-result-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.rps-result-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.rps-result-emoji {
  font-size: 2.25rem;
  line-height: 1;
}

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

.rps-result-vs {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
}

.rps-result-text {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

/* ── 1분 스트레칭 ── */

.stretch-card {
  border-top: 4px solid #0d9488;
  background: linear-gradient(165deg, #f0fdfa 0%, var(--card) 50%);
  margin-bottom: 0.875rem;
}

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

.stretch-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f766e;
}

.stretch-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #ccfbf1;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.stretch-running,
.stretch-done {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.stretch-countdown {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  margin: 0 0 0.5rem;
  color: #0f766e;
}

.stretch-tip {
  font-size: 0.9375rem;
  margin: 0 0 1rem;
}

.stretch-done-text {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

/* ── 밸런스 게임 ── */

.balance-card {
  border-top: 4px solid #db2777;
  background: linear-gradient(165deg, #fdf2f8 0%, var(--card) 50%);
  margin-bottom: 0.875rem;
}

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

.balance-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #be185d;
}

.balance-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #fce7f3;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.balance-question {
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.balance-choices {
  display: flex;
  gap: 0.625rem;
}

.btn-balance {
  flex: 1;
  padding: 0.75rem 0.5rem;
  border: none;
  border-radius: 0.75rem;
  background: #fce7f3;
  color: #9d174d;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.btn-balance:active {
  transform: scale(0.96);
  background: #fbcfe8;
}

.balance-result {
  text-align: center;
  padding: 0.25rem 0;
}

.balance-result-text {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.balance-bar {
  display: flex;
  height: 0.625rem;
  border-radius: 999px;
  overflow: hidden;
  background: #fce7f3;
  margin-bottom: 0.5rem;
}

.balance-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.balance-bar-a {
  background: #db2777;
}

.balance-bar-b {
  background: #f9a8d4;
}

.balance-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

/* ── 반응속도 테스트 ── */

.reaction-card {
  border-top: 4px solid #eab308;
  background: linear-gradient(165deg, #fefce8 0%, var(--card) 50%);
  margin-bottom: 0.875rem;
}

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

.reaction-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #a16207;
}

.reaction-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #fef9c3;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.reaction-play {
  text-align: center;
  padding: 1.25rem 0.75rem;
  border-radius: 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}

.reaction-play.reaction-wait {
  background: #fee2e2;
  color: #b91c1c;
}

.reaction-play.reaction-go {
  background: #bbf7d0;
  color: #15803d;
}

.reaction-play.reaction-early {
  background: #ffedd5;
  color: #c2410c;
}

.reaction-play-text {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
}

.reaction-play-sub {
  font-size: 0.8125rem;
  margin: 0;
  opacity: 0.85;
}

.reaction-done {
  text-align: center;
  padding: 0.25rem 0;
}

.reaction-done-text {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

/* ── 숫자 맞추기 ── */

.guess-card {
  border-top: 4px solid #0891b2;
  background: linear-gradient(165deg, #ecfeff 0%, var(--card) 50%);
  margin-bottom: 0.875rem;
}

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

.guess-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0e7490;
}

.guess-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #cffafe;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.guess-playing,
.guess-done {
  text-align: center;
  padding: 0.25rem 0;
}

.guess-feedback {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.guess-tries {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.guess-input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.guess-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  text-align: center;
  background: var(--card);
  color: var(--text);
}

.guess-done-text {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

/* ── 주사위 굴리기 ── */

.dice-card {
  border-top: 4px solid #7c3aed;
  background: linear-gradient(165deg, #f5f3ff 0%, var(--card) 50%);
  margin-bottom: 0.875rem;
}

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

.dice-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #6d28d9;
}

.dice-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #ede9fe;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.dice-result {
  text-align: center;
  padding: 0.25rem 0;
}

.dice-faces {
  font-size: 2.5rem;
  letter-spacing: 0.5rem;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.dice-rolling .dice-faces,
#diceIdle.dice-rolling .fun-reveal-idle-emoji {
  animation: dice-shake 0.15s ease-in-out infinite;
}

@keyframes dice-shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

.dice-sum-text {
  font-size: 1.125rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
  color: #6d28d9;
}

.dice-msg-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

/* ── 행운 슬롯 ── */

.slot-card {
  border-top: 4px solid #d97706;
  background: linear-gradient(165deg, #fffbeb 0%, var(--card) 50%);
  margin-bottom: 0.875rem;
}

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

.slot-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #b45309;
}

.slot-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #fef3c7;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.slot-reels {
  font-size: 2.5rem;
  letter-spacing: 0.35rem;
  text-align: center;
  margin: 0.5rem 0 0.75rem;
}

.slot-spinning .slot-reels,
#slotIdle.slot-spinning .fun-reveal-idle-emoji {
  animation: slot-shake 0.12s ease-in-out infinite;
}

@keyframes slot-shake {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.slot-msg-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 0.75rem;
}

/* ── 5초 탭 챌린지 ── */

.tap-card {
  border-top: 4px solid #0d9488;
  background: linear-gradient(165deg, #f0fdfa 0%, var(--card) 50%);
  margin-bottom: 0.875rem;
}

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

.tap-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f766e;
}

.tap-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #ccfbf1;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.tap-running {
  text-align: center;
  padding: 0.25rem 0;
}

.tap-countdown {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f766e;
  margin: 0 0 0.25rem;
}

.tap-count {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.btn-tap-hit {
  display: block;
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  border: none;
  border-radius: 1rem;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.btn-tap-hit:active {
  transform: scale(0.97);
}

.tap-done-text {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 0.75rem;
  color: #0f766e;
}

/* ── 타자 속도 테스트 ── */

.typing-card {
  border-top: 4px solid #ea580c;
  background: linear-gradient(165deg, #fff7ed 0%, var(--card) 50%);
  margin-bottom: 0.875rem;
}

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

.typing-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #c2410c;
}

.typing-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #ffedd5;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.typing-running,
.typing-done {
  text-align: center;
  padding: 0.25rem 0;
}

.typing-target {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.typing-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--card);
  color: var(--text);
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
}

.typing-done-text {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

/* ── 오늘의 사주 ── */

.saju-card {
  border-top: 4px solid #6366f1;
  background: linear-gradient(165deg, #eef2ff 0%, var(--card) 50%);
  margin-bottom: 0.875rem;
}

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

.saju-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #4338ca;
}

.saju-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #e0e7ff;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.saju-empty {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.saju-empty-emoji {
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

.saju-empty-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 1rem;
}

.btn-saju-settings {
  display: inline-block;
  width: auto;
  min-width: 10rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
  cursor: pointer;
  font-family: inherit;
}

.saju-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
}

.saju-meta-item strong {
  color: var(--text);
  font-weight: 800;
}

.saju-meta-divider {
  color: #c7d2fe;
  font-weight: 300;
}

.saju-message {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.65;
  text-align: center;
  margin: 0 0 0.875rem;
  color: var(--text);
}

.saju-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.625rem 0.75rem;
  border-radius: 12px;
  background: #eef2ff;
  margin-bottom: 0.625rem;
}

.saju-stat strong {
  color: #4338ca;
  font-weight: 800;
}

.saju-stat-divider {
  color: #c7d2fe;
}

.saju-disclaimer {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.fun-hero {
  text-align: center;
  padding: 0.5rem 0 1.25rem;
}

.fun-hero-emoji {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.25rem;
  animation: fun-bounce 2s ease-in-out infinite;
}

@keyframes fun-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.fun-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

.fun-hero-date {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.35rem;
}

.fun-hero-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.fun-subtabs {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.25rem;
  background: var(--bg-muted, rgba(0, 0, 0, 0.04));
  border-radius: 12px;
}

.fun-subtab {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.fun-subtab.active {
  color: var(--text);
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.fun-panel {
  display: none;
}

.fun-panel.active {
  display: block;
}

.fortune-card {
  border-top: 4px solid #c084fc;
  background: linear-gradient(165deg, #faf5ff 0%, var(--card) 45%);
  overflow: hidden;
}

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

.fortune-card-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: #7c3aed;
}

.fortune-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #ede9fe;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.fortune-idle {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.fortune-crystal {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.35));
}

.fortune-idle-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.fun-reveal-idle {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.fun-reveal-idle-emoji {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.fun-reveal-idle-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.btn-fun-reveal {
  display: inline-block;
  width: auto;
  min-width: 11rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-fun-reveal:active {
  transform: scale(0.97);
}

.btn-fortune {
  display: inline-block;
  width: auto;
  min-width: 11rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  box-shadow: 0 8px 20px rgba(167, 139, 250, 0.45);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-fortune:active {
  transform: scale(0.96);
}

.fortune-shake {
  animation: fortune-shake 0.45s ease;
}

@keyframes fortune-shake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-2deg) scale(1.01); }
  40% { transform: rotate(2deg); }
  60% { transform: rotate(-1deg); }
  80% { transform: rotate(1deg); }
}

.fortune-result {
  text-align: center;
  padding: 0.25rem 0;
}

.fortune-result-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.875rem;
}

.fortune-emoji {
  font-size: 2.75rem;
  line-height: 1;
}

.fortune-grade {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--fortune-accent, #8b5cf6);
}

.fortune-category {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--fortune-accent, #8b5cf6);
}

.fortune-score-block {
  margin: 0 auto 1rem;
  padding: 0.875rem 1rem;
  max-width: 16rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #faf5ff, #fdf2f8);
  border: 1px solid #e9d5ff;
}

.fortune-score-label {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7c3aed;
  letter-spacing: 0.04em;
}

.fortune-score-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.125rem;
  margin-bottom: 0.5rem;
}

.fortune-score-num {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.fortune-score-max {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.fortune-score-track {
  height: 8px;
  border-radius: 999px;
  background: #ede9fe;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.fortune-score-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #a78bfa, #f472b6);
  transition: width 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.fortune-score-msg {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6d28d9;
}

.fortune-text {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

.fortune-chips {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}

.fortune-chip {
  font-size: 0.8125rem;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  text-align: left;
}

.fortune-chip strong {
  font-weight: 700;
}

.fortune-chip-lucky {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.fortune-chip-caution {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.fortune-stamp {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.fun-coming {
  border-style: dashed;
  border-color: #e9d5ff;
  background: #faf5ff;
}

.fun-coming-title {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #7c3aed;
}

.fun-coming-list {
  list-style: none;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.fun-coming-list li::before {
  content: '· ';
  color: #c084fc;
  font-weight: bold;
}

.setting-row-fortune {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.setting-row-fortune input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: #8b5cf6;
}

.setting-row-lunch {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.setting-row-lunch input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: #10b981;
}

.tab-btn[data-tab="fun"].active {
  color: #8b5cf6;
}

.tab-btn[data-tab="lunch"].active {
  color: #047857;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    .fortune-card {
      background: linear-gradient(165deg, #2e1065 0%, var(--card) 50%);
    }

    .fortune-card-hint {
      background: #4c1d95;
      color: #ddd6fe;
    }

    .fortune-score-block {
      background: linear-gradient(135deg, #2e1065, #500724);
      border-color: #6b21a8;
    }

    .fortune-score-track {
      background: #4c1d95;
    }

    .fortune-score-msg {
      color: #ddd6fe;
    }

    .fortune-chip-lucky {
      background: #064e3b;
      color: #6ee7b7;
      border-color: #047857;
    }

    .fortune-chip-caution {
      background: #7c2d12;
      color: #fdba74;
      border-color: #9a3412;
    }

    .quote-card {
      background: linear-gradient(165deg, #500724 0%, var(--card) 50%);
    }

    .quote-card-tag {
      background: #831843;
      color: #fbcfe8;
    }

    .color-card {
      background: linear-gradient(165deg, #0c4a6e 0%, var(--card) 50%);
    }

    .color-swatch {
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    }

    .lucky-card {
      background: linear-gradient(165deg, #052e16 0%, var(--card) 50%);
    }

    .coin-card {
      background: linear-gradient(165deg, #422006 0%, var(--card) 50%);
    }

    .coin-card-hint {
      background: #713f12;
      color: #fef08a;
    }

    .rps-card {
      background: linear-gradient(165deg, #1e3a8a 0%, var(--card) 50%);
    }

    .rps-card-hint {
      background: #1e40af;
      color: #bfdbfe;
    }

    .btn-rps {
      background: #1e40af;
      color: #bfdbfe;
    }

    .btn-rps:active {
      background: #1d4ed8;
    }

    .saju-card {
      background: linear-gradient(165deg, #1e1b4b 0%, var(--card) 50%);
    }

    .saju-card-hint {
      background: #312e81;
      color: #c7d2fe;
    }

    .saju-stats {
      background: #1e1b4b;
    }

    .saju-stat strong {
      color: #a5b4fc;
    }

    .stretch-card {
      background: linear-gradient(165deg, #042f2e 0%, var(--card) 50%);
    }

    .stretch-card-hint {
      background: #115e59;
      color: #99f6e4;
    }

    .stretch-countdown {
      color: #2dd4bf;
    }

    .balance-card {
      background: linear-gradient(165deg, #500724 0%, var(--card) 50%);
    }

    .balance-card-hint {
      background: #831843;
      color: #fbcfe8;
    }

    .btn-balance {
      background: #831843;
      color: #fbcfe8;
    }

    .btn-balance:active {
      background: #9d174d;
    }

    .balance-bar {
      background: #831843;
    }

    .typing-card {
      background: linear-gradient(165deg, #431407 0%, var(--card) 50%);
    }

    .typing-card-hint {
      background: #7c2d12;
      color: #fed7aa;
    }

    .reaction-card {
      background: linear-gradient(165deg, #422006 0%, var(--card) 50%);
    }

    .reaction-card-hint {
      background: #713f12;
      color: #fef08a;
    }

    .reaction-play.reaction-wait {
      background: #7f1d1d;
      color: #fecaca;
    }

    .reaction-play.reaction-go {
      background: #14532d;
      color: #bbf7d0;
    }

    .reaction-play.reaction-early {
      background: #7c2d12;
      color: #fed7aa;
    }

    .guess-card {
      background: linear-gradient(165deg, #083344 0%, var(--card) 50%);
    }

    .guess-card-hint {
      background: #155e75;
      color: #a5f3fc;
    }

    .dice-card {
      background: linear-gradient(165deg, #2e1065 0%, var(--card) 50%);
    }

    .dice-card-hint {
      background: #4c1d95;
      color: #ddd6fe;
    }

    .slot-card {
      background: linear-gradient(165deg, #451a03 0%, var(--card) 50%);
    }

    .slot-card-hint {
      background: #78350f;
      color: #fde68a;
    }

    .dice-sum-text {
      color: #c4b5fd;
    }

    .fun-coming {
      background: #2e1065;
      border-color: #6b21a8;
    }
  }
}

[data-theme="dark"] {
  .fortune-card {
    background: linear-gradient(165deg, #2e1065 0%, var(--card) 50%);
  }

  .fortune-card-hint {
    background: #4c1d95;
    color: #ddd6fe;
  }

  .fortune-score-block {
    background: linear-gradient(135deg, #2e1065, #500724);
    border-color: #6b21a8;
  }

  .fortune-score-track {
    background: #4c1d95;
  }

  .fortune-score-msg {
    color: #ddd6fe;
  }

  .fortune-chip-lucky {
    background: #064e3b;
    color: #6ee7b7;
    border-color: #047857;
  }

  .fortune-chip-caution {
    background: #7c2d12;
    color: #fdba74;
    border-color: #9a3412;
  }

  .quote-card {
    background: linear-gradient(165deg, #500724 0%, var(--card) 50%);
  }

  .quote-card-tag {
    background: #831843;
    color: #fbcfe8;
  }

  .color-card {
    background: linear-gradient(165deg, #0c4a6e 0%, var(--card) 50%);
  }

  .color-swatch {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  }

  .lucky-card {
    background: linear-gradient(165deg, #052e16 0%, var(--card) 50%);
  }

  .coin-card {
    background: linear-gradient(165deg, #422006 0%, var(--card) 50%);
  }

  .coin-card-hint {
    background: #713f12;
    color: #fef08a;
  }

  .rps-card {
    background: linear-gradient(165deg, #1e3a8a 0%, var(--card) 50%);
  }

  .rps-card-hint {
    background: #1e40af;
    color: #bfdbfe;
  }

  .btn-rps {
    background: #1e40af;
    color: #bfdbfe;
  }

  .btn-rps:active {
    background: #1d4ed8;
  }

  .saju-card {
    background: linear-gradient(165deg, #1e1b4b 0%, var(--card) 50%);
  }

  .saju-card-hint {
    background: #312e81;
    color: #c7d2fe;
  }

  .saju-stats {
    background: #1e1b4b;
  }

  .saju-stat strong {
    color: #a5b4fc;
  }

  .stretch-card {
    background: linear-gradient(165deg, #042f2e 0%, var(--card) 50%);
  }

  .stretch-card-hint {
    background: #115e59;
    color: #99f6e4;
  }

  .stretch-countdown {
    color: #2dd4bf;
  }

  .balance-card {
    background: linear-gradient(165deg, #500724 0%, var(--card) 50%);
  }

  .balance-card-hint {
    background: #831843;
    color: #fbcfe8;
  }

  .btn-balance {
    background: #831843;
    color: #fbcfe8;
  }

  .btn-balance:active {
    background: #9d174d;
  }

  .balance-bar {
    background: #831843;
  }

  .typing-card {
    background: linear-gradient(165deg, #431407 0%, var(--card) 50%);
  }

  .typing-card-hint {
    background: #7c2d12;
    color: #fed7aa;
  }

  .reaction-card {
    background: linear-gradient(165deg, #422006 0%, var(--card) 50%);
  }

  .reaction-card-hint {
    background: #713f12;
    color: #fef08a;
  }

  .reaction-play.reaction-wait {
    background: #7f1d1d;
    color: #fecaca;
  }

  .reaction-play.reaction-go {
    background: #14532d;
    color: #bbf7d0;
  }

  .reaction-play.reaction-early {
    background: #7c2d12;
    color: #fed7aa;
  }

  .guess-card {
    background: linear-gradient(165deg, #083344 0%, var(--card) 50%);
  }

  .guess-card-hint {
    background: #155e75;
    color: #a5f3fc;
  }

  .dice-card {
    background: linear-gradient(165deg, #2e1065 0%, var(--card) 50%);
  }

  .dice-card-hint {
    background: #4c1d95;
    color: #ddd6fe;
  }

  .slot-card {
    background: linear-gradient(165deg, #451a03 0%, var(--card) 50%);
  }

  .slot-card-hint {
    background: #78350f;
    color: #fde68a;
  }

  .dice-sum-text {
    color: #c4b5fd;
  }

  .fun-coming {
    background: #2e1065;
    border-color: #6b21a8;
  }
}

/* ── 맛집 탭: 전체화면 지도 + 플로팅 패널 ── */

.app.is-lunch-tab {
  padding: 0;
  padding-bottom: calc(3.75rem + env(safe-area-inset-bottom));
  max-width: none;
}

.app.is-lunch-tab .header {
  display: none;
}

.app.is-lunch-tab .main-content {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.lunch-tab-panel.active {
  display: block;
  position: absolute;
  inset: 0;
}

.lunch-map-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.lunch-map-full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #e2e8f0;
}

.lunch-map-stage .leaflet-container {
  width: 100%;
  height: 100%;
  font-family: inherit;
}

.lunch-map-stage .leaflet-top.leaflet-right {
  top: calc(5.5rem + env(safe-area-inset-top));
  right: 0.5rem;
  z-index: 450;
}

.lunch-map-stage .leaflet-control-zoom a {
  color: #334155;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.lunch-float-top {
  position: absolute;
  top: max(0.5rem, env(safe-area-inset-top));
  left: 0.625rem;
  right: 0.625rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  pointer-events: none;
}

.lunch-float-top > * {
  pointer-events: auto;
}

.lunch-float-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.lunch-float-title {
  font-size: 0.9375rem;
  font-weight: 800;
  color: #065f46;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.lunch-float-title-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.lunch-btn-user {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4);
}

.lunch-user-coords {
  margin: 0.25rem 0 0;
  padding: 0 0.25rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.lunch-user-coords.hidden {
  display: none;
}

.lunch-map-pin-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 1.35rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.lunch-map-pin-place-wrap {
  background: transparent;
  border: none;
}

.place-pin {
  --pin-hue: 24;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 48px;
  pointer-events: none;
}

.place-pin-glow {
  position: absolute;
  top: 0;
  left: 50%;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  border-radius: 50%;
  background: hsla(var(--pin-hue), 90%, 58%, 0.35);
  animation: place-pin-glow 2.4s ease-out infinite;
}

@keyframes place-pin-glow {
  0% { transform: scale(0.65); opacity: 0.85; }
  100% { transform: scale(1.55); opacity: 0; }
}

.place-pin-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(145deg, hsl(var(--pin-hue), 95%, 62%), hsl(var(--pin-hue), 85%, 48%));
  border: 3px solid #fff;
  box-shadow: 0 6px 16px hsla(var(--pin-hue), 80%, 40%, 0.55);
}

.place-pin-emoji {
  display: block;
  transform: rotate(45deg);
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.place-pin-stem {
  position: relative;
  z-index: 1;
  width: 4px;
  height: 8px;
  margin-top: -2px;
  border-radius: 0 0 4px 4px;
  background: hsl(var(--pin-hue), 70%, 42%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.lunch-map-pin-user {
  background: transparent;
  border: none;
}

.lunch-map-popup-user strong {
  color: #059669;
}

.user-face-pin {
  position: relative;
  width: 52px;
  height: 60px;
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.28));
}

.user-face-pin-glow {
  position: absolute;
  left: 50%;
  top: 18px;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.35);
  animation: user-face-pulse 2s ease-in-out infinite;
}

.user-face-pin-head {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 38px;
  height: 38px;
  margin-left: -19px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe8c8 0%, #ffd3a5 100%);
  border: 3px solid #fff;
  box-shadow: inset 0 -4px 0 rgba(251, 146, 60, 0.18), 0 0 0 2px rgba(22, 163, 74, 0.35);
}

.user-face-pin-hair {
  position: absolute;
  left: -2px;
  top: -6px;
  width: 36px;
  height: 20px;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(180deg, #5b3a29 0%, #3f2a1d 100%);
}

.user-face-pin-eye {
  position: absolute;
  top: 14px;
  width: 5px;
  height: 7px;
  border-radius: 50%;
  background: #1e293b;
}

.user-face-pin-eye-left { left: 8px; }
.user-face-pin-eye-right { right: 8px; }

.user-face-pin-blush {
  position: absolute;
  top: 20px;
  width: 7px;
  height: 4px;
  border-radius: 50%;
  background: rgba(251, 113, 133, 0.55);
}

.user-face-pin-blush-left { left: 4px; }
.user-face-pin-blush-right { right: 4px; }

.user-face-pin-smile {
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 12px;
  height: 7px;
  margin-left: -6px;
  border: 2px solid transparent;
  border-bottom-color: #ea580c;
  border-radius: 0 0 12px 12px;
}

.user-face-pin-pointer {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: #16a34a;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.45);
}

@keyframes user-face-pulse {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.35); opacity: 0.2; }
}

.lunch-btn-office {
  border: none;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  cursor: pointer;
}

.lunch-float-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.lunch-float-desc {
  flex: 1;
  margin: 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lunch-float-top .lunch-map-status {
  margin: 0;
  padding: 0.4rem 0.625rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
}

.lunch-btn-retry {
  align-self: flex-start;
}

.lunch-float-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  max-height: min(52vh, 420px);
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0.75rem 0.5rem;
  border-radius: 20px 20px 0 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  transform: translateY(0);
  transition: transform 0.28s ease;
  --sheet-peek: 3.5rem;
}

.lunch-float-bottom.is-collapsed {
  transform: translateY(calc(100% - var(--sheet-peek)));
}

.lunch-float-bottom.is-collapsed .lunch-roulette-block,
.lunch-float-bottom.is-collapsed .lunch-list-section,
.lunch-float-bottom.is-collapsed .lunch-map-attribution {
  opacity: 0;
  pointer-events: none;
}

.lunch-sheet-handle {
  width: 3rem;
  height: 1.35rem;
  margin: 0.1rem auto 0.5rem;
  border: none;
  padding: 0;
  background: transparent;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lunch-sheet-handle::before {
  content: '';
  width: 2.5rem;
  height: 4px;
  border-radius: 999px;
  background: #cbd5e1;
}

.lunch-sheet-handle:active {
  cursor: grabbing;
}

.lunch-sheet-peek {
  display: none;
  margin: -0.35rem 0 0.15rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  user-select: none;
}

.lunch-float-bottom.is-collapsed .lunch-sheet-peek {
  display: block;
}

.lunch-float-bottom.is-collapsed .lunch-sheet-handle {
  margin-bottom: 0.25rem;
}

.lunch-float-bottom .lunch-roulette-block {
  flex-shrink: 0;
  margin-bottom: 0.625rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid #e2e8f0;
}

.lunch-list-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lunch-list-heading {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.lunch-float-bottom .lunch-map-attribution {
  flex-shrink: 0;
  margin: 0.35rem 0 0;
  text-align: center;
}

/* ── 점심 룰렛 ── */

.lunch-roulette-block {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.lunch-roulette-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.lunch-roulette-badge {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #b45309;
}

.lunch-roulette-hint {
  font-size: 0.625rem;
  color: var(--text-muted);
  background: #fef3c7;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.lunch-roulette-wheel {
  border-radius: 12px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px dashed #fbbf24;
  padding: 0.75rem 0.625rem;
  margin-bottom: 0.5rem;
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.lunch-roulette-wheel-spinning {
  animation: lunch-roulette-pulse 0.35s ease-in-out infinite alternate;
}

@keyframes lunch-roulette-pulse {
  from { transform: scale(1); box-shadow: 0 0 0 rgba(245, 158, 11, 0); }
  to { transform: scale(1.02); box-shadow: 0 0 20px rgba(245, 158, 11, 0.35); }
}

.lunch-roulette-display {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.4;
  color: #92400e;
}

.btn-lunch-roulette {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
  cursor: pointer;
  font-family: inherit;
}

.btn-lunch-roulette:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.lunch-roulette-result {
  margin-top: 0.5rem;
  padding: 0.625rem;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  text-align: center;
}

.lunch-roulette-result-label {
  margin: 0 0 0.2rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #047857;
}

.lunch-roulette-result-name {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 900;
  color: #065f46;
}

.lunch-roulette-result-meta {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: #047857;
  line-height: 1.45;
}

.lunch-diary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.625rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.lunch-diary-label {
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-secondary, #64748b);
}

.lunch-diary-input {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #1e293b);
}

.lunch-diary-input:focus {
  outline: 2px solid var(--primary, #1a56db);
  outline-offset: 1px;
}

.lunch-list-item-picked {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.lunch-map-filter {
  font-size: 0.75rem;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  max-width: 6.5rem;
  flex-shrink: 0;
}

.lunch-map-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lunch-map-status-error {
  color: #b91c1c;
}

.lunch-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.lunch-list-item-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.3rem;
}

.lunch-fav-btn {
  flex-shrink: 0;
  width: 2.25rem;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}

.lunch-fav-btn.is-fav {
  color: #f59e0b;
  border-color: #fcd34d;
}

.lunch-fav-btn:hover,
.lunch-fav-btn:focus-visible {
  border-color: #f59e0b;
  outline: none;
}

.lunch-dir-btn {
  flex-shrink: 0;
  width: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.lunch-dir-btn:hover,
.lunch-dir-btn:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.lunch-list-item-wrap .lunch-list-item {
  flex: 1;
  min-width: 0;
}

.lunch-list-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  padding: 0.5rem 0.625rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.lunch-list-item:hover,
.lunch-list-item:focus-visible {
  border-color: #6ee7b7;
  background: #ecfdf5;
  outline: none;
}

.lunch-list-name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}

.lunch-list-meta {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.lunch-list-memo {
  display: block;
  font-size: 0.6875rem;
  color: #047857;
  margin-top: 0.15rem;
}

.lunch-map-attribution {
  font-size: 0.5625rem;
  color: var(--text-muted);
}

[data-theme="dark"] .lunch-float-title,
[data-theme="dark"] .lunch-float-bar,
[data-theme="dark"] .lunch-float-bottom,
[data-theme="dark"] .lunch-float-top .lunch-map-status {
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
}

[data-theme="dark"] .lunch-float-title {
  color: #6ee7b7;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lunch-float-title,
  :root:not([data-theme="light"]) .lunch-float-bar,
  :root:not([data-theme="light"]) .lunch-float-bottom,
  :root:not([data-theme="light"]) .lunch-float-top .lunch-map-status {
    background: rgba(15, 23, 42, 0.92);
  }

  :root:not([data-theme="light"]) .lunch-float-title {
    color: #6ee7b7;
  }
}

.lunch-map-pin {
  background: transparent;
  border: none;
}

.lunch-map-pin-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 1.35rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.lunch-map-pin-office-wrap {
  background: transparent;
  border: none;
}

.office-pin {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 128px;
  pointer-events: none;
}

.office-pin-ring {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 52px;
  height: 52px;
  margin-left: -26px;
  border-radius: 50%;
  border: 3px solid #2563eb;
  animation: office-pin-ring 2s ease-out infinite;
}

.office-pin-ring-delay {
  animation-delay: 1s;
}

@keyframes office-pin-ring {
  0% { transform: scale(0.55); opacity: 0.9; }
  100% { transform: scale(1.45); opacity: 0; }
}

.office-pin-core {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.55);
  border: 3px solid white;
}

.office-pin-icon-inner {
  display: block;
  transform: rotate(45deg);
  font-size: 1.4rem;
  line-height: 1;
}

.office-pin-label {
  position: relative;
  z-index: 2;
  margin-top: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.6875rem;
  font-weight: 800;
  color: white;
  background: #1d4ed8;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.45);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lunch-map-popup-office strong {
  color: #1d4ed8;
}

.lunch-map-popup {
  font-size: 0.8125rem;
  line-height: 1.5;
  min-width: 140px;
}

.lunch-map-popup-cat {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.6875rem;
  color: #64748b;
}

.lunch-map-popup-price {
  margin: 0.25rem 0 0;
  color: #047857;
  font-weight: 600;
}

.lunch-map-popup-rating {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #b45309;
}

.lunch-map-popup-address {
  margin: 0.35rem 0 0;
  font-size: 0.6875rem;
  color: #64748b;
  line-height: 1.45;
}

.lunch-map-popup-memo {
  margin: 0.25rem 0 0;
}

.lunch-map-popup-tags {
  margin: 0.35rem 0 0;
  font-size: 0.6875rem;
  color: #6b7280;
}

[data-theme="dark"] .lunch-map-desc code {
  background: #064e3b;
  color: #a7f3d0;
}

[data-theme="dark"] .lunch-list-item:hover,
[data-theme="dark"] .lunch-list-item:focus-visible {
  background: #064e3b;
  border-color: #10b981;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lunch-map-desc code {
    background: #064e3b;
    color: #a7f3d0;
  }

  :root:not([data-theme="light"]) .lunch-list-item:hover,
  :root:not([data-theme="light"]) .lunch-list-item:focus-visible {
    background: #064e3b;
    border-color: #10b981;
  }
}

/* ── Hermes AI 채팅 ── */
.app.is-chat-tab {
  padding: 0;
  max-width: none;
  height: 100dvh;
  overflow: hidden;
  padding-bottom: calc(var(--tab-bar-height) + env(safe-area-inset-bottom));
}

.app.is-chat-tab .header {
  display: none;
}

.app.is-chat-tab .main-content {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  max-height: calc(100dvh - var(--tab-bar-height) - env(safe-area-inset-top));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-tab-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  position: relative;
}

.chat-stage {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem 0;
  padding-bottom: var(--chat-kb-offset, 0px);
  background: var(--bg);
}

.chat-stage .chat-setup.card {
  margin-bottom: 0.5rem;
  padding: 0.875rem 1rem;
  flex-shrink: 0;
  box-shadow: none;
  border: 1px solid var(--border);
}

.chat-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0 0.25rem;
}

.chat-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
  flex-shrink: 1;
  min-width: 0;
}

.chat-topbar-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
}

.chat-topbar-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.chat-topbar-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.chat-setup {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
}

.chat-setup.hidden {
  display: none;
}

.chat-setup-title {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.chat-location {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
  padding: 0.75rem 0.875rem;
  box-shadow: none;
  border: 1px solid var(--border);
}

.chat-location-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.chat-location-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.chat-location-map {
  width: 100%;
  height: 140px;
  border-radius: 0.625rem;
  overflow: hidden;
  background: var(--border);
}

.chat-location-map .leaflet-container {
  width: 100%;
  height: 100%;
  font: inherit;
}

.chat-location-coords {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.chat-loc-pin {
  background: transparent;
  border: none;
}

.chat-loc-pin-dot {
  display: block;
  width: 16px;
  height: 16px;
  margin: 4px;
  background: #2563eb;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.chat-messages-wrap {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.chat-messages {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.25rem 0.125rem 0.5rem;
}

.chat-empty {
  flex-shrink: 0;
  margin: auto 0;
  padding: 1rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

.chat-empty.hidden {
  display: none;
}

.chat-bubble {
  max-width: min(92%, 20rem);
  padding: 0.625rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-bubble-user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}

.chat-bubble-assistant {
  align-self: flex-start;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 0.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.chat-bubble-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-bubble-time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.625rem;
  opacity: 0.75;
}

.chat-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}

.chat-shortcut {
  flex: 0 0 auto;
  padding: 0.3rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.chat-shortcut:hover,
.chat-shortcut:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}

.chat-footer {
  flex-shrink: 0;
  padding: 0.5rem 0 max(0.25rem, env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 2;
}

.chat-status {
  margin: 0 0 0.375rem;
  padding: 0 0.125rem;
  font-size: 0.75rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chat-status.hidden {
  display: none;
}

.chat-status-info {
  color: var(--text-muted);
}

.chat-status-ok {
  color: #059669;
}

.chat-status-error {
  color: #dc2626;
}

.chat-char-count {
  margin: 0 0 0.25rem;
  padding: 0 0.125rem;
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--text-muted);
  text-align: right;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: end;
}

.chat-form.is-busy {
  opacity: 0.7;
}

.chat-input {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  max-height: 7rem;
  resize: none;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  background: var(--card);
  color: var(--text);
}

.chat-input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.chat-topbar .btn,
.chat-topbar .btn-sm {
  display: inline-flex;
  width: auto;
  flex: 0 0 auto;
  flex-shrink: 0;
}

.chat-form .btn,
.chat-form .btn-primary,
.chat-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: none;
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: 3.25rem;
  min-height: 2.75rem;
  padding-left: 0.875rem;
  padding-right: 0.875rem;
  border-radius: 999px;
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chat-bubble-assistant {
    background: #1e293b;
    border-color: #334155;
  }

  :root:not([data-theme="light"]) .chat-input {
    background: #0f172a;
    border-color: #334155;
  }
}

[data-theme="dark"] .chat-bubble-assistant {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .chat-input {
  background: #0f172a;
  border-color: #334155;
}

.tab-btn[data-tab="chat"].active {
  color: #2563eb;
}

/* ── 회사 날씨 (weather-brief) ── */
.weather-brief-card {
  margin: 0 0 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius, 12px);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(59, 130, 246, 0.06));
  border: 1px solid var(--border);
}

.weather-brief-card.hidden {
  display: none;
}

.weather-brief-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.5rem;
}

.weather-brief-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0284c7;
}

.weather-brief-meta {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

.weather-brief-summary {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--text);
}

.weather-brief-periods {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.weather-brief-periods.hidden {
  display: none;
}

.weather-brief-periods li {
  font-size: 0.6875rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
  color: var(--text-muted, #64748b);
}

[data-theme="dark"] .weather-brief-periods li {
  background: rgba(15, 23, 42, 0.45);
}

.weather-brief-periods li.weather-period-rain {
  border-color: rgba(14, 165, 233, 0.55);
  color: #0284c7;
  font-weight: 600;
}

.temp-arrow { font-size: 0.7rem; }
.temp-up { color: #ef4444; }
.temp-down { color: #3b82f6; }
.temp-steady { color: #94a3b8; }

/* ── News 탭 ── */
.news-hero {
  text-align: center;
  padding: 1.25rem 0 0.75rem;
}

.news-hero-emoji {
  font-size: 2rem;
  margin: 0 0 0.25rem;
}

.news-hero-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
}

.news-hero-date {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted, #64748b);
}

.news-market-toggle {
  display: inline-flex;
  gap: 0.35rem;
  margin-top: 0.85rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--surface-muted, rgba(148, 163, 184, 0.15));
  border: 1px solid var(--border);
}

.news-stock-toggle {
  margin-top: 0.5rem;
}

.news-market-btn {
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.news-market-btn.active {
  background: var(--card-bg, #fff);
  color: #ea580c;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] .news-market-btn.active {
  background: rgba(30, 41, 59, 0.95);
}

.news-brief-card {
  margin: 0 0 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius, 12px);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(234, 88, 12, 0.06));
  border: 1px solid var(--border);
}

.news-brief-card.hidden,
.news-list-card.hidden,
.news-empty.hidden {
  display: none;
}

.news-brief-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.5rem;
}

.news-brief-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ea580c;
}

.news-brief-meta {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

.news-copy-btn {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  margin-left: auto;
  flex-shrink: 0;
}

.news-brief-summary {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
}

.news-read-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.news-read-progress.hidden { display: none; }
.news-read-bar-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  min-width: 40px;
}
.news-read-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.news-read-bar-text {
  white-space: nowrap;
  flex-shrink: 0;
}

.news-list-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: -0.5rem 0 0.5rem;
}

.news-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-item {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  line-height: 1.4;
}

.news-item-row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.news-item-body {
  flex: 1;
  min-width: 0;
}

.news-item-pin-btn {
  flex-shrink: 0;
  margin-top: 0.05rem;
  padding: 0.15rem 0.35rem;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.45;
}

.news-item-pin-btn:hover,
.news-item-pin-btn:focus-visible {
  opacity: 1;
  background: rgba(234, 88, 12, 0.1);
}

.news-item-share-btn {
  flex-shrink: 0;
  padding: 0.15rem 0.25rem;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.45;
  color: var(--text-muted, #64748b);
  text-decoration: none;
}

.news-item-share-btn:hover,
.news-item-share-btn:focus-visible {
  opacity: 1;
}

.news-item-bookmark-btn {
  flex-shrink: 0;
  padding: 0.15rem 0.25rem;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  font-size: 0.925rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.45;
  color: var(--text-muted, #64748b);
}

.news-item-bookmark-btn:hover,
.news-item-bookmark-btn:focus-visible {
  opacity: 1;
}

.news-item-bookmark-btn.bookmarked {
  opacity: 1;
  color: #eab308;
}

.news-item-actions {
  display: flex;
  gap: 0.1rem;
  align-items: flex-start;
  flex-shrink: 0;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item a {
  color: var(--text);
  text-decoration: none;
}

.news-item a:hover {
  color: #2563eb;
}

.news-item-pubdate {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
  margin-top: 0.15rem;
  line-height: 1.2;
}

.news-item-read {
  opacity: 0.55;
}

.news-item-read a {
  color: var(--text-muted, #64748b);
}

.news-pin-bar {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
}

.news-pin-bar.hidden {
  display: none;
}

.news-pin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  min-height: 1.25rem;
}

.news-pin-hint {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

.news-pin-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  background: rgba(234, 88, 12, 0.08);
  color: var(--text);
  cursor: pointer;
}

.news-pin-count {
  display: inline-block;
  min-width: 1rem;
  margin: 0 0.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.2;
  background: rgba(234, 88, 12, 0.2);
  color: #c2410c;
}

.news-pin-form {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.news-pin-input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  background: var(--bg);
  color: var(--text);
}

.news-search-bar {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.5rem;
}

.news-unread-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  background: var(--card-bg, #fff);
  color: var(--text-muted, #64748b);
  cursor: pointer;
}

.news-unread-btn.active {
  border-color: #ea580c;
  color: #ea580c;
  background: rgba(234, 88, 12, 0.08);
}

.news-search-input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  background: var(--card);
  color: var(--text);
}

.news-item-empty {
  color: var(--text-muted, #64748b);
  font-size: 0.8125rem;
  text-align: center;
  list-style: none;
}

.news-item-pinned {
  background: rgba(234, 88, 12, 0.06);
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: 0.35rem;
}

.news-item-desc {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 0;
}
.news-item-desc.open {
  max-height: 6rem;
  opacity: 1;
}
.news-item-expand {
  flex-shrink: 0;
  padding: 0.15rem 0.25rem;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.45;
  color: var(--text-muted, #64748b);
}
.news-item-expand:hover,
.news-item-expand:focus-visible {
  opacity: 1;
}

.news-pin-tag {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #ea580c;
}

.news-highlight {
  background: linear-gradient(180deg, transparent 55%, rgba(234, 88, 12, 0.18) 55%);
  padding: 0 0.1rem;
  font-weight: 500;
}

.news-empty-text {
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted, #64748b);
  line-height: 1.5;
}

/* ── 퇴근길 (commute-time) ── */
.commute-card {
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border-radius: var(--radius, 12px);
  background: linear-gradient(135deg, rgba(26, 86, 219, 0.06), rgba(16, 185, 129, 0.08));
  border: 1px solid var(--border);
}

.commute-card.hidden,
.commute-setup.hidden {
  display: none;
}

.commute-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.commute-card-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
}

.commute-route {
  margin: 0 0 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.commute-times {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.commute-line {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.commute-arrival {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.commute-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.commute-map-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--primary);
}

.commute-setup {
  margin: 0 0 1rem;
  padding: 0.75rem;
  border-radius: var(--radius, 12px);
  background: var(--surface-muted, #f8fafc);
  text-align: center;
}

.commute-setup-text {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
/* ── 맛집 지도 날씨 ── */
.lunch-weather-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.25);
  max-width: 100%;
}

.lunch-weather-chip.hidden {
  display: none;
}

.lunch-weather-icon {
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.lunch-weather-temp {
  font-size: 0.875rem;
  font-weight: 800;
  color: #0369a1;
  white-space: nowrap;
}

.lunch-weather-text {
  font-size: 0.75rem;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.lunch-map-pin-weather-wrap {
  background: transparent;
  border: none;
}

.weather-pin {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 4px 10px rgba(14, 165, 233, 0.35));
}

.weather-pin-glow {
  position: absolute;
  top: 6px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.55), transparent 70%);
  animation: weather-pin-pulse 2.4s ease-in-out infinite;
}

.weather-pin-bubble {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e0f2fe, #bae6fd);
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weather-pin-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.weather-pin-temp {
  position: relative;
  z-index: 1;
  margin-top: -4px;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #0284c7;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  white-space: nowrap;
}

.weather-pin-tail {
  width: 0;
  height: 0;
  margin-top: -2px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 10px solid #bae6fd;
}

@keyframes weather-pin-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}

.lunch-map-popup-weather strong {
  display: block;
  margin-bottom: 0.25rem;
}

[data-theme="dark"] .lunch-weather-chip {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(56, 189, 248, 0.35);
}

[data-theme="dark"] .lunch-weather-text {
  color: #94a3b8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lunch-weather-chip {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(56, 189, 248, 0.35);
  }
  :root:not([data-theme="light"]) .lunch-weather-text {
    color: #94a3b8;
  }
}

/* ── 맛집 지도 비 효과 (canvas 애니메이션은 lunch-map.js) ── */
.lunch-map-rain {
  position: absolute;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    rgba(120, 132, 150, 0.09) 0%,
    rgba(71, 85, 105, 0.21) 55%,
    rgba(45, 55, 72, 0.27) 100%
  );
}

.lunch-map-rain.hidden {
  display: none;
}

.lunch-map-rain-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 1;
}

