/* Tools index — search band, chips, results, empty state.
   Loads after chemease.css and home.css and reuses their tokens. */

.ce-h1--tools { font-size: clamp(36px, 4vw, 52px); }
.ce-lead--wide { max-width: 560px; }

/* --- Search band ------------------------------------------------------ */
.ce-search {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--ce-cream) 0%, #fff 100%);
    padding: 64px 0 40px;
}
.ce-search__inner { position: relative; z-index: 1; }

.ce-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    max-width: 900px;
    margin-top: 26px;
}

.ce-field {
    flex: 1 1 300px;
    height: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-radius: var(--ce-r-lg);
    background: #fff;
    border: 1px solid var(--ce-line-70);
    box-shadow: var(--ce-sh-subtle);
    color: var(--ce-faint);
    transition: border-color .2s var(--ce-ease), box-shadow .2s var(--ce-ease);
}
.ce-field:focus-within { border-color: var(--ce-brand-400); box-shadow: var(--ce-focus-ring); }
.ce-field svg { flex: none; }
.ce-field input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
    color: var(--ce-ink);
}
/* The UA's own clear affordance would sit beside ours. */
.ce-field input::-webkit-search-cancel-button { display: none; }

.ce-field__clear {
    flex: none;
    width: 24px; height: 24px;
    display: grid; place-items: center;
    border: 0;
    border-radius: var(--ce-r-xs);
    background: var(--ce-tint);
    color: var(--ce-body);
    cursor: pointer;
    transition: background-color .2s var(--ce-ease);
}
.ce-field__clear:hover { background: #00000014; color: var(--ce-ink); }
.ce-field__clear:focus-visible { outline: none; box-shadow: var(--ce-focus-ring); }

.ce-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.ce-chip {
    padding: 9px 15px;
    border-radius: var(--ce-r-pill);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    background: #fff;
    color: #413C33;
    border: 1px solid var(--ce-line-70);
    cursor: pointer;
    transition: background-color .2s var(--ce-ease), border-color .2s var(--ce-ease),
                color .2s var(--ce-ease);
}
.ce-chip:hover { border-color: var(--ce-line-soft); }
.ce-chip:focus-visible { outline: none; border-color: var(--ce-brand-400); box-shadow: var(--ce-focus-ring); }
.ce-chip.is-active {
    background: var(--ce-ink-strong);
    color: #fff;
    border-color: var(--ce-ink-strong);
    font-weight: 600;
}

.ce-count { margin-top: 16px; font-size: 12px; color: var(--ce-muted); }

/* --- Results ---------------------------------------------------------- */
.ce-results {
    background: var(--ce-sand);
    border-top: 1px solid var(--ce-line-60);
    padding: 52px 0 76px;
}
.ce-tiles--wide { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.ce-tiles--wide .ce-tile { padding: 14px 16px; }
.ce-tiles--wide .ce-tile b { font-size: 14px; }
.ce-tiles--wide .ce-tile span { font-size: 12.5px; line-height: 1.45; }

/* `hidden` alone loses to the grid/flex display rules above. */
.ce-tile[hidden], .ce-cat[hidden], .ce-empty[hidden] { display: none !important; }

/* --- Empty state ------------------------------------------------------ */
.ce-empty {
    border-radius: var(--ce-r-glass);
    border: 1px dashed var(--ce-line-soft);
    background: #fff;
    padding: 56px 28px;
    text-align: center;
}
.ce-empty h2 { font-size: 19px; font-weight: 600; margin-bottom: 10px; }
.ce-empty p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--ce-body);
    max-width: 400px;
    margin: 0 auto 22px;
}
.ce-empty .ce-btn { padding: 12px 24px; font-size: 14.5px; }

/* The handoff draws the clear button at 24x24. That is fine for a pointer but
   under the 44px minimum for a thumb, and it sits inside a 50px field so the
   visual size cannot simply grow. Expand the hit area instead and leave the
   painted button alone. */
.ce-field__clear { position: relative; }
.ce-field__clear::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
}
