/* =============================================
   ZERGOM — Main Stylesheet
   Mobile-first, iPad-like home screen
   ============================================= */

:root {
  --icon-size: 72px;
  --icon-radius: 16px;
  --icon-gap: 24px;
  --dock-height: 80px;
  --dock-blur: 20px;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --glass: rgba(255,255,255,0.12);
  --glass-border: rgba(255,255,255,0.18);
  --text: #ffffff;
  --text-dim: rgba(255,255,255,0.6);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  overflow: hidden;
}

/* ---- Background ---- */
.home-body {
  background: #0a0a1a url('/assets/images/default-bg.jpg') center/cover no-repeat;
  position: relative;
}
.wallpaper-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.5) 100%);
  z-index: 0;
  pointer-events: none;
}

/* ---- Clock ---- */
.clock-widget {
  position: fixed;
  top: max(20px, env(safe-area-inset-top, 20px));
  left: 0; right: 0;
  text-align: center;
  z-index: 10;
  pointer-events: none;
}
.clock-time {
  font-size: clamp(48px, 10vw, 80px);
  font-weight: 200;
  letter-spacing: -2px;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.clock-date {
  font-size: clamp(14px, 3vw, 18px);
  font-weight: 300;
  opacity: 0.8;
  margin-top: 4px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

/* ---- Grid ---- */
.grid-container {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 5;
  padding: clamp(120px, 22vh, 180px) 16px calc(var(--dock-height) + 24px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.grid-container::-webkit-scrollbar { display: none; }

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--icon-size), 1fr));
  gap: var(--icon-gap);
  max-width: 900px;
  margin: 0 auto;
  align-items: start;
}

/* ---- Icon Item ---- */
.icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
}

.icon-wrapper {
  position: relative;
  width: var(--icon-size);
  height: var(--icon-size);
}

.icon-link {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--icon-radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-drag: none;
  border-radius: var(--icon-radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  display: block;
}
.icon-link:active .icon-img,
.icon-link:hover .icon-img {
  transform: scale(0.95);
}

.icon-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--text);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  text-align: center;
  max-width: calc(var(--icon-size) + 12px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

/* ---- Delete button (shown in jiggle mode) ---- */
.delete-btn {
  display: none;
  position: absolute;
  top: -6px;
  left: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-size: 14px;
  font-weight: bold;
  border: 2px solid white;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  padding: 0;
}
.delete-btn:hover { background: #c0392b; }

/* ---- Edit button (shown in jiggle mode) ---- */
.edit-btn {
  display: none;
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #3498db;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  padding: 0;
}
.edit-btn:hover { background: #2980b9; }

/* ---- Initials icon ---- */
.initials-icon {
  width: 100%;
  height: 100%;
  border-radius: 22%;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -1px;
  -webkit-user-select: none;
  user-select: none;
}

/* ---- Icon upload row in modal ---- */
.icon-upload-row {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.icon-upload-label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.icon-upload-input {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
}

/* ---- Jiggle mode ---- */
@keyframes jiggle {
  0%   { transform: rotate(-1.5deg) scale(1.02); }
  25%  { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(1.5deg) scale(1.02); }
  75%  { transform: rotate(0deg) scale(1); }
  100% { transform: rotate(-1.5deg) scale(1.02); }
}

body.jiggle-mode .icon-item {
  animation: jiggle 0.5s ease-in-out infinite;
}
body.jiggle-mode .delete-btn {
  display: flex;
  animation: none;
}
body.jiggle-mode .edit-btn {
  display: flex;
  animation: none;
}
body.jiggle-mode .icon-link {
  pointer-events: none;
}

/* ---- Folder ---- */
.folder-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  border-radius: var(--icon-radius);
  background: rgba(100,120,180,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 8px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  transition: transform var(--transition);
}
.folder-icon img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  object-fit: cover;
}
.folder-icon:hover { transform: scale(0.97); }

/* Drag-over target for folders */
.folder-icon.drag-over {
  background: rgba(59,130,246,0.6);
  box-shadow: 0 0 0 3px var(--accent);
}

/* ---- Drag ---- */
.icon-item.dragging {
  opacity: 0.4;
  transform: scale(1.1);
}
.icon-item.drag-over-item {
  transform: scale(1.08);
}
.icon-item.drag-placeholder {
  opacity: 0.3;
}

/* ---- Dock ---- */
.dock {
  position: fixed;
  bottom: env(safe-area-inset-bottom, 0);
  left: 0; right: 0;
  z-index: 500;
  padding: 8px 16px;
}
.dock-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--glass);
  backdrop-filter: blur(var(--dock-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--dock-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 8px 12px;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}
.dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 14px;
  transition: background var(--transition), transform var(--transition);
  min-width: 56px;
}
.dock-btn svg { width: 32px; height: 32px; }
.dock-btn span { font-size: 11px; opacity: 0.75; white-space: nowrap; }
.dock-btn:hover, .dock-btn:active {
  background: rgba(255,255,255,0.15);
  transform: scale(1.08);
}
.dock-btn.active { background: rgba(255,255,255,0.2); }

/* ---- Dropdown menu ---- */
.dropdown-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  background: rgba(20,20,30,0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 8px;
  min-width: 260px;
  max-width: 320px;
  width: 90vw;
  z-index: 510;
  box-shadow: var(--shadow);
  display: none;
  opacity: 0;
  transition: opacity .15s, transform .15s;
}
.dropdown-menu.open {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.dropdown-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 8px;
}
.dropdown-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.dropdown-name { font-size: 14px; font-weight: 500; }
.dropdown-tier { font-size: 11px; opacity: 0.6; display: flex; align-items: center; gap: 4px; }

.trial-badge {
  background: var(--accent);
  color: white;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
}
.trial-countdown { font-size: 10px; opacity: 0.5; margin-top: 2px; }

.dropdown-divider { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 4px 0; }

.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition);
}
.dropdown-item:hover { background: rgba(255,255,255,0.1); }
.dropdown-admin { color: #fbbf24; }
.dropdown-logout { color: var(--danger); }

/* ---- Language selector ---- */
.lang-selector { position: relative; padding: 6px 8px; }

.lang-current {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  transition: background var(--transition);
}
.lang-current:hover { background: rgba(255,255,255,0.14); }
.lang-chevron { margin-left: auto; opacity: .5; transition: transform .2s; }
.lang-selector.open .lang-chevron { transform: rotate(180deg); }

.lang-list {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}
.lang-selector.open .lang-list { display: flex; }

.lang-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}
.lang-btn.active { color: var(--text); font-weight: 600; background: rgba(255,255,255,0.08); }
.lang-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }

/* ---- Modals ---- */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 300;
}
.modal-backdrop.open { display: block; }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.open { display: flex; }

.modal-card {
  background: rgba(18,18,30,0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  position: relative;
  animation: modal-in 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modal-in {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}
.modal-card input[type="text"],
.modal-card input[type="url"],
.modal-card input[type="email"],
.modal-card input[type="password"] {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  padding: 12px 14px;
  margin-bottom: 10px;
  outline: none;
  transition: border-color var(--transition);
}
.modal-card input:focus { border-color: var(--accent); }
.modal-card input::placeholder { color: var(--text-dim); }

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--text);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(255,255,255,0.2); }

