/* UI-BASIC (2026-11-26) - monitor. Plan: 10_active/ui_basic/docs/plan_ui_basic.md
   Loaded right after css/style.css. Rollback: empty this file.
   monitor and monitor234 share this file byte for byte EXCEPT the TOKENS block below. */

/* ===== TOKENS: monitor234 (teal) ===== */
:root {
    --canvas: #f5f5f7; --surface: #ffffff; --surface-subtle: #f0f0f3;
    --text: #1d1d1f; --text-secondary: #5f5f66;
    --border: #8a8a93; --border-subtle: #d9d9de;
    --brand: #00796b; --on-brand: #ffffff; --brand-hover: #00695c;
    --danger: #b42318; --on-danger: #ffffff; --danger-hover: #912018;
    --focus: #00796b;
    --field: var(--surface);   /* form field fill */
    --field-readonly: var(--surface-subtle);   /* readonly field fill (24b) */
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --canvas: #121214; --surface: #1d1d20; --surface-subtle: #2a2a2e;
        --text: #f5f5f7; --text-secondary: #a1a1a6;
        --border: #7c7c85; --border-subtle: #38383d;
        --brand: #4db6ac; --on-brand: #101820; --brand-hover: #80cbc4;
        --danger: #ff8a80; --on-danger: #101820; --danger-hover: #ffb4ab;
        --focus: #4db6ac;
        --field: var(--surface-subtle);   /* dark: field one step above the --surface card */
        --field-readonly: var(--canvas);   /* dark: readonly one step below the card, so it differs from both --field and --surface */
    }
}
html[data-theme="dark"], body.dark-mode {
    --canvas: #121214; --surface: #1d1d20; --surface-subtle: #2a2a2e;
    --text: #f5f5f7; --text-secondary: #a1a1a6;
    --border: #7c7c85; --border-subtle: #38383d;
    --brand: #4db6ac; --on-brand: #101820; --brand-hover: #80cbc4;
    --danger: #ff8a80; --on-danger: #101820; --danger-hover: #ffb4ab;
    --focus: #4db6ac;
    --field: var(--surface-subtle);
    --field-readonly: var(--canvas);
}
/* ===== END TOKENS ===== */

/* Legacy variables (style.css) -> new tokens, LIGHT mode only: style.css's dark selectors are more specific and
   keep their own values (dark --primary-color #1a73e8 carries hard-coded white text in many rules). */
:root {
    --primary-color: var(--brand);
    --link-color: var(--brand);
    --border-color: var(--border-subtle);   /* table lines, chips, sidebar; fields get --border below */
    --secondary-color: var(--text-secondary);   /* grey text (#6c757d was 4.3:1 on --canvas); bg uses are hovers under white text */
}

@media screen {

/* ---- Page and boxes ---- */
body { background-color: var(--canvas); }
.login-container, .signin-container, .popup-card, .popup-content-input, .aa-card {
    background-color: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08);
}

/* ---- Thai text: no stretched letter-spacing (style.css sets .1rem on body, button, inputs, selects) ---- */
body, button, input, select, textarea, table th, .custom-select, .dob-select, .search-input,
.input-container textarea, .input-container input, .checkbox-custom-label { letter-spacing: normal; }
p, li { line-height: 1.6; }
td { font-variant-numeric: tabular-nums; }

/* ---- Secondary = default for every button (exempt list keeps its own look) ---- */
:is(button, .btn, .segment-btn, .btn-cancel, .btn-secondary, .view-file-button, input[type="button"], input[type="submit"]):not(:where(#theme-toggle, .circle, .theme-menu-item, .nav-buttons, .segment, .aa-tab, #hamburger, #sidebarToggle,
            .mfa-link, .close-btn, #close-descript, .prev, .next, .leaflet-control-zoom-in, .leaflet-control-zoom-out,
            [style*="background"])) {
    background-color: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
}
:is(button, .btn, .segment-btn, .btn-cancel, .btn-secondary, .view-file-button, input[type="button"], input[type="submit"]):not(:where(#theme-toggle, .circle, .theme-menu-item, .nav-buttons, .segment, .aa-tab, #hamburger, #sidebarToggle,
            .mfa-link, .close-btn, #close-descript, .prev, .next, .leaflet-control-zoom-in, .leaflet-control-zoom-out,
            [style*="background"])):hover {
    background-color: var(--surface-subtle);
    text-decoration: none;
}
/* Button text >= 14px (.btn and .segment-btn were .8rem = 12.8px); .segment-btn.large keeps 1.2rem */
.btn, .segment-btn:not(.large) { font-size: 14px; }
/* Buttons styled inside page fragments (listarable / listadminarea <style>, loaded after this file): !important */
.ty-unlock-btn, .tyd-btn, .aa-btn {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    font-size: 14px !important;   /* fragment sets 13.6px */
}
.ty-unlock-btn:hover, .tyd-btn:hover, .aa-btn:hover { background: var(--surface-subtle) !important; filter: none; }

