/* Garam Checklist — inventory-matching layout, light + Onix/Ash themes. */
html:has(.garam-checklist-page),
body:has(.garam-checklist-page) {
    background-color: var(--garam-theme-surface, #d2edfe) !important;
    background-image: none !important;
}
.garam-checklist-page {
    --check-ink: var(--garam-c-123c5c, #123c5c);
    --check-muted: var(--garam-c-527f99, #527f99);
    --check-border: var(--garam-c-bbdef5, #bbdef5);
    --check-soft: var(--garam-c-f0f9ff, #f0f9ff);
    --check-card: var(--garam-c-e9f7ff, #e9f7ff);
    --check-accent: var(--garam-theme-ui-accent, var(--garam-theme-accent, #087cce));
    min-height: 75vh;
    width: 100%;
    box-sizing: border-box;
    padding: 24px 16px 52px;
    color: var(--check-ink);
    font-family: inherit;
}
.garam-checklist-page *, .checklist-owner-overlay *, .checklist-card-dialog * { box-sizing: border-box; }
.garam-checklist-page [hidden], .checklist-owner-overlay [hidden] { display: none !important; }
.checklist-main { max-width: 1240px; width: 100%; margin: 0 auto; }
.checklist-hero {
    position: relative; isolation: isolate; text-align: center;
    overflow: visible; padding: 44px 12px 48px;
}
.checklist-hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(var(--garam-c-86c7ed, #86c7ed) 1px, transparent 1px);
    background-size: 22px 22px; opacity: .28;
    mask-image: linear-gradient(to bottom, black 20%, transparent 95%);
    pointer-events: none;
}
.checklist-title {
    margin: 0; display: flex; flex-wrap: wrap; align-items: center;
    justify-content: center; gap: 12px 18px;
    font-size: clamp(36px, 6vw, 76px); font-weight: 850;
    letter-spacing: -.045em; line-height: 1.1; color: #fff;
}
.checklist-avatar-button {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto; position: relative; border: 0; padding: 0;
    border-radius: 50%; background: transparent; cursor: pointer;
    overflow: hidden; transition: transform .18s ease;
}
.checklist-avatar-button:hover { transform: translateY(-2px) scale(1.035); }
.checklist-avatar-button:focus-visible { outline: 3px solid var(--check-accent); outline-offset: 7px; }
.checklist-avatar-button img {
    display: block; width: clamp(68px, 7vw, 96px);
    height: clamp(68px, 7vw, 96px); border-radius: 50%;
    object-fit: cover; border: 5px solid #fff;
    background: var(--garam-c-caeaff, #caeaff);
    box-shadow: 0 8px 30px rgba(22,99,150,.23), 0 0 0 3px var(--garam-c-91d5fa, #91d5fa);
}
.checklist-avatar-hover {
    position: absolute; inset: 5px; border-radius: 50%;
    display: grid; place-content: center; text-align: center;
    color: #fff; background: rgba(0,0,0,.62);
    font-size: clamp(11px,1.2vw,14px); font-weight: 800;
    letter-spacing: 0; line-height: 1.2;
    opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.checklist-avatar-button:hover .checklist-avatar-hover,
.checklist-avatar-button:focus-visible .checklist-avatar-hover { opacity: 1; }
.checklist-instruction { margin: 17px 0 0; color: #fff; font-size: 16px; }
.checklist-filter-panel {
    padding: 24px; background: #fff;
    border: 1px solid var(--check-border); border-radius: 24px;
    box-shadow: 0 14px 30px rgba(21,99,153,.12);
}
.checklist-filters { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.checklist-filter-field {
    display: flex; flex-direction: column; min-width: 0; position: relative;
    gap: 7px;
}
.checklist-filter-field > label {
    color: var(--garam-c-44718d,#44718d); font-size: 13px; font-weight: 700;
}
.checklist-filter-field.is-autocomplete-open { z-index: 20; }
/* Google-style suggestion panel: portaled to <body>, so no page frame or
   filter panel can clip it.  The JS anchors it beneath the active input. */
.checklist-autocomplete {
    /* The popup lives under <body>, so give it the same theme tokens the
       Checklist root normally provides through inheritance. */
    --check-ink: var(--garam-c-123c5c, #123c5c);
    --check-muted: var(--garam-c-527f99, #527f99);
    --check-border: var(--garam-c-bbdef5, #bbdef5);
    --check-soft: var(--garam-c-f0f9ff, #f0f9ff);
    font-family: inherit;
    position: fixed; z-index: 300100;
    top: 0; left: 0; width: 330px;
    max-height: min(430px, 62dvh);
    overflow-y: auto; overflow-x: hidden;
    padding: 5px; border-radius: 14px;
    background: #fff; border: 1px solid var(--check-border);
    box-shadow: 0 15px 38px rgba(15, 43, 76, .24);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-gutter: stable;
    scrollbar-width: auto;
    scrollbar-color: #a2aec0 transparent;
}
.checklist-autocomplete::-webkit-scrollbar { width: 10px; }
.checklist-autocomplete::-webkit-scrollbar-track { background: transparent; }
.checklist-autocomplete::-webkit-scrollbar-thumb {
    background: #abb6c6; border-radius: 99px;
    border: 2px solid #fff;
}
.checklist-autocomplete::-webkit-scrollbar-thumb:hover { background: #8494a9; }

.checklist-autocomplete[hidden] { display: none !important; }
.checklist-autocomplete-option {
    display: block; width: 100%; min-height: 46px; padding: 12px 14px;
    border: 0; border-radius: 9px; text-align: left;
    background: transparent; color: var(--check-ink);
    font: inherit; font-size: 15px; font-weight: 600;
    line-height: 1.35; cursor: pointer; white-space: normal;
    overflow-wrap: anywhere;
}
.checklist-autocomplete-option:hover,
.checklist-autocomplete-option.is-highlighted,
.checklist-autocomplete-option:focus-visible {
    background: var(--check-soft); color: var(--check-ink); outline: none;
}
.checklist-autocomplete-option small {
    display: block; color: var(--check-muted); font-size: 11px; font-weight: 500;
}
.checklist-filters input, .checklist-owner-form input {
    display: block; width: 100%; min-width: 0; max-width: 100%;
    height: 45px; margin: 0; padding: 10px 12px;
    border: 1px solid var(--garam-c-b7d8ed,#b7d8ed);
    border-radius: 13px; background: var(--check-soft);
    color: var(--check-ink); font: inherit; font-size: 14px;
    box-shadow: none; outline: none;
}
.checklist-filters input:focus-visible, .checklist-owner-form input:focus-visible {
    outline: 2px solid var(--garam-c-51a8e8,#51a8e8); outline-offset: 1px;
}
.checklist-filters input::placeholder, .checklist-owner-form input::placeholder {
    color: var(--garam-c-84a9be,#84a9be); opacity: .9;
}
.checklist-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.checklist-filter-hint { color: var(--check-muted); font-size: 12px; flex: 1; min-width: 205px; }
.checklist-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.garam-checklist-page .checklist-button, .checklist-owner-overlay .checklist-button {
    display: inline-flex; justify-content: center; align-items: center;
    gap: 7px; min-height: 42px; padding: 9px 15px;
    border-radius: 13px; font: inherit; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: background .15s ease, transform .15s ease;
}
.garam-checklist-page .checklist-button:active, .checklist-owner-overlay .checklist-button:active { transform: translateY(1px); }
.checklist-button-outline {
    border: 1px solid var(--garam-c-a9cfea,#a9cfea) !important;
    background: #fff; color: var(--garam-c-155a8d,#155a8d);
}
.checklist-button-outline:hover:not(:disabled) { background: var(--garam-c-e5f5ff,#e5f5ff); }
.checklist-button-primary {
    border: 1px solid var(--garam-c-0764a6,#0764a6);
    background: var(--garam-c-087cce,#087cce); color: #fff;
    box-shadow: 0 4px 0 var(--garam-c-075a91,#075a91);
}
.checklist-button-primary:hover:not(:disabled) { filter: brightness(.95); }
.checklist-button-icon { min-width: 42px; border: 1px solid var(--garam-c-a9cfea,#a9cfea); background: #fff; padding: 8px !important; }
/* Text toggle: same button typography as Inventory's toolbar, with a true on/off indicator. */
.checklist-button-toggle {
    border: 1px solid var(--garam-c-a9cfea,#a9cfea);
    color: var(--garam-c-155a8d,#155a8d);
    background: #fff;
    white-space: nowrap;
}
.checklist-toggle-track {
    display: inline-flex; align-items: center; box-sizing: border-box;
    width: 29px; height: 17px; padding: 2px; flex-shrink: 0;
    background: #b6c2cd; border-radius: 99px;
    transition: background-color .18s ease;
}
.checklist-toggle-knob {
    display: block; width: 13px; height: 13px; flex: 0 0 13px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 1px 3px rgb(0 0 0 / 15%);
    transition: transform .18s ease;
}
.checklist-button-toggle.is-active {
    border-color: var(--check-accent);
    color: var(--check-accent);
    background: var(--check-soft);
}
.checklist-button-toggle.is-active .checklist-toggle-track { background: var(--check-accent); }
.checklist-button-toggle.is-active .checklist-toggle-knob { transform: translateX(12px); }
.checklist-button-toggle:focus-visible { outline: 3px solid var(--check-accent); outline-offset: 2px; }
.checklist-button:disabled { opacity: .43; cursor: default; }
.checklist-results-heading { display: flex; gap: 10px; align-items: center; justify-content: space-between; min-height: 44px; margin-top: 17px; }
#checklistCount { margin: 0; color: var(--garam-c-096dae,#096dae); font-size: 14px; font-weight: 650; }
.checklist-card-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); align-items: start; gap: 14px; width: 100%; margin: 0 auto; transition: opacity .2s ease; }
.checklist-card-tile { min-width: 0; padding: 6px; border-radius: 17px; background: var(--check-card); border: 1px solid var(--garam-c-b9def3,#b9def3); }
.checklist-card-open { display: block; width: 100%; border: 0; padding: 0; margin: 0; text-align: left; background: transparent; color: inherit; cursor: pointer; }
.checklist-card-open:focus-visible { outline: 3px solid var(--check-accent); outline-offset: 2px; border-radius: 12px; }
.checklist-card-photo { display: block; position: relative; width: 100%; border-radius: 25px; overflow: hidden; aspect-ratio: 188 / 279; background: var(--garam-c-cae9f9,#cae9f9); }
.checklist-card-image { display: block; width: 100%; height: 100%; aspect-ratio: 188 / 279; object-fit: cover; border-radius: 25px; }
/* Missing: neutral grayscale, intentionally kept light and recognizable. */
.checklist-card-tile.is-missing .checklist-card-image { filter: grayscale(1) brightness(.94) contrast(.92); opacity: .82; }
.checklist-card-tile.is-missing .checklist-card-photo { background: #e5e7ea; }
.checklist-card-badge { position: absolute; top: 7px; left: 7px; z-index: 2; display: inline-flex; align-items: center; min-height: 24px; border-radius: 9px; padding: 3px 9px; background: rgba(15,67,105,.9); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; }
.checklist-card-tile.is-missing .checklist-card-badge { background: rgba(85,87,93,.86); }
.checklist-image-missing::after { content: "Image unavailable"; color: var(--check-ink); font-size: 12px; display: grid; place-content: center; position: absolute; inset: 0; }
.checklist-card-caption { display: flex; min-height: 59px; padding: 9px 5px 4px; flex-direction: column; gap: 4px; }
.checklist-card-caption strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; color: var(--check-ink); }
.checklist-card-caption > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; color: var(--check-muted); }
.checklist-card-tile.is-missing .checklist-card-caption { opacity: .76; }
.checklist-pagination { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 24px; }
#checklistPageDisplay { min-width: 110px; text-align: center; color: var(--garam-c-155a8d,#155a8d); font-weight: 700; }
.checklist-empty { grid-column: 1 / -1; padding: 55px 15px; border: 1px dashed var(--check-border); border-radius: 17px; text-align: center; color: var(--check-muted); }
.checklist-guest-landing { min-height: calc(100dvh - 100px); display: flex; align-items: center; justify-content: center; padding: 22px 12px; }
.checklist-guest-card { width: min(100%,530px); padding: clamp(20px,5vw,36px); background: #fff; border: 1px solid var(--check-border); border-radius: 24px; box-shadow: 0 20px 60px rgba(4,75,122,.18); }
.checklist-guest-card h2 { margin: 0; color: var(--check-ink); font-size: clamp(25px,5vw,35px); }
.checklist-guest-card p { color: var(--check-muted); font-size: 14px; line-height: 1.6; }
.checklist-owner-form { display: flex; flex-direction: column; gap: 10px; }
.checklist-owner-form label { font-size: 14px; font-weight: 800; color: var(--check-ink); }
.checklist-owner-form .checklist-button { align-self: flex-end; min-width: 94px; }
.checklist-error { color: #bd344b !important; font-size: 13px; margin: 0; }
.checklist-owner-overlay { position: fixed; inset: 0; z-index: 200110; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgb(10 10 10 / 60%); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, visibility .2s; }
.checklist-owner-overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.checklist-owner-panel { width: min(100%,485px); max-height: calc(100dvh - 32px); overflow: auto; padding: 23px; background: #fff; border: 1px solid var(--check-border); border-radius: 23px; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.checklist-owner-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.checklist-owner-heading h2 { margin: 0; font-size: 24px; color: var(--check-ink); }
.checklist-owner-panel > p { font-size: 14px; color: var(--check-muted); margin: 13px 0 21px; }
.checklist-owner-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.checklist-card-dialog { width: min(960px,95vw); max-height: 93vh; border: 1px solid var(--check-border); border-radius: 22px; padding: 22px; box-shadow: 0 26px 80px rgba(0,0,0,.32); background: #fff; color: var(--check-ink); }
.checklist-card-dialog::backdrop { background: rgb(10 10 10 / 60%); }
.checklist-card-dialog[open] { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(250px,.9fr); gap: 22px; align-items: center; }
.checklist-card-dialog-media { min-width: 0; min-height: 275px; padding: 10px; display: grid; place-content: center; background: var(--check-soft); border-radius: 15px; }
.checklist-card-dialog-media img { display: block; max-width: 100%; max-height: 72vh; object-fit: contain; border-radius: 18px; }
.checklist-card-close { position: absolute; top: 13px; right: 13px; width: 38px; height: 38px; border: 1px solid var(--check-border); border-radius: 11px; background: var(--check-soft); font-size: 26px; color: var(--check-ink); cursor: pointer; }
.checklist-card-dialog-content { min-width: 0; padding: 16px; }
.checklist-dialog-eyebrow { margin: 0; font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--check-muted); letter-spacing: .05em; }
.checklist-card-dialog-content h2 { margin: 8px 0; font-size: clamp(22px,3vw,34px); overflow-wrap: anywhere; }
#checklistDialogStatus { font-size: 13px; font-weight: 800; color: #098559; }
#checklistDialogStatus.is-missing { color: #85878b; }
#checklistDialogFacts { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 12px 8px; margin: 20px 0 0; }
#checklistDialogFacts dt { font-size: 13px; font-weight: 650; color: var(--check-muted); }
#checklistDialogFacts dd { margin: 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; color: var(--check-ink); }
@media (max-width: 1050px) { .checklist-card-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width: 740px) {
    .garam-checklist-page { padding: 12px 9px 32px; }
    .checklist-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 9px 34px; }
    .checklist-title { width: 100%; text-align: center; font-size: clamp(32px,7vw,50px); gap: 12px; }
    .checklist-instruction { width: 100%; text-align: center; margin: 16px 0 0; font-size: 14px; }
    .checklist-filters { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
    .checklist-filter-panel { padding: 16px; border-radius: 18px; }
    .checklist-card-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
    .checklist-card-dialog[open] { grid-template-columns: 1fr; }
    .checklist-card-dialog-media img { max-height: 44vh; }
    .checklist-card-dialog-content { padding: 6px; }
}
@media (max-width: 460px) {
    .checklist-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
    .checklist-results-heading { align-items: flex-start; flex-wrap: wrap; gap: 5px 12px; }
    .checklist-filter-hint { min-width: 0; }
    .checklist-card-dialog { padding: 16px; }
    .checklist-pagination { gap: 6px; }
    .checklist-pagination .checklist-button { padding: 9px 11px; }
    #checklistPageDisplay { min-width: 64px; font-size: 13px; }
}
/* Shared Onix / Ash tokens. */
html[data-garam-mode="dark"] .garam-checklist-page {
    --check-ink: var(--garam-dark-text,#f3f4f7);
    --check-muted: var(--garam-dark-muted,#a5a8b2);
    --check-border: var(--garam-dark-border,#45464d);
    --check-soft: var(--garam-dark-raised,#34353c);
    --check-card: var(--garam-dark-raised,#34353c);
}
html[data-garam-mode="dark"] .checklist-filter-panel,
html[data-garam-mode="dark"] .checklist-guest-card,
html[data-garam-mode="dark"] .checklist-owner-panel,
html[data-garam-mode="dark"] .checklist-card-dialog {
    background: var(--garam-dark-panel,#23242a); color: var(--garam-dark-text,#f3f4f7);
    border-color: var(--garam-dark-border,#45464d);
}
html[data-garam-mode="dark"] .checklist-filter-panel input,
html[data-garam-mode="dark"] .checklist-owner-form input {
    background: var(--garam-dark-raised,#34353c); color: var(--garam-dark-text,#f3f4f7);
    border-color: var(--garam-dark-border,#45464d);
}
html[data-garam-mode="dark"] .checklist-card-tile {
    background: var(--garam-dark-raised,#34353c); border-color: var(--garam-dark-border,#45464d);
}
html[data-garam-mode="dark"] .checklist-button-outline,
html[data-garam-mode="dark"] .checklist-button-icon,
html[data-garam-mode="dark"] .checklist-button-toggle,
html[data-garam-mode="dark"] .checklist-card-close {
    background: var(--garam-dark-raised,#34353c); color: var(--garam-dark-text,#f3f4f7);
    border-color: var(--garam-dark-border,#45464d) !important;
}
html[data-garam-mode="dark"] .checklist-card-dialog-media {
    background: var(--garam-dark-raised,#34353c);
}
html[data-garam-mode="dark"] .checklist-filter-hint,
html[data-garam-mode="dark"] .checklist-filter-field > label,
html[data-garam-mode="dark"] .checklist-card-caption > span,
html[data-garam-mode="dark"] .checklist-legend,
html[data-garam-mode="dark"] .checklist-owner-panel > p,
html[data-garam-mode="dark"] #checklistDialogFacts dt { color: var(--garam-dark-muted,#a5a8b2); }
html[data-garam-mode="dark"] .checklist-card-caption strong,
html[data-garam-mode="dark"] .checklist-guest-card h2,
html[data-garam-mode="dark"] .checklist-owner-heading h2,
html[data-garam-mode="dark"] #checklistDialogFacts dd { color: var(--garam-dark-text,#f3f4f7); }
@media (prefers-reduced-motion:reduce) {
    .checklist-avatar-button, .checklist-card-grid, .checklist-owner-overlay, .checklist-button { transition:none!important; }
}

/* Autocomplete dropdowns use the same Onix / Ash surfaces as the filters. */
html[data-garam-mode="dark"] .checklist-autocomplete {
    background: var(--garam-dark-panel, #23242a);
    border-color: var(--garam-dark-border, #45464d);
    box-shadow: 0 16px 36px rgb(0 0 0 / 40%);
}
html[data-garam-mode="dark"] .checklist-autocomplete-option {
    color: var(--garam-dark-text, #f3f4f7);
}
html[data-garam-mode="dark"] .checklist-autocomplete-option:is(:hover, .is-highlighted, :focus-visible) {
    background: var(--garam-dark-raised, #34353c);
    color: var(--garam-dark-text, #f3f4f7);
}
html[data-garam-mode="dark"] .checklist-autocomplete-option small {
    color: var(--garam-dark-muted, #a5a8b2);
}

/* Dark theme scrollbar remains visible against the dark dropdown. */
html[data-garam-mode="dark"] .checklist-autocomplete {
    scrollbar-color: #747985 transparent;
}
html[data-garam-mode="dark"] .checklist-autocomplete::-webkit-scrollbar-thumb {
    background: #747985; border-color: var(--garam-dark-panel, #23242a);
}
