html {
  transition: color 180ms ease, background-color 180ms ease;
}

html[data-theme="light"] {
  color-scheme: light;
  color: #17221d;
  background: #f5f7f4;
  --surface: rgba(255, 255, 255, 0.88);
  --line: #dfe6e1;
  --muted: #6b7871;
}

html[data-theme="light"] .glow { opacity: 1; }
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] dialog { color: #17221d; background: #fff; }
html[data-theme="light"] .search input { background: transparent; }
html[data-theme="light"] label { color: #435049; }
html[data-theme="light"] .quiet,
html[data-theme="light"] .icon,
html[data-theme="light"] .copy-dot { color: #526159; }
html[data-theme="light"] .quiet:hover,
html[data-theme="light"] .icon:hover { background: #e8eeea; }
html[data-theme="light"] .copy-dot:hover { background: #e5f3ed; }
html[data-theme="light"] th { background: rgba(241, 245, 242, 0.8); }
html[data-theme="light"] .chip { color: #55635c; background: #edf1ee; }

html[data-theme="dark"] {
  color-scheme: dark;
  color: #e7eee9;
  background: #111713;
  --surface: rgba(25, 34, 29, 0.9);
  --line: #334039;
  --muted: #99a69f;
}

html[data-theme="dark"] .glow { opacity: 0.55; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] dialog { color: #e7eee9; background: #1a241e; }
html[data-theme="dark"] .search input { background: transparent; }
html[data-theme="dark"] label { color: #b5c2bb; }
html[data-theme="dark"] .quiet,
html[data-theme="dark"] .icon,
html[data-theme="dark"] .copy-dot { color: #b5c2bb; }
html[data-theme="dark"] .quiet:hover,
html[data-theme="dark"] .icon:hover,
html[data-theme="dark"] .copy-dot:hover { background: #2b3831; }
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .rule-card,
html[data-theme="dark"] .pending-panel { background: var(--surface); }
html[data-theme="dark"] th { background: #202b25; }
html[data-theme="dark"] .chip { color: #c0cac4; background: #2b3731; }

.theme-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notice {
  overflow-wrap: anywhere;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pending-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 3px solid #c8872e;
  border-radius: 16px;
  background: var(--surface);
}

.pending-head,
.pending-item,
.pending-actions {
  display: flex;
  align-items: center;
}

.pending-head,
.pending-item {
  justify-content: space-between;
  gap: 18px;
}

.pending-head h2,
.pending-head p,
.pending-item p {
  margin: 0;
}

.pending-head > p,
.pending-item span {
  color: var(--muted);
  font-size: 13px;
}

.pending-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.pending-item {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.pending-item > div:first-child {
  display: grid;
  gap: 4px;
}

.pending-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.pending-actions a {
  text-decoration: none;
}

.form-fields code {
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pending-head,
  .pending-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .pending-actions {
    width: 100%;
  }

  .pending-actions > * {
    flex: 1;
    justify-content: center;
    text-align: center;
  }
}

.login-card,
.stats article,
.table-wrap,
.rule-card,
dialog,
input,
select,
textarea,
.quiet,
.icon,
.copy-dot {
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
  html,
  .login-card,
  .stats article,
  .table-wrap,
  .rule-card,
  dialog,
  input,
  select,
  textarea,
  .quiet,
  .icon,
  .copy-dot { transition: none; }
}
