/* Member auth — news_tgn_0013 (Package Desk (institutional blue)) */
body.n1-login-open {
  overflow: hidden;
}

.n1-login-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  box-sizing: border-box;
}

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

.n1-login-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.n1-login-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 25rem;
  max-height: min(92vh, 42rem);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid rgba(18, 18, 18, 0.14);
  border-radius: 0;
  padding: 0;
  color: #121212;
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  box-shadow: 0 28px 64px rgba(17, 17, 17, 0.22);
  animation: n1-modal-in 0.22s ease-out;
}

.n1-login-modal__handle {
  display: none;
}

.n1-login-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem 1.05rem;
  background: #ffffff;
  color: #121212;
  border-bottom: 2px solid #0b3d91;
}

.n1-login-modal__brand {
  min-width: 0;
  flex: 1;
}

.n1-login-modal__head .n1-auth-eyebrow {
  margin: 0 0 0.3rem;
  color: #0b3d91;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.n1-login-modal__head .n1-auth-title {
  margin: 0;
  color: #121212;
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

@keyframes n1-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .n1-login-modal__panel {
    animation: none;
  }
}

.n1-auth-panel {
  display: none;
}

.n1-auth-panel.active {
  display: block;
}

.n1-auth-tab.active {
  color: #ffffff;
  background: #0b3d91;
}

