:root {
  color-scheme: dark;
  --background: #101115;
  --panel: #191b20;
  --panel-raised: #202229;
  --line: #393b43;
  --gold: #e7bd76;
  --gold-light: #f9db9e;
  --text: #f3eee6;
  --muted: #bcb9b4;
  --good: #a8d7ae;
  --danger: #ffac9f;
  font-family: "DM Sans", "Malgun Gothic", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.55rem, 4vw, 2.15rem); }
h2 { font-size: 1.24rem; }
h3 { font-size: 1.12rem; overflow-wrap: anywhere; }
p { color: var(--muted); line-height: 1.55; }

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding: 14px max(18px, calc((100% - 1120px) / 2));
  border-bottom: 1px solid #493c2c;
  background: #17171c;
}
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  height: 42px;
  border: 1px solid #7d603d;
  border-radius: 10px;
  background: linear-gradient(140deg, #3b3021, #201c19);
  color: var(--gold-light);
  font: 700 25px "Playfair Display", Georgia, serif;
}
.brand-name { color: var(--gold-light); font: 700 clamp(1.04rem, 4.2vw, 1.5rem) "Playfair Display", Georgia, serif; }
.brand-detail { font-size: .77rem; margin-top: 3px; }
.main { max-width: 1168px; margin-inline: auto; padding: 34px 24px 44px; }
.notice { border: 1px solid #705433; background: #2a231a; padding: 12px 15px; border-radius: 8px; margin-bottom: 18px; color: var(--gold-light); }
.notice.error, .inline-error { color: var(--danger); }
.notice.error { border-color: #713e38; background: #2b2020; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.access-card { max-width: 460px; padding: 28px; margin: 34px auto; }
.access-card > p { margin-top: 8px; }
.form-stack { display: grid; gap: 14px; }
.access-card form, .enrollment { margin-top: 22px; }
label { display: grid; gap: 7px; font-size: .86rem; color: var(--text); }
input, select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 9px 10px;
  border: 1px solid #565862;
  border-radius: 7px;
  background: #141519;
  color: var(--text);
  font-size: 1rem;
}
input::placeholder { color: #aaa8a2; }
input:read-only { color: var(--gold-light); }
.button, .quiet, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 7px;
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.3;
}
.button { padding: 8px 13px; border: 1px solid #5e6068; background: var(--panel-raised); color: var(--text); }
.button:hover:not(:disabled) { background: #2c2e35; }
.button.primary { background: var(--gold); border-color: var(--gold); color: #231b11; }
.button.primary:hover:not(:disabled) { background: var(--gold-light); }
.button.danger { border-color: #a55e55; color: var(--danger); }
.quiet, .icon-button { background: transparent; border: 0; color: var(--muted); }
.quiet { padding: 6px 0; margin-top: 7px; text-decoration: underline; }
.icon-button { min-width: 40px; font-size: 1.5rem; }
.enrollment img { display: block; width: 196px; max-width: 100%; height: auto; padding: 9px; background: white; border-radius: 8px; margin-bottom: 13px; }

.page-heading, .section-heading, .card-heading, .dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.page-heading { margin-bottom: 24px; }
.page-heading p, .section-heading p { margin-top: 5px; font-size: .85rem; }
.tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 700; padding: 10px 8px 12px; min-height: 44px; }
.tabs button[aria-selected="true"] { border-color: var(--gold); color: var(--gold-light); }
.tabs span { color: var(--muted); font-size: .8em; margin-left: 3px; }
.section-heading { margin-block: 25px 15px; }
.card-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 455px), 1fr)); gap: 14px; }
.license-card { padding: 17px; min-width: 0; }
.card-heading { align-items: flex-start; }
.status-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.chip { display: inline-block; white-space: nowrap; border: 1px solid #565862; border-radius: 99px; padding: 3px 8px; color: var(--muted); font-size: .72rem; }
.chip.good { border-color: #456b4d; color: var(--good); }
.chip.warn { border-color: #79603a; color: var(--gold-light); }
.chip.bad { border-color: #835048; color: var(--danger); }
.details { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 14px; row-gap: 6px; padding-block: 12px; margin: 13px 0; border-block: 1px solid var(--line); font-size: .82rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.card-actions, .dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { border: 1px dashed #58535a; border-radius: 12px; padding: 23px; text-align: center; }
.command-note { font-size: .83rem; margin-bottom: 12px; }
.command-note.confirmed { color: var(--good); }
.command-note.pending { color: var(--gold-light); }

#editor { width: min(100% - 24px, 510px); max-height: calc(100dvh - 32px); margin: auto; padding: 20px; color: var(--text); background: var(--panel); border: 1px solid #79603a; border-radius: 14px; overflow: auto; }
#editor::backdrop { background: #000b; }
#editor-fields { margin-block: 14px 18px; }
.dialog-actions { justify-content: flex-end; }
.inline-error { margin-bottom: 10px; }
.code-actions { display: flex; align-items: flex-end; gap: 8px; }
.code-actions label { flex: 1; min-width: 0; }
.code-actions .button { min-height: 43px; flex: none; }
.day-hour { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 560px) {
  .masthead { padding-inline: 14px; }
  .brand { gap: 9px; }
  .brand-mark { flex-basis: 36px; height: 36px; }
  .main { padding: 24px 14px 32px; }
  .access-card { padding: 20px; margin-block: 18px; }
  .page-heading, .section-heading { align-items: flex-start; }
  .page-heading .button, .section-heading .button { flex: none; }
  .card-heading { flex-wrap: wrap; }
  .status-chips { justify-content: flex-start; }
}
.checkbox-label { display: flex; align-items: center; }
.checkbox-label input { display: inline-block; width: 20px; min-height: 20px; height: 20px; accent-color: var(--gold); }
