:root {
  color-scheme: dark;
  --bg: #140d08;
  --bg-soft: #21150d;
  --panel: #fff8ea;
  --panel-deep: #2a1a10;
  --text: #24150c;
  --text-on-dark: #f7ead1;
  --muted: #75685a;
  --muted-on-dark: #c8ad83;
  --line: #d8bd88;
  --line-dark: #5a3b22;
  --accent: #9e2119;
  --accent-strong: #6e130f;
  --gold: #d5a84e;
  --gold-soft: #f4ddaa;
  --ok: #21633c;
  --warn: #9d6416;
  --bad: #9a2323;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 0%, rgba(213, 168, 78, 0.22), transparent 32rem),
    linear-gradient(135deg, #100905 0%, #24160d 48%, #140d08 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(42, 26, 16, 0.96), rgba(20, 13, 8, 0.92));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

.brandLockup {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brandLogo {
  width: clamp(72px, 10vw, 112px);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(213, 168, 78, 0.12), 0 12px 24px rgba(0, 0, 0, 0.42);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--text-on-dark);
  font-size: 30px;
  line-height: 1.08;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
  color: var(--accent-strong);
}

p {
  color: var(--muted);
  margin-top: 6px;
}

.topbar p {
  color: var(--muted-on-dark);
}

.eyebrow {
  color: var(--gold) !important;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.versionText {
  color: var(--gold) !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.hidden {
  display: none !important;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.settingsGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.panel {
  background: linear-gradient(180deg, #fff9ee 0%, var(--panel) 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.panelHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.headerActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notice {
  border: 1px solid #80591f;
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: #2b1b0f;
  padding: 12px 14px;
  margin-bottom: 16px;
  color: var(--gold-soft);
  line-height: 1.45;
}

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

.form.compact {
  max-width: 420px;
}

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

.targetGrid label:nth-child(n + 3) {
  grid-column: span 1;
}

.targetGrid button {
  justify-self: start;
}

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

.formActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

label {
  display: grid;
  gap: 6px;
  color: #6a4c2d;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #c9a469;
  border-radius: 6px;
  padding: 10px 11px;
  background: #fffdf8;
  color: var(--text);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(213, 168, 78, 0.42);
  outline-offset: 1px;
  border-color: var(--gold);
}

select {
  min-height: 40px;
}

textarea {
  resize: vertical;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox input {
  width: auto;
}

button {
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #b42b22, var(--accent));
  color: white;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

button:hover {
  background: linear-gradient(180deg, #8f1d17, var(--accent-strong));
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.iconButton {
  background: #fff8ea;
  color: var(--accent);
  border: 1px solid #c9a469;
  box-shadow: none;
}

.iconButton:hover {
  background: #f3dfb6;
}

.dangerButton {
  color: var(--bad);
  border-color: #d9a29b;
}

.dangerButton:hover {
  background: #ffe8e5;
}

.topbar .iconButton {
  background: transparent;
  color: var(--gold-soft);
  border-color: var(--line-dark);
}

.topbar .iconButton:hover {
  background: rgba(213, 168, 78, 0.12);
}

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

.item {
  border: 1px solid #d8bd88;
  border-radius: 8px;
  padding: 12px;
  background: #fffdf8;
}

.itemHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.item h3 {
  margin: 0;
  font-size: 15px;
}

.item a {
  color: var(--accent);
  overflow-wrap: anywhere;
  font-weight: 700;
}

.meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  border: 1px solid #c9a469;
  border-radius: 999px;
  padding: 3px 8px;
  color: #6a4c2d;
  background: #fff5df;
  font-size: 12px;
  font-weight: 700;
}

.badge.positive {
  border-color: #8fbf9b;
  color: var(--ok);
  background: #eff8f2;
}

.badge.negative {
  border-color: #e6b4b4;
  color: var(--bad);
  background: #fff0f0;
}

.badge.unknown {
  border-color: #dfc891;
  color: var(--warn);
  background: #fff9e8;
}

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

.dense .item {
  padding: 10px 12px;
}

.scrollList {
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.userList {
  margin-top: 12px;
}

.smallText {
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  background: #21150d;
  color: var(--gold-soft);
  border: 1px solid var(--line-dark);
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

@media (max-width: 860px) {
  .layout,
  .settingsGrid {
    grid-template-columns: 1fr;
  }

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

  .topbar {
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .topbar,
  .brandLockup {
    display: grid;
  }

  .brandLogo {
    width: 84px;
  }
}
