:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --panel: #ffffff;
  --ink: #202124;
  --muted: #666b73;
  --line: #ddd8cf;
  --accent: #0b6f6a;
  --accent-2: #a33b20;
  --soft: #e8f2ef;
  --soft-2: #f7e8dd;
  --shadow: 0 18px 45px rgba(32, 33, 36, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.topbar {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1320px;
  padding: 36px 28px 24px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 42px;
  line-height: 1.05;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

main {
  margin: 0 auto;
  max-width: 1320px;
  padding: 0 28px 44px;
}

.sync-card,
.metric,
.filters,
.paper-panel,
.groups-section,
.channel-strip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sync-card {
  min-width: 220px;
  padding: 16px 18px;
}

.sync-card span,
.metric span,
label,
.paper-meta,
.panel-head p,
.group-card p {
  color: var(--muted);
  font-size: 13px;
}

.sync-card strong,
.metric strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

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

.metric {
  padding: 18px;
}

.channel-strip {
  margin-bottom: 18px;
  padding: 18px;
}

.panel-head.compact {
  margin-bottom: 12px;
}

.channel-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.channel-card {
  align-items: center;
  background: #fbfaf7;
  border: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  min-height: 54px;
  text-align: left;
}

.channel-card span {
  font-size: 13px;
  font-weight: 800;
}

.channel-card strong {
  color: var(--accent);
  font-size: 18px;
}

.channel-card.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.channel-card.active strong {
  color: white;
}

.workspace {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 290px minmax(0, 1fr);
}

.filters {
  display: grid;
  gap: 16px;
  padding: 18px;
  position: sticky;
  top: 16px;
}

label {
  display: grid;
  font-weight: 700;
  gap: 7px;
}

input,
select {
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
  width: 100%;
}

.sort-group {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  min-height: 40px;
  padding: 0 14px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.chip {
  background: #eee8dc;
  color: var(--ink);
}

.chip.active,
.primary {
  background: var(--accent);
  color: white;
}

.secondary {
  background: var(--soft);
  color: var(--accent);
  font-weight: 700;
}

.paper-panel,
.groups-section {
  padding: 18px;
}

.panel-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

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

.pagination {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 16px;
}

.pagination span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.paper-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.paper-title {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}

.paper-title:hover {
  color: var(--accent);
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: var(--soft);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.tag.warn {
  background: var(--soft-2);
  color: var(--accent-2);
}

.tag.channel {
  background: #edf0f7;
  color: #33508a;
}

.paper-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.paper-actions a {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.groups-section {
  margin-top: 18px;
}

.group-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.group-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.group-card h3 {
  font-size: 16px;
  margin: 0;
}

.group-card a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

@media (max-width: 900px) {
  .topbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-grid,
  .workspace,
  .group-list,
  .channel-list {
    grid-template-columns: 1fr;
  }

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

  .filters {
    position: static;
  }

  h1 {
    font-size: 34px;
  }
}
