.help-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--text-main);
}

.help-list li {
  margin-bottom: 8px;
}

.settings-block {
  margin: 0;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f5f9fd;
  color: #1d3146;
  font-family: "Consolas", "Courier New", monospace;
  line-height: 1.45;
  overflow-x: auto;
}

.meta-line {
  margin: 12px 0 0;
  color: var(--text-muted);
}

.mono {
  font-family: "Consolas", "Courier New", monospace;
}

.table-wrap {
  overflow-x: auto;
}

.quad-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.plug-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.codebook-card {
  border-radius: 18px;
  border: 1px solid rgba(89, 60, 29, 0.25);
  background: linear-gradient(130deg, #433021, #2f2117 50%, #24170f);
  padding: 16px;
  box-shadow: 0 24px 36px rgba(27, 20, 12, 0.32);
}

.paper-stack {
  position: relative;
}

.paper-stack::before,
.paper-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
}

.paper-stack::before {
  transform: translate(8px, 7px) rotate(-1deg);
  background: #d8c8a8;
  opacity: 0.42;
}

.paper-stack::after {
  transform: translate(-5px, -4px) rotate(0.7deg);
  background: #cdb991;
  opacity: 0.28;
}

.codebook-paper {
  position: relative;
  z-index: 1;
  border-radius: 14px;
  border: 1px solid #b79f73;
  padding: 18px;
  color: #2f2017;
  font-family: "American Typewriter", "Courier New", serif;
  background:
    radial-gradient(circle at 15% 18%, rgba(255, 255, 255, 0.65), transparent 38%),
    radial-gradient(circle at 82% 70%, rgba(113, 79, 43, 0.12), transparent 36%),
    radial-gradient(circle at 44% 35%, rgba(95, 65, 35, 0.1), transparent 42%),
    repeating-linear-gradient(
      8deg,
      rgba(70, 46, 24, 0.06) 0,
      rgba(70, 46, 24, 0.06) 2px,
      rgba(246, 232, 204, 0.14) 3px,
      rgba(246, 232, 204, 0.14) 8px
    ),
    linear-gradient(145deg, #e8d8b4, #d4bf92 55%, #ccb17f);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 223, 0.45),
    inset 0 40px 55px rgba(255, 249, 237, 0.2),
    inset 0 -36px 42px rgba(84, 56, 28, 0.14),
    0 22px 28px rgba(27, 17, 9, 0.25);
}

.codebook-paper::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 16%, rgba(82, 38, 24, 0.16), transparent 35%),
    radial-gradient(circle at 92% 90%, rgba(79, 44, 20, 0.14), transparent 33%),
    radial-gradient(circle at 56% 6%, rgba(255, 253, 241, 0.22), transparent 29%);
  mix-blend-mode: multiply;
}

.codebook-header {
  margin-bottom: 14px;
}

.codebook-stamp {
  margin: 0;
  display: inline-block;
  border: 2px solid rgba(98, 21, 12, 0.65);
  color: rgba(116, 24, 14, 0.9);
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 10px;
  transform: rotate(-3deg);
}

.codebook-header h2 {
  margin: 12px 0 8px;
  color: #3d2719;
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.codebook-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.codebook-wrap {
  border: 1px solid rgba(72, 45, 20, 0.35);
  border-radius: 8px;
  background: rgba(247, 238, 216, 0.5);
  overflow-x: hidden;
}

.enigma-sheet {
  min-width: 980px;
}

.enigma-sheet th,
.enigma-sheet td {
  text-align: center;
  padding: 8px 6px;
}

.codebook-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.codebook-table th,
.codebook-table td {
  color: #2b1c13;
  border: 1px solid rgba(66, 43, 22, 0.35);
  border-bottom: 1px solid rgba(66, 43, 22, 0.35);
  background: rgba(250, 242, 221, 0.72);
  font-size: 0.88rem;
}

.codebook-table thead th {
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.codebook-table th:nth-child(1),
.codebook-table td:nth-child(1) {
  width: 11%;
}

.codebook-table th:nth-child(2),
.codebook-table td:nth-child(2) {
  width: 10%;
}

.codebook-table th:nth-child(3),
.codebook-table td:nth-child(3) {
  width: 13%;
}

.codebook-table th:nth-child(4),
.codebook-table td:nth-child(4),
.codebook-table th:nth-child(5),
.codebook-table td:nth-child(5) {
  width: 10%;
}

.codebook-table th:nth-child(6),
.codebook-table td:nth-child(6) {
  width: 29%;
}

.codebook-table th:nth-child(7),
.codebook-table td:nth-child(7) {
  width: 17%;
}

.mono-cell {
  font-family: "Courier New", monospace;
  letter-spacing: 0.03em;
}

.month-codebook-table {
  min-width: 0;
}

.month-codebook-table th,
.month-codebook-table td {
  font-size: 0.78rem;
  padding: 6px 4px;
}

.month-codebook-table .mono-cell {
  letter-spacing: 0.02em;
  white-space: normal;
}

.sheet-banner {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 10px;
  align-items: center;
  text-align: center;
}

.sheet-banner span {
  font-weight: 700;
}

.codebook-footnote {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: rgba(73, 46, 27, 0.9);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tool-shell.sheet-mode {
  width: min(1320px, 100%);
}

body.sheet-mode .tool-main {
  padding-left: 20px;
  padding-right: 20px;
}

@media (max-width: 700px) {
  .codebook-card {
    padding: 10px;
  }

  .codebook-paper {
    padding: 12px;
  }

  .codebook-meta {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .codebook-footnote {
    flex-direction: column;
    gap: 4px;
  }

  .meta-line {
    font-size: 0.9rem;
  }
}
