/* OptimAI site: the home page scan form (phase 1, Seth's brief 30 Oct 2026). A site-owned copy of the
   app's scan bar styles (app.css A2-81 block and the ss-keyword combo, origin/dev 7d1a8727), same class
   names, with the app's colour variables mapped onto the site's canon tokens here. The field is the
   canon .input look the hero already uses; the locked URL, the searching skeleton, the red error line
   and the keyword combo all sit inside it. */
.scanbar2 {
  --primary: var(--c-primary); --secondary: var(--c-secondary); --body-color: var(--c-body); --body: var(--c-body);
  --mid-grey: var(--c-mid); --invert-1: var(--c-invert-1); --invert-2: var(--c-invert-2); --surface: white;
  --red: var(--c-red); --radius-sm: var(--r-sm);
}
.scanbar2 .field-row { align-items: center; }
.scanbar2-row { display: flex; align-items: center; gap: var(--s-3); flex: 1 1 0; min-width: 0; }

/* The field: the canon input box; its inner input has no box of its own. */
.scanbar2-field { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 10px;
  background: white; padding-top: 0; padding-bottom: 0; }
.scanbar2-field > input, .scanbar2-field .scanbar2-kw-input { border: 0; outline: 0; background: transparent; box-shadow: none;
  font: inherit; color: var(--c-body); height: 100%; padding: 0; min-width: 0; }
.scanbar2-url-input { flex: 1; }
.scanbar2-field:focus-within { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); }

/* Locked URL: strong body text, never wraps, never shrinks (app). */
.scanbar2-url { flex-shrink: 0; font-weight: 700; font-size: 16px; color: var(--body-color); white-space: nowrap; }

