:root {
  color-scheme: light;
  --bg: #f4efe6;
  --surface: #fffaf2;
  --ink: #10242b;
  --muted: #5f6b73;
  --accent: #0f4c5c;
  --accent-soft: rgba(15, 76, 92, 0.12);
  --border: rgba(15, 76, 92, 0.18);
  --shadow: 0 20px 44px rgba(16, 36, 43, 0.11);
  --font-body: 'Avenir Next', 'Avenir', 'Futura', 'Trebuchet MS', 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 5%, rgba(79, 121, 255, 0.12), transparent 42%),
    radial-gradient(circle at 90% 0%, rgba(188, 89, 198, 0.12), transparent 38%),
    linear-gradient(180deg, #f7f3ea 0%, #f0ece3 100%);
  color: var(--ink);
  font-family: var(--font-body);
}

.intel-page {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 18px 42px;
  display: grid;
  gap: 18px;
}

.intel-hero {
  background: var(--surface);
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow);
}

.brand img {
  width: 132px;
  max-width: 35vw;
  height: auto;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.hero-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 70ch;
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6a4a0a;
}

.intel-layout {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  height: auto;
  min-height: 0;
  overflow: visible;
}

.intel-list-card,
.intel-article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
  min-height: 0;
}

.intel-list-card {
  display: flex;
  flex-direction: column;
  height: auto;
  overflow: hidden;
}

.list-header {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 12px;
}

.list-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.list-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

select,
button {
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.93rem;
  font-weight: 600;
}

select {
  padding: 0 10px;
  min-width: 0;
  flex: 1;
  background: #fff;
  color: var(--ink);
}

button {
  cursor: pointer;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
}

button.secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

.briefings-list {
  flex: 1;
  min-height: 420px;
  max-height: min(72vh, 980px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px;
  display: grid;
  gap: 12px;
  scrollbar-gutter: stable;
}

.briefing-item {
  border: 1px solid rgba(15, 76, 92, 0.12);
  border-radius: 14px;
  background: #fff;
  padding: 14px 14px 15px;
  display: grid;
  gap: 9px;
  text-align: left;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
}

.briefing-item.is-active {
  border-color: rgba(15, 76, 92, 0.38);
  box-shadow: 0 0 0 2px rgba(15, 76, 92, 0.1);
}

.briefing-topic {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #6a4a0a;
}

.briefing-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.briefing-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.briefing-tldr {
  margin: 0;
  color: #21343b;
  font-size: 0.94rem;
  line-height: 1.45;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.briefing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  min-width: 0;
}

.intel-article-card {
  padding: 20px 24px 24px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.article-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.intel-article-card h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
}

.article-summary {
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.article-tldr-label {
  margin: 10px 0 4px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6a4a0a;
  font-weight: 700;
}

.article-tldr {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 76, 92, 0.08);
  border: 1px solid rgba(15, 76, 92, 0.16);
  color: #1c2f36;
  font-weight: 600;
  line-height: 1.45;
}

.share-tools {
  margin: 0 0 10px;
  padding: 10px 12px 12px;
  border-radius: 10px;
  border: 1px solid rgba(15, 76, 92, 0.14);
  background: rgba(255, 255, 255, 0.8);
}

.share-tools h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

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

.share-actions button,
.share-link {
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  padding: 0 12px;
  font-size: 0.88rem;
  font-weight: 600;
}

.share-actions button {
  background: var(--accent);
  color: #fff;
}

.share-actions button.secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

.share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #fff;
  color: var(--accent);
}

.share-link:hover {
  border-color: rgba(15, 76, 92, 0.32);
}

.share-status {
  margin: 8px 0 0;
  min-height: 1.2em;
  font-size: 0.82rem;
}

.article-body {
  line-height: 1.58;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-body h3 {
  margin: 18px 0 8px;
  font-size: 1.1rem;
}

.article-body p {
  margin: 0 0 12px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 14px 18px;
  padding: 0;
}

.article-body li {
  margin: 0 0 6px;
}

.sources {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.sources h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

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

.source-link {
  border: 1px solid rgba(15, 76, 92, 0.14);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
}

.source-link:hover {
  border-color: rgba(15, 76, 92, 0.28);
}

.source-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.source-meta {
  font-size: 0.8rem;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  border: 0;
  padding: 0;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 1120px) {
  .intel-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .intel-list-card {
    height: auto;
    min-height: 0;
  }

  .briefings-list {
    min-height: 320px;
    max-height: 52vh;
  }

  .intel-article-card {
    height: auto;
    min-height: 60vh;
  }
}
