:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5d6675;
  --line: #d8dee7;
  --panel: #f7f9fb;
  --accent: #1f6f8b;
  --accent-dark: #15506d;
  --gold: #b88428;
  --bg: #ffffff;
}

* {
  box-sizing: border-box;
}

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

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  min-height: 100vh;
}

.filters {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.brand h1 {
  margin: 0 0 4px;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.brand p {
  margin: 0 0 22px;
  color: var(--muted);
}

label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

select,
input,
button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

select {
  padding: 7px;
}

input {
  padding: 9px 10px;
}

.checkbox-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--ink);
}

.checkbox-filter input {
  width: auto;
}

button {
  padding: 9px 11px;
  cursor: pointer;
  font-weight: 650;
}

button:hover,
a:hover {
  border-color: var(--accent);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

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

.results {
  min-width: 0;
  padding: 22px clamp(18px, 4vw, 46px);
}

.external-link-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.external-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.toolbar select {
  width: auto;
  min-width: 160px;
}

.cards {
  display: grid;
  gap: 12px;
  padding: 18px 0 40px;
}


.comment-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.meta-row,
.source-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.stock {
  font-weight: 750;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf4f7;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.type {
  background: #f6eee1;
  color: #745016;
}

.buffer-topic {
  background: #eef6e8;
  color: #416c25;
}

.model-choice-topic {
  background: #fde8e7;
  color: #9b2924;
}

.model-choice-topic.review {
  background: #fff4d6;
  color: #795713;
}

.excerpt,
.full-text {
  margin: 12px 0;
}

details {
  margin: 8px 0 12px;
}

summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 650;
}

.source-row {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pdf-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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