:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #172230;
  --muted: #55667d;
  --primary: #174ea6;
  --danger: #b3261e;
  --line: #dbe2ec;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

h1,
h2,
h3 {
  margin-top: 0;
}

p {
  line-height: 1.55;
}

.topbar {
  padding: 1.25rem 1.5rem;
  background: #0f1f35;
  color: #fff;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.site-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
}

.tagline {
  margin: 0;
  color: #d3deef;
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-actions {
  display: grid;
  gap: 0.65rem;
}

.top-nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.layout {
  padding: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
}

#requestList,
#userRoleList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#requestList li,
#userRoleList li {
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0;
}

.search-panel {
  margin: 1rem;
}

.search-panel label {
  margin-bottom: 0.35rem;
}

.search-suggestions {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
}

.search-suggestions li {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0;
}

#seeMoreResultsBtn {
  margin-top: 0.7rem;
}

button {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: #e6ebf4;
  color: #1f2f47;
}

button.danger {
  background: var(--danger);
}

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

input,
textarea {
  width: 100%;
  border: 1px solid #c4cedb;
  border-radius: 8px;
  padding: 0.55rem 0.6rem;
  font: inherit;
  margin-top: 0.35rem;
}

textarea {
  min-height: 110px;
}

label {
  display: block;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

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

.between {
  justify-content: space-between;
}

.content {
  display: grid;
  gap: 1rem;
}

.profile-details {
  display: grid;
  gap: 0.65rem;
  margin: 0.5rem 0 1rem;
}

.profile-details div {
  display: grid;
  gap: 0.2rem;
}

.profile-details dt {
  font-weight: 700;
}

.profile-details dd {
  margin: 0;
}

#articleImage {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
}

.article-inline-image {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 8px;
  margin: 0.6rem 0;
  border: 1px solid var(--line);
}

.article-item-btn {
  width: 100%;
  border: none;
  background: none;
  color: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.article-item-btn.active {
  color: var(--primary);
  font-weight: 700;
}

.top-nav button.active {
  background: var(--primary);
  color: #fff;
}

.article-search-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.article-search-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.article-directory-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-directory-list li {
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.article-link {
  color: var(--primary);
}

.citation-link {
  text-decoration: none;
  margin-left: 0.15rem;
}

.footnotes {
  margin-top: 1.2rem;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

.footnotes-list {
  padding-left: 1.25rem;
}

.footnote-item {
  margin-bottom: 0.55rem;
}

.footnote-backref {
  margin-left: 0.4rem;
}

.section-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.7rem;
}

.section-editor-actions {
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.banner {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  background: #243b5a;
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  max-width: calc(100vw - 2rem);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .topbar-actions {
    width: 100%;
  }

  .top-nav,
  .auth-controls {
    justify-content: flex-start;
  }
}