/* ---- Primary: confirmed list only (stage 0 button table). !important because fragments style
   #ty-apply (.ty-bar #ty-apply.ty-apply-btn) and #aaSheet .btn-save with their own colours. ---- */
:is(.login-button, #nextandsave, .segment-btn[onclick^="handleSubmit"], .ty-apply-btn, .search-button, .btn-save,
    .btn-primary, #mfaAnnounceOk, #mfaNext, #btnSend, #btnSave, #apply-btn, #maintAnnounceOk) {
    /* .segment-btn[onclick^="handleSubmit"]: depends on the onclick name in list*Edt / myAccount pages */
    background: var(--brand) !important;
    color: var(--on-brand) !important;
    border: 1px solid var(--brand) !important;
}
.ty-apply-btn { font-size: 14px !important; }   /* listarable fragment sets 13.6px */
:is(.login-button, #nextandsave, .segment-btn[onclick^="handleSubmit"], .ty-apply-btn, .search-button, .btn-save,
    .btn-primary, #mfaAnnounceOk, #mfaNext, #btnSend, #btnSave, #apply-btn, #maintAnnounceOk):hover:not(:disabled) {
    background: var(--brand-hover) !important;
    border-color: var(--brand-hover) !important;
    filter: none;
}
button.search-button { border-radius: 0 10px 10px 0; }   /* keep the joined search-field shape */

/* ---- Danger: cancel-record (.segment-btn.red) and remove image (.remove-btn; style.css .sortable-images rule wins otherwise) ---- */
:is(.segment-btn.red, .remove-btn) {
    background: var(--danger) !important;
    color: var(--on-danger) !important;
    border: 1px solid var(--danger) !important;
}
:is(.segment-btn.red, .remove-btn):hover { background: var(--danger-hover) !important; }

/* ---- Disabled ---- */
:is(button, .btn, input, select, textarea):is(:disabled, [aria-disabled="true"]) { opacity: .55; cursor: not-allowed; }

/* ---- Fields: visible border (was 2px #f8f9fa = invisible on white) ---- */
:is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="file"]),
    select, textarea, .custom-select, .custom-single-select, .custom-multi-select, .dob-select, .custom-select-search) {
    border-color: var(--border);
}
:is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="file"]),
    select, textarea):focus { border-color: var(--brand); }
input:not([type="checkbox"]):not([type="radio"]):not(.aa-search input) { color: var(--text); }   /* style.css: bare input text = --border-color; adminarea search keeps its own colours */
/* Search field joined to .search-button: was borderless + transparent, which vanishes on the --canvas page */
.search-input { background-color: var(--surface); border: 1px solid var(--border); border-right: 0; border-radius: 10px 0 0 10px; }
/* adminarea search (listadminarea <style>, border:0 filled pill): add a visible edge */
.aa-search input { border: 1px solid var(--border) !important; }
/* Inline "color: var(--border-color)" text links (index Forgot password, mfa back-to-login) and .mfa-link: were ~1.4:1 */
a[style*="var(--border-color)"], .mfa-link { color: var(--text-secondary) !important; }   /* inline style otherwise wins */
::placeholder, .input-container input::placeholder, .input-container textarea::placeholder { color: var(--text-secondary); opacity: 1; }

/* ---- Keyboard focus: style.css has several outline:none; !important so a ring always shows ---- */
:focus-visible { outline: 3px solid var(--focus) !important; outline-offset: 2px; }
.checkbox-container-checkmark input:focus-visible + .checkmark { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---- Links: no underline at rest (user, 2026-11-27); style.css a:hover underlines, add the same for keyboard focus ---- */
:is(#content, .login-container, .signin-container) a:not([class*="btn"]):not(.mfa-link):not(.pagination a):focus-visible {
    text-decoration: underline;
}

/* ===== Forms (A2, 2026-11-27): page recedes, fields stand out. Values: RECOMMENDATIONS_UIB_monitor_20261127.md §2-3 ===== */
/* Tab content of in-app forms (arableEdt, accountEdt, myAccount ...) is a card; #content excludes signUp (already a card) */
#content .page-container > .page.active-page {
    background-color: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08);
    margin-top: 8px;
}
.underline { border-bottom-color: var(--border-subtle); }   /* section divider was #f8f9fa */

