:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #d8e0ec;
  --panel: #ffffff;
  --surface: #f4f7fb;
  --accent: #3159d8;
  --accent-dark: #2445b5;
  --approved: #168a50;
  --approved-card: #c8efd8;
  --rejected: #c92f3a;
  --rejected-card: #ffd0d4;
  --hold: #b66f00;
  --hold-card: #ffe2a1;
  --sidebar: 284px;
  --topbar-height: 76px;
  --comparison-height: 61px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  background: var(--surface);
}

body.dialog-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
a {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid #8aa6ff;
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: clamp(20px, 5vw, 64px);
  color: #162037;
  background:
    radial-gradient(circle at 12% 10%, #5076ed33 0 12%, transparent 34%),
    radial-gradient(circle at 90% 88%, #54c7b52b 0 10%, transparent 30%),
    #eef3fb;
}

.login-shell {
  width: min(1060px, 100%);
  min-height: min(660px, calc(100dvh - 128px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-self: center;
  justify-self: center;
  overflow: hidden;
  border: 1px solid #d2dcec;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 32px 90px #1c2d5a24;
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 6vw, 72px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, #6387ff 0 8%, transparent 28%),
    linear-gradient(145deg, #101b38 0%, #1e3678 58%, #3159d8 100%);
}

.login-brand::after {
  position: absolute;
  right: -84px;
  bottom: -112px;
  width: 330px;
  height: 330px;
  border: 1px solid #ffffff26;
  border-radius: 50%;
  box-shadow: 0 0 0 42px #ffffff0a, 0 0 0 86px #ffffff08;
  content: "";
}

.login-logo {
  position: relative;
  width: 58px;
  height: 50px;
  margin-bottom: 34px;
}

.login-logo span {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 4px solid #fff;
  border-radius: 50% 50% 46% 54%;
  background: #3159d8;
}

.login-logo span:nth-child(1) { left: 0; bottom: 0; }
.login-logo span:nth-child(2) { right: 0; bottom: 0; }
.login-logo span:nth-child(3) { left: 14px; top: 0; background: #58c9b9; }

.login-private-badge {
  width: fit-content;
  margin-bottom: 16px;
  padding: 6px 10px;
  border: 1px solid #ffffff5c;
  border-radius: 999px;
  color: #dfe7ff;
  background: #ffffff12;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.login-kicker,
.login-eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-kicker { color: #aebfff; }

.login-brand h1 {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.28;
  letter-spacing: -0.04em;
}

.login-brand-copy {
  max-width: 440px;
  margin: 24px 0 30px;
  color: #d6def4;
  font-size: 14px;
  line-height: 1.9;
}

.login-points {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.login-points li {
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid #ffffff30;
}

.login-points strong,
.login-points span { display: block; }
.login-points strong { font-size: 24px; }
.login-points span { margin-top: 2px; color: #c8d3ee; font-size: 10px; }

.login-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 5vw, 64px);
  background: #fff;
}

.login-step {
  position: absolute;
  top: 24px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #667085;
  font-size: 10px;
}

.login-step span {
  padding: 4px 7px;
  border-radius: 999px;
  color: #2445b5;
  background: #e8edff;
  font-weight: 900;
}

.login-step strong { font-weight: 700; }

.login-lock {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, #3159d8, #2445b5);
  box-shadow: 0 10px 24px #3159d83d;
  font-size: 23px;
  font-weight: 900;
}

.login-eyebrow { color: #3159d8; }

.login-card h2 {
  margin: 0;
  color: #111b32;
  font-size: clamp(27px, 3vw, 36px);
  line-height: 1.25;
}

.login-intro {
  margin: 10px 0 24px;
  color: #667085;
  font-size: 13px;
  line-height: 1.7;
}

.login-form { display: grid; gap: 16px; }

.login-field {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.login-field input {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid #bdc9da;
  border-radius: 11px;
  color: #172033;
  background: #fbfcff;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.login-field input:hover { border-color: #8da0ba; }
.login-field input:focus { border-color: #3159d8; background: #fff; box-shadow: 0 0 0 4px #3159d818; }
.login-field input[aria-invalid="true"] { border-color: #c92f3a; background: #fff8f8; }

.primary-button.login-submit {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3px;
  padding: 12px 17px;
  border-radius: 11px;
  box-shadow: 0 10px 24px #3159d82b;
}

.login-error {
  min-height: 0;
  margin: -4px 0 16px;
  padding: 11px 12px;
  border: 1px solid #efb1b6;
  border-radius: 10px;
  background: #fff3f4;
  line-height: 1.6;
}

.login-help {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e5eaf2;
  color: #667085;
  font-size: 11px;
  line-height: 1.65;
}

.login-help strong { color: #344054; }
.login-help p { margin: 4px 0 0; }

.login-footer {
  width: min(1060px, 100%);
  display: flex;
  justify-content: space-between;
  justify-self: center;
  gap: 12px;
  padding-top: 18px;
  color: #667085;
  font-size: 10px;
}

@media (max-width: 860px) {
  .login-page { padding: 20px; }
  .login-shell { width: min(580px, 100%); min-height: 0; grid-template-columns: 1fr; }
  .login-brand { padding: 32px; }
  .login-logo { margin-bottom: 20px; }
  .login-brand h1 { font-size: 30px; }
  .login-brand-copy { margin: 16px 0 22px; }
  .login-card { padding: 66px 32px 36px; }
}

@media (max-width: 520px) {
  .login-page { padding: 10px; }
  .login-shell { border-radius: 18px; }
  .login-brand { padding: 26px 22px; }
  .login-logo { width: 50px; height: 43px; transform: scale(0.86); transform-origin: left center; }
  .login-brand h1 { font-size: 25px; }
  .login-brand-copy { margin-bottom: 0; font-size: 12px; }
  .login-points { display: none; }
  .login-card { padding: 62px 22px 28px; }
  .login-step { top: 20px; right: 20px; }
  .login-step strong { display: none; }
  .login-footer { padding: 12px 6px 4px; flex-direction: column; gap: 3px; }
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: #fff;
  background: #111827;
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  min-height: var(--topbar-height);
  display: grid;
  grid-template-columns: minmax(260px, auto) minmax(330px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  color: #fff;
  background: #172033;
  box-shadow: 0 3px 18px #11182733;
}

.title-line,
.account-area,
.stats {
  display: flex;
  align-items: center;
}

.title-line {
  gap: 9px;
}

.title-block h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  white-space: nowrap;
}

.title-block p {
  margin: 3px 0 0;
  color: #c9d2e3;
  font-size: 11px;
}

.private-badge {
  padding: 3px 8px;
  border: 1px solid #ffcf70;
  border-radius: 999px;
  color: #ffe1a5;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.stats {
  min-width: 0;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}

.stat {
  min-width: 74px;
  padding: 5px 8px;
  border: 1px solid #ffffff2e;
  border-radius: 999px;
  background: #ffffff12;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

.account-area {
  gap: 7px;
  justify-content: flex-end;
}

.account-name {
  max-width: 140px;
  overflow: hidden;
  color: #dfe6f3;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid #ffffff52;
  border-radius: 8px;
  color: #fff;
  background: #ffffff13;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.top-button:hover {
  background: #ffffff24;
}

.top-button-muted {
  color: #d7deeb;
  background: transparent;
}

.comparison-nav {
  position: sticky;
  z-index: 25;
  top: var(--topbar-height);
  min-height: var(--comparison-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 5px 16px #2636550d;
}

.comparison-nav-label {
  margin-right: 4px;
  color: #4b5870;
  font-size: 13px;
  font-weight: 900;
}

.view-button {
  min-width: 118px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #364157;
  background: #f4f6fa;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.view-button:hover {
  border-color: #b9c5f4;
  background: #e9edff;
}

.view-button.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 12px #3559e033;
}

.notice-bar {
  position: sticky;
  z-index: 24;
  top: calc(var(--topbar-height) + var(--comparison-height));
  padding: 10px 20px;
  border-bottom: 1px solid #e8a932;
  color: #633900;
  background: #fff0c2;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.notice-bar:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.notice-reload {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #875500;
  border-radius: 8px;
  color: #fff;
  background: #875500;
  font-size: 12px;
  font-weight: 900;
}

.loading-panel,
.fatal-panel,
.password-panel {
  max-width: 680px;
  margin: 84px auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 15px 40px #26365514;
  text-align: center;
}

.loading-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #dbe3f4;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 1.6s;
  }
}

.fatal-panel h2 {
  margin: 0 0 10px;
}

.fatal-panel p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.7;
}

.password-panel {
  max-width: 620px;
  text-align: left;
}

.password-heading {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.password-heading h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.password-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.password-panel form {
  display: grid;
  gap: 14px;
}

.password-panel label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 900;
}

.password-panel input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #aab7ca;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
}

.password-rules {
  margin: -2px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: #503800;
  background: #fff4ce;
  font-size: 12px;
  line-height: 1.65;
}

.password-panel .primary-button {
  justify-self: start;
}

.fatal-panel button,
.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 9px;
  font-weight: 900;
}

.fatal-panel button,
.primary-button {
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
}

.fatal-panel button:hover,
.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.layout {
  min-height: calc(100vh - var(--topbar-height) - var(--comparison-height));
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.layout > aside {
  position: sticky;
  top: calc(var(--topbar-height) + var(--comparison-height));
  height: calc(100vh - var(--topbar-height) - var(--comparison-height));
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #fff;
}

.filter {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.filter label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.filter select {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.monster-list {
  padding: 8px;
}

.list-item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 34px auto minmax(0, 1fr) 18px;
  align-items: center;
  gap: 7px;
  padding: 9px 8px;
  border: 0;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.list-item:hover {
  background: #f0f4ff;
}

.list-item.active {
  color: #1d3eb4;
  background: #e8edff;
}

.list-number {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.list-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd2df;
}

.status-dot[data-status="approved"] {
  background: var(--approved);
}

.status-dot[data-status="rejected"] {
  background: var(--rejected);
}

.status-dot[data-status="hold"] {
  background: var(--hold);
}

.status-dot[data-missing="true"] {
  border: 2px dashed #8e9bb0;
  background: transparent;
}

.list-empty {
  padding: 24px 12px;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}

main {
  min-width: 0;
  padding: 22px;
}

.review-card,
.compare-shell {
  max-width: 1320px;
  margin: 0 auto;
}

.review-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 12px 35px #26365512;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 19px;
  border-bottom: 1px solid var(--line);
}

.badge {
  padding: 5px 9px;
  border-radius: 999px;
  color: #4b5870;
  background: #edf1f7;
  font-size: 12px;
  font-weight: 800;
}

.card-title {
  min-width: 0;
  overflow: hidden;
  font-size: 23px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-subject {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.card-content {
  display: grid;
  grid-template-columns: minmax(620px, 1.5fr) minmax(280px, 0.6fr);
}

.visual-panel {
  padding: 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(145deg, #f8faff, #eef3fb);
}

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

.stage-card,
.compare-card {
  min-width: 0;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 16px #2636550d;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  overflow-anchor: none;
}

.stage-card {
  padding: 10px;
}

.stage-card[data-status="approved"],
.compare-card[data-status="approved"] {
  border-color: #168a50;
  background: #c8efd8;
  box-shadow: 0 8px 24px #138a535c, 0 0 0 2px #168a502e;
}

.stage-card[data-status="rejected"],
.compare-card[data-status="rejected"] {
  border-color: #c92f3a;
  background: #ffd0d4;
  box-shadow: 0 8px 24px #d63c455c, 0 0 0 2px #c92f3a2e;
}

.stage-card[data-status="hold"],
.compare-card[data-status="hold"] {
  border-color: #b66f00;
  background: #ffe2a1;
  box-shadow: 0 8px 24px #c7810b5c, 0 0 0 2px #b66f002e;
}

.stage-card.is-unsaved,
.compare-card.is-unsaved {
  box-shadow: 0 0 0 4px #c92f3a4d, 0 8px 24px #991b1b2e;
}

.stage-card.is-saving,
.compare-card.is-saving {
  cursor: progress;
}

.stage-head {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.stage-head strong {
  font-size: 15px;
}

.stage-head span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-image {
  width: 100%;
  height: 250px;
  display: grid;
  place-items: center;
  padding: 5px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(#fafcff, #f1f5fb);
}

.stage-image:disabled {
  cursor: default;
}

.stage-image img {
  max-width: 100%;
  max-height: 238px;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px #2537541f);
}

.inline-candidate-viewer {
  min-width: 0;
}

.inline-candidate-frame {
  position: relative;
  min-width: 0;
}

.inline-candidate-badges {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}

.inline-candidate-kind,
.inline-candidate-count {
  max-width: calc(50% - 3px);
  overflow: hidden;
  padding: 5px 9px;
  border: 1px solid #52627a;
  border-radius: 999px;
  color: #fff;
  background: #17253ee8;
  box-shadow: 0 4px 12px #07101f52;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.inline-candidate-kind.is-candidate,
.inline-candidate-count {
  border-color: #7f9cf0;
  background: #3159d8ed;
}

.inline-candidate-viewer.is-showing-candidate .inline-candidate-surface {
  border: 3px solid #3159d8;
  box-shadow: 0 0 0 3px #3159d82e, inset 0 1px 5px #45557226;
}

.inline-candidate-arrow {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid #8da2c3;
  border-radius: 50%;
  color: #fff;
  background: #10213be8;
  box-shadow: 0 6px 18px #07101f61;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.inline-candidate-arrow.is-previous {
  left: 8px;
}

.inline-candidate-arrow.is-next {
  right: 8px;
}

.inline-candidate-arrow:hover:not(:disabled) {
  border-color: #9cf7e9;
  background: #3159d8;
}

.inline-candidate-arrow:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

.inline-candidate-status {
  min-height: 22px;
  margin: 5px 2px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.5;
  text-align: center;
}

.inline-candidate-warning {
  margin: 5px 0 0;
  padding: 7px 9px;
  border: 1px solid #bb7a13;
  border-radius: 8px;
  color: #674000;
  background: #fff1c9;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.45;
}

.stage-card.is-previewing-candidate .stage-actions,
.compare-card.is-previewing-candidate .stage-actions {
  opacity: 0.62;
}

.placeholder {
  width: 100%;
  height: 238px;
  display: grid;
  place-content: center;
  padding: 18px;
  border: 2px dashed #aeb9ca;
  border-radius: 10px;
  color: var(--muted);
  background: #fff;
  line-height: 1.6;
  text-align: center;
}

.placeholder strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 18px;
}

.stage-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.stage-actions button {
  min-height: 36px;
  padding: 7px 2px;
  border: 2px solid transparent;
  border-radius: 8px;
  color: #364157;
  background: #f0f2f6;
  font-weight: 900;
}

.stage-actions button[data-status="approved"] {
  color: var(--approved);
  background: #e9f8f0;
}

.stage-actions button[data-status="rejected"] {
  color: var(--rejected);
  background: #fff0f1;
}

.stage-actions button[data-status="hold"] {
  color: var(--hold);
  background: #fff7e8;
}

.stage-actions button.selected {
  border-color: currentColor;
  box-shadow: inset 0 0 0 1px currentColor;
}

.stage-actions button:disabled,
.stage-note:disabled,
.stage-tool:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.stage-note {
  width: 100%;
  min-height: 56px;
  margin-top: 7px;
  padding: 8px;
  resize: vertical;
  border: 1px solid #b8c4d5;
  border-radius: 8px;
  color: var(--ink);
  background: #fffffff0;
  font-size: 12px;
  line-height: 1.55;
}

.save-state {
  min-height: 19px;
  margin: 4px 1px 0;
  color: #59657b;
  font-size: 11px;
  font-weight: 800;
}

.save-state[data-state="saved"] {
  color: #0b6d3c;
}

.save-state[data-state="error"] {
  color: #a51d28;
}

.stage-tools {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}

.stage-tool,
.bundle-button,
.download-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  border: 1px solid #b7c3d5;
  border-radius: 8px;
  color: #294269;
  background: #ffffffd9;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

.stage-tool:hover,
.bundle-button:hover,
.download-link:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: #fff;
}

.image-state {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.details-panel {
  min-width: 0;
  padding: 21px;
  overflow: auto;
}

.section-title,
.eyebrow {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.key-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 16px;
}

.key {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.key span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.key strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.details-copy {
  color: #344054;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.character-downloads {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.character-downloads h3 {
  margin: 0;
  font-size: 13px;
}

.bundle-button[aria-disabled="true"] {
  cursor: not-allowed;
  color: #7d8798;
  background: #f0f2f6;
}

.card-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.card-nav button {
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}

.card-nav button:last-child {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.card-nav span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.compare-mode .layout {
  grid-template-columns: 1fr;
}

.compare-mode .layout > aside {
  display: none;
}

.compare-mode main {
  padding: 20px;
}

.compare-shell {
  max-width: 1680px;
}

.compare-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.compare-head h2 {
  margin: 0;
  font-size: 24px;
}

.compare-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.compare-count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.compare-card {
  padding: 10px;
}

.compare-title {
  min-height: 40px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin-bottom: 8px;
}

.compare-number {
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #4b5870;
  background: #edf1f7;
  font-size: 12px;
  font-weight: 900;
}

.compare-name {
  min-width: 0;
}

.compare-name button {
  width: 100%;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: none;
  font-size: 16px;
  font-weight: 900;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-name span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-card .stage-image {
  height: 260px;
}

.compare-card .stage-image img {
  max-height: 248px;
}

.compare-stage-name {
  min-height: 35px;
  margin: 7px 2px 0;
  overflow: hidden;
  color: #4f5b70;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.compare-card .stage-note {
  min-height: 48px;
}

.compare-footer {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

dialog {
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  margin: auto;
  border: 0;
}

dialog::backdrop {
  background: #0c1220d9;
  backdrop-filter: blur(2px);
}

.image-dialog {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  padding: 48px 24px 24px;
  color: #fff;
  background: transparent;
}

.image-dialog figure {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 10px;
  margin: 0;
}

.image-dialog img {
  max-width: 94vw;
  max-height: calc(100vh - 100px);
  object-fit: contain;
}

img.is-image-error {
  opacity: 0.18;
}

.image-dialog figcaption {
  font-weight: 800;
  text-align: center;
}

.dialog-close {
  position: fixed;
  z-index: 2;
  top: 18px;
  right: 18px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #ffffff80;
  border-radius: 999px;
  color: #fff;
  background: #172033;
  font-weight: 800;
}

.panel-dialog {
  width: min(720px, calc(100vw - 32px));
  padding: 22px;
  border-radius: 16px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 90px #00000066;
}

.panel-dialog > form {
  padding: 0;
}

.upload-dialog {
  padding: 0;
}

.upload-dialog > form {
  padding: 22px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 22px;
}

.dialog-close-inline {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  font-size: 22px;
}

.dialog-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.download-expiry-note {
  margin: -8px 0 14px;
  padding: 10px 12px;
  border: 1px solid #dfb758;
  border-radius: 10px;
  color: #634000;
  background: #fff8e3;
  font-size: 12px;
  line-height: 1.65;
}

.download-featured {
  margin: 18px 0;
}

.download-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.download-section-heading h3 {
  margin: 0;
  font-size: 15px;
}

.download-section-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.download-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.download-feature-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
  border: 1px solid #cdd7e8;
  border-radius: 14px;
  background: linear-gradient(155deg, #fff, #f3f6fc);
}

.download-feature-card.egg { border-color: #c9b987; background: linear-gradient(155deg, #fffdf4, #fff5d7); }
.download-feature-card.all { border-color: #96a9e5; background: linear-gradient(155deg, #f7f9ff, #eaf0ff); }

.download-feature-number {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  color: #3159d8;
  background: #e6ecff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.download-feature-card h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.download-feature-card p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.download-feature-card select {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #aebbd0;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
}

.download-feature-link {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  color: #fff;
  background: var(--accent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}

.download-feature-link:hover { background: var(--accent-dark); }

.download-feature-link.is-disabled {
  border-color: #c8d0dc;
  color: #737f92;
  background: #eef1f5;
}

.download-more {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.download-more summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 9px 11px;
  border-radius: 9px;
  color: #2445b5;
  background: #eef3ff;
  font-size: 12px;
  font-weight: 900;
  list-style-position: inside;
}

.download-more[open] summary { margin-bottom: 12px; }

.download-context {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 10px;
  background: #eef3ff;
  font-size: 13px;
  font-weight: 800;
}

.download-list {
  display: grid;
  gap: 9px;
  max-height: min(480px, 60vh);
  overflow: auto;
}

.download-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.download-row strong,
.download-row span {
  display: block;
}

.download-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.download-empty {
  padding: 24px;
  border: 1px dashed #aeb9ca;
  border-radius: 10px;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}

.candidate-dialog {
  width: min(1040px, calc(100vw - 32px));
  overflow: auto;
  overscroll-behavior: contain;
}

.candidate-swipe-nav {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) auto minmax(112px, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid #c7d3ee;
  border-radius: 13px;
  background: #f5f8ff;
}

.candidate-swipe-button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #6f88d1;
  border-radius: 10px;
  color: #173477;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}

.candidate-swipe-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.candidate-swipe-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.candidate-swipe-position {
  min-width: 120px;
  text-align: center;
}

.candidate-swipe-position strong,
.candidate-swipe-position span {
  display: block;
}

.candidate-swipe-position strong {
  font-size: 16px;
}

.candidate-swipe-position span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.candidate-all-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 16px 0 22px;
}

.candidate-image-card {
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 13px;
  background: #f8faff;
}

.candidate-image-card.is-candidate {
  border-color: #8ca3e6;
  background: #eef3ff;
}

.candidate-image-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.candidate-image-head strong {
  min-height: 2.7em;
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.candidate-kind {
  padding: 3px 8px;
  border-radius: 999px;
  color: #3f4e68;
  background: #dfe6f2;
  font-size: 10px;
  font-weight: 900;
}

.candidate-image-card.is-candidate .candidate-kind {
  color: #fff;
  background: var(--accent);
}

.candidate-preview {
  width: 100%;
  height: 300px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: #fff;
}

.candidate-preview img {
  max-width: 100%;
  max-height: 284px;
  object-fit: contain;
}

.candidate-swipe-preview:not(:disabled) {
  touch-action: pan-y pinch-zoom;
  overscroll-behavior-x: contain;
  user-select: none;
  cursor: grab;
  transform: translateX(var(--candidate-swipe-offset, 0));
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.candidate-swipe-preview.is-swiping:not(:disabled) {
  cursor: grabbing;
  box-shadow: 0 12px 30px #274ca829;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .candidate-swipe-preview:not(:disabled) {
    transition: none;
  }
}

.candidate-meta {
  min-height: 42px;
  margin: 9px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.candidate-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.adopt-button {
  min-height: 44px;
  padding: 7px 11px;
  border: 1px solid #173da9;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.adopt-button:hover {
  background: var(--accent-dark);
}

.adopt-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.candidate-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.candidate-list-heading h3 {
  margin: 0;
  font-size: 15px;
}

.candidate-list-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.candidate-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.candidate-choice {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.candidate-choice:hover,
.candidate-choice.selected {
  border-color: var(--accent);
  background: #eef3ff;
}

.candidate-choice img {
  width: 58px;
  height: 58px;
  border-radius: 7px;
  background: #f3f6fb;
  object-fit: contain;
}

.candidate-choice strong,
.candidate-choice span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-choice strong {
  font-size: 12px;
}

.candidate-choice span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.upload-target {
  margin: 10px 0 14px;
  font-weight: 900;
}

.safety-note {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #dfb758;
  border-radius: 10px;
  color: #634000;
  background: #fff5d6;
  font-size: 12px;
  line-height: 1.6;
}

.file-field {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 2px dashed #96a6bf;
  border-radius: 12px;
  background: #f8faff;
  font-weight: 800;
}

.file-field input {
  width: 100%;
}

.file-field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}

.file-summary,
.form-message {
  min-height: 20px;
  margin: 9px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.form-message.is-error {
  color: var(--rejected);
  font-weight: 800;
}

.form-message.is-success {
  color: var(--approved);
  font-weight: 800;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.admin-dialog {
  width: min(1040px, calc(100vw - 32px));
  overflow: auto;
}

.outer-account-warning {
  display: grid;
  gap: 4px;
  margin: 12px 0 16px;
  padding: 13px 14px;
  border: 2px solid #c77b00;
  border-radius: 11px;
  color: #613900;
  background: #fff0bf;
  font-size: 12px;
  line-height: 1.65;
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px;
  border-radius: 11px;
  background: #edf1f7;
}

.admin-tab {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: #4f5b70;
  background: transparent;
  font-weight: 900;
}

.admin-tab.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 3px 10px #3159d833;
}

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

.admin-create-form {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f7f9fd;
}

.admin-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-section-heading h3 {
  margin: 0;
  font-size: 16px;
}

.admin-section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.admin-form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #3e4a61;
  font-size: 12px;
  font-weight: 900;
}

.admin-form-grid input,
.admin-form-grid select,
.admin-role-select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #aeb9ca;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.admin-field-help {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.admin-create-actions {
  margin-top: 12px;
}

.temporary-password-panel {
  margin-top: 14px;
  padding: 15px;
  border: 3px solid #168a50;
  border-radius: 12px;
  color: #0d5230;
  background: #dff7e8;
}

.temporary-password-panel h3,
.temporary-password-panel p {
  margin: 0;
}

.temporary-password-panel p {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.6;
}

.temporary-password-panel code {
  display: block;
  margin-top: 10px;
  padding: 12px;
  overflow-wrap: anywhere;
  border: 1px solid #59a77c;
  border-radius: 8px;
  color: #10251b;
  background: #fff;
  font-size: clamp(16px, 3vw, 22px);
  font-weight: 900;
  letter-spacing: 0.04em;
  user-select: all;
}

.admin-message {
  min-height: 20px;
}

.admin-list-heading {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.admin-refresh {
  min-height: 38px;
  flex: 0 0 auto;
}

.admin-user-list,
.admin-audit-list {
  display: grid;
  gap: 9px;
  margin-top: 11px;
}

.admin-audit-list {
  max-height: min(560px, 62vh);
  overflow: auto;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, auto);
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 2px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.admin-user-row.is-disabled {
  border-color: #d7a5aa;
  background: #fff3f4;
}

.admin-user-row.is-busy {
  opacity: 0.62;
}

.admin-user-name,
.admin-user-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.admin-user-name {
  flex-wrap: wrap;
}

.admin-user-name strong {
  font-size: 14px;
}

.admin-user-main p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.admin-user-status,
.self-badge {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.admin-user-status.is-active {
  color: #0c6337;
  background: #d8f3e3;
}

.admin-user-status.is-disabled {
  color: #8e2029;
  background: #ffdce0;
}

.self-badge {
  color: #2445b5;
  background: #e3eaff;
}

.admin-user-controls {
  justify-content: flex-end;
}

.admin-role-select {
  width: 126px;
  min-height: 38px;
  font-size: 12px;
  font-weight: 800;
}

.admin-action {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #aeb9ca;
  border-radius: 8px;
  color: #344054;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.admin-action:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: #eef3ff;
}

.danger-outline {
  border-color: #d96a74;
  color: #a51f2b;
}

.danger-button {
  border-color: #a51f2b;
  background: #b92632;
}

.danger-button:hover {
  background: #951c27;
}

.admin-empty {
  padding: 28px 18px;
  border: 1px dashed #aeb9ca;
  border-radius: 11px;
  color: var(--muted);
  background: #fafbfe;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.admin-audit-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.admin-audit-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.admin-audit-main strong {
  font-size: 13px;
}

.admin-audit-main span,
.admin-audit-row p {
  color: var(--muted);
  font-size: 11px;
}

.admin-audit-row p {
  margin: 7px 0 0;
}

.admin-confirm-dialog {
  width: min(520px, calc(100vw - 32px));
}

.admin-confirm-dialog h2 {
  margin: 5px 0 10px;
  font-size: 20px;
}

.admin-confirm-dialog > p {
  margin: 0;
  color: #4f5b70;
  font-size: 13px;
  line-height: 1.75;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: min(420px, calc(100vw - 36px));
  padding: 11px 14px;
  border: 1px solid #526174;
  border-radius: 10px;
  color: #fff;
  background: #172033;
  box-shadow: 0 10px 30px #1118274d;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.toast.error {
  border-color: #ff8e96;
  background: #7d1921;
}

@media (max-width: 1280px) {
  :root {
    --topbar-height: 112px;
  }

  .topbar {
    grid-template-columns: minmax(260px, auto) 1fr;
  }

  .stats {
    justify-content: flex-end;
  }

  .account-area {
    grid-column: 1 / -1;
  }

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

@media (max-width: 980px) {
  :root {
    --topbar-height: auto;
    --comparison-height: auto;
  }

  .topbar,
  .comparison-nav,
  .layout > aside {
    position: relative;
    top: auto;
  }

  .topbar {
    display: flex;
    flex-wrap: wrap;
  }

  .title-block {
    flex: 1 1 280px;
  }

  .stats {
    flex: 1 1 100%;
    order: 3;
    justify-content: flex-start;
  }

  .account-area {
    flex-wrap: wrap;
  }

  .comparison-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .comparison-nav-label {
    display: none;
  }

  .notice-bar {
    position: relative;
    top: auto;
  }

  .layout {
    display: block;
  }

  .layout > aside {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .monster-list {
    display: flex;
    gap: 5px;
    overflow-x: auto;
  }

  .list-item {
    width: 230px;
    flex: 0 0 auto;
  }

  .card-content {
    grid-template-columns: 1fr;
  }

  .visual-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 620px) {
  .topbar {
    padding: 11px 12px;
  }

  .title-block h1 {
    font-size: 16px;
  }

  .account-area {
    width: 100%;
    justify-content: flex-start;
  }

  .account-name {
    width: 100%;
    max-width: none;
  }

  .top-button {
    flex: 1 1 auto;
  }

  .comparison-nav {
    padding: 8px 10px;
  }

  .view-button {
    min-width: auto;
    min-height: 38px;
    padding: 7px 11px;
    font-size: 12px;
  }

  main,
  .compare-mode main {
    padding: 10px;
  }

  .card-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .card-title {
    width: 100%;
    font-size: 20px;
  }

  .card-subject {
    width: 100%;
    margin-left: 0;
  }

  .visual-panel,
  .details-panel {
    padding: 10px;
  }

  .stage-grid,
  .compare-grid,
  .key-grid {
    grid-template-columns: 1fr;
  }

  .stage-image,
  .compare-card .stage-image {
    height: 300px;
  }

  .stage-image img,
  .compare-card .stage-image img {
    max-height: 288px;
  }

  .compare-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .compare-actions {
    width: 100%;
    justify-content: space-between;
  }

  .card-nav button {
    padding: 8px 10px;
    font-size: 12px;
  }

  .panel-dialog {
    padding: 16px;
  }

  .upload-dialog {
    padding: 0;
  }

  .upload-dialog > form {
    padding: 16px;
  }

  .download-row {
    grid-template-columns: 1fr;
  }

  .download-quick-grid {
    grid-template-columns: 1fr;
  }

  .download-link {
    width: 100%;
  }

  .candidate-all-comparison-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .candidate-swipe-nav {
    grid-template-columns: minmax(74px, 1fr) auto minmax(74px, 1fr);
    gap: 7px;
    padding: 8px;
  }

  .candidate-swipe-button {
    padding: 7px 8px;
    font-size: 12px;
  }

  .candidate-swipe-position {
    min-width: 70px;
  }

  .candidate-swipe-position span {
    max-width: 86px;
    margin-inline: auto;
    line-height: 1.35;
  }

  .candidate-dialog .dialog-close-inline {
    width: 44px;
    height: 44px;
  }

  .candidate-list {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
  }

  .candidate-choice {
    width: min(82vw, 286px);
    flex: 0 0 min(82vw, 286px);
    scroll-snap-align: start;
  }

  .candidate-image-card {
    padding: 8px;
  }

  .candidate-image-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .candidate-preview {
    height: 180px;
  }

  .candidate-preview img {
    max-height: 164px;
  }

  .candidate-card-actions,
  .candidate-card-actions .download-link,
  .candidate-card-actions .adopt-button {
    width: 100%;
  }

  .admin-dialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }

  .admin-form-grid,
  .admin-user-row {
    grid-template-columns: 1fr;
  }

  .admin-section-heading,
  .admin-audit-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-refresh,
  .admin-user-controls,
  .admin-role-select,
  .admin-action {
    width: 100%;
  }

  .admin-user-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .admin-role-select {
    grid-column: 1 / -1;
  }

  .temporary-password-panel code {
    font-size: 16px;
  }
}

/* Authenticated portal: midnight review theme
 * Keep the approved login surface above unchanged; this layer is deliberately
 * scoped to the signed-in application only.
 */
body:not(.login-page) {
  --ink: #f5f8ff;
  --muted: #b4c2d8;
  --line: #2c4162;
  --panel: #101d32;
  --surface: #07101f;
  --accent: #3159d8;
  --accent-dark: #2445b5;
  --portal-glow: #58c9b9;
  --portal-glow-soft: #58c9b929;
  --comparison-height: 65px;
  color-scheme: dark;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 5%, #3159d833 0 8%, transparent 29%),
    radial-gradient(circle at 96% 88%, #58c9b91f 0 8%, transparent 27%),
    linear-gradient(145deg, #07101f 0%, #0a1427 52%, #0b1830 100%);
  background-attachment: fixed;
}

body:not(.login-page)::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(#93a8cc0a 1px, transparent 1px),
    linear-gradient(90deg, #93a8cc0a 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 72%);
  mask-image: linear-gradient(to bottom, #000 0, transparent 72%);
  content: "";
}

body:not(.login-page) button:focus-visible,
body:not(.login-page) a:focus-visible,
body:not(.login-page) select:focus-visible,
body:not(.login-page) textarea:focus-visible,
body:not(.login-page) input:focus-visible {
  outline-color: #7ff0df;
  box-shadow: 0 0 0 4px #58c9b93d;
  scroll-margin-top: calc(var(--topbar-height) + var(--comparison-height) + 18px);
}

body:not(.login-page) ::selection {
  color: #07101f;
  background: #7ff0df;
}

body:not(.login-page) .skip-link {
  border: 1px solid #7ff0df;
  color: #07101f;
  background: #7ff0df;
  box-shadow: 0 12px 32px #0009;
}

body:not(.login-page) .topbar {
  isolation: isolate;
  border-bottom: 1px solid #5e7ec259;
  background:
    radial-gradient(circle at 18% -85%, #597eff66 0 23%, transparent 54%),
    linear-gradient(125deg, #091326 0%, #10234b 55%, #18346f 100%);
  box-shadow: 0 14px 38px #0207138f, inset 0 -1px #ffffff0a;
}

body:not(.login-page) .topbar::after {
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #58c9b9 38%, #6687ff 72%, transparent);
  opacity: 0.72;
  content: "";
}

body:not(.login-page) .title-block {
  position: relative;
  min-width: 0;
  padding-left: 52px;
}

body:not(.login-page) .title-block::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 42px;
  height: 42px;
  border: 1px solid #8ca6ef70;
  border-radius: 14px;
  background:
    radial-gradient(circle at 31% 68%, #fff 0 4px, #3159d8 4.5px 9px, transparent 9.5px),
    radial-gradient(circle at 69% 68%, #fff 0 4px, #3159d8 4.5px 9px, transparent 9.5px),
    radial-gradient(circle at 50% 29%, #fff 0 4px, #58c9b9 4.5px 9px, transparent 9.5px),
    linear-gradient(145deg, #172d62, #0b1730);
  box-shadow: 0 8px 22px #0207138f, inset 0 1px #ffffff14;
  transform: translateY(-50%);
  content: "";
}

body:not(.login-page) .title-block h1 {
  color: #fff;
  letter-spacing: -0.025em;
}

body:not(.login-page) .title-block p {
  color: #b9c9e2;
}

body:not(.login-page) .private-badge {
  border-color: #58c9b980;
  color: #aef6eb;
  background: #58c9b914;
  box-shadow: inset 0 0 16px #58c9b912;
}

body:not(.login-page) .stats {
  gap: 7px;
}

body:not(.login-page) .stat {
  position: relative;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  border-color: #7890c74d;
  color: #e8efff;
  background: #06102461;
  box-shadow: inset 0 1px #ffffff0a;
  backdrop-filter: blur(10px);
}

body:not(.login-page) .stat::before {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--portal-glow);
  box-shadow: 0 0 10px var(--portal-glow);
  content: "";
}

body:not(.login-page) .account-name {
  color: #eef3ff;
}

body:not(.login-page) .top-button {
  border-color: #88a0d25c;
  color: #eef3ff;
  background: #06102463;
  box-shadow: inset 0 1px #ffffff0d;
  backdrop-filter: blur(10px);
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

body:not(.login-page) .top-button:hover {
  border-color: #74ddce;
  color: #fff;
  background: #58c9b91f;
  transform: translateY(-1px);
}

body:not(.login-page) #open-downloads {
  border-color: #58c9b98c;
  color: #baf9ef;
  background: #58c9b918;
}

body:not(.login-page) .top-button-muted {
  color: #c5d0e1;
  background: transparent;
}

body:not(.login-page) .comparison-nav {
  border-color: #2c4162;
  background: #0a1628e8;
  box-shadow: 0 12px 30px #02071366, inset 0 -1px #ffffff08;
  backdrop-filter: blur(16px) saturate(130%);
}

body:not(.login-page) .comparison-nav-label {
  color: #9eb0cb;
}

body:not(.login-page) .view-button {
  border-color: #334b70;
  color: #cad6e9;
  background: #111f36;
  box-shadow: inset 0 1px #ffffff09;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

body:not(.login-page) .view-button:hover {
  border-color: #7091df;
  color: #fff;
  background: #172b50;
}

body:not(.login-page) .view-button.active {
  border-color: #74ddce;
  color: #fff;
  background: linear-gradient(135deg, #3159d8, #2445b5);
  box-shadow: 0 8px 24px #173da95c, inset 0 -2px #72e0d0;
}

body:not(.login-page) .notice-bar {
  border-color: #aa7e27;
  color: #ffe7ae;
  background: #432f0feF;
  box-shadow: 0 8px 24px #0005;
}

body:not(.login-page) .notice-reload {
  border-color: #ffcf70;
  color: #241600;
  background: #ffcf70;
}

body:not(.login-page) .loading-panel,
body:not(.login-page) .fatal-panel,
body:not(.login-page) .password-panel {
  border-color: #365178;
  background:
    radial-gradient(circle at 100% 0, #3159d82e, transparent 38%),
    linear-gradient(145deg, #12223b, #0d192c);
  box-shadow: 0 28px 80px #0207138f, inset 0 1px #ffffff0a;
}

body:not(.login-page) .spinner {
  border-color: #314665;
  border-top-color: #72e0d0;
  box-shadow: 0 0 18px #58c9b94d;
}

body:not(.login-page) .password-heading {
  border-color: #334965;
}

body:not(.login-page) .password-panel input,
body:not(.login-page) .filter select,
body:not(.login-page) .download-feature-card select,
body:not(.login-page) .admin-form-grid input,
body:not(.login-page) .admin-form-grid select,
body:not(.login-page) .admin-role-select {
  border-color: #526785;
  color: #f5f8ff;
  background: #091426;
  box-shadow: inset 0 1px 3px #02071399;
}

body:not(.login-page) .password-panel input:hover,
body:not(.login-page) .filter select:hover,
body:not(.login-page) .admin-form-grid input:hover,
body:not(.login-page) .admin-form-grid select:hover,
body:not(.login-page) .admin-role-select:hover {
  border-color: #7d98c4;
}

body:not(.login-page) .password-rules {
  border: 1px solid #8f6a28;
  color: #ffe4a6;
  background: #39290f;
}

body:not(.login-page) .fatal-panel button,
body:not(.login-page) .primary-button,
body:not(.login-page) .adopt-button,
body:not(.login-page) .download-feature-link {
  border-color: #6ecfc1;
  color: #fff;
  background: linear-gradient(135deg, #3159d8, #2445b5);
  box-shadow: 0 8px 20px #173da947, inset 0 -2px #58c9b95c;
}

body:not(.login-page) .fatal-panel button:hover,
body:not(.login-page) .primary-button:hover,
body:not(.login-page) .adopt-button:hover,
body:not(.login-page) .download-feature-link:hover {
  border-color: #8bf4e5;
  background: linear-gradient(135deg, #3b64e2, #294dbd);
}

body:not(.login-page) .secondary-button {
  border-color: #506482;
  color: #e9eff9;
  background: #111f35;
}

body:not(.login-page) .secondary-button:hover {
  border-color: #72e0d0;
  color: #fff;
  background: #172b48;
}

body:not(.login-page) .layout > aside {
  border-color: #273d5c;
  background: #0b1729eb;
  box-shadow: 14px 0 32px #0207134d;
  backdrop-filter: blur(16px);
}

body:not(.login-page) .filter {
  border-color: #2a405f;
  background: #0b1729f2;
  box-shadow: 0 8px 18px #02071352;
}

body:not(.login-page) .filter label {
  color: #aabbd3;
  letter-spacing: 0.04em;
}

body:not(.login-page) .monster-list {
  padding: 10px;
}

body:not(.login-page) .list-item {
  border: 1px solid transparent;
  color: #d7e1ef;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

body:not(.login-page) .list-item:hover {
  border-color: #334d72;
  color: #fff;
  background: #152944;
}

body:not(.login-page) .list-item.active {
  border-color: #58c9b970;
  color: #dffffa;
  background: linear-gradient(90deg, #18335a, #132943);
  box-shadow: inset 3px 0 #58c9b9, 0 8px 18px #0207134d;
}

body:not(.login-page) .status-dot {
  border: 1px solid #6c7c94;
  background: #6c7c94;
  box-shadow: 0 0 0 3px #ffffff0d;
}

body:not(.login-page) .status-dot[data-status="approved"] {
  border-color: #55d493;
  background: #31b878;
  box-shadow: 0 0 12px #31b87880;
}

body:not(.login-page) .status-dot[data-status="rejected"] {
  border-color: #ff7882;
  background: #e64e59;
  box-shadow: 0 0 12px #e64e5980;
}

body:not(.login-page) .status-dot[data-status="hold"] {
  border-color: #ffc45a;
  background: #d9921f;
  box-shadow: 0 0 12px #d9921f80;
}

body:not(.login-page) .status-dot[data-missing="true"] {
  border-color: #8090a8;
  background: transparent;
  box-shadow: none;
}

body:not(.login-page) main {
  background: linear-gradient(145deg, #07101f52, #0d1b3252);
}

body:not(.login-page) .review-card {
  border-color: #314a6e;
  background: #101d32;
  box-shadow: 0 28px 80px #0207138f, inset 0 1px #ffffff08;
}

body:not(.login-page) .card-head {
  border-color: #2b4262;
  background:
    radial-gradient(circle at 100% 0, #3159d829, transparent 40%),
    linear-gradient(110deg, #12233c, #0e1a2d);
}

body:not(.login-page) .badge,
body:not(.login-page) .compare-number {
  border: 1px solid #435a7d;
  color: #d9e5f5;
  background: #172844;
  box-shadow: inset 0 1px #ffffff0b;
}

body:not(.login-page) .card-title {
  color: #fff;
}

body:not(.login-page) .visual-panel {
  border-color: #2c4162;
  background:
    radial-gradient(circle at 50% 8%, #3159d820, transparent 38%),
    linear-gradient(145deg, #0a1628, #0e1c32);
}

body:not(.login-page) .stage-card,
body:not(.login-page) .compare-card {
  border-color: #385071;
  color: #eff5ff;
  background: linear-gradient(155deg, #15243b, #101c30);
  box-shadow: 0 14px 32px #02071370, inset 0 1px #ffffff0a;
}

body:not(.login-page) .stage-card[data-status="approved"],
body:not(.login-page) .compare-card[data-status="approved"] {
  --ink: #10251b;
  --muted: #365344;
  --line: #77b990;
  border-color: #168a50;
  color: #10251b;
  background: #c8efd8;
  box-shadow: 0 8px 24px #138a535c, 0 0 0 2px #168a502e;
}

body:not(.login-page) .stage-card[data-status="rejected"],
body:not(.login-page) .compare-card[data-status="rejected"] {
  --ink: #321116;
  --muted: #674249;
  --line: #d78a92;
  border-color: #c92f3a;
  color: #321116;
  background: #ffd0d4;
  box-shadow: 0 8px 24px #d63c455c, 0 0 0 2px #c92f3a2e;
}

body:not(.login-page) .stage-card[data-status="hold"],
body:not(.login-page) .compare-card[data-status="hold"] {
  --ink: #301f00;
  --muted: #684d17;
  --line: #d8ad50;
  border-color: #b66f00;
  color: #301f00;
  background: #ffe2a1;
  box-shadow: 0 8px 24px #c7810b5c, 0 0 0 2px #b66f002e;
}

body:not(.login-page) .stage-card.is-unsaved,
body:not(.login-page) .compare-card.is-unsaved {
  box-shadow: 0 0 0 4px #c92f3a4d, 0 8px 24px #991b1b2e;
}

body:not(.login-page) .stage-card.is-saving,
body:not(.login-page) .compare-card.is-saving {
  cursor: progress;
}

body:not(.login-page) .stage-image,
body:not(.login-page) .candidate-preview {
  border: 1px solid #c8d2e2;
  color: #172033;
  background:
    radial-gradient(circle at 50% 38%, #fff 0 24%, #f3f6fb 74%, #e8edf6 100%);
  box-shadow: inset 0 1px 5px #45557226;
}

body:not(.login-page) .inline-candidate-viewer.is-showing-candidate .inline-candidate-surface {
  border: 3px solid #6687ff;
  box-shadow: 0 0 0 3px #6687ff3d, inset 0 1px 5px #45557226;
}

body:not(.login-page) .inline-candidate-status {
  color: var(--muted);
}

body:not(.login-page) .inline-candidate-warning {
  border-color: #c58d2f;
  color: #ffe6ac;
  background: #3b2a10;
}

body:not(.login-page) .stage-image img,
body:not(.login-page) .candidate-preview img {
  filter: drop-shadow(0 14px 18px #1a2d4a38);
}

body:not(.login-page) .placeholder {
  border-color: #8594aa;
  color: #536079;
  background: #f7f9fd;
}

body:not(.login-page) .placeholder strong {
  color: #172033;
}

body:not(.login-page) .stage-actions button {
  border-color: #3e5575;
  color: #dce7f6;
  background: #162740;
}

body:not(.login-page) .stage-actions button[data-status="approved"] {
  border-color: #2a7d54;
  color: #0b6338;
  background: #d9f4e5;
}

body:not(.login-page) .stage-actions button[data-status="rejected"] {
  border-color: #bd5059;
  color: #9b202a;
  background: #ffe4e6;
}

body:not(.login-page) .stage-actions button[data-status="hold"] {
  border-color: #aa741b;
  color: #704400;
  background: #ffefc7;
}

body:not(.login-page) .stage-actions button.selected {
  box-shadow: inset 0 0 0 1px currentColor, 0 0 0 2px #ffffffa6;
}

body:not(.login-page) .stage-note {
  border-color: #506482;
  color: var(--ink);
  background: #091426e8;
}

body:not(.login-page) .stage-card[data-status="approved"] .stage-note,
body:not(.login-page) .compare-card[data-status="approved"] .stage-note,
body:not(.login-page) .stage-card[data-status="rejected"] .stage-note,
body:not(.login-page) .compare-card[data-status="rejected"] .stage-note,
body:not(.login-page) .stage-card[data-status="hold"] .stage-note,
body:not(.login-page) .compare-card[data-status="hold"] .stage-note {
  border-color: var(--line);
  color: var(--ink);
  background: #ffffffe0;
}

body:not(.login-page) .save-state[data-state="saved"] {
  color: #72e0a9;
}

body:not(.login-page) .save-state[data-state="error"] {
  color: #ff9ea6;
}

body:not(.login-page) .stage-card[data-status="approved"] .save-state[data-state="saved"],
body:not(.login-page) .compare-card[data-status="approved"] .save-state[data-state="saved"],
body:not(.login-page) .stage-card[data-status="rejected"] .save-state[data-state="saved"],
body:not(.login-page) .compare-card[data-status="rejected"] .save-state[data-state="saved"],
body:not(.login-page) .stage-card[data-status="hold"] .save-state[data-state="saved"],
body:not(.login-page) .compare-card[data-status="hold"] .save-state[data-state="saved"] {
  color: #0b6d3c;
}

body:not(.login-page) .stage-card[data-status="approved"] .save-state[data-state="error"],
body:not(.login-page) .compare-card[data-status="approved"] .save-state[data-state="error"],
body:not(.login-page) .stage-card[data-status="rejected"] .save-state[data-state="error"],
body:not(.login-page) .compare-card[data-status="rejected"] .save-state[data-state="error"],
body:not(.login-page) .stage-card[data-status="hold"] .save-state[data-state="error"],
body:not(.login-page) .compare-card[data-status="hold"] .save-state[data-state="error"] {
  color: #a51d28;
}

body:not(.login-page) .stage-tool,
body:not(.login-page) .bundle-button,
body:not(.login-page) .download-link {
  border-color: #536b90;
  color: #c9f8f1;
  background: #10223a;
  box-shadow: inset 0 1px #ffffff0b;
}

body:not(.login-page) .candidate-compare-tool {
  border-color: #72e0d0;
  color: #fff;
  background: linear-gradient(135deg, #3159d8, #2445b5);
  box-shadow: 0 7px 18px #173da947, inset 0 -2px #58c9b95c;
}

body:not(.login-page) .stage-tool:hover,
body:not(.login-page) .bundle-button:hover,
body:not(.login-page) .download-link:hover {
  border-color: #72e0d0;
  color: #fff;
  background: #173250;
}

body:not(.login-page) .details-panel {
  background:
    radial-gradient(circle at 100% 100%, #58c9b912, transparent 34%),
    #101d32;
}

body:not(.login-page) .section-title,
body:not(.login-page) .eyebrow {
  color: #84ddcf;
}

body:not(.login-page) .key {
  border-color: #324a6c;
  background: #0b172a;
  box-shadow: inset 0 1px #ffffff08;
}

body:not(.login-page) .details-copy {
  color: #d0dced;
}

body:not(.login-page) .bundle-button[aria-disabled="true"],
body:not(.login-page) .download-feature-link.is-disabled {
  border-color: #35455d;
  color: #8796aa;
  background: #121d2d;
  box-shadow: none;
}

body:not(.login-page) .card-nav {
  border-color: #2b4160;
  background: #0b1729;
}

body:not(.login-page) .card-nav button {
  border-color: #4a6081;
  color: #e4ecf8;
  background: #14243a;
}

body:not(.login-page) .card-nav button:last-child {
  border-color: #6ed6c7;
  color: #fff;
  background: linear-gradient(135deg, #3159d8, #2445b5);
}

body:not(.login-page) .compare-head h2 {
  color: #fff;
}

body:not(.login-page) .compare-name button {
  color: var(--ink);
}

body:not(.login-page) .compare-stage-name {
  color: var(--muted);
}

body:not(.login-page) dialog::backdrop {
  background: #020713e8;
  backdrop-filter: blur(8px) saturate(80%);
}

body:not(.login-page) .panel-dialog {
  border: 1px solid #3d587f;
  color: #f5f8ff;
  background:
    radial-gradient(circle at 100% 0, #3159d834, transparent 36%),
    linear-gradient(145deg, #13233b, #0c1729 74%);
  box-shadow: 0 34px 120px #000c, inset 0 1px #ffffff0d;
}

body:not(.login-page) .panel-dialog::before {
  position: absolute;
  top: 0;
  right: 22px;
  left: 22px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #58c9b9, #6687ff, transparent);
  content: "";
}

body:not(.login-page) .dialog-header h2 {
  color: #fff;
}

body:not(.login-page) .dialog-close-inline {
  border-color: #536987;
  color: #eaf1fb;
  background: #0d192b;
}

body:not(.login-page) .dialog-close-inline:hover {
  border-color: #72e0d0;
  color: #07101f;
  background: #72e0d0;
}

body:not(.login-page) .download-expiry-note,
body:not(.login-page) .safety-note,
body:not(.login-page) .outer-account-warning {
  border-color: #a97b2b;
  color: #ffe5a9;
  background: #3a290f;
}

body:not(.login-page) .download-feature-card {
  border-color: #365176;
  background: linear-gradient(155deg, #172843, #0e1a2c);
  box-shadow: 0 14px 28px #02071361, inset 0 1px #ffffff09;
}

body:not(.login-page) .download-feature-card.egg {
  border-color: #806b3f;
  background: linear-gradient(155deg, #332a18, #171a25);
}

body:not(.login-page) .download-feature-card.all {
  border-color: #526dab;
  background: linear-gradient(155deg, #1a2c52, #111d34);
}

body:not(.login-page) .download-feature-number {
  color: #b9fff4;
  background: #58c9b921;
  box-shadow: inset 0 0 0 1px #58c9b93d;
}

body:not(.login-page) .download-more {
  border-color: #2e4565;
}

body:not(.login-page) .download-more summary,
body:not(.login-page) .download-context {
  color: #d9fff9;
  background: #142a45;
}

body:not(.login-page) .download-more summary:hover {
  background: #193652;
}

body:not(.login-page) .download-row {
  border-color: #334b6d;
  background: #0c182b;
}

body:not(.login-page) .download-empty,
body:not(.login-page) .admin-empty,
body:not(.login-page) .list-empty {
  border-color: #536883;
  color: #aebdd3;
  background: #0c1829;
}

body:not(.login-page) .candidate-swipe-nav {
  border-color: #3c5884;
  background: #101f37;
  box-shadow: inset 0 1px #ffffff0a;
}

body:not(.login-page) .candidate-swipe-button {
  border-color: #6681ba;
  color: #dce7f8;
  background: #14243c;
}

body:not(.login-page) .candidate-swipe-button:hover:not(:disabled) {
  border-color: #72e0d0;
  color: #fff;
  background: #3159d8;
}

body:not(.login-page) .candidate-image-card {
  border-color: #3b5274;
  background: #0c182a;
}

body:not(.login-page) .candidate-image-card.is-candidate {
  border-color: #5f7fd4;
  background: #12264a;
  box-shadow: 0 16px 38px #02071373, inset 0 0 0 1px #58c9b929;
}

body:not(.login-page) .candidate-kind {
  color: #dce7f5;
  background: #31445f;
}

body:not(.login-page) .candidate-image-card.is-candidate .candidate-kind {
  background: linear-gradient(135deg, #3159d8, #2445b5);
}

body:not(.login-page) .candidate-choice {
  border-color: #3a5274;
  color: #edf4ff;
  background: #0d192b;
}

body:not(.login-page) .candidate-choice:hover,
body:not(.login-page) .candidate-choice.selected {
  border-color: #72e0d0;
  color: #fff;
  background: #153052;
  box-shadow: inset 3px 0 #58c9b9;
}

body:not(.login-page) .candidate-choice img {
  border: 1px solid #60708a;
  background: #f3f6fb;
}

body:not(.login-page) .file-field {
  border-color: #5d789d;
  color: #e8effa;
  background: #0c1a2e;
}

body:not(.login-page) .file-field:hover {
  border-color: #72e0d0;
  background: #10233b;
}

body:not(.login-page) .form-message.is-error {
  color: #ff9ea6;
}

body:not(.login-page) .form-message.is-success {
  color: #72e0a9;
}

body:not(.login-page) .admin-tabs {
  border: 1px solid #324966;
  background: #0a1628;
}

body:not(.login-page) .admin-tab {
  color: #b7c5d9;
}

body:not(.login-page) .admin-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #3159d8, #2445b5);
  box-shadow: 0 8px 18px #173da94f, inset 0 -2px #58c9b95c;
}

body:not(.login-page) .admin-create-form {
  border-color: #344c6e;
  background: #0b1729;
}

body:not(.login-page) .admin-form-grid label {
  color: #c6d3e5;
}

body:not(.login-page) .temporary-password-panel {
  border-color: #49b77e;
  color: #d9ffeb;
  background: #123b2a;
}

body:not(.login-page) .temporary-password-panel code {
  border-color: #66bf8e;
  color: #10251b;
  background: #f5fff9;
}

body:not(.login-page) .admin-user-row,
body:not(.login-page) .admin-audit-row {
  border-color: #344d6f;
  background: #0c182a;
}

body:not(.login-page) .admin-user-row.is-disabled {
  border-color: #8e414b;
  background: #35171d;
}

body:not(.login-page) .admin-user-status.is-active {
  color: #c4ffe0;
  background: #18583a;
}

body:not(.login-page) .admin-user-status.is-disabled {
  color: #ffd4d8;
  background: #722e37;
}

body:not(.login-page) .self-badge {
  color: #d8e2ff;
  background: #2b468c;
}

body:not(.login-page) .admin-action {
  border-color: #536987;
  color: #e8eff9;
  background: #14233a;
}

body:not(.login-page) .admin-action:hover {
  border-color: #72e0d0;
  color: #fff;
  background: #17304e;
}

body:not(.login-page) .danger-outline {
  border-color: #db6b75;
  color: #ffb9c0;
  background: #35161c;
}

body:not(.login-page) .danger-button {
  border-color: #ff8b94;
  background: #9b202b;
  box-shadow: none;
}

body:not(.login-page) .admin-confirm-dialog > p {
  color: #c3d0e2;
}

body:not(.login-page) .toast {
  border-color: #58c9b980;
  background: #0d1b30f2;
  box-shadow: 0 16px 46px #000a, inset 3px 0 #58c9b9;
  backdrop-filter: blur(14px);
}

body:not(.login-page) .toast.error {
  border-color: #ff8e96;
  background: #641b24f2;
  box-shadow: 0 16px 46px #000a, inset 3px 0 #ff8e96;
}

/* WCAG 2.2 target-size baseline for every portal action. */
body:not(.login-page) .top-button,
body:not(.login-page) .view-button,
body:not(.login-page) .notice-reload,
body:not(.login-page) .fatal-panel button,
body:not(.login-page) .primary-button,
body:not(.login-page) .secondary-button,
body:not(.login-page) .filter select,
body:not(.login-page) .list-item,
body:not(.login-page) .stage-actions button,
body:not(.login-page) .stage-tool,
body:not(.login-page) .bundle-button,
body:not(.login-page) .download-link,
body:not(.login-page) .compare-name button,
body:not(.login-page) .card-nav button,
body:not(.login-page) .dialog-close,
body:not(.login-page) .dialog-close-inline,
body:not(.login-page) .download-feature-card select,
body:not(.login-page) .download-feature-link,
body:not(.login-page) .download-more summary,
body:not(.login-page) .candidate-swipe-button,
body:not(.login-page) .inline-candidate-arrow,
body:not(.login-page) .adopt-button,
body:not(.login-page) .admin-tab,
body:not(.login-page) .admin-form-grid input,
body:not(.login-page) .admin-form-grid select,
body:not(.login-page) .admin-role-select,
body:not(.login-page) .admin-action,
body:not(.login-page) .admin-refresh {
  min-height: 44px;
}

body:not(.login-page) .dialog-close-inline {
  width: 44px;
  height: 44px;
}

@media (min-width: 981px) and (max-width: 1280px) {
  body:not(.login-page) {
    --topbar-height: 128px;
  }
}

@media (max-width: 980px) {
  body:not(.login-page) .comparison-nav {
    position: sticky;
    z-index: 29;
    top: 0;
  }

  body:not(.login-page) button:focus-visible,
  body:not(.login-page) a:focus-visible,
  body:not(.login-page) select:focus-visible,
  body:not(.login-page) textarea:focus-visible,
  body:not(.login-page) input:focus-visible {
    scroll-margin-top: 76px;
  }

  body:not(.login-page) .layout > aside {
    border-color: #2a405f;
    background: #0b1729;
    box-shadow: 0 10px 24px #02071366;
  }

  body:not(.login-page) .monster-list {
    scrollbar-color: #536b90 #0b1729;
  }
}

@media (max-width: 620px) {
  body:not(.login-page) {
    background:
      radial-gradient(circle at 5% 3%, #3159d82b 0 8%, transparent 31%),
      linear-gradient(145deg, #07101f, #0b172b);
  }

  body:not(.login-page) .topbar {
    gap: 12px;
    padding: 14px 12px 12px;
  }

  body:not(.login-page) .title-block {
    min-height: 44px;
    padding-left: 48px;
  }

  body:not(.login-page) .title-block::before {
    width: 40px;
    height: 40px;
  }

  body:not(.login-page) .title-block p {
    max-width: 250px;
    line-height: 1.5;
  }

  body:not(.login-page) .stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  body:not(.login-page) .stat {
    width: 100%;
    min-width: 0;
  }

  body:not(.login-page) .account-area {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body:not(.login-page) .account-name {
    grid-column: 1 / -1;
  }

  body:not(.login-page) .top-button {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
    text-align: center;
  }

  body:not(.login-page) .comparison-nav {
    gap: 7px;
    padding: 8px 10px 9px;
    scrollbar-width: thin;
    scrollbar-color: #536b90 #0a1628;
  }

  body:not(.login-page) .view-button {
    min-width: 104px;
    padding-inline: 10px;
  }

  body:not(.login-page) main,
  body:not(.login-page) .compare-mode main {
    padding: 12px 10px 18px;
  }

  body:not(.login-page) .review-card,
  body:not(.login-page) .stage-card,
  body:not(.login-page) .compare-card,
  body:not(.login-page) .panel-dialog {
    border-radius: 14px;
  }

  body:not(.login-page) .stage-actions button {
    min-width: 0;
  }

  body:not(.login-page) .stage-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.login-page) .stage-tool {
    width: 100%;
    padding-inline: 6px;
  }

  body:not(.login-page) .panel-dialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }

  body:not(.login-page) .dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.login-page) .dialog-actions > * {
    width: 100%;
  }
}

@media (max-width: 360px) {
  body:not(.login-page) .title-block h1 {
    font-size: 15px;
  }

  body:not(.login-page) .private-badge {
    padding-inline: 6px;
  }

  body:not(.login-page) .stage-actions button,
  body:not(.login-page) .stage-tool,
  body:not(.login-page) .card-nav button {
    font-size: 11px;
  }

  body:not(.login-page) .candidate-all-comparison-grid {
    gap: 6px;
  }

  body:not(.login-page) .candidate-preview {
    height: 150px;
  }

  body:not(.login-page) .candidate-preview img {
    max-height: 134px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:not(.login-page) *,
  body:not(.login-page) *::before,
  body:not(.login-page) *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  body:not(.login-page) {
    --line: #7087a8;
  }

  body:not(.login-page) .top-button,
  body:not(.login-page) .view-button,
  body:not(.login-page) .list-item,
  body:not(.login-page) .stage-card,
  body:not(.login-page) .compare-card,
  body:not(.login-page) .panel-dialog {
    border-color: #8ba1c0;
  }
}

@media (forced-colors: active) {
  body:not(.login-page)::before,
  body:not(.login-page) .topbar::after,
  body:not(.login-page) .panel-dialog::before {
    display: none;
  }

  body:not(.login-page) button,
  body:not(.login-page) a,
  body:not(.login-page) input,
  body:not(.login-page) select,
  body:not(.login-page) textarea,
  body:not(.login-page) .stage-card,
  body:not(.login-page) .compare-card {
    forced-color-adjust: auto;
  }
}
.rarity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  min-height: 1.65rem;
  padding: 0.15rem 0.48rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.rarity-sur {
  color: #18223f;
  background: linear-gradient(135deg, #fff7b0, #8bf6ff 45%, #e2a7ff 72%, #fff);
  box-shadow: 0 0 14px rgba(132, 225, 255, 0.52);
}

.rarity-ur {
  color: #fff6ce;
  background: linear-gradient(135deg, #7b3cff, #123da8 58%, #e29c25);
}

.rarity-sr {
  color: #e8fbff;
  background: linear-gradient(135deg, #08728d, #124db6);
}

.rarity-r {
  color: #edf4ff;
  background: #334765;
}

/* Character selection board: one monster per horizontal growth row. */
.selection-view-button { border-color: #30d6ff; }
.selection-mode .layout { grid-template-columns: minmax(0, 1fr); }
.selection-mode .layout > aside { display: none; }
.selection-mode main {
  width: 100%;
  max-width: none;
  padding: 20px clamp(12px, 2.5vw, 34px) 56px;
}
.selection-board { min-width: 0; display: grid; gap: 18px; }
.selection-board-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding: 24px;
  color: #eafaff;
  border: 1px solid rgba(48, 214, 255, 0.42);
  border-radius: 22px;
  background: radial-gradient(circle at 90% 15%, rgba(48, 214, 255, 0.18), transparent 34%), linear-gradient(135deg, #0c1d3a, #10274b 64%, #0b1830);
  box-shadow: 0 18px 45px rgba(1, 10, 30, 0.3);
}
.selection-board-head h2 { margin: 4px 0 6px; font-size: clamp(24px, 3vw, 38px); }
.selection-board-head p { margin: 0; color: #b8d9e7; }
.selection-total {
  flex: 0 0 auto;
  padding: 10px 16px;
  color: #07152d;
  border-radius: 999px;
  background: #5de5ff;
}
.selection-create-panel {
  overflow: hidden;
  color: #eafaff;
  border: 1px solid rgba(91, 229, 255, 0.45);
  border-radius: 18px;
  background: #0d1f3d;
}
.selection-create-panel summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  cursor: pointer;
  color: #5de5ff;
  font-weight: 800;
}
.selection-create-form { display: grid; gap: 14px; padding: 0 18px 18px; }
.selection-create-fields { display: grid; grid-template-columns: minmax(220px, 1fr) 110px; gap: 10px; }
.selection-create-fields input,
.selection-create-fields select {
  min-height: 46px;
  padding: 0 13px;
  color: #eefbff;
  border: 1px solid #3f6582;
  border-radius: 12px;
  background: #07152d;
}
.selection-create-drops { display: grid; grid-template-columns: repeat(4, minmax(145px, 1fr)); gap: 10px; }
.selection-create-dropzone,
.selection-dropzone {
  cursor: pointer;
  border: 1.5px dashed #4e809f;
  background: rgba(7, 21, 45, 0.72);
  transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}
.selection-create-dropzone {
  min-height: 88px;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 10px;
  text-align: center;
  border-radius: 13px;
}
.selection-create-dropzone span {
  max-width: 180px;
  overflow: hidden;
  color: #a9cad9;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selection-create-dropzone.is-dragging,
.selection-create-dropzone.has-file,
.selection-dropzone.is-dragging {
  border-color: #5de5ff;
  background: rgba(24, 118, 157, 0.3);
  transform: translateY(-2px);
}
.selection-create-message { min-height: 22px; margin: 0; color: #b8d9e7; }
.selection-board-list { min-width: 0; display: grid; gap: 14px; }
.selection-row {
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(760px, 1fr);
  gap: 14px;
  padding: 14px;
  border: 2px solid #234665;
  border-radius: 18px;
  background: linear-gradient(135deg, #0b1b36, #102745);
  box-shadow: 0 12px 28px rgba(2, 10, 28, 0.24);
}
.selection-row.is-selected {
  border-color: #31dca4;
  background: linear-gradient(135deg, #0b2a36, #10364a);
  box-shadow: 0 0 0 3px rgba(49, 220, 164, 0.12), 0 16px 34px rgba(1, 22, 28, 0.38);
}
.selection-identity {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 6px;
  color: #effbff;
}
.selection-identity h3,
.selection-identity small { margin: 0; }
.selection-identity h3 { margin-top: 2px; font-size: 20px; overflow-wrap: anywhere; }
.selection-identity .rarity-badge { width: fit-content; }
.selection-check {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 2px 10px;
  margin-top: 8px;
  cursor: pointer;
}
.selection-check input { position: absolute; opacity: 0; pointer-events: none; }
.selection-checkmark {
  grid-row: 1 / span 2;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #6e91a5;
  border: 2px solid #527086;
  border-radius: 13px;
  background: #07152d;
  font-size: 25px;
  font-weight: 900;
}
.selection-check input:checked + .selection-checkmark { color: #061d19; border-color: #31dca4; background: #31dca4; }
.selection-check input:focus-visible + .selection-checkmark { outline: 3px solid #fff; outline-offset: 3px; }
.selection-save-state { color: #94bacb; font-size: 12px; }
.selection-edit {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #315571;
}
.selection-edit > strong { color: #79dff4; font-size: 12px; }
.selection-edit label { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 8px; color: #b8d9e7; font-size: 12px; }
.selection-edit select,
.selection-edit button { min-height: 44px; border-radius: 10px; font: inherit; }
.selection-edit select { padding: 0 10px; color: #effbff; border: 1px solid #4e809f; background: #07152d; }
.selection-edit button { padding: 8px 10px; border: 1px solid #4e809f; color: #effbff; background: #17385a; cursor: pointer; font-weight: 800; }
.selection-edit button:disabled { cursor: wait; opacity: 0.65; }
.selection-edit .selection-delete { border-color: #c85a69; color: #ffe9ec; background: #592331; }
.selection-edit-state { min-height: 18px; color: #94bacb; font-size: 11px; }
.selection-stages {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(175px, 1fr));
  gap: 10px;
}
.selection-stage {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(150px, 1fr) auto;
  overflow: hidden;
  border: 1px solid #315571;
  border-radius: 14px;
  background: #07152d;
}
.selection-stage-head { display: flex; justify-content: space-between; gap: 6px; padding: 8px 10px; }
.selection-stage-head strong { color: #effbff; }
.selection-stage-head span { color: #79dff4; font-size: 11px; }
.selection-preview {
  min-width: 0;
  min-height: 150px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: linear-gradient(45deg, #e7eef2 25%, transparent 25%), linear-gradient(-45deg, #e7eef2 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e7eef2 75%), linear-gradient(-45deg, transparent 75%, #e7eef2 75%), #f7fafb;
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.selection-preview:not(:disabled) { cursor: zoom-in; }
.selection-preview img { width: 100%; height: 100%; max-height: 210px; object-fit: contain; }
.selection-preview > span { color: #4d6675; font-weight: 800; }
.selection-dropzone {
  min-height: 44px;
  display: grid;
  place-items: center;
  margin: 8px;
  padding: 5px;
  color: #9dc7d8;
  border-radius: 10px;
  font-size: 12px;
}
.selection-dropzone.is-uploading { cursor: wait; opacity: 0.75; }

@media (max-width: 1080px) {
  .selection-row { grid-template-columns: 170px minmax(720px, 1fr); overflow-x: auto; }
  .selection-create-drops { grid-template-columns: repeat(2, minmax(145px, 1fr)); }
}

@media (max-width: 620px) {
  .selection-mode main { padding: 12px 10px 42px; }
  .selection-board-head { align-items: start; flex-direction: column; padding: 18px; }
  .selection-create-fields,
  .selection-create-drops { grid-template-columns: 1fr; }
  .selection-row { width: 100%; min-width: 0; display: block; padding: 10px; overflow: hidden; }
  .selection-identity { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .selection-check { grid-column: 1 / -1; margin: 2px 0 6px; }
  .selection-stages {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding: 2px 1px 9px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
  }
  .selection-stage { flex: 0 0 min(76vw, 260px); scroll-snap-align: start; }
}
