/* TradeBuilt Nation - Home Page */

:root {
  --bg-deep: #0d1117;
  --bg-surface: #161b22;
  --bg-elevated: #21262d;
  --accent: #ff6b35;
  --accent-soft: #ff8c5a;
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --border: #30363d;
  --grid-color: rgba(48, 54, 61, 0.15);
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg-deep: #f6f8fa;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --text-primary: #24292f;
  --text-secondary: #57606a;
  --border: #d0d7de;
  --grid-color: rgba(31, 35, 40, 0.08);
}

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

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

#dashboard-section[hidden],
#auth-section[hidden] {
  display: none !important;
}

.auth-theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.375rem;
  z-index: 100;
}

.auth-theme-btn {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.auth-theme-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: rgba(255, 107, 53, 0.08);
}

.auth-theme-btn[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

body[data-auth-loading] .home {
  visibility: hidden;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

@keyframes bg-drift {
  0% {
    transform: translate(8%, 8%);
  }
  100% {
    transform: translate(-8%, -8%);
  }
}

/* Animated grid background - drifts bottom-right to top-left */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background-image: 
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 64px 64px;
  background-color: transparent;
  pointer-events: none;
  z-index: 0;
  animation: bg-drift 25s linear infinite alternate;
}

.home {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Full-page dashboard layout */
body:has(#dashboard-section:not([hidden])) {
  align-items: stretch;
}

main:has(#dashboard-section:not([hidden])) {
  padding: 0;
  max-width: none;
}

.hero {
  max-width: 720px;
  margin: 0 auto;
  perspective: 800px;
}

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

@keyframes logo-flip-vertical {
  0% {
    transform: rotateX(0deg);
  }
  100% {
    transform: rotateX(360deg);
  }
}

.header-logo {
  cursor: pointer;
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 0 auto 2rem;
  border-radius: 12px;
  box-shadow: 0 0 80px 20px rgba(0, 0, 0, 0.4);
  animation: logo-pulse 3s ease-in-out infinite;
}

.header-logo--flipping {
  animation: logo-flip-vertical 0.6s ease-in-out forwards;
}

.header-logo--dashboard {
  max-width: 360px;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 0 60px 15px rgba(0, 0, 0, 0.35);
  animation: logo-pulse 3s ease-in-out infinite;
}

.hero-tagline {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin: -1rem auto 1.5rem;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .hero-tagline {
    white-space: normal;
  }
  .home {
    padding: 1rem;
  }
}

.logo-mark {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--accent);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin-bottom: 2rem;
  text-transform: uppercase;
}

/* Legal footer */
.legal-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.legal-footer a {
  color: var(--accent);
  text-decoration: none;
}

.legal-footer a:hover {
  color: var(--accent-soft);
  text-decoration: underline;
}

.legal-sep {
  margin: 0 0.5rem;
  color: var(--border);
  user-select: none;
}

/* Auth tabs */
.auth-card {
  max-width: 360px;
  margin: 0 auto;
}

[data-theme="light"] .auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: 0 2px 8px rgba(31, 35, 40, 0.08), 0 1px 2px rgba(31, 35, 40, 0.06);
}

.auth-tabs {
  display: flex;
  gap: 0;
  max-width: 100%;
  margin: 0 0 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}

[data-theme="light"] .auth-tabs {
  background: var(--bg-deep);
  border-color: rgba(31, 35, 40, 0.12);
  margin-bottom: 1.75rem;
}

[data-theme="light"] .auth-tab.active {
  background: var(--bg-surface);
  box-shadow: 0 1px 2px rgba(31, 35, 40, 0.08);
}

