:root {
  --blue-950: #123b3a;
  --blue-900: #1b5553;
  --blue-800: #256b69;
  --blue-700: #2f8380;
  --blue-100: #dff1ef;
  --blue-50: #f5f8f8;
  --ink: #16181b;
  --muted: #667075;
  --line: #dbe3e5;
  --card: #ffffff;
  --shadow: 0 18px 45px rgba(18, 59, 58, 0.10);
  --soft-shadow: 0 10px 26px rgba(18, 59, 58, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(47, 131, 128, 0.08), transparent 30rem),
    linear-gradient(180deg, #ffffff 0%, var(--blue-50) 48%, #ffffff 100%);
  font-family: "Aptos", "Segoe UI", Verdana, sans-serif;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
}

.top-bar,
.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  backdrop-filter: blur(14px);
}

.top-bar {
  top: 0;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 24px rgba(18, 59, 58, 0.05);
}

.bottom-bar {
  bottom: 0;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 24px rgba(18, 59, 58, 0.05);
}

.bar-inner {
  width: calc(100% - 32px);
  max-width: none;
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.bottom-inner {
  min-height: 58px;
  color: var(--blue-900);
  font-size: 14px;
  font-weight: 700;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.footer-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-row a {
  color: var(--blue-900);
  text-decoration: none;
}

.footer-row a:hover {
  text-decoration: underline;
}

.footer-row-secondary {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.footer-dot {
  opacity: 0.7;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--blue-950);
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 950;
  letter-spacing: -0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark-image {
  width: auto;
  height: 68px;
  display: block;
  object-fit: contain;
}

.top-nav {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.feed-refresh-banner {
  display: block;
  width: min(420px, calc(100% - 32px));
  margin: 0 auto 18px;
  padding: 14px 18px;
  border: 0;
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #1f6d61 0%, #2b8a78 52%, #43b08b 100%);
  box-shadow: 0 16px 30px rgba(27, 85, 83, 0.18);
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-align: center;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

.feed-refresh-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(27, 85, 83, 0.24);
}

.feed-refresh-banner-hidden {
  display: none;
}

.personalized-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--blue-950);
  font-weight: 950;
  cursor: pointer;
  user-select: none;
}

.personalized-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 58px;
  height: 32px;
  border-radius: 999px;
  background: #c7d5d8;
  box-shadow: inset 0 2px 6px rgba(18, 59, 58, 0.18);
  transition: background 160ms ease, box-shadow 160ms ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(18, 59, 58, 0.24);
  transition: transform 160ms ease;
}

.personalized-toggle input:checked + .toggle-track {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
  box-shadow: inset 0 2px 6px rgba(18, 59, 58, 0.18), 0 10px 20px rgba(37, 107, 105, 0.18);
}

.personalized-toggle input:checked + .toggle-track::after {
  transform: translateX(26px);
}

.personalized-toggle input:focus-visible + .toggle-track {
  outline: 3px solid var(--blue-100);
  outline-offset: 3px;
}

.account-menu {
  position: relative;
}

.account-menu summary {
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--blue-950);
  background: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(18, 59, 58, 0.05);
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu[open] summary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue-950), var(--blue-800));
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(260px, 78vw);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}

.account-menu-panel a {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--blue-950);
  font-weight: 900;
  text-decoration: none;
}

.account-menu-panel a:hover {
  background: var(--blue-100);
}

.account-menu-user,
.account-menu-email {
  margin: 0;
  padding: 0 12px;
  overflow-wrap: anywhere;
}

.account-menu-user {
  color: var(--blue-950);
  font-weight: 950;
}

.account-menu-email {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.app-shell {
  width: calc(100% - 32px);
  max-width: none;
  margin: 0 auto;
  padding: 116px 0 96px;
}

.feed-layout {
  display: block;
  width: min(60vw, 980px);
  margin: 0 auto;
}

.info-page-card {
  padding: 34px 38px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--card);
  box-shadow: var(--soft-shadow);
}

.info-page-card h1 {
  margin: 0 0 14px;
  color: var(--blue-950);
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.05em;
}

.info-page-kicker {
  margin: 0 0 12px;
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.info-page-intro {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.info-page-copy {
  color: var(--ink);
  line-height: 1.75;
}

.info-page-copy p {
  margin: 0 0 16px;
}

.info-page-copy h2,
.info-page-copy h3 {
  margin: 28px 0 12px;
  color: var(--blue-950);
  letter-spacing: -0.03em;
}

.info-page-copy ul {
  margin: 0 0 16px 20px;
  padding: 0;
}

.info-page-copy li {
  margin: 0 0 8px;
}

.top-link-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--blue-950);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(18, 59, 58, 0.05);
}

.feed-list {
  display: grid;
  gap: 28px;
}

.article-card {
  width: 100%;
  min-height: 268px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--card);
  box-shadow: var(--soft-shadow);
}

