/* =========================================
   TAXREADY — style.css
   Tax Prep Organizer
   Design system: white cards, #061d33 text,
   #ff9901 accent — DM Sans + IBM Plex Mono
   ========================================= */

:root {
  --primary:        #ff9901;
  --primary-hover:  #e68a00;
  --primary-light:  #fff7e6;
  --primary-border: rgba(255,153,1,0.3);
  --dark:           #061d33;
  --mid:            #4a5568;
  --muted:          #9ca3af;
  --border:         #e2e8f0;
  --bg:             #f7f8fa;
  --white:          #ffffff;
  --radius:         10px;
  --radius-sm:      6px;
  --shadow:         0 4px 10px rgba(0,0,0,0.08);
  --shadow-md:      0 8px 24px rgba(0,0,0,0.12);
  --font-body:      'DM Sans', sans-serif;
  --font-mono:      'IBM Plex Mono', monospace;
  --success:        #10b981;
  --success-light:  #ecfdf5;
  --success-border: #a7f3d0;
}

/* ---- APP BAR (disclaimer + actions in one row) ---- */
.tr-app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 14px;
  margin-bottom: 14px;
  margin-top: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.tr-app-bar-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}
.tr-app-bar-note svg {
  flex-shrink: 0;
  color: var(--primary);
  opacity: 0.8;
}
.tr-app-bar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .tr-app-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .tr-app-bar-actions { width: 100%; justify-content: flex-end; }
}



/* ---- BUTTONS ---- */
.tr-btn-primary {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.tr-btn-primary:hover { background: var(--primary-hover); }

.tr-btn-ghost {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--mid);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.tr-btn-ghost:hover { border-color: var(--dark); color: var(--dark); }

/* ---- TABS ---- */
.tr-tabs {
  display: flex;
  gap: 2px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 5px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tr-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 13px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex: 1;
  justify-content: center;
}
.tr-tab:hover { color: var(--dark); background: var(--bg); }
.tr-tab.active {
  background: var(--primary);
  color: var(--white);
}
.tr-tab.complete::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  margin-left: 2px;
}

/* ---- PANELS ---- */
.tr-panels {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.tr-panel { display: none; }
.tr-panel.active { display: block; }

/* ---- SECTION LABELS ---- */
.tr-section-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ---- GRID ---- */
.tr-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

/* ---- FIELDS ---- */
.tr-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tr-field label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
}
.tr-optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
}
.tr-field input,
.tr-field textarea,
.tr-field select {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--dark);
  background: var(--white);
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
}
.tr-field input:focus,
.tr-field textarea:focus,
.tr-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,153,1,0.15);
}
.tr-field select {
  appearance: none;
  background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2212%22 height=%2212%22 viewBox=%220 0 12 12%22%3E%3Cpath fill=%22%239ca3af%22 d=%22M2 4l4 4 4-4z%22/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

/* ---- MONEY INPUT ---- */
.tr-money-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.tr-money-sym {
  position: absolute;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}
.tr-money-wrap input {
  padding-left: 22px !important;
}

/* ---- TOTAL BAR ---- */
.tr-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
}
.tr-total-bar-accent {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  margin-top: 8px;
}
.tr-total-num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
}

/* ---- INFO CARD ---- */
.tr-info-card {
  background: var(--bg);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--mid);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ---- INCOME STREAM GRID ---- */
#trIncomeStreams {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}

/* ---- INCOME STREAM CARDS ---- */
.tr-stream-block {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s;
}
.tr-stream-block:hover { border-color: #d1d5db; }

.tr-stream-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 14px 10px;
  background: var(--bg);
  gap: 8px;
}
.tr-stream-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tr-stream-name {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}
.tr-stream-form {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  display: inline-block;
  width: fit-content;
}
.tr-stream-count {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--white);
  background: var(--primary);
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
  display: inline-block;
  flex-shrink: 0;
  visibility: hidden;
  margin-top: 1px;
}
.tr-stream-count:not(:empty) { visibility: visible; }

.tr-stream-body {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* No col-heads in card layout — labels live in the source rows */
.tr-stream-col-heads { display: none; }

.tr-stream-source-row {
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 6px;
  align-items: start;
  margin-bottom: 6px;
}
.tr-stream-source-row .src-payer {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--dark);
  background: var(--white);
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 4px;
}
.tr-stream-source-row .tr-money-wrap {
  grid-column: 1;
}
.tr-stream-source-row .tr-money-wrap input {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dark);
  background: var(--white);
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: 5px 8px 5px 20px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tr-stream-source-row .tr-money-sym {
  font-size: 11px;
  left: 8px;
}
.tr-stream-source-row .src-remove {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
}
.tr-stream-source-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,153,1,0.15);
}

.tr-stream-source-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0 8px;
}

.tr-stream-empty {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin: 2px 0 8px;
  flex: 1;
}

.tr-stream-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin: 6px 0 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--mid);
}
.tr-stream-subtotal {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--dark);
}
.tr-stream-subtotal.negative { color: #ef4444; }

.tr-stream-add-btn {
  margin-top: auto;
  font-size: 11px !important;
  padding: 6px 10px !important;
}

/* ---- STREAM RESPONSIVE ---- */
@media (max-width: 780px) {
  #trIncomeStreams { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  #trIncomeStreams { grid-template-columns: 1fr; }
}



/* ---- ADD BIZ BUTTON ---- */
.tr-add-biz-btn {
  margin-top: 4px;
}

/* ---- INFO CARD LINK VARIANT ---- */
.tr-info-card-link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: default;
}
.tr-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tr-link-btn:hover { color: var(--primary-hover); }