.n1-auth-alert {
  display: none;
  padding: 0.65rem 0.85rem;
  border-radius: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.n1-auth-alert.show {
  display: block;
}

.n1-auth-alert.error {
  background: #f0f0f0;
  color: #121212;
  border: 1px solid rgba(18, 18, 18, 0.14);
  border-left: 3px solid #d14343;
}

.n1-auth-alert.success {
  background: #eef2f8;
  color: #0b3d91;
  border: 1px solid #c5d0e4;
  border-left: 3px solid #0b3d91;
}

.n1-form-group .n1-form-error {
  display: none;
  color: #d14343;
  font-size: 0.75rem;
  margin-top: 0.3rem;
}

.n1-form-group.has-error .n1-form-error {
  display: block;
}

.n1-form-group.has-error .n1-form-input {
  border-color: #d14343;
}

.n1-btn-auth.loading {
  opacity: 0.7;
  pointer-events: none;
}

.n1-btn-auth.loading .n1-btn-auth-text::after {
  content: '…';
}

/* Top-bar member UI — light paper mast (Package Desk) */
.n1-nav-user {
  gap: 0.5rem;
}

.n1-nav-user-profile {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 10rem;
  min-width: 0;
  padding: 0.2rem 0.7rem 0.2rem 0.2rem;
  border-radius: 0;
  border: 1px solid var(--n13-line, rgba(18, 18, 18, 0.14));
  background: var(--n13-panel, #ffffff);
  color: var(--n13-ink, #121212);
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.n1-nav-user-profile:hover {
  background: var(--n13-soft, #f0f0f0);
  border-color: var(--n13-accent, #0b3d91);
}

.n1-nav-user-profile:hover .n1-nav-user-name {
  color: var(--n13-accent, #0b3d91);
}

.n1-nav-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--n13-ink, #121212);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  transition: color 0.2s ease;
}

.n1-nav-user-divider {
  width: 1px;
  height: 1.125rem;
  background: var(--n13-line, rgba(18, 18, 18, 0.14));
  flex-shrink: 0;
}

.n1-nav-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--n13-line, rgba(18, 18, 18, 0.14));
  border-radius: 0;
  background: transparent;
  color: var(--n13-muted, #5c5c5c);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.n1-nav-logout i {
  font-size: 0.7rem;
  opacity: 0.9;
}

.n1-nav-logout:hover {
  color: #fff;
  background: var(--n13-accent, #0b3d91);
  border-color: var(--n13-accent, #0b3d91);
}

.n1-nav-user--mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.375rem 0.125rem;
}

.n1-nav-user--mobile .n1-nav-user-profile {
  flex: 1;
  min-width: 0;
  max-width: none;
  padding: 0.375rem 0.625rem 0.375rem 0.25rem;
}

.n1-nav-logout--mobile {
  flex-shrink: 0;
  padding: 0.55rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0;
  color: var(--n13-muted, #5c5c5c);
  border-color: var(--n13-line, rgba(18, 18, 18, 0.14));
  background: var(--n13-soft, #f0f0f0);
}

.n1-nav-logout--mobile:hover {
  color: #fff;
  background: var(--n13-accent, #0b3d91);
  border-color: var(--n13-accent, #0b3d91);
}

.n1-nav-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0b3d91, #121212);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1.5px solid rgba(11, 61, 145, 0.7);
  box-shadow: 0 0 0 1px rgba(10, 22, 40, 0.35);
}

.n1-nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.n1-profile-panel {
  display: none;
}

.n1-profile-panel.active {
  display: block;
}

.n1-profile-nav-item.active {
  color: #0b3d91;
  border-bottom-color: #0b3d91;
}

.n1-avatar-preview {
  width: 5rem;
  height: 5rem;
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
}

.n1-avatar-preview--header {
  width: 3rem;
  height: 3rem;
  font-size: 1rem;
  border-width: 1.5px;
}

@media (min-width: 640px) {
  .n1-avatar-preview--header {
    width: 5rem;
    height: 5rem;
    font-size: 1.5rem;
    border-width: 2px;
  }
}

.n1-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.n1-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  z-index: 110;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  max-width: 90vw;
}

.n1-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.n1-toast.success {
  background: #166534;
  color: #dcfce7;
}

.n1-toast.error {
  background: #991b1b;
  color: #fee2e2;
}

/* Profile lists */
.n1-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: #94a3b8;
  font-size: 0.875rem;
}

.n1-loading[hidden],
.n1-empty-state[hidden],
.n1-btn-load-more[hidden] {
  display: none !important;
}

.n1-loading-spinner {
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid #c5d0e4;
  border-top-color: #0b3d91;
  border-radius: 9999px;
  animation: n1-spin 0.7s linear infinite;
}

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

.n1-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0.25rem 0 0.5rem;
  padding: 1.5rem 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 1rem;
  background:
    radial-gradient(ellipse 70% 80% at 50% 0%, rgba(11, 61, 145, 0.06), transparent 65%),
    #f8fafc;
}

.n1-empty-state__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.75rem;
  border-radius: 9999px;
  background: #eef2f8;
  border: 1px solid #c5d0e4;
  color: #0b3d91;
  font-size: 1.125rem;
}

.n1-empty-state__title {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.n1-empty-state__desc {
  margin: 0.375rem 0 0;
  max-width: 22rem;
  color: #64748b;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.n1-empty-state__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.55rem 1.1rem;
  border-radius: 0.75rem;
  background: #0b3d91;
  color: #121212;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.n1-empty-state__cta:hover {
  background: #082d6b;
}

.n1-empty-state__cta i {
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}

.n1-empty-state__cta:hover i {
  transform: translateX(2px);
}

@media (min-width: 640px) {
  .n1-empty-state {
    padding: 2.75rem 2rem;
  }

  .n1-empty-state__icon {
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
  }

  .n1-empty-state__title {
    font-size: 1.25rem;
  }

  .n1-empty-state__desc {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.55;
  }

  .n1-empty-state__cta {
    margin-top: 1.25rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
}

.n1-article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .n1-article-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .n1-article-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.n1-article-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.n1-article-card:hover {
  border-color: #c5d0e4;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.n1-article-card__thumb {
  display: block;
  height: 8.5rem;
  overflow: hidden;
  background: #e2e8f0;
}

.n1-article-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.n1-article-card:hover .n1-article-card__thumb img {
  transform: scale(1.03);
}

.n1-article-card__ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #94a3b8;
  font-size: 1.5rem;
}

.n1-article-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.875rem 1rem 1rem;
  min-width: 0;
  flex: 1;
}

.n1-article-card__cat {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #082d6b;
  background: #eef2f8;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
}

.n1-article-card__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.35;
  min-width: 0;
}

.n1-article-card__title a {
  color: #0f172a;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.n1-article-card__title a:hover {
  color: #0b3d91;
}

.n1-article-card__meta {
  margin: 0;
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.n1-btn-remove {
  margin-top: auto;
  align-self: flex-start;
  padding: 0.25rem 0;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.n1-btn-remove:hover {
  color: #0b3d91;
}

.n1-btn-load-more {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.7rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.n1-btn-load-more:hover {
  border-color: #c5d0e4;
  color: #0b3d91;
  background: #eef2f8;
}

.n1-btn-load-more.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.n1-btn-load-more:disabled {
  cursor: not-allowed;
  opacity: 0.85;
  filter: none;
}

.n1-btn-load-more.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: profile-load-more-spin 0.7s linear infinite;
}

@keyframes profile-load-more-spin {
  to { transform: rotate(360deg); }
}


/* Confirm dialog */
.n1-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.n1-confirm-overlay.show {
  display: flex;
}

.n1-confirm-modal {
  width: 100%;
  max-width: 22rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.n1-confirm-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 800;
  color: #0f172a;
}

.n1-confirm-desc {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
}

.n1-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
}

.n1-confirm-cancel,
.n1-confirm-ok {
  padding: 0.55rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.n1-confirm-cancel {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
}

.n1-confirm-cancel:hover {
  border-color: #cbd5e1;
  color: #0f172a;
  background: #f8fafc;
}

.n1-confirm-ok {
  border: none;
  background: #0b3d91;
  color: #121212;
}

.n1-confirm-ok:hover {
  background: #082d6b;
}

/* Detail favorite button */
.detail-favorite-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  background: #fff;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.detail-favorite-btn__icon,
.detail-favorite-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.detail-favorite-btn:not(.is-active) .detail-favorite-btn__icon,
.detail-favorite-btn:not(.is-active) svg {
  fill: none;
}

.detail-favorite-btn.is-active {
  color: #0b3d91;
  border-color: #c5d0e4;
  background: #eef2f8;
}

.detail-favorite-btn.is-active .detail-favorite-btn__icon,
.detail-favorite-btn.is-active svg {
  fill: currentColor;
  stroke: currentColor;
}

.detail-favorite-btn__spinner {
  display: none;
  box-sizing: border-box;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: detail-fav-spin 0.7s linear infinite;
}

.detail-favorite-btn.is-toggling {
  color: #0b3d91;
  border-color: #c5d0e4;
  background: #eef2f8;
  cursor: wait;
  pointer-events: none;
  animation: detail-fav-pulse 1.2s ease-in-out infinite;
}

.detail-favorite-btn.is-toggling .detail-favorite-btn__icon {
  display: none;
}

.detail-favorite-btn.is-toggling .detail-favorite-btn__spinner {
  display: inline-block;
}

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

@keyframes detail-fav-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(11, 61, 145, 0); }
  50% { box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.18); }
}

.detail-favorite-btn:hover {
  border-color: #c5d0e4;
  color: #0b3d91;
  background: #eef2f8;
}

.detail-favorite-toast {
  position: fixed;
  left: 50%;
  bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  z-index: 30000;
  max-width: min(92vw, 22.5rem);
  padding: 0.75rem 1.125rem;
  border-radius: 0.625rem;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 0.75rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.detail-favorite-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 480px) {
  .detail-favorite-btn__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .detail-favorite-btn {
    padding: 0;
    width: 2.5rem;
  }
}

/* ===== Auth form visuals — Package Desk (institutional blue) ===== */
.n1-auth-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  padding: 1.5rem 1rem 3rem;
  min-height: 60vh;
  box-sizing: border-box;
}

.n1-auth-card {
  width: 100%;
  max-width: 26rem;
  padding: 1.7rem 1.6rem 1.85rem;
  background: #ffffff;
  border: 1px solid rgba(18, 18, 18, 0.14);
  border-top: 3px solid #0b3d91;
  border-radius: 0;
  box-shadow: 0 18px 48px rgba(17, 17, 17, 0.08);
  color: #121212;
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  box-sizing: border-box;
}

.n1-auth-card--modal {
  max-width: none;
  padding: 1.25rem 1.25rem 1.4rem;
  border: none;
  box-shadow: none;
  background: #ffffff;
  border-radius: 0;
}

.n1-auth-card .n1-auth-eyebrow {
  margin: 0 0 0.4rem;
  color: #0b3d91;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.n1-auth-card h1,
.n1-auth-card h2,
.n1-auth-card .n1-auth-title {
  margin: 0 0 1.2rem;
  color: #121212;
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.n1-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid rgba(18, 18, 18, 0.14);
  background: #f0f0f0;
  margin-bottom: 1.2rem;
}

.n1-auth-tab {
  flex: 1;
  min-height: 44px;
  padding: 0.55rem 0.25rem;
  font: inherit;
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #5c5c5c;
  background: transparent;
  border: none;
  border-bottom: none;
  margin-bottom: 0;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.n1-auth-tab:hover { color: #121212; }

.n1-auth-tab:focus-visible {
  outline: 2px solid #0b3d91;
  outline-offset: -2px;
}

.n1-form-group { margin-bottom: 1rem; }

.n1-form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #5c5c5c;
}

.n1-form-input-wrap {
  position: relative;
}

.n1-form-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(18, 18, 18, 0.14);
  border-radius: 0;
  background: #f0f0f0;
  color: #121212;
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.n1-form-input::placeholder {
  color: #8a8a8a;
}

.n1-form-input.has-toggle { padding-right: 2.5rem; }

.n1-form-input:focus,
.n1-form-input:focus-visible {
  outline: none;
  border-color: #0b3d91;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.18);
}

.n1-form-group.has-error .n1-form-input {
  border-color: #d14343;
  box-shadow: 0 0 0 3px rgba(209, 67, 67, 0.12);
}

.n1-pwd-toggle {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #8a8a8a;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.n1-pwd-toggle:hover { color: #0b3d91; }

.n1-btn-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.9rem 1rem;
  border: none;
  border-radius: 0;
  background: #0b3d91;
  color: #ffffff;
  font: inherit;
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.n1-btn-auth:hover { background: #082d6b; color: #ffffff; }

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

.n1-btn-auth:focus-visible {
  outline: 2px solid #121212;
  outline-offset: 2px;
}

.n1-login-modal__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(18, 18, 18, 0.14);
  border-radius: 0;
  background: transparent;
  color: #121212;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.n1-login-modal__close:hover {
  color: #0b3d91;
  border-color: #0b3d91;
  background: rgba(11, 61, 145, 0.08);
}

.n1-login-modal__close:focus-visible {
  outline: 2px solid #0b3d91;
  outline-offset: 2px;
}

.n1-social-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #5c5c5c;
  letter-spacing: 0.01em;
}

.n1-social-row::before,
.n1-social-row::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(18, 18, 18, 0.14);
}

.n1-social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.n1-social-btn {
  padding: 0.55rem;
  border: 1px solid rgba(18, 18, 18, 0.14);
  border-radius: 0;
  background: #ffffff;
  color: #5c5c5c;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.n1-social-btn:hover {
  color: #0b3d91;
  border-color: #0b3d91;
  background: #f0f0f0;
}

@media (max-width: 480px) {
  .n1-login-modal {
    align-items: flex-end;
    padding: 0;
  }

  .n1-login-modal__panel {
    max-width: none;
    max-height: min(94vh, 100%);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    animation: n1-modal-sheet-in 0.24s ease-out;
  }

  .n1-login-modal__handle {
    display: block;
    width: 2.5rem;
    height: 0.25rem;
    margin: 0.55rem auto 0;
    border-radius: 999px;
    background: rgba(18, 18, 18, 0.25);
    position: absolute;
    left: 50%;
    top: 0.35rem;
    transform: translateX(-50%);
    z-index: 3;
  }

  .n1-login-modal__head {
    padding: 1.35rem 1.1rem 1rem;
  }

  .n1-login-modal__head .n1-auth-title {
    font-size: 1.1rem;
  }

  .n1-auth-card--modal {
    padding: 1.15rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  @keyframes n1-modal-sheet-in {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .n1-auth-card h1,
  .n1-auth-card h2,
  .n1-auth-card .n1-auth-title {
    font-size: 1.2rem;
  }
}


/* Paper-mast member UI overrides */
.n1-nav-user {
  display: none;
  align-items: center;
}

.n1-nav-signin {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 650;
  text-decoration: none;
  color: var(--n13-ink, #121212);
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--n13-line, rgba(18, 18, 18, 0.14));
  border-radius: 0;
  background: var(--n13-panel, #ffffff);
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.n1-nav-signin:hover {
  color: #fff;
  border-color: var(--n13-accent, #0b3d91);
  background: var(--n13-accent, #0b3d91);
}

@media (max-width: 900px) {
  .n1-nav-logout span {
    display: none;
  }

  .n1-nav-logout {
    padding: 0.45rem 0.55rem;
  }

  .n1-nav-user-name {
    max-width: 4.5rem;
  }
}

/* Desktop auth in top bar; mobile keeps auth inside the fold menu only */
@media (max-width: 767px) {
  #loginBtn,
  #userInfo {
    display: none !important;
  }
}

@media (min-width: 768px) {
  #loginBtnMob,
  #loginMobItem,
  #userInfoMob,
  #logoutBtnMob {
    display: none !important;
  }
}

/* ===== Profile page — navy / gold (matches site) ===== */
.n1-profile-page {
  max-width: 64rem;
  margin: 0 auto;
  /* Top offset comes from styles.css: calc(var(--navbar-h) + var(--navbar-gap)) */
  padding: 1.5rem 1rem 3rem;
  box-sizing: border-box;
}

.n1-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  margin-bottom: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  color: #0f172a;
}

.n1-profile-header__meta {
  min-width: 0;
  flex: 1;
}

.n1-profile-header .n1-auth-eyebrow {
  margin: 0 0 0.2rem;
  color: #0b3d91;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.n1-profile-header h1 {
  margin: 0;
  color: #0f172a;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.n1-profile-header p {
  margin: 0.2rem 0 0;
  color: #64748b;
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.n1-profile-stats {
  display: flex;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
  text-align: center;
}

.n1-profile-stats > div {
  min-width: 4.25rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.n1-profile-stats strong {
  display: block;
  color: #0f172a;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.2;
}

.n1-profile-stats span {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.n1-profile-nav {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.n1-profile-nav-item {
  flex-shrink: 0;
  padding: 0.65rem 0.85rem;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.n1-profile-nav-item:hover {
  color: #0f172a;
}

.n1-profile-panel {
  display: none;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.35rem 1.5rem;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.n1-profile-panel.active {
  display: block;
}

.n1-profile-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.n1-profile-panel__head h2,
.n1-profile-panel > h2 {
  margin: 0 0 1rem;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.n1-profile-panel__head h2 {
  margin: 0;
}

.n1-profile-panel__count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
}

.n1-profile-text-btn {
  border: none;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.n1-profile-text-btn:hover {
  color: #0f172a;
}

.n1-profile-text-btn--danger {
  display: block;
  margin-top: 0.5rem;
  color: #0b3d91;
}

.n1-profile-text-btn--danger:hover {
  color: #082d6b;
}

.n1-profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.n1-profile-hint {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.n1-btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.n1-btn-secondary:hover {
  color: #0b3d91;
  border-color: #c5d0e4;
  background: #eef2f8;
}

.n1-btn-secondary--file {
  cursor: pointer;
}

.n1-profile-panel .n1-form-group {
  margin-bottom: 1rem;
}

.n1-profile-panel .n1-form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
}

.n1-profile-panel .n1-form-input,
.n1-profile-panel input[type="text"],
.n1-profile-panel input[type="email"],
.n1-profile-panel input[type="password"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.n1-profile-panel .n1-form-input:focus,
.n1-profile-panel input[type="text"]:focus,
.n1-profile-panel input[type="email"]:focus,
.n1-profile-panel input[type="password"]:focus {
  outline: none;
  border-color: #0b3d91;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(11, 61, 145, 0.12);
}

.n1-profile-panel .n1-form-input:disabled,
.n1-profile-panel input:disabled {
  color: #94a3b8;
  background: #f1f5f9;
  cursor: not-allowed;
}

.n1-profile-panel button[type="submit"],
.n1-profile-panel .n1-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.25rem;
  padding: 0.7rem 1.35rem;
  border: none;
  border-radius: 0.75rem;
  background: #0b3d91;
  color: #121212;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.n1-profile-panel .n1-btn-primary:hover,
.n1-profile-panel button[type="submit"]:hover {
  background: #082d6b;
}

.n1-profile-panel .n1-btn-primary:active,
.n1-profile-panel button[type="submit"]:active {
  transform: translateY(1px);
}

@media (max-width: 640px) {
  .n1-profile-header {
    flex-wrap: wrap;
    padding: 1.15rem 1.15rem;
  }

  .n1-profile-stats {
    margin-left: 0;
    width: 100%;
    justify-content: stretch;
  }

  .n1-profile-stats > div {
    flex: 1;
  }

  .n1-profile-panel {
    padding: 1.15rem;
  }
}


.n1-confirm-ok {
  position: relative;
}

.n1-confirm-ok:disabled,
.n1-confirm-cancel:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.n1-confirm-ok.is-loading {
  color: transparent;
  pointer-events: none;
}

.n1-confirm-ok.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: n1-confirm-spin 0.7s linear infinite;
}

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