#page-tbm .page-scroll-body {
  padding: 14px 16px 28px;
  background: var(--bg);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#page-tbm,
#page-tbm * {
  box-sizing: border-box;
}

.tbm-header-actions,
.tbm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.tbm-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  background: var(--panel);
  margin-bottom: 12px;
}

.tbm-summary-item {
  min-height: 58px;
  padding: 10px 14px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.tbm-summary-item:last-child { border-right: 0; }
.tbm-summary-item span { color: var(--text3); font-size: 11px; font-weight: 700; }
.tbm-summary-item strong { color: var(--navy2); font-size: 18px; line-height: 1; }

.tbm-list-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
}

.tbm-list {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.tbm-list th {
  height: 34px;
  padding: 6px 8px;
  background: var(--navy2);
  color: #fff;
  border-right: 1px solid rgba(255,255,255,.15);
  text-align: center;
  font-weight: 800;
}

.tbm-list td {
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.tbm-list tbody tr { cursor: pointer; }
.tbm-list tbody tr:hover td { background: var(--blue-bg); }
.tbm-list tbody tr:last-child td { border-bottom: 0; }
.tbm-list td:last-child, .tbm-list th:last-child { border-right: 0; }

.tbm-mobile-list { display: none; }

.tbm-list-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.tbm-list-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  background: #f8fbff;
}

.tbm-list-card-no { color: var(--blue); font-size: 10px; font-weight: 900; }
.tbm-list-card-date { color: var(--navy2); font-size: 12px; font-weight: 900; }
.tbm-list-card-title {
  display: block;
  padding: 11px 10px 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.tbm-list-card-meta {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 7px;
  padding: 0 10px 9px;
  color: var(--text2);
  font-size: 11px;
}

.tbm-list-card-meta b,
.tbm-list-card-grid b { color: var(--text3); font-size: 9px; }

.tbm-list-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.tbm-list-card-grid > span {
  display: flex;
  min-width: 0;
  min-height: 50px;
  padding: 7px 9px;
  border-right: 1px solid var(--border);
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.tbm-list-card-grid > span:last-child { border-right: 0; }

.tbm-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text2);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.tbm-status.complete { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.tbm-status.pending { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.tbm-status.mine { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.tbm-status.approval { color: #fff; border-color: #166534; background: #15803d; }

.tbm-document {
  width: min(1180px, 100%);
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 4px 14px rgba(15, 42, 74, .07);
}

.tbm-document-title {
  padding: 20px 24px;
  background: var(--navy2);
  color: #fff;
  text-align: center;
}

.tbm-document-title h2 { margin: 0; font-size: 21px; letter-spacing: 0; }
.tbm-document-title p { margin: 5px 0 0; color: rgba(255,255,255,.72); font-size: 11px; }

.tbm-section { padding: 18px 20px; border-top: 1px solid var(--border); }
.tbm-section:first-of-type { border-top: 0; }

.tbm-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--navy2);
  font-size: 14px;
  font-weight: 900;
}

.tbm-section-title small { color: var(--text3); font-size: 10px; font-weight: 600; }

.tbm-basic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tbm-field { min-width: 0; }
.tbm-field.wide { grid-column: 1 / -1; }
.tbm-field label {
  display: block;
  margin-bottom: 5px;
  color: var(--text2);
  font-size: 11px;
  font-weight: 800;
}

.tbm-field .form-input,
.tbm-field .form-select,
.tbm-field textarea {
  width: 100%;
  box-sizing: border-box;
}

.tbm-read-value {
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.tbm-risk-head,
.tbm-risk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 34px;
  gap: 8px;
  align-items: start;
}

.tbm-risk-head { margin-bottom: 6px; color: var(--text2); font-size: 11px; font-weight: 800; }
.tbm-risk-row { padding: 8px 0; border-top: 1px solid var(--border); }
.tbm-risk-row:first-child { border-top: 0; }
.tbm-risk-input { display: grid; gap: 6px; min-width: 0; }

.tbm-icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text3);
  cursor: pointer;
  font-size: 17px;
}

.tbm-icon-button:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }

.tbm-checklist { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.tbm-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  min-height: 43px;
  border-top: 1px solid var(--border);
}
.tbm-check-row:first-child { border-top: 0; }
.tbm-check-text { padding: 10px 12px; color: var(--text); line-height: 1.5; }
.tbm-check-actions { display: grid; grid-template-columns: 1fr 1fr; border-left: 1px solid var(--border); }
.tbm-check-option { position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tbm-check-option + .tbm-check-option { border-left: 1px solid var(--border); }
.tbm-check-option input { position: absolute; opacity: 0; pointer-events: none; }
.tbm-check-option span { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text3); font-size: 11px; font-weight: 800; }
.tbm-check-option input:checked + span.good { color: #047857; background: #ecfdf5; }
.tbm-check-option input:checked + span.bad { color: #b91c1c; background: #fef2f2; }

.tbm-worker-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.tbm-worker-search { width: min(320px, 100%); }
.tbm-worker-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text2);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}
.tbm-worker-select-all input {
  width: 14px;
  height: 14px;
  margin: 0;
}
.tbm-worker-select-all:has(input:disabled) {
  opacity: .5;
  cursor: not-allowed;
}
.tbm-worker-tray { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin: 0 0 10px; }
.tbm-worker-chip { display: inline-flex; align-items: center; min-height: 23px; padding: 2px 8px; border: 1px solid #bfdbfe; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 10px; font-weight: 800; }
.tbm-worker-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.tbm-worker-option { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 7px 9px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; min-width: 0; }
.tbm-worker-option:nth-child(3n) { border-right: 0; }
.tbm-worker-option:hover { background: var(--blue-bg); }
.tbm-worker-option strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text); }
.tbm-worker-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text3); font-size: 9px; }
.tbm-worker-empty { grid-column: 1 / -1; padding: 28px 12px; text-align: center; color: var(--text3); font-size: 11px; }