/* Field fill: style.css uses --background-color, #121212 in dark = same as the page */
.input-container input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.input-container textarea, .custom-single-select, .custom-multi-select, .dob-select {
    background-color: var(--field);
    color: var(--text);
}
/* 24b: same :not() chain as the field-fill rule above, otherwise that rule (0,5,1) beats input[readonly] (0,2,1) */
.input-container input[readonly]:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.input-container textarea[readonly] {
    background-color: var(--field-readonly);
    border-color: var(--border-subtle);
    color: var(--text-secondary);
    cursor: default;
}
/* Open dropdown list */
.select-options {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08);
}

/* A9: field labels 14px / 500 / --text (was .8rem, 400). Plain list on purpose: equal specificity with
   style.css's .disabled rules is resolved by the disabled block below */
.input-container label:not(.custom-label),
.custom-select-container label.title,
.custom-multi-select-container label.title,
.date-picker-container label.title,
.popup-row label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}
/* Radio/checkbox option text: no stretched spacing for Thai (style.css 1px) */
.custom-radio + .custom-label, .custom-checkbox + .custom-label { letter-spacing: normal; line-height: 1.5; }

/* Disabled fields: style.css colours them --navbar-background-color = invisible text */
.input-container.disabled label, .input-container.disabled input, .input-container.disabled textarea,
.input-container.disabled input::placeholder, .input-container.disabled textarea::placeholder,
.custom-select-container.disabled, .custom-select-container.disabled label.title, .custom-select-container.disabled .select-placeholder,
.custom-multi-select-container.disabled, .custom-multi-select-container.disabled label.title, .custom-multi-select-container.disabled .select-placeholder,
input[type="radio"].custom-radio:disabled + .custom-label,
input[type="checkbox"].custom-checkbox:disabled + .custom-label {
    color: var(--text-secondary);
    opacity: .65;
}

/* Radio / checkbox boxes: edge >= 3:1 (was --navbar-background-color, ~1.05:1) */
.custom-radio + .custom-label:before,
.custom-checkbox + .custom-label:before {
    background-color: var(--field);
    border: 2px solid var(--border);
}
input[type="radio"].custom-radio:checked + .custom-label:before,
input[type="checkbox"].custom-checkbox:checked + .custom-label:before {
    background-color: var(--brand);
    border-color: var(--brand);
}
input[type="checkbox"].custom-checkbox:checked + .custom-label:after { border-color: var(--on-brand); }   /* checkbox tick shape unchanged */
/* A7: selected radio = filled circle + tick. Drawn as a glyph in :before because ::after of the first
   radio label carries the red/green required dot (.label-required / .label-filled, script.js) */
input[type="radio"].custom-radio:checked + .custom-label:before {
    content: "\2713";
    color: var(--on-brand);
    font-size: 13px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}
input[type="radio"].custom-radio:disabled + .custom-label:before,
input[type="checkbox"].custom-checkbox:disabled + .custom-label:before {
    background-color: var(--surface-subtle);
    border-color: var(--border-subtle);
}
/* Checkbox in the plot list table */
.checkbox-container-checkmark .checkmark { background-color: var(--field); border: 2px solid var(--border); }
.checkbox-container-checkmark input:checked + .checkmark { background-color: var(--brand); border-color: var(--brand); }
.checkbox-container-checkmark input:checked + .checkmark:after { border-color: var(--on-brand); }
/* Chip checkbox (accountEdt_levels) */
.custom-checkbox-container { background-color: var(--field); border-color: var(--border); }

/* 29: signature box. .sigpad-frame (around the canvas) draws the border and paper; the buttons sit below it.
   Paper = --field; on-screen ink = --sig-ink, read by js/script.js and redrawn on theme change. The PNG that is
   sent does not use these: script.js draws it off screen at 380x200, transparent, ink #1a73e8. */
