:root {
  color-scheme: light;
  --bg: #f4efe6;
  --card: #ffffff;
  --ink: #1a1510;
  --muted: #6f6458;
  --accent: #1b5d52;
  --accent-strong: #0f2f2a;
  --warm: #c08f4d;
  --danger: #9f2b2b;
  --shadow: 0 24px 60px rgba(24, 18, 12, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Sora", sans-serif;
  background: radial-gradient(circle at top left, #faf4ea, #f4efe6 50%, #eef3f1 100%);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.28;
  z-index: 0;
  animation: float 12s ease-in-out infinite;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(27, 93, 82, 0.35), transparent 70%);
  top: -120px;
  left: -120px;
}

.orb-2 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(192, 143, 77, 0.28), transparent 70%);
  top: 160px;
  right: -120px;
  animation-delay: -4s;
}

.orb-3 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(15, 47, 42, 0.28), transparent 70%);
  bottom: -80px;
  left: 20%;
  animation-delay: -7s;
}

.page {
  position: relative;
  z-index: 1;
  padding: 48px clamp(20px, 5vw, 80px) 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  animation: fadeIn 0.8s ease-out;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(26, 21, 16, 0.06);
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: var(--shadow);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-left: auto;
}

.brand img {
  height: 32px;
  display: block;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand span {
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}

.nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-links a:hover {
  color: var(--accent-strong);
}

.nav-button {
  border: 1px solid rgba(26, 21, 16, 0.12);
  border-radius: 999px;
  padding: 7px 14px;
  background: #faf7f0;
  cursor: pointer;
  font-size: 14px;
}

.is-hidden {
  display: none !important;
}

.nav-status {
  font-size: 13px;
  color: var(--accent-strong);
  background: rgba(27, 93, 82, 0.12);
  padding: 7px 14px;
  border-radius: 999px;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--accent-strong);
  margin: 0 0 12px;
}

.hero h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.02;
  margin: 0 0 14px;
  max-width: none;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  max-width: none;
}

.warning-card {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.92);
  border-left: 3px solid var(--warm);
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  font-size: 13px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #48b774;
  box-shadow: 0 0 0 6px rgba(72, 183, 116, 0.15);
}

.panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

.invite {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 24px;
  padding: 20px 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(26, 21, 16, 0.06);
}

.invite > div {
  flex: 1;
  min-width: 260px;
}

.invite h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.invite p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  max-width: none;
}

.panel-left,
.panel-right {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(26, 21, 16, 0.08);
  backdrop-filter: blur(14px);
}

.panel-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

label {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(31, 111, 139, 0.12);
  color: var(--accent-strong);
  font-size: 12px;
  margin-left: 6px;
  cursor: help;
  position: relative;
}

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  background: #1b1b1b;
  color: #f6f3ee;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease;
  z-index: 20;
}

.info-icon:hover::after,
.info-icon:focus::after {
  opacity: 1;
}

textarea {
  width: 100%;
  border: 1px solid rgba(23, 20, 16, 0.12);
  border-radius: 16px;
  padding: 16px;
  font-size: 16px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 2px rgba(23, 20, 16, 0.06);
}

textarea:focus,
input:focus,
select:focus,
button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(27, 93, 82, 0.2);
  border-color: rgba(27, 93, 82, 0.4);
}

.char-counter {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin-top: -6px;
}

.char-counter.over {
  color: var(--danger);
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

select {
  width: 100%;
  border-radius: 14px;
  padding: 10px;
  border: 1px solid rgba(26, 21, 16, 0.12);
  font-family: inherit;
  background: #fffefb;
}

.toolbox {
  border: 1px solid rgba(26, 21, 16, 0.1);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.85);
}

.toolbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toolbox-header h2 {
  margin: 0;
  font-size: 16px;
}

#toggleTools {
  background: transparent;
  border: 1px solid rgba(23, 20, 16, 0.2);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 12px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 14px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
}

.tool-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tool-group {
  margin-bottom: 16px;
}

.tool-group-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 8px;
}

.tool-category {
  margin-bottom: 0;
}

.tool-category .tool-pill {
  justify-content: space-between;
  width: 100%;
}

.tool-category.is-disabled {
  opacity: 0.55;
}

.tool-pill {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fbf8f2;
  font-size: 13px;
  border: 1px solid rgba(26, 21, 16, 0.06);
}

.toolbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-toggle {
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid rgba(26, 21, 16, 0.12);
  background: transparent;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
  cursor: pointer;
}

.tool-toggle:hover {
  background: rgba(27, 93, 82, 0.08);
}

@media (max-width: 720px) {
  .tool-groups {
    grid-template-columns: 1fr;
  }
}

