:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #2563eb;
  --primary-dark: #1e3a8a;
  --primary-soft: #eff6ff;
  --shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.site-header {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(255, 255, 255, 0) 48%),
    var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.dashboard {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 0 30px;
}

.brand-block {
  position: relative;
  padding-left: 64px;
}

.brand-mark {
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  font-size: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 780px;
  margin: 0;
  line-height: 1.18;
  letter-spacing: 0;
}

h1 span {
  display: block;
}

.title-kicker {
  margin-bottom: 4px;
  color: var(--primary-dark);
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 800;
}

.title-main {
  color: var(--text);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 900;
}

.header-description,
.section-description {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.schedule-note {
  max-width: 820px;
  margin: 8px 0 0;
  color: #7a8699;
  font-size: 13px;
  font-weight: 700;
}

.list-intro .schedule-note {
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.refresh-button,
.filter-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.refresh-button {
  min-width: 104px;
  border-radius: 8px;
  padding: 11px 16px;
}

.refresh-button:hover,
.filter-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.dashboard {
  padding: 28px 0 56px;
}

.summary-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.summary-panel > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.summary-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-panel strong {
  font-size: 22px;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: 12px 0 20px;
}

.filter-button {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 13px 14px;
}

.filter-button:last-child {
  border-right: 0;
}

.filter-button.active {
  background: var(--primary);
  color: #ffffff;
}

.status-message {
  margin: 18px 0;
  color: var(--muted);
  font-weight: 700;
}

.status-message.is-hidden,
.status-message:empty {
  display: none;
}

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

.briefing-section {
  display: grid;
  gap: 20px;
  margin-bottom: 28px;
}

.list-intro {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.archive-browser {
  display: grid;
  gap: 16px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.list-intro h2 {
  margin: 0;
  font-size: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2,
.category-briefings h2 {
  margin: 0;
  font-size: 22px;
}

.briefing-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.briefing-card,
.compact-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.briefing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-color: #cfe0ff;
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 0%, rgba(37, 99, 235, 0.18), transparent 34%),
    linear-gradient(145deg, #ffffff 0%, #f7fbff 52%, #eef5ff 100%);
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.12);
  padding: 18px;
  overflow: hidden;
}

.briefing-card::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
  content: "";
  pointer-events: none;
}

.briefing-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.briefing-card h3 {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.35;
}

.briefing-field {
  margin-top: 12px;
}

.briefing-field > span {
  display: block;
  margin-bottom: 4px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.briefing-field p {
  margin: 0;
  color: #475467;
}

.clampable {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.expanded .clampable {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.source-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  min-height: 36px;
  padding: 8px 12px;
  text-decoration: none;
}

.source-button:hover {
  background: #1d4ed8;
  text-decoration: none;
}

.source-button.secondary {
  border-color: #d0d5dd;
  background: #ffffff;
  color: var(--primary);
}

.source-button.secondary:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.briefing-card a:not(.source-button) {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 0;
}

.text-button:hover,
.briefing-card a:not(.source-button):hover {
  text-decoration: underline;
}

.rank-badge {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  color: #ffffff;
  font-weight: 900;
  position: relative;
  z-index: 1;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}

.insight-text {
  font-weight: 700;
}

.category-briefings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.category-heading {
  margin-top: 8px;
}

.category-briefings section {
  display: grid;
  gap: 12px;
  align-content: start;
}

.compact-list {
  display: grid;
  gap: 12px;
}

.compact-item {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 14px;
}

.compact-item strong {
  display: block;
  margin-bottom: 5px;
  overflow: visible;
  line-height: 1.35;
}

.compact-item span,
.muted-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.compact-field {
  flex: 1;
}

.compact-field .clampable {
  -webkit-line-clamp: 3;
}

.compact-item .card-actions {
  justify-content: flex-end;
}

.archive-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.archive-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.archive-controls select {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 10px 12px;
}

.archive-viewer {
  display: grid;
  gap: 16px;
}

.archive-summary {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 2fr;
  gap: 12px;
}

.archive-summary > div,
.archive-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.archive-summary > div {
  padding: 14px;
}

.archive-summary strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 16px;
}

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

.archive-section h3 {
  margin: 0;
  font-size: 20px;
}

.archive-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 12px;
}

.archive-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 14px;
}

.archive-card h4 {
  margin: 8px 0;
  font-size: 15px;
  line-height: 1.35;
}

.archive-card p {
  display: -webkit-box;
  overflow: hidden;
  color: #475467;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.archive-card .source-button {
  margin-top: auto;
  align-self: flex-end;
}

.archive-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.archive-category-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.archive-category-grid h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.archive-mini-list {
  display: grid;
  gap: 8px;
}

.archive-mini-list a {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.archive-mini-list a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.item-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.item-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  font-size: 24px;
}

.item-content {
  min-width: 0;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.item-meta span {
  border-radius: 999px;
  background: #f2f4f7;
  color: var(--muted);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.item-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.item-summary {
  display: -webkit-box;
  margin: 0 0 14px;
  overflow: hidden;
  color: #475467;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.item-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.item-footer a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

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

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

@media (max-width: 920px) {
  .category-briefings,
  .archive-category-grid,
  .archive-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 28px 0 24px;
  }

  .refresh-button {
    width: 100%;
  }

  .brand-block {
    padding-left: 0;
  }

  .brand-mark {
    position: static;
    margin-bottom: 14px;
  }

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

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

  .filter-button:nth-child(2) {
    border-right: 0;
  }

  .filter-button:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .briefing-grid,
  .category-briefings,
  .archive-card-grid {
    grid-template-columns: 1fr;
  }

  .compact-item {
    min-height: 220px;
  }

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

  .item-icon {
    width: 44px;
    height: 44px;
  }
}
