/* The mobile questionnaire is one compact board; the desktop layout is unchanged. */
.mobile-label,.mobile-limit,.mobile-description,.mobile-section-help,.mobile-demands-title{display:none}
.preview-stage[data-device=mobile] .preview-frame{height:844px;max-height:none;min-height:640px}
@media(max-width:760px){
  .fill-body .fill-header{height:44px;padding:0 10px;gap:8px}
  .fill-header .brand-name{font-size:18px}.fill-header .brand-mark{width:28px;height:28px;border-radius:8px}
  .fill-header .button{font-size:11px;min-height:28px;padding:4px 7px}.fill-header .button svg{width:15px;height:15px}
  .fill-wrap,.preview-embedded .fill-wrap{margin:0 auto;padding:7px 8px 12px}
  .fill-banner{margin:0 0 6px;padding:0;align-items:center;gap:5px}.fill-banner .badge{font-size:10px;padding:2px 6px}
  .fill-banner p{font-size:10px;line-height:1.3;max-width:220px}.fill-wrap>.draft-note{display:none}
  .paper{border-radius:10px}.paper-intro{padding:10px 10px 7px;border-top-width:3px}
  .paper-intro h1{font-size:19px;line-height:1.35;letter-spacing:0;margin:0}
  .paper-intro .eyebrow,.paper-intro .paper-info,.paper-intro>.survey-description{display:none}
  .mobile-description{display:block;margin-top:3px}.mobile-description summary,.mobile-section-help summary{font-size:11px;line-height:1.5;color:var(--muted);cursor:pointer}
  .mobile-description p,.mobile-section-help p{font-size:12px!important;line-height:1.5!important;margin:4px 0 2px!important;white-space:pre-line;overflow-wrap:anywhere}
  #survey-form{display:grid;grid-template-columns:minmax(118px,.42fr) minmax(0,.58fr);grid-template-areas:'region demands' 'feedback demands' 'info demands' 'summary summary' 'error error' 'submit submit';gap:6px;align-items:start;padding:0 8px 8px}
  .selection-section,.survey-matrix{display:contents}
  .selection-section>.section-title,.selection-section>.question-hint{display:none}
  .matrix-region{grid-area:region;border:1px solid var(--line);border-top:3px solid var(--line);border-radius:8px;background:var(--white);padding:7px}
  .matrix-region h3{font-size:14px;line-height:1.3;margin:0 0 6px;color:var(--green)}
  .desktop-label{display:none}.mobile-label{display:inline}.mobile-limit{display:block;font-size:10px;line-height:1.4;font-weight:400;color:var(--muted);margin-top:2px}
  .matrix-region .choices.vertical{display:flex;flex-direction:column;gap:4px}
  .matrix-region .choice{width:100%;min-height:28px;padding:4px 5px;font-size:13px;line-height:1.3;gap:5px}
  #other-region-field{margin-top:5px!important}#other-region-field .field-label{font-size:11px;line-height:1.3;margin-bottom:3px}
  #other-region-field input{padding:4px 5px;font-size:16px;height:29px;min-width:0}
  .matrix-demands{grid-area:demands;min-width:0;border:1px solid var(--line);border-top:3px solid var(--line);border-radius:8px;padding:7px;background:var(--white)}
  .mobile-demands-title{display:block;font-size:14px;line-height:1.3;color:var(--green);margin:0 0 5px}
  .matrix-demands .mobile-limit{color:var(--muted)}
  .matrix-demands .matrix-group{display:block;border:0;border-top:1px solid var(--line);padding:3px 0 0;margin-top:4px}
  .matrix-demands .matrix-group h3{font-size:12px;line-height:1.35;padding:0 0 3px;border:0;background:transparent;color:var(--green)}
  .matrix-demands .matrix-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;padding:0}
  .matrix-demands .choice{position:relative;display:flex;align-items:center;justify-content:center;text-align:center;min-width:0;min-height:24px;gap:0;padding:4px 2px;font-size:12px;line-height:1.25;background:var(--white);border-color:var(--line)}
  .matrix-demands .choice span{min-width:0;overflow-wrap:anywhere}
  .matrix-region .choice input,.matrix-demands .choice input{width:13px;height:13px;min-width:13px;flex-shrink:0;margin:0}
  .matrix-demands .choice input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
  .matrix-demands .choice:focus-within{outline:2px solid var(--green);outline-offset:1px}
  .matrix-demands .choice:has(input:checked){background:var(--soft);border-color:var(--green);color:var(--green)}
  .text-section{grid-column:1;margin:0;padding:7px;border:1px solid var(--line);border-top:3px solid var(--line);border-radius:8px;background:var(--white);min-width:0}
  .text-section[data-section-id=feedback]{grid-area:feedback}.text-section[data-section-id=info]{grid-area:info}
  .text-section>.section-title{margin:0 0 5px;gap:0;align-items:flex-start}.text-section .section-index{display:none}
  .text-section .section-title h2{font-size:12px;line-height:1.35;color:var(--green);font-weight:600}
  .text-section .section-title h2>span{font-size:9px!important;white-space:normal;margin-left:3px!important}
  .text-section>.section-description{display:none}.mobile-section-help{display:block;margin:-2px 0 5px}
  .mobile-section-help summary{font-size:10px;color:var(--muted)}
  .text-section .dynamic-fields,.text-section .dynamic-fields.compact{display:flex;flex-direction:column;gap:0;margin:0}
  .text-section .form-field{margin:0 0 6px;min-width:0}.text-section .form-field:last-child{margin-bottom:0}
  .text-section .field-label{font-size:11px;line-height:1.35;margin-bottom:3px;overflow-wrap:anywhere}
  .text-section .field-label .required{font-size:9px;margin-left:3px}
  .text-section input[type=text],.text-section textarea{min-width:0;width:100%;border-color:var(--line);background:var(--white);padding:4px 5px;font-size:16px;line-height:1.3;border-radius:5px}
  .text-section input[type=text]{height:29px}.text-section textarea{min-height:44px;height:44px;resize:vertical}
  .text-section input::placeholder,.text-section textarea::placeholder{font-size:10px}
  .text-section .character-count{display:none;font-size:9px;line-height:1.3;margin:2px 0 0}.text-section .form-field:focus-within .character-count{display:block}
  .selection-summary{grid-area:summary;margin:0;padding:1px 0 0;font-size:10px;line-height:1.3;gap:4px;align-items:center;flex-wrap:wrap}.selection-summary strong{font-size:10px}
  #form-error{grid-area:error;margin:0;padding:6px;font-size:12px}
  .survey-submit{grid-area:submit;border-top:1px solid var(--line);padding:7px 0 0;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px;background:transparent}
  .survey-submit p{font-size:10px;line-height:1.4;flex:1;max-width:215px}.survey-submit .button{width:auto;flex-shrink:0;min-height:36px;padding:7px 12px;font-size:13px}.survey-submit .button svg{width:15px;height:15px}
}
@media(max-width:374px){.matrix-demands .matrix-options{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Distribute spare phone height through the form instead of leaving a blank page tail. */
@media(max-width:760px){
  #app>.fill-body{min-height:100vh;min-height:100svh;display:flex;flex-direction:column}
  #app>.fill-body>.fill-header{flex-shrink:0}
  #app>.fill-body>.fill-wrap{flex:1;display:flex;flex-direction:column;width:100%;margin:0 auto;padding-bottom:max(12px,env(safe-area-inset-bottom))}
  .fill-wrap>.fill-banner{flex-shrink:0;margin-bottom:8px}
  .fill-wrap>.paper{flex:1;display:flex;flex-direction:column}
  .paper-intro{flex-shrink:0;padding:11px 11px 8px}
  .paper-intro h1{font-size:20px}
  .paper>#survey-form{flex:1;grid-template-rows:auto minmax(min-content,1fr) auto auto auto auto;gap:6px}
  .paper>#survey-form:not(:has(.text-section[data-section-id=info])){grid-template-rows:auto minmax(min-content,1fr) 0 auto auto auto}
  .paper>#survey-form:not(:has(.text-section[data-section-id=feedback])){grid-template-rows:minmax(min-content,1fr) 0 auto auto auto auto}
  .paper>#survey-form:not(:has(.text-section)){grid-template-rows:minmax(min-content,1fr) 0 0 auto auto auto}
  .matrix-region,.matrix-demands,.text-section{align-self:stretch}
  .matrix-region{display:flex;flex-direction:column;padding:8px}
  .matrix-region .choices.vertical{flex:1;gap:5px;justify-content:space-between}
  .matrix-region .choice{flex:1;min-height:34px;font-size:14px;padding:5px 6px}
  .matrix-demands{display:flex;flex-direction:column;padding:8px}
  .matrix-demands .matrix-group{flex:1;display:flex;flex-direction:column;justify-content:center;margin-top:4px;padding-top:3px}
  .matrix-demands .matrix-group h3{font-size:13px;padding-bottom:3px}
  .matrix-demands .matrix-options{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
  .matrix-demands .choice{min-height:28px;font-size:12px;padding:4px 2px;border-radius:6px}
  .text-section{display:flex;flex-direction:column;padding:8px}
  .text-section .section-title h2{font-size:13px}
  .text-section .dynamic-fields{flex:1;gap:4px}
  .text-section .form-field:has(textarea){flex:1;display:flex;flex-direction:column}
  .text-section .field-label{font-size:12px;margin-bottom:5px}
  .text-section textarea{flex:1;height:60px;min-height:60px;padding:6px}
  .text-section input[type=text]{height:34px;padding:6px}
  .text-section input::placeholder,.text-section textarea::placeholder{font-size:11px;line-height:1.5}
  .selection-summary{padding:3px 0;font-size:11px}.selection-summary strong{font-size:11px}
  .survey-submit{padding-top:7px;gap:10px}
  .survey-submit .button{min-height:40px;font-size:14px;padding:8px 14px}
  .survey-submit p{font-size:11px}
  .paper>.success{margin-block:auto}
}
@media(max-width:760px) and (max-height:760px){
  .paper-intro{padding:10px 10px 7px}.paper-intro h1{font-size:19px}
  .paper>#survey-form{gap:6px}
  .matrix-region .choice{min-height:30px;font-size:13px;padding:4px 5px}
  .matrix-demands .matrix-group{margin-top:4px;padding-top:3px}
  .matrix-demands .matrix-group h3{font-size:12px;padding-bottom:3px}
  .matrix-demands .matrix-options{grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}
  .matrix-demands .choice{min-height:26px;font-size:12px;padding:4px 1px}
  .text-section .field-label{font-size:11px;margin-bottom:3px}
  .text-section textarea{height:48px;min-height:48px;padding:4px 5px}
  .text-section input[type=text]{height:29px}
  .survey-submit .button{min-height:36px;font-size:13px;padding:7px 12px}
}
@media(max-width:374px){.matrix-demands .matrix-options{grid-template-columns:repeat(3,minmax(0,1fr))}.matrix-demands .choice{font-size:11.5px;padding-inline:1px}}

@media(max-width:760px) and (max-height:700px){.matrix-region .choice{min-height:28px}.matrix-demands .choice{min-height:24px}.text-section textarea{height:44px;min-height:44px}}
