:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f3f4f6;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 24px;
  background: #111827;
  color: #f9fafb;
  border-right: 1px solid #1f2937;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
}

.brand p {
  margin: 8px 0 0;
  color: #9ca3af;
}

.sidebar-tools {
  margin-top: 20px;
}

.search-input,
.date-filter {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #374151;
  border-radius: 12px;
  background: #1f2937;
  color: #f9fafb;
}

.date-filter {
  margin-top: 10px;
}

.search-input::placeholder {
  color: #9ca3af;
}

.article-count {
  margin: 10px 0 0;
  font-size: 13px;
  color: #9ca3af;
}

.article-list {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}

.article-item {
  padding: 16px;
  border: 1px solid #374151;
  border-radius: 12px;
  background: #1f2937;
  cursor: pointer;
}

.article-item.active {
  border-color: #60a5fa;
  background: #1d4ed8;
}

.article-item h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.article-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #d1d5db;
}

.article-item .item-meta {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.item-pill,
.meta-pill {
  display: inline-block;
  margin: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 12px;
}

.content {
  padding: 32px;
}

.empty-state,
.article-view {
  max-width: 960px;
  margin: 0 auto;
}

.hidden {
  display: none;
}

.article-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.article-header h2 {
  margin: 8px 0 12px;
  font-size: 32px;
}

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

.badge {
  display: inline-block;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
}

.summary {
  margin: 0;
  color: #4b5563;
  line-height: 1.7;
}

.topics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.topic-chip {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
}

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

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: #111827;
  color: white;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

button:active {
  transform: scale(0.97);
}

button.is-success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #f0fdf4;
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.35);
}

button.is-error {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fef2f2;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
}

button:disabled {
  cursor: default;
  opacity: 0.92;
}

#toast-host {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25);
  transform: translateY(-16px);
  opacity: 0;
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 240ms ease;
  max-width: min(92vw, 420px);
  text-align: center;
}

.toast-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.toast-error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.article-body {
  padding: 32px;
  border-radius: 20px;
  background: white;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

.article-body h1 {
  font-size: 32px;
  line-height: 1.5;
}

.article-body p {
  font-size: 17px;
  line-height: 1.9;
  color: #1f2937;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  border-radius: 16px;
}

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

  .sidebar,
  .content {
    padding: 20px;
  }

  .article-header {
    flex-direction: column;
  }

  .article-body {
    padding: 20px;
  }

  .actions {
    width: 100%;
  }

  .actions button {
    flex: 1 1 auto;
  }

  .article-header h2 {
    font-size: 24px;
  }
}
