:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #fbfbfd;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: #e8f2ff;
  --green: #248a3d;
  --green-soft: #eaf7ed;
  --warm: #a05a00;
  --warm-soft: #fff4e5;
  --danger: #b42318;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.08);
  --shadow-drawer: -24px 0 70px rgba(0, 0, 0, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", Arial, sans-serif;
}

body {
  padding: 24px 22px 48px;
  overflow-x: hidden;
}

body.detail-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.auth-shell {
  width: min(1180px, 100%);
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  align-items: center;
  gap: clamp(40px, 8vw, 110px);
}

.auth-brand {
  padding: 44px 0;
}

.auth-brand h1 {
  max-width: 21ch;
  color: #202a3a;
  font-size: clamp(1.9rem, 3vw, 3.1rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.auth-brand > p:last-child {
  max-width: 54ch;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.auth-card {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(24px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 26px;
  padding: 4px;
  border-radius: 12px;
  background: #f0f0f2;
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
  cursor: pointer;
}

.auth-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  outline: none;
  background: #fff;
}

.auth-form input:focus {
  border-color: rgba(0, 113, 227, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-message {
  min-height: 22px;
  margin: 18px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.55;
}

.auth-message.success {
  color: var(--green);
}

.auth-note {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.55;
}

.page-shell {
  width: min(1460px, 100%);
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(330px, 0.6fr);
  gap: 18px;
  margin-bottom: 18px;
}

.hero-copy,
.digest-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow-sm);
}

.hero-copy {
  min-height: 390px;
  padding: 52px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 8%, rgba(0, 113, 227, 0.12), transparent 28%),
    linear-gradient(145deg, #ffffff 0%, #fbfdff 55%, #f2f7ff 100%);
}

.hero-copy::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -150px;
  bottom: -190px;
  border-radius: 50%;
  background: rgba(0, 113, 227, 0.06);
}

.digest-card {
  padding: 32px;
  min-height: 390px;
  background: linear-gradient(160deg, #f9fbff, #ffffff 60%);
}

.eyebrow,
.section-label,
.detail-kicker,
.micro-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 14ch;
  font-size: clamp(2.55rem, 4.5vw, 4.8rem);
  line-height: 1.02;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  line-height: 1.12;
}

h3 {
  font-size: 1.34rem;
  line-height: 1.25;
}

h4 {
  font-size: 1.05rem;
  line-height: 1.4;
}

.hero-highlight {
  color: var(--accent);
}

.hero-text,
.hero-note,
.article-summary,
.card-meta,
.abstract-preview,
.profile-line,
.detail-block p,
.detail-empty p,
.summary-tile p,
.plain-list,
.detail-list {
  color: var(--muted);
  line-height: 1.65;
}

.hero-text {
  max-width: 68ch;
  margin: 22px 0;
  font-size: 1.05rem;
}

.hero-signal-band,
.hero-actions,
.status-strip,
.tab-group,
.chip-group,
.card-topline,
.card-topline-group,
.tag-row,
.score-strip,
.detail-meta,
.detail-actions,
.entry-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.hero-signal-band {
  margin-bottom: 24px;
}

.signal-pill,
.pill,
.journal-badge,
.reading-badge,
.outline-badge,
.status-badge,
.status-note {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.signal-pill {
  padding: 7px 11px;
  background: rgba(0, 0, 0, 0.04);
  color: #424245;
}

.hero-actions {
  position: relative;
  z-index: 1;
}

.hero-note {
  max-width: 48ch;
  font-size: 13px;
}

.primary-button,
.entry-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-button {
  min-height: 44px;
  padding: 11px 20px;
}

.primary-button:hover,
.entry-link:hover {
  background: var(--accent-hover);
}

.primary-button:active,
.entry-link:active {
  transform: scale(0.98);
}

.status-strip {
  margin-top: 18px;
}

.status-badge,
.status-note {
  padding: 7px 10px;
  background: #f0f0f2;
  color: var(--muted);
}

.status-live {
  background: var(--green-soft);
  color: var(--green);
}

.status-fallback {
  background: var(--warm-soft);
  color: var(--warm);
}

.status-error {
  background: #fff0ef;
  color: var(--danger);
}

.status-success {
  background: #edf8f1;
  color: #177245;
}

.hero-micro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
  position: relative;
  z-index: 1;
}

.micro-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.micro-card strong {
  display: block;
  margin-bottom: 6px;
}

.micro-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.dashboard {
  display: block;
}

.panel {
  padding: 28px;
}

.dashboard-title {
  max-width: none;
  font-size: clamp(1.55rem, 2.4vw, 2.3rem);
  line-height: 1.12;
}

.panel-wide {
  min-width: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.header-side {
  display: grid;
  justify-items: end;
  gap: 14px;
}

.session-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.type-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  flex-wrap: nowrap;
}

.type-toggle .chip {
  min-width: 0;
  padding: 8px 18px;
  font-size: 16px;
  line-height: 1.15;
  white-space: nowrap;
}

.integration-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}

.integration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.analytics-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  border: 0;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(5px);
}

