:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4f7;
  --text: #17202a;
  --muted: #65717f;
  --line: #d9e1e8;
  --blue: #2563eb;
  --blue-dark: #1746ad;
  --green: #0f8b6f;
  --red: #d14343;
  --yellow: #e8aa16;
  --shadow: 0 14px 40px rgba(23, 32, 42, 0.08);
  --header-bg: rgba(255, 255, 255, 0.94);
  --affiliate-bg: #f7fbff;
  --affiliate-border: #cddfed;
  --affiliate-text: #3c4a57;
  --summary-bg: #f3f7fc;
  --summary-text: #334155;
  --ad-bg-a: #f8fafc;
  --ad-bg-b: #eef4f7;
  --badge-bg: #26313d;
  --saved-bg: #fff8df;
  --control-active: #17202a;
  --control-active-text: #ffffff;
  --link-bg: #2563eb;
  --link-text: #ffffff;
  --link-bg-hover: #1746ad;
  --radius: 8px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f141b;
  --surface: #151c25;
  --surface-soft: #1e2835;
  --text: #eef3f8;
  --muted: #a9b4c1;
  --line: #2d3948;
  --blue: #78a8ff;
  --blue-dark: #4d86ed;
  --green: #42b998;
  --red: #ff7979;
  --yellow: #f5c64d;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  --header-bg: rgba(15, 20, 27, 0.94);
  --affiliate-bg: #121e2b;
  --affiliate-border: #284764;
  --affiliate-text: #c8d5e2;
  --summary-bg: #1a2635;
  --summary-text: #d9e4ef;
  --ad-bg-a: #121922;
  --ad-bg-b: #172231;
  --badge-bg: #dbe8f7;
  --saved-bg: #342b10;
  --control-active: #dbe8f7;
  --control-active-text: #10151d;
  --link-bg: #78a8ff;
  --link-text: #10151d;
  --link-bg-hover: #9abbff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Segoe UI",
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    Meiryo,
    sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-grid;
  align-items: start;
  gap: 3px;
  min-width: 142px;
  line-height: 1;
}

.brand-logo-wrap {
  display: block;
  line-height: 0;
}

.brand-logo {
  display: block;
  width: auto;
  height: 34px;
  max-width: 148px;
  object-fit: contain;
}

.brand-logo-dark {
  display: none;
}

html[data-theme="dark"] .brand-logo-light {
  display: none;
}

html[data-theme="dark"] .brand-logo-dark {
  display: block;
}

.brand-subcopy {
  display: block;
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.global-search,
.large-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.global-search {
  height: 44px;
  padding: 0 14px;
}

.global-search svg,
.large-search svg,
.ghost-button svg,
.primary-button svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.global-search input,
.large-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.header-actions a,
.theme-toggle {
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.header-actions a:hover,
.theme-toggle:hover {
  background: var(--surface-soft);
  color: var(--text);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 18px;
  min-height: 320px;
}

.overview-feed {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 320px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.rss-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.rss-heading h1 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
}

.rss-heading span {
  flex: none;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.today-news-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 348px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.today-news-list li {
  min-width: 0;
}

.today-news-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.today-news-button:hover {
  border-color: var(--blue);
}

.today-news-button span,
.today-news-button strong,
.today-news-button small {
  display: block;
  min-width: 0;
}

.today-news-button strong {
  overflow: hidden;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-news-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.today-news-button svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--blue);
}

.overview-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 320px;
  padding: clamp(22px, 4vw, 48px);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(15, 139, 111, 0.86)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1200&q=80");
  background-size: cover;
  background-position: center;
  color: #fff;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: currentColor;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.82;
}

.overview h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.15rem, 4.9vw, 3.7rem);
  line-height: 1.05;
}

.overview .rss-heading h1 {
  max-width: none;
  font-size: 1.2rem;
  line-height: 1.28;
}

.nowrap {
  white-space: nowrap;
}

.overview-copy p:last-child {
  max-width: 640px;
  margin: 18px 0 0;
  line-height: 1.8;
  opacity: 0.9;
}

.search-panel {
  align-self: stretch;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-panel-title,
.section-heading,
.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.search-panel-title {
  margin-bottom: 22px;
  font-weight: 800;
}

.search-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.large-search {
  min-height: 58px;
  padding: 8px 8px 8px 14px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 700;
  white-space: nowrap;
}

.primary-button {
  padding: 0 16px;
  background: var(--blue);
  color: #fff;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.ghost-button {
  padding: 0 12px;
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.ghost-button:hover {
  border-color: var(--blue);
}

.trend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.trend-list button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface-soft);
  color: var(--text);
}

