.mpt-app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
}

.mpt-form {
  position: sticky;
  top: calc(var(--header-h) + var(--s-4));
  display: grid;
  gap: var(--s-4);
  max-height: calc(100vh - var(--header-h) - var(--s-6));
  overflow-y: auto;
}

.mpt-row2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-3);
}

.mpt-themes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px var(--s-2);
}

.mpt-themes label {
  display: grid;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.mpt-themes .bt-input {
  min-height: 38px;
  font-size: 0.875rem;
}

.mpt-addrow {
  display: flex;
  gap: var(--s-2);
}

.mpt-extra-list {
  display: grid;
  gap: 4px;
  margin-top: var(--s-2);
}

.mpt-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 2px var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 0.875rem;
}

.mpt-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.mpt-sw-sage { background: #3d7a5a; }
.mpt-sw-butter { background: #e3b53f; }
.mpt-sw-clay { background: #c0603a; }
.mpt-sw-ink { background: #1f2a33; }

.mpt-main {
  min-width: 0;
}

.mpt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}

.mpt-toolbar .bt-actions {
  margin: 0;
  padding: 0;
  border: 0;
}

.mpt-sheet-wrap {
  overflow-x: auto;
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--cream-200);
}

.mpt-sheet {
  --mpt-c: #3d7a5a;
  --mpt-soft: #eef5f0;
  min-width: 760px;
  padding: 28px 30px 18px;
  background: #fff;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  color: #1d2620;
  font-size: 13px;
}

.mpt-l-list {
  min-width: 620px;
  max-width: 820px;
  margin: 0 auto;
}

.mpt-c-butter { --mpt-c: #a77a0e; --mpt-soft: #fdf6e1; }
.mpt-c-clay { --mpt-c: #a9512f; --mpt-soft: #fbece5; }
.mpt-c-ink { --mpt-c: #1f2a33; --mpt-soft: #eef1f3; }

.mpt-sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 3px solid var(--mpt-c);
}

.mpt-sheet-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.1;
  color: var(--mpt-c);
}

.mpt-sheet-sub {
  font-size: 13px;
  font-weight: 600;
  color: #4a554e;
}

.mpt-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.mpt-grid th,
.mpt-grid td {
  border: 1px solid #cdd3cd;
  vertical-align: top;
}

.mpt-grid thead th {
  padding: 7px 6px;
  background: var(--mpt-c);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.mpt-grid .mpt-corner {
  width: 84px;
  background: #fff;
  border-color: transparent transparent #cdd3cd transparent;
}

.mpt-grid-list .mpt-corner {
  width: 110px;
}

.mpt-dname {
  display: block;
}

.mpt-ddate {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.85;
}

.mpt-rowhead {
  padding: 8px 6px;
  background: var(--mpt-soft);
  color: var(--mpt-c);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.mpt-rowhead .mpt-ddate {
  color: #4a554e;
}

.mpt-cell {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 6px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.35;
  color: #1d2620;
  resize: none;
  overflow: hidden;
}

.mpt-cell:hover {
  background: #f7faf7;
}

.mpt-cell:focus-visible {
  outline: 2px solid var(--mpt-c);
  outline-offset: -2px;
  background: #fff;
}

.mpt-month td {
  height: 74px;
  padding: 0;
}

.mpt-mday {
  display: block;
  padding: 4px 6px 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--mpt-c);
}

.mpt-cell-month {
  min-height: 48px;
  padding-top: 2px;
  font-size: 11.5px;
}

.mpt-off {
  background: #f4f5f3;
}

.mpt-extras {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.mpt-l-list .mpt-extras {
  grid-template-columns: 1fr;
}

.mpt-extras:has(> :only-child) {
  grid-template-columns: 1fr;
}

.mpt-box {
  padding: 8px 10px 10px;
  border: 1px solid #cdd3cd;
  border-radius: 4px;
}

.mpt-box-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mpt-c);
}

.mpt-gcols {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.mpt-l-list .mpt-gcols {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mpt-gname {
  font-size: 11px;
  font-weight: 700;
  color: #4a554e;
}

.mpt-lines {
  min-height: 96px;
  padding: 2px 0;
  line-height: 19px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='19'%3E%3Crect y='18' width='10' height='1' fill='%23dfe3df'/%3E%3C/svg%3E");
  background-size: 10px 19px;
  background-attachment: local;
}

.mpt-lines:hover {
  background-color: transparent;
}

.mpt-foot {
  margin-top: 10px;
  font-size: 10px;
  color: #8a948d;
  text-align: right;
}

@media (max-width: 1023px) {
  .mpt-app {
    grid-template-columns: 1fr;
  }

  .mpt-form {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media print {
  .mpt-form,
  .mpt-toolbar,
  .mpt-tip,
  .bt-status-bar {
    display: none !important;
  }

  .mpt-app {
    display: block;
  }

  .mpt-sheet-wrap {
    padding: 0;
    border: 0;
    background: none;
    overflow: visible;
  }

  .mpt-sheet {
    min-width: 0;
    max-width: none;
    padding: 0;
    box-shadow: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .mpt-cell:hover {
    background: transparent;
  }
}

.mpt-gap {
  margin-top: var(--s-3);
}

.mpt-fg {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0 4px 5px;
}

.mpt-fg-box {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.mpt-fg-box input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.mpt-fg-box span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid #b9c2bc;
  border-radius: 3px;
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1;
  color: #5d6a62;
  background: #fff;
}

.mpt-fg-box input:checked + span {
  border-color: var(--mpt-c);
  background: var(--mpt-c);
  color: #fff;
}

.mpt-fg-box input:focus-visible + span {
  outline: 2px solid var(--mpt-c);
  outline-offset: 1px;
}

.mpt-fg-key {
  margin: 6px 0 0;
  font-size: 10.5px;
  color: #4a554e;
}