.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: white;
  border: none;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 15px;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(27, 93, 82, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary.ghost {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid rgba(27, 93, 82, 0.25);
  box-shadow: none;
}

.primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 22px 38px rgba(31, 111, 139, 0.3);
}

.analysis-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(26, 21, 16, 0.08);
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--muted);
}

.analysis-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--ink);
}

.captcha-block {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(26, 21, 16, 0.08);
  box-shadow: var(--shadow);
}

.captcha-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 8px;
}

.captcha-widget {
  min-height: 70px;
}

.result-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  border: 1px solid rgba(26, 21, 16, 0.06);
  animation: cardRise 0.6s ease both;
}

.result-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.decision-bar {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: #efe8dd;
}

.decision-bar .favor {
  background: linear-gradient(120deg, #5f8f69, #8fb592);
  width: 0%;
}

.decision-bar .against {
  background: linear-gradient(120deg, #8b3d3d, #c6776a);
  width: 0%;
}

.decision-bar .impartial {
  background: linear-gradient(120deg, #b1a691, #d3c7b3);
  width: 0%;
}

.decision-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.summary {
  font-size: 15px;
  color: var(--muted);
}

.vote-list {
  display: grid;
  gap: 12px;
}

.vote-item {
  padding: 12px;
  border-radius: 14px;
  background: #faf7f0;
  border: 1px solid rgba(26, 21, 16, 0.06);
}

.vote-item h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.vote-item ul {
  margin: 6px 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.rounds {
  display: grid;
  gap: 12px;
}

.round-item {
  border: 1px solid rgba(26, 21, 16, 0.08);
  border-radius: 16px;
  padding: 8px 12px;
  background: #faf7f0;
}

.round-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
}

.round-item summary::-webkit-details-marker {
  display: none;
}

.round-votes {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.round-vote-card {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(26, 21, 16, 0.05);
}

.round-vote-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}

.round-reasons {
  margin: 0 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.sources,
.usage {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.sources a {
  color: var(--accent-strong);
  text-decoration: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.auth-grid {
  display: grid;
  gap: 10px;
  margin: 10px 0;
}

.auth-grid input {
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(26, 21, 16, 0.12);
  font-family: inherit;
  font-size: 15px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.auth-actions button {
  border: 1px solid rgba(26, 21, 16, 0.12);
  border-radius: 999px;
  padding: 8px 14px;
  background: #faf7f0;
  cursor: pointer;
}

.auth-actions .ghost {
  background: transparent;
}

.history-search {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.history-search input {
  flex: 1;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(26, 21, 16, 0.12);
  font-family: inherit;
}

.history-search button {
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(26, 21, 16, 0.12);
  background: #faf7f0;
  cursor: pointer;
}

.history {
  display: grid;
  gap: 10px;
}

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

.login-gate {
  margin-top: 8px;
  background: rgba(27, 93, 82, 0.08);
  border: 1px solid rgba(27, 93, 82, 0.16);
  padding: 10px 12px;
  border-radius: 12px;
}

.login-gate a {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
}

.run-feedback {
  margin-top: 8px;
}

.history-item {
  border: 1px solid rgba(26, 21, 16, 0.1);
  border-radius: 14px;
  padding: 12px;
  background: rgba(251, 248, 242, 0.6);
  font-size: 14px;
}

.history-card {
  border: 1px solid rgba(26, 21, 16, 0.1);
  border-radius: 18px;
  padding: 16px;
  background: rgba(251, 248, 242, 0.72);
  display: grid;
  gap: 14px;
  box-shadow: 0 10px 24px rgba(26, 21, 16, 0.06);
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.history-card-meta h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.history-card-date {
  font-size: 12px;
  color: var(--muted);
}

.history-donut {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: conic-gradient(
    #5f8f69 0 calc(var(--favor) * 1%),
    #b1a691 calc(var(--favor) * 1%) calc((var(--favor) + var(--impartial)) * 1%),
    #8b3d3d calc((var(--favor) + var(--impartial)) * 1%) 100%
  );
  display: grid;
  place-items: center;
  position: relative;
}

.history-donut::after {
  content: "";
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fdfbf7;
  position: absolute;
}

.history-donut-label {
  position: relative;
  font-size: 11px;
  color: var(--ink);
  text-align: center;
  z-index: 1;
}

.history-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.active-claim {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin: 6px 0 0;
}

.status-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 6px;
  border: 2px solid rgba(26, 21, 16, 0.35);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -1px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.history-card-cell {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(26, 21, 16, 0.08);
  display: grid;
  gap: 4px;
}

.history-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.history-card-value {
  font-size: 13px;
  color: var(--ink);
}

.history-summary {
  display: grid;
  gap: 8px;
}

.history-summary-text {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.history-summary-toggle {
  width: fit-content;
  border: 1px solid rgba(26, 21, 16, 0.15);
  background: transparent;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.history-rounds {
  border-top: 1px solid rgba(26, 21, 16, 0.08);
  padding-top: 10px;
}

.history-rounds summary,
.history-round summary,
.history-vote summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--accent-strong);
}

.history-round {
  margin-top: 8px;
  border: 1px solid rgba(26, 21, 16, 0.08);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.8);
}

.history-votes {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.history-vote {
  border: 1px dashed rgba(26, 21, 16, 0.12);
  border-radius: 10px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.9);
}

.history-reasons {
  margin: 6px 0 0 18px;
  font-size: 12px;
  color: var(--muted);
}

.footer {
  margin: 40px auto 0;
  max-width: 900px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 0 20px 30px;
}

.footer-links {
  margin-top: 10px;
}

.footer-links a {
  color: var(--accent-strong);
  text-decoration: none;
  font-size: 13px;
}

.history-panel {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(26, 21, 16, 0.08);
  backdrop-filter: blur(14px);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.history-header h2 {
  margin: 0;
  font-size: 18px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

.blog-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(26, 21, 16, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 32px rgba(26, 21, 16, 0.12);
}

.blog-card h2 {
  margin: 0;
  font-size: 18px;
}

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

.blog-images {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 12px 0 18px;
}

.blog-images img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(26, 21, 16, 0.08);
}

.blog-grid .blog-images {
  grid-template-columns: 1fr;
}

.blog-post h2 {
  margin: 22px 0 10px;
  font-size: 20px;
}

.blog-post p {
  margin: 0 0 14px;
  line-height: 1.65;
}

.blog-figure {
  margin: 18px 0;
}

.blog-figure img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(26, 21, 16, 0.08);
  background: #faf7f0;
}

.blog-figure figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.tool-groups {
  margin-top: 10px;
}

.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-login {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  padding: 28px;
  border: 1px solid rgba(26, 21, 16, 0.08);
  box-shadow: var(--shadow);
  max-width: 560px;
  margin: 0 auto;
  align-self: center;
}

.admin-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.admin-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.admin-controls input {
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(26, 21, 16, 0.12);
  font-family: inherit;
}

.admin-controls select {
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(26, 21, 16, 0.12);
  font-family: inherit;
  background: #fff;
}

.admin-controls button {
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid rgba(26, 21, 16, 0.12);
  background: #faf7f0;
  cursor: pointer;
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.admin-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(26, 21, 16, 0.08);
  box-shadow: var(--shadow);
}

.admin-card p {
  margin: 8px 0 0;
  font-size: 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.admin-grid-wide {
  grid-template-columns: 1fr;
}

.admin-section {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  padding: 18px;
  border: 1px solid rgba(26, 21, 16, 0.08);
  box-shadow: var(--shadow);
}

.admin-section-collapsible {
  padding: 0;
}

.admin-section-collapsible summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-section-collapsible summary::-webkit-details-marker {
  display: none;
}

.admin-section-collapsible summary::after {
  content: "▾";
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.admin-section-collapsible[open] summary::after {
  transform: rotate(180deg);
}

.admin-section-body {
  padding: 0 18px 18px;
}

.admin-search {
  width: 100%;
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid rgba(26, 21, 16, 0.12);
  font-family: inherit;
  margin: 8px 0 12px;
  background: rgba(255, 255, 255, 0.9);
}

.admin-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}

.admin-pagination button {
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid rgba(26, 21, 16, 0.12);
  background: #faf7f0;
  cursor: pointer;
  font-size: 12px;
}

.admin-pagination span {
  min-width: 80px;
}
.admin-table,
.admin-list {
  display: grid;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.admin-table-body {
  display: grid;
  gap: 6px;
  width: 100%;
}

.admin-table-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 2fr 0.8fr 0.8fr;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(26, 21, 16, 0.08);
}

.admin-table-row.columns-4 {
  grid-template-columns: 1.2fr 0.8fr 0.9fr 0.9fr;
}

.admin-table-row.columns-5 {
  grid-template-columns: 1.4fr 1fr 2fr 0.8fr 0.8fr;
}

.admin-table-row.columns-3 {
  grid-template-columns: 1.2fr 0.6fr 2fr;
}

.admin-table-row.columns-2 {
  grid-template-columns: 1.4fr 0.6fr;
}

.admin-table-row.columns-6 {
  grid-template-columns: 1.3fr 1fr 2fr 0.7fr 0.7fr 0.8fr;
}

.admin-table-row.columns-7 {
  grid-template-columns: 1.2fr 0.9fr 2fr 1.4fr 0.7fr 0.7fr 0.8fr;
}

.admin-table-row.columns-9 {
  grid-template-columns: 1.2fr 0.9fr 2fr 1.4fr 0.6fr 0.6fr 0.6fr 0.6fr 0.8fr;
}

.admin-table-row.columns-10 {
  grid-template-columns: 1.1fr 0.8fr 2fr 1.3fr 0.6fr 0.6fr 0.6fr 0.6fr 0.8fr 0.8fr;
}

.admin-tools-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-tools-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: #6b6154;
}

.admin-tools-meta span {
  background: rgba(26, 21, 16, 0.06);
  border-radius: 999px;
  padding: 2px 8px;
}

.admin-tools-preview {
  font-size: 12px;
  color: #3f352b;
}

.admin-tools-view {
  align-self: flex-start;
}

.admin-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.admin-modal.open {
  display: flex;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 16, 12, 0.4);
}

.admin-modal-panel {
  position: relative;
  z-index: 1;
  background: #f7f1e8;
  border-radius: 16px;
  padding: 20px;
  width: min(720px, 92vw);
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.admin-modal-close {
  border: none;
  background: #2f261e;
  color: #fdf8f2;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  position: absolute;
  top: 16px;
  right: 16px;
}

.admin-modal-meta {
  margin: 6px 0 16px;
  color: #6b6154;
  font-size: 12px;
}

.admin-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.admin-modal-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 12px;
  color: #3f352b;
  max-height: 320px;
  overflow: auto;
}

.admin-decision-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: #efe8dd;
  margin-bottom: 6px;
}

.admin-decision-bar .favor {
  background: linear-gradient(120deg, #5f8f69, #8fb592);
}

.admin-decision-bar .impartial {
  background: linear-gradient(120deg, #b1a691, #d3c7b3);
}

.admin-decision-bar .against {
  background: linear-gradient(120deg, #8b3d3d, #c6776a);
}

.admin-decision-label {
  font-size: 11px;
  color: var(--muted);
}

.admin-table-head {
  background: rgba(27, 93, 82, 0.08);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--ink);
}

.admin-table-cell {
  color: var(--ink);
  font-size: 13px;
  word-break: break-word;
}

.admin-chart {
  display: grid;
  gap: 10px;
}

.admin-chart-row {
  display: grid;
  grid-template-columns: 100px 1fr 140px;
  gap: 10px;
  align-items: center;
}

.admin-chart-label {
  font-size: 12px;
  color: var(--muted);
}

.admin-chart-bar {
  height: 10px;
  background: linear-gradient(90deg, var(--accent-strong), #caa678);
  border-radius: 999px;
}

.admin-chart-meta {
  font-size: 12px;
  color: var(--ink);
}

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

.admin-inline-button {
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid rgba(26, 21, 16, 0.12);
  background: #faf7f0;
  cursor: pointer;
  font-size: 12px;
}

.admin-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}

.admin-source-list {
  margin: 8px 0 0;
  padding-left: 16px;
  color: var(--muted);
  font-size: 12px;
}

.login-page .login-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  align-items: start;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  padding: 36px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(26, 21, 16, 0.08);
  backdrop-filter: blur(14px);
  max-width: 1100px;
  margin: 0 auto;
}

.auth-card {
  max-width: 640px;
}

.auth-google {
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid rgba(26, 21, 16, 0.12);
  background: #f5efe5;
  cursor: pointer;
  width: 100%;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 14px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(26, 21, 16, 0.08);
}

.confirm-grid {
  grid-template-columns: 1fr;
}

.confirm-actions {
  justify-content: flex-start;
}

.auth-confirm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
}

.source-stats-header {
  margin-bottom: 0.75rem;
  color: var(--accent-strong);
}

.source-stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(27, 93, 82, 0.04);
  border-radius: 8px;
  border: 1px solid rgba(27, 93, 82, 0.12);
}

.source-stat-item {
  display: flex;
  gap: 0.5rem;
  font-size: 14px;
  align-items: baseline;
}

.source-stat-item .tool-name {
  font-weight: 600;
  color: var(--accent);
}

.source-stat-item .success-count {
  color: var(--accent-strong);
  font-weight: 500;
}

.source-stat-item .total-count {
  color: var(--muted);
}

.source-stat-item .success-rate {
  color: var(--warm);
  font-weight: 500;
  margin-left: auto;
}

@media (max-width: 720px) {
  .panel-left,
  .panel-right {
    padding: 20px;
  }

  .history-panel {
    padding: 20px;
  }

  .tool-grid {
    max-height: 160px;
  }
}
