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

:root {
  --brand: #6c63ff;
  --brand-dark: #5a52d5;
  --brand-light: #ede9ff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow: 0 4px 16px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.14);
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* === Layout === */
#app { min-height: 100vh; }

.page { min-height: 100vh; }
.container { max-width: 480px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* === Navbar === */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.5px;
}
.navbar-actions { display: flex; gap: 8px; align-items: center; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand);
  color: var(--white);
}
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* === Forms === */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(108,99,255,.12);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 0.78rem; color: var(--gray-400); margin-top: 4px; }
.form-error { font-size: 0.82rem; color: var(--danger); margin-top: 4px; }

/* === Cards === */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.card-body { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  font-weight: 600;
  font-size: 0.95rem;
}

/* === Auth Pages === */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0edff 0%, #faf9ff 50%, #edf5ff 100%);
  padding: 24px;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-text {
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -1px;
}
.auth-logo-sub { font-size: 0.85rem; color: var(--gray-500); margin-top: 4px; }
.auth-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; text-align: center; }
.auth-divider { text-align: center; font-size: 0.82rem; color: var(--gray-400); margin: 16px 0; }
.auth-link { color: var(--brand); font-weight: 500; }
.auth-link:hover { text-decoration: underline; }

/* === Landing Page === */
.hero {
  padding: 80px 24px;
  text-align: center;
  background: linear-gradient(160deg, #f0edff 0%, #ffffff 60%);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--gray-900);
  line-height: 1.15;
  margin-bottom: 20px;
}
.hero h1 span { color: var(--brand); }
.hero p { font-size: 1.1rem; color: var(--gray-500); max-width: 480px; margin: 0 auto 36px; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.features { padding: 64px 24px; }
.features h2 { text-align: center; font-size: 1.8rem; font-weight: 700; margin-bottom: 48px; letter-spacing: -0.5px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; max-width: 960px; margin: 0 auto; }
.feature-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  border: 1px solid var(--gray-200);
  transition: all var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card h3 { font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 0.875rem; color: var(--gray-500); }

/* === Dashboard === */
.dashboard-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 60px);
}
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  padding: 20px 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.sidebar-nav { padding: 0 12px; }
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}
.sidebar-nav-item:hover { background: var(--gray-50); color: var(--gray-800); }
.sidebar-nav-item.active { background: var(--brand-light); color: var(--brand); }
.sidebar-nav-item .icon { width: 18px; text-align: center; }
.sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  padding: 16px 24px 6px;
}

.main-content { padding: 28px; background: var(--gray-50); }
.page-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; letter-spacing: -0.3px; }

/* === Profile Preview Panel === */
.preview-panel {
  width: 320px;
  flex-shrink: 0;
}
.phone-frame {
  width: 280px;
  height: 560px;
  background: var(--white);
  border-radius: 32px;
  border: 2px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin: 0 auto;
  position: relative;
}
.phone-inner { height: 100%; overflow-y: auto; }
.phone-inner::-webkit-scrollbar { width: 4px; }
.phone-inner::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }

