:root { font-family: Arial, sans-serif; color: #203b30; background: #edf3ef; }
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 840px; margin: 0 auto; padding: 32px 20px; }
main > header, #notice-form, .guide { background: white; padding: 28px 32px; border: 1px solid #bac9c0; }
main > header, .guide { margin: 0 0 16px; }
h1, h2 { font-family: Georgia, serif; margin: 0; }
h1 { font-size: clamp(30px, 5vw, 44px); }
main > header a { color: #215b44; font-weight: bold; }
form { display: grid; gap: 24px; }
fieldset { margin: 0; min-width: 0; padding: 0; border: 1px solid #bac9c0; }
legend { float: left; width: 100%; padding: 10px 14px; background: #e9f1ec; font-weight: bold; }
.fields { clear: both; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; padding: 16px; }
.field { grid-column: span 12; min-width: 0; display: grid; gap: 5px; }
.tenants, .city { grid-column: span 8; }
.noticeDate { grid-column: span 4; }
.state, .zip { grid-column: span 2; }
.sender, .contact { grid-column: span 6; }
label { font-size: 13px; line-height: 1.35; }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #83958b; background: white; border-radius: 3px; font: 16px/1.5 Arial, sans-serif; color: inherit; padding: 8px; }
:where(input,select,textarea):focus { outline: 2px solid #286f51; outline-offset: 1px; background: #edf7f1; }
textarea { resize: vertical; }
.signature { clear: both; display: grid; grid-template-columns: 1fr 170px; align-items: end; gap: 16px; padding: 16px; }
.line { border-bottom: 1px solid #83958b; padding: 10px 0; font-size: 13px; }
.guide { margin-top: 16px; }
@media (max-width: 600px) {
  main { padding: 12px; }
  main > header, #notice-form, .guide { padding: 16px; }
  .fields { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 12px; padding: 12px; }
  .field { grid-column: 1 / -1; }
  .state, .zip { grid-column: span 1; }
  .signature { grid-template-columns: 1fr; padding: 12px; }
}
#notice-form :is(input, select, textarea, canvas) { scroll-margin-top: 60px; }
#notice-form button, #pdf-review button { min-height: 44px; padding: 8px 16px; color: white; background: #214c3d; border: 1px solid #214c3d; border-radius: 5px; font: inherit; }
#notice-form .signature { grid-template-columns: minmax(0, 1fr); align-items: start; }
#signature-pad { width: 100%; max-width: 680px; border: 1px solid #83958b; touch-action: none; cursor: crosshair; }
#clear-signature { justify-self: start; }
#notice-form [name=signedDate] { display: block; width: min(100%, 180px); }
#notice-form .consent { display: flex; gap: 8px; align-items: center; }
#sign-consent { width: 20px; min-height: 20px; }
.step-nav, .export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#pdf-review { width: min(95vw, 850px); border: 1px solid #83958b; }
#pdf-review iframe { display: block; margin-top: 10px; width: 100%; height: 72vh; border: 0; }
@media(max-width: 600px) {
  .step-nav { position: sticky; bottom: 0; background: white; z-index: 1; padding: 8px 0 max(8px, env(safe-area-inset-bottom)); }
}

@media (min-width: 601px) {
  .city { grid-column: span 5; }
  .state { grid-column: span 5; }
}
#notice-form .fields :is(input, select, textarea):focus {
  background: #edf7f1;
  outline: 2px solid #286f51;
  outline-offset: 1px;
  animation: active-notice-field 2s ease-in-out infinite alternate;
}
@keyframes active-notice-field {
  to { outline-color: #58856c; background-color: #e3f2e9; }
}
@media (prefers-reduced-motion: reduce) {
  #notice-form .fields :is(input, select, textarea):focus { animation: none; }
}

.state-menu { display: none; }
@media (min-width: 601px) {
  .field.state.has-state-menu { position: relative; }
  .has-state-menu #state { display: none; }
  .has-state-menu .state-menu { display: block; }
  #notice-form #state-menu-toggle { width: 100%; color: #203b30; background: white; border-color: #83958b; text-align: left; }
  .state-menu-list { display: none; position: absolute; inset: 100% 0 auto 0; z-index: 3; overflow-y: auto; max-height: 240px; background: white; border: 1px solid #83958b; box-shadow: 0 4px 12px #203b3030; }
  .state-menu-list:not([hidden]) { display: grid; }
  #notice-form .state-menu-list button { color: #203b30; background: white; border: 0; border-radius: 0; text-align: left; }
  #notice-form .state-menu-list button:is(:hover,:focus-visible,[aria-current=true]) { background: #e3f2e9; }
}

#notice-form .fields :is(input, select, textarea):focus,
#notice-form .field.state:focus-within #state-menu-toggle {
  background-color: #e5f4e9;
  outline: 2px solid #3d805d;
  outline-offset: 1px;
  animation: notice-field-highlight 1.9s ease-in-out infinite alternate;
}
@keyframes notice-field-highlight {
  to { background-color: #cce9d5; outline-color: #74a689; }
}
@media (prefers-reduced-motion: reduce) {
  #notice-form .fields :is(input, select, textarea):focus,
  #notice-form .field.state:focus-within #state-menu-toggle { animation: none; }
}
@media (min-width: 601px) {
  #notice-form.navigation-active .step-nav {
    position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
    z-index: 4; padding: 6px; border: 1px solid #bac9c0; border-radius: 8px;
    background: white; box-shadow: 0 3px 14px #203b3026;
  }
  #notice-form.navigation-active { padding-bottom: 88px; }
  #notice-form.navigation-active .step-nav button { min-width: 100px; }
}

.start-dock { display: flex; justify-content: flex-end; position: sticky; top: 10px; z-index: 2; pointer-events: none; }
.start-dock button { pointer-events: auto; box-shadow: 0 2px 8px #203b3030; }
@media (min-width: 601px) {
  #notice-form.navigation-active .step-nav {
    left: var(--step-nav-x, 50%);
    top: var(--step-nav-y, auto);
    bottom: auto;
    transform: none;
    width: max-content;
  }
}
@media (max-width: 600px) {
  #notice-form.navigation-active .step-nav {
    position: fixed; left: 0; right: 0; bottom: 0;
    justify-content: center; z-index: 4;
    border-top: 1px solid #bac9c0;
    bottom: var(--step-keyboard-offset, 0px);
  }
  #notice-form.navigation-active { padding-bottom: 80px; }
}
.field.state:has(#state-menu-toggle[aria-expanded=true]) .state-menu-list { z-index: 5; }

.start-dock { position: static; min-height: 0; padding: 0; }
#notice-form #start-here-button {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(16px + env(safe-area-inset-right));
  z-index: 6;
}

#notice-form .step-nav[hidden] { display: none; }
#additional-section { padding: 12px 16px; border: 1px solid #bac9c0; }
#additional-section label { display: block; margin: 12px 0 4px; }
#additional-terms::placeholder { color: #606b64; font-style: italic; }
#additional-terms:focus { background: #e5f4e9; outline: 2px solid #3d805d; }
#stroke-width { width: min(100%, 240px); accent-color: #214c3d; }
#notice-form #clear-notice { justify-self: start; color: #214c3d; background: white; }
.draft-help { margin: 0; font-size: .875rem; }

#additional-terms:focus {
  outline-offset: 1px;
  animation: notice-field-highlight 1.9s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion: reduce) {
  #additional-terms:focus { animation: none; }
}

.signing-identity { margin: 0; font-size: .875rem; color: #214c3d; }
.signing-pen { display: inline-block; margin-right: 5px; }
.signing-identity.has-signer .signing-pen { animation: signing-pen 1.8s ease-in-out infinite alternate; }
@keyframes signing-pen { to { transform: translateX(3px) rotate(-18deg); } }
@media (prefers-reduced-motion: reduce) { .signing-identity.has-signer .signing-pen { animation: none; } }

#notice-form .fields :is(input, select, textarea):focus,
#notice-form .field.state:focus-within #state-menu-toggle,
#notice-form :is(#additional-terms, [name=signedDate]):focus {
  background-color: #edf8ef;
  outline: 2px solid #377a51;
  outline-offset: 1px;
  animation: notice-field-highlight 2.4s ease-in-out infinite;
}
@keyframes notice-field-highlight {
  0%, 100% { background-color: #edf8ef; outline-color: #377a51; box-shadow: 0 0 0 2px #65a77915; }
  50% { background-color: #b9e4c5; outline-color: #21643b; box-shadow: 0 0 0 4px #65a77938; }
}
@media (prefers-reduced-motion: reduce) {
  #notice-form .fields :is(input, select, textarea):focus,
  #notice-form .field.state:focus-within #state-menu-toggle,
  #notice-form :is(#additional-terms, [name=signedDate]):focus { animation: none; }
}

#open-signature { display: none; }
#signature-pad { display: block; aspect-ratio: 680 / 250; background: #fff; border: 2px solid #59856d; border-radius: 6px; }
#signature-dialog { width: min(calc(100% - 20px), 480px); max-height: 88dvh; border: 1px solid #83958b; border-radius: 12px; padding: 16px; color: #203b30; }
#signature-dialog::backdrop { background: #152e26a0; }
#signature-dialog header { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 0; border: 0; }
#signature-dialog #close-signature { background: #fff; color: #214c3d; border: 0; font-size: 24px; }
#signature-dialog .signature { padding: 12px 0 0; gap: 10px; }
#signature-status:empty { display:none; }
#save-mobile-signature { width: 100%; margin-top: 12px; }
@media (max-width: 600px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .fields .field { grid-column: 1 / -1; }
  #signature-section > .signature { display: none; }
  #notice-form #open-signature { display: block; clear: both; margin: 12px; }
}

main > header { margin-bottom: 0; border-bottom: 0; }
main > header p { margin-bottom: 0; }
.paper-window { background: white; }
.paper-window:focus-visible { outline: 2px solid #286f51; outline-offset: -2px; }
.paper-window #notice-form { border-top: 0; padding-top: 12px; }
.blank-download { padding: 14px 0; text-align: right; }
.blank-download a { color: #214c3d; font-weight: 700; display: inline-block; padding: 8px 0; }
@media (max-width: 600px) {
  .paper-window { overflow-x: auto; border-inline: 1px solid #bac9c0; }
  .paper-window #notice-form { min-width: 460px; border-inline: 0; }
  .paper-window #signature-dialog { max-width: calc(100vw - 20px); }
}

@media (max-width: 600px) {
  .paper-window #notice-form { min-width: 560px; }
  .paper-window .fields { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .paper-window .fields .field { grid-column: span 12; }
  .paper-window .fields .tenants { grid-column: span 8; }
  .paper-window .fields .noticeDate { grid-column: span 4; }
  .paper-window .fields :is(.city,.state) { grid-column: span 5; }
  .paper-window .fields .zip { grid-column: span 2; }
  .paper-window .fields :is(.sender,.contact) { grid-column: span 6; }
}

#notice-form .noticeDate {
  display: grid;
  grid-template-rows: min-content minmax(44px, auto);
  align-content: start;
  min-inline-size: 0;
}
#noticeDate {
  display: block;
  box-sizing: border-box;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  min-block-size: 44px;
  padding-inline: 10px;
}
#noticeDate::-webkit-date-and-time-value { text-align: left; }
#noticeDate::-webkit-calendar-picker-indicator { margin: 0; padding: 2px; }
#notice-form .field { scroll-margin-block-start: 72px; }
@media (max-width: 600px) {
  .paper-window .fields .tenants { grid-column: span 7; }
  .paper-window .fields .noticeDate { grid-column: span 5; }
  #notice-form:has(.noticeDate:focus-within) #start-here-button { visibility: hidden; }
}

.field { align-content: start; }
#notice-form .field label { display: flex; align-items: baseline; gap: 7px; min-inline-size: 0; }
.field-check { color: #21643b; font-weight: bold; flex: none; }
#notice-form .fields :is(input, select, textarea, #state-menu-toggle) { max-inline-size: 100%; }
#notice-form input[type=date] { padding-inline: 10px 16px; }
#notice-form input[type=date]::-webkit-date-and-time-value { min-inline-size: 0; text-align: left; }
#notice-form input[type=date]::-webkit-calendar-picker-indicator { flex-shrink: 0; margin-inline-start: 4px; margin-inline-end: 2px; }
@media (max-width: 600px) {
  .paper-window #notice-form { min-width: 580px; padding-inline: 20px; }
  #notice-form .fields { column-gap: 16px; }
}

@media (max-width: 600px) {
  #notice-form .fields .noticeDate {
    grid-template-columns: minmax(0, 1fr);
    padding-inline-end: 16px;
    padding-block-end: 6px;
    overflow: clip;
  }
  #notice-form .noticeDate label { overflow-wrap: anywhere; }
  #notice-form #noticeDate {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding-inline-end: 14px;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
  }
}

#notice-form input[type=date] {
  box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%;
  padding: 8px 42px 8px 10px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23214c3d' stroke-width='1.7' stroke-linecap='round'%3E%3Crect x='4' y='6' width='16' height='14' rx='2'/%3E%3Cpath d='M8 4v4m8-4v4M4 11h16'/%3E%3C/svg%3E") !important;
  background-size: 19px 19px; background-position: right 12px center; background-repeat: no-repeat;
  position: relative;
}
#notice-form input[type=date]::-webkit-calendar-picker-indicator {
  position: absolute; right: 6px; top: 0; width: 34px; height: 100%; padding: 0; margin: 0; opacity: 0; cursor: pointer;
}
#notice-form .fields .requestedDate { max-width: 270px; padding-inline-end: 16px; padding-block-end: 6px; overflow: clip; }
#notice-form #requestedDate { max-width: 205px; }
#notice-form #noticeDate { padding-inline-end: 42px; }
.signature-tools { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 14px; }
.stroke-control { display: grid; gap: 2px; flex: 1 1 120px; min-width: 0; }
#notice-form #stroke-width { min-height: 36px; padding: 0; border: 0; }
#notice-form #clear-signature { color: #214c3d; background: white; border-color: #aac0b2; font-size: .875rem; }
#signature-dialog { background: #fff; padding: 18px; box-shadow: 0 14px 44px #142d2866; }
#signature-dialog header { padding-bottom: 12px; border-bottom: 1px solid #d6e0d9; }
#signature-dialog h2 { font-size: 25px; }
#signature-dialog #signature-pad { border-color: #7da88d; background-color: #fbfdfb; }
#signature-dialog .signing-identity { font-weight: 600; }
#signature-dialog .consent { border-top: 1px solid #d6e0d9; padding-top: 8px; }
#signature-dialog [name=signedDate] { width: min(100%, 178px); }
@media (max-width: 600px) {
  #signature-dialog { width: min(calc(100dvw - 24px), 440px); }
  #signature-dialog #signature-pad { width: 100%; }
}
#notice-form #requestedDate { inline-size: min(100%, 205px); max-inline-size: 205px; }


#zip-hint { font-size: .75rem; color: #465851; }
#notice-form #gmail-suggestion { background: #edf7ef; color: #214c3d; border-color: #9fbdab; justify-self: start; text-align: left; }
#notice-form #gmail-suggestion[hidden] { display: none; }
.export-actions { display: grid; gap: 16px; padding: 20px; border: 1px solid #bac9c0; border-radius: 8px; background: #f3f8f4; }
.finish-copy p { margin: 6px 0 0; color: #465851; }
.finish-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
#notice-form #review { background: white; color: #214c3d; }
#notice-form :is(#review, #open-signature, .finish-buttons button[type=submit]) { font-weight: 700; }
@media (max-width: 600px) {
  .export-actions { max-width: 300px; }
}
#notice-form #gmail-suggestion { max-width: 100%; overflow-wrap: anywhere; }

#notice-form input[type=date] {
  background-repeat: no-repeat !important;
  background-size: 19px 19px !important;
  background-position: right 12px center !important;
}
.finish-copy p { font-size: 1rem; line-height: 1.45; }
.finish-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
#notice-form .finish-buttons button { min-height: 50px; line-height: 1.3; }
@media (max-width: 600px) {
  .export-actions { width: min(100%, calc(100vw - 72px)); max-width: 350px; padding: 16px; }
  .finish-buttons { grid-template-columns: minmax(0, 1fr); }
}

#notice-form .fields :is(.city,.state,.zip) > label {
  min-block-size: 18px;
  line-height: 18px;
}
#notice-form .fields :is(#city,#state,#zip,#state-menu-toggle) {
  box-sizing: border-box;
  block-size: 44px;
  min-block-size: 44px;
  padding-block: 0;
  font: 16px/1.25 Arial, sans-serif;
  margin: 0;
}

#saved-signature { display: none; }
@media (max-width: 600px) {
  #saved-signature:not([hidden]) {
    display: block; clear: both; width: min(300px, calc(100vw - 72px)); margin: 12px;
    padding: 10px 12px; border: 1px solid #a9c3b1; border-radius: 6px; background: #f8fbf8;
  }
  #saved-signature img { display: block; width: 100%; height: auto; }
  #saved-signature figcaption { color: #465851; font-size: .875rem; }
}

.guide { color: #263d33; line-height: 1.6; }
.guide h3 { margin: 24px 0 6px; }
.guide a { color: #245c43; text-underline-offset: 3px; }
.state-rule { border-top: 1px solid #c8d7cd; padding: 0 12px 0 0; }
.state-rule summary { font-weight: 700; cursor: pointer; padding: 10px 4px; min-height: 44px; }
.state-rule:target { scroll-margin-top: 90px; }
.state-rule dl { margin: 0; }
.state-rule dt { font-weight: 700; }
.state-rule dd { margin: 0 0 12px; }
.law-sources { margin: 8px 0 16px; padding-left: 22px; overflow-wrap: anywhere; }
#state-guide-status:empty { display: none; }

.state-directory { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: start; }
.state-directory .state-rule { min-width: 0; padding: 0; border: 1px solid #c8d7cd; border-radius: 6px; background: #f6f9f6; }
.state-directory .state-rule summary { padding: 10px 14px; }
.state-directory .state-rule[open] { background: white; }
.state-directory .state-rule[open] summary { border-bottom: 1px solid #c8d7cd; background: #eaf3ec; border-radius: 5px 5px 0 0; }
.state-directory .state-rule dl { padding: 14px 16px 0; }
.state-directory .state-rule .law-sources { margin: 4px 16px 16px; }
@media (min-width: 740px) {
  .state-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
  .state-directory .state-rule[open] { grid-column: 1 / -1; }
}

#notice-form .start-dock { justify-content: flex-start; margin-bottom: -12px; }
#notice-form #start-here-button { position: static; box-shadow: none; }
#notice-form .start-dock:has(#start-here-button[hidden]) { display: none; }
#notice-form .start-dock { scroll-margin-top: 90px; }

#notice-form .start-dock { min-height: 36px; }
#notice-form #start-here-button {
  position: fixed; inset: var(--start-top, 110px) var(--start-right, 20px) auto auto;
  visibility: var(--start-visibility, hidden);
  z-index: 6; padding: 5px 11px; min-height: 38px; font-size: .875rem;
  box-shadow: 0 2px 8px #203b3026;
}

#zip-hint {
  position: absolute; inline-size: 1px; block-size: 1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

main > header .hero-blank-download {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px;
  padding: 8px 14px; border: 1px solid #789685; border-radius: 5px;
  background: white; text-decoration: none;
}
main > header .hero-blank-download:is(:hover,:focus-visible) { background: #eaf3ec; text-decoration: underline; }

.paper-tools { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0 0 12px; }
.paper-tools a { display: inline-flex; align-items: center; min-height: 44px; color: #214c3d; text-underline-offset: 3px; }
main > header { padding-bottom: 14px; }
