:root {
  /* Color Palette - Deep Navy & Premium */
  --bg-dark: #0f141c;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1c2537, #0f141c 80%);
  --panel-glass: rgba(20, 27, 40, 0.7);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f1f5ff;
  --text-secondary: #94a3b8;
  --accent-color: #3b82f6;
  /* Blue-ish accent */
  --accent-glow: rgba(59, 130, 246, 0.4);
  --danger: #ef4444;
  --success: #10b981;

  /* Spacing & Radius */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-color);
}

/* Utilities */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  width: 100%;
}

main.page-main {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 20px 0 60px;
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.section-subtitle {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.section-helper {
  margin: -4px 0 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 56px 32px;
  text-align: center;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.2), transparent 55%);
  pointer-events: none;
}

.hero-panel.slim {
  padding: 40px 32px;
}

.hero-panel>* {
  position: relative;
  z-index: 1;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  margin: 18px auto 28px;
  max-width: 640px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions .btn,
.hero-actions .btn-ghost {
  min-width: 140px;
}

.highlight-panel {
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 12px 30px rgba(15, 20, 28, 0.5);
}

.highlight-body {
  margin: 12px 0 20px;
  font-size: 15px;
  color: var(--text-secondary);
}

.panel-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.panel-grid.two-columns {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.form-panel {
  display: flex;
  flex-direction: column;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.form-stack button {
  margin-top: 8px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-2 {
  gap: 8px;
}

.gap-4 {
  gap: 16px;
}

.gap-6 {
  gap: 24px;
}

.w-full {
  width: 100%;
}

.mt-4 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-secondary);
}

.font-bold {
  font-weight: 700;
}

.hidden {
  display: none !important;
}

/* Glassmorphism Card */
.glass-panel {
  background: var(--panel-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 32px;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.glass-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Header */
.site-header {
  position: sticky;
  top: 20px;
  z-index: 100;
  margin-bottom: 40px;
  padding: 16px 24px;
  border-radius: 999px;
  /* Pill shape */
}

.menu-toggle {
  display: none;
}

.brand-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.brand-logo-full {
  height: 90px;
  max-height: 100px;
  max-width: 360px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.28));
  border-radius: 16px;
}

.nav-link {
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  transition: background 0.2s;
  font-size: 15px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Buttons */
.btn,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}

.btn {
  border: none;
  background: var(--accent-color);
  color: white;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--accent-glow);
  filter: brightness(1.1);
}

.btn-ghost {
  background: transparent;
  box-shadow: none;
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}


.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.suggestion-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.chip-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.2s;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Forms */
input,
select,
textarea {
  width: 100%;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 16px;
  transition: all 0.2s;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: rgba(0, 0, 0, 0.3);
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Search Box Special */
.search-box-wrapper {
  position: relative;
}

.search-box-wrapper input {
  padding-right: 120px;
  /* Space for button */
  font-size: 18px;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: rgba(20, 27, 40, 0.6);
  backdrop-filter: blur(10px);
}

.search-box-wrapper button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 10px 20px;
}

.search-form {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.led-border {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(59, 130, 246, 0.4), rgba(124, 58, 237, 0.35));
  box-shadow: 0 8px 24px rgba(15, 20, 28, 0.45);
}

.led-border input {
  flex: 1;
  border-radius: calc(var(--radius-lg) - 4px);
  border: none;
  background: rgba(15, 20, 28, 0.85);
  padding: 18px 22px;
  font-size: 17px;
}

.led-border input:focus {
  box-shadow: none;
  border: none;
}

.search-suggest {
  margin-top: 8px;
  background: rgba(20, 27, 40, 0.9);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.search-suggest.hidden {
  display: none;
}

.suggest-item {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.suggest-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.suggest-item .suggest-title {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.45;
}

.suggest-item .suggest-id {
  font-size: 12px;
  color: var(--text-secondary);
}

.led-border .btn {
  flex-shrink: 0;
  min-width: 120px;
  box-shadow: none;
}

.current-query {
  margin-top: 24px;
  font-size: 15px;
  color: var(--text-secondary);
}

/* Typography */
h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 42px;
  line-height: 1.2;
  margin-bottom: 16px;
}

h2 {
  font-size: 28px;
  margin-bottom: 16px;
}

p {
  margin: 0 0 16px;
  color: var(--text-secondary);
}

/* Manual Content */
.manual-content {
  line-height: 1.8;
  font-size: 16px;
}

.manual-content img {
  border-radius: var(--radius-md);
  max-width: 100%;
  border: 1px solid var(--panel-border);
}

.manual-code {
  background: #0d1117;
  padding: 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  border: 1px solid var(--panel-border);
  margin: 16px 0;
}

.summary-line {
  margin: 6px 0;
  line-height: 1.6;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s var(--ease-out) forwards;
}

.guestbook-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guestbook-entry {
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.guestbook-entry:last-child {
  border-bottom: none;
}

.guestbook-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.guestbook-meta strong {
  font-size: 16px;
}

.guestbook-date {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 8px;
}

.guestbook-body {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
}

.guestbook-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.guestbook-actions .danger {
  color: var(--danger);
  border-color: var(--danger);
}

.announce-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 28px 32px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(15, 20, 28, 0.9));
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: 0 20px 60px rgba(12, 16, 26, 0.7);
}

.announce-hero__text h2 {
  margin: 6px 0 10px;
  font-size: 24px;
}

.announce-hero__actions {
  display: flex;
  gap: 8px;
}

.announce-subtitle {
  margin: 0 0 12px;
  color: var(--text-secondary);
}

.announce-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.pill.muted {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.chip.strong {
  border-color: rgba(59, 130, 246, 0.6);
  color: #dce9ff;
}

.chip.subtle {
  color: var(--text-secondary);
}

.announce-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
}

.announce-card {
  padding: 20px 24px;
  border: 1px solid var(--panel-border);
  position: relative;
  overflow: hidden;
}

.announce-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.12), transparent 50%);
  pointer-events: none;
}

