.blank-quickbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--surface-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.blank-quickbar-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.blank-quickbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ledger-header-bar {
  gap: 10px;
}

.ledger-actions {
  gap: 6px;
}

.ledger-actions .btn-sm {
  padding: 6px 10px;
}

.rl-month-cell.is-today-month {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.toolbar-sep {
  width: 1px;
  height: 22px;
  background: var(--line-strong);
  margin-inline: 2px;
  display: inline-block;
}

.mobile-add-row {
  display: none;
}

.ledger-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  background: var(--text);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
}

/* Statement & Export Studio Modal */
.studio-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(24, 28, 32, 0.52);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.studio-dialog {
  width: 100%;
  max-width: 1120px;
  height: min(88vh, 800px);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.studio-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line-strong);
  flex-wrap: wrap;
}

.studio-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-right: auto;
}

.studio-heading {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  color: var(--text);
}

.studio-access-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
}

.studio-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.studio-close-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 140ms ease, color 140ms ease;
}

.studio-close-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.studio-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr);
}

.studio-rail {
  border-right: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.studio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.studio-row-split {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.studio-group-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.studio-tpl-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.studio-tpl-card {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.studio-tpl-card:hover {
  border-color: var(--text);
  background: var(--surface-tint);
}

.studio-tpl-card.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.studio-tpl-name {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.studio-tpl-desc {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
}

.studio-swatches {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
}

.studio-swatch {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line-strong);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.studio-swatch:hover {
  transform: scale(1.08);
}

.studio-swatch.is-active {
  box-shadow: 0 0 0 2px var(--text);
}

.studio-seg {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 2px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.studio-seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.studio-seg-btn.is-active {
  background: var(--primary);
  color: var(--surface);
}

.studio-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.studio-field span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.studio-field input,
.studio-note-wrap textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  padding: 7px 9px;
}

.studio-field input:focus,
.studio-note-wrap textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.studio-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8125rem;
  line-height: 1.38;
  color: var(--text);
  cursor: pointer;
}

.studio-check input {
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.studio-pro-gate {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-tint);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.studio-gate-title {
  font-size: 0.875rem;
  color: var(--text);
}

.studio-gate-copy {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
}

.studio-gate-plans {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Right Preview Canvas */
.studio-stage {
  background: var(--surface-muted);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.studio-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.studio-canvas-scroll {
  flex: 1 1 auto;
  overflow: auto;
  padding: 22px;
  display: flex;
  align-items: flex-start;
}

.studio-preview-zoom {
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.studio-canvas-scroll > .studio-paper {
  flex: none;
  margin-inline: auto;
  zoom: var(--studio-preview-scale, 1);
}

.studio-paper {
  --st-accent: rgb(27, 77, 62);
  --st-soft: rgb(230, 240, 236);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  padding: 26px 28px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  width: 100%;
  transition: max-width 180ms ease;
}

.studio-paper.is-landscape {
  width: calc(640px * 11 / 8.5);
  min-height: 640px;
}

.studio-paper.is-portrait {
  width: 640px;
  min-height: calc(640px * 11 / 8.5);
}

/* Live Paper Templates */
.sp-head-classic {
  border-top: 3px solid var(--st-accent);
  padding-top: 12px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.sp-title-classic {
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px 0;
}

.sp-sub {
  color: var(--muted);
  font-size: 0.75rem;
}

.sp-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
  background: var(--st-soft);
  color: var(--st-accent);
}

.sp-badge.is-due {
  background: var(--accent-soft);
  color: var(--accent);
}

.sp-head-formal {
  text-align: center;
  border-bottom: 3px double var(--st-accent);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.sp-head-formal .sp-title-classic {
  font-size: 1.25rem;
}

.sp-head-modern {
  background: var(--st-accent);
  color: var(--surface);
  margin: -26px -28px 16px -28px;
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
}

.sp-head-modern .sp-title-modern {
  font-family: var(--font-sans);
  font-size: 1.1875rem;
  font-weight: 700;
  margin: 0 0 3px 0;
  color: var(--surface);
}

.sp-head-modern .sp-modern-sub {
  font-size: 0.75rem;
  opacity: 0.88;
}

.sp-meta-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-tint);
  margin-bottom: 14px;
}

.tpl-formal .sp-meta-box {
  background: var(--surface);
  border-radius: 0;
}

.sp-meta-col div {
  margin-bottom: 3px;
}

.sp-meta-col div:last-child {
  margin-bottom: 0;
}

.sp-meta-k {
  color: var(--muted);
  font-weight: 600;
}

.sp-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.sp-kpi {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 9px;
  background: var(--surface);
}

.sp-kpi-hi {
  background: var(--st-soft);
  border-color: var(--st-accent);
}

.sp-kpi span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.sp-kpi strong {
  font-size: 0.875rem;
  color: var(--text);
}

.sp-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
  font-size: 0.75rem;
}

.sp-table th,
.sp-table td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.sp-table th.r,
.sp-table td.r {
  text-align: right;
  white-space: nowrap;
}

.sp-table thead th {
  font-weight: 600;
  background: var(--surface-muted);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1.5px solid var(--line-strong);
  color: var(--text);
}

.tpl-formal .sp-table thead th {
  background: transparent;
  border-top: 1.5px solid var(--st-accent);
  border-bottom: 1.5px solid var(--st-accent);
}

.tpl-modern .sp-table thead th {
  background: var(--st-accent);
  color: var(--surface);
  border: none;
}

.tpl-modern .sp-table tbody tr.sp-row-alt {
  background: var(--surface-tint);
}

.sp-table tfoot td {
  font-weight: 700;
  background: var(--surface-muted);
  border-top: 1.5px solid var(--line-strong);
  border-bottom: 3px double var(--line-strong);
}

.tpl-formal .sp-table tfoot td {
  background: transparent;
}

.sp-note-box {
  padding: 8px 10px;
  border-left: 3px solid var(--st-accent);
  background: var(--surface-tint);
  margin-bottom: 14px;
  white-space: pre-wrap;
}

.sp-sig-block {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.sp-cert-text {
  color: var(--muted);
  margin: 0 0 18px 0;
}

.sp-sig-lines {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.sp-sig-line {
  border-top: 1px solid var(--text);
  padding-top: 4px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .studio-dialog {
    height: 92vh;
  }
  .studio-body {
    display: block;
    overflow: auto;
    overscroll-behavior: contain;
  }
  .studio-rail {
    border-right: none;
    border-bottom: 1px solid var(--line-strong);
    overflow: visible;
  }
  .studio-canvas-scroll {
    display: block;
    padding: 14px;
  }
}

@media (max-width: 640px) {
  .toolbar-sep {
    display: none;
  }
  .studio-backdrop {
    padding: 8px;
  }
  .studio-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }
  .studio-title-wrap {
    grid-column: 1;
    grid-row: 1;
    margin-right: 0;
  }
  .studio-close-btn {
    grid-column: 2;
    grid-row: 1;
  }
  .studio-top-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 6px;
  }
  .studio-top-actions .btn {
    flex: 1 1 auto;
    padding: 6px 10px;
  }
  .sp-meta-box,
  .sp-kpis,
  .sp-sig-lines {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .blank-quickbar {
    align-items: stretch;
  }
  .blank-quickbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .blank-quickbar-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media screen and (max-width: 820px) {
  .ledger-header-bar {
    padding: 12px;
    gap: 10px;
  }
  .ledger-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
  }
  .ledger-actions .btn {
    width: 100%;
    padding: 6px 6px;
    justify-content: center;
  }
  .toolbar-sep {
    display: none;
  }
  .ledger-scroll-hint {
    display: none;
  }
  .ledger-table-scroll {
    overflow-x: visible;
  }
  .ledger-grid {
    display: block;
    min-width: 0;
    width: 100%;
  }
  .ledger-grid colgroup {
    display: none;
  }
  .ledger-grid thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .ledger-grid tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: var(--surface-muted);
  }
  .ledger-grid tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .ledger-grid tbody tr:hover {
    background: var(--surface);
  }
  .ledger-grid tbody td {
    min-width: 0;
    min-height: 0;
    border-right: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .ledger-grid tbody td.td-period {
    position: static;
    left: auto;
    z-index: auto;
    box-shadow: none;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    background: var(--surface-tint);
    border-bottom: 1px solid var(--line);
    padding: 0;
    justify-content: center;
  }
  .ledger-grid tbody td.td-period .cell-period-btn {
    height: 46px;
    padding: 0 10px 0 12px;
    justify-content: flex-start;
    gap: 6px;
    font-size: 0.9375rem;
  }
  .ledger-grid tbody td.td-status {
    grid-column: 2;
    grid-row: 1;
    background: var(--surface-tint);
    border-bottom: 1px solid var(--line);
    padding: 0 46px 0 6px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }
  .ledger-grid tbody td.td-status .status-cell {
    min-height: 46px;
    padding: 0;
  }
  .ledger-grid tbody td.td-del {
    position: absolute;
    top: 5px;
    right: 6px;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    z-index: 2;
  }
  .ledger-grid tbody td.td-del .del-cell {
    min-height: 36px;
  }
  .ledger-grid tbody td.td-rent,
  .ledger-grid tbody td.td-late,
  .ledger-grid tbody td.td-date {
    min-width: 0;
    padding: 10px 6px 0 12px;
  }
  .ledger-grid tbody td.td-other,
  .ledger-grid tbody td.td-paid,
  .ledger-grid tbody td.td-method {
    min-width: 0;
    padding: 10px 12px 0 6px;
  }
  .ledger-grid tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--muted);
  }
  .ledger-grid tbody .money-cell {
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }
  .ledger-grid tbody .money-input {
    flex: 1 1 0%;
    width: 0 !important;
    min-width: 0 !important;
  }
  .ledger-grid tbody td.td-date .cell-picker-btn {
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }
  .ledger-grid tbody .cell-select {
    height: 40px;
    padding: 0 26px 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background-color: var(--surface);
    background-position: right 8px center;
  }
  .ledger-grid tbody td.td-notes {
    order: 1;
    grid-column: 1 / -1;
    min-width: 0;
    padding: 10px 12px 12px 12px;
  }
  .ledger-grid tbody .memo-wrap {
    min-height: 0;
  }
  .ledger-grid tbody .cell-memo {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }
  .ledger-grid tbody .money-cell:hover,
  .ledger-grid tbody td.td-date .cell-picker-btn:hover,
  .ledger-grid tbody .cell-select:hover,
  .ledger-grid tbody .cell-memo:hover {
    background: var(--surface);
    border-color: var(--text);
  }
  .ledger-grid tbody .money-cell:focus-within,
  .ledger-grid tbody td.td-date .cell-picker-btn:focus,
  .ledger-grid tbody td.td-date .cell-picker-btn.is-open,
  .ledger-grid tbody .cell-select:focus,
  .ledger-grid tbody .cell-memo:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
  }
  .ledger-grid tbody td.td-balance {
    order: 2;
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--surface-tint);
    border-top: 1px solid var(--line);
    min-height: 44px;
  }
  .ledger-grid tbody td.td-balance::before {
    content: "Running balance";
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
  }
  .ledger-grid tbody td.td-balance .balance-cell {
    min-height: 0;
    padding: 0;
    gap: 3px;
    font-size: 0.9375rem;
  }
  .ledger-grid tfoot {
    display: block;
  }
  .ledger-grid tfoot tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 12px;
    background: var(--surface-muted);
    border-top: 1px solid var(--line-strong);
  }
  .ledger-grid tfoot .tf-spacer {
    display: none;
  }
  .ledger-grid tfoot td {
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: auto;
    padding: 0;
    border-right: none;
    text-align: left;
  }
  .ledger-grid tfoot td.tf-label {
    position: static;
    left: auto;
    z-index: auto;
    background: transparent;
    box-shadow: none;
    grid-column: 1 / -1;
    padding: 0 0 6px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.875rem;
  }
  .ledger-grid tfoot td[data-label]::before {
    content: attr(data-label);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
  }
  .ledger-grid tfoot td.tf-num {
    padding: 0;
    text-align: left;
  }
  .ledger-grid tfoot .tf-acct {
    justify-content: flex-start;
    gap: 2px;
  }
  .ledger-grid tfoot td.tf-balance {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin-top: 2px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
  }
  .ledger-grid tfoot td.tf-balance::before {
    font-size: 0.8125rem;
    color: var(--text);
  }
  .mobile-add-row {
    display: block;
    padding: 0 12px 12px 12px;
    background: var(--surface-muted);
  }
  .mobile-add-row .btn {
    width: 100%;
    justify-content: center;
    background: var(--surface);
  }
}

@media screen and (max-width: 420px) {
  .ledger-actions .btn {
    font-size: 0.75rem;
    gap: 4px;
    padding: 6px 4px;
  }
}

@media print {
  .blank-quickbar,
  .mobile-add-row,
  .studio-backdrop,
  .ledger-toast {
    display: none !important;
  }
}

.studio-paper.is-portrait {
  min-width: 0;
}

.is-portrait .sp-table {
  table-layout: fixed;
}

.is-portrait .sp-table th,
.is-portrait .sp-table td {
  padding: 7px 5px;
  vertical-align: top;
}

.is-portrait .sp-table th:first-child,
.is-portrait .sp-table td:first-child {
  padding-left: 6px;
}

.is-portrait .sp-table th:last-child,
.is-portrait .sp-table td:last-child {
  padding-right: 6px;
}

.is-portrait .sp-table th.sp-pay-col,
.is-portrait .sp-table td.sp-pay-col {
  padding-left: 12px;
}

.sp-cell-pri {
  display: block;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  line-height: 1.3;
}

.sp-pay-date {
  display: block;
  color: var(--text);
  white-space: nowrap;
  line-height: 1.3;
}

.sp-pay-date.is-unpaid {
  color: var(--muted);
}

.sp-cell-sub {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
  margin-top: 2px;
}

.sp-st-paid,
.sp-st-credit {
  color: var(--primary);
  font-weight: 600;
}

.sp-st-partial {
  color: var(--accent);
  font-weight: 600;
}

.sp-st-unpaid {
  color: var(--danger);
  font-weight: 600;
}

.sp-st-open {
  color: var(--muted);
  font-weight: 500;
}

.is-portrait .sp-table tbody tr.has-memo td {
  border-bottom: none;
  padding-bottom: 3px;
}

.is-portrait .sp-table tbody tr.sp-row-memo td {
  padding: 1px 6px 7px 6px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.38;
  border-bottom: 1px solid var(--line);
  overflow-wrap: break-word;
}

.sp-memo-k {
  font-weight: 600;
  color: var(--text);
}

.is-portrait .sp-table tfoot td {
  padding: 7px 5px;
}

.studio-paper .sp-table td.r {
  white-space: nowrap;
  overflow-wrap: normal;
}


@media screen {
  .studio-print-sheet {
    display: none;
  }
}

@media print {
  body.printing-studio {
    margin: 0 !important;
    overflow: visible !important;
  }

  body.printing-studio > :not(.studio-print-sheet) {
    display: none !important;
  }

  .studio-paper.studio-print-sheet {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-height: 0;
    border: 0;
    box-shadow: none;
    padding: 0;
    overflow-wrap: anywhere;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .studio-print-sheet .sp-head-modern {
    margin: 0 0 16px;
  }

  .studio-print-sheet .sp-table thead {
    display: table-header-group;
  }

  .studio-print-sheet .sp-table tfoot {
    display: table-row-group;
  }

  .studio-print-sheet .sp-table tr,
  .studio-print-sheet .sp-sig-block {
    break-inside: avoid;
  }

  .studio-print-sheet .sp-table tr.has-memo {
    break-after: avoid;
    page-break-after: avoid;
  }

  .studio-print-sheet .sp-table tr.sp-row-memo {
    break-before: avoid;
    page-break-before: avoid;
  }
}