/* ---- Wallpaper modal ---- */
.wallpaper-card {
  width: min(92vw, 600px);
  max-height: 80vh;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
}
.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  overflow-y: auto;
  -webkit-flex: 1;
  flex: 1;
  padding: 4px 2px;
  margin: 12px 0;
}
.wallpaper-item {
  aspect-ratio: 16/9;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
}
.wallpaper-item:hover {
  border-color: rgba(255,255,255,0.6);
  -webkit-transform: scale(1.03);
  transform: scale(1.03);
}
.wallpaper-upload-section {
  display: -webkit-flex;
  display: flex;
  gap: 10px;
  -webkit-align-items: center;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-wrap: wrap;
}
.wallpaper-upload-btn {
  display: -webkit-inline-flex;
  display: inline-flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.wallpaper-upload-btn:hover { background: rgba(255,255,255,0.18); }
.wallpaper-remove-btn {
  background: transparent;
  border: 1px solid rgba(255,100,100,0.4);
  color: rgba(255,120,120,0.9);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.wallpaper-remove-btn:hover { background: rgba(255,80,80,0.12); }

/* ---- Profile modal ---- */
.profile-card {
  width: min(92vw, 480px);
  max-height: 85vh;
  overflow-y: auto;
}
.profile-avatar-row {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.profile-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.profile-avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #3498db;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: 50%;
}
.profile-avatar-wrap:hover .profile-avatar-overlay { opacity: 1; }
.profile-email {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 4px;
  word-break: break-all;
}
.profile-tier-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
}
.profile-tier-premium { background: rgba(255,200,50,0.2); color: #f9c74f; }
.profile-tier-pro     { background: rgba(52,152,219,0.2); color: #74b9ff; }
.profile-tier-trial   { background: rgba(155,89,182,0.2); color: #d6a4f0; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.profile-stat {
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 4px;
}
.profile-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.profile-stat-lbl {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
}
.profile-section {
  margin-bottom: 16px;
}
.profile-section--sep {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
}
.profile-field-label {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}
.profile-save-btn { margin-top: 8px; }
.profile-pw-form {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 8px;
}
.profile-msg {
  font-size: 12px;
  margin-top: 6px;
  min-height: 16px;
}
.profile-msg--ok  { color: #2ecc71; }
.profile-msg--err { color: #e74c3c; }

.save-limit-info {
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 12px;
}

/* =============================================
   RADIO PAGE — Tesla-style
   ============================================= */
.radio-page {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 600;
  background: #111118;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-transform: translateX(100%);
  transform: translateX(100%);
  -webkit-transition: -webkit-transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
.radio-page.open {
  -webkit-transform: translateX(0);
  transform: translateX(0);
}

/* Header */
.radio-page-header {
  display: flex;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top, 16px)) 20px 14px;
  gap: 16px;
  background: #1a1a24;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.radio-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 6px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: opacity var(--transition);
}
.radio-back-btn:hover { opacity: 0.7; }
.radio-page-title {
  font-size: 22px;
  font-weight: 700;
  flex: 1;
  text-align: center;
  letter-spacing: -0.3px;
}
.radio-page-spacer { flex-shrink: 0; width: 80px; }

/* Radio country selector */
.radio-country-selector { position: relative; flex-shrink: 0; }
.radio-country-btn {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.08);
  border: none; color: white;
  padding: 6px 10px; border-radius: 20px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.radio-country-btn:hover { background: rgba(255,255,255,0.15); }
.radio-country-list {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 6px;
  z-index: 700;
  min-width: 130px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.radio-country-selector.open .radio-country-list { display: flex; flex-direction: column; gap: 2px; }
.radio-country-item {
  background: none; border: none; color: rgba(255,255,255,0.8);
  padding: 8px 12px; border-radius: 8px;
  font-size: 14px; text-align: left; cursor: pointer;
  transition: background var(--transition);
}
.radio-country-item:hover { background: rgba(255,255,255,0.08); color: white; }
.radio-country-item.active { background: rgba(59,130,246,0.2); color: var(--accent); font-weight: 600; }

/* Search */
.radio-page-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 20px 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 11px 16px;
  flex-shrink: 0;
}
.radio-page-search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 16px;
  outline: none;
}
.radio-page-search input::placeholder { color: rgba(255,255,255,0.35); }
.radio-page-search svg { color: rgba(255,255,255,0.4); flex-shrink: 0; }

/* Accordion sections */
.radio-accordion-section {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.radio-accordion-section--all {
  flex: 1;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  min-height: 0;
  border-bottom: none;
  overflow: hidden;
}

.radio-accordion-header {
  width: 100%;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  padding: 12px 20px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  cursor: pointer;
  -webkit-transition: color var(--transition), background var(--transition);
  transition: color var(--transition), background var(--transition);
  -webkit-user-select: none;
  user-select: none;
  flex-shrink: 0;
}
.radio-accordion-header:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.03); }

.accordion-arrow {
  flex-shrink: 0;
  -webkit-transition: -webkit-transform 0.25s ease;
  transition: transform 0.25s ease;
}
.radio-accordion-header.collapsed .accordion-arrow {
  -webkit-transform: rotate(180deg);
  transform: rotate(180deg);
}

/* Favorites accordion body — animates height */
.radio-accordion-body {
  overflow: hidden;
  max-height: 500px;
  opacity: 1;
  -webkit-transition: max-height 0.3s ease, opacity 0.25s ease;
  transition: max-height 0.3s ease, opacity 0.25s ease;
}
.radio-accordion-body.collapsed {
  max-height: 0 !important;
  opacity: 0;
}

/* All stations body — fills remaining space, no max-height animation */
.radio-accordion-body--all {
  -webkit-flex: 1;
  flex: 1;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  max-height: none;
  -webkit-transition: opacity 0.2s ease;
  transition: opacity 0.2s ease;
}
.radio-accordion-body--all.collapsed {
  display: none;
}

/* Favorites row — wraps to next line on desktop/Tesla, scrolls on mobile */
.radio-favorites-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px 20px 8px;
}

@media (max-width: 480px) {
  .radio-favorites-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .radio-favorites-row::-webkit-scrollbar { display: none; }
}

.radio-fav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.radio-fav-cover {
  position: relative;
  width: 100px;
  height: 100px;
}
.radio-fav-cover img {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}
.radio-fav-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.radio-fav-item:hover .radio-fav-overlay { opacity: 1; }
.radio-fav-item.playing .radio-fav-overlay { opacity: 1; background: rgba(59,130,246,0.55); }
.radio-fav-item.playing .radio-fav-cover img {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.radio-fav-remove { display: none; }
.radio-fav-item:hover .radio-fav-remove { display: none; }
.radio-fav-name {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255,255,255,0.7);
}

/* Station grid — Tesla style: 3 columns, logo + name side by side */
.radio-list {
  -webkit-flex: 1;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 16px 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 104px;
  gap: 10px;
  align-content: start;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.radio-list::-webkit-scrollbar { width: 4px; }
.radio-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

/* Station card */
.radio-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1e1e2a;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform 0.15s;
  overflow: hidden;
  flex-shrink: 0; /* don't let flex squeeze the card */
  height: 104px;   /* match grid-auto-rows */
}
.radio-item:hover { background: #252535; border-color: rgba(255,255,255,0.14); transform: scale(1.02); }
.radio-item:active { transform: scale(0.98); }
.radio-item.playing {
  background: rgba(59,130,246,0.12);
  border-color: rgba(59,130,246,0.4);
}

/* Logo */
.radio-item-logo {
  position: relative;
  width: 76px;
  height: 64px;
  flex-shrink: 0;
}
.radio-item-logo img {
  width: 76px;
  height: 76px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}
/* Hover play overlay on logo */
.radio-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.radio-item:hover .radio-item-overlay { opacity: 1; }
.radio-item.playing .radio-item-overlay { opacity: 1; background: rgba(59,130,246,0.5); }

.radio-item-info {
  flex: 1;
  min-width: 0;
}
.radio-item-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.radio-item-country {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
}

.radio-loading {
  grid-column: 1/-1;
  padding: 60px 20px;
  text-align: center;
  color: rgba(255,255,255,0.4);
  font-size: 15px;
}

/* EQ bars animation */
.radio-eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}
.radio-eq span {
  display: block;
  width: 4px;
  background: white;
  border-radius: 2px;
  animation: eq-bounce 0.7s ease-in-out infinite alternate;
}
.radio-eq span:nth-child(1) { height: 7px;  animation-delay: 0s; }
.radio-eq span:nth-child(2) { height: 16px; animation-delay: 0.12s; }
.radio-eq span:nth-child(3) { height: 11px; animation-delay: 0.25s; }
.radio-eq span:nth-child(4) { height: 18px; animation-delay: 0.38s; }
@keyframes eq-bounce {
  from { transform: scaleY(0.25); }
  to   { transform: scaleY(1); }
}

/* Tesla-style sticky player at bottom of radio page */
.radio-now-playing-bar {
  display: flex;
  align-items: center;
  background: #222230;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 0 20px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  flex-shrink: 0;
  min-height: 90px;
  gap: 0;
}

/* Left: transport controls */
.radio-np-transport {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  flex-shrink: 0;
}

/* Center: logo + info */
.radio-np-center {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 16px;
}
#radio-np-logo {
  width: 90px;
  height: 90px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.radio-np-info {
  min-width: 0;
}
.radio-np-eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  margin-bottom: 6px;
}
.radio-np-eq span {
  display: block;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
  animation: eq-bounce 0.7s ease-in-out infinite alternate;
}
.radio-np-eq span:nth-child(1) { height: 6px;  animation-delay: 0s; }
.radio-np-eq span:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.radio-np-eq span:nth-child(3) { height: 9px;  animation-delay: 0.3s; }
.radio-np-eq span:nth-child(4) { height: 16px; animation-delay: 0.45s; }
#radio-np-name {
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.3px;
}
#radio-np-country {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
}