/* === Link Editor === */
.links-editor { display: flex; gap: 24px; }
.links-list-panel { flex: 1; }
.link-item {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition);
  cursor: grab;
}
.link-item:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.link-item.dragging { opacity: 0.5; }
.link-item.drag-over { border-color: var(--brand); background: var(--brand-light); }
.link-drag-handle { color: var(--gray-300); cursor: grab; font-size: 1.1rem; }
.link-info { flex: 1; min-width: 0; }
.link-title { font-weight: 500; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-url { font-size: 0.78rem; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-actions { display: flex; gap: 6px; align-items: center; }
.link-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 500;
}
.badge-link { background: #ede9ff; color: var(--brand); }
.badge-sns { background: #fce7f3; color: #db2777; }
.badge-embed { background: #dcfce7; color: #16a34a; }
.badge-video { background: #fef3c7; color: #d97706; }
.badge-banner { background: #dbeafe; color: #2563eb; }

.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: 99px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--brand); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }

/* === Add Link Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; background: var(--gray-100); border: none; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--gray-200); }

.link-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.link-type-btn {
  padding: 14px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  background: var(--white);
  transition: all var(--transition);
}
.link-type-btn:hover, .link-type-btn.selected { border-color: var(--brand); background: var(--brand-light); }
.link-type-btn .type-icon { font-size: 1.4rem; margin-bottom: 4px; }
.link-type-btn .type-label { font-size: 0.75rem; font-weight: 500; color: var(--gray-600); }

/* === Public Profile Page === */
.profile-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.profile-header-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: linear-gradient(135deg, #6c63ff, #a78bfa);
}
.profile-header-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #6c63ff, #a78bfa);
}
.profile-body {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px 40px;
  width: 100%;
}
.profile-avatar-wrap {
  margin-top: -40px;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--white);
  object-fit: cover;
  background: var(--gray-200);
  box-shadow: var(--shadow);
}
.profile-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--white);
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  box-shadow: var(--shadow);
}
.profile-name { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.3px; }
.profile-username { font-size: 0.85rem; color: var(--gray-400); margin-bottom: 10px; }
.profile-bio { font-size: 0.9rem; color: var(--gray-600); white-space: pre-line; margin-bottom: 16px; }
.profile-sns-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.sns-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  text-decoration: none;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
}
.sns-icon-btn:hover { transform: scale(1.12); border-color: var(--brand); color: var(--brand); }

/* === Profile Link Buttons === */
.profile-links { display: flex; flex-direction: column; gap: 10px; }

.profile-link-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.18s ease;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.profile-link-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.profile-link-btn .link-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.profile-link-btn .link-arrow { margin-left: auto; opacity: 0.5; font-size: 0.8rem; }

/* Highlighted / animated button */
.profile-link-btn.highlighted {
  animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108,99,255,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(108,99,255,0); }
}
.profile-link-btn.highlighted::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Banner link */
.profile-banner-link {
  border-radius: 14px;
  overflow: hidden;
  display: block;
  position: relative;
  transition: all var(--transition);
}
.profile-banner-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.profile-banner-link img { width: 100%; aspect-ratio: 3/1; object-fit: cover; }
.profile-banner-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  padding: 20px 16px 14px;
  color: white;
  font-weight: 600;
}