.signaturePadContainer {   /* style.css framed this box; now only a column of frame + buttons */
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    background: none;
}
.sigpad-frame {
    --sig-ink: #1a73e8;   /* light: same blue as the PNG, 4.6:1 on --field */
    position: relative;
    aspect-ratio: 380 / 200;   /* PNG size, so pen units scale the same on both axes */
    border: 2px solid var(--border);
    border-radius: 16px;
    background-color: var(--field);
    overflow: hidden;
}
html[data-theme="dark"] .sigpad-frame, body.dark-mode .sigpad-frame { --sig-ink: #8ab4f8; }   /* dark: lighter blue on the dark field */
.signaturePadContainer .sigpad-frame canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0;
    cursor: crosshair;
    touch-action: none;   /* touch draws instead of scrolling */
}
.sigpad-guide {   /* signing line at 72% of the height */
    position: absolute;
    left: 8%; right: 8%; top: 72%;
    border-top: 1.5px dashed var(--border);
    pointer-events: none;
}
.sigpad-hint {
    position: absolute;
    left: 0; right: 0; top: calc(72% - 1.9em);
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    pointer-events: none;
    user-select: none;
}
.sigpad-frame.has-ink .sigpad-hint { display: none; }
.signaturePadContainer .button-group {   /* style.css put it absolute over the bottom of the drawing area */
    position: static;
    transform: none;
    justify-content: center;
    gap: 10px;
    margin: 10px auto 0;
}
.signaturePadContainer .button-group .segment-btn { margin: 0; }
/* Saved signature PNGs (transparent, blue ink): light backing in dark mode so the ink stays readable */
html[data-theme="dark"] :is(#inspector_sign, #headman_sign, #officer_sign, #approve_sign)[src]:not([src=""]),
body.dark-mode :is(#inspector_sign, #headman_sign, #officer_sign, #approve_sign)[src]:not([src=""]) {
    background-color: #f5f5f7;   /* intentional fixed colour: paper behind the fixed-colour ink */
    border-radius: 8px;
    padding: 4px;
}
.file-upload-container {
    background-color: var(--surface-subtle);
    border-color: var(--border);   /* stays 2px dashed */
    border-radius: 16px;
}
.file-upload-container:hover, .file-upload-container.dragover { border-color: var(--brand); }
.file-upload-label { color: var(--text-secondary); font-size: 14px; }

/* Signature mode switch: inline style="color:#666" on .switch-option, unreadable in dark */
.segmented-switch { background-color: var(--surface-subtle); border: 1px solid var(--border-subtle); }
.switch-option { color: var(--text-secondary) !important; }   /* !important: overrides the inline colour */

.section-title::after { background-color: var(--brand); }   /* .section-title.red keeps its red (more specific) */

/* A8: form tabs, colours only (shape/size unchanged, still exempt from the button rules) */
.segmented-control .segment.active { background-color: var(--brand); color: var(--on-brand); }   /* was #0080FF, 3.79:1 */
.segmented-control .segment:where(:not(.active, .disabled)) { color: var(--text-secondary); }   /* was #666 (fails on dark #1f1f1f) */

/* A6: tick "ไม่สามารถติดต่อได้" hides items 1-5 (wrapper .survey-detail in arableEdt_survey.php) */
#page2:has(#chbresult:checked) .survey-detail { display: none; }

/* ===== Items 15-17 (2026-11-27, ui-01) ===== */
/* 15: sidebar = drawer over the content on every screen size, closed on every page load (js/script.js toggles
   .active on #sidebar and #overlay). Replaces style.css's push layout (.hidden / .shifted are no longer used). */
.sidebar {
    transform: translateX(-100%);
    visibility: hidden;   /* closed drawer: links not reachable with Tab */
    transition: transform .3s ease-in-out, visibility 0s linear .3s;
}
.sidebar.active {   /* style.css desktop .sidebar.active is translateX(250px) */
    transform: translateX(0);
    visibility: visible;
    transition: transform .3s ease-in-out, visibility 0s;
    box-shadow: 0 8px 24px rgba(0,0,0,.24);
}
#navbar { left: 0; }      /* was 250px beside the fixed sidebar */
#content { margin-left: 0; }

/* 16: search field may shrink, so .search-button stays inside .search-container (overflow:hidden); it was
   cut off at 769-1250px wide before UI-BASIC too */
.search-input { min-width: 0; }
.search-button { flex-shrink: 0; }
/* 16: detail panel buttons (#buttonDtl, filled by describe_arableDtl.js) overran .button-group's width and
   overflow:hidden cut off the last (red cancel) button */
#buttonDtl.button-group { flex-wrap: wrap; justify-content: center; gap: 8px; overflow: visible; max-width: 100%; }
#buttonDtl.button-group > * { margin: 0; flex: 0 0 auto; padding-left: 12px; padding-right: 12px; }   /* 20px side padding: 302px > 280px panel row */

/* 17: unlock-all buttons now sit in the #button row next to รับรองผล (listarable.php) */
#button.button-group:has(.ty-unlock-bar) { max-width: none; overflow: visible; }   /* 450px + hidden would cut them off */
#button .ty-unlock-bar { margin: 0 0 0 10px; }   /* fragment margin was for its own row below */

/* 20: phone bottom sheet (75% high) cut off the history pager; scroll inside the panel, not the page behind */
@media (max-width: 768px) {
    #descript.show { overflow-y: auto; overscroll-behavior: contain; }
}

/* ===== Items 24a, 24d, 24e (2026-11-27, ui-01) ===== */
/* 24a: target-year select. The listarable.php <style> (loaded after this file) sets the border to --navbar-background-color
   (invisible in light) and the fill to --background-color (= page in dark): !important as for .ty-unlock-btn.
   background-color only: the fragment draws the chevron with background-image. */
.ty-bar select.ty-select { background-color: var(--field) !important; border: 1.5px solid var(--border) !important; }
.ty-bar select.ty-select:hover, .ty-bar select.ty-select:focus { border-color: var(--brand) !important; }   /* fragment: #007bff */

/* 24d: table#table has no overflow:hidden (TABLES section), so the corner cells carry the card's 12px corners
   (11px = inside the 1px border); their backgrounds (th --surface, row hover) would otherwise square the corners */
table#table tr:first-child > th:first-child { border-top-left-radius: 11px; }
table#table tr:first-child > th:last-child { border-top-right-radius: 11px; }
table#table tbody tr:last-child > td:first-child { border-bottom-left-radius: 11px; }
table#table tbody tr:last-child > td:last-child { border-bottom-right-radius: 11px; }

/* 24e: style.css hides custom radios/checkboxes with display:none, so Tab never reached them. Visually hidden instead:
   absolute + 1px = no layout change; the label's :before box stays the visible control and gets the focus ring */
input[type="radio"].custom-radio, input[type="checkbox"].custom-checkbox {
    display: inline-block;
    position: absolute;
    width: 1px; height: 1px;
    margin: 0; padding: 0;
    opacity: 0;
    overflow: hidden;
    clip-path: inset(50%);
    pointer-events: none;   /* clicks go to the label, as before */
}
input.custom-radio:focus-visible + .custom-label:before,
input.custom-checkbox:focus-visible + .custom-label:before { outline: 3px solid var(--focus); outline-offset: 2px; }
/* ===== end items 15-17, 20, 24 ===== */

/* ===== TABLES (plan §2 ข้อ 18) ===== */
/* table#table on arable, arableResult (รายงานการจัดระเบียบฯ), landx, report, account takes the adminarea .aa-table/.aa-card look.
   Rows are built in JS and there is no wrapper element, so the table itself is the card: border-collapse separate
   so border-radius applies. Base rules: style.css "Base table styling" (18px th, uppercase, hover --navbar-background-color). */
table#table {
    background-color: var(--surface);
    border: 1px solid var(--border-subtle);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;   /* no overflow:hidden (24d): it cut off the landx area tooltip above row 1; corner cells are rounded instead */
    box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08);
}
table#table th {
    padding: 10px 16px;
    font-size: 13px;   /* adminarea 12px; 13px keeps Thai headers readable */
    font-weight: 600;
    text-transform: none;
    color: var(--text-secondary);
    background-color: var(--surface);
    vertical-align: bottom;
}
table#table td {
    padding: 10px 16px;
    vertical-align: middle;
    border-top: 1px solid var(--border-subtle);   /* line above each row, not under th: account's JS header has fewer cells than its rows */
    border-radius: 0;   /* style.css rounds the end cells of every tr.radius: lines and hover would curve */
}
table#table tbody tr:hover { background-color: var(--surface-subtle); }   /* --navbar-background-color = card colour, hover vanished */
/* Cancelled plot row (describe_listarable.js inline "color: #e53935" on the tr): token red, which keeps >= 4.5:1 on --surface in both modes */
table#table tbody tr[style*="line-through"] td { color: var(--danger); }