.article-body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-width: 0;
}

.article-meta {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.article-title {
  display: block;
  color: var(--blue-950);
  font-size: clamp(15px, 1.9vw, 24px);
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: -0.05em;
  text-decoration: none;
}

.article-summary {
  margin: 16px 0 0;
  min-height: 92px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 620;
  line-height: 1.6;
}

.article-read-more {
  display: inline-flex;
  align-items: center;
  margin-top: auto;
  padding-top: 18px;
  color: var(--blue-900);
  font-size: 16px;
  font-weight: 900;
  text-decoration: none;
}

.article-read-more:hover {
  color: var(--blue-700);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.inline-policy-link {
  display: inline;
  padding: 0;
  border: 0;
  color: var(--blue-900);
  background: transparent;
  font: inherit;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.policy-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: min(82vh, 900px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: transparent;
  overflow: hidden;
}

.policy-dialog::backdrop {
  background: rgba(9, 21, 21, 0.44);
  backdrop-filter: blur(6px);
}

.policy-dialog-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(82vh, 900px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 68px rgba(18, 59, 58, 0.22);
  overflow: hidden;
}

.policy-dialog-header,
.policy-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.policy-dialog-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.policy-dialog-header h2 {
  margin: 0;
  color: var(--blue-950);
  font-size: 24px;
  letter-spacing: -0.04em;
}

.policy-dialog-close {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--blue-950);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.policy-dialog-body {
  overflow: auto;
  padding: 24px 26px 10px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.policy-dialog-footer a {
  color: var(--blue-900);
  font-weight: 900;
  text-decoration: none;
}

.policy-dialog-footer a:hover {
  text-decoration: underline;
}

.feed-status {
  margin: 24px 0 6px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(480px, 100%);
}

.login-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--soft-shadow);
  padding: 34px;
  border-radius: 32px;
}

.login-card h1 {
  margin: 0 0 10px;
  color: var(--blue-950);
  font-size: clamp(36px, 8vw, 64px);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.login-brand-image {
  display: block;
  width: min(260px, 82%);
  height: auto;
  margin: 0 auto 14px;
}

.login-copy,
.login-error,
.login-success,
.login-dev-link {
  color: var(--muted);
  line-height: 1.55;
}

.login-error {
  color: #a13f3f;
  font-weight: 800;
}

.login-success {
  color: var(--blue-800);
  font-weight: 900;
}

.login-dev-link a {
  color: var(--blue-900);
  font-weight: 950;
  text-underline-offset: 4px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--blue-950);
  font-weight: 900;
}

.field-rule {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.field-error {
  color: #a43746;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.field-error[hidden] {
  display: none;
}

.login-form input:not([type="checkbox"]) {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(18, 59, 58, 0.03);
}

.login-form input:disabled {
  color: #8b969b;
  background: #edf3f4;
  border-color: #d5e0e3;
  cursor: not-allowed;
  box-shadow: none;
}

.login-form .checkbox-label {
  grid-template-columns: auto 1fr;
  align-items: start;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.login-form .checkbox-label input {
  margin-top: 3px;
}

.checkbox-rule {
  grid-column: 2;
  margin-top: -2px;
}

.checkbox-label .field-error {
  grid-column: 2;
}

.login-form button {
  border: 0;
  border-radius: 16px;
  padding: 15px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-950), var(--blue-800));
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  box-shadow: var(--soft-shadow);
}

.login-form button:disabled {
  color: #8da1a7;
  background: linear-gradient(135deg, #dbe5e7, #c8d5d9);
  cursor: not-allowed;
  box-shadow: none;
}

.delete-account-form {
  margin-top: 12px;
}

.reset-preferences-form {
  margin-top: 12px;
}

.login-form .warning-button {
  background: linear-gradient(135deg, #d9822b, #b96218);
  box-shadow: 0 16px 28px rgba(185, 98, 24, 0.18);
}

.login-form .danger-button {
  background: linear-gradient(135deg, #c83e4c, #a72733);
  box-shadow: 0 16px 28px rgba(167, 39, 51, 0.18);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.auth-resend-form {
  margin-top: 14px;
}

.auth-links a,
.auth-back a {
  color: var(--blue-900);
  font-weight: 950;
  text-underline-offset: 4px;
}

.auth-links-single {
  justify-content: flex-start;
}

.auth-back {
  margin-top: 20px;
}

.auth-help {
  margin: 20px 0 0;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 860px) {
  .bar-inner {
    min-height: 64px;
  }

  .top-nav {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .personalized-toggle {
    font-size: 14px;
  }

  .app-shell {
    padding-top: 88px;
  }

  .article-card {
    padding: 20px 18px;
  }

  .article-title {
    font-size: clamp(15px, 5vw, 20px);
  }

  .bottom-inner {
    justify-content: center;
  }

  .bottom-inner span:last-child {
    display: none;
  }
}