/* Right: favorite button */
.radio-np-right {
  flex-shrink: 0;
  padding-left: 16px;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 8px;
}
.radio-np-mute {
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.7);
  width: 64px; height: 64px;
  border-radius: 50%;
  cursor: pointer;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.radio-np-mute:hover { background: rgba(255,255,255,0.18); color: white; }

.radio-mini-info { cursor: pointer; }

.radio-np-fav,
.radio-np-prev,
.radio-np-next {
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.7);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.radio-np-prev { margin-right: 2px; }
.radio-np-next { margin-left: 2px; }
.radio-np-fav:hover,
.radio-np-prev:hover,
.radio-np-next:hover { background: rgba(255,255,255,0.18); color: white; }
.radio-np-fav.liked { color: #ef4444; }
.radio-np-fav.liked svg { fill: #ef4444; stroke: #ef4444; }

.radio-np-stop {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.radio-np-stop:hover { background: rgba(255,255,255,0.2); }

/* Report not working button */
.radio-np-report {
  position: relative;
  background: rgba(255,255,255,0.06);
  border: none;
  color: rgba(255,255,255,0.45);
  width: 52px; height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.radio-np-report:hover { background: rgba(251,191,36,0.15); color: #fbbf24; }
.radio-np-report.reported { color: #fbbf24; background: rgba(251,191,36,0.15); }
#radio-np-report-count {
  position: absolute;
  top: 4px; right: 4px;
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 4px;
  min-width: 14px;
  text-align: center;
  line-height: 12px;
  display: none;
}
#radio-np-report-count:not(:empty) { display: block; }

/* Mini radio player (floating above dock on home) */
.radio-mini-player {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--dock-height) + 10px + env(safe-area-inset-bottom, 0px));
  background: rgba(26,26,36,0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 18px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 50;
  -webkit-animation: mini-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
  animation: mini-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@-webkit-keyframes mini-in {
  from { -webkit-transform: translateY(20px); opacity: 0; }
  to   { -webkit-transform: translateY(0);    opacity: 1; }
}
@keyframes mini-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Transport buttons */
.radio-mini-transport {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.radio-mini-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.85);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-transition: background var(--transition);
  transition: background var(--transition);
  flex-shrink: 0;
}
.radio-mini-btn svg { width: 36px; height: 36px; }
.radio-mini-btn:hover { background: rgba(255,255,255,0.18); color: white; }
.radio-mini-btn--pause { background: rgba(255,255,255,0.14); }

#mini-radio-logo { width: 68px; height: 68px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.radio-mini-info { flex: 1; min-width: 0; }
#mini-radio-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-mini-eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  margin-top: 4px;
}
.radio-mini-eq span {
  display: block;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  -webkit-animation: eq-bounce 0.7s ease-in-out infinite alternate;
  animation: eq-bounce 0.7s ease-in-out infinite alternate;
}
.radio-mini-eq span:nth-child(1) { height: 5px;  -webkit-animation-delay: 0s;   animation-delay: 0s; }
.radio-mini-eq span:nth-child(2) { height: 10px; -webkit-animation-delay: 0.2s; animation-delay: 0.2s; }
.radio-mini-eq span:nth-child(3) { height: 7px;  animation-delay: 0.4s; }
.radio-mini-open {
  background: rgba(59,130,246,0.2);
  border: none; color: var(--accent);
  width: 60px; height: 60px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  -webkit-transition: background var(--transition);
  transition: background var(--transition);
}
.radio-mini-open svg { width: 30px; height: 30px; }
.radio-mini-open:hover { background: rgba(59,130,246,0.35); }
.radio-mini-close {
  background: rgba(255,255,255,0.07);
  border: none;
  color: rgba(255,255,255,0.5);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.radio-mini-close svg { width: 28px; height: 28px; }
.radio-mini-close:hover { background: rgba(231,76,60,0.25); color: #e74c3c; }

/* Responsive grid: 2 cols on small screens, 3 on medium, 4 on large */
@media (max-width: 480px) {
  .radio-list { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 70px; gap: 8px; padding: 8px 12px; }
  .radio-item { height: 70px; padding: 9px; gap: 8px; }
  .radio-item-logo, .radio-item-logo img { width: 48px; height: 48px; }
  .radio-item-name { font-size: 12px; }
  .radio-fav-cover, .radio-fav-cover img { width: 76px; height: 76px; }
  .radio-fav-name { max-width: 76px; }
  .radio-page-title { font-size: 18px; }
  #radio-np-logo { width: 72px; height: 72px; }
  #radio-np-name { font-size: 16px; }
  .radio-np-fav, .radio-np-prev, .radio-np-next, .radio-np-stop { width: 38px; height: 38px; }
  .radio-np-transport { padding: 0 8px; gap: 2px; }
  .radio-np-right { padding-left: 8px; }
  #radio-np-logo { width: 72px; height: 72px; }
}
@media (min-width: 900px) {
  .radio-list { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1200px) {
  .radio-list { grid-template-columns: repeat(5, 1fr); }
}

/* ---- Finance & News Modal ---- */
.finance-modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.finance-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.finance-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}
.finance-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px 0;
  flex-shrink: 0;
}
.finance-tab {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: none;
  color: rgba(255,255,255,0.5);
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.finance-tab.active { background: var(--accent); color: white; }
.finance-tab-content { display: none; flex: 1; overflow-y: auto; padding: 14px 16px; }
.finance-tab-content.active { display: block; }

/* Rates */
.finance-rates-grid { display: flex; flex-direction: column; gap: 8px; }
.finance-rate-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 12px 14px;
}
.finance-rate-flag { font-size: 22px; flex-shrink: 0; }
.finance-rate-label { flex: 1; font-size: 14px; color: rgba(255,255,255,0.7); }
.finance-rate-value { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.finance-gold-row { margin-top: 8px; }
.finance-gold-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(251,191,36,0.08);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: rgba(255,255,255,0.8);
}

/* Crypto */
.finance-crypto-list { display: flex; flex-direction: column; gap: 8px; }
.finance-crypto-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 12px 14px;
}
.finance-crypto-name { display: flex; flex-direction: column; gap: 2px; }
.finance-crypto-symbol { font-size: 15px; font-weight: 700; }
.finance-crypto-full { font-size: 11px; color: rgba(255,255,255,0.45); }
.finance-crypto-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.finance-crypto-price { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.finance-crypto-change { font-size: 12px; font-weight: 600; }
.finance-crypto-change.positive { color: #22c55e; }
.finance-crypto-change.negative { color: #ef4444; }

/* News */
.finance-news-list { display: flex; flex-direction: column; gap: 2px; }
.finance-news-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background var(--transition);
}
.finance-news-item:hover { background: rgba(255,255,255,0.06); }
.finance-news-source { font-size: 11px; color: rgba(255,255,255,0.4); }
.finance-news-title { font-size: 14px; line-height: 1.4; color: rgba(255,255,255,0.9); }

.finance-loading { text-align: center; color: rgba(255,255,255,0.3); padding: 32px 0; font-size: 14px; }
.finance-error { text-align: center; color: rgba(255,80,80,0.7); padding: 24px 0; font-size: 13px; }
.finance-updated { text-align: right; font-size: 11px; color: rgba(255,255,255,0.25); padding: 6px 16px 12px; flex-shrink: 0; }

/* ---- Apps picker ---- */
.apps-card { max-width: 600px; max-height: 80vh; display: flex; flex-direction: column; }
.apps-search { margin-bottom: 12px; }
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  overflow-y: auto;
  max-height: 320px;
  padding: 4px;
  scrollbar-width: thin;
}
.app-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border-radius: 14px;
  transition: background var(--transition);
}
.app-picker-item:hover { background: rgba(255,255,255,0.1); }
.app-picker-item--added { background: rgba(52,152,219,0.12); }
.app-picker-item--added img { outline: 2px solid #3498db; border-radius: 12px; }
.app-picker-item img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.app-picker-item span { font-size: 10px; text-align: center; opacity: 0.8; }
.apps-upload {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 12px;
  margin-top: 12px;
}
.apps-upload h4 { font-size: 13px; opacity: 0.7; margin-bottom: 8px; }
.apps-upload input { width: 100%; margin-bottom: 8px; }

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  text-decoration: none;
  flex: 1;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary.btn-full { width: 100%; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
  transition: background var(--transition);
  flex: 1;
}
.btn-secondary:hover { background: rgba(255,255,255,0.18); }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition);
  width: 100%;
  margin-top: 8px;
}
.btn-google:hover { background: rgba(255,255,255,0.18); }

/* ---- Auth page ---- */
.auth-body {
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0a1a2a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: auto;
}
.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 24px 16px;
}
.auth-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo img { height: 60px; }
.auth-logo h1 { font-size: 28px; font-weight: 700; margin-top: 8px; }

.auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.auth-tab.active {
  background: rgba(255,255,255,0.14);
  color: var(--text);
}

.form-group { margin-bottom: 10px; }
.form-group input {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  padding: 13px 14px;
  outline: none;
  transition: border-color var(--transition);
}
.form-group input:focus { border-color: var(--accent); }
.form-group input::placeholder { color: var(--text-dim); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-dim);
  font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.12);
}

