/* The fifth action must remain reachable on short mobile viewports. */
#screen-home .menu-actions { overflow-y: auto; min-height: 0; }
#screen-home .menu-action { flex-shrink: 0; }
body.home-screen-open #screen-home { touch-action: pan-y; }
#screen-inspection { max-width: 760px; width: 100%; margin: 0 auto; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
#screen-inspection [hidden] { display: none !important; }
#screen-inspection h1 { font-size: clamp(22px, 5vw, 30px); }
#screen-inspection h2 { font-size: 20px; margin: 12px 0; }
#screen-inspection button, #screen-inspection input, #screen-inspection textarea { font-size: 16px; }
#screen-inspection .btn { min-height: 48px; white-space: normal; }
#screen-inspection .btn-icon { min-height: 44px; white-space: nowrap; }
.ins-controls { border: 0; padding: 0; margin: 0; min-width: 0; }
.ins-controls > div, .ins-controls > form { margin-bottom: 18px; }
.ins-kinds, .ins-search-row, .ins-buttons { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.ins-kinds > button, .ins-buttons > button { flex: 1 1 140px; }
.ins-kinds small { display: block; font-size: 13px; }
.ins-kinds .btn[aria-pressed="false"],
.ins-kinds .btn[aria-pressed="false"]:hover,
.ins-kinds .btn[aria-pressed="false"]:focus {
    color: var(--primary);
    background: transparent;
    border: 1.5px solid var(--primary);
    box-shadow: none;
}
.ins-kinds .btn[aria-pressed="true"] {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(59,125,248,.35), 0 1px 2px rgba(59,125,248,.2);
}
.ins-search-row input { flex: 1 1 180px; min-width: 0; }
.ins-new-search { width: 100%; background: #fff; }
.ins-new-search svg { flex: 0 0 auto; width: 22px; height: 22px; }
.ins-unit { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--product-br); background: var(--product-bg); padding: 16px; border-radius: 14px; overflow-wrap: anywhere; }
.ins-status { font-weight: 600; }
.ins-status-suitable { color: #166534; }
.ins-status-unsuitable { color: #b91c1c; }
.ins-status-absent { color: var(--text-2); }
.ins-help { color: var(--text-2); font-size: 14px; line-height: 1.5; margin: 12px 0; }
#ins-message { min-height: 22px; line-height: 1.45; margin: 12px 0; overflow-wrap: anywhere; }
.ins-error { color: #b91c1c; }
.ins-photo-action { position: relative; display: flex; justify-content: flex-end; width: 100%; margin: 14px 0 10px; }
.ins-photo-action .ins-photo-picker { display: flex; align-items: center; justify-content: center; gap: 10px; width: min(100%, 380px); min-height: 72px; padding: 14px 82px 14px 18px; }
.ins-photo-picker svg { flex: 0 0 auto; width: 25px; height: 25px; }
.ins-camera-counter { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); min-width: 54px; padding: 6px 9px; border-radius: 999px; background: rgba(17, 24, 39, .78); color: #fff; font-size: 14px; font-weight: 700; line-height: 1; text-align: center; pointer-events: none; }
.ins-camera-counter.complete { background: #166534; }
.ins-finish-photos { width: 100%; margin: 12px 0; }
.ins-upload-progress { margin: 12px 0; padding: 12px; border: 1px solid #93c5fd; border-radius: 12px; background: #eff6ff; color: #1e3a8a; }
.ins-upload-progress.complete { border-color: #86efac; background: #f0fdf4; color: #166534; }
.ins-upload-progress.failed { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }
.ins-upload-progress-head { display: flex; align-items: center; gap: 9px; min-height: 22px; font-size: 14px; }
.ins-upload-spinner { flex: 0 0 auto; width: 17px; height: 17px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ins-upload-spin .8s linear infinite; }
.ins-upload-progress-track { height: 8px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: rgba(30, 64, 175, .16); }
.ins-upload-progress-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: currentColor; transition: width .2s ease; }
@keyframes ins-upload-spin { to { transform: rotate(360deg); } }
.ins-photo-source { position: fixed; z-index: 2200; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 18px max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.ins-photo-source-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(15, 23, 42, .52); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ins-photo-source-sheet { position: relative; width: min(100%, 480px); padding: 20px; border-radius: 22px; background: var(--card, #fff); box-shadow: 0 24px 60px rgba(15, 23, 42, .32); }
#screen-inspection .ins-photo-source-sheet h2 { margin: 0 0 16px; text-align: center; }
.ins-photo-series-status { margin: 0 0 14px; color: var(--text-2); line-height: 1.45; text-align: center; }
.ins-photo-source-sheet .btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 10px; }
.ins-photo-source-sheet svg { width: 24px; height: 24px; flex: 0 0 auto; }
body.ins-photo-source-open { overflow: hidden; }
body.ins-photo-source-open #screen-inspection { opacity: 1 !important; transform: none !important; animation: none !important; will-change: auto; overflow: visible; }
#ins-form fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
#ins-form legend, .ins-field { font-size: 16px; font-weight: 600; line-height: 1.5; }
.ins-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.ins-choices.ins-single-choice { grid-template-columns: 1fr; }
.ins-choices label { position: relative; cursor: pointer; }
.ins-choices input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ins-choices span { display: flex; align-items: center; justify-content: center; min-height: 52px; height: 100%; padding: 10px 8px; text-align: center; font-size: 15px; overflow-wrap: normal; word-break: normal; hyphens: none; border: 1px solid var(--product-br); border-radius: 10px; }
.ins-choices input:checked + span { color: #fff; background: #166534; border-color: #166534; }
.ins-choices input:focus-visible + span { outline: 3px solid #2563eb; outline-offset: 2px; }
.ins-field { display: flex; flex-direction: column; gap: 8px; margin: 18px 0; }
.ins-field textarea { width: 100%; resize: vertical; padding: 12px; border-radius: 10px; border: 1px solid var(--product-br); background: var(--card); color: var(--text); }
.ins-functionality-notes { margin-bottom: 0; }
.ins-field.disabled { color: var(--text-2); }
.ins-field textarea:disabled { opacity: .65; background: var(--bg); }
#ins-form fieldset.disabled { opacity: .55; }
#ins-form fieldset.disabled .ins-choices label { cursor: default; }
.ins-cancel { width: 100%; margin-top: 8px; }
#ins-result { white-space: pre-wrap; font: inherit; overflow-wrap: anywhere; margin: 16px 0; }
@media (max-width: 360px) { .ins-choices { grid-template-columns: 1fr; } .ins-search-row button { width: 100%; } }