.trend-list button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.overview-calendar {
  align-self: stretch;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.overview-calendar .side-heading {
  margin-bottom: 0;
}

.overview-calendar .calendar-news {
  min-height: 32px;
  max-height: none;
  overflow: visible;
  padding-top: 8px;
  padding-right: 0;
}

.toolbar,
.article-meta,
.source-line,
.memo-list,
.ranking-list p {
  color: var(--muted);
}

.affiliate-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--affiliate-border);
  border-radius: var(--radius);
  background: var(--affiliate-bg);
  color: var(--affiliate-text);
  font-size: 0.88rem;
  line-height: 1.65;
}

.affiliate-notice svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 0.25em;
  color: var(--blue);
}

.affiliate-notice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 0.9rem;
}

.affiliate-notice p {
  margin: 0;
}

.affiliate-notice a {
  display: inline-flex;
  margin-top: 6px;
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 700;
}

.ad-slot {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 116px;
  padding: 16px;
  border: 1px dashed #b7c7d6;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(
      -45deg,
      var(--ad-bg-a),
      var(--ad-bg-a) 10px,
      var(--ad-bg-b) 10px,
      var(--ad-bg-b) 20px
    );
  color: var(--muted);
  text-align: center;
}

.ad-slot span,
.ad-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--surface);
  font-size: 0.72rem;
  font-weight: 800;
}

.ad-slot strong {
  color: var(--text);
  font-size: 1rem;
}

.ad-slot small {
  font-size: 0.78rem;
}

.banner-ad {
  margin: 0 0 28px;
  min-height: 96px;
}

.category-band {
  margin-bottom: 28px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2,
.side-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}

.section-heading.compact {
  align-items: end;
}

.feed-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

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

