/* ============================================
   SRCH_AGENT — Dark Terminal Chat UI
   ============================================ */

:root {
  --bg-deep: #06060a;
  --bg-base: #0a0a12;
  --bg-surface: #0e0e18;
  --bg-elevated: #14142a;
  --bg-hover: #1a1a30;

  --accent: #00f0ff;
  --accent-dim: #00a0aa;
  --accent-glow: rgba(0, 240, 255, 0.15);
  --accent-glow-strong: rgba(0, 240, 255, 0.3);

  --text-primary: #e0e0e8;
  --text-secondary: #8888a0;
  --text-muted: #555570;
  --text-accent: #00f0ff;

  --border-subtle: #1a1a2e;
  --border-accent: #00f0ff;

  --msg-user-bg: #141428;
  --msg-system-bg: #0c0c18;
  --msg-analysis-border: #00f0ff;
  --msg-queries-border: #7b61ff;
  --msg-searching-border: #ffaa00;
  --msg-relevance-border: #00cc88;
  --msg-extraction-border: #ff6b9d;
  --msg-answer-border: #00f0ff;
  --msg-sources-border: #8888a0;
  --msg-stats-border: #555570;
  --msg-error-border: #ff4444;
  --msg-compare-border: #7b61ff;

  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  --font-body: 'IBM Plex Mono', 'JetBrains Mono', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --header-h: 48px;
  --input-h: 72px;
}

/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Noise overlay ---- */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Header ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
}

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

.sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}

.sidebar-toggle-btn:hover {
  color: var(--accent);
}

.logo {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.logo-accent {
  color: var(--accent);
}

.version {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  padding: 2px 6px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

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

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s;
}

.health-dot.ok {
  background: #00cc88;
  box-shadow: 0 0 8px rgba(0, 204, 136, 0.5);
}

.health-dot.err {
  background: #ff4444;
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
}

.health-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ---- App layout (sidebar + main) ---- */
.app-layout {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
}

/* ---- Sidebar ---- */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-base);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
}

.sidebar-new-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin: 12px 12px 0;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.sidebar-new-btn:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 12px var(--accent-glow);
}

.sidebar-clear-wrap {
  padding: 6px 12px 0;
  text-align: right;
}

.sidebar-clear-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}

.sidebar-clear-btn:hover {
  color: #ff4444;
}

.sidebar-history {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.history-date-group {
  padding: 0 12px;
}

.history-date-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 4px 6px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  margin: 1px 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  border-left: 3px solid transparent;
}

.history-item:hover {
  background: var(--bg-hover);
}

.history-item.active {
  background: var(--bg-elevated);
  border-left-color: var(--accent);
}

.history-item-text {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.history-item.active .history-item-text {
  color: var(--text-primary);
}

.history-item-delete {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  font-size: 14px;
  line-height: 1;
  border-radius: 2px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.history-item:hover .history-item-delete {
  display: flex;
}

.history-item-delete:hover {
  color: #ff4444;
}

.sidebar-empty {
  padding: 24px 16px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 49;
}

/* ---- Main content ---- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* ---- Chat area ---- */
.chat-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 16px;
  padding-bottom: var(--input-h);
  scroll-behavior: smooth;
}

/* ---- Welcome block ---- */
.welcome-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 16px;
  animation: fadeIn 0.6s ease;
}

.welcome-title {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--text-primary);
}

.welcome-sub {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 1px;
  max-width: 400px;
}

.welcome-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.hint-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.hint-chip:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-glow);
}

/* ---- Messages ---- */
.msg {
  max-width: 780px;
  margin: 0 auto 10px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  animation: msgSlideIn 0.3s ease;
  position: relative;
  word-break: break-word;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.msg-user {
  background: var(--msg-user-bg);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  max-width: 780px;
  text-align: left;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.msg-user .msg-label {
  color: var(--accent);
}

.msg-system {
  background: var(--msg-system-bg);
  border-left: 3px solid var(--text-muted);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.msg-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.msg-analysis {
  border-left-color: var(--msg-analysis-border);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.03) 0%, var(--msg-system-bg) 100%);
}
.msg-analysis .msg-label { color: var(--msg-analysis-border); }

.msg-queries { border-left-color: var(--msg-queries-border); }
.msg-queries .msg-label { color: var(--msg-queries-border); }

.msg-searching { border-left-color: var(--msg-searching-border); }
.msg-searching .msg-label { color: var(--msg-searching-border); }

.msg-relevance { border-left-color: var(--msg-relevance-border); }
.msg-relevance .msg-label { color: var(--msg-relevance-border); }

.msg-extraction { border-left-color: var(--msg-extraction-border); }
.msg-extraction .msg-label { color: var(--msg-extraction-border); }

.msg-answer {
  border-left-color: var(--msg-answer-border);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.04) 0%, var(--bg-surface) 100%);
  max-width: 780px;
  padding: 20px 24px;
}
.msg-answer .msg-label { color: var(--msg-answer-border); }

