body {
  background: #f7f1e6;
  color: #0b1f33;
}

.form433d-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 18px 54px;
}

.form433d-shell [hidden] {
  display: none !important;
}

.form433d-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  padding: 20px 0 16px;
  border-bottom: 1px solid rgba(11, 58, 110, 0.14);
}

.form433d-title-row span {
  display: block;
  color: #b98518;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.form433d-title-row h1 {
  margin: 0;
  color: #0b3a6e;
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  line-height: 1.05;
}

.form433d-title-row p {
  margin: 6px 0 0;
  color: #52657d;
}

.form433d-panel,
.form433d-section {
  background: transparent;
  border: 0;
  border-top: 1px solid #d7e1ec;
  border-radius: 0;
  padding: 12px 0;
  margin-bottom: 16px;
  box-shadow: none;
}

.form433d-section {
  border-top: 1px solid #d7e1ec;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  color: #0b3a6e;
  font-size: 1.16rem;
}

.section-head p {
  margin: 4px 0 0;
  color: #5c6f84;
  font-size: 0.9rem;
}

.agreement-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.agreement-option {
  border: 1px solid #c9d6e4;
  border-radius: 8px;
  background: #f8fbfd;
  color: #0b1f33;
  padding: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.agreement-option:hover {
  border-color: #0b3a6e;
  box-shadow: 0 8px 18px rgba(16, 34, 52, 0.08);
  transform: translateY(-1px);
}

.agreement-option strong,
.agreement-option span {
  display: block;
}

.agreement-option strong {
  color: #0b3a6e;
  font-size: 0.95rem;
}

.agreement-option span {
  margin-top: 5px;
  font-weight: 800;
}

.agreement-option.selected {
  border-color: #b98518;
  background: #fff8e6;
  box-shadow: inset 0 0 0 1px #b98518;
}

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

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

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

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.field-grid label,
.table-wrap label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 800;
  color: #27384b;
  font-size: 0.85rem;
}

.field-grid .wide {
  grid-column: 1 / -1;
}

input,
select {
  border: 1px solid #bdc9d7;
  border-radius: 6px;
  min-height: 32px;
  padding: 6px 10px;
  font: inherit;
  background: #fff;
  color: #0b1f33;
}

input:focus,
select:focus {
  border-color: #0b3a6e;
  box-shadow: 0 0 0 3px rgba(11, 58, 110, 0.13);
  outline: 0;
}

input[readonly] {
  background: #f2f5f8;
  color: #26384c;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid #e2e9f1;
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #0b3a6e;
  color: #fff;
  font-size: 0.78rem;
  text-transform: uppercase;
}

td input {
  width: 100%;
}

.row-remove {
  border: 1px solid #b8c0ca;
  border-radius: 6px;
  background: #fff;
  color: #24313f;
  height: 30px;
  padding: 5px 8px;
  font-weight: 800;
}

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

.segmented label,
.checkline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #c9d6e4;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 800;
  color: #24313f;
  background: #fff;
}

.checkline {
  margin-top: 10px;
}

.segmented input,
.checkline input {
  height: auto;
}

.schedule-list {
  display: grid;
  gap: 8px;
}

.schedule-row,
.review-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.45fr) 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #e7edf4;
}

.schedule-row strong,
.review-row strong {
  color: #52657d;
}

.form433d-warning,
.form433d-alert {
  border: 1px solid #d8b25f;
  border-radius: 8px;
  background: #fff7e6;
  color: #5c3a07;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-weight: 700;
}

.form433d-alert.error {
  border-color: #d99a9a;
  background: #fff0f0;
  color: #8a2424;
}

.form433d-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

#balance-source,
#bank-link-status {
  color: #53657a;
  font-weight: 800;
}

@media (max-width: 760px) {
  .form433d-title-row,
  .section-head {
    display: block;
  }

  .form433d-title-row .btn-neutral,
  .section-head .btn-neutral {
    margin-top: 10px;
  }

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

  .schedule-row,
  .review-row {
    grid-template-columns: 1fr;
  }
}

/* Keep the form controls and review within the existing page at narrow widths. */
.form433d-shell *, .form433d-shell { box-sizing: border-box; }
.field-grid label, .field-grid input, .field-grid select { min-width: 0; width: 100%; }
.review-row span, .agreement-option { overflow-wrap: anywhere; }
.form433d-shell .btn-neutral, .form433d-shell .btn-blue-bright, .form433d-shell .btn-gold {
  display: inline-flex; align-items: center; justify-content: center; border: 1px solid #bdc9d7; border-radius: 8px;
  min-height: 40px; padding: 10px 14px; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer;
}
.form433d-shell .btn-neutral { color: #0b3a6e; background: #fff; }
.form433d-shell .btn-blue-bright { color: #fff; background: #0b3a6e; }
.form433d-shell .btn-gold { color: #0b1f33; background: #f6cc6d; border-color: #b98518; }
@media (max-width: 480px) {
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { margin-bottom: 14px; }
  .table-wrap td:nth-child(1)::before { content: "Tax form"; }
  .table-wrap td:nth-child(2)::before { content: "Tax period"; }
  .table-wrap td:nth-child(3)::before { content: "Balance as of"; }
  .table-wrap td:nth-child(4)::before { content: "Balance"; }
}

.table-wrap input[type="checkbox"] { width: auto; height: auto; }
.form433d-shell button:disabled { cursor: wait; opacity: 0.65; }

@media (max-width: 480px) {
  .table-wrap td::before { display: block; margin-bottom: 4px; font-weight: 700; }
}

.field-grid .checkline { flex-direction: row; align-items: center; justify-content: flex-start; }
.field-grid input[type="checkbox"], .field-grid input[type="radio"] { width: 16px; height: 16px; min-height: 16px; }

@media print {
  .tt-header, .tt-footer, button, .form433d-actions, #back-profile { display: none !important; }
  body { background: #fff; }
  .form433d-shell { width: 100%; max-width: none; margin: 0; padding: 0; }
}