.analytics-panel {
  position: fixed;
  inset: 32px;
  z-index: 120;
  overflow-y: auto;
  padding: 0 30px 34px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-drawer);
}

.analytics-content {
  display: grid;
  gap: 26px;
}

.analytics-section {
  display: grid;
  gap: 20px;
}

.analytics-hero-head,
.analytics-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.analytics-hero-head {
  margin-bottom: 2px;
}

.analytics-hero-head h3,
.analytics-section-head h3 {
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  letter-spacing: -0.035em;
}

.analytics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.analytics-select-pill,
.analytics-date-pill {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid #d7d7dc;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.analytics-select-pill select,
.analytics-date-pill input {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
  outline: 0;
}

.analytics-select-pill select {
  min-width: 180px;
  padding-right: 26px;
  cursor: pointer;
}

.analytics-date-pill {
  gap: 10px;
  padding-right: 16px;
}

.analytics-date-pill span {
  color: var(--faint);
  font-size: 17px;
}

.analytics-date-pill input {
  width: 136px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.analytics-card {
  padding: 24px;
  border: 1px solid #ececf0;
  border-radius: 28px;
  background: linear-gradient(180deg, #fff, #fbfbfd);
}

.analytics-card-hero {
  padding: 34px 34px 28px;
}

.analytics-card-wide {
  grid-column: 1 / -1;
}

.notification-list,
.sync-run-list {
  display: grid;
  gap: 14px;
}

.notification-card,
.sync-run-card {
  padding: 18px 20px;
  border: 1px solid #ececf0;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #fbfbfd);
}

.notification-card.is-read {
  opacity: 0.72;
}

.notification-head,
.sync-run-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.sync-run-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.sync-journal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.sync-journal-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #ececf0;
  border-radius: 16px;
  background: #fff;
  color: #424245;
  font-size: 12px;
}

.sync-journal-item.has-error {
  border-color: rgba(255, 59, 48, 0.18);
  background: #fff7f7;
}

.sync-journal-item em {
  color: var(--danger);
  font-style: normal;
}

.analytics-card h4 {
  margin-bottom: 14px;
  font-size: 15px;
}

.analytics-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 240px;
}

.analytics-chart-wide {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #ededf2;
}

.analytics-bar-item {
  display: grid;
  grid-template-rows: 170px auto auto;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.analytics-bar-track {
  display: flex;
  align-items: end;
  overflow: hidden;
  min-height: 170px;
  border-radius: 18px 18px 4px 4px;
  background: linear-gradient(180deg, #f4f4f7, #ececf2);
}

.analytics-bar-track span {
  display: block;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, #9d6cff, #7b4fe0);
}

.analytics-bar-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
}

.analytics-bar-item small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-period {
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 12px;
}

.analytics-ranking {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analytics-ranking li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #f7f7fa;
  color: var(--muted);
  font-size: 13px;
}

.analytics-ranking span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-ranking strong {
  flex: none;
  font-weight: 600;
}

.analytics-summary {
  padding: 18px 20px;
  border: 1px solid #ececf2;
  border-radius: 20px;
  background: #fafafd;
  color: #333842;
  line-height: 1.75;
}

.analytics-summary:empty {
  display: none;
}

.analytics-empty {
  color: var(--muted);
  font-size: 13px;
}

.analytics-total-label {
  color: #1d1d1f;
  font-size: 18px;
  font-weight: 520;
}

.analytics-total-value {
  margin-top: 14px;
  color: #1d1d1f;
  font-size: clamp(1.5rem, 3.2vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.analytics-total-note {
  margin-top: 12px;
  color: #7a7a81;
  font-size: 14px;
}

.admin-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.3fr) minmax(0, 1fr);
  gap: 22px;
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid rgba(0, 113, 227, 0.16);
  border-radius: 18px;
  background: #f5f9ff;
}

.admin-panel h2 {
  font-size: 1.3rem;
}

.pending-users {
  display: grid;
  gap: 8px;
}

.account-list {
  display: grid;
  gap: 14px;
}

.account-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.account-card-head,
.account-actions,
.tag-editor-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.account-card-head {
  margin-bottom: 14px;
}

.account-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.account-grid label,
.account-meta {
  display: grid;
  gap: 6px;
}

.account-grid label span,
.account-meta span {
  color: var(--faint);
  font-size: 12px;
}

.account-grid input,
.account-grid select {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

.danger-button {
  color: #9b1c1c;
  border-color: rgba(155, 28, 28, 0.22);
}

.tag-editor-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 130;
  width: min(520px, calc(100vw - 28px));
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -50%);
}

.tag-editor-body {
  display: grid;
  gap: 14px;
}

.tag-editor-body label {
  display: grid;
  gap: 6px;
}

.tag-editor-body label span {
  color: var(--faint);
  font-size: 12px;
}

.pending-user,
.pending-empty {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.pending-user strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  gap: 10px;
}

.stat-card {
  min-width: 100px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.stat-value {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 700;
}

.stat-label {
  color: var(--faint);
  font-size: 12px;
}

.toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.tab,
.chip,
.ghost-button,
.pagination-button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tab:hover,
.chip:hover,
.ghost-button:hover,
.pagination-button:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--border-strong);
  background: #fafafa;
}

