/* Checklist Search -- phone-first search page (Story #2088) */

.cls-shell {
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- Search bar -------------------------------------------------------- */
.cls-search-bar {
    background: #fff;
    border-bottom: 1px solid #E5E5E8;
    padding: 14px 16px 12px 16px;
    position: sticky; top: 0; z-index: 5;
}
.cls-search-bar .cls-search-row {
    display: flex; gap: 10px; align-items: center;
}
.cls-search-bar input[type="search"] {
    flex: 1;
    width: 100%;
    padding: 11px 14px;
    font: 13pt -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    border: 1px solid #D5D5D9; border-radius: 10px;
    background: #F8F8FA;
    -webkit-appearance: none; appearance: none;
}
.cls-search-bar input[type="search"]:focus {
    outline: none; border-color: #1A73E8;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.18);
}
.cls-search-bar .cls-hint {
    font-size: 10pt; color: #888; margin-top: 6px; line-height: 1.35;
}

/* ---- Filter panel ------------------------------------------------------ */
.cls-filters {
    background: #fff;
    border-bottom: 1px solid #E5E5E8;
    padding: 0 16px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease, padding 0.25s ease;
}
.cls-filters.open {
    max-height: 600px;
    padding: 14px 16px 16px 16px;
}
.cls-filter-toggle {
    background: transparent; border: 1px solid #D5D5D9;
    border-radius: 8px; padding: 8px 14px;
    font: 11pt -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-weight: 600; color: #555; cursor: pointer;
    white-space: nowrap;
}
.cls-filter-toggle:hover { background: #F5F5F7; }
.cls-filter-toggle.has-filters {
    border-color: #1A73E8; color: #1A73E8; background: #F0F6FF;
}

.cls-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}
.cls-filter-grid label {
    display: block;
    font-size: 10pt; font-weight: 600; color: #555;
    margin-bottom: 4px;
}
.cls-filter-grid select,
.cls-filter-grid input[type="date"] {
    width: 100%;
    padding: 8px 10px;
    font: 11pt -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    border: 1px solid #D5D5D9; border-radius: 8px;
    background: #fff;
    -webkit-appearance: none; appearance: none;
}
.cls-filter-grid select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}
.cls-filter-grid select:focus,
.cls-filter-grid input[type="date"]:focus {
    outline: none; border-color: #1A73E8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.18);
}

/* ---- Search-in toggles ------------------------------------------------- */
.cls-search-in {
    grid-column: 1 / -1;
    display: flex; flex-wrap: wrap; gap: 6px;
}
.cls-search-in-chip {
    padding: 5px 12px;
    font-size: 10pt; font-weight: 600;
    border: 1px solid #D5D5D9; border-radius: 14px;
    background: #F5F5F7; color: #555;
    cursor: pointer;
}
.cls-search-in-chip:hover { background: #ECECEE; }
.cls-search-in-chip.active {
    background: #1A73E8; color: #fff; border-color: #0B4FA8;
}

/* ---- Results list ------------------------------------------------------ */
.cls-results {
    flex: 1;
    padding: 10px 14px 40px 14px;
}
.cls-results-status {
    padding: 8px 4px;
    font-size: 10.5pt; color: #6A6A6E; font-weight: 500;
}

.cls-group-header {
    font-size: 11.5pt; font-weight: 700; color: #1A1A1A;
    padding: 16px 4px 6px 4px;
    border-bottom: 2px solid #E0E0E4;
    display: flex; align-items: center; gap: 8px;
}
.cls-group-header a {
    color: #0A66C2; text-decoration: none;
    font-weight: 600;
}
.cls-group-header a:hover { text-decoration: underline; }
.cls-group-header .cls-group-meta {
    font-size: 9.5pt; font-weight: 500; color: #888;
}

.cls-result {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 8px;
    border-bottom: 1px solid #F0F0F2;
    cursor: pointer;
    transition: background 0.1s ease;
}
.cls-result:hover { background: #F8FAFF; }
.cls-result:active { background: #EFF4FB; }

.cls-result-icon {
    flex: 0 0 auto;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    font-size: 13px; font-weight: 700;
    background: #F0F0F2; color: #666;
}
.cls-result-icon.item     { background: #E8F0FE; color: #1A73E8; }
.cls-result-icon.note     { background: #FFF4DA; color: #B58400; }
.cls-result-icon.group    { background: #E6F7F0; color: #14A08C; }
.cls-result-icon.checklist { background: #F3E8FF; color: #6A2D8C; }

.cls-result-body {
    flex: 1; min-width: 0;
}
.cls-result-text {
    font-size: 12pt; color: #1A1A1A; line-height: 1.4;
    word-break: break-word;
}
.cls-result-text mark {
    background: #FFF3B0; color: inherit;
    border-radius: 2px; padding: 0 1px;
}
.cls-result-meta {
    font-size: 9.5pt; color: #888; margin-top: 3px;
    display: flex; flex-wrap: wrap; gap: 4px 10px;
}

.cls-result-chips {
    display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px;
}
.cls-result-chip {
    display: inline-block;
    padding: 2px 8px;
    font-size: 8.5pt; font-weight: 600;
    border-radius: 8px;
    background: #F0F0F2; color: #666;
    border: 1px solid #E0E0E4;
}
.cls-result-chip.checked  { background: #E8F5E9; color: #2E7D32; border-color: #A5D6A7; }
.cls-result-chip.skipped  { background: #FFF3E0; color: #E65100; border-color: #FFCC80; }
.cls-result-chip.resolved { background: rgba(20,160,140,0.1); color: #14A08C; border-color: #14A08C; }
.cls-result-chip.template { background: #FFF4DA; color: #B58400; border-color: #ECDFB4; }
.cls-result-chip.category { background: rgba(26,115,232,0.1); color: #1A73E8; border-color: #B7CFF5; }

/* ---- Empty + loading --------------------------------------------------- */
.cls-empty {
    color: #888; font-style: italic;
    padding: 48px 24px; text-align: center;
    font-size: 12pt; line-height: 1.5;
}

/* ---- Desktop ----------------------------------------------------------- */
@media (min-width: 720px) {
    .cls-results { max-width: 920px; margin: 0 auto; padding: 10px 24px 60px 24px; }
    .cls-search-bar { padding: 16px 24px 14px 24px; }
    .cls-filter-grid { grid-template-columns: 1fr 1fr 1fr; }
}
