:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #161b22;
  --panel-alt: #1f2630;
  --border: #2e3744;
  --text: #e6edf3;
  --muted: #9da7b3;
  --accent: #2f81f7;
  --accent-soft: rgba(47, 129, 247, 0.16);
  --badge: #243041;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

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

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 8px 0 18px;
  background: linear-gradient(to bottom, rgba(13, 17, 23, 0.98), rgba(13, 17, 23, 0.92), rgba(13, 17, 23, 0));
  backdrop-filter: blur(8px);
}

.toolbar-inner {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(240px, 1fr) minmax(180px, 220px) auto;
  gap: 12px;
  align-items: center;
}

.filter-select,
.search-input,
.reset-button {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  box-shadow: var(--shadow);
}

.search-input {
  text-align: center;
  font-size: 1rem;
}

.filter-select:focus,
.search-input:focus,
.reset-button:focus,
.entry-toggle:focus,
.action-button:focus,
.image-link:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.reset-button {
  width: auto;
  min-width: 128px;
  cursor: pointer;
  font-weight: 600;
}

.entries-app {
  margin-top: 16px;
}

.entries-container {
  display: grid;
  gap: 18px;
}

.day-group {
  display: grid;
  gap: 10px;
}

.day-group-title {
  margin: 0;
  padding: 4px 2px;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.day-group-rows {
  display: grid;
  gap: 10px;
}

.entry-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(22, 27, 34, 0.95), rgba(17, 22, 29, 0.95));
  box-shadow: var(--shadow);
}

.entry-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 18px 20px;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.entry-toggle:hover {
  background: rgba(255, 255, 255, 0.02);
}

.entry-name {
  min-width: 0;
  font-size: 1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.entry-category {
  flex-shrink: 0;
  max-width: 40%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--badge);
  color: #c5d5ea;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-expanded {
  border-top: 1px solid var(--border);
  background: rgba(12, 17, 24, 0.55);
}

.entry-expanded-inner {
  padding: 18px 20px 22px;
}

.entry-meta {
  margin: 0 0 16px;
  display: grid;
  gap: 8px;
}

.entry-meta-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
}

.entry-meta-row dt {
  color: var(--muted);
  font-weight: 700;
}

.entry-meta-row dd {
  margin: 0;
}

.entry-content-block {
  margin-bottom: 18px;
}

.entry-content {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

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

.entry-section-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--muted);
}

.pill-list,
.button-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #d6e8ff;
  border: 1px solid rgba(47, 129, 247, 0.22);
  font-size: 0.88rem;
  font-weight: 600;
}

.severity-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 700;
}

.severity-info {
  background: rgba(47, 129, 247, 0.16);
  border-color: rgba(47, 129, 247, 0.28);
  color: #d6e8ff;
}

.severity-warning {
  background: rgba(219, 156, 0, 0.16);
  border-color: rgba(219, 156, 0, 0.28);
  color: #ffe3a1;
}

.severity-error {
  background: rgba(248, 81, 73, 0.16);
  border-color: rgba(248, 81, 73, 0.28);
  color: #ffc1bc;
}

.severity-critical {
  background: rgba(163, 36, 36, 0.22);
  border-color: rgba(248, 81, 73, 0.32);
  color: #ffd4d1;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 700;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.image-link {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel-alt);
}

.entry-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.empty-state {
  padding: 40px 20px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  text-align: center;
  font-size: 1rem;
}

.scroll-sentinel {
  height: 1px;
}

.loading-note {
  padding: 14px 0;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 880px) {
  .toolbar-inner {
    grid-template-columns: 1fr;
  }

  .reset-button {
    width: 100%;
  }

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

  .entry-category {
    max-width: 100%;
    text-align: center;
  }

  .entry-meta-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
