:root {
  --primary: #22c55e;
  --primary-dark: #16a34a;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --danger: #ef4444;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  padding-bottom: calc(70px + var(--safe-bottom));
}

#app {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Loading */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: white;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card-bg);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header h1 {
  margin: 0;
  font-size: 1.25rem;
}

.app-version {
  font-size: 0.65rem;
  color: var(--text-secondary);
  opacity: 0.5;
  font-weight: normal;
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.5rem;
  padding: 8px;
  cursor: pointer;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-action-btn {
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.header-action-btn:active {
  background: var(--primary-dark);
}

.header-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #176b3a;
}

.header-share-btn svg {
  width: 21px;
  height: 21px;
}

/* Pages */
.page {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* Track share card */
.share-card-modal {
  position: fixed;
  z-index: 10001;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px 16px calc(16px + var(--safe-bottom));
  background: rgba(11, 25, 18, 0.58);
  backdrop-filter: blur(5px);
}

.share-card-sheet {
  width: min(100%, 420px);
  max-height: calc(100vh - 36px - var(--safe-bottom));
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: #f8faf6;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.share-card-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.share-card-sheet-head strong,
.share-card-sheet-head span {
  display: block;
}

.share-card-sheet-head strong {
  color: #173a2d;
  font-size: 1rem;
}

.share-card-sheet-head span,
.share-card-hint {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.share-card-sheet-head span {
  margin-top: 3px;
}

.share-card-sheet-head .btn-icon {
  padding: 2px 4px;
  color: var(--text-secondary);
  font-size: 1.2rem;
}

.share-card-preview {
  display: block;
  width: min(100%, 320px);
  margin: 0 auto 15px;
  border-radius: 14px;
  background: #e8eee5;
  box-shadow: 0 8px 22px rgba(23, 58, 45, 0.18);
}

.share-card-primary {
  width: 100%;
  min-height: 46px;
  background: #176b3a;
}

.share-card-download {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: none;
  background: transparent;
  color: #315945;
  font: 600 0.88rem inherit;
  cursor: pointer;
}

.share-card-hint {
  margin: 0;
  text-align: center;
  line-height: 1.45;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.1s;
}

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

.card-title {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.card-meta {
  display: flex;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

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

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

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

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

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.file-input-wrapper {
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  color: var(--text-secondary);
  background: rgba(34, 197, 94, 0.04);
}

.file-input-wrapper:active {
  border-color: var(--primary);
  background: rgba(34, 197, 94, 0.05);
}

.file-select-btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 13px 16px;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.file-name-hint {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.4;
  word-break: break-all;
}

/* Login */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}

.login-logo {
  width: 100px;
  height: 100px;
  background: var(--primary);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: 24px;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
  background: rgba(17, 24, 39, 0.45);
}

.auth-panel {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

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

.auth-panel-header h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.auth-panel-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  background: var(--bg);
  border-radius: 10px;
}

.auth-tabs button {
  border: none;
  border-radius: 8px;
  padding: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;
}

.auth-tabs button.active {
  background: var(--card-bg);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.auth-form {
  margin: 0;
}

.settings-section {
  margin-top: 24px;
}

.settings-section h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

/* Install guide */
.install-entry-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.install-entry-card.is-installed {
  cursor: default;
}

.install-entry-card.is-installed:active {
  transform: none;
}

.install-entry-icon,
.install-nudge-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 11px;
}

.install-entry-copy {
  min-width: 0;
  flex: 1;
}

.install-entry-copy .card-title,
.install-entry-copy .card-desc {
  margin: 0;
}

.install-entry-status {
  flex: 0 0 auto;
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.install-entry-card.is-installed .install-entry-status {
  color: var(--text-secondary);
}

.install-nudge {
  position: fixed;
  z-index: 1550;
  left: 12px;
  right: 12px;
  bottom: calc(74px + var(--safe-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 576px;
  margin: 0 auto;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 1px solid rgba(15, 107, 86, 0.16);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(15, 43, 35, 0.18);
  animation: installNudgeIn 0.24s ease-out;
}

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

.install-nudge-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.install-nudge-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.install-nudge-copy strong {
  font-size: 0.86rem;
}

.install-nudge-copy span {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.install-nudge-action,
.install-nudge-close {
  border: none;
  cursor: pointer;
}

.install-nudge-action {
  flex: 0 0 auto;
  padding: 7px 8px;
  background: transparent;
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
}

.install-nudge-close {
  padding: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.25rem;
  line-height: 1;
}

.install-guide-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.install-guide-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(17, 24, 39, 0.45);
}

.install-guide-panel {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: min(78vh, 620px);
  overflow-y: auto;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.16);
  animation: installGuideUp 0.22s ease-out;
}

@keyframes installGuideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.install-guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.install-guide-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.install-guide-eyebrow {
  margin: 0 0 4px;
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
}

.install-guide-body {
  margin: 14px 0 18px;
}

.install-guide-body > p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.install-guide-steps {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: install-step;
}

.install-guide-steps li {
  position: relative;
  min-height: 42px;
  padding: 11px 12px 11px 50px;
  background: #f0fdf8;
  border-radius: 12px;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
  counter-increment: install-step;
}

.install-guide-steps li::before {
  position: absolute;
  top: 10px;
  left: 12px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-dark);
  color: white;
  content: counter(install-step);
  font-size: 0.78rem;
  font-weight: 700;
}

.install-guide-symbol {
  color: var(--primary-dark);
  font-size: 1.1rem;
}

.install-guide-or {
  margin: 14px 0 0 !important;
  text-align: center;
  font-size: 0.82rem;
}

.install-guide-later {
  width: 100%;
}

/* Map */
.map-wrapper {
  position: relative;
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
}

.map-container {
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--border);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

@media (min-width: 768px) {
  .map-container {
    height: 300px;
  }
}

.map-fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 400;
  padding: 0;
}

.map-fullscreen-btn svg {
  width: 20px;
  height: 20px;
}

.map-fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card-bg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.map-fullscreen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
  flex-shrink: 0;
}

.map-fullscreen-header h2 {
  margin: 0;
  font-size: 1rem;
  flex: 1;
  text-align: center;
  padding: 0 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-fullscreen-body {
  flex: 1;
  position: relative;
  min-height: 0;
}

.map-fullscreen-body .map-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  border-radius: 0;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stats-grid-4 .stat-card {
  padding: 14px 8px;
}

.stats-grid-4 .stat-value {
  font-size: 1.1rem;
}

.stats-grid-4 .stat-label {
  font-size: 0.75rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stats-grid-secondary {
  margin-top: 12px;
}

.stat-value-sm {
  font-size: 1.15rem;
}

@media (max-width: 360px) {
  .stats-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.difficulty-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.difficulty-easy {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.difficulty-moderate {
  background: rgba(234, 179, 8, 0.12);
  color: #a16207;
}

.difficulty-hard {
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
}

.difficulty-extreme {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

/* Chart */
.chart-container {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.chart-container canvas {
  max-height: 200px !important;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding-bottom: var(--safe-bottom);
  z-index: 1000;
}

.nav-item {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-secondary);
  cursor: pointer;
}

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

.nav-icon {
  font-size: 1.4rem;
}

.nav-label {
  font-size: 0.7rem;
}

/* Messages */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  z-index: 2000;
  animation: fadeIn 0.2s;
}

.toast.error {
  background: var(--danger);
}

.app-update-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(74px + var(--safe-bottom));
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #111827;
  color: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.app-update-banner strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.3;
}

.app-update-banner p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  line-height: 1.35;
}

.app-update-banner button {
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--primary);
  color: white;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.app-update-banner button:disabled {
  opacity: 0.65;
  cursor: wait;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }

/* Explore Page */
.explore-filters {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.explore-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.explore-search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  pointer-events: none;
}

.explore-search-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
}

.explore-search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.explore-filter-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.explore-filter-btn:active {
  background: rgba(34, 197, 94, 0.08);
  border-color: var(--primary);
  color: var(--primary);
}

.explore-filter-btn svg {
  width: 20px;
  height: 20px;
}

.filter-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--primary);
  color: white;
  border-radius: 9px;
  font-size: 0.65rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.explore-tag-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.explore-tag-scroll::-webkit-scrollbar {
  display: none;
}

.filter-tag-pill {
  flex-shrink: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: 16px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.filter-tag-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Explore Filter Panel */
.explore-filter-panel {
  background: white;
  border-radius: 20px 20px 16px 16px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  overflow: hidden;
  animation: slideUp 0.2s ease;
}

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

.explore-filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.explore-filter-panel-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.filter-panel-reset {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px 8px;
}

.explore-filter-panel-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.filter-panel-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-panel-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.filter-panel-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-panel-option {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-panel-option.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.filter-panel-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
}

.filter-panel-select:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-panel-done {
  width: calc(100% - 40px);
  margin: 0 20px 20px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.explore-result-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.explore-grid {
  display: grid;
  gap: 16px;
}

/* Explore Cards */
.explore-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid rgba(29, 78, 47, 0.10);
  border-radius: 18px;
  box-shadow: 0 5px 16px rgba(19, 51, 29, 0.07);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.explore-card:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(19, 51, 29, 0.08);
}

.explore-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 158px;
  background: #e3eee5;
  overflow: hidden;
}

.explore-thumb canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.explore-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 27, 13, 0.18) 0%, transparent 42%, rgba(7, 27, 13, 0.64) 100%);
}

.explore-thumb-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 13px 14px 12px;
  color: #fff;
  pointer-events: none;
}