.tbm-signers { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.tbm-signer {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1fr) 160px;
  min-height: 64px;
  border-top: 1px solid var(--border);
  align-items: center;
}
.tbm-signer:first-child { border-top: 0; }
.tbm-signer > div { padding: 9px 12px; min-width: 0; }
.tbm-signer-name strong { display: block; color: var(--text); font-size: 12px; }
.tbm-signer-name small { color: var(--text3); font-size: 10px; }
.tbm-sign-area { text-align: center; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.tbm-sign-mark { display: inline-flex; align-items: center; gap: 5px; color: #1d4ed8; transform: rotate(-2deg); }
.tbm-sign-mark strong { font-family: "Segoe Print", "궁서", cursive; font-size: 20px; font-style: italic; }
.tbm-sign-mark span { padding: 1px 4px; border: 1px solid currentColor; border-radius: 50%; font-size: 8px; font-weight: 900; }
.tbm-sign-time { margin-top: 3px; color: var(--text3); font-size: 9px; }
.tbm-sign-pending { color: var(--text3); font-size: 11px; }
.tbm-signer-action { text-align: center; }

.tbm-approval-card {
  display: grid;
  grid-template-columns: minmax(180px, .55fr) minmax(0, 1.45fr);
  min-height: 82px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}
.tbm-approval-person,
.tbm-approval-action { display: flex; align-items: center; justify-content: center; padding: 13px 16px; }
.tbm-approval-person { flex-direction: column; gap: 3px; border-right: 1px solid var(--border); }
.tbm-approval-person strong { color: var(--text); font-size: 15px; }
.tbm-approval-person span { color: var(--text3); font-size: 10px; font-weight: 700; }
.tbm-approval-message { color: var(--text3); font-size: 11px; font-weight: 700; text-align: center; line-height: 1.55; }
.tbm-approval-message.ready { color: #b45309; }
.tbm-approval-signature { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; color: #15803d; }
.tbm-approval-signature strong { font-family: "Segoe Print", "궁서", cursive; font-size: 22px; font-style: italic; }
.tbm-approval-signature span { padding: 2px 7px; border: 1px solid currentColor; border-radius: 999px; font-size: 9px; font-weight: 900; }
.tbm-approval-signature small { width: 100%; color: var(--text3); font-size: 9px; text-align: center; }

.tbm-form-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg); }
.tbm-empty { padding: 72px 20px; text-align: center; color: var(--text3); }

.tbm-photo-section { background: #fff; }
.tbm-print-frame {
  position: fixed;
  left: -10000px;
  bottom: 0;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.tbm-mail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, .42);
}

.tbm-mail-panel {
  width: min(940px, calc(100vw - 30px));
  max-height: min(760px, calc(100vh - 30px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}

.tbm-mail-head {
  min-height: 80px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #214f82;
  color: #fff;
}

.tbm-mail-kicker {
  margin-bottom: 3px;
  color: rgba(255,255,255,.78);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.tbm-mail-title {
  font-size: 19px;
  font-weight: 900;
  line-height: 1.25;
}

.tbm-mail-close {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 7px;
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.tbm-mail-body {
  padding: 20px;
  overflow: auto;
  background: #fff;
}

.tbm-mail-help {
  padding: 13px 15px;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #f8fafc;
  color: #1f2f46;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.tbm-mail-summary {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.tbm-mail-summary span {
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #d8e2ef;
  border-radius: 7px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.tbm-mail-summary b {
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
}

.tbm-mail-search {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.tbm-mail-input {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  border: 1px solid #c9d7e8;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  padding: 0 12px;
}

.tbm-mail-input:focus {
  outline: 2px solid rgba(37, 99, 235, .2);
  border-color: #60a5fa;
}

.tbm-mail-user-results {
  max-height: 296px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  padding: 10px;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #f8fafc;
}

.tbm-mail-user-result {
  min-width: 0;
  min-height: 66px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid #c9d7e8;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
}

.tbm-mail-user-result:hover {
  border-color: #60a5fa;
  background: #eff8fd;
}

.tbm-mail-user-result input {
  width: 18px;
  height: 18px;
  accent-color: #1f5fae;
}

.tbm-mail-user-result span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.tbm-mail-user-result b,
.tbm-mail-user-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tbm-mail-user-result b { font-size: 15px; font-weight: 900; }
.tbm-mail-user-result small { color: #64748b; font-size: 12px; font-weight: 800; }

.tbm-mail-user-empty {
  grid-column: 1 / -1;
  padding: 20px 12px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.tbm-mail-manual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 14px;
}

.tbm-mail-manual .btn-primary {
  min-width: 68px;
  height: 42px;
}

.tbm-mail-recipient-list {
  min-height: 88px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #c9d7e8;
  border-radius: 8px;
  background: #fff;
}

.tbm-mail-empty {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 800;
}

.tbm-mail-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid #cfe7f6;
  border-radius: 999px;
  background: #eff8fd;
  color: #03428e;
  font-size: 13px;
  font-weight: 900;
}

.tbm-mail-chip small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
  font-weight: 800;
}

.tbm-mail-chip button {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  cursor: pointer;
  line-height: 1;
  font-weight: 900;
}

.tbm-mail-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

.tbm-photo-save-first {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text3);
  font-size: 11px;
  text-align: center;
}

#tbm-photo-attachments .attach-zone { margin-top: 0; }
#tbm-photo-attachments .wr-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 500px));
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

#tbm-photo-attachments .wr-photo-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

#tbm-photo-attachments .wr-photo-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #f8fafc;
  cursor: pointer;
}

#tbm-photo-attachments .wr-photo-thumb:disabled { cursor: default; }
#tbm-photo-attachments .wr-photo-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

#tbm-photo-attachments .wr-photo-fileicon {
  display: grid;
  aspect-ratio: 1 / 1;
  place-items: center;
  color: #334155;
  font-size: 34px;
  font-weight: 900;
}

#tbm-photo-attachments .wr-photo-card-body { padding: 8px; }
#tbm-photo-attachments .wr-photo-file-name {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tbm-photo-attachments .wr-photo-desc-input { width: 100%; margin-top: 7px; font-size: 12px; padding: 7px 8px; }
#tbm-photo-attachments .wr-photo-card-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }

@media (max-width: 900px) {
  .tbm-worker-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tbm-worker-option:nth-child(3n) { border-right: 1px solid var(--border); }
  .tbm-worker-option:nth-child(2n) { border-right: 0; }
}

@media (max-width: 700px) {
  #page-tbm {
    min-width: 0 !important;
    width: 100% !important;
  }

  #page-tbm .page-fixed-header {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  #page-tbm .page-scroll-body { padding: 9px 7px 18px; }
  .tbm-header-actions,
  .tbm-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }
  .tbm-header-actions > div,
  .tbm-toolbar > div {
    min-width: 0;
  }
  .tbm-header-actions .btn-primary,
  .tbm-toolbar .btn-primary,
  .tbm-toolbar .btn-ghost {
    min-height: 34px;
  }
  .tbm-list-desktop { display: none; }
  .tbm-mobile-list { display: grid; gap: 8px; }
  .tbm-list-card-head {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .tbm-list-card-head .tbm-status {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .tbm-summary-strip { grid-template-columns: repeat(2, 1fr); }
  .tbm-summary-item:nth-child(2) { border-right: 0; }
  .tbm-summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .tbm-document-title { padding: 17px 12px; }
  .tbm-document-title h2 { font-size: 18px; }
  .tbm-section { padding: 14px 11px; }
  .tbm-basic-grid { grid-template-columns: 1fr; }
  .tbm-field.wide { grid-column: auto; }
  .tbm-risk-head { display: none; }
  .tbm-risk-form-row { grid-template-columns: 1fr 32px; gap: 7px; }
  .tbm-risk-form-row .tbm-risk-input { grid-column: 1; }
  .tbm-risk-form-row .tbm-icon-button { grid-column: 2; grid-row: 1 / span 2; }
  .tbm-risk-read-row { grid-template-columns: 1fr; gap: 7px; }
  .tbm-risk-read-row > span { display: none; }
  .tbm-risk-read-row .tbm-read-value::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--text3); font-size: 9px; font-weight: 800; }
  .tbm-check-row { grid-template-columns: 1fr; }
  .tbm-check-actions { min-height: 38px; border-left: 0; border-top: 1px solid var(--border); }
  .tbm-worker-list { grid-template-columns: 1fr; }
  .tbm-worker-option, .tbm-worker-option:nth-child(2n), .tbm-worker-option:nth-child(3n) { border-right: 0; }
  .tbm-signer { grid-template-columns: 1fr; }
  .tbm-sign-area { border: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .tbm-approval-card { grid-template-columns: 1fr; }
  .tbm-approval-person { border-right: 0; border-bottom: 1px solid var(--border); }
  .tbm-form-actions { position: sticky; bottom: 0; padding: 10px; z-index: 3; }
  .tbm-mail-backdrop { align-items: stretch; padding: 8px; }
  .tbm-mail-panel { width: 100%; max-height: calc(100vh - 16px); }
  .tbm-mail-head { min-height: 70px; padding: 14px; }
  .tbm-mail-body { padding: 12px; }
  .tbm-mail-summary { grid-template-columns: 1fr; }
  .tbm-mail-user-results { grid-template-columns: 1fr; max-height: 270px; }
  .tbm-mail-manual { grid-template-columns: 1fr; }
  .tbm-mail-footer { position: sticky; bottom: -12px; padding: 10px 0 0; background: #fff; }
}

@media (max-width: 430px) {
  .tbm-summary-strip {
    grid-template-columns: 1fr;
  }
  .tbm-summary-item {
    min-height: 50px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .tbm-summary-item:last-child {
    border-bottom: 0;
  }
  .tbm-list-card-grid {
    grid-template-columns: 1fr;
  }
  .tbm-list-card-grid > span {
    min-height: 42px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .tbm-list-card-grid > span:last-child {
    border-bottom: 0;
  }
  .tbm-mail-chip {
    width: 100%;
    justify-content: space-between;
    border-radius: 8px;
  }
}

@media (max-width: 560px) {
  #tbm-photo-attachments .wr-photo-grid { grid-template-columns: minmax(0, 500px); }
}

@media print {
  body.tbm-printing .topbar,
  body.tbm-printing .sidebar,
  body.tbm-printing .tab-bar,
  body.tbm-printing .page-fixed-header,
  body.tbm-printing #page-tbm .tbm-toolbar,
  body.tbm-printing #page-tbm .attach-zone,
  body.tbm-printing #page-tbm .wr-photo-card-actions {
    display: none !important;
  }

  body.tbm-printing .page:not(#page-tbm) {
    display: none !important;
  }

  body.tbm-printing #page-tbm {
    display: block !important;
  }

  body.tbm-printing,
  body.tbm-printing .main-wrap,
  body.tbm-printing #main-content,
  body.tbm-printing #page-tbm,
  body.tbm-printing #page-tbm .page-scroll-body {
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    color: #000 !important;
  }

  body.tbm-printing #page-tbm .tbm-document {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border: 1px solid #111827 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  body.tbm-printing #page-tbm .tbm-section,
  body.tbm-printing #page-tbm .tbm-signer,
  body.tbm-printing #page-tbm .tbm-check-row,
  body.tbm-printing #page-tbm .tbm-risk-row {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.tbm-printing #page-tbm .tbm-read-value,
  body.tbm-printing #page-tbm .tbm-field .form-input,
  body.tbm-printing #page-tbm .tbm-field textarea {
    background: #fff !important;
    color: #000 !important;
  }

  body.tbm-printing #tbm-photo-attachments .wr-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.tbm-printing #tbm-photo-attachments .wr-photo-thumb img {
    object-fit: contain !important;
    background: #fff !important;
  }
}