/* ---- SECTION HINT (inline subtitle in section label) ---- */
.tr-section-hint {
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 8px;
}

/* ---- EMPTY HINT ---- */
.tr-empty-hint {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  padding: 12px 0 4px;
  margin: 0;
}

/* ---- BUSINESS CARDS ---- */
.tr-biz-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.tr-biz-card:hover { border-color: #d1d5db; }

.biz-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: var(--bg);
  cursor: default;
}
.biz-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  text-align: left;
  padding: 0;
  min-width: 0;
}
.biz-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.2s;
}
.tr-biz-card.expanded .biz-chevron { transform: rotate(0deg); }
.tr-biz-card:not(.expanded) .biz-chevron { transform: rotate(-90deg); }
.biz-header-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.biz-placeholder { color: var(--muted); font-weight: 400; font-style: italic; }
.biz-header-net {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
}
.biz-header-net.negative { color: #ef4444; }
.biz-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.biz-remove-btn:hover { color: #ef4444; background: #fef2f2; }

.biz-body {
  display: none;
  padding: 20px 20px 24px;
  border-top: 1px solid var(--border);
}
.tr-biz-card.expanded .biz-body { display: block; }
.tr-add-row-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1.5px dashed var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 8px;
}
.tr-add-row-btn:hover {
  background: #ffe9b3;
  border-color: var(--primary);
}

/* ---- DYNAMIC ROWS (W2, 1099, dependents) ---- */
.tr-dynamic-row {
  display: grid;
  gap: 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
}
.tr-dynamic-row.tr-row-w2 {
  grid-template-columns: 2fr 1fr 1fr auto;
}
.tr-dynamic-row.tr-row-1099 {
  grid-template-columns: 2fr 1fr auto;
}
.tr-dynamic-row.tr-row-dependent {
  grid-template-columns: 2fr 1fr 1fr auto;
}
.tr-row-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  align-self: end;
  margin-bottom: 1px;
  transition: color 0.15s, background 0.15s;
}
.tr-row-remove:hover { color: #ef4444; background: #fef2f2; }
.tr-row-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

/* ---- DEDUCTION TOGGLE ---- */
.tr-deduction-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}
.tr-toggle-label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
}
.tr-toggle-group {
  display: flex;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.tr-toggle-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.tr-toggle-btn.active {
  background: var(--white);
  color: var(--dark);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ---- DOCUMENTS CHECKLIST ---- */
.tr-docs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tr-doc-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.tr-doc-item:hover { border-color: #d1d5db; }
.tr-doc-item.checked {
  background: var(--success-light);
  border-color: var(--success-border);
}
.tr-doc-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.12s;
  color: transparent;
}
.tr-doc-item.checked .tr-doc-checkbox {
  background: var(--success);
  border-color: var(--success);
  color: var(--white);
}
.tr-doc-text {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.3;
}
.tr-doc-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}

/* ---- SUMMARY ---- */
.tr-summary-wrap {
  font-family: var(--font-body);
}
.tr-summary-section {
  margin-bottom: 24px;
}
.tr-summary-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 6px;
  margin-bottom: 12px;
}
.tr-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--mid);
}
.tr-summary-row:last-child { border-bottom: none; }
.tr-summary-row strong { color: var(--dark); }
.tr-summary-val {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--dark);
  font-weight: 600;
}
.tr-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
}
.tr-summary-total .tr-summary-val {
  font-size: 16px;
  color: var(--primary);
}
.tr-summary-empty {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}
.tr-summary-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--mid);
  margin-left: 6px;
}

/* ---- BOTTOM BAR ---- */
.tr-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 0;
  margin-top: 4px;
  margin-bottom: 70px;
}
.tr-save-status {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
}
.tr-btn-ghost-sm {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.tr-btn-ghost-sm:hover { color: #ef4444; border-color: #fca5a5; }

/* ---- CONFIRM DIALOG ---- */
.tr-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,29,51,0.5);
  backdrop-filter: blur(3px);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.tr-confirm-overlay.open { opacity: 1; pointer-events: all; }
.tr-confirm {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  padding: 24px;
  width: 100%;
  max-width: 340px;
  transform: translateY(8px);
  transition: transform 0.15s;
}
.tr-confirm-overlay.open .tr-confirm { transform: translateY(0); }
.tr-confirm-msg {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dark);
  margin: 0 0 20px;
  line-height: 1.5;
}
.tr-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.tr-confirm-cancel {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--mid);
  cursor: pointer;
  transition: all 0.15s;
}
.tr-confirm-cancel:hover { border-color: var(--dark); color: var(--dark); }
.tr-confirm-ok {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: #ef4444;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.tr-confirm-ok:hover { background: #dc2626; }

/* ---- TOAST ---- */
.tr-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--dark);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 5000;
  white-space: nowrap;
}
.tr-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- PRINT ---- */
#trPrintOutput { display: none; }

@media print {
  @page { margin: 0; size: A4; }
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  body.tr-printing > * { display: none !important; }
  body.tr-printing #trPrintOutput {
    display: block !important;
    padding: 16mm 18mm !important;
    box-sizing: border-box !important;
    width: 100% !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  .tr-grid-2 { grid-template-columns: 1fr; }
  .tr-docs-grid { grid-template-columns: 1fr; }
  .tr-tabs { gap: 2px; }
  .tr-tab { font-size: 11px; padding: 7px 8px; }
  .tr-tab svg { display: none; }
  .tr-panels { padding: 18px; }
  .tr-dynamic-row.tr-row-w2,
  .tr-dynamic-row.tr-row-1099,
  .tr-dynamic-row.tr-row-dependent {
    grid-template-columns: 1fr;
  }
}