/* ===== Items 22-23 (ui-02) ===== */
/* 22: detail panel (arableDtl.php). An empty #idperson still left its <br /> = a blank line above "บัญชีลำดับที่",
   which pushed the result-history pagination out of the panel. The line stays when idperson has a value. */
#idperson:empty + br { display: none; }

/* 23: upload boxes, uxui skill "File upload" row: arableEdt_img.php (#imageContainer / #uploadLabel)
   and arableEdt_survey.php (#arableFileContainer). Scoped by id because .file-upload-container
   is also used by the signature upload boxes. Hints in the markup match the code: images accept="image/jpeg",
   25 MB total (script.js MAX_UPLOAD_SIZE_MB + arableEdt_img-Saving.php); PDF 25 MB (setSingleFileInput + Saving).
   NOTE: no JS adds .dragover to these two boxes (script.js does it only for the signature *_uploadContainer),
   so the .dragover rule below only takes effect if JS adds the class later. */
.visually-hidden {   /* replaces the hidden attribute on #fileupload: invisible but still reachable with Tab */
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%);
    white-space: nowrap;
}
#imageContainer { position: relative; }
#uploadLabel, #arableFileContainer {
    box-sizing: border-box;
    border: 2px dashed var(--border);
    border-radius: 16px;
    background-color: var(--surface-subtle);
    color: var(--text);
    transition: border-color .2s, background-color .2s;
}
#uploadLabel {   /* was a blue pill button (style.css .image-file-upload-label) */
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    width: 100%; max-width: 380px; min-height: 140px;
    padding: 16px;
    text-align: center;
    position: relative;
    box-shadow: none;
    cursor: pointer;
}
#uploadLabel::before { position: absolute; top: 12px; left: 12px; margin: 0; }   /* JS status dot (.label-filled green / .label-required red, style.css): corner, not above the icon */
#arableFileContainer { aspect-ratio: auto; min-height: 170px; padding: 16px; }
#arableFileContainer .file-upload-content {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    pointer-events: none;   /* content sits above the transparent input (z-index 2): let clicks reach the input */
}
#arableFileContainer .view-file-button { pointer-events: auto; margin-top: 6px; }
#uploadLabel .file-upload-title, #arableFileContainer .file-upload-title {
    display: block;
    font-size: 16px; font-weight: 600;
    color: var(--brand);
}
#uploadLabel .file-upload-title::before, #arableFileContainer .file-upload-title::before {   /* upload icon, follows the text colour */
    content: "";
    display: block;
    width: 32px; height: 32px;
    margin: 0 auto 6px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E") center / contain no-repeat;
}
#uploadLabel .file-upload-hint, #arableFileContainer .file-upload-hint { display: block; font-size: 13px; color: var(--text-secondary); }
#arableFileContainer .file-name { margin-top: 6px; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
#uploadLabel:hover, #arableFileContainer:hover, #arableFileContainer.dragover {
    border-color: var(--brand);
    background-color: var(--surface);
    box-shadow: none;
}
#fileupload:focus-visible + #uploadLabel,
#arableFileContainer:has(#arablefile:focus-visible) {   /* the focused input itself is invisible: ring the box */
    border-color: var(--brand);
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* 24f: arableEdt_survey.php line 4 has an inline letter-spacing:.2rem on this label (the PHP is not edited),
   so !important is the only way to override it. */