.auth-link {
  display: block;
  text-align: center;
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
  margin-top: 14px;
}
.auth-link:hover { text-decoration: underline; }

/* ---- QR Login ---- */
.qr-login-section { margin-top: 4px; }
.qr-box {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
  gap: 10px;
}
.qr-img {
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.1);
  display: block;
}
.qr-loading {
  width: 180px; height: 180px;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.08);
}
@keyframes spin { to { transform: rotate(360deg); } }
.qr-spin { animation: spin 1.2s linear infinite; opacity: 0.4; }
.qr-hint { font-size: 12px; color: rgba(255,255,255,0.45); text-align: center; margin: 0; }
.qr-expire { font-size: 11px; color: rgba(255,255,255,0.3); text-align: center; margin: 0; }

/* ---- QR confirm page ---- */
.qr-confirm-card { max-width: 380px; }
.qr-status {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 8px 0;
}
.qr-status--err svg { color: #e74c3c; }
.qr-avatar img, .qr-avatar-placeholder {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover;
}
.qr-avatar-placeholder {
  background: #3498db;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}
.qr-greeting { font-size: 16px; margin: 0; }
.qr-desc { font-size: 13px; color: rgba(255,255,255,0.55); margin: 0; }
.qr-confirm-btn { width: 100%; margin-top: 4px; }

.auth-error {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #fca5a5;
  margin-bottom: 14px;
}
.auth-success {
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #86efac;
  margin-bottom: 14px;
}

/* ---- Responsive ---- */
@media (min-width: 480px) {
  :root { --icon-size: 80px; --icon-gap: 28px; }
}
@media (min-width: 768px) {
  :root { --icon-size: 88px; --icon-gap: 32px; }
  .clock-widget { top: 40px; }
}
@media (min-width: 1024px) {
  :root { --icon-size: 96px; --icon-gap: 36px; }
}

/* Tesla browser — no hover effects */
@media (hover: none) and (pointer: coarse) {
  .dock-btn:hover { background: none; transform: none; }
}

/* PWA standalone */
@media (display-mode: standalone) {
  .clock-widget { top: max(32px, env(safe-area-inset-top, 32px)); }
}

/* =============================================
   TESLA WIDGET
   ============================================= */
.tesla-modal-card { min-width: 300px; max-width: 380px; }

.tesla-stats { display: flex; flex-direction: column; gap: 10px; }
.tesla-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.tesla-stat-label {
  width: 72px;
  opacity: .55;
  font-size: 12px;
  flex-shrink: 0;
}
.tesla-stat-val { font-weight: 600; }

.tesla-bat-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,.12);
  border-radius: 4px;
  overflow: hidden;
}
.tesla-bat-fill {
  height: 100%;
  background: #3498db;
  border-radius: 4px;
  transition: width .4s;
}
.tesla-bat-fill.low  { background: #e74c3c; }
.tesla-bat-fill.high { background: #2ecc71; }

.tesla-trip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tesla-trip-status {
  font-size: 13px;
  font-weight: 600;
  opacity: .7;
}
.tesla-trip-status.active {
  color: #2ecc71;
  opacity: 1;
}
.tesla-trip-duration { font-size: 12px; opacity: .5; }

/* Tesla Accordion */
.tesla-accordion { border: none; margin: 0; }
.tesla-accordion-toggle {
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  opacity: .5;
  padding: 4px 0 8px;
  user-select: none;
}
.tesla-accordion-toggle::-webkit-details-marker { display: none; }
.tesla-accordion[open] .tesla-accordion-toggle { opacity: .7; }

/* Live taksimetre */
#tesla-live-trip {
  text-align: center;
  padding: 10px 0 8px;
}
.tlive-cost { font-size: 56px; font-weight: 800; color: #f39c12; line-height: 1; letter-spacing: -2px; }
.tlive-sub  { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.tlive-kwh  { font-size: 16px; font-weight: 600; color: #3498db; }
.tlive-km   { font-size: 16px; font-weight: 600; color: rgba(255,255,255,.7); }
.tlive-sep  { font-size: 16px; opacity: .4; }

/* Trip özet kutusu */
.tsum-cost    { font-size: 52px; font-weight: 800; color: #f39c12; line-height: 1; letter-spacing: -2px; text-align: center; padding: 20px 0 8px; }
.tsum-label   { font-size: 13px; opacity: .5; text-align: center; margin-bottom: 12px; }
.tsum-details { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px; font-size: 16px; font-weight: 500; line-height: 1.6; border-top: 1px solid rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.tsum-details span:last-child { font-size: 13px; opacity: .5; font-weight: 400; }
.tsum-details-inline { text-align: center; font-size: 14px; opacity: .7; padding: 0 16px 14px; }
.tsum-compare { border-top: 1px solid rgba(255,255,255,.07); padding: 14px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tsum-compare-col { display: flex; flex-direction: column; gap: 2px; }
.tsum-compare-title { font-size: 12px; opacity: .55; }
.tsum-compare-price { font-size: 20px; font-weight: 700; color: rgba(255,255,255,.85); }
.tsum-compare-save { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.4); }
.tsum-compare-save.positive { color: #2ecc71; }

/* Tesla fiyat girişleri */
.tesla-prices { display: flex; flex-direction: column; gap: 8px; }
.tesla-price-row { display: flex; align-items: center; gap: 8px; }
.tesla-price-row label { font-size: 12px; opacity: .6; min-width: 72px; }
.tesla-price-input-wrap { display: flex; align-items: center; gap: 4px; }
.tesla-price-input-wrap input { width: 70px; padding: 5px 7px; border-radius: 8px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: #fff; font-size: 13px; text-align: right; }
.tesla-price-input-wrap span { font-size: 11px; opacity: .5; white-space: nowrap; }

.tesla-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
