:root {
  color-scheme: light dark;
}

body {
  font-family: system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 900px;
  padding: 1rem 1.25rem 4rem;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid #8884;
  margin-bottom: 1.5rem;
}

.site-header h1 {
  font-size: 1.6rem;
  margin: 0;
}

.site-header h1 a {
  text-decoration: none;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.group h2 {
  margin-bottom: 0.35rem;
}

details {
  margin: 0 0 0.75rem;
}

summary {
  cursor: pointer;
}

summary:hover {
  opacity: 0.75;
}

.feed-url {
  color: #888;
  font-size: 0.85em;
  word-break: break-all;
}

.muted {
  color: #888;
}

.errors {
  border: 1px solid #d9534f;
  border-radius: 6px;
  padding: 0 1rem;
  margin-top: 1.5rem;
}

.errors h2 {
  color: #d9534f;
}

.panel {
  border: 1px solid #8884;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.panel h3 {
  margin-top: 0;
}

.panel.narrow {
  max-width: 420px;
  margin: 2rem auto;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.panel-heading h3 {
  margin: 0;
}

.admin {
  padding-bottom: 2rem;
}

.alert {
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
}

.alert.success {
  background: #2e7d3222;
  border: 1px solid #2e7d32;
}

.alert.error {
  background: #d9534f22;
  border: 1px solid #d9534f;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  padding: 0.45rem 0.55rem;
  border: 1px solid #8888;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  max-width: 100%;
}

button {
  padding: 0.45rem 0.8rem;
  border: 1px solid #8888;
  border-radius: 5px;
  background: #8881;
  color: inherit;
  cursor: pointer;
}

button:hover {
  background: #8883;
}

button.danger {
  border-color: #d9534f;
  color: #d9534f;
}

.row-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stack-form {
  display: grid;
  gap: 0.4rem;
  max-width: 560px;
}

.stack-form button {
  justify-self: start;
  margin-top: 0.4rem;
}

.group-panel {
  margin-top: 1.5rem;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.feed-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-top: 1px solid #8883;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.feed-edit {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 560px;
  flex-wrap: wrap;
}

.feed-edit input[name="url"] {
  flex: 1 1 320px;
}

.feed-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.inline-form {
  display: inline;
  margin: 0;
}

.link-button {
  border: none;
  background: none;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover {
  background: none;
  opacity: 0.75;
}

.reader-toolbar {
  margin-bottom: 1rem;
}

.view-switch {
  display: inline-flex;
  gap: 0.25rem;
  border: 1px solid #8884;
  border-radius: 999px;
  padding: 0.2rem;
  background: #8881;
}

.view-switch a {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
}

.view-switch a.active {
  background: #8883;
  font-weight: 600;
}

.latest-view {
  display: grid;
  gap: 0.75rem;
}

.latest-item {
  border: 1px solid #8884;
  border-radius: 8px;
  padding: 0.9rem 1rem;
}

.latest-item-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: #888;
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
}

.latest-item a {
  text-decoration: none;
  font-weight: 600;
}

.latest-item a:hover {
  opacity: 0.8;
}

@media (max-width: 640px) {
  .latest-item-meta {
    flex-direction: column;
  }
}