.category-card {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.category-card span,
.category-card strong {
  display: block;
}

.category-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.category-card strong {
  margin-top: 8px;
  font-size: 1.45rem;
}

.category-card.active,
.category-card:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.content-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.saved-control,
.sort-control,
.rank-tabs {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.saved-control {
  gap: 4px;
}

.saved-view-button,
.saved-reset-button,
.sort-button,
.rank-tab {
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.saved-view-button,
.saved-reset-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.saved-view-button svg {
  width: 16px;
  height: 16px;
}

.sort-button.active,
.rank-tab.active,
.saved-view-button.active {
  background: var(--control-active);
  color: var(--control-active-text);
}

.saved-reset-button {
  color: var(--red);
}

.saved-reset-button:hover:not(:disabled) {
  background: var(--surface-soft);
}

.saved-reset-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

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

.inline-ad {
  min-height: 100px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pagination-top {
  justify-content: space-between;
  margin-top: 0;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.pagination[hidden] {
  display: none;
}

.pagination-pages {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pagination-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 40px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.pagination-button svg {
  width: 16px;
  height: 16px;
}

.pagination-button:hover:not(:disabled),
.pagination-button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.pagination-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.pagination-gap {
  color: var(--muted);
  font-weight: 700;
}

.article-card {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(23, 32, 42, 0.05);
  cursor: pointer;
}

.article-card:hover,
.article-card:focus-visible {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 12px 30px rgba(23, 32, 42, 0.08);
  outline: none;
}

.thumb {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  border-radius: var(--radius);
  background: #dbe7f1;
}

.thumb img {
  width: 100%;
  height: 100%;
  min-height: 142px;
  object-fit: cover;
  display: block;
}

.thumb-category {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(23, 32, 42, 0.74);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
}

.thumb-credit {
  position: absolute;
  right: 8px;
  bottom: 8px;
  max-width: calc(100% - 96px);
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(23, 32, 42, 0.68);
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thumb-credit:hover,
.thumb-credit:focus-visible {
  background: rgba(23, 32, 42, 0.86);
  outline: none;
}

.article-body {
  min-width: 0;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.78rem;
}

.comment-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.comment-chip svg {
  width: 13px;
  height: 13px;
}

.article-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.45;
}

.article-summary {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  background: var(--summary-bg);
  color: var(--summary-text);
  font-weight: 650;
  line-height: 1.7;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.tag-chip:hover,
.tag-chip:focus-visible,
.tag-chip.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--link-bg);
  color: var(--link-text);
  outline: none;
}

.point-list {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.point-list li {
  display: flex;
  gap: 8px;
  line-height: 1.55;
}

.point-list li::before {
  content: "";
  flex: 0 0 7px;
  height: 7px;
  margin-top: 0.55em;
  border-radius: 50%;
  background: var(--green);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.source-line {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: max-content;
}

.save-button,
.detail-button,
.source-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.detail-button,
.source-button {
  background: var(--surface-soft);
}

.source-button {
  color: var(--blue);
}

.save-button svg,
.detail-button svg,
.source-button svg {
  width: 16px;
  height: 16px;
}

.save-button.saved {
  border-color: var(--yellow);
  background: var(--saved-bg);
}

.sidebar {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 16px;
}

.side-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.affiliate-products {
  display: grid;
  gap: 12px;
}

.product-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.product-link:hover {
  border-color: var(--blue);
}

.product-link span,
.product-link strong,
.product-link small {
  display: block;
}

.product-link strong {
  line-height: 1.4;
}

.product-link small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.product-link svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--blue);
}

.side-heading {
  margin-bottom: 12px;
}

.side-heading h2 {
  font-size: 1.05rem;
}

#ranking .side-heading {
  align-items: stretch;
  flex-direction: column;
}

#ranking .rank-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
}

#ranking .rank-tab {
  padding-inline: 8px;
}

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

.ranking-list li {
  min-width: 0;
}

.ranking-item-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.ranking-item-button:hover strong,
.ranking-item-button:focus-visible strong {
  color: var(--blue);
}

.ranking-item-button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.ranking-rank {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-bottom: 5px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 800;
}

.ranking-list strong {
  display: block;
  line-height: 1.45;
}

.ranking-list p {
  margin: 3px 0 0;
  font-size: 0.8rem;
}

.ranking-empty {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

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

.recent-comment-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.recent-comment-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.recent-comment-item:hover,
.recent-comment-item:focus-visible {
  border-color: rgba(37, 99, 235, 0.45);
  outline: none;
}

.recent-comment-item strong {
  overflow: hidden;
  font-size: 0.84rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-comment-item span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.recent-comment-item p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.calendar-section {
  display: grid;
  gap: 12px;
}

.calendar-heading {
  display: grid;
  gap: 10px;
}

.calendar-controls {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
}

.calendar-controls strong {
  text-align: center;
  font-size: 0.95rem;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.icon-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekday,
.calendar-day,
.calendar-blank {
  min-width: 0;
  min-height: 34px;
}

.calendar-weekday {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.calendar-day {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.calendar-day.has-news {
  border-color: rgba(37, 99, 235, 0.42);
  background: rgba(37, 99, 235, 0.08);
}

.calendar-day.active {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.calendar-count {
  position: absolute;
  right: 3px;
  bottom: 2px;
  font-size: 0.58rem;
  line-height: 1;
}

.calendar-news {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.calendar-news p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.calendar-news ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.calendar-news li {
  border-radius: 6px;
  background: var(--surface-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.calendar-news-button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.calendar-news-button:hover {
  color: var(--blue);
}

.calendar-news-button small {
  color: var(--muted);
  font-size: 0.74rem;
}

.article-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(780px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(23, 32, 42, 0.34);
  overflow-x: hidden;
}

.article-dialog.comments-open {
  width: min(1120px, calc(100% - 28px));
}

.article-dialog::backdrop {
  background: rgba(7, 12, 18, 0.62);
  backdrop-filter: blur(3px);
}

:root[data-theme="dark"] .article-dialog {
  border-color: rgba(120, 168, 255, 0.26);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.78),
    0 0 0 1px rgba(120, 168, 255, 0.12);
}

:root[data-theme="dark"] .article-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.dialog-shell {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 22px;
}

.dialog-shell.comments-open {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  align-items: start;
  gap: 18px;
}

.dialog-shell.comments-open > :not(.comment-block) {
  grid-column: 1;
}

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

.dialog-heading span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 700;
}

.article-dialog h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.dialog-meta,
.dialog-summary {
  margin: 0;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.dialog-summary {
  padding: 12px 14px;
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  background: var(--summary-bg);
  color: var(--summary-text);
  font-weight: 700;
}

.dialog-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.dialog-points {
  display: block;
  margin: 0;
  padding: 0;
}

.dialog-points[hidden] {
  display: none;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.primary-link,
.comment-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--link-bg);
  color: var(--link-text);
  font-weight: 700;
}

.primary-link:hover,
.comment-toggle:hover {
  background: var(--link-bg-hover);
}

.comment-toggle {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.comment-toggle:hover,
.comment-toggle.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--link-bg);
  color: var(--link-text);
}

.comment-toggle svg {
  width: 16px;
  height: 16px;
}

.comment-block {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.comment-block[hidden] {
  display: none;
}

.dialog-shell.comments-open .comment-block {
  grid-column: 2;
  grid-row: 1 / span 8;
  max-height: calc(100vh - 84px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.dialog-shell.comments-open .comment-item {
  background: var(--surface);
}

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

.comment-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.comment-heading span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.comment-form {
  display: grid;
  gap: 10px;
}

.comment-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.comment-form input {
  min-height: 38px;
  padding: 0 10px;
}

.comment-form textarea {
  min-height: 98px;
  resize: vertical;
  padding: 10px;
  line-height: 1.65;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(37, 99, 235, 0.18);
}

.comment-submit {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--control-active);
  color: var(--control-active-text);
  font-weight: 800;
}

.comment-submit svg {
  width: 16px;
  height: 16px;
}

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

.comment-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.comment-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.comment-item.is-reply {
  margin-left: calc(var(--reply-depth, 1) * 18px);
  border-left: 3px solid var(--blue);
  background: var(--surface);
}

.comment-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.comment-item-meta {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.comment-anchor {
  color: var(--blue);
  font-weight: 800;
}

.comment-item-header strong {
  color: var(--text);
}

.comment-reply-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.comment-item p {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.comment-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.comment-reply {
  justify-self: start;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
}

.comment-reaction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.comment-reaction svg {
  width: 14px;
  height: 14px;
}

.comment-reaction b {
  color: var(--text);
  font-size: 0.74rem;
}

.comment-reaction.active {
  border-color: var(--blue);
  background: var(--control-bg);
  color: var(--blue);
}

.related-block {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.related-block h3 {
  margin: 0;
  font-size: 1rem;
}

#related-list {
  display: block;
}

.related-empty {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.related-timeline {
  position: relative;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-timeline::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 15px;
  width: 2px;
  background: var(--line);
}

.related-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.related-timeline-item.current .timeline-marker {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.related-timeline-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.related-timeline-item.current .related-timeline-card {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.related-timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.related-timeline-meta span:first-child {
  color: var(--blue);
}

.related-timeline-card strong {
  line-height: 1.45;
}

.related-timeline-card p {
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.55;
}

.related-timeline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.related-timeline-actions small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-timeline-actions a {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--link-bg);
  color: var(--link-text);
  font-weight: 700;
  white-space: nowrap;
}

.related-timeline-actions a:hover {
  background: var(--link-bg-hover);
}

.template-box {
  display: grid;
  gap: 8px;
}

.template-box p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--surface-soft);
}

.memo-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  line-height: 1.6;
}

.empty-state {
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.legal-header {
  grid-template-columns: auto;
}

.legal-page {
  width: min(100% - 32px, 860px);
}

.legal-document {
  display: grid;
  gap: 18px;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-document h1,
.legal-document h2,
.legal-document p,
.legal-document ul {
  margin: 0;
}

.legal-document h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
}

.legal-document h2 {
  margin-top: 8px;
  font-size: 1.1rem;
}

.legal-document p {
  color: var(--summary-text);
  line-height: 1.8;
}

.legal-document a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-document ul {
  display: grid;
  gap: 8px;
  padding-left: 20px;
  color: var(--summary-text);
  line-height: 1.75;
}

.legal-updated {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.site-footer {
  padding: 28px 16px 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 0 0 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 8px 18px;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

.footer-links a {
  color: var(--text);
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--blue);
}

@media (max-width: 980px) {
  .article-dialog.comments-open {
    width: min(760px, calc(100% - 28px));
  }

  .dialog-shell.comments-open {
    grid-template-columns: 1fr;
  }

  .dialog-shell.comments-open .comment-block {
    grid-column: 1;
    grid-row: auto;
    max-height: none;
  }

  .site-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .header-actions {
    overflow-x: auto;
  }

  .overview,
  .content-shell {
    grid-template-columns: 1fr;
  }

  .overview-copy,
  .overview-feed {
    min-height: 280px;
  }

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

  .sidebar {
    position: static;
  }
}

@media (max-width: 680px) {
  main {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }

  .overview-copy,
  .overview-feed,
  .overview-calendar {
    padding: 18px;
  }

  .rss-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .rss-heading span {
    white-space: normal;
  }

  .overview h1 {
    font-size: 2.4rem;
  }

  .large-search {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .large-search input {
    min-height: 40px;
  }

  .primary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

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

  .section-heading,
  .section-heading.compact,
  .toolbar,
  .card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .source-line {
    width: 100%;
  }

  .card-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    min-width: 0;
    width: 100%;
  }

  .pagination,
  .pagination-top {
    justify-content: center;
  }

  .feed-controls,
  .saved-control,
  .sort-control,
  .rank-tabs {
    width: 100%;
  }

  .feed-controls,
  .saved-control {
    justify-content: stretch;
  }

  .saved-view-button,
  .saved-reset-button,
  .sort-button,
  .rank-tab {
    flex: 1;
  }

  .article-card {
    grid-template-columns: 1fr;
  }

  .article-dialog {
    width: min(100% - 20px, 420px);
  }

  .dialog-shell {
    padding: 18px;
  }

  .article-dialog h2 {
    font-size: 1.28rem;
  }

  .dialog-actions {
    display: grid;
  }

  .primary-link,
  .comment-toggle {
    width: 100%;
  }

  .thumb {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 430px) {
  .category-grid {
    grid-template-columns: 1fr;
  }

  .overview h1 {
    font-size: 2rem;
  }
}
