:root {
  --sidebar-width: 380px;
  --font-body: "Inter", sans-serif;
  --font-label: "Space Mono", monospace;
  --font-jp: "Noto Sans JP", sans-serif;
}

[data-theme="light"] {
  --bg-dark: #FAFAF8;
  --bg-panel: #ffffff;
  --bg-card: #f4f4f2;
  --bg-hover: #eceae6;
  --accent: #E63946;
  --accent-glow: rgba(230, 57, 70, 0.18);
  --accent-hover: rgba(230, 57, 70, 0.35);
  --text-primary: #1A1A2E;
  --text-secondary: #5c5c7a;
  --text-muted: #8D99AE;
  --border: #E8E8E8;
  --border-input: #D0D0D0;
  --success: #2A9D8F;
  --section-divider: #E8E8E8;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg-dark: #0D0D1A;
  --bg-panel: #0D0D1A;
  --bg-card: #1A1A2E;
  --bg-hover: #24244a;
  --accent: #E63946;
  --accent-glow: rgba(230, 57, 70, 0.25);
  --accent-hover: rgba(230, 57, 70, 0.4);
  --text-primary: #F4F1DE;
  --text-secondary: #8D99AE;
  --text-muted: #565a6e;
  --border: #2A2A4E;
  --border-input: #2A2A4E;
  --success: #2A9D8F;
  --section-divider: #2A2A4E;
  color-scheme: dark;
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.app-layout {
  display: flex;
  height: 100vh;
  width: 100%;
}

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  border-right: none;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
  transition: background-color 0.3s ease;
  z-index: 10;
}

.sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--section-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-header-left {
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-family: var(--font-body);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-logo {
  flex-shrink: 0;
}

.sidebar-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 400;
}

.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.sidebar-content {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
}

.sidebar-health {
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--text-secondary);
}

.health-badge {
  color: var(--accent);
}

.section-label {
  font-family: var(--font-label);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 4px;
  font-weight: 700;
}

.section-heading {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.shape-section {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--section-divider);
}

.ai-shape-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.ai-shape-row .search-input {
  flex: 1;
}

.generate-shape-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s, transform 0.15s;
}

.generate-shape-btn:hover {
  background: var(--accent-hover);
}

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

.generate-shape-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.shape-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.shape-chip {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

[data-theme="light"] .shape-chip {
  background: #F0F0F0;
  color: #1A1A2E;
}

[data-theme="dark"] .shape-chip {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.shape-chip:hover {
  background: var(--accent);
  color: #fff;
}

.shape-chip.active {
  background: var(--accent);
  color: #fff;
}

.shape-preview-area {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.shape-preview-placeholder {
  font-size: 13px;
  color: var(--text-tertiary);
  font-style: italic;
}

.shape-preview-result {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shape-preview-svg {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.shape-preview-name {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.shape-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.shape-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.divider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--section-divider);
}

.divider-text {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.freehand-btn {
  width: 100%;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s, filter 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

[data-theme="light"] .freehand-btn {
  background: #ffffff;
}

[data-theme="dark"] .freehand-btn {
  background: var(--bg-card);
}

.freehand-btn:hover {
  border-color: var(--accent-hover);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.freehand-btn.selected {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

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

.freehand-icon {
  font-size: 16px;
}

.text-shape-confirm {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--accent);
  margin-top: 6px;
  min-height: 1em;
}

.location-section {
  margin-top: 0;
  padding-top: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--section-divider);
}

.location-btn {
  width: 100%;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, filter 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

[data-theme="light"] .location-btn {
  background: #ffffff;
}

[data-theme="dark"] .location-btn {
  background: var(--bg-card);
}

.location-btn:hover {
  border-color: var(--accent-hover);
}

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

.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.search-input {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-input);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.3s ease;
}

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

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
}

.search-go-btn {
  padding: 9px 16px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s;
  white-space: nowrap;
}

.search-go-btn:hover {
  filter: brightness(0.9);
}

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

.section-hint {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.adjust-section {
  margin-top: 0;
  padding-top: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--section-divider);
}

.slider-group {
  margin-bottom: 16px;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.slider-label {
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--text-secondary);
}

.slider-value {
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--accent);
}

.custom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-card);
  outline: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.custom-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.select-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.custom-select {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-input);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238D99AE' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.custom-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
}

.custom-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.generate-section {
  margin-top: 0;
  padding-top: 24px;
  position: relative;
}

.generate-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #E63946, #c5303c);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.01em;
}

.generate-btn:hover:not(:disabled) {
  filter: brightness(0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px var(--accent-glow);
}

.generate-btn:active:not(:disabled) {
  transform: scale(0.98);
}

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

.progress-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  margin-top: 12px;
}

.progress-panel.visible {
  display: flex;
}

.progress-percent {
  font-family: var(--font-label);
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
  position: relative;
  transition: background-color 0.3s ease;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #E63946, #FF6B6B);
  transition: width 0.3s ease;
  position: relative;
}

.progress-bar-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
  animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
  0%, 100% { opacity: 0; transform: translateX(-100%); }
  50% { opacity: 1; transform: translateX(100%); }
}

