.login-nav-button,
.login-mobile-button {
  appearance: none;
  border: 0;
  background: #22c55e;
  color: #050505;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.login-nav-button {
  padding: 0.7rem 1rem;
  white-space: nowrap;
}

.login-mobile-button {
  width: 100%;
  justify-content: flex-start;
  padding: 0.75rem;
}

.login-nav-button:hover,
.login-mobile-button:hover {
  background: #28d453;
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.22);
}

.login-nav-button:focus-visible,
.login-mobile-button:focus-visible,
.login-form input:focus-visible,
.profile-trigger:focus-visible,
.profile-actions a:focus-visible,
.profile-actions button:focus-visible,
.profile-logout-icon:focus-visible,
.account-page-button:focus-visible,
.account-inline-link:focus-visible,
.account-form input:focus-visible,
.account-form textarea:focus-visible,
.login-submit:focus-visible,
.login-close:focus-visible {
  outline: 2px solid #86efac;
  outline-offset: 3px;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-modal.is-open {
  display: flex;
}

.login-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.login-dialog {
  position: relative;
  width: min(100%, 420px);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: #141414;
  color: #e6eef1;
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.62);
  padding: 1.25rem;
}

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

.login-title {
  margin: 0;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  background: #0f0f0f;
  border: 1px solid #252525;
  border-radius: 8px;
}

.auth-tab {
  appearance: none;
  border: 0;
  min-height: 40px;
  border-radius: 6px;
  background: transparent;
  color: #d1d5db;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.auth-tab.active {
  background: #22c55e;
  color: #050505;
}

.login-close {
  appearance: none;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #1f1f1f;
  color: #e6eef1;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.login-form {
  display: grid;
  gap: 0.95rem;
}

.login-form[hidden] {
  display: none;
}

.login-field {
  display: grid;
  gap: 0.45rem;
}

.login-field label,
.login-remember {
  color: #d1d5db;
  font-size: 0.95rem;
  font-weight: 600;
}

.login-form input[type="email"],
.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #374151;
  border-radius: 8px;
  background: #0f0f0f;
  color: #fff;
  padding: 0.75rem 0.85rem;
}

