:root {
  --bg: #12141a;
  --panel: #1a1d25;
  --line: #2c313c;
  --text: #e6e8ec;
  --muted: #9aa2b1;
  --accent: #6ee7a8;
  --danger: #ff8a7a;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.wrap { max-width: 1000px; margin: 0 auto; padding: 24px 16px 64px; }

header.site {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
header.site .wrap { padding: 14px 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
header.site a { color: var(--text); text-decoration: none; }
header.site a:hover { text-decoration: underline; }
.brand { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.spacer { flex: 1; }

h1 { font-size: 20px; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 4px; }
h2 { font-size: 15px; letter-spacing: .04em; text-transform: uppercase; margin: 32px 0 8px; }
p.lede { color: var(--muted); margin: 0 0 20px; }

section.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .08em; white-space: nowrap; }
tbody tr:hover { background: #20242e; }
td.id { white-space: nowrap; color: var(--accent); }
td.price { white-space: nowrap; text-align: right; }
.table-scroll { overflow-x: auto; }

.tag { font-size: 11px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--muted); }
.tag.available { color: var(--accent); border-color: var(--accent); }
.tag.pending { color: #e8c66e; border-color: #e8c66e; }
.tag.sold { color: var(--muted); }
.tag.paid { color: var(--accent); border-color: var(--accent); }
.tag.expired, .tag.cancelled { color: var(--danger); border-color: var(--danger); }
.tag.hidden { color: var(--danger); border-color: var(--danger); }

form { display: grid; gap: 12px; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: #0d0f14;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  width: 100%;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  font: inherit;
  cursor: pointer;
  background: var(--accent);
  color: #0d0f14;
  border: 0;
  border-radius: var(--radius);
  padding: 9px 16px;
  font-weight: 700;
  justify-self: start;
}
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 400; padding: 4px 10px; }
button.danger { background: var(--danger); }
button[disabled] { opacity: .5; cursor: not-allowed; }

.msg { font-size: 13px; padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--line); }
.msg.error { color: var(--danger); border-color: var(--danger); }
.msg.ok { color: var(--accent); border-color: var(--accent); }
.msg:empty { display: none; }

.hint { font-size: 12px; color: var(--muted); }
.hint.warn { color: var(--danger); border-left: 2px solid var(--danger); padding-left: 10px; margin-top: 12px; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.auth { max-width: 420px; }

.order p { margin: 4px 0; font-size: 13px; }
.order p .k { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 10px; margin-right: 6px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.strong { color: var(--accent); font-weight: 700; }
.small { font-size: 11px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
td select { padding: 4px 6px; font-size: 12px; }

.numberbox {
  font-size: 13px; word-break: break-all; padding: 8px 10px; margin: 10px 0;
  background: #0d0f14; border: 1px solid var(--accent); border-radius: 4px; color: var(--accent);
}

/* notes spreadsheet */
table.sheet-table { font-size: 12px; }
table.sheet-table th, table.sheet-table td { padding: 3px; white-space: nowrap; }
table.sheet-table input {
  width: 110px; padding: 5px 6px; font-size: 12px; background: #0d0f14;
  border: 1px solid var(--line); border-radius: 3px; color: var(--text);
}
table.sheet-table th input {
  width: 110px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  font-size: 10px; color: var(--muted); background: transparent; border: 1px solid transparent;
}
table.sheet-table th input:hover, table.sheet-table th input:focus { border-color: var(--line); background: #0d0f14; }
table.sheet-table td.rownum { color: var(--muted); font-size: 11px; text-align: right; white-space: nowrap; }
table.sheet-table button.rowdel { padding: 3px 8px; font-size: 11px; }
#sheetPager { align-items: center; }

details summary { cursor: pointer; color: var(--text); font-size: 13px; font-weight: 600; margin-bottom: 8px; }
details textarea { margin-top: 8px; }
code { background: #0d0f14; border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; font-size: 12px; }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10;
}
.modal-backdrop.hidden { display: none; }
.modal { max-width: 440px; width: 100%; }

/* 404 */
.code404 {
  font-size: 64px; line-height: 1; margin: 8px 0 4px;
  color: var(--accent); letter-spacing: .08em; font-weight: 700;
}
ul.plain { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; }
ul.plain li { padding: 5px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
ul.plain li:last-child { border-bottom: 0; }
ul.plain a { color: var(--text); }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); margin-top: 48px; }
.site-footer .wrap { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 16px; font-size: 12px; color: var(--muted); }
.site-footer a { color: var(--muted); }
.site-footer .muted { color: #5c6473; }

/* ---- create-form slot grid ---- */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 10px 0; }
.slot-grid label { font-size: 10px; }

/* ---- account detail subpanel ---- */
.subpanel { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 14px; background: #0d0f14; }
.subpanel h3 { font-size: 15px; color: var(--accent); }
.subpanel p .k { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 10px; margin-right: 6px; }
h4 { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0; }
td.muted, .muted { color: var(--muted); }

/* ---- admin vouch management grid ---- */
.vouch-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 16px; }
.vouch-admin-grid .vouch-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; background: #0d0f14; display: grid; gap: 8px; }
.vouch-admin-grid .vouch-card img { width: 100%; height: 130px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.vouch-cap { font-size: 12px; }

/* ---- public vouch gallery ---- */
.vouch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 8px; }
.vouch-grid .vouch-card { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0d0f14; }
.vouch-grid .vouch-card img { width: 100%; height: 200px; object-fit: cover; display: block; cursor: zoom-in; transition: opacity .15s; }
.vouch-grid .vouch-card img:hover { opacity: .85; }
.vouch-grid figcaption { padding: 8px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---- lightbox ---- */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 20; cursor: zoom-out; }
.lightbox.hidden { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 8px 40px rgba(0,0,0,.6); }

/* file input */
input[type="file"] { padding: 6px; font-size: 12px; }

/* always-visible detail group on the add-listing form */
.detail-block { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 12px; }

/* admin-only detail fields (d, g) — subtle tint so they're distinguishable */
.admin-only { border-color: #6b6250 !important; background: #1b1710 !important; }