.msg-sources { border-left-color: var(--msg-sources-border); }
.msg-sources .msg-label { color: var(--msg-sources-border); }

.msg-stats { border-left-color: var(--msg-stats-border); }
.msg-stats .msg-label { color: var(--msg-stats-border); }

.msg-error {
  border-left-color: var(--msg-error-border);
  background: rgba(255, 68, 68, 0.05);
}
.msg-error .msg-label { color: var(--msg-error-border); }

/* ---- Message inner elements ---- */

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.analysis-item { font-size: 12px; }

.analysis-key {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.5px;
  display: block;
}

.analysis-val { color: var(--text-primary); }

.analysis-reasoning {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.analysis-strategy {
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent-dim);
  line-height: 1.7;
}

.reddit-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #ff6b00;
  background: rgba(255, 107, 0, 0.1);
  border: 1px solid rgba(255, 107, 0, 0.3);
  border-radius: 4px;
  padding: 2px 8px;
  margin-top: 8px;
  letter-spacing: 0.5px;
}

.subreddit-tag {
  display: inline-block;
  font-size: 10px;
  color: #ff6b00;
  background: rgba(255, 107, 0, 0.08);
  border-radius: 3px;
  padding: 1px 6px;
  margin: 2px 4px 2px 0;
}

.query-list {
  list-style: none;
  counter-reset: qcount;
}

.query-list li {
  counter-increment: qcount;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  padding: 6px 10px;
  margin-bottom: 4px;
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.query-list li::before {
  content: counter(qcount) ".";
  color: var(--msg-queries-border);
  font-weight: 600;
  margin-right: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.stat-cell {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.stat-key {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 2px;
  display: block;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.msg-searching .msg-body {
  animation: pulse 1.5s ease-in-out infinite;
}

.searching-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ---- Markdown rendered content ---- */
.md-content h1 { font-size: 18px; font-weight: 700; margin: 16px 0 8px; color: var(--text-primary); }
.md-content h2 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; color: var(--text-primary); }
.md-content h3 { font-size: 13px; font-weight: 600; margin: 12px 0 4px; color: var(--text-primary); }
.md-content p { margin: 8px 0; line-height: 1.7; }
.md-content strong { color: #fff; font-weight: 600; }
.md-content em { color: var(--text-secondary); font-style: italic; }
.md-content a { color: var(--accent); text-decoration: none; }
.md-content a:hover { text-decoration: underline; }

.md-content code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--accent);
}

.md-content pre {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 10px 0;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
}

.md-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
}

.md-content blockquote {
  border-left: 3px solid var(--accent-dim);
  padding-left: 12px;
  margin: 10px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.md-content ul, .md-content ol {
  padding-left: 20px;
  margin: 8px 0;
}

.md-content li {
  margin: 4px 0;
  line-height: 1.6;
}

.md-content hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 16px 0;
}

/* ---- Input bar ---- */
.input-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--input-h);
  background: var(--bg-deep);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  z-index: 10;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 780px;
}

.search-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.search-input::placeholder {
  color: var(--text-muted);
}

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

.execute-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--bg-deep);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.execute-btn:hover {
  background: #33f5ff;
  box-shadow: 0 0 16px var(--accent-glow-strong);
}

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

.execute-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.execute-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--bg-deep);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: -280px;
    bottom: 0;
    width: 260px;
    z-index: 60;
    transition: left 0.25s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .sidebar-toggle-btn {
    display: flex;
  }
}

@media (max-width: 640px) {
  .msg { max-width: 100%; }
  .msg-user { max-width: 100%; }
  .msg-answer { max-width: 100%; padding: 16px; }

  .welcome-title { font-size: 24px; letter-spacing: 3px; }

  .input-wrapper { flex-wrap: wrap; }
  .search-input { min-width: 0; }

  .analysis-grid { grid-template-columns: 1fr; }
}

