:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --panel: #ffffff;
  --ink: #1f2723;
  --muted: #69746e;
  --line: #d9dfd7;
  --accent: #126b59;
  --accent-2: #8a4d1f;
  --soft: #e9f2ee;
  --warn: #fff3d8;
  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);
}

a {
  color: inherit;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.brand {
  display: grid;
  gap: 4px;
}

.brand h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

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

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

.button,
button,
select {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 6px;
  padding: 8px 12px;
  font: inherit;
}

input {
  width: min(420px, 100%);
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 6px;
  padding: 8px 12px;
  font: inherit;
}

button,
.button {
  cursor: pointer;
  text-decoration: none;
}

button.primary,
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metric strong {
  display: block;
  font-size: 24px;
}

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

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

.paper {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.paper h2 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.title-ja {
  color: #3d4b44;
  font-size: 14px;
  line-height: 1.5;
  margin: -2px 0 10px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  background: #f8faf8;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 12px;
  color: #314039;
}

.tag.review {
  background: #eef0ff;
  border-color: #cfd4ff;
}

.tag.original {
  background: var(--soft);
  border-color: #c8dfd6;
}

.tag.ubiquinol {
  background: var(--warn);
  border-color: #e8d19b;
}

.paper-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.detail h2 {
  margin-top: 0;
}

.abstract {
  line-height: 1.65;
  color: #26332d;
  white-space: pre-wrap;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

.admin-controls {
  display: grid;
  gap: 10px;
  min-width: 320px;
}

.choice-block {
  display: grid;
  gap: 5px;
}

.choice-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.choice {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
  background: #f8faf8;
  white-space: normal;
}

.choice.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.notice {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

@media (max-width: 760px) {
  .topbar,
  .admin-row {
    display: grid;
  }

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

  .admin-controls {
    min-width: 0;
  }
}