.progress-status {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

.progress-eta {
  font-family: var(--font-label);
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 1em;
}

.cancel-btn {
  margin-top: 4px;
  padding: 6px 20px;
  background: transparent;
  border: 1px solid rgba(230, 57, 70, 0.3);
  color: var(--accent);
  border-radius: 8px;
  font-family: var(--font-label);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.cancel-btn:hover {
  background: rgba(230, 57, 70, 0.1);
  border-color: rgba(230, 57, 70, 0.5);
}

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

.result-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.result-panel.visible {
  display: flex;
}

.stats-row {
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.stats-row strong {
  color: var(--accent);
  font-weight: 700;
}

.fidelity-score {
  color: var(--accent);
  font-weight: 600;
}

.shape-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.shape-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}

.download-btn {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.download-btn:hover {
  filter: brightness(0.9);
}

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

.strava-hint {
  font-family: var(--font-label);
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.map-wrapper {
  flex: 1;
  height: 100vh;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}


.draw-canvas {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  cursor: crosshair;
  background: rgba(0, 0, 0, 0.08);
  touch-action: none;
}

.draw-canvas.active {
  display: block;
}

.done-draw-btn {
  display: none;
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 1001;
  padding: 10px 20px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.done-draw-btn.active {
  display: block;
}

.done-draw-btn:hover {
  filter: brightness(0.9);
}

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

.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  max-width: 480px;
  width: 90%;
}

.toast {
  pointer-events: auto;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: toastIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .toast-adjust {
  background: #3d3217;
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

[data-theme="light"] .toast-adjust {
  background: #fef3cd;
  color: #856404;
  border: 1px solid rgba(133, 100, 4, 0.2);
}

[data-theme="dark"] .toast-error {
  background: #3d1717;
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.25);
}

[data-theme="light"] .toast-error {
  background: #fde8e8;
  color: #c53030;
  border: 1px solid rgba(197, 48, 48, 0.2);
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast-dismiss {
  margin-left: 8px;
  cursor: pointer;
  opacity: 0.6;
  font-size: 16px;
  background: none;
  border: none;
  color: inherit;
  padding: 0 2px;
  line-height: 1;
}

.toast-dismiss:hover {
  opacity: 1;
}

.toast-fade-out {
  animation: toastOut 0.3s ease-in forwards;
}

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

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

@media (max-width: 767px) {
  .app-layout {
    flex-direction: column;
    height: 100vh;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;
    height: 45vh;
    border-right: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  .sidebar-header {
    padding: 14px 16px 12px;
  }

  .sidebar-title {
    font-size: 20px;
  }

  .sidebar-tagline {
    font-size: 12px;
  }

  .sidebar-content {
    padding: 14px 16px;
  }

  .section-heading {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .ai-shape-row {
    flex-direction: column;
  }

  .shape-chips {
    gap: 4px;
  }

  .shape-chip {
    padding: 5px 10px;
    font-size: 12px;
  }

  .divider-row {
    margin: 10px 0;
  }

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

  .location-section {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .adjust-section {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .generate-section {
    padding-top: 16px;
  }

  .generate-btn {
    padding: 12px;
    font-size: 14px;
  }

  .map-wrapper {
    flex: none;
    height: 55vh;
  }

  .done-draw-btn {
    bottom: 16px;
    right: 16px;
  }

  .toast-container {
    left: 0;
    right: 0;
    max-width: 100%;
  }
}


.map-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.map-banner-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-body);
  line-height: 1.4;
  pointer-events: auto;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  animation: bannerSlideIn 0.3s ease;
  max-width: 480px;
}

.map-banner-item.banner-info {
  background: rgba(59, 130, 246, 0.9);
  color: #ffffff;
}

.map-banner-item.banner-warning {
  background: rgba(234, 179, 8, 0.9);
  color: #1a1a2e;
}

.map-banner-dismiss {
  background: none;
  border: none;
  color: inherit;
  font-size: 16px;
  cursor: pointer;
  padding: 0 0 0 4px;
  opacity: 0.8;
  flex-shrink: 0;
  line-height: 1;
}

.map-banner-dismiss:hover {
  opacity: 1;
}

.banner-fade-out {
  animation: bannerFadeOut 0.3s ease forwards;
}

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

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

.route-info-box {
  position: absolute;
  bottom: 24px;
  left: 12px;
  z-index: 1100;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.6;
  pointer-events: auto;
  min-width: 200px;
  max-width: 300px;
  display: none;
}

[data-theme="light"] .route-info-box {
  background: rgba(255, 255, 255, 0.92);
  color: #1a1a2e;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .route-info-box {
  background: rgba(13, 13, 26, 0.92);
  color: #F4F1DE;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.route-info-box .info-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.route-info-box .info-label {
  opacity: 0.6;
  font-size: 11px;
  white-space: nowrap;
}

.route-info-box .info-value {
  font-weight: 600;
  font-size: 12px;
}

.route-info-box .info-value.accuracy-green { color: #2A9D8F; }
.route-info-box .info-value.accuracy-yellow { color: #eab308; }
.route-info-box .info-value.accuracy-red { color: #ef4444; }

.sidebar-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--section-divider);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.footer-brand {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.footer-jp {
  font-family: var(--font-jp);
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.7;
}

.footer-made {
  font-family: var(--font-label);
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.5;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.footer-made svg {
  color: var(--accent);
  flex-shrink: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-card {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background-color 0.3s ease;
}

.stat-card-label {
  font-family: var(--font-label);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card-value {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.stat-card-sub {
  font-family: var(--font-label);
  font-size: 10px;
  color: var(--text-secondary);
}

.stat-card-value.accuracy-green { color: #2A9D8F; }
.stat-card-value.accuracy-yellow { color: #eab308; }
.stat-card-value.accuracy-red { color: #ef4444; }

@keyframes header-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tagline-slide-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.sidebar-title {
  animation: header-fade-in 0.5s ease-out both;
}

.sidebar-tagline {
  animation: tagline-slide-up 0.5s ease-out 0.2s both;
}

@keyframes generate-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.generate-btn.pulsing {
  animation: generate-pulse 1.5s ease-in-out infinite;
}

.generate-btn.pulsing:hover {
  animation: none;
}

.download-location-note {
  font-size: 11px;
  line-height: 1.5;
  opacity: 0.7;
  margin-top: 4px;
  padding: 0;
}

[data-theme="light"] .download-location-note {
  color: #4a4a6a;
}

[data-theme="dark"] .download-location-note {
  color: #a0a0b8;
}