.tab.active,
.chip.active {
  border-color: transparent;
  background: var(--ink);
  color: #fff;
}

.filter-row {
  display: grid;
  grid-template-columns: 220px 220px 220px minmax(240px, 1fr);
  gap: 10px;
  align-items: center;
}

.multi-select {
  position: relative;
  min-width: 0;
}

.multi-select summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}

.multi-select summary::-webkit-details-marker {
  display: none;
}

.multi-select summary::after {
  content: "⌄";
  margin-left: 10px;
  color: var(--faint);
  font-size: 16px;
}

.multi-select[open] summary {
  border-color: rgba(0, 113, 227, 0.45);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.multi-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: max-content;
  min-width: 100%;
  max-width: min(360px, 85vw);
  max-height: 330px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.multi-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 9px;
  color: #424245;
  font-size: 14px;
  cursor: pointer;
}

.multi-select-option:hover {
  background: #f3f6fa;
}

.multi-select-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.journal-options {
  min-width: 280px;
}

.select,
.search-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: var(--surface-soft);
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.select:focus,
.search-input:focus {
  border-color: rgba(0, 113, 227, 0.45);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

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

.library-batch-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fafafd;
}

.library-batch-meta,
.library-batch-actions,
.card-topline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.library-batch-meta {
  color: var(--muted);
  font-size: 13px;
}

.library-batch-meta strong {
  color: var(--ink);
}

.results-meta {
  color: var(--muted);
  font-size: 14px;
}

.results-meta strong {
  color: var(--ink);
}

.results-separator {
  margin: 0 7px;
  color: #d2d2d7;
}

.compact-select {
  width: 170px;
}

.content-grid,
.list-column {
  min-width: 0;
}

.article-list {
  display: grid;
  gap: 10px;
}

.article-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: none;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.article-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: var(--shadow-sm);
}

.article-card.active {
  border-color: rgba(0, 113, 227, 0.4);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.08);
}

.article-body {
  padding: 20px 22px;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.journal-badge {
  padding: 5px 9px;
  background: var(--accent-soft);
  color: #005bb5;
}

.reading-badge {
  padding: 5px 9px;
  background: var(--warm-soft);
  color: var(--warm);
}

.outline-badge {
  padding: 5px 9px;
  background: #f2f2f4;
  color: var(--muted);
}

.article-title {
  margin-bottom: 8px;
  font-size: clamp(1.18rem, 1.8vw, 1.42rem);
}

.article-title-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}

.article-title-button:hover {
  color: var(--accent);
}