.announce-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.announce-card__title {
  margin: 6px 0 4px;
  font-size: 18px;
}

.announce-helper {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.announce-form__fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.announce-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.announce-form .field span {
  color: var(--text-secondary);
  font-size: 14px;
}

.announce-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.announce-list .guestbook-entry {
  padding: 18px 18px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.announce-list .guestbook-entry:hover {
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
  transition: all 0.2s var(--ease-out);
}

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

.avatar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.15);
}

/* Mobile */
@media (max-width: 768px) {
  .site-header {
    position: static;
    top: 0;
    padding: 16px;
    border-radius: 20px;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
    gap: 16px;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    display: flex;
    gap: 8px;
  }

  .auth-links {
    width: 100%;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .auth-links form {
    display: flex;
    flex: 1;
  }

  .auth-links .btn,
  .auth-links .btn-ghost {
    width: auto;
    flex: 1;
    min-width: auto;
    padding: 10px 16px;
    font-size: 14px;
  }

  /* Fix for the greeting message to take full width */
  .auth-links .greeting-badge {
    width: 100%;
    justify-content: center;
    margin-bottom: 4px;
  }

  main.page-main {
    padding: 0 0 40px;
  }

  .hero-panel,
  .hero-panel.slim {
    text-align: left;
    padding: 32px 24px;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .suggestion-chips {
    flex-direction: column;
    align-items: flex-start;
  }

  .led-border {
    flex-direction: column;
  }

  .led-border .btn {
    width: 100%;
  }

  .result-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 {
    font-size: 32px;
  }

  .glass-panel {
    padding: 24px;
  }

  .announce-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }

  .announce-hero__actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .announce-card {
    padding: 18px 20px;
  }

  .brand-logo-full {
    height: 42px;
    max-width: 180px;
  }

  .ai-help-panel .ai-help-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* AI 입력 영역 모바일 레이아웃 */
  .ai-input-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .ai-input-row .input-wrapper {
    width: 100%;
    position: relative;
  }

  .ai-input-row .input-wrapper input {
    padding-right: 48px;
  }

  /* 버튼들을 가로로 꽉 차게 배치 - clear 버튼 제외 */
  .ai-input-row button:not(.input-clear) {
    width: 100%;
    flex: 1;
  }

  /* AI 입력 영역의 clear 버튼은 명시적으로 위치 고정 */
  .ai-input-row .input-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    flex: none;
  }

  /* 버튼 그룹 컨테이너가 있다면(미래 대비) */
  .ai-button-group {
    display: flex;
    gap: 8px;
    width: 100%;
  }

  .ai-help-panel #ai-need-input {
    min-width: 100%;
    width: 100%;
  }

  .led-border input {
    font-size: 14px;
    padding: 14px 16px;
  }
}

/* Rotating LED Border for Logo */
.brand-wrapper {
  position: relative;
  padding: 4px;
  border-radius: 99px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* ... */

.brand-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.brand-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(transparent,
      transparent,
      transparent,
      var(--accent-color));
  animation: rotate 4s linear infinite;
  z-index: 0;
}

.brand-wrapper::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--bg-dark);
  /* Match header background or slightly lighter */
  border-radius: 99px;
  z-index: 0;
}

.brand-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

/* Ensure loading overlay is hidden by default and handles transitions */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 20, 28, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.loading-overlay.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.spinner {
  width: 58px;
  height: 58px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 18px;
}

.loading-text {
  text-align: center;
  color: var(--text-primary);
  font-weight: 600;
}