label[for="chbresult"] { letter-spacing: normal !important; }

/* 24j: date selects (.dob-select-container) were 3 equal thirds, so a long month ("กุมภาพันธ์", "พฤศจิกายน") was cut off.
   Unequal widths by id suffix, because the order differs: survey is year-month-day, person/cancel are day-month-year.
   flex-basis 0 + min-width 0 keeps the 3 boxes inside the col at 390px. */
.dob-select-container > .dob-select { flex: 1 1 0; width: auto; min-width: 0; }
.dob-select-container > .dob-select[id$="_month"] { flex-grow: 1.6; }
.dob-select-container > .dob-select[id$="_day"] { flex-grow: .8; }

/* 28: theme button hover, same recipe as Land /index (.news-theme-btn) and Land #theme-toggle. Colours from TOKENS only.
   The transform moves only the button: a fixed .circle (login pages) stays fixed. Reduced motion: see the rule at the end of the file. */
#theme-toggle.circle { transition: transform .25s ease, background-color .25s ease, color .25s ease; }
#theme-toggle.circle:is(:hover, :focus-visible) {
    transform: rotate(12deg) scale(1.05);
    background-color: color-mix(in srgb, var(--brand) 16%, var(--surface));
    color: var(--brand);
}

} /* end @media screen */

/* A6 wrapper sits inside a flex .row: display:contents keeps the original column layout in every medium
   (outside @media screen on purpose: it only restores the pre-wrapper layout) */