/* Searching: the word plus a pulsing skeleton filling the rest of the field (app). */
.scanbar2-searching { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.scanbar2-searching-word { color: var(--mid-grey); white-space: nowrap; flex-shrink: 0; }
.scanbar2-skeleton { flex: 1; min-width: 0; height: 14px; min-height: 14px; }
.skeleton { display: block; background: linear-gradient(90deg, var(--invert-2) 0%, var(--invert-1) 50%, var(--invert-2) 100%);
  background-size: 200% 100%; border-radius: var(--radius-sm); animation: skeletonShimmer 2.8s ease-in-out infinite; min-height: 16px; }
.skeleton.line { height: 14px; }
@keyframes skeletonShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* The one red line, in the field (app A2-81b). */
.scanbar2-line { flex: 0 1 auto; min-width: 0; font-size: 13px; color: var(--mid-grey); white-space: nowrap; overflow: hidden; text-overflow: clip; }
.scanbar2-line-error { color: var(--red); }
.scanbar2-line-failed { flex: 1 1 auto; text-align: left; }

/* Cancel: the outline twin of the primary (app .btn-outline), on the green ground. */
.scanbar2 .btn-outline { background: transparent; color: white; border: 1px solid white; height: 48px; }
.scanbar2 .btn-outline:hover { background: rgba(255, 255, 255, 0.12); }
.scanbar2-btn { flex-shrink: 0; white-space: nowrap; }
.scanbar2[data-mode="searching"] .scanbar2-primary, .scanbar2[data-mode="failed"] .scanbar2-primary { display: none; }
.scanbar2-primary { display: inline-flex; align-items: center; gap: var(--s-2); }
.scanbar2-primary .btn-icon { font-size: 20px; line-height: 1; }

/* Resolved: the combo fills the field after the locked URL; the dropdown hangs under the field (app). */
.scanbar2-field-combo { padding-right: 0; }
.ss-keyword-combo { position: relative; display: flex; align-items: center; gap: 0; }
.scanbar2-combo { flex: 1; min-width: 0; align-self: stretch; position: static; }
.scanbar2-kw-input { flex: 1; width: 100%; padding-right: 40px !important; }
.scanbar2-kw-input.scanbar2-kw-suggested { font-weight: 500; color: var(--secondary); }
.scanbar2-kw-meta { display: none; }
.scanbar2-combo-line { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; font-size: 12px; color: white;
  white-space: nowrap; overflow: hidden; text-overflow: clip; pointer-events: none; }
.scanbar2-combo:has(.scanbar2-dropdown:not(.hidden)) .scanbar2-combo-line { display: none; }
.ss-keyword-toggle { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 36px; display: inline-flex; align-items: center;
  justify-content: center; background: transparent; border: none; border-left: 1px solid var(--invert-1); cursor: pointer; padding: 0;
  border-radius: 0 var(--r-md) var(--r-md) 0; transition: background 0.15s; }
.ss-keyword-toggle::after { content: ''; display: block; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-top: 8px solid var(--secondary); transition: border-color 0.15s; }
.ss-keyword-toggle:hover { background: var(--secondary); }
.ss-keyword-toggle:hover::after { border-top-color: #fff; }
.ss-keyword-dropdown { position: absolute; top: 100%; left: 0; right: 0; margin-top: 2px; padding: 4px; background: #fff; border: 1px solid var(--invert-1);
  border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); max-height: 240px; overflow-y: auto; z-index: 100; text-align: left; }
.ss-keyword-dropdown.hidden { display: none; }
.ss-keyword-option { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; background: transparent; border: none; border-radius: 4px; cursor: pointer; text-align: left; font: inherit; font-size: 12px; color: var(--body); }
.ss-keyword-option:hover { background: var(--invert-2); }
.ss-keyword-option-kw { flex: 1 1 auto; overflow: hidden; text-overflow: clip; white-space: nowrap; font-weight: 500; }
.scanbar2-dropdown .ss-keyword-option-kw.scanbar2-kw-suggested { font-weight: 400; color: var(--secondary); }
.ss-keyword-option-date { color: var(--mid-grey); font-size: 11px; flex-shrink: 0; }
.ss-keyword-shared-badge { font-size: 10px; font-weight: 600; color: var(--secondary); background: var(--invert-2); padding: 1px 6px; border-radius: 3px; white-space: nowrap; flex-shrink: 0; }
.kwops-empty { padding: 16px; text-align: center; color: var(--mid-grey); font-size: 13px; }
.kwops-empty p { margin: 0; }

/* The primary's text and icon follow the button: dark teal on white, knocking out to white on hover
   (the hero's url-form button rule), whatever else styles a span. */
.ground-primary .scanbar2 .scanbar2-primary { color: var(--c-primary); }
.ground-primary .scanbar2 .scanbar2-primary:hover { color: white; }
.scanbar2 .scanbar2-primary .btn-icon, .scanbar2 .scanbar2-primary .btn-label { color: inherit; }

/* Seth (30 Oct 2026): the locked URL sits ABOVE the field on the hero (no room inside it), strong, white on the green. */
.scanbar2-locked { margin: 0 0 var(--s-2); min-height: 0; }
.scanbar2-locked:empty { display: none; }
.scanbar2-locked .scanbar2-url { color: white; font-weight: 700; font-size: 32px; line-height: 40px; }
/* Dropdown rows tighter: suggestions strong, the badge smaller. */
.scanbar2-dropdown .ss-keyword-option { padding: 4px 8px; }
.scanbar2-dropdown .ss-keyword-option-kw.scanbar2-kw-suggested { font-weight: 700; }
.ss-keyword-shared-badge { font-size: 9px; line-height: 14px; padding: 0 4px; }
/* Long paths wrap at / and - (the <wbr> the URL rule inserts), never past the form's width. */
.scanbar2-locked { max-width: 100%; }
.scanbar2-locked .scanbar2-url { display: block; white-space: normal; overflow-wrap: anywhere; flex-shrink: 1; padding: 0; }
/* Long suggestions wrap onto a second line rather than truncate (the browser's truncation draws the
   ellipsis glyph; house style is three full stops or none) (Seth, 30 Oct 2026). */
.scanbar2-dropdown .ss-keyword-option { align-items: flex-start; }
.scanbar2-dropdown .ss-keyword-option-kw { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.scanbar2-dropdown .ss-keyword-option-date, .scanbar2-dropdown .ss-keyword-shared-badge { margin-top: 1px; }

/* The same component on a light ground (the How it works act, 30 Oct 2026): the white-on-green
   choices above become their light-ground twins. */
.scanbar2:not(.ground-primary *) .scanbar2-locked .scanbar2-url { color: var(--c-body); }
.scanbar2:not(.ground-primary *) .btn-outline { color: var(--c-primary); border-color: var(--c-primary); background: transparent; }
.scanbar2:not(.ground-primary *) .btn-outline:hover { background: var(--c-invert-2); }
.scanbar2:not(.ground-primary *) .scanbar2-combo-line { color: var(--c-mid); }
.scanbar2:not(.ground-primary *) .scanbar2-field:focus-within { box-shadow: 0 0 0 3px rgba(2, 96, 92, 0.15); }