.article-authors {
  margin: 0 0 9px;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.5;
}

.abstract-preview {
  margin: 0 0 12px;
  font-size: 14px;
}

.card-meta {
  font-size: 12px;
}

.tag-row {
  margin-top: 12px;
}

.search-hit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  padding: 5px 9px;
  background: #f2f2f4;
  color: var(--muted);
}

mark {
  padding: 0 2px;
  border-radius: 4px;
  background: #fff2b8;
  color: inherit;
}

.saved-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.saved-tag-pill {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(0, 113, 227, 0.18);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.saved-tag-pill:hover {
  border-color: rgba(0, 113, 227, 0.32);
  background: #dcebff;
}

.library-select-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.library-select-toggle input {
  margin: 0;
}

.ghost-button {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 12px;
}

.ghost-button.saved {
  border-color: rgba(0, 113, 227, 0.18);
  background: var(--accent-soft);
  color: var(--accent);
}

.generate-button {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.generate-button:hover {
  background: var(--accent-hover);
  color: #fff;
}

.danger-button {
  border-color: rgba(255, 59, 48, 0.16);
  background: #fff5f5;
  color: var(--danger);
}

.danger-button:hover {
  border-color: rgba(255, 59, 48, 0.28);
  background: #ffeceb;
  color: #b42318;
}

.generate-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 22px 0 4px;
}

.pagination-button {
  min-width: 84px;
}

.pagination-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.pagination-status {
  min-width: 100px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.side-column {
  display: grid;
  align-content: start;
  gap: 18px;
}

.side-card {
  padding: 22px;
}

.side-card h3 {
  margin-bottom: 14px;
}

.interest-stack {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.interest-card {
  padding: 13px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.interest-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.profile-line {
  margin: 0 0 6px;
  font-size: 14px;
}

.plain-list,
.detail-list {
  margin: 0;
  padding-left: 18px;
}

.plain-list li,
.detail-list li {
  margin-bottom: 8px;
}

.empty-state {
  padding: 40px 24px;
  border-radius: 18px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  border: 0;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(3px);
  opacity: 0;
  cursor: default;
  transition: opacity 220ms ease;
}

body.detail-open .detail-backdrop {
  opacity: 1;
}

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: min(680px, 52vw);
  min-width: 520px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 34px 48px;
  border-left: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-drawer);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), visibility 260ms;
}

.detail-panel[data-detail-state="open"] {
  transform: translateX(0);
  visibility: visible;
}

.detail-topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
  margin: 0 -4px 30px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(18px);
}

.detail-page-tag {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.detail-page-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 12px;
}

.detail-close-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ededf0;
  color: #515154;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.detail-close-button:hover {
  background: #e2e2e5;
  color: var(--ink);
}

.detail-header {
  display: grid;
  gap: 13px;
}

.detail-header h3 {
  font-size: clamp(1.65rem, 2.7vw, 2.35rem);
  line-height: 1.16;
}

.detail-header .abstract-preview {
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--surface-soft);
  color: #424245;
  font-size: 15px;
  line-height: 1.72;
}

.detail-actions {
  margin: 4px 0;
}

.detail-error-message {
  margin: 2px 0 8px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 59, 48, 0.18);
  border-radius: 14px;
  background: #fff0ef;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.55;
}