/* Embed wrapper */
.profile-embed {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gray-900);
  width: 100%;
}
.profile-embed iframe { width: 100%; border: none; display: block; }
.profile-video { width: 100%; border-radius: var(--radius-lg); overflow: hidden; background: #000; }
.profile-video video { width: 100%; display: block; max-height: 400px; }

/* === Analytics === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--gray-200);
}
.stat-label { font-size: 0.78rem; color: var(--gray-500); font-weight: 500; margin-bottom: 6px; }
.stat-value { font-size: 1.8rem; font-weight: 700; letter-spacing: -1px; }
.stat-sub { font-size: 0.75rem; color: var(--gray-400); margin-top: 4px; }

.chart-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--gray-200);
  margin-bottom: 20px;
}
.chart-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 16px; }

.period-tabs { display: flex; gap: 4px; background: var(--gray-100); border-radius: var(--radius); padding: 4px; margin-bottom: 20px; width: fit-content; }
.period-tab {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--transition);
}
.period-tab.active { background: var(--white); color: var(--gray-800); box-shadow: var(--shadow-sm); }

.analytics-link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.analytics-link-row:last-child { border-bottom: none; }
.analytics-link-rank { width: 24px; font-size: 0.82rem; font-weight: 700; color: var(--gray-400); }
.analytics-link-info { flex: 1; min-width: 0; }
.analytics-link-title { font-size: 0.88rem; font-weight: 500; }
.analytics-link-url { font-size: 0.75rem; color: var(--gray-400); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-bar-wrap { width: 80px; height: 6px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.analytics-bar { height: 100%; background: var(--brand); border-radius: 99px; }
.analytics-link-count { font-size: 0.82rem; font-weight: 600; width: 40px; text-align: right; }
.analytics-link-ctr { font-size: 0.75rem; color: var(--gray-400); width: 44px; text-align: right; }

/* === Themes === */
[data-theme="dark"] {
  --profile-bg: #0f0f0f;
  --profile-text: #f0f0f0;
  --profile-sub: #888;
  --profile-btn-bg: #1e1e1e;
  --profile-btn-border: #333;
  --profile-btn-text: #f0f0f0;
}
[data-theme="pastel"] {
  --profile-bg: #fdf6ff;
  --profile-text: #4a3d6e;
  --profile-sub: #9c86c0;
  --profile-btn-bg: #ede4ff;
  --profile-btn-border: #d8c8f8;
  --profile-btn-text: #4a3d6e;
}
[data-theme="retro"] {
  --profile-bg: #f5f0e8;
  --profile-text: #3d2b1f;
  --profile-sub: #8b6a50;
  --profile-btn-bg: #e8dcc8;
  --profile-btn-border: #c8a87a;
  --profile-btn-text: #3d2b1f;
}
[data-theme="minimal"] {
  --profile-bg: #ffffff;
  --profile-text: #111;
  --profile-sub: #666;
  --profile-btn-bg: #ffffff;
  --profile-btn-border: #e0e0e0;
  --profile-btn-text: #111;
}

.profile-page-themed {
  background: var(--profile-bg, var(--white));
  color: var(--profile-text, var(--gray-800));
  min-height: 100vh;
}
.profile-page-themed .profile-username { color: var(--profile-sub, var(--gray-400)); }
.profile-page-themed .profile-bio { color: var(--profile-sub, var(--gray-600)); }
.profile-page-themed .profile-link-btn {
  background: var(--profile-btn-bg, var(--gray-100));
  color: var(--profile-btn-text, var(--gray-800));
  border: 1.5px solid var(--profile-btn-border, var(--gray-200));
}

/* === Color Pickers === */
.color-row { display: flex; gap: 8px; align-items: center; }
.color-swatch { width: 36px; height: 36px; border-radius: var(--radius); border: 2px solid var(--gray-200); cursor: pointer; }

/* === Notifications === */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--gray-900);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slide-in 0.2s ease;
  max-width: 320px;
}
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
@keyframes slide-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === Misc === */
.divider { border: none; border-top: 1px solid var(--gray-100); margin: 16px 0; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: 500;
  background: var(--gray-100); color: var(--gray-600);
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 48px 20px; color: var(--gray-400); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

.chip {
  display: inline-flex; gap: 6px; align-items: center;
  padding: 4px 12px; border-radius: 99px; font-size: 0.78rem;
  background: var(--brand-light); color: var(--brand); font-weight: 500;
}

.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--gray-50);
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--brand);
  background: var(--brand-light);
}
.upload-area p { font-size: 0.85rem; color: var(--gray-500); margin-top: 8px; }

/* === Responsive === */
@media (max-width: 768px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .sidebar.mobile-open {
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    z-index: 200;
    box-shadow: var(--shadow-lg);
  }
  .main-content { padding: 16px; }
  .links-editor { flex-direction: column; }
  .preview-panel { display: none; }
  .auth-card { padding: 28px 20px; }
}

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

/* === Simple Chart (canvas-free fallback) === */
.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 80px; }
.bar-chart-bar {
  flex: 1;
  min-width: 4px;
  background: var(--brand);
  border-radius: 3px 3px 0 0;
  opacity: 0.8;
  transition: opacity var(--transition);
}
.bar-chart-bar:hover { opacity: 1; }

/* scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

/* password entry */
.site-password-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0edff 0%, #faf9ff 50%, #edf5ff 100%);
}
.site-password-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.site-password-lock { font-size: 3rem; margin-bottom: 16px; }
.site-password-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.site-password-sub { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 28px; }