.explore-thumb-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.explore-map-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  opacity: 0.9;
}

.explore-map-title {
  max-width: 88%;
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.36);
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.explore-info {
  padding: 12px 14px 14px;
}

.explore-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.explore-info .card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.city-badge {
  flex-shrink: 0;
  background: rgba(107, 114, 128, 0.1);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
}

.city-badge-on-map {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 34, 15, 0.38);
  color: #fff;
  backdrop-filter: blur(5px);
}

.track-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.explore-contributor {
  color: var(--text-secondary);
  font-size: 0.78rem;
  margin: 0 0 9px;
}

.tag {
  background: rgba(34, 197, 94, 0.1);
  color: var(--primary-dark);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.explore-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 11px 0 0;
  border-top: 1px solid rgba(29, 78, 47, 0.10);
}

.stat-item {
  text-align: center;
  border-right: 1px solid rgba(29, 78, 47, 0.10);
}

.stat-item:last-child {
  border-right: 0;
}

.stat-item-value {
  font-size: 1.14rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.stat-item-unit {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 2px;
  font-weight: 500;
}

.stat-item-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

.stat-elevation-up .stat-item-value {
  color: #177a41;
}

.stat-elevation-down .stat-item-value {
  color: #b65a22;
}

/* Activity Records */
.activity-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.activity-toolbar-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.activity-toolbar-subtitle {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.range-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  flex-shrink: 0;
}

.range-toggle button {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.range-toggle button.active {
  background: var(--primary);
  color: white;
}

.activity-list-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px 10px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.activity-summary-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}

.activity-summary-label {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-align: center;
}

.activity-record-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-card {
  margin-bottom: 0;
}

.activity-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.activity-card-date {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.activity-privacy {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(107, 114, 128, 0.1);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
}

.activity-privacy.is-public {
  background: rgba(34, 197, 94, 0.12);
  color: var(--primary-dark);
}

.activity-primary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.activity-stat-value {
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
}

.activity-stat-label {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  text-align: center;
}

.activity-secondary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.activity-ai-summary {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.14);
  cursor: pointer;
}

.activity-ai-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 700;
}

