:root {
  color-scheme: light;
  --bg: #f2f4f8;
  --card: #eef1f6;
  --primary: #123a75;
  --text: #212936;
  --muted: #657089;
  --green: #0f9b6b;
  --green-bg: #dff7ef;
  --border: #d7deea;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: #fff;
  border-bottom: 1px solid #e7eaf1;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-feather-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 6px;
}

.logo {
  color: #112b52;
  font-family: "Times New Roman", Georgia, "Palatino Linotype", serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 2rem;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
}

.ghost-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: #2c3f5f;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.ghost-btn:hover {
  border-color: #aec3e7;
}

.menu-dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(18, 58, 117, 0.1);
  z-index: 20;
  padding: 0.35rem;
}

.dropdown-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.2rem;
}

.dropdown-item-btn {
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  padding: 0.5rem 0.55rem;
  cursor: pointer;
  color: #263d63;
  font-weight: 600;
}

.dropdown-item-btn:hover {
  background: #edf3ff;
}

.hidden {
  display: none;
}

.container {
  width: min(1200px, 95%);
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
  flex: 1;
}

.title-section h1 {
  margin: 0;
  color: #142a4b;
}

.title-section p {
  margin: 0.35rem 0 1rem;
  color: var(--muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  transform: translateY(-2px);
  border-color: #a8bfe4;
  box-shadow: 0 8px 20px rgba(18, 58, 117, 0.08);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #d7deea;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: #2f4366;
}

.paper-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.paper-logo-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.status {
  color: var(--green);
  background: var(--green-bg);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.card h3 {
  margin: 0;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.94rem;
}

.action-row {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
}

.primary-btn,
.secondary-btn {
  border-radius: 9px;
  border: 1px solid var(--border);
  padding: 0.45rem 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.primary-btn:hover {
  background: #0f315f;
}

.secondary-btn {
  background: #fff;
  color: #2f4366;
}

.secondary-btn:hover {
  border-color: #aec3e7;
}

.footer {
  padding: 1rem 2rem;
  border-top: 1px solid #e0e5ef;
  background: #fff;
  color: #75809a;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  text-decoration: none;
  color: #75809a;
}

.feeds-dialog {
  border: none;
  border-radius: 12px;
  width: min(640px, 90vw);
  padding: 0;
}

.feeds-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.feeds-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #e7ebf4;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

.feeds-list {
  margin: 0;
  padding: 0.75rem 1rem 1rem;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.feed-item {
  border: 1px solid #dce4f2;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  background: #f8fafd;
}

.feed-item a {
  display: inline-flex;
  text-decoration: none;
  color: #1e4fa4;
  font-weight: 600;
  line-height: 1.35;
}

.feed-meta {
  margin-top: 0.4rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: #6a7792;
  font-size: 0.82rem;
}

.feed-loading,
.feed-error {
  color: #4e5f80;
  padding: 0.35rem 0.2rem;
}

.feed-error-detail {
  margin-top: 0.35rem;
  color: #6b7893;
  font-size: 0.82rem;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .topbar,
  .footer {
    padding: 0.9rem 1rem;
  }
}
