:root {
  color-scheme: dark;
  --bg: #0e1917;
  --panel: #172622;
  --edge: #2b3c35;
  --muted: #a0afa6;
  --ink: #f7f1e4;
  --gold: #e4c185;
  --green: #a4d3b0;
  --red: #f0a298;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.5 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
a {
  color: var(--gold);
}
.shell {
  max-width: 1320px;
  margin: auto;
  padding: 0 40px;
}
header {
  border-bottom: 1px solid var(--edge);
  background: #101d19;
}
header .shell {
  height: 88px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.mark {
  width: 44px;
  height: 44px;
  border: 1px solid #718b6d;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 26px;
}
.brand {
  font-weight: 650;
  letter-spacing: -0.3px;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 450;
}
.spacer {
  flex: 1;
}
.server-pill {
  font-size: 12px;
  border: 1px solid var(--edge);
  border-radius: 20px;
  padding: 7px 12px;
  color: var(--muted);
}
nav {
  display: flex;
  gap: 30px;
  border-bottom: 1px solid var(--edge);
  margin-top: 22px;
}
nav button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 16px 0;
  border-bottom: 2px solid transparent;
}
nav button.active {
  color: var(--gold);
  border-color: var(--gold);
}
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 42px 0 30px;
}
.eyebrow {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 2.5px;
  text-transform: uppercase;
}
.hero h1 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 43px;
  letter-spacing: -1.1px;
  line-height: 1.15;
  margin: 10px 0;
}
.hero p {
  color: var(--muted);
  margin: 10px 0 0;
  max-width: 600px;
}
.primary,
.secondary,
.quiet,
.danger {
  border: 1px solid var(--edge);
  border-radius: 9px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background 0.15s;
}
.primary {
  color: #17231b;
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 650;
}
.primary:hover {
  background: #f3d9aa;
}
.secondary {
  background: #21372d;
  color: var(--ink);
}
.secondary:hover {
  background: #2c483a;
}
.quiet {
  background: none;
  color: var(--muted);
}
.danger {
  background: #422622;
  color: #ffc2b4;
  border-color: #644039;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0 0 35px;
}
.stat {
  background: linear-gradient(130deg, #1d3027, #16251f);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 19px 23px;
}
.stat .value {
  font-size: 30px;
  line-height: 1.2;
  font-family: Georgia, serif;
  margin: 6px 0;
}
.stat .caption {
  color: var(--muted);
  font-size: 12px;
}
.section-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 16px;
}
.section-bar h2 {
  font-size: 17px;
  font-weight: 550;
  margin: 0;
}
.count {
  color: var(--muted);
  font-size: 12px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 50px;
}
.card {
  border: 1px solid var(--edge);
  border-radius: 13px;
  background: var(--panel);
  overflow: hidden;
}
.card-art {
  height: 140px;
  background:
    radial-gradient(ellipse at 75% 25%, #38664c 0, transparent 58%),
    linear-gradient(130deg, #283d2e, #101f1b);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.card-art img {
  height: 100%;
  width: 100%;
  object-fit: contain;
}
.card .badge {
  position: absolute;
  top: 13px;
  left: 13px;
  background: #102019e8;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 20px;
  border: 1px solid #41604d;
  color: var(--muted);
}
.badge.live {
  color: #b4e8bb;
  border-color: #497450;
}
.badge.retrying,
.badge.starting {
  color: var(--gold);
  border-color: #806f49;
}
.badge.stalled {
  color: var(--red);
  border-color: #945a50;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.card-body {
  padding: 18px;
}
.card h3 {
  margin: 0 0 5px;
  font-size: 17px;
  font-weight: 550;
}
.card .detail {
  font-size: 12px;
  color: var(--muted);
}
.card-meta {
  display: flex;
  gap: 8px;
  margin: 17px 0;
  color: var(--muted);
  font-size: 11px;
}
.chip {
  padding: 3px 7px;
  background: #22382e;
  border-radius: 4px;
}
.card-actions {
  display: flex;
  gap: 7px;
  border-top: 1px solid var(--edge);
  padding-top: 14px;
}
.card-actions button {
  padding: 7px 10px;
  font-size: 12px;
}
.add-card {
  min-height: 320px;
  border: 1px dashed #47604e;
  background: #13221b;
  border-radius: 13px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.add-card b {
  font-size: 26px;
  color: var(--gold);
  font-weight: 300;
}
.add-card strong {
  color: var(--ink);
  font-weight: 450;
}
.add-card small {
  font-size: 12px;
}
.view {
  display: none;
}
.view.active {
  display: block;
}
.box {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 13px;
  padding: 24px;
  margin: 20px 0;
}
.box h2 {
  margin: 0 0 8px;
  font-size: 18px;
}
.box p {
  color: var(--muted);
  max-width: 850px;
}
.export-line {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 15px 0;
}
.export-line input {
  flex: 1;
  width: 100%;
  font-family: monospace;
  font-size: 12px;
}
.notice {
  border-left: 3px solid var(--gold);
  background: #243025;
  padding: 15px 18px;
  margin: 20px 0;
  color: #e4d7b6;
  font-size: 13px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 15px;
}
label {
  font-size: 12px;
  color: #c6d3c7;
}
.field small {
  font-size: 11px;
  color: var(--muted);
}
input,
textarea,
select {
  background: #0d1b15;
  border: 1px solid #3b5142;
  color: var(--ink);
  border-radius: 7px;
  padding: 10px 12px;
  width: 100%;
}
textarea {
  resize: vertical;
  min-height: 95px;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--gold);
}
dialog {
  border: 1px solid #4b604f;
  border-radius: 15px;
  background: #172820;
  color: var(--ink);
  width: min(640px, calc(100% - 32px));
  max-height: 90vh;
  padding: 25px;
}
dialog::backdrop {
  background: #040b08bf;
  backdrop-filter: blur(4px);
}
dialog h2 {
  font-weight: 450;
  font-size: 24px;
  margin: 0 0 23px;
}
.dialog-foot {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 18px;
}
.error {
  color: #ffb5a4;
  font-size: 13px;
  min-height: 20px;
  white-space: pre-wrap;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0b1711;
  padding: 14px;
  font-size: 11px;
  max-height: 58vh;
  overflow: auto;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #18261b;
  border-radius: 9px;
  padding: 12px 22px;
  display: none;
  box-shadow: 0 10px 40px #0008;
  z-index: 10;
  max-width: 90vw;
}
.footer {
  border-top: 1px solid var(--edge);
  padding: 20px 0 30px;
  font-size: 11px;
  color: #7f9585;
  display: flex;
  justify-content: space-between;
}
.library-row {
  padding: 10px;
  border-bottom: 1px solid var(--edge);
  display: flex;
  gap: 12px;
  align-items: center;
}
.library-row span {
  flex: 1;
  word-break: break-word;
  font-size: 12px;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 10%, #2b4530 0, transparent 60%), #0e1917;
}
.login-box {
  width: min(410px, calc(100vw - 32px));
  padding: 35px;
  background: #172820ed;
  border: 1px solid #46604b;
  border-radius: 18px;
  box-shadow: 0 25px 100px #0004;
}
.login-box .mark {
  margin-bottom: 25px;
}
.login-box h1 {
  font:
    36px Georgia,
    serif;
  margin: 0 0 6px;
}
.login-box p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 26px;
}
.login-box button {
  width: 100%;
  margin-top: 12px;
}
.login-foot {
  text-align: center;
  font-size: 10px;
  color: #8da18f;
  margin-top: 22px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.muted {
  color: var(--muted);
}
@media (max-width: 1050px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .shell {
    padding: 0 25px;
  }
}
@media (max-width: 650px) {
  .shell {
    padding: 0 17px;
  }
  header .shell {
    height: 75px;
  }
  .server-pill {
    display: none;
  }
  .hero {
    padding: 30px 0 23px;
    align-items: flex-start;
    gap: 14px;
  }
  .hero h1 {
    font-size: 32px;
  }
  .hero p {
    font-size: 12px;
  }
  .hero .primary {
    font-size: 12px;
    padding: 9px;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 12px;
  }
  .stat .value {
    font-size: 24px;
  }
  .stat .caption {
    font-size: 10px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  nav {
    gap: 23px;
    overflow: auto;
    white-space: nowrap;
  }
  nav button {
    font-size: 12px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .export-line {
    flex-wrap: wrap;
  }
  .export-line input {
    flex-basis: 100%;
  }
  .footer {
    gap: 12px;
  }
  .brand small {
    font-size: 9px;
  }
}
@media (max-width: 650px) {
  .section-bar {
    flex-wrap: wrap;
    row-gap: 12px;
  }
  .section-bar .spacer {
    display: none;
  }
  #collection-filter {
    margin-left: auto;
  }
  #last-update {
    flex-basis: 100%;
  }
  .hero > div {
    min-width: 0;
  }
  .hero .primary {
    flex-shrink: 0;
  }
}