.loading-hint {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

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

/* Utilities for Feedback */
.feedback-btn {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.feedback-btn:hover,
.feedback-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.ai-help-panel .ai-help-header {
  align-items: flex-start;
}

.ai-help-panel .ai-help-title {
  margin: 0;
  line-height: 1.3;
}

.ai-help-panel .ai-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.ai-help-panel #ai-need-input {
  flex: 1;
  min-width: 240px;
  max-width: 420px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-wrapper input {
  width: 100%;
  padding-right: 42px;
}

/* LED border 내부의 input-wrapper에서 clear 버튼이 오른쪽 끝에 위치하도록 */
.led-border .input-wrapper {
  flex: 1;
}

.led-border .input-wrapper input {
  padding-right: 48px;
}

.input-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: color 0.15s;
}

.input-clear:hover {
  color: var(--text-primary);
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 1200;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-2px);
}

.err {
  color: var(--danger);
  font-size: 14px;
  margin-top: 8px;
}

.notice {
  color: var(--success);
  font-size: 14px;
  margin-top: 8px;
}

.feedback-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.results-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.result-card {
  overflow: hidden;
}

.result-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.empty-state {
  text-align: center;
}

/* Lightbox */
/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: none;
  /* Changed from flex to none */
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  /* Show when active */
  opacity: 1;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 40px;
  cursor: pointer;
  padding: 10px;
  line-height: 1;
}

.site-footer {
  text-align: center;
  padding: 24px 16px 40px;
  color: var(--text-secondary);
  font-size: 13px;
}

.site-footer p {
  margin-bottom: 4px;
}

/* Mobile Touch Optimizations */
@media (max-width: 768px) {

  .btn,
  .btn-ghost,
  .nav-link,
  .chip {
    min-height: 44px;
    /* Apple's recommended touch target size */
    display: inline-flex;
    align-items: center;
  }

  .chip {
    padding: 8px 16px;
    /* Larger touch area */
  }

  /* Active state for better touch feedback */
  .btn:active,
  .btn-ghost:active,
  .chip:active,
  .result-card:active {
    transform: scale(0.98);
    transition: transform 0.1s;
  }
}

/* Trendy Logo */
.logo-text {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 30%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(59, 130, 246, 0.3));
  margin-bottom: 2px;
}

.logo-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  background: linear-gradient(90deg, #94a3b8 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 1;
  margin-top: -2px;
}

/* Greeting Badge */
.greeting-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
}

.data-table th {
  text-align: left;
  padding: 16px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid var(--panel-border);
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 15px;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table th.text-right,
.data-table td.text-right {
  text-align: right;
}

.data-table th.text-center,
.data-table td.text-center {
  text-align: center;
}

/* AI Summary Table */
.ai-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-summary-table th {
  background: rgba(59, 130, 246, 0.15);
  color: #fff;
  font-weight: 600;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(59, 130, 246, 0.3);
}

.ai-summary-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.ai-summary-table tr:last-child td {
  border-bottom: none;
}

.ai-summary-table tr:hover td {
  background: rgba(59, 130, 246, 0.08);
}

.ai-summary-table strong {
  color: #60a5fa;
}

/* AI Summary Table - Mobile Responsive */
.ai-summary-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0;
}

@media (max-width: 768px) {
  .ai-summary-table {
    font-size: 13px;
    min-width: 280px;
  }

  .ai-summary-table th,
  .ai-summary-table td {
    padding: 10px 12px;
    white-space: nowrap;
  }

  .ai-summary-table th:first-child,
  .ai-summary-table td:first-child {
    min-width: 100px;
    white-space: normal;
    word-break: keep-all;
  }

  /* 터치 영역 확대 */
  .ai-summary-table tr {
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
  }

  .ai-summary-table tr:active td {
    background: rgba(59, 130, 246, 0.15);
  }
}

/* Search Loading Animation */
.search-loading {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-color);
  font-weight: 500;
}

.loading-dots {
  display: inline-flex;
  gap: 3px;
}

.loading-dots::after {
  content: "●●●";
  animation: loadingDots 1.4s infinite;
  letter-spacing: 2px;
}

@keyframes loadingDots {

  0%,
  20% {
    opacity: 0.2;
  }

  40% {
    opacity: 1;
  }

  60% {
    opacity: 0.2;
  }

  80%,
  100% {
    opacity: 0.2;
  }
}

/* AI 입력 행 기본 스타일 */
.ai-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

/* 검색 트리거 강조 (검색해줘) */
/* 검색 트리거 강조 (검색해줘) */
.ai-help-panel .search-trigger-highlight {
  color: #fcb045;
  /* Golden Orange */
  font-weight: 800;
  /* Extra Bold */
  background: rgba(252, 176, 69, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(252, 176, 69, 0.3);
  box-shadow: 0 0 8px rgba(252, 176, 69, 0.15);
  display: inline-block;
  /* 패딩 적용 보장 */
}

/* 출처 링크 스타일 */
.source-link {
  color: var(--accent-color);
  text-decoration: underline;
  word-break: break-all;
}

.source-link:hover {
  color: #60a5fa;
  text-decoration: none;
}