:root {
  color-scheme: light;
  --bg: #f5f6f4;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #64707d;
  --line: #d7ddd8;
  --accent: #176b5b;
  --accent-strong: #0f4e43;
  --danger: #9f2a2a;
  --soft: #edf4f1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 28px auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  margin: 16px 0;
  box-shadow: 0 8px 24px rgb(31 41 51 / 7%);
}

.panel.narrow {
  max-width: 520px;
  margin-inline: auto;
}

.subpanel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfb;
}

.flow-context {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  background: var(--soft);
}

.owner-documents {
  border-top: 4px solid var(--accent);
}

.tenant-documents {
  border-top: 4px solid #315f9a;
}

.notice.compact {
  margin-bottom: 0;
}

.brandline,
.adminbar,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0 0 16px;
  line-height: 1.15;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 20px;
}

.stack {
  display: grid;
  gap: 16px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wide {
  grid-column: span 3;
}

.occupant-row {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.occupant-row:first-child {
  padding-top: 0;
  border-top: 0;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgb(23 107 91 / 22%);
  border-color: var(--accent);
}

button,
.linkbutton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 11px 16px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.linkbutton:hover {
  background: var(--accent-strong);
}

.secondary {
  color: var(--accent-strong);
  background: var(--soft);
}

.secondary:hover {
  background: #ddebe6;
}

.small {
  padding: 7px 10px;
  font-size: 13px;
}

.danger {
  background: var(--danger);
}

.danger:hover {
  background: #741d1d;
}

.actions .erase-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #e2b9b9;
}

.small-check {
  font-size: 13px;
}

.notice {
  border: 1px solid #b9d6ca;
  border-radius: 6px;
  padding: 12px;
  margin: 12px 0;
  background: var(--soft);
}

.breadcrumbline,
.copyrow {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  color: var(--muted);
}

.breadcrumbline {
  margin-top: 12px;
}

.copyrow label {
  flex: 1 1 360px;
}

.copy-mini {
  width: 180px;
  min-width: 140px;
  padding: 7px 9px;
  font-size: 13px;
}

.notice.error {
  border-color: #e2b9b9;
  color: var(--danger);
  background: #fff1f1;
}

.legal {
  margin-top: 0;
  color: var(--muted);
}

.checkline {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  font-weight: 600;
}

.checkline input {
  width: auto;
  margin-top: 4px;
}

canvas {
  width: 100%;
  height: 220px;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

.tablewrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions form {
  display: inline;
}

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--accent-strong);
  background: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 18px, 1120px);
    margin: 9px auto;
  }

  .panel {
    padding: 16px;
  }

  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .brandline,
  .adminbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }
}