.original-entry-panel {
  margin-top: 6px;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.original-entry-panel .detail-kicker {
  margin-bottom: 8px;
}

.score-line,
.match-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.detail-body {
  display: grid;
  gap: 20px;
  margin-top: 26px;
}

.detail-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.summary-tile,
.guide-placeholder {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.summary-tile h4,
.guide-placeholder h4 {
  margin-bottom: 8px;
}

.summary-tile p,
.guide-placeholder p {
  margin: 0;
}

.detail-block {
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.detail-block p {
  margin: 0 0 12px;
}

.similar-article-list {
  display: grid;
  gap: 10px;
}

.similar-article-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.similar-article-item strong {
  font-size: 13px;
  line-height: 1.5;
}

.similar-article-item span {
  color: var(--muted);
  font-size: 12px;
}

.entry-links {
  margin-top: 12px;
}

.entry-link {
  min-height: 36px;
  padding: 7px 13px;
  font-size: 13px;
}

.muted-link {
  border: 1px solid var(--border);
  background: #f2f2f4;
  color: var(--faint);
  cursor: default;
}

.muted-link:hover {
  background: #f2f2f4;
}

.detail-empty {
  padding-top: 40px;
}

@media (max-width: 1180px) {
  .filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-input {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  body {
    padding: 12px 12px 32px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .digest-card {
    min-height: auto;
  }

  .hero-copy {
    padding: 38px 28px;
  }

  .panel-head {
    display: grid;
  }

  .header-side {
    width: 100%;
    justify-items: stretch;
  }

  .session-bar {
    justify-content: space-between;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-panel {
    width: min(680px, 88vw);
    min-width: 0;
  }

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

@media (max-width: 680px) {
  .auth-shell {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .auth-brand {
    padding: 30px 4px 10px;
  }

  .auth-brand h1 {
    max-width: 18ch;
    font-size: 2.1rem;
  }

  .auth-card {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .hero-copy,
  .digest-card,
  .panel {
    border-radius: 20px;
  }

  .hero-copy,
  .digest-card,
  .panel {
    padding: 24px 20px;
  }

  h1 {
    font-size: 2.45rem;
  }

  .dashboard-title {
    font-size: 1.7rem;
  }

  .hero-micro-grid,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .admin-panel {
    grid-template-columns: 1fr;
  }

  .analytics-panel {
    inset: 14px;
    padding: 0 14px 22px;
    overflow-x: hidden;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-content,
  .analytics-section,
  .analytics-card,
  .notification-card,
  .sync-run-card,
  .account-card {
    min-width: 0;
  }

  .analytics-hero-head,
  .analytics-section-head,
  .notification-head,
  .sync-run-head,
  .account-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .analytics-hero-head h3,
  .analytics-section-head h3 {
    font-size: 1.22rem;
  }

  .analytics-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .analytics-select-pill,
  .analytics-date-pill {
    width: 100%;
    justify-content: space-between;
    min-width: 0;
    min-height: 48px;
    padding-inline: 14px;
  }

  .analytics-select-pill select,
  .analytics-date-pill input {
    min-width: 0;
    width: 100%;
    font-size: 14px;
  }

  .analytics-date-pill {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding-block: 10px;
    border-radius: 24px;
  }

  .analytics-date-pill span {
    font-size: 14px;
  }

  .analytics-card,
  .analytics-card-hero,
  .notification-card,
  .sync-run-card,
  .account-card {
    padding: 16px 14px;
    border-radius: 20px;
  }

  .analytics-total-label {
    font-size: 15px;
  }

  .analytics-total-value {
    margin-top: 10px;
    font-size: clamp(1.2rem, 6vw, 1.9rem);
  }

  .analytics-total-note,
  .analytics-summary,
  .analytics-empty {
    font-size: 12px;
  }

  .analytics-chart {
    grid-template-columns: repeat(auto-fit, minmax(22px, 1fr));
    gap: 6px;
    min-height: 180px;
  }

  .analytics-bar-item {
    grid-template-rows: 122px auto auto;
    gap: 5px;
    font-size: 10px;
  }

  .analytics-bar-track {
    min-height: 122px;
    border-radius: 14px 14px 4px 4px;
  }

  .analytics-bar-item strong,
  .analytics-bar-item small {
    font-size: 10px;
  }

  .analytics-ranking li {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
  }

  .analytics-ranking span,
  .analytics-ranking strong {
    white-space: normal;
    word-break: break-word;
  }

  .sync-run-metrics {
    gap: 8px;
    font-size: 11px;
  }

  .sync-journal-grid {
    grid-template-columns: 1fr;
  }

  .sync-journal-item {
    font-size: 11px;
  }

  .pending-user {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-grid,
  .account-actions,
  .tag-editor-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .search-input {
    grid-column: auto;
  }

  .results-row {
    align-items: stretch;
    flex-direction: column;
  }

  .library-batch-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-select {
    width: 100%;
  }

  .article-body {
    padding: 18px;
  }

  .card-topline {
    align-items: flex-start;
  }

  .detail-panel {
    width: 100%;
    padding: 0 20px 40px;
    border-left: 0;
  }

  .detail-topbar {
    margin-bottom: 22px;
  }

  .pagination {
    gap: 8px;
  }

  .pagination-button {
    min-width: 74px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
