.admin-body .site-footer,
main.admin-main {
  max-width: 64rem;
}

.demo-banner {
  background: var(--soon);
  color: var(--crimson-deep);
  border: 1px solid var(--crimson);
  border-radius: 1rem;
  padding: 1rem 1.05rem;
  margin-bottom: 0.9rem;
}

.demo-banner p + p {
  margin-top: 0.55rem;
}

.ops-nav,
.admin-nav {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.ops-nav .button {
  margin-top: 0;
}

.ops-nav .is-current {
  outline: 3px solid var(--crimson-deep);
  outline-offset: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.65rem 0.8rem;
  border: 2px solid var(--crimson);
  border-radius: 0.75rem;
  background: var(--white);
  color: var(--crimson-deep);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.nav-link:focus-visible {
  outline: 3px solid var(--crimson-deep);
  outline-offset: 3px;
}

h3 {
  margin: 0 0 0.55rem;
  font-family: Georgia, "Palatino Linotype", Palatino, serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

.intro,
.help,
.check-list,
.history-list,
.file-status {
  color: var(--muted);
}

.intro {
  margin-bottom: 0.75rem;
}

.help,
.file-status {
  margin-top: 0.3rem;
  font-size: 0.92rem;
  font-weight: 400;
}

label,
.field-label {
  display: block;
  margin-top: 0.75rem;
  font-weight: 700;
}

.fields label:first-child,
.vendor-row label:first-child {
  margin-top: 0;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid #e4c4c9;
  border-radius: 0.65rem;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

textarea {
  min-height: 6.5rem;
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--crimson-deep);
  outline-offset: 2px;
}

input:disabled,
select:disabled,
textarea:disabled,
input.is-calculated {
  background: #f7f1f1;
  color: var(--ink);
}

.drawer-switch {
  display: grid;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.drawer-config-row {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
}

.check-label input {
  width: 1.25rem;
  min-height: 1.25rem;
  margin-top: 0;
}

.signoff,
.square-lock {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
}

.signoff {
  border: 1px solid var(--line);
  background: var(--white);
}

.square-lock {
  border: 1px dashed var(--crimson);
  background: var(--soon);
}

.summary h5,
.summary h6 {
  margin: 0.8rem 0 0.25rem;
  font-size: 1rem;
}

.summary-drawer + .summary-drawer {
  margin-top: 0.9rem;
}

.count-tables {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.35rem;
}

.count-table-wrap {
  overflow-x: auto;
}

.count-table,
.summary-count {
  width: 100%;
  border-collapse: collapse;
}

.count-table caption,
.summary-count caption {
  caption-side: top;
  margin-bottom: 0.35rem;
  font-weight: 700;
  text-align: left;
}

.count-table th,
.count-table td,
.summary-count th,
.summary-count td {
  padding: 0.35rem 0.3rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.count-table th,
.summary-count th {
  font-size: 0.88rem;
}

.count-table td:last-child,
.count-table th:last-child,
.summary-count td:last-child,
.summary-count th:last-child {
  text-align: right;
  white-space: nowrap;
}

.count-table input {
  width: 5.25rem;
  min-height: 2.75rem;
  margin-top: 0;
  padding: 0.4rem 0.5rem;
}

.count-table tfoot th,
.count-table tfoot td,
.summary-count tfoot th,
.summary-count tfoot td {
  font-weight: 700;
}

fieldset {
  margin: 0.9rem 0 0;
  padding: 0.85rem 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
}

legend {
  padding: 0 0.3rem;
  font-weight: 700;
}

.fields,
.vendor-row {
  display: grid;
  gap: 0.75rem;
}

.split {
  display: grid;
  gap: 0.9rem;
}

.record-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.record-button {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.record-button span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.record-button.is-selected {
  border-color: var(--crimson);
  background: var(--soon);
}

.button-inline {
  width: auto;
  min-height: 3rem;
  margin-top: 0.75rem;
}

.action-row {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.totals,
.summary {
  margin-top: 0.9rem;
  padding: 0.9rem;
  border-radius: 0.85rem;
  background: var(--paper);
}

[hidden] {
  display: none !important;
}

.admin-body button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#future-panel p + p {
  margin-top: 0.65rem;
}

.totals div,
.summary-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.totals dt,
.summary-line span:first-child {
  font-weight: 700;
}

.is-short {
  color: var(--crimson-deep);
  font-weight: 700;
}

.check-list,
.history-list {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}

.summary h3 {
  margin-bottom: 0.35rem;
}

.summary h4 {
  margin: 0.9rem 0 0.25rem;
  font-size: 1rem;
}

.summary p {
  margin-top: 0.35rem;
}

@media (min-width: 768px) {
  .count-tables {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .drawer-switch {
    grid-template-columns: repeat(3, 1fr);
  }

  .drawer-config-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .drawer-config-row .help {
    grid-column: 1 / -1;
  }

  .ops-nav,
  .admin-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .fields.cols-2,
  .vendor-row {
    grid-template-columns: 1fr 1fr;
  }

  .span-2 {
    grid-column: 1 / -1;
  }

  .action-row.cols-2 {
    grid-template-columns: 1fr 1fr;
  }

  .button-inline {
    width: auto;
  }
}

@media (min-width: 1024px) {
  .split {
    grid-template-columns: 18rem minmax(0, 1fr);
    align-items: start;
  }

  .vendor-row {
    grid-template-columns: 1fr 1.4fr 8rem auto;
    align-items: end;
  }
}

@media print {
  .no-print,
  header.site-header,
  .site-footer,
  #night-workspace > h2,
  #calc-check {
    display: none !important;
  }

  body,
  .summary {
    background: #fff;
  }

  main.admin-main {
    max-width: none;
    padding: 0;
  }

  .summary {
    border: 0;
    padding: 0;
  }
}