.survey-detail { display: contents; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ===== Survey visibility + multi-picker (2026-11-30, ui-01, SPEC_SURVEY_VISIBILITY_monitor_20261127.md files 1-3) ===== */
/* Survey conditional visibility (wrap_* ids in arableEdt_survey.php, toggled by describe_arable_edit*x.js) */
.survey-field-hidden { display: none !important; }
.survey-option-note {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--text-secondary);
    padding: 0.35rem 0.25rem;
}
/* #selectlandused / #selectspecies: col-12 and no 400px cap; the old box and list stay in the DOM (hidden) as the value store */
.custom-multi-select-container.mp-on { max-width: none; }
.mp-on > .custom-multi-select, .mp-on > .select-options { display: none !important; }
.mp { position: relative; }
.mp-box {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    min-height: 46px; padding: 6px 10px;
    background-color: var(--field); color: var(--text);
    border: 1.5px solid var(--border); border-radius: 10px;
    cursor: text;
}
.mp-box:focus-within { border-color: var(--brand); }
.mp-tags { display: contents; list-style: none; margin: 0; padding: 0; }
.mp-dtags { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-tag {
    display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
    padding: 2px 4px 2px 10px; border-radius: 999px;
    background-color: color-mix(in srgb, var(--brand) 14%, var(--surface));
    color: var(--text); font-size: 14px; line-height: 1.6;
}
.mp-tag-text { overflow-wrap: anywhere; }
.mp-tag-legacy { background-color: var(--surface-subtle); border: 1px dashed var(--border); }
.mp-tag-note { color: var(--text-secondary); font-size: 12px; }
.mp-tag-x {
    min-width: 28px; min-height: 28px; padding: 0; border: 0; border-radius: 50%;
    background: transparent !important; color: var(--text-secondary) !important;
    font-size: 18px; line-height: 1; cursor: pointer;
}
.mp-tag-x:hover:not(:disabled) { background-color: color-mix(in srgb, var(--text) 12%, transparent) !important; color: var(--text) !important; }
.mp-input {
    flex: 1 1 180px; min-width: 120px; padding: 6px 2px !important;
    border: 0 !important; outline: 0; background: transparent !important; color: var(--text);
    font-size: 16px; letter-spacing: normal;
}
.mp-input:focus-visible { outline: 0 !important; }   /* .mp-box:focus-within draws the ring */
.mp-box:has(.mp-input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.mp-suggest {
    position: absolute; left: 0; right: 0; z-index: 1000; margin: 4px 0 0; padding: 4px; list-style: none;
    max-height: 300px; overflow-y: auto;
    background-color: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.mp-option { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.mp-option.is-active, .mp-option:hover { background-color: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.mp-option-sub { color: var(--text-secondary); font-size: 13px; }
.mp-option-sci { color: var(--text-secondary); font-size: 13px; font-style: italic; }
/* r3: long names (e.g. other names of 150+ characters, words without spaces) wrap inside the row / card, never cut */
.mp-option > span, .mp-pill > span { max-width: 100%; overflow-wrap: anywhere; }
.mp-none { color: var(--text-secondary); cursor: default; padding: 8px 10px; margin: 0; }
.mp-actions, .mp-recent, .mp-recent-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mp-actions { margin-top: 6px; }
.mp-recent { margin-top: 6px; }
.mp-recent-title { color: var(--text-secondary); font-size: 14px; }
.mp-actions button, .mp-recent-btn { min-height: 36px; padding: 4px 12px; border-radius: 999px; font-size: 14px; cursor: pointer; }
.mp-actions button[hidden], .mp-recent[hidden], .mp-suggest[hidden] { display: none !important; }
/* buttons / inputs do not inherit the page font by default */
.mp button, .mp input, .mp-dialog button, .mp-dialog input { font-family: inherit; }
.mp-disabled .mp-box { background-color: var(--field-readonly); border-color: var(--border-subtle); cursor: not-allowed; }
.mp-disabled { opacity: .65; }

/* Wide picker window (appended to <body>) */
body.mp-modal-open { overflow: hidden; }
.mp-backdrop {
    position: fixed; inset: 0; z-index: 100002;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    background-color: rgba(0,0,0,.5);
}
.mp-dialog {
    display: flex; flex-direction: column; width: min(960px, 100%); max-height: min(720px, calc(100vh - 32px));
    background-color: var(--surface); color: var(--text);
    border: 1px solid var(--border-subtle); border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.24); overflow: hidden;
    font-family: 'Prompt', sans-serif; letter-spacing: normal;
}
.mp-dhead, .mp-dfoot { flex: none; padding: 12px 16px; background-color: var(--surface); }
.mp-dhead { border-bottom: 1px solid var(--border-subtle); }
.mp-dfoot { border-top: 1px solid var(--border-subtle); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mp-dfoot .mp-dtags { flex: 1 1 240px; max-height: 96px; overflow-y: auto; margin: 0; padding: 0; }
.mp-dtitle-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mp-dtitle { margin: 0; font-size: 1.15rem; font-weight: 600; color: var(--text); }
.mp-dclose { min-width: 40px; min-height: 40px; padding: 0; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.mp-dtools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.mp-dsearch {
    flex: 1 1 220px; min-height: 40px; padding: 6px 12px;
    background-color: var(--field); color: var(--text);
    border: 1.5px solid var(--border); border-radius: 10px; font-size: 16px; letter-spacing: normal;
}
.mp-dsearch:focus { border-color: var(--brand); }
.mp-dcount { color: var(--text-secondary); font-size: 14px; }
.mp-dclear, .mp-dok { min-height: 40px; padding: 6px 14px; border-radius: 999px; font-size: 14px; cursor: pointer; }
.mp-dclear[hidden] { display: none !important; }
.mp-dok { background-color: var(--brand) !important; color: var(--on-brand) !important; border-color: var(--brand) !important; margin-left: auto; }
.mp-dok:hover { background-color: var(--brand-hover) !important; border-color: var(--brand-hover) !important; }
.mp-dbody { flex: 1 1 auto; min-height: 0; display: flex; background-color: var(--canvas); }
.mp-cats {
    flex: 0 0 240px; display: flex; flex-direction: column; gap: 4px; padding: 10px;
    overflow-y: auto; border-right: 1px solid var(--border-subtle); background-color: var(--surface);
}
.mp-cat {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
    min-height: 40px; padding: 6px 10px; border-radius: 10px; text-align: left; font-size: 14px; cursor: pointer;
    background-color: transparent !important; color: var(--text) !important; border: 1px solid transparent !important;
}
.mp-cat.is-on { background-color: color-mix(in srgb, var(--brand) 14%, var(--surface)) !important; border-color: var(--brand) !important; }
.mp-badge {
    min-width: 22px; padding: 0 6px; border-radius: 999px; text-align: center; font-size: 12px; line-height: 22px;
    background-color: var(--brand); color: var(--on-brand);
}
.mp-pane { flex: 1 1 auto; min-width: 0; padding: 12px 16px; overflow-y: auto; }
.mp-cathead { margin: 12px 0 4px; font-size: 1rem; font-weight: 600; color: var(--text); }
.mp-cathead:first-child { margin-top: 0; }
.mp-subhead { margin: 10px 0 6px; font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.mp-pills { display: flex; flex-wrap: wrap; gap: 8px; }
/* r3: rows take the card's full height. With "auto" rows the 40px min-height of .mp-pill set the row size whenever the
   cards were taller than the scrolling pane (no free space left to grow the rows), so long text spilled out of the card */
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-auto-rows: max-content; gap: 8px; align-content: start; }
.mp-pill {
    display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center;
    min-height: 40px; min-width: 0; max-width: 100%; padding: 6px 14px; border-radius: 20px; text-align: left; font-size: 14px; cursor: pointer;
    background-color: var(--surface) !important; color: var(--text) !important; border: 1.5px solid var(--border) !important;
}
.mp-pill:hover { border-color: var(--brand) !important; }
.mp-pill.is-on { background-color: var(--brand) !important; color: var(--on-brand) !important; border-color: var(--brand) !important; }
.mp-pill-sub { font-size: 12px; color: var(--text-secondary); }
.mp-pill-sci { font-size: 12px; font-style: italic; color: var(--text-secondary); }
.mp-pill.is-on .mp-pill-sub, .mp-pill.is-on .mp-pill-sci { color: var(--on-brand); }
.mp-dialog :focus-visible { outline: 3px solid var(--focus) !important; outline-offset: 2px; }
@media (max-width: 768px) {
    .mp-backdrop { padding: 0; align-items: stretch; }
    .mp-dialog { width: 100%; max-height: none; height: 100%; border-radius: 0; }
    .mp-dbody { flex-direction: column; }
    .mp-cats { flex: none; flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--border-subtle); }
    .mp-cat { width: auto; flex: none; white-space: nowrap; }
    .mp-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
/* 3.3 year / month <select>: on a phone style.css centres the column, so the group shrank to 124px and cut "เลือกเดือน" */
@media (max-width: 768px) {
    #wrap_abandoned_time { align-self: stretch; }
}
/* ===== end survey visibility + multi-picker ===== */