.auth-tab {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.625rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.auth-tab:hover {
  color: var(--text-primary);
}

.auth-tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Form error */
.form-error {
  font-size: 0.875rem;
  color: #f85149;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.form-error:empty,
.form-error[hidden] {
  display: none !important;
}

.form-success {
  font-size: 0.875rem;
  color: #3fb950;
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.form-success[hidden] {
  display: none !important;
}

.forgot-link {
  margin-top: 1rem;
  text-align: center;
}

.forgot-link-btn {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}

.forgot-link-btn:hover {
  color: var(--accent-soft);
  text-decoration: underline;
}

.forgot-instructions {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Auth forms */
.auth-form {
  max-width: 360px;
  margin: 0 auto;
  text-align: left;
  display: none;
}

.auth-form.active {
  display: block;
}

.form-field {
  margin-bottom: 1.25rem;
}

.form-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-field input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.form-field input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.form-field input:hover,
.form-field input:focus {
  border-color: var(--accent);
  outline: none;
}

/* Password field with toggle */
.password-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.password-field input {
  flex: 1;
  padding-right: 4.5rem;
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  flex-shrink: 0;
}

.password-toggle:hover {
  color: var(--accent-soft);
}

/* Remember me */
.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.remember-me input {
  width: auto;
  margin: 0;
}

/* Email verification banner */
.verify-banner {
  font-size: 0.875rem;
  color: #d29922;
  background: rgba(210, 153, 34, 0.15);
  border: 1px solid rgba(210, 153, 34, 0.4);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.verify-banner button {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  margin-left: 0.25rem;
}

.verify-banner button {
  margin-right: 0.5rem;
}

.verify-banner button:hover {
  text-decoration: underline;
}

.verify-banner .verify-status {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
}

/* Rate limit lockout */
.auth-btn:disabled,
.auth-btn.auth-btn--cooldown {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-btn {
  width: 100%;
  margin-top: 0.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.875rem 1.5rem;
  background: var(--accent);
  color: var(--bg-deep);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-btn:hover {
  background: var(--accent-soft);
}

.auth-btn:active {
  transform: translateY(1px);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  gap: 1rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.google-btn:hover {
  border-color: var(--text-secondary);
  background: var(--bg-surface);
}

.google-btn:active {
  transform: translateY(1px);
}

.google-icon {
  flex-shrink: 0;
}

/* Dashboard */
.dashboard-section {
  position: relative;
  z-index: 1;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dashboard {
  background: var(--bg-surface);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.main-legal-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

/* Dashboard body: sidebar + main */
.dashboard-body {
  display: flex;
  flex: 1;
  min-height: 0;
  text-align: left;
}

.profile-sidebar {
  padding: 1.5rem;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  min-width: 160px;
  max-width: 240px;
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  position: relative;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.profile-sidebar.collapsed {
  width: 72px;
  min-width: 72px;
  overflow: visible;
  max-width: 72px;
  padding: 1rem 0.5rem;
}

.profile-sidebar.collapsed .profile-sidebar-content .profile-name,
.profile-sidebar.collapsed .profile-sidebar-content .logout-btn-label,
.profile-sidebar.collapsed .profile-sidebar-content .sidebar-nav-label {
  display: none;
}

.profile-sidebar.collapsed .profile-sidebar-content .sidebar-nav-icon,
.profile-sidebar.collapsed .profile-sidebar-content .logout-icon {
  display: block;
}

/* Icons always visible - expanded shows icon + label, collapsed shows icon only */

.profile-avatar {
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-sidebar.collapsed .profile-avatar {
  width: 64px;
  height: 64px;
}

.profile-avatar-initials {
  transition: font-size 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-sidebar.collapsed .profile-avatar-initials {
  font-size: 1.25rem;
}

.sidebar-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.sidebar-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(255, 107, 53, 0.1);
}

.sidebar-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--accent);
}

.sidebar-toggle-icon {
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-sidebar.collapsed .sidebar-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  flex-shrink: 0;
}

.profile-sidebar.collapsed .sidebar-toggle-icon {
  width: 18px;
  height: 18px;
  transform: rotate(180deg);
}

/* Tooltip when collapsed */
.profile-sidebar.collapsed .sidebar-toggle[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 0.5rem 0.875rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  pointer-events: none;
}

.profile-sidebar-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 0;
  transition: opacity 0.35s ease;
  padding-bottom: 1rem;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem 1rem;
  margin-bottom: 0.75rem;
  text-decoration: none;
  transition: opacity 0.2s, color 0.2s;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand:hover {
  opacity: 0.95;
}

.sidebar-brand:hover .sidebar-brand-name {
  color: var(--accent-soft);
}

.sidebar-brand-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 12px;
}

.sidebar-brand-name {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
  transition: color 0.2s;
  text-align: center;
  line-height: 1.2;
}

.sidebar-brand {
  transition: opacity 0.2s, color 0.2s, gap 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s cubic-bezier(0.4, 0, 0.2, 1), margin 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-sidebar.collapsed .sidebar-brand {
  flex-direction: row;
  gap: 0;
  padding: 0.5rem 0 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.profile-sidebar.collapsed .sidebar-brand-name {
  display: none;
}

.sidebar-brand-logo {
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-sidebar.collapsed .sidebar-brand-logo {
  width: 64px;
  height: 64px;
}

.sidebar-profile-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  padding-top: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
  transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1), margin 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-nav-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  flex: 1;
  min-width: 0;
  transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-sidebar.collapsed .sidebar-profile-block {
  padding: 0.5rem;
  padding-top: 0;
  margin-bottom: 0.5rem;
}

.profile-sidebar.collapsed .sidebar-nav-block {
  padding: 0 0.5rem;
}

/* Instant tooltip when collapsed - appears to the right */
.profile-sidebar.collapsed .sidebar-nav-link,
.profile-sidebar.collapsed .sidebar-profile-block .sidebar-nav-link {
  justify-content: center;
}

.profile-sidebar.collapsed .sidebar-nav-link[data-tooltip]:hover::after,
.profile-sidebar.collapsed .logout-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 0.5rem 0.875rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 1000;
  animation: tooltip-fade-in 0.1s ease-out;
}

@keyframes tooltip-fade-in {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.sidebar-nav-label {
  flex: 1;
  text-align: center;
  padding-right: 1rem;
}

.sidebar-profile-block .sidebar-nav-link {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.sidebar-nav-link:hover {
  color: var(--accent);
  background: rgba(255, 107, 53, 0.1);
  border-color: var(--accent);
}

.sidebar-nav-link.active {
  color: var(--accent);
  background: rgba(255, 107, 53, 0.1);
  border-color: var(--accent);
}

.sidebar-nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.profile-sidebar .logout-btn {
  margin-top: auto;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
  position: relative;
}

.logout-btn-label {
  flex: 1;
  text-align: center;
  padding-right: 1rem;
}

.profile-sidebar.collapsed .logout-btn {
  padding: 0.625rem;
}

.dashboard-main {
  flex: 1;
  padding: 2rem;
  min-width: 0;
}

@media (max-width: 768px) {
  .profile-sidebar {
    width: 180px;
    max-width: 200px;
    padding: 1.25rem;
    padding-bottom: 2rem;
  }
  .profile-sidebar.collapsed {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
  }
  .dashboard-main {
    padding: 1.5rem;
  }
}

@media (max-width: 640px) {
  .profile-sidebar.collapsed {
    width: auto;
    min-width: 0;
    max-width: none;
  }
  .sidebar-toggle {
    display: none;
  }
  .dashboard-body {
    flex-direction: column;
  }
  .profile-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    min-width: 0;
    max-width: none;
  }
  .sidebar-profile-block {
    border-bottom: none;
    margin-bottom: 0;
    padding: 0;
    flex-direction: row;
    gap: 0.75rem;
  }
  .sidebar-nav-block {
    flex-direction: row;
    flex: 0;
    padding: 0;
    margin-left: auto;
    gap: 0.5rem;
  }
  .profile-sidebar .logout-btn {
    margin-top: 0;
    margin-left: 0;
  }
  .dashboard-main {
    padding: 1rem 1.5rem;
  }
  .profile-name {
    font-size: 0.875rem;
  }
}

@media (max-width: 360px) {
  .profile-sidebar {
    padding: 0.75rem 1rem;
  }
  .profile-avatar {
    width: 56px;
    height: 56px;
  }
  .profile-avatar-initials {
    font-size: 1.125rem;
  }
  .profile-name {
    font-size: 0.8125rem;
  }
  .dashboard-main {
    padding: 0.75rem 1rem;
  }
}

.logout-btn {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.logout-btn:hover {
  color: #f85149;
  border-color: #f85149;
  background: rgba(248, 81, 73, 0.1);
}

/* Profile sidebar */
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--border) 100%);
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-initials {
  font-family: var(--font-mono);
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  text-transform: uppercase;
}

.profile-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Profile content (main area) */
.profile-content {
  flex: 1;
  min-height: 0;
}

.account-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.account-panel-header .panel-title {
  margin-bottom: 0;
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.account-save-status {
  margin-bottom: 1rem;
  min-height: 1.25rem;
}

.account-save-status:empty {
  margin-bottom: 0;
  min-height: 0;
}

.panel-placeholder {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* Account top row: photo + name side by side */
.account-top-row {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .account-top-row {
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* Account name section */
.account-name-section {
  flex: 1;
  min-width: 200px;
}

.account-name-section > .account-field-label:not(:first-of-type) {
  margin-top: 1.25rem;
}

.account-field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.account-name-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.account-city-state-row .account-name-input {
  flex: 1;
  min-width: 0;
}

.account-city-state-row .account-name-input:first-of-type {
  flex: 2;
  max-width: 240px;
}

.account-city-state-row .account-name-input:last-of-type {
  max-width: 140px;
}

.account-name-input {
  flex: 1;
  max-width: 320px;
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.625rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.account-name-input:hover,
.account-name-input:focus {
  border-color: var(--accent);
  outline: none;
}

.account-save-btn {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  background: var(--accent);
  color: var(--bg-deep);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.account-save-btn:hover {
  background: var(--accent-soft);
}

.account-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.account-field-hint {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.account-field-hint.success {
  color: #3fb950;
}

.account-field-hint.error {
  color: #f85149;
}

/* Account bio section */
.account-bio-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-top: 0.5rem;
}

.account-bio-input {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.625rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s;
}

.account-bio-input:hover,
.account-bio-input:focus {
  border-color: var(--accent);
  outline: none;
}

.account-bio-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.account-bio-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 400px;
}

.account-bio-counter {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-align: right;
}

/* Account profile photo section */
.account-profile-photo {
  flex-shrink: 0;
}

.account-photo-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.photo-source-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.photo-source-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.875rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: left;
}

.photo-source-option:hover {
  border-color: var(--accent);
  background: rgba(255, 107, 53, 0.08);
}

.photo-source-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--accent);
}

.camera-preview-wrap {
  width: 280px;
  height: 280px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-deep);
  border: 1px solid var(--border);
}

.camera-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar--large {
  width: 120px;
  height: 120px;
}

.profile-avatar--large .profile-avatar-initials {
  font-size: 2.5rem;
}

.change-photo-btn {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.change-photo-btn:hover {
  color: var(--bg-deep);
  background: var(--accent);
}

.account-photo-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: max-content;
}

.account-photo-actions .change-photo-btn,
.account-photo-actions .account-logout-btn {
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
}

.account-logout-btn {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  color: var(--text-secondary);
}

.account-logout-btn:hover {
  color: #f85149;
  border-color: #f85149;
  background: rgba(248, 81, 73, 0.1);
}

/* Account sections - Email, Password, Delete */
.account-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.theme-toggle-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.theme-toggle-btn {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.theme-toggle-btn:hover {
  border-color: var(--accent);
  background: rgba(255, 107, 53, 0.08);
}

.theme-toggle-btn[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.account-section.account-security-section {
  display: flex;
  flex-direction: column;
}

.account-section .account-password-block,
.account-section .account-danger-block {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.account-email-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

.account-email-row input {
  flex: 1;
  max-width: 320px;
}

.account-email-row input[readonly] {
  background: var(--bg-deep);
  color: var(--text-secondary);
  cursor: default;
}

.account-edit-btn {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.375rem 0.875rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.account-edit-btn:hover {
  color: var(--bg-deep);
  background: var(--accent);
}

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

.account-edit-btn:disabled:hover {
  color: var(--accent);
  background: transparent;
}

.account-google-note {
  margin-bottom: 0.5rem;
}

.account-danger-block .account-field-hint {
  margin-bottom: 0.75rem;
}

.account-delete-btn {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  background: transparent;
  color: #f85149;
  border: 1px solid #f85149;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.account-delete-btn:hover {
  color: var(--bg-deep);
  background: #f85149;
}

/* Account modals */
.account-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.account-modal[hidden] {
  display: none;
}

.account-modal-content .form-field {
  margin-bottom: 1rem;
}

.account-delete-warning {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Crop modal */
.crop-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.crop-modal[hidden] {
  display: none;
}

.crop-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.crop-modal-content {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
}

.crop-modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.crop-container {
  margin-bottom: 1.5rem;
}

.crop-viewport {
  width: 280px;
  height: 280px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: var(--bg-elevated);
  cursor: move;
  user-select: none;
}

.crop-image {
  position: absolute;
  max-width: none;
  display: block;
  pointer-events: none;
}

.crop-error {
  font-size: 0.875rem;
  color: #f85149;
  margin: 0.5rem 0 0;
}

.crop-error[hidden] {
  display: none !important;
}

.crop-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.crop-cancel-btn,
.crop-save-btn {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.crop-cancel-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.crop-cancel-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.crop-save-btn {
  background: var(--accent);
  color: var(--bg-deep);
  border: none;
}

.crop-save-btn:hover {
  background: var(--accent-soft);
}

/* Login splash screen */
.login-splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-splash[data-visible] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.login-splash-content {
  text-align: center;
  max-width: 320px;
}

.login-splash-spinner {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  padding: 12px;
  display: block;
  border-radius: 50%;
  background: #000;
  box-sizing: content-box;
  animation: splash-spin 1.2s linear infinite;
}

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

.login-splash-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.login-splash-message {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

