    .refusal_page {
      width: min(100vw, 11in);
      min-height: 8.5in;
      margin: 0 auto;
      padding: clamp(6px, .9vw, 12px);
      display: flex;
      flex-direction: column;
      gap: 4px;
      --ink: #111;
      --line: #222;
      --soft: #e4e4e4;
      --field: #fff;
      --bg: #fff;
      --accent: #991200;
      --pad: clamp(8px, 1.4vw, 18px);
      --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    	}

    .top {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: start;
      gap: 8px;
    }

    .agency h1 {
      margin: 0;
      font-size: clamp(9px, 1vw, 12px);
      line-height: 1.12;
      font-weight: 800;
      letter-spacing: .01em;
      text-transform: uppercase;
    }

    .agency address {
      margin: 2px 0 0;
      font-style: normal;
      font-size: clamp(9px, 1vw, 12px);
      line-height: 1.12;
    }

    .logo-mark {
      width: clamp(34px, 4.6vw, 52px);
      aspect-ratio: 1 / 1;
      border: 2px solid #142d75;
      border-radius: 50%;
      display: grid;
      place-items: center;
      color: #142d75;
      font-size: clamp(5px, .55vw, 7px);
      font-weight: 800;
      text-align: center;
      line-height: 1.05;
    }

    .form-shell {
      min-height: 0;
      border: 1px solid var(--line);
      display: block;
    }

    .mato	{
	margin-top:16px;
	}

     .dspace	{
	width:100%;
	height:0px
	}

    .titlebar {
      background: var(--soft);
      min-height: 34px;
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: end;
      gap: 8px;
      padding: 6px 10px 5px;
      border-bottom: 1px solid #aaa;
    }

    .titlebar .form-title {
      grid-column: 2;
      font-size: clamp(14px, 1.6vw, 20px);
      font-weight: 900;
      text-transform: uppercase;
      line-height: 1;
    }

    .titlebar .form-id {
      grid-column: 2;
      font-size: clamp(8px, .9vw, 10px);
      margin-top: 2px;
    }

    .row {
      display: grid;
      gap: 6px;
      padding: 5px 8px;
      border-bottom: 1px solid var(--line);
    }

    .incident-row {
      grid-template-columns: 1fr 2fr 1fr;
      align-items: center;
    }

    label.inline {
      display: grid;
      grid-template-columns: auto 1fr;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
      font-size: clamp(9px, 1vw, 12px);
    }

    input[type="text"], textarea {
      width: 100%;
      border: 1px solid #aaa;
      background: var(--field);
      padding: 3px 5px;
      font: inherit;
      min-height: 22px;
    }

    .assessment-row {
      grid-template-columns: 1.05fr .95fr 1.45fr;
      align-items: stretch;
      gap: 8px;
      padding-top: 5px;
      padding-bottom: 5px;
    }

    .checks {
      display: grid;
      gap: 5px;
      align-content: start;
      font-size: clamp(9px, 1vw, 12px);
    }

    .checkline {
      display: grid;
      grid-template-columns: 16px 1fr;
      gap: 5px;
      align-items: start;
    }

    input[type="checkbox"] {
      width: 15px;
      height: 15px;
      margin: 0;
      appearance: none;
      border: 2px solid #aaa;
      background: #fff;
    }

    input[type="checkbox"]:checked::after {
      content: "✓";
      display: block;
      font-size: 15px;
      line-height: 12px;
      text-align: center;
      font-weight: 800;
    }

    .name-address {
      border: 1px solid var(--line);
      padding: 5px 7px;
      display: flex;
      flex-direction: column;
      min-height: 44px;
      max-height: 68px;
    }

    .name-address textarea {
      flex: 1;
      resize: none;
    }

    .field-caption {
      margin-top: 3px;
      font-size: clamp(8px, .85vw, 10px);
    }

    .text-body {
      position: relative;
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
      gap: clamp(5px, .65vh, 8px);
      padding: 5px 10px 7px;
      overflow: visible;
    }

    .paragraph-with-initial {
      display: grid;
      grid-template-columns: 1fr clamp(58px, 7vw, 76px);
      gap: 8px;
      align-items: center;
    }

    .refusal-text {
      margin: 0;
      font-size: 16px;
    }

    .initial-box {
      border: 1px solid var(--line);
      padding: 3px;
      text-align: center;
      align-self: center;
      background: #fff;
    }

    canvas.initial-canvas {
      width: 100%;
      height: 50px;
      border: 1px solid #b5b5b5;
      background: #fff;
      touch-action: none;
      display: block;
    }

    .initial-box span {
      display: block;
      margin-top: 2px;
      font-size: 8px;
    }

    .initial-box button {
      margin-top: 2px;
      padding: 1px 5px;
      font-size: 8px;
    }

    .bottom-row {
      display: grid;
      grid-template-columns: 1fr 40%;
      gap: clamp(12px, 4vw, 48px);
      align-items: end;
      padding-top: 4px;
    }

    .notes-box, .signature-box {
      border: 1px solid var(--line);
      padding: 5px;
      height: 100px;
      display: flex;
      flex-direction: column;
      background: #fff;
    }

    .notes-box textarea {
      flex: 1;
      resize: none;
      height: 60px;
    }

    .signature-box {
      min-width: 280px;
    }

    canvas#signature_patient {
      flex: 1;
      width: 100%;
      height: 70px;
      border: 1px solid #b5b5b5;
      background: #fff;
      touch-action: none;
      display: block;
    }

    .signature-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      margin-top: 3px;
    }

    .caption {
      font-size: clamp(8px, .85vw, 10px);
    }

    button {
      border: 1px solid var(--line);
      background: #fff;
      padding: 3px 7px;
      font: inherit;
      cursor: pointer;
    }

    .screen-only-toolbar {
      position: fixed;
      right: 10px;
      bottom: 10px;
      display: flex;
      gap: 6px;
      z-index: 10;
      opacity: .2;
    }

    .screen-only-toolbar:hover,
    .screen-only-toolbar:focus-within {
      opacity: 1;
    }

    .screen-only-toolbar button {
      background: #fff;
      border: 1px solid #555;
      border-radius: 4px;
      font-size: 12px;
    }

    @media (max-height: 650px), (orientation: portrait) {
	html, body {
		#background:red;
		}
	.refusal-text {
		margin: 0;
		font-size: 14px;
		}
	.dspace {
		display:none;
		height: 0px;
		background:red;
		}
	.mato	{
		margin-top:4px;
		}

    @media (max-width: 820px), (orientation: portrait) {
      body.fullscreen-form { overflow: auto; }

      .page {
        height: auto;
        min-height: 100vh;
      }

      .titlebar {
        grid-template-columns: 1fr;
      }

      .titlebar .form-title,
      .titlebar .form-id {
        grid-column: 1;
      }

      .incident-row,
      .assessment-row,
      .bottom-row {
        grid-template-columns: 1fr;
      }

      .paragraph-with-initial {
        grid-template-columns: 1fr;
      }

      .initial-box {
        width: 100px;
        justify-self: end;
      }

      .signature-box {
        width: 100%;
        min-width: 0;
      }
    }

    @media print {
      @page { size: letter landscape; margin: .25in; }

      html, body {
        width: auto;
        height: auto;
        overflow: visible;
      }

      .page {
        width: auto;
        min-height: 0;
        padding: 0;
      }

      .screen-only-toolbar,
      button {
        display: none !important;
      }

      .text-body {
        overflow: visible;
      }
}
