:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #666057;
  --paper: #f8f8f6;
  --panel: #ffffff;
  --line: #d8d7d0;
  --accent: #c83a24;
  --accent-dark: #8f2012;
  --green: #197b55;
  --amber: #8a6414;
  --shadow: 0 24px 70px rgba(23, 23, 23, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(200, 58, 36, 0.08), transparent 32rem),
    repeating-linear-gradient(90deg, rgba(23, 23, 23, 0.035) 0 1px, transparent 1px 72px),
    var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.hero {
  width: min(100%, 720px);
  padding: clamp(28px, 6vw, 64px);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 32px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.code-row,
.copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 16px;
  font-size: 1.1rem;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(200, 58, 36, 0.13);
}

button {
  min-height: 56px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  padding: 0 22px;
  font-weight: 800;
  cursor: pointer;
}

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

.error {
  margin: 14px 0 0;
  color: var(--accent-dark);
  font-weight: 800;
}

.copy-box {
  display: grid;
  gap: 10px;
}

.copy-row input {
  font-family: "Menlo", "Consolas", monospace;
  font-size: 0.98rem;
}

.meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.secondary-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 28px;
  color: var(--ink);
  font-weight: 800;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.admin-shell {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-header h1 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stats div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
}

.stats strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1;
}

.stats span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.give-list {
  margin-bottom: 18px;
}

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

.section-heading h2 {
  margin: 0;
  font-size: 1.05rem;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

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

.give-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 6px solid var(--amber);
  border-radius: 6px;
  padding: 14px;
}

.give-card.is-given {
  border-left-color: var(--green);
}

.give-card code {
  display: block;
  margin-bottom: 4px;
  font-size: 1.25rem;
  font-weight: 900;
}

.give-card strong,
.give-card span {
  display: block;
}

.give-card form {
  margin: 0;
}

.card-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
}

.outline-button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.outline-button:hover {
  color: #fff;
  border-color: var(--accent-dark);
}

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

.check-columns > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
}

.check-columns h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.check-columns ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-columns li {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  align-items: baseline;
  gap: 10px;
  min-height: 30px;
}

.check-columns p {
  margin: 0;
  color: var(--muted);
}

.check-columns em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

td strong,
td span {
  display: block;
}

td span {
  color: var(--muted);
  margin-top: 3px;
}

.hanzi {
  font-family: "Songti SC", "STSong", serif;
  font-size: 1.05rem;
}

code {
  font-family: "Menlo", "Consolas", monospace;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.pill.ready {
  color: var(--amber);
  background: rgba(138, 100, 20, 0.12);
}

.pill.given {
  color: var(--green);
  background: rgba(25, 123, 85, 0.12);
}

.pill.not-given {
  color: var(--amber);
  background: rgba(138, 100, 20, 0.12);
}

.pill.revealed {
  color: var(--green);
  background: rgba(25, 123, 85, 0.12);
}

.pill.missing {
  color: var(--accent-dark);
  background: rgba(200, 58, 36, 0.12);
}

tr.missing {
  background: rgba(200, 58, 36, 0.045);
}

.notice {
  margin-top: 18px;
  padding: 18px;
  background: #fff8e7;
  border: 1px solid #dec783;
  border-radius: 6px;
}

.notice h2 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.notice p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 700px) {
  .shell {
    align-items: start;
    padding: 14px;
  }

  .hero {
    margin-top: 8vh;
    padding: 24px;
  }

  .code-row,
  .copy-row,
  .stats,
  .give-grid,
  .check-columns,
  .admin-header {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: grid;
    align-items: start;
  }

  .give-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .card-pills {
    justify-content: start;
  }

  .check-columns li {
    grid-template-columns: 72px 1fr;
  }

  .check-columns em {
    grid-column: 2;
  }

  .admin-header {
    display: grid;
    align-items: start;
  }

  button {
    width: 100%;
  }
}
