:root {
  color-scheme: dark;
  --page: #2f2f2f;
  --top: #050505;
  --bar: #5b5b5b;
  --panel: #858585;
  --panel-text: #080808;
  --line: #9a9a9a;
  --menu-line: #bebebe;
  --copper: #8e2f12;
  --copper-dark: #220a03;
  --copper-light: #d9b29a;
  --white: #f5f5f5;
  --yellow: #ffff00;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-color: #d8d8d8 #3c3c3c;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--white);
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.22;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 45px;
  display: flex;
  align-items: center;
  padding: 0;
  border-top: 2px solid #f1e0d2;
  border-bottom: 3px solid var(--copper);
  background:
    linear-gradient(#fff1e6 0 2px, #9f3c1a 2px 9px, #1a0602 9px 17px, #000 17px 100%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 300px;
  height: 43px;
  padding-left: 4px;
  color: var(--white);
  text-decoration: none;
  text-shadow: 2px 2px 0 #000;
}

.brand-mark {
  color: #d9d9d9;
  font-family: Georgia, serif;
  font-size: 16px;
  font-style: italic;
  font-weight: 700;
  transform: skew(-12deg);
}

.brand strong {
  display: block;
  margin-top: 1px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: italic;
  line-height: .9;
  color: #eeeeee;
  transform: skew(-9deg);
}

.brand small {
  display: block;
  margin-left: 46px;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.menu-toggle {
  display: none;
  width: 38px;
  height: 30px;
  margin-left: auto;
  margin-right: 6px;
  border: 1px solid #777;
  background: #202020;
  color: #fff;
  padding: 5px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  margin: 4px 0;
}

.user-strip {
  position: sticky;
  top: 45px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 22px;
  padding: 2px 5px;
  border-bottom: 1px solid #3b3b3b;
  background: linear-gradient(#777, #555);
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  overflow-x: auto;
}

.user-strip b {
  color: #fff;
}

.user-strip span,
.user-strip time,
.mail-pill {
  flex: 0 0 auto;
}

.user-strip time {
  color: var(--yellow);
  font-weight: 700;
}

.mail-pill {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #c9b09e;
  border-radius: 2px;
  background: linear-gradient(#b88a74, #734127 50%, #542915);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
}

.layout {
  display: grid;
  grid-template-columns: 149px minmax(0, 1fr);
  width: 100%;
}

.sidebar {
  position: sticky;
  top: 67px;
  align-self: start;
  height: calc(100vh - 67px);
  overflow-y: auto;
  border-right: 2px solid var(--menu-line);
  background: #303030;
  color: #fff;
}

.nav section {
  margin: 0;
  padding: 0 0 3px;
  border-bottom: 1px solid #1f1f1f;
}

.nav h2 {
  margin: 0;
  padding: 1px 4px 2px 8px;
  border-top: 1px solid #f0b58a;
  border-bottom: 1px solid #1d0802;
  background: linear-gradient(#e6c1aa 0, #9a3a17 24%, #551806 62%, #210801 100%);
  color: #fff;
  font-size: 11px;
  line-height: 1.05;
  font-weight: 700;
  text-transform: uppercase;
}

.nav h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 4px;
  border-radius: 50%;
  background: #fff;
  vertical-align: 2px;
}

.nav a {
  display: block;
  padding: 1px 4px 1px 10px;
  color: #fff;
  text-decoration: none;
  font-size: 11px;
  line-height: 1.18;
}

.nav a::before {
  content: "- ";
}

.nav a:hover,
.nav a.active {
  background: #4a4a4a;
  color: #ffd8c7;
}

.content {
  min-width: 0;
  max-width: 930px;
  padding: 24px 18px 50px 72px;
}

.notice,
.panel,
.action-card,
.auth-card {
  border: 1px solid #222;
  border-top-color: #bdbdbd;
  background: var(--panel);
  color: var(--panel-text);
}

.notice {
  margin-bottom: 24px;
  padding: 7px 8px;
  font-weight: 700;
}

.notice.error {
  background: #8a5a55;
  color: #fff;
}

.panel,
.action-card {
  margin-bottom: 26px;
}

.panel h1,
.panel h2,
.action-card h2 {
  margin: 0;
  padding: 2px 7px 3px;
  border-top: 1px solid #d4a78e;
  border-bottom: 1px solid #240901;
  background: linear-gradient(#e1bca5 0, #a3421d 18%, #6e230b 55%, #1d0701 100%);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-weight: 700;
}

.panel p,
.panel ul,
.action-card p {
  margin: 0;
  padding: 9px 8px;
  color: #0b0b0b;
}

.panel p + p {
  padding-top: 0;
}

.panel ul {
  list-style: none;
  padding: 9px 8px;
}

.panel li + li {
  margin-top: 8px;
}

.intro p {
  font-size: 12px;
}

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

.action-card {
  min-height: 124px;
}

.action-card p {
  padding-top: 6px;
  padding-bottom: 0;
}

.action-card button,
.auth-form button {
  display: block;
  width: calc(100% - 16px);
  margin: 10px 8px 8px;
  min-height: 23px;
  border: 1px solid #1b1b1b;
  background: linear-gradient(#eeeeee, #9e9e9e);
  color: #111;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.action-card button:hover,
.auth-form button:hover {
  background: linear-gradient(#fff, #bdbdbd);
}

.info-grid {
  display: block;
}

.audit {
  display: none;
}

.auth-body {
  display: grid;
  place-items: start center;
  padding-top: 80px;
  background: var(--page);
}

.auth-shell {
  width: min(100% - 22px, 430px);
}

.auth-card {
  color: #111;
}

.auth-brand {
  display: flex;
  min-width: 0;
  height: 45px;
  padding-left: 8px;
  background: #050505;
  border-bottom: 3px solid var(--copper);
}

.auth-card h1 {
  margin: 0;
  padding: 2px 7px 3px;
  background: linear-gradient(#e1bca5 0, #a3421d 18%, #6e230b 55%, #1d0701 100%);
  color: #fff;
  font-size: 13px;
}

.auth-card p {
  margin: 0;
  padding: 9px 8px;
}

.auth-form {
  display: grid;
  gap: 7px;
  padding: 0 8px 8px;
}

.auth-form label {
  display: grid;
  gap: 3px;
  color: #111;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  border: 1px solid #333;
  background: #f2f2f2;
  color: #111;
  padding: 4px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px 10px;
  color: #111;
}

.challenge {
  border: 1px solid #333;
  margin: 4px 0;
  padding: 8px;
  background: #737373;
}

.challenge legend {
  color: #fff;
  font-weight: 700;
}

.hp-field {
  position: absolute;
  left: -10000px;
}

.check-row {
  display: grid !important;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 6px !important;
  color: #111 !important;
  cursor: pointer;
}

.check-row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.fake-box {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #1a1a1a;
  background: #eeeeee;
}

.check-row input:checked + .fake-box::after {
  content: "";
  width: 12px;
  height: 7px;
  border-left: 3px solid #1c5f2c;
  border-bottom: 3px solid #1c5f2c;
  transform: rotate(-45deg) translate(1px, -1px);
}

.challenge small {
  display: block;
  margin-top: 6px;
  color: #111;
}

@media (max-width: 860px) {
  body {
    font-size: 12px;
  }

  .topbar {
    height: 47px;
  }

  .brand {
    min-width: 0;
    max-width: calc(100vw - 54px);
  }

  .brand strong {
    font-size: 18px;
  }

  .brand small {
    margin-left: 34px;
    font-size: 7px;
  }

  .menu-toggle {
    display: block;
  }

  .user-strip {
    top: 47px;
    gap: 9px;
  }

  .layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 69px auto 0 0;
    z-index: 50;
    width: min(78vw, 230px);
    height: auto;
    transform: translateX(-105%);
    transition: transform .18s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .content {
    max-width: none;
    padding: 16px 8px 36px;
  }

  .action-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 520px) {
  .content {
    padding-top: 12px;
  }

  .panel,
  .action-card {
    margin-bottom: 16px;
  }

  .auth-links {
    display: grid;
  }
}