/* ---- Mode toggle ---- */
.mode-toggle {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.mode-toggle.mode-refined {
  color: var(--accent);
  background: var(--accent-glow);
  border-color: var(--accent-dim);
}

.mode-toggle.mode-raw {
  color: #ffaa00;
  background: rgba(255, 170, 0, 0.1);
  border-color: rgba(255, 170, 0, 0.3);
}

.mode-toggle:hover {
  opacity: 0.85;
}

/* ---- Raw results — 통합 리스트 ---- */
.results-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.results-meta-count {
  color: var(--accent);
  font-weight: 600;
}

.results-meta-sep {
  color: var(--text-muted);
}

.results-meta-time {
  color: var(--text-secondary);
}

.results-provider-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 2px 7px;
}

.results-md-link {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-dim);
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  border-radius: 3px;
  padding: 2px 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.results-md-link:hover {
  color: var(--accent);
  background: var(--accent-glow-strong);
}

.results-unified-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.results-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.result-unified-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}

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

.result-unified-item:hover {
  background: rgba(0, 240, 255, 0.02);
}

.result-url-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.result-display-url {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.result-source-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent-dim);
  background: var(--accent-glow);
  border-radius: 3px;
  padding: 1px 6px;
}

.result-score-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #ffaa00;
  background: rgba(255, 170, 0, 0.1);
  border-radius: 3px;
  padding: 1px 6px;
}

.result-unified-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
  line-height: 1.4;
}

.result-unified-title:hover {
  text-decoration: underline;
  color: #33f5ff;
}

.result-unified-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  display: inline-block;
}

.msg-raw-results {
  border-left-color: var(--accent-dim);
  max-width: 780px;
  padding: 0;
  overflow: hidden;
  background: var(--bg-surface);
}
.msg-raw-results .msg-label {
  color: var(--accent);
}


/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  z-index: 200;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 48px 32px;
  text-align: center;
  animation: fadeIn 0.6s ease;
}

.login-brand {
  margin-bottom: 40px;
}

.login-title {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 8px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-subtitle {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.login-divider {
  width: 48px;
  height: 2px;
  background: var(--accent);
  margin: 20px auto 0;
  opacity: 0.6;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Google 로그인 버튼 */
.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.login-btn-google {
  background: #ffffff;
  color: #3c4043;
}

.login-btn-google:hover {
  background: #f1f3f4;
  box-shadow: 0 2px 12px rgba(255, 255, 255, 0.1);
}

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

.google-icon {
  flex-shrink: 0;
}

/* OR 구분선 */
.login-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}

.login-or-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.login-or-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Magic Link */
.magic-link-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.magic-link-input-wrap {
  display: flex;
  gap: 8px;
}

.magic-link-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.magic-link-input:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.magic-link-input::placeholder {
  color: var(--text-muted);
}

.magic-link-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--bg-deep);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.magic-link-btn:hover {
  background: #33f5ff;
  box-shadow: 0 0 12px var(--accent-glow-strong);
}

.magic-link-btn:active {
  transform: scale(0.97);
}

.magic-link-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.magic-link-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--bg-deep);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.magic-link-hint {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.magic-link-status {
  font-size: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.3px;
}

.magic-link-status-success {
  color: #00cc88;
  background: rgba(0, 204, 136, 0.08);
  border: 1px solid rgba(0, 204, 136, 0.2);
}

.magic-link-status-error {
  color: #ff4444;
  background: rgba(255, 68, 68, 0.08);
  border: 1px solid rgba(255, 68, 68, 0.2);
}

/* Login footer */
.login-footer {
  margin-top: 48px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.login-footer-accent {
  color: var(--accent);
  font-weight: 600;
}

/* ============================================
   HEADER — User info & Logout
   ============================================ */

.user-email {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  color: #ff4444;
  border-color: rgba(255, 68, 68, 0.3);
  background: rgba(255, 68, 68, 0.05);
}

/* ============================================
   RESPONSIVE — Login
   ============================================ */

@media (max-width: 480px) {
  .login-container {
    padding: 32px 20px;
  }

  .login-title {
    font-size: 32px;
    letter-spacing: 5px;
  }

  .magic-link-input-wrap {
    flex-direction: column;
  }

  .magic-link-btn {
    width: 100%;
    justify-content: center;
  }
}