.activity-ai-summary-text {
  margin-top: 4px;
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.45;
}

.activity-ai-toggle {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 0;
  font-size: 0.7rem;
  cursor: pointer;
}

.activity-ai-entry {
  margin-top: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 9px;
  padding: 5px 9px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.activity-ai-entry:active {
  color: var(--primary-dark);
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.05);
}

.activity-card-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.effort-badge,
.activity-data-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.effort-recovery {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.effort-easy {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.effort-moderate {
  background: rgba(249, 115, 22, 0.14);
  color: #c2410c;
}

.effort-hard {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

.activity-data-chip {
  background: rgba(31, 41, 55, 0.08);
  color: var(--text);
  font-weight: 600;
}

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

.activity-detail-hero {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.activity-detail-hero h2 {
  margin: 4px 0 8px;
  font-size: 1.3rem;
  line-height: 1.3;
}

.activity-detail-hero p {
  margin: 0 0 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.activity-detail-meta {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.activity-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-top-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.activity-top-actions .btn {
  width: 100%;
}

.activity-key-stats .stat-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.activity-metric-panel,
.activity-analysis {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.activity-metric-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 16px;
}

.activity-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.activity-metric-row:nth-last-child(-n + 2) {
  border-bottom: none;
}

.activity-metric-row span {
  color: var(--text-secondary);
}

.activity-metric-row strong {
  color: var(--text);
  font-size: 0.9rem;
  text-align: right;
}

.activity-analysis h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.activity-analysis p {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

.ai-analysis-panel {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-width: 1px 0 0;
}

.ai-analysis-text {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.65;
  white-space: normal;
}

.ai-analysis-text h4 {
  margin: 12px 0 4px;
  font-size: 0.95rem;
  line-height: 1.35;
}

.ai-analysis-text h4:first-child {
  margin-top: 0;
}

.ai-analysis-text strong {
  font-weight: 700;
  color: var(--text);
}

.ai-analysis-loading,
.ai-analysis-error {
  color: var(--text-secondary);
}

.ai-analysis-error {
  color: #dc2626;
}

.ai-analysis-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-analysis-progress-title {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}

.ai-analysis-step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.ai-analysis-step span {
  width: 20px;
  color: var(--primary);
  font-weight: 700;
  text-align: center;
}

.ai-analysis-step strong {
  font-weight: 500;
}

.ai-analysis-step.active {
  color: var(--text);
}

/* Upload */
.upload-intro {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.upload-intro h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.upload-intro p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.upload-guide {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}

.upload-guide-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.upload-guide-summary::-webkit-details-marker {
  display: none;
}

.upload-guide-summary span {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.upload-guide-summary small {
  flex-shrink: 0;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.upload-guide-summary small::after {
  content: "⌄";
  margin-left: 5px;
}

.upload-guide[open] .upload-guide-summary {
  border-bottom: 1px solid var(--border);
}

.upload-guide[open] .upload-guide-summary small::after {
  content: "⌃";
}

.upload-guide-content {
  padding: 14px 16px 16px;
}

.upload-guide-head h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.upload-guide-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
}

.upload-guide-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.upload-guide-step {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.upload-guide-step > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.upload-guide-step strong {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.35;
}

.upload-guide-step p {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

.upload-guide-video {
  margin-top: 15px;
  overflow: hidden;
  border-radius: 10px;
  background: #111827;
}

.upload-guide-video video {
  display: block;
  width: 100%;
  max-height: 420px;
  background: #111827;
}

.upload-suggestion-status {
  min-height: 18px;
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.4;
}

.upload-suggestion-status.is-loading {
  color: var(--primary-dark);
}

.upload-suggestion-status.is-error {
  color: #dc2626;
}

.upload-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  cursor: pointer;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.check-row strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
}

.check-row small {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.4;
}

@media (max-width: 380px) {
  .activity-list-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .activity-metric-panel {
    grid-template-columns: 1fr;
  }

  .activity-metric-row:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .activity-metric-row:last-child {
    border-bottom: none;
  }
}

/* Track Endpoints */
.track-endpoints {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.endpoint-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.endpoint-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.endpoint-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.endpoint-start {
  background: #22c55e;
}

.endpoint-end {
  background: #ef4444;
}

.endpoint-info {
  flex: 1;
  min-width: 0;
}

.endpoint-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.endpoint-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-nav {
  flex-shrink: 0;
  background: var(--primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 10px;
}

/* Navigation Menu */
.nav-menu-item {
  transition: background 0.15s ease;
}

.nav-menu-item:active {
  background: #f3f4f6;
}

.nav-menu-item:last-of-type {
  border-bottom: none !important;
}

/* Admin Backend */
.admin-entry-card {
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.admin-entry-card:active {
  transform: scale(0.98);
}

.admin-entry-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-entry-arrow {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.admin-stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.admin-stat-value {
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--primary);
}

.admin-stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}

.admin-toolbar .btn {
  width: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.admin-search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.admin-search-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
}

.admin-search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.admin-track-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.admin-track-main {
  flex: 1;
  min-width: 0;
}

.admin-track-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-track-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.admin-track-contributor {
  color: var(--primary);
}

.admin-track-status {
  flex-shrink: 0;
}

.admin-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

.admin-status.public {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.admin-status.private {
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
}

.admin-track-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.admin-loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-secondary);
}

.admin-load-more {
  text-align: center;
  margin-top: 16px;
}

.admin-ai-settings-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.admin-ai-settings-card textarea {
  width: 100%;
  min-height: 360px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  font-family: inherit;
  color: var(--text);
  background: var(--card-bg);
}

.admin-ai-settings-card textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* Admin Modal */
.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.admin-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
}

.admin-modal-content {
  position: relative;
  background: white;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUpModal 0.2s ease;
  margin-bottom: env(safe-area-inset-bottom, 0px);
}

@keyframes slideUpModal {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.admin-modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.admin-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.admin-modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.admin-modal-footer .btn {
  flex: 1;
}

/* Admin Tag Management */
.admin-tag-intro {
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

.admin-tag-form {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-tag-form .admin-tag-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
}

.admin-tag-form .admin-tag-input:focus {
  outline: none;
  border-color: var(--primary);
}

.admin-tag-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-tag-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.admin-tag-fields {
  flex: 1;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.admin-tag-name-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
}

.admin-tag-order-input {
  width: 70px;
  flex-shrink: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
  text-align: center;
}

.admin-tag-name-input:focus,
.admin-tag-order-input:focus {
  outline: none;
  border-color: var(--primary);
}

.admin-tag-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.admin-tag-actions .btn-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Admin Batch Upload & Edit */
.admin-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.admin-file-name {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
}

.admin-batch-global {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.admin-batch-global h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.admin-batch-global-fields {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-batch-global-fields .form-group {
  margin: 0;
}

.admin-batch-global-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-batch-global .btn {
  width: auto;
}

.admin-batch-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-batch-item {
  display: flex;
  gap: 12px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.admin-batch-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
}

.admin-batch-thumb canvas {
  width: 100%;
  height: 100%;
}

.admin-batch-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-batch-input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
}

.admin-batch-input:focus {
  outline: none;
  border-color: var(--primary);
}

.admin-batch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-batch-row .admin-batch-input {
  flex: 1;
  min-width: 80px;
}

.admin-batch-row .check-row {
  font-size: 0.75rem;
  margin: 0;
  white-space: nowrap;
}

.admin-batch-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.admin-batch-actions {
  position: sticky;
  bottom: 12px;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  margin-top: 8px;
}

.admin-batch-actions .btn {
  width: 100%;
}

/* ===================== Share Landing Page (/r/{id}) ===================== */

.share-landing {
  padding-bottom: 0;
}

.share-landing .bottom-nav {
  display: none;
}

.share-landing .page {
  padding-bottom: 24px;
}

/* Header */
.share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.share-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.share-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.share-header-open-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
}

.share-header-open-btn:active {
  background: var(--primary-dark);
}

/* App Open Banner */
.share-app-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  margin: 16px 0 20px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.08);
}

.share-app-banner-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.share-app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.share-app-info {
  flex: 1;
  min-width: 0;
}

.share-app-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.3;
}

.share-app-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.share-app-open-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-appearance: none;
}

.share-app-open-btn:active {
  background: var(--primary-dark);
}

/* WeChat Hint */
.share-wechat-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fffbeb;
  border-top: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 10px 16px;
}

.share-hint-icon {
  flex-shrink: 0;
  font-size: 1rem;
}

.share-wechat-hint strong {
  font-weight: 600;
}

.share-app-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(15, 23, 42, 0.48);
}

.share-app-modal-sheet {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 24px 20px 18px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
  text-align: center;
}

.share-app-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--text-secondary);
  font-size: 1.25rem;
  line-height: 1;
}

.share-app-modal-sheet .share-app-icon {
  margin: 0 auto 12px;
}

.share-app-modal-sheet h3 {
  margin: 0 28px 8px;
  color: var(--text);
  font-size: 1.12rem;
}

.share-app-modal-sheet p {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

.share-app-modal-sheet .btn {
  width: 100%;
}

.share-app-store-link {
  display: block;
  margin-top: 12px;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.share-app-modal-sheet .share-wechat-hint {
  margin: 16px -20px -18px;
  text-align: left;
}
