/* =========================================================
       1. THE SWISS CLOCK BRAND COLORS
       ========================================================= */

    :root {
      --tsc-red: #a71930;
      --ink: #252525;
      --muted: #666666;
      --line: #777777;
      --soft: #f1f1f1;
      --paper: #ffffff;
      --page-background: #ececec;
      --ink-blue: #234b9b;
    }

    /* =========================================================
       2. GLOBAL STYLES
       ========================================================= */

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      background: var(--page-background);
      color: var(--ink);
      font-family: Helvetica, Arial, sans-serif;
    }

    /* =========================================================
       3. PRINT BUTTON
       ========================================================= */

    .toolbar {
      display: flex;
      justify-content: flex-end;
      width: 8.5in;
      max-width: calc(100% - 24px);
      margin: 16px auto 8px;
    }

    .print-button {
      padding: 10px 18px;
      border: 0;
      border-radius: 3px;
      background: var(--tsc-red);
      color: #ffffff;
      font-weight: 700;
      cursor: pointer;
    }

    /* =========================================================
       4. PAGE
       ========================================================= */

    .page {
      width: 8.5in;
      min-height: 11in;
      margin: 0 auto 24px;
      padding: 0.34in 0.38in;
      background: var(--paper);
      box-shadow: 0 2px 16px rgba(0, 0, 0, 0.14);
    }

    /* =========================================================
       5. MAIN FORM TABLE
       ========================================================= */

    .form-grid {
      width: 100%;
      table-layout: fixed;
      border-collapse: collapse;
      border: 1px solid var(--line);
      font-size: 9.15pt;
      line-height: 1.13;
    }

    .form-grid th,
    .form-grid td {
      padding: 8px 6px;
      border: 1px solid var(--line);
      vertical-align: middle;
    }

    /* =========================================================
       6. HEADER
       ========================================================= */

    .brand-row td {
      padding: 7px 8px;
    }

    .form-title {
      color: var(--tsc-red);
      font-size: 14pt;
      font-weight: 800;
      letter-spacing: 0.2px;
    }

    .brand {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 8px;
      font-family: Georgia, "Times New Roman", serif;
      font-size: 20pt;
      letter-spacing: -0.35px;
    }

    .cross {
      display: inline-grid;
      place-items: center;
      width: 25px;
      height: 25px;
      background: var(--tsc-red);
      color: #ffffff;
      font: 700 28px/1 Arial, sans-serif;
    }

    .contact {
      font-size: 9.3pt;
      line-height: 1.25;
    }

    .notice {
      font-size: 8.7pt;
      line-height: 1.18;
    }

    /* =========================================================
       7. SECTION HEADERS
       ========================================================= */

    .section {
      background: var(--soft);
      text-align: left;
      font-size: 10pt;
      font-weight: 800;
      letter-spacing: 0.2px;
      text-transform: uppercase;
    }

    .subhead {
      margin: 0 0 4px;
      font-size: 9.5pt;
      font-weight: 800;
      text-transform: uppercase;
    }

    /* =========================================================
       8. FORM FIELDS
       ========================================================= */

    .field {
      width: 100%;
      height: 22px;
      padding: 0 2px;
      border: 0;
      border-bottom: 0px solid #444444;
      background: transparent;
      color: var(--ink-blue);
      font: inherit;
      font-weight: 500;
    }

    textarea {
      width: 100%;
      min-height: 70px;
      padding: 4px 2px;
      border: 0;
      resize: none;
      background: transparent;
      color: var(--ink-blue);
      font: inherit;
      font-weight: 500;
    }

    .field:focus,
    textarea:focus {
      outline: 1px solid var(--tsc-red);
      outline-offset: 1px;
    }

    input[type="date"] {
      width: 100%;
      border: 0;
      background: transparent;
      color: var(--ink-blue);
      font: inherit;
      font-weight: 500;
    }

    .system-field {
      color: var(--ink);
      font-weight: 600;
    }

    /* Keep Safari and Chrome autofill backgrounds white */
    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus,
    textarea:-webkit-autofill,
    textarea:-webkit-autofill:hover,
    textarea:-webkit-autofill:focus,
    select:-webkit-autofill,
    select:-webkit-autofill:hover,
    select:-webkit-autofill:focus {
      -webkit-text-fill-color: var(--ink-blue);
      -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
      box-shadow: 0 0 0 1000px #ffffff inset;
      caret-color: var(--ink-blue);
      transition: background-color 99999s ease-in-out 0s;
    }

    .system-field:-webkit-autofill,
    .system-field:-webkit-autofill:hover,
    .system-field:-webkit-autofill:focus {
      -webkit-text-fill-color: var(--ink);
      caret-color: var(--ink);
    }

    /* =========================================================
       9. CHECKBOXES
       ========================================================= */

    .choice-row {
      display: flex;
      align-items: center;
      gap: 9px;
      white-space: nowrap;
    }

    .choice {
      display: inline-flex;
      align-items: center;
      gap: 3px;
    }

    input[type="checkbox"] {
      appearance: none;
      width: 13px;
      height: 13px;
      margin: 0;
      border: 1px solid #555555;
      background: #ffffff;
    }

    input[type="checkbox"]:checked::after {
      content: "✓";
      display: block;
      text-align: center;
      font-size: 11px;
      line-height: 11px;
      color: var(--ink-blue);
      font-weight: 700;
    }

    /* =========================================================
       10. LISTS AND SMALL TEXT
       ========================================================= */

    .notice ul,
    .compact-list {
      margin: 0;
      padding-left: 16px;
    }

    .notice li,
    .compact-list li {
      margin: 0 0 2px;
    }

    .fine {
      font-size: 8.3pt;
      line-height: 1.15;
    }

    .warning {
      color: var(--tsc-red);
      font-weight: 800;
    }

    /* =========================================================
       11. PAYMENT SECTION
       ========================================================= */

    .payment-box,
    .info-box {
      min-height: 250px;
    }

    .payment-table {
      width: 100%;
      margin-top: 4px;
      table-layout: fixed;
      border-collapse: collapse;
    }

    .payment-table td {
      height: 24px;
      padding: 3px 5px;
      border: 1px solid var(--line);
    }

    .payment-table .pay-label {
      width: 39%;
      font-weight: 700;
    }

    .card-choices {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 3px 10px;
      padding: 2px 0;
    }

    .payment-field {
      height: 19px;
      padding: 0 2px;
    }

    .payment-field::placeholder {
      color: #9a9a9a;
      font-weight: 400;
      opacity: 1;
    }

    /* Payment details are intentionally completed by hand after printing. */
    .handwritten-payment-line {
      min-height: 19px;
      background: var(--paper);
    }

    /* =========================================================
       12. ESTIMATE FEES
       ========================================================= */

    .fees {
      width: 100%;
      margin: 2px 0 5px;
      border-collapse: collapse;
    }

    .fees td {
      padding: 1px 0;
      border: 0;
      vertical-align: top;
    }

    .fees td:last-child {
      text-align: right;
      white-space: nowrap;
    }

    /* =========================================================
       13. FOOTER
       ========================================================= */

    .footer-note {
      padding-top: 10px;
      font-size: 9.5pt;
      text-align: left;
    }

    /* =========================================================
       14. AFTER-PRINT MODAL
       ========================================================= */

    .modal-overlay {
      position: fixed;
      inset: 0;
      z-index: 1000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 24px;
      background: rgba(0, 0, 0, 0.68);
    }

    .modal-overlay.is-visible {
      display: flex;
    }

    .modal-dialog {
      width: 100%;
      max-width: 520px;
      padding: 28px;
      border-radius: 6px;
      background: var(--paper);
      box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
      text-align: center;
    }

    .modal-dialog h2 {
      margin: 0 0 10px;
      color: var(--ink);
      font-size: 20px;
    }

    .modal-dialog p {
      margin: 0 0 18px;
      color: var(--muted);
      font-size: 15px;
      line-height: 1.45;
    }

    .service-summary {
      margin: 0 0 20px;
      border: 1px solid #d2d2d2;
      border-radius: 4px;
      overflow: hidden;
      text-align: left;
    }

    .service-summary-title {
      padding: 9px 12px;
      background: var(--soft);
      color: var(--ink);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.35px;
      text-transform: uppercase;
    }

    .service-summary-row {
      display: grid;
      grid-template-columns: 112px 1fr;
      border-top: 1px solid #e1e1e1;
    }

    .service-summary-label,
    .service-summary-value {
      padding: 8px 12px;
      font-size: 14px;
      line-height: 1.25;
    }

    .service-summary-label {
      background: #fafafa;
      color: var(--muted);
      font-weight: 700;
    }

    .service-summary-value {
      color: var(--ink-blue);
      font-weight: 700;
      overflow-wrap: anywhere;
    }

    .online-payment-warning {
      color: var(--tsc-red);
      font-weight: 800;
    }

    .modal-actions {
      display: grid;
      gap: 10px;
    }

    .modal-button {
      width: 100%;
      padding: 12px 16px;
      border: 1px solid var(--tsc-red);
      border-radius: 4px;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
    }

    .modal-button-primary {
      background: var(--tsc-red);
      color: #ffffff;
    }

    .modal-button-secondary {
      background: #ffffff;
      color: var(--tsc-red);
    }

    body.modal-open {
      overflow: hidden;
    }

    /* =========================================================
       15. MOBILE / NARROW SCREEN
       ========================================================= */

    @media (max-width: 900px) {
      .toolbar {
        width: calc(100% - 20px);
      }

      .page {
        width: calc(100% - 20px);
        min-height: auto;
        padding: 18px;
        overflow-x: auto;
      }

      .form-grid {
        min-width: 760px;
      }
    }



    /* =========================================================
       15A. TRUE RESPONSIVE MOBILE LAYOUT
       Keeps the desktop and print versions unchanged.
       ========================================================= */

    @media screen and (max-width: 760px) {
      body {
        background: #ffffff;
      }

      .toolbar {
        position: sticky;
        top: 0;
        z-index: 20;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 10px 12px;
        background: rgba(255,255,255,.96);
        border-bottom: 1px solid #d7d7d7;
        backdrop-filter: blur(8px);
      }

      .print-button {
        width: 100%;
        min-height: 44px;
        font-size: 14px;
      }

      .page {
        width: 100%;
        margin: 0;
        padding: 14px 12px 24px;
        overflow: visible;
        box-shadow: none;
      }

      .form-grid {
        display: block;
        min-width: 0;
        border: 0;
        font-size: 14px;
        line-height: 1.35;
      }

      .form-grid colgroup {
        display: none;
      }

      .form-grid tbody {
        display: block;
      }

      .form-grid tr {
        display: grid;
        grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
        gap: 0;
        margin: 0 0 12px;
        overflow: hidden;
        border: 1px solid #b9b9b9;
        border-radius: 4px;
        background: #ffffff;
      }

      .form-grid th,
      .form-grid td {
        display: block;
        width: auto !important;
        min-width: 0;
        padding: 10px 11px;
        border: 0;
        border-bottom: 1px solid #d8d8d8;
        vertical-align: top;
      }

      .form-grid tr > *:nth-last-child(-n+2) {
        border-bottom: 0;
      }

      .form-grid th[colspan="12"],
      .form-grid td[colspan="12"],
      .form-grid td[colspan="10"],
      .form-grid td[colspan="7"],
      .form-grid td[colspan="6"].payment-box,
      .form-grid td[colspan="6"].info-box {
        grid-column: 1 / -1;
      }

      .form-grid th.section {
        grid-column: 1 / -1;
        padding: 12px;
        background: var(--tsc-red);
        color: #ffffff;
        border: 0;
        font-size: 13px;
        letter-spacing: .08em;
      }

      .brand-row {
        grid-template-columns: 1fr !important;
      }

      .brand-row td {
        grid-column: 1 / -1;
        text-align: center;
      }

      .brand {
        justify-content: center;
        font-size: 24px;
      }

      .form-title {
        font-size: 17px;
        text-align: center;
      }

      .contact {
        font-size: 13px;
        line-height: 1.45;
      }

      /* Keep the service instructions as one full-width column on mobile. */
      .form-grid td.notice[colspan="6"] {
        grid-column: 1 / -1;
        border-bottom: 0;
      }

      /* Mobile header layout: address on its own row, date label and field together. */
      .service-header-details {
        grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
      }

      .service-header-details .service-address {
        grid-column: 1 / -1;
        grid-row: auto;
        border-bottom: 1px solid #d8d8d8;
      }

      .service-header-details .service-date-label {
        grid-column: 1;
        grid-row: auto;
        border-bottom: 0;
      }

      .service-header-details .service-date-field {
        grid-column: 2;
        grid-row: auto;
        border-bottom: 0;
      }

      .service-header-details .service-date-field input[type="date"] {
        width: 100%;
        margin: 0;
      }

      .notice {
        font-size: 12px;
        line-height: 1.4;
      }

      .shade {
        background: #f3f3f3;
      }

      .field,
      input[type="date"] {
        min-height: 34px;
        height: auto;
        padding: 5px 3px;
        font-size: 16px;
      }

      textarea {
        min-height: 120px;
        font-size: 16px;
      }

      .choice-row {
        flex-wrap: wrap;
        white-space: normal;
      }

      input[type="checkbox"] {
        width: 18px;
        height: 18px;
      }

      input[type="checkbox"]:checked::after {
        font-size: 15px;
        line-height: 16px;
      }

      .payment-box,
      .info-box {
        min-height: 0;
      }

      .payment-table {
        font-size: 13px;
      }

      .payment-table,
      .payment-table tbody,
      .payment-table tr {
        display: block;
      }

      .payment-table tr {
        margin: 0;
        border: 0;
        border-bottom: 1px solid #d8d8d8;
        border-radius: 0;
      }

      .payment-table td {
        display: block;
        width: 100% !important;
        height: auto;
        padding: 8px;
        border: 0;
      }

      .payment-table .pay-label {
        width: 100%;
        padding-bottom: 3px;
      }

      .card-choices {
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .fees td {
        display: table-cell;
        width: auto !important;
        padding: 3px 0;
      }

      .footer-note {
        padding: 8px 2px 0;
        font-size: 12px;
        line-height: 1.45;
      }

      .modal-overlay {
        padding: 12px;
      }

      .modal-dialog {
        max-height: calc(100svh - 24px);
        overflow-y: auto;
        padding: 22px 16px;
      }

      .service-summary-row {
        grid-template-columns: 92px minmax(0, 1fr);
      }

      .service-summary-label,
      .service-summary-value {
        padding: 8px 9px;
        font-size: 13px;
      }
    }

    @media screen and (max-width: 430px) {
      .page {
        padding-right: 8px;
        padding-left: 8px;
      }

      .form-grid tr {
        grid-template-columns: 1fr;
      }

      .form-grid th,
      .form-grid td,
      .form-grid th[colspan],
      .form-grid td[colspan] {
        grid-column: 1 / -1;
      }

      .form-grid tr > * {
        border-bottom: 1px solid #d8d8d8;
      }

      .form-grid tr > *:last-child {
        border-bottom: 0;
      }

      .shade {
        font-weight: 700;
      }

      .brand {
        font-size: 22px;
      }

      .cross {
        width: 23px;
        height: 23px;
        font-size: 25px;
      }

      .modal-button {
        font-size: 13px;
        line-height: 1.35;
      }
    }


    /* =========================================================
       16. PRINT
       ========================================================= */

    @media print {
      @page {
        size: Letter portrait;
        margin: 0.20in 0.25in;
      }

      html,
      body {
        width: 100%;
        height: auto;
        background: #ffffff;
      }

      .toolbar,
      .modal-overlay {
        display: none !important;
      }

      .page {
        width: auto;
        min-height: auto;
        margin: 0;
        padding: 0;
        box-shadow: none;
      }

      .form-grid {
        font-size: 8.15pt;
        line-height: 1.05;
        page-break-inside: avoid;
      }

      .form-grid th,
      .form-grid td {
        padding: 4px 5px;
      }

      .brand-row td {
        padding: 5px 7px;
      }

      .brand {
        font-size: 18pt;
      }

      .cross {
        width: 22px;
        height: 22px;
        font-size: 23px;
      }

      .form-title {
        font-size: 12.5pt;
      }

      .contact {
        font-size: 8.35pt;
        line-height: 1.15;
      }

      .notice {
        font-size: 7.8pt;
        line-height: 1.1;
      }

      .section {
        font-size: 9pt;
      }

      .subhead {
        margin-bottom: 2px;
        font-size: 8.5pt;
      }

      .field {
        height: 16px;
      }

      textarea {
        min-height: 45px;
        padding: 2px;
      }

      .fine {
        font-size: 7.4pt;
        line-height: 1.08;
      }

      .notice li,
      .compact-list li {
        margin-bottom: 1px;
      }

      .payment-box,
      .info-box {
        min-height: 0;
      }

      .payment-table {
        margin-top: 2px;
      }

      .payment-table td {
        height: 20px;
        padding: 2px 4px;
      }

      .card-choices {
        gap: 2px 8px;
        padding: 1px 0;
      }

      .fees {
        margin: 1px 0 3px;
      }

      .fees td {
        padding: 0;
      }

      .footer-note {
        padding-top: 4px;
        font-size: 7.5pt;
      }

      input,
      textarea,
      .shade,
      .section,
      .cross {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
      }
    }

	
    /* =========================================================
       7. TABLE BACKGROUNDS
       ========================================================= */

    .shade {
      background: var(--soft);
    }
	
	.white {
      background: var(--paper);
    }