.login-form input::placeholder {
  color: #8b949e;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.login-link,
.login-link-button {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #22c55e;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  padding: 0;
}

.login-link:hover,
.login-link-button:hover {
  color: #86efac;
}

.auth-switch-text {
  margin: 0;
  color: #d1d5db;
  font-size: 0.95rem;
  text-align: center;
}

.auth-forgot-copy {
  margin: 0;
  color: #9aa19f;
  font-size: 0.92rem;
  line-height: 1.55;
  text-align: center;
}

.login-submit {
  appearance: none;
  border: 0;
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  background: #22c55e;
  color: #050505;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.login-message {
  min-height: 1.25rem;
  color: #86efac;
  font-size: 0.9rem;
}

body.login-modal-open {
  overflow: hidden;
}

.auth-account-slot {
  position: relative;
  display: inline-flex;
  width: auto;
}

.profile-menu {
  position: relative;
  display: inline-flex;
  width: auto;
}

.profile-trigger {
  appearance: none;
  border: 1px solid rgba(34, 197, 94, 0.34);
  min-height: 42px;
  border-radius: 8px;
  background: #141414;
  color: #e6eef1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
  font: inherit;
  font-weight: 800;
  max-width: 210px;
}

.profile-trigger:hover {
  border-color: #22c55e;
  background: #1f1f1f;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
}

.profile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-caret {
  color: #22c55e;
  font-size: 0.8rem;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(92vw, 330px);
  z-index: 1200;
  background: #141414;
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.58);
  padding: 1rem;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.profile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.profile-card-avatar {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  object-fit: cover;
  flex: 0 0 auto;
}

.profile-card-name {
  color: #fff;
  font-weight: 900;
  line-height: 1.15;
}

.profile-card-email {
  color: #9aa19f;
  font-size: 0.82rem;
  margin-top: 0.2rem;
  word-break: break-word;
}

.profile-bio {
  margin: 0.85rem 0;
  color: #d1d5db;
  font-size: 0.9rem;
  line-height: 1.45;
}

.profile-actions {
  display: grid;
  gap: 0.5rem;
}

.profile-actions button,
.profile-actions a,
.profile-logout,
.profile-logout-icon,
.auth-info-actions button,
.auth-action-inner button {
  appearance: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.profile-actions button,
.profile-actions a,
.auth-info-actions button,
.auth-action-inner button {
  min-height: 40px;
  background: #1f1f1f;
  color: #e6eef1;
}

.profile-actions a {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 0.9rem;
  text-decoration: none;
}

.profile-actions button:hover,
.profile-actions a:hover,
.auth-info-actions button:hover,
.auth-action-inner button:hover {
  background: #22c55e;
  color: #050505;
}

.profile-logout-icon {
  width: 40px;
  height: 40px;
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  flex: 0 0 auto;
}

.profile-logout-icon:hover {
  background: rgba(239, 68, 68, 0.22);
}

.profile-logout {
  width: 100%;
  min-height: 40px;
  margin-top: 0.75rem;
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.profile-logout:hover {
  background: rgba(239, 68, 68, 0.22);
}

.auth-action-bar {
  position: sticky;
  top: 78px;
  z-index: 45;
  width: 100%;
  padding: 0.55rem 1rem;
  background: rgba(15, 15, 15, 0.9);
  border-bottom: 1px solid rgba(34, 197, 94, 0.16);
  backdrop-filter: blur(8px);
}

.auth-action-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.auth-action-inner button {
  padding: 0.55rem 0.85rem;
}

.auth-info-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.auth-info-actions button {
  padding: 0.7rem 1rem;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.auth-continue-section {
  width: 100%;
  margin: 0 0 2rem;
  padding: 0 1rem;
}

.auth-continue-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.auth-continue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.auth-continue-header h2 {
  margin: 0;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 900;
}

.auth-continue-list {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-continue-item {
  appearance: none;
  border: 1px solid rgba(34, 197, 94, 0.24);
  color: #e6eef1;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.auth-continue-item:hover {
  border-color: #22c55e;
}

.auth-continue-title {
  color: #fff;
  font-weight: 900;
}

.auth-continue-meta {
  color: #9aa19f;
  font-size: 0.88rem;
  font-weight: 700;
}

.auth-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 1rem);
  z-index: 1300;
  max-width: min(92vw, 420px);
  background: #141414;
  color: #e6eef1;
  border: 1px solid rgba(34, 197, 94, 0.34);
  border-radius: 8px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.5);
  padding: 0.85rem 1rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.auth-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.account-dashboard-grid {
  display: grid;
  gap: 1rem;
}

.account-surface {
  background: #141414;
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.account-user-hero,
.account-edit-layout {
  display: grid;
  gap: 1rem;
}

.account-page-avatar {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  object-fit: cover;
  flex: 0 0 auto;
}

.account-user-copy h2,
.account-section-heading h2,
.account-empty-state h2,
.account-empty-state h3,
.account-edit-summary h3 {
  margin: 0;
  color: #fff;
}

.account-kicker {
  margin: 0 0 0.35rem;
  color: #22c55e;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-email,
.account-note,
.account-empty-state p,
.account-mini-card p,
.account-bookmark-body p,
.account-stat-label,
.account-form-message {
  color: #9aa19f;
}

.account-page-bio {
  margin: 0.6rem 0 0;
  color: #d1d5db;
  line-height: 1.6;
}

.account-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.account-stat-card {
  background: #1a1a1a;
  border: 1px solid rgba(34, 197, 94, 0.12);
  border-radius: 8px;
  padding: 0.9rem;
  display: grid;
  gap: 0.25rem;
}

.account-stat-value {
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
}

.account-page-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.account-page-button {
  appearance: none;
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 8px;
  background: #22c55e;
  color: #050505;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.account-page-button:hover {
  background: #28d453;
}

.account-page-button-secondary {
  background: #1f1f1f;
  color: #e6eef1;
}

.account-page-button-secondary:hover {
  background: #2a2a2a;
}

.account-page-button-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.account-page-button-danger:hover {
  background: rgba(239, 68, 68, 0.22);
}

.account-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.account-inline-link {
  color: #86efac;
  font-weight: 700;
  text-decoration: none;
}

.account-inline-link:hover {
  color: #bbf7d0;
}

.account-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.account-mini-card {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  background: #1a1a1a;
  border: 1px solid rgba(34, 197, 94, 0.12);
  border-radius: 8px;
  padding: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.account-mini-card:hover,
.account-bookmark-card:hover {
  border-color: rgba(34, 197, 94, 0.36);
  transform: translateY(-1px);
}

.account-mini-card img {
  width: 64px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
}

.account-mini-card-copy {
  min-width: 0;
}

.account-mini-card h3,
.account-bookmark-body h3 {
  margin: 0.25rem 0 0.35rem;
  color: #fff;
  font-size: 1rem;
}

.account-mini-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.account-edit-summary {
  background: #1a1a1a;
  border: 1px solid rgba(34, 197, 94, 0.1);
  border-radius: 8px;
  padding: 1rem;
  display: grid;
  justify-items: start;
  gap: 0.6rem;
}

.account-form {
  display: grid;
  gap: 0.75rem;
}

.account-form label {
  color: #d1d5db;
  font-weight: 700;
}

.account-form input,
.account-form textarea {
  width: 100%;
  border: 1px solid #374151;
  border-radius: 8px;
  background: #0f0f0f;
  color: #fff;
  font: inherit;
  padding: 0.8rem 0.9rem;
}

.account-form textarea {
  min-height: 120px;
  resize: vertical;
}

.account-form input[readonly] {
  opacity: 0.75;
  cursor: not-allowed;
}

.account-bookmark-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 1.25rem;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: #22c55e #23272e;
  -webkit-overflow-scrolling: touch;
  align-items: stretch;
}

.account-bookmark-grid::-webkit-scrollbar {
  height: 7px;
  background: #23272e;
}

.account-bookmark-grid::-webkit-scrollbar-thumb {
  background: #22c55e;
  border-radius: 4px;
}

.account-bookmark-card {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 145px;
  min-width: 145px;
  max-width: 170px;
  background: #1a1a1a;
  border: 1px solid rgba(34, 197, 94, 0.12);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.account-bookmark-media {
  aspect-ratio: 3 / 4;
  background: #111;
}

.account-bookmark-poster,
.account-bookmark-fallback {
  width: 100%;
  height: 100%;
}

.account-bookmark-poster {
  object-fit: cover;
}

.account-bookmark-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #166534, #0f172a);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 900;
}

.account-bookmark-body {
  padding: 0.7rem 0.7rem 0.8rem;
}

.account-bookmark-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.account-bookmark-body h3 {
  margin: 0.3rem 0 0.2rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.22;
  min-height: 2.4em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.account-bookmark-body p {
  margin: 0 0 0.7rem;
  font-size: 0.85rem;
}

.account-card-link {
  color: #86efac;
  font-weight: 700;
  font-size: 0.85rem;
}

.account-empty-state {
  display: grid;
  gap: 0.75rem;
}

.account-empty-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .login-modal {
    align-items: center;
    justify-content: center;
    padding: 0.85rem;
  }

  .login-dialog {
    width: min(100%, 360px);
    max-height: calc(100vh - 1.7rem);
    border-radius: 8px;
    padding: 1rem;
  }

  .login-title {
    font-size: 1.2rem;
  }

  .auth-account-slot,
  .profile-menu,
  .profile-trigger {
    width: 100%;
  }

  .profile-trigger {
    justify-content: flex-start;
    max-width: none;
  }

  .profile-dropdown {
    left: 0;
    right: auto;
    width: 100%;
  }

  .auth-action-bar {
    top: 70px;
    padding: 0.5rem;
  }

  .auth-action-inner {
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth-info-actions,
  .auth-info-actions button {
    width: 100%;
  }

  .auth-continue-section {
    padding: 0 0.75rem;
  }

  .auth-continue-list {
    overflow-x: auto;
  }

  .profile-card-head,
  .account-section-heading {
    align-items: stretch;
  }

  .account-stat-grid {
    grid-template-columns: 1fr;
  }

  .account-page-actions,
  .account-empty-actions {
    width: 100%;
  }

  .account-page-button,
  .account-page-actions a,
  .account-page-actions button,
  .account-empty-actions button {
    width: 100%;
  }

  .account-bookmark-card {
    width: 165px;
    min-width: 165px;
  }
}

@media (max-width: 420px) {
  .login-modal {
    padding: 0.75rem;
  }

  .login-dialog {
    width: min(100%, 340px);
    padding: 0.95rem;
  }

  .auth-tabs {
    gap: 0.35rem;
  }

  .login-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 900px) {
  .account-dashboard-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }

  .account-user-hero,
  .account-edit-layout {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .account-edit-layout {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  }
}

@media (min-width: 768px) {
  .account-bookmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem 1.25rem;
    overflow-x: visible;
  }

  .account-bookmark-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}
