@font-face { font-family: "Sora"; src: url("/fonts/sora-400.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Sora"; src: url("/fonts/sora-500.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Sora"; src: url("/fonts/sora-600.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-400.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-500.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-600.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0b0b12;
  --bg-deep: #08080e;
  --panel: #16161f;
  --panel-raised: #1a1a26;
  --line: #33334a;
  --line-soft: rgba(143, 143, 166, .22);
  --text: #f4f4fa;
  --muted: #b4b4ca;
  --text-3: #8f8fa6;
  --brand: #6d3bf5;
  --brand-2: #2e5bff;
  --brand-lift: #a78bff;
  --info: #7da0ff;
  --cyan: #a78bff;
  --green: #30a46c;
  --danger: #e5484d;
  --focus: #a78bff;
  --header-height: 72px;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg-deep); scroll-behavior: smooth; scrollbar-color: var(--line) var(--bg-deep); scrollbar-width: thin; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; overflow-anchor: none; color: var(--text); background: var(--bg); }
body::before { content: ""; position: fixed; inset: 1px; z-index: 60; pointer-events: none; border: 1px solid rgba(125, 160, 255, .26); border-radius: 14px; }
body.has-results::before { border-color: rgba(51, 51, 74, .72); }
body::selection { color: #ffffff; background: var(--brand); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { border: 3px solid var(--bg-deep); border-radius: 10px; background: var(--line); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
button, input { font: inherit; }
button { cursor: pointer; }
svg { display: block; }

.skip-link { position: fixed; top: 10px; left: 12px; z-index: 100; padding: 10px 14px; color: var(--bg); background: var(--focus); transform: translateY(-160%); transition: transform .18s ease-out; }
.skip-link:focus { transform: translateY(0); }
.session-pending .skip-link, .session-required .skip-link { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.auth-gate { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 28px 18px; background: rgba(8, 8, 14, .7); backdrop-filter: blur(12px); opacity: 1; visibility: visible; transition: opacity .24s ease-out, visibility 0s; }
.is-authenticated .auth-gate { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease-out, visibility 0s .2s; }
.auth-panel { width: min(430px, 100%); padding: 28px 30px 25px; border: 1px solid rgba(125, 160, 255, .34); border-radius: 14px; background: #0e0e15; box-shadow: 0 30px 90px rgba(0, 0, 0, .58), inset 0 1px 0 rgba(244, 244, 250, .05); }
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 34px; }
.auth-brand img { width: 34px; height: 34px; object-fit: contain; }
.auth-brand span { display: flex; align-items: center; gap: 11px; font-family: "Sora", sans-serif; }
.auth-brand strong { font-size: 21px; font-weight: 600; letter-spacing: -.025em; }
.auth-brand i { width: 1px; height: 22px; background: var(--line); }
.auth-brand small { color: var(--muted); font-family: "IBM Plex Sans", sans-serif; font-size: 12px; font-style: normal; letter-spacing: .045em; }
.session-checking { min-height: 240px; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.session-checking[hidden] { display: none; }
.session-checking p { margin: 0; }
.session-loader { width: 28px; height: 28px; border: 1.5px solid rgba(167, 139, 255, .25); border-top-color: var(--brand-lift); border-radius: 50%; animation: spin .8s linear infinite; }
.login-form { display: grid; }
.login-form[hidden], .login-notice[hidden], .login-error[hidden] { display: none; }
.login-heading { margin-bottom: 24px; }
.login-heading h1 { font-size: clamp(24px, 5vw, 30px); letter-spacing: -.03em; text-align: left; }
.login-heading p { max-width: 38ch; margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.login-form label { margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 500; }
.login-form input { width: 100%; height: 48px; margin-bottom: 16px; padding: 0 14px; border: 1px solid rgba(143, 143, 166, .38); border-radius: 8px; outline: 0; color: var(--text); caret-color: var(--brand-lift); background: var(--bg-deep); font-size: 16px; }
.login-form input:focus { border-color: var(--brand-lift); box-shadow: 0 0 0 3px rgba(109, 59, 245, .14); }
.login-notice, .login-error { margin: 0 0 16px; padding: 10px 12px; border: 1px solid rgba(245, 165, 36, .3); border-radius: 8px; color: #f6d397; background: rgba(245, 165, 36, .07); font-size: 12px; line-height: 1.5; }
.login-error { border-color: rgba(229, 72, 77, .36); color: #ffb8bb; background: rgba(229, 72, 77, .08); }
.login-button { min-height: 50px; margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid rgba(125, 160, 255, .48); border-radius: 8px; color: #fff; background: linear-gradient(100deg, rgba(109, 59, 245, .54), rgba(46, 91, 255, .42)); font-weight: 600; }
.login-button:hover { background: linear-gradient(100deg, rgba(109, 59, 245, .72), rgba(46, 91, 255, .58)); }
.login-button:disabled { cursor: wait; opacity: .7; }
.login-form.is-submitting .login-button > span { display: none; }
.login-form.is-submitting .login-button .button-loader { display: block; margin: 0; }
.access-note { margin: 17px 0 0; color: var(--text-3); font-size: 11px; line-height: 1.5; text-align: center; }

.starfield-ground { position: fixed; inset: 0; z-index: 0; background: radial-gradient(ellipse 68% 72% at 50% 46%, #121020 0%, #0c0c15 54%, #08080e 100%); transition: opacity .35s ease-out, visibility 0s .35s; }
.starfield-canvas { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; opacity: 1; image-rendering: auto; transition: opacity .35s ease-out, visibility 0s .35s; }
.ambient-veil { position: fixed; inset: var(--header-height) 0 0; z-index: 2; pointer-events: none; background: radial-gradient(ellipse 44% 40% at 50% 43%, rgba(8, 8, 14, .03), rgba(8, 8, 14, .28) 70%, rgba(8, 8, 14, .54)), linear-gradient(180deg, rgba(8, 8, 14, .01), rgba(8, 8, 14, .1) 72%, rgba(8, 8, 14, .5)); transition: background .55s ease-out; }
.has-results .starfield-ground, .has-results .starfield-canvas { opacity: 0; visibility: hidden; }
.has-results .ambient-veil { background: var(--bg); }

.topbar { position: fixed; inset: 0 0 auto; z-index: 20; height: var(--header-height); padding: 0 clamp(20px, 3.6vw, 58px); display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: center; gap: clamp(20px, 3vw, 46px); border-bottom: 1px solid rgba(51, 51, 74, .78); background: rgba(8, 8, 14, .91); backdrop-filter: blur(18px) saturate(120%); }
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; object-fit: contain; }
.brand-name { display: flex; align-items: center; gap: 11px; font-family: "Sora", sans-serif; }
.brand-name strong { color: var(--text); font-size: 20px; font-weight: 600; letter-spacing: -.025em; }
.brand-name small { color: var(--muted); font-family: "IBM Plex Sans", sans-serif; font-size: 12px; font-weight: 500; letter-spacing: .045em; }
.product-divider { width: 1px; height: 20px; background: var(--line); }
.system-state { justify-self: start; display: flex; align-items: center; gap: 9px; margin-left: clamp(18px, 5vw, 92px); color: var(--green); font-size: 13px; }
.has-results .system-state { justify-self: end; margin-left: 0; }
.system-state #health-short { display: none; }
.health-dot { width: 9px; height: 9px; border-radius: 50%; background: #f5a524; box-shadow: 0 3px 14px rgba(245, 165, 36, .32); }
.health-dot.ok { background: var(--green); box-shadow: 0 3px 14px rgba(48, 164, 108, .38); }
.health-dot.error { background: var(--danger); }
.model-state { padding-right: 28px; border-right: 1px solid var(--line); color: var(--muted); font-size: 13px; letter-spacing: .02em; }
.session-area { justify-self: end; min-width: 0; display: flex; align-items: center; gap: 18px; }
.session-controls { min-width: 0; display: flex; align-items: center; gap: 13px; }
.session-controls[hidden] { display: none; }
.session-identity { min-width: 0; display: grid; justify-items: end; }
.session-identity strong { max-width: 180px; overflow: hidden; color: var(--text); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.session-identity small { color: var(--text-3); font-size: 10px; }
.session-controls button { min-height: 40px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; }
.session-controls button:hover { color: var(--text); border-color: var(--brand-lift); background: rgba(109, 59, 245, .08); }
.session-controls svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.settings-button { width: 40px; height: 40px; display: none; place-items: center; border: 0; color: var(--text-3, #8f8fa6); background: transparent; }
.has-results .settings-button { display: grid; }
.settings-button:hover { color: var(--cyan); }
.settings-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.settings-button svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

main { position: relative; z-index: 3; width: 100%; min-height: 100vh; padding: var(--header-height) clamp(24px, 5vw, 84px) 36px; transition: background-color .35s ease-out; }
.has-results main { background: var(--bg); }
.search-stage { width: min(1180px, 100%); min-height: calc(100vh - var(--header-height)); margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: clamp(42px, 7vh, 78px) 0 96px; }
.search-intro { max-height: 200px; margin-bottom: 30px; text-align: center; }
.section-label { margin: 0 0 15px; color: var(--cyan); font-size: 11px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; }
h1 { margin: 0; font-family: "Sora", sans-serif; font-size: clamp(30px, 2.5vw, 40px); line-height: 1.12; letter-spacing: -.035em; font-weight: 600; text-wrap: balance; }
.search-intro > p:last-child { margin: 15px auto 0; color: var(--muted); font-size: clamp(15px, 1.3vw, 18px); line-height: 1.6; }

.search-workspace { width: min(1115px, 100%); }
.search-form { position: relative; z-index: 2; width: 100%; height: 76px; display: grid; grid-template-columns: 64px minmax(0, 1fr) 44px auto 1px 144px; align-items: center; border: 1px solid rgba(125, 160, 255, .62); border-radius: 16px; background: rgba(14, 14, 21, .97); box-shadow: 0 20px 54px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(244, 244, 250, .05); transition: box-shadow .2s ease-out, border-color .2s ease-out; }
.search-form:focus-within { border-color: var(--focus); box-shadow: 0 24px 64px rgba(0, 0, 0, .44), 0 0 0 3px rgba(109, 59, 245, .16), inset 0 1px 0 rgba(244, 244, 250, .08); }
.search-icon { width: 27px; height: 27px; margin: auto; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; }
.search-form input { min-width: 0; width: 100%; height: 100%; padding: 0 20px 0 0; color: var(--text); caret-color: var(--cyan); background: transparent; border: 0; outline: 0; font-size: clamp(15px, 1.4vw, 18px); }
.search-form input::placeholder { color: var(--text-3); opacity: 1; }
.search-form input::-webkit-search-cancel-button { display: none; appearance: none; }
.image-search-button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 9px; color: var(--muted); background: transparent; transition: color .18s ease-out, background .18s ease-out; }
.image-search-button:hover { color: var(--brand-lift); background: rgba(109, 59, 245, .11); }
.image-search-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.image-search-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.image-search-button:disabled { cursor: wait; opacity: .52; }
.search-shortcut { margin-right: 18px; padding: 5px 8px; border: 1px solid rgba(143, 143, 166, .3); border-radius: 6px; color: var(--text-3); background: rgba(22, 22, 31, .76); font-size: 11px; line-height: 1; white-space: nowrap; }
.search-divider { width: 1px; height: 44px; background: rgba(143, 143, 166, .46); }
.search-button { height: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; color: var(--text); background: linear-gradient(100deg, rgba(109, 59, 245, .2), rgba(46, 91, 255, .12)); font-size: 15px; font-weight: 600; transition: color .18s ease-out, background .18s ease-out; }
.repeat-icon { display: none; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.has-results .repeat-icon { display: block; }
.search-button:hover { color: #ffffff; background: linear-gradient(100deg, rgba(109, 59, 245, .38), rgba(46, 91, 255, .24)); }
.search-button:focus-visible, .example-grid button:focus-visible, .result-action:focus-visible, .feedback-button:focus-visible, .dialog-close:focus-visible, .search-categories button:focus-visible, .option-chips button:focus-visible, .clear-filters:focus-visible, .refine-toggle:focus-visible, .structured-fields input:focus-visible, .login-button:focus-visible, .session-controls button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.search-button:disabled { cursor: wait; color: var(--muted); }
.button-loader { display: none; width: 17px; height: 17px; margin: auto; border: 1.5px solid rgba(168, 186, 193, .35); border-top-color: var(--cyan); border-radius: 50%; animation: spin .75s linear infinite; }
.is-searching .button-label { display: none; }
.is-searching .button-loader { display: block; }

.result-refine-bar { display: none; }
.guided-search { width: calc(100% - 28px); margin: -1px auto 0; overflow: hidden; border: 1px solid rgba(51, 51, 74, .92); border-top-color: rgba(51, 51, 74, .62); border-radius: 0 0 14px 14px; background: rgba(14, 14, 21, .93); box-shadow: 0 24px 54px rgba(0, 0, 0, .24); backdrop-filter: blur(16px); transition: max-height .32s cubic-bezier(.2, .8, .2, 1), opacity .2s ease-out, margin .28s ease-out; }
.guided-heading { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.guided-heading h2 { margin: 0; font-family: "Sora", sans-serif; font-size: 15px; font-weight: 500; }
.guided-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.clear-filters { min-height: 38px; padding: 0 11px; border: 0; border-radius: 8px; color: var(--brand-lift); background: transparent; font-size: 12px; font-weight: 500; white-space: nowrap; }
.clear-filters:hover:not(:disabled) { background: rgba(109, 59, 245, .1); }
.clear-filters:disabled { cursor: default; color: var(--text-3); opacity: .55; }
.search-categories { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0 12px; border-bottom: 1px solid var(--line-soft); }
.search-categories button { position: relative; min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 0 10px; border: 0; color: var(--text-3); background: transparent; font-size: 12px; white-space: nowrap; transition: color .18s ease-out, background .18s ease-out; }
.search-categories button::after { content: ""; position: absolute; right: 12px; bottom: -1px; left: 12px; height: 2px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transform: scaleX(0); transition: transform .2s ease-out; }
.search-categories button:hover { color: var(--text); background: rgba(26, 26, 38, .55); }
.search-categories button[aria-selected="true"] { color: var(--text); background: rgba(109, 59, 245, .08); }
.search-categories button[aria-selected="true"]::after { transform: scaleX(1); }
.search-categories svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.guided-panels { min-height: 176px; }
.guided-panel { padding: 18px 20px 20px; }
.guided-panel[hidden] { display: none; }
.tip-callout { display: grid; grid-template-columns: 24px 1fr; align-items: start; gap: 11px; padding: 10px 13px; border: 1px solid rgba(125, 160, 255, .18); border-radius: 10px; color: var(--muted); background: rgba(46, 91, 255, .06); }
.tip-callout svg { width: 21px; height: 21px; margin-top: 1px; fill: none; stroke: var(--info); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tip-callout p { margin: 0; font-size: 12px; line-height: 1.5; }
.tip-callout strong { margin-right: 6px; color: var(--text); font-weight: 600; }
.example-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.example-grid button { min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid rgba(143, 143, 166, .34); border-radius: 10px; color: #d0d0e0; background: rgba(22, 22, 31, .64); text-align: left; font-size: 12px; line-height: 1.35; transition: border-color .18s ease-out, color .18s ease-out, background .18s ease-out; }
.example-grid button:hover { color: var(--text); border-color: var(--brand-lift); background: rgba(31, 31, 44, .92); }
.example-grid svg { flex: 0 0 auto; width: 17px; height: 17px; fill: none; stroke: var(--brand-lift); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.option-group { margin: 0; padding: 0; border: 0; }
.option-group + .option-group { margin-top: 20px; }
.option-group legend { margin-bottom: 10px; color: var(--muted); font-size: 12px; font-weight: 500; }
.option-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.option-chips button { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid rgba(143, 143, 166, .32); border-radius: 8px; color: var(--muted); background: rgba(22, 22, 31, .7); font-size: 12px; transition: color .18s ease-out, border-color .18s ease-out, background .18s ease-out; }
.option-chips button:hover { color: var(--text); border-color: rgba(167, 139, 255, .68); }
.option-chips button[aria-pressed="true"] { color: var(--text); border-color: var(--brand-lift); background: rgba(109, 59, 245, .16); box-shadow: inset 0 1px 0 rgba(244, 244, 250, .06); }
.color-swatch { width: 12px; height: 12px; border: 1px solid rgba(244, 244, 250, .3); border-radius: 50%; background: var(--swatch); }
.swatch-black { --swatch: #111118; }
.swatch-white { --swatch: #f3f3f0; }
.swatch-gray { --swatch: #8b8e98; }
.swatch-silver { --swatch: #c4c7cf; }
.swatch-blue { --swatch: #3977db; }
.swatch-red { --swatch: #d84b53; }
.swatch-yellow { --swatch: #e1b82d; }
.swatch-green { --swatch: #3d9a68; }
.structured-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.structured-fields label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
.structured-fields input { width: 100%; height: 44px; padding: 0 13px; border: 1px solid rgba(143, 143, 166, .36); border-radius: 8px; outline: 0; color: var(--text); caret-color: var(--brand-lift); background: rgba(8, 8, 14, .72); color-scheme: dark; }
.structured-fields input::placeholder { color: var(--text-3); opacity: 1; }
.structured-fields input:focus { border-color: var(--brand-lift); }
.field-note { margin: 12px 0 0; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.selection-summary { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; border-top: 1px solid var(--line-soft); color: var(--text-3); font-size: 11px; }
.selection-summary #selection-status { color: var(--brand-lift); font-weight: 500; }
.refine-toggle { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid rgba(143, 143, 166, .34); border-radius: 8px; color: var(--text); background: var(--panel); font-size: 12px; }
.refine-toggle:hover { border-color: var(--brand-lift); }
.refine-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.active-filter-count { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; border-radius: 10px; color: #fff; background: var(--brand); font-size: 10px; font-variant-numeric: tabular-nums; }
.active-filter-count[hidden] { display: none; }

.results-section { width: min(1500px, 100%); margin: 0 auto; opacity: 0; transform: translateY(28px); visibility: hidden; transition: opacity .42s .18s ease-out, transform .52s .12s cubic-bezier(.2, .8, .2, 1), visibility 0s .6s; }
.results-heading { min-height: 64px; display: flex; align-items: center; gap: 24px; padding: 0 4px; border-bottom: 1px solid var(--line-soft); }
.match-summary { display: flex; align-items: center; gap: 11px; }
.match-summary svg { width: 26px; height: 26px; fill: none; stroke: var(--brand-lift); stroke-width: 1.35; }
.match-summary h2 { margin: 0; color: var(--brand-lift); font-family: "Sora", sans-serif; font-size: 16px; font-weight: 500; white-space: nowrap; }
.search-meta { margin: 0; padding-left: 24px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 22px 4px 30px; }

.result-card { min-width: 0; overflow: hidden; border: 1px solid rgba(51, 51, 74, .72); border-radius: 12px; background: #0e0e15; transition: border-color .18s ease-out; }
.result-card:focus-within { border-color: rgba(167, 139, 255, .56); }
.result-image { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0e0e15; }
.result-image::after { content: ""; position: absolute; inset: auto 0 0; height: 28%; pointer-events: none; background: linear-gradient(transparent, rgba(8, 8, 14, .42)); }
.result-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.result-rank { position: absolute; top: 0; left: 0; z-index: 2; min-width: 40px; height: 40px; display: grid; place-items: center; color: var(--brand-lift); background: rgba(11, 11, 18, .93); border-right: 1px solid rgba(125, 160, 255, .42); border-bottom: 1px solid rgba(125, 160, 255, .42); border-radius: 0 0 8px 0; font-family: "Sora", sans-serif; font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.result-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--info); }
.result-placeholder svg { width: 52px; height: 52px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.result-content { padding: 10px 12px 12px; }
.score { position: absolute; right: 10px; bottom: 10px; z-index: 2; display: block; padding: 7px 9px; border: 1px solid rgba(167, 139, 255, .32); border-radius: 8px; color: #ffffff; background: rgba(8, 8, 14, .78); backdrop-filter: blur(10px); font-family: "Sora", sans-serif; font-size: 19px; line-height: 1; font-weight: 500; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.result-facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
.result-facts div { min-width: 0; min-height: 32px; display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; }
.result-facts div:nth-child(3) { grid-column: 1 / -1; }
.result-facts dt { display: none; }
.result-facts dd { margin: 0; overflow: hidden; color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.fact-icon { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.match-reasons { min-height: 28px; margin: 8px 0 0; padding: 0; display: flex; gap: 6px; overflow: hidden; list-style: none; }
.match-reasons li { min-width: 0; padding: 5px 7px; overflow: hidden; border: 1px solid rgba(125, 160, 255, .2); border-radius: 7px; color: #c9c9dc; background: rgba(46, 91, 255, .06); font-size: 10px; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.result-action { width: 100%; min-height: 44px; margin-top: 8px; display: flex; align-items: center; justify-content: space-between; padding: 0 11px; border: 1px solid rgba(51, 51, 74, .82); border-radius: 8px; color: var(--brand-lift); background: var(--panel); font-size: 13px; transition: border-color .18s ease-out, background .18s ease-out; }
.result-action:hover { border-color: var(--brand); background: rgba(31, 31, 44, .92); }
.result-action span { display: flex; align-items: center; gap: 8px; }
.result-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.result-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin-top: 8px; }
.result-actions .result-action { margin-top: 0; }
.feedback-actions { display: flex; gap: 5px; }
.feedback-button { width: 40px; min-height: 44px; display: grid; place-items: center; border: 1px solid rgba(51, 51, 74, .82); border-radius: 8px; color: var(--text-3); background: var(--panel); transition: color .18s ease-out, border-color .18s ease-out, background .18s ease-out; }
.feedback-button:hover { color: var(--brand-lift); border-color: rgba(167, 139, 255, .55); }
.feedback-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.feedback-button.is-selected { color: #b9f6d2; border-color: rgba(48, 164, 108, .62); background: rgba(48, 164, 108, .12); }
.feedback-button[data-relevant="false"].is-selected { color: #ffc1c3; border-color: rgba(229, 72, 77, .62); background: rgba(229, 72, 77, .11); }
.feedback-button:disabled { cursor: default; opacity: .66; }

.result-state { grid-column: 1 / -1; min-height: 330px; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); text-align: center; }
.result-state strong { color: var(--text); font-size: 20px; font-weight: 560; }
.result-state p { max-width: 54ch; margin: 0; line-height: 1.6; }
.state-loader { width: 32px; height: 32px; margin-bottom: 8px; border: 1px solid rgba(168, 186, 193, .28); border-top-color: var(--cyan); border-radius: 50%; animation: spin 1s linear infinite; }
.state-action, .results-pagination button { min-height: 44px; padding: 0 16px; border: 1px solid rgba(125, 160, 255, .42); border-radius: 8px; color: var(--brand-lift); background: var(--panel); font-weight: 500; }
.state-action:hover, .results-pagination button:hover { border-color: var(--brand-lift); background: var(--panel-raised); }
.results-pagination { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 14px; margin: -8px 0 22px; }
.results-pagination[hidden] { display: none; }
.results-pagination button[disabled] { cursor: wait; opacity: .58; }
.results-pagination span { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }

.privacy-note { position: absolute; z-index: 3; bottom: 32px; left: 50%; width: max-content; max-width: calc(100% - 28px); margin: 0; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 13px; transform: translateX(-50%); }
.privacy-note svg { width: 22px; height: 22px; fill: none; stroke: var(--brand-lift); stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.has-results .search-stage { width: min(1500px, 100%); min-height: 0; padding: 26px 0 16px; }
.has-results .search-intro { max-height: 0; margin: 0; opacity: 0; transform: translateY(-18px); pointer-events: none; overflow: hidden; }
.has-results .search-workspace { width: 100%; }
.has-results .search-form { width: 100%; height: 64px; grid-template-columns: 64px minmax(0, 1fr) 44px auto 1px 190px; border-color: rgba(51, 51, 74, .96); border-radius: 13px; background: #0e0e15; box-shadow: none; }
.has-results .search-form:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(109, 59, 245, .16); }
.has-results .result-refine-bar { min-height: 54px; display: flex; align-items: center; gap: 14px; padding: 7px 4px 0; }
.has-results .result-refine-bar p { margin: 0; overflow: hidden; color: var(--text-3); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.has-results .guided-search { max-height: 0; margin-top: 0; opacity: 0; visibility: hidden; pointer-events: none; border-color: transparent; box-shadow: none; transition: max-height .32s cubic-bezier(.2, .8, .2, 1), opacity .2s ease-out, margin .28s ease-out, visibility 0s .32s; }
.has-results.refine-open .guided-search { max-height: 520px; margin-top: 8px; opacity: 1; visibility: visible; pointer-events: auto; border-color: rgba(51, 51, 74, .92); box-shadow: 0 20px 48px rgba(0, 0, 0, .22); transition-delay: 0s; }
.has-results .results-section { opacity: 1; transform: none; visibility: visible; transition-delay: .16s, .1s, 0s; }
.has-results .privacy-note { position: static; margin: 32px auto 0; transform: none; }

dialog { width: min(900px, calc(100% - 32px)); max-height: 88vh; padding: 0; color: var(--text); border: 1px solid var(--line); border-radius: 14px; background: #0e0e15; box-shadow: 0 34px 100px rgba(0, 0, 0, .6); }
dialog::backdrop { background: rgba(8, 8, 14, .82); backdrop-filter: blur(8px); }
.dialog-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(125, 160, 255, .42); border-radius: 50%; color: var(--text); background: rgba(14, 14, 21, .94); }
.dialog-close svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.detail-grid { display: grid; grid-template-columns: 1.15fr .85fr; }
.detail-image { min-height: 480px; background: var(--bg-deep); }
.detail-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.detail-info { padding: 42px 34px; overflow: auto; }
.detail-info h2 { margin: 0 0 28px; font-size: 28px; font-weight: 560; }
.detail-info > p { margin: 0 0 9px; color: var(--cyan); font-size: 11px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.detail-info dl { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; }
.detail-info dt { color: var(--text-3); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; }
.detail-info dd { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--text); font-size: 14px; }
.detail-provenance { grid-column: 1 / -1; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.detail-provenance h3 { margin: 0 0 12px; font-family: "Sora", sans-serif; font-size: 13px; font-weight: 500; }
.attribute-list { display: grid; gap: 7px; }
.attribute-row { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(110px, 1fr) auto; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid var(--line-soft); border-radius: 7px; background: rgba(8, 8, 14, .45); font-size: 11px; }
.attribute-row strong { overflow-wrap: anywhere; color: var(--muted); font-weight: 500; }
.attribute-row span { overflow-wrap: anywhere; color: var(--text); }
.attribute-row small { color: var(--brand-lift); font-variant-numeric: tabular-nums; }
.inference-note { margin: 12px 0 0; color: var(--text-3); font-size: 10px; line-height: 1.5; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 40; max-width: 390px; padding: 13px 17px; border-radius: 10px; color: var(--text); background: var(--panel-raised); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .38); font-weight: 650; opacity: 0; visibility: hidden; transform: translateY(calc(100% + 40px)); transition: transform .25s ease-out, opacity .2s ease-out, visibility 0s .25s; }
.toast.show { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 1300px) {
  .result-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .session-identity { display: none; }
  .model-state { display: none; }
  .search-shortcut { display: none; }
  .search-form { grid-template-columns: 58px minmax(0, 1fr) 42px 1px 126px; }
  .has-results .search-form { grid-template-columns: 58px minmax(0, 1fr) 42px 1px 158px; }
  .example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-categories { overflow-x: auto; grid-template-columns: repeat(5, minmax(125px, 1fr)); scrollbar-width: thin; }
}

@media (max-width: 720px) {
  :root { --header-height: 64px; }
  .topbar { padding: 0 16px; }
  .topbar { grid-template-columns: auto 1fr; gap: 10px; }
  .has-results .topbar { grid-template-columns: auto 1fr 40px; }
  .brand-mark { width: 26px; height: 26px; }
  .brand-name { gap: 8px; }
  .brand-name strong { font-size: 18px; }
  .brand-name small { font-size: 11px; }
  .auth-panel { padding: 24px 20px 22px; }
  .auth-brand { margin-bottom: 28px; }
  .session-controls button span { display: none; }
  .session-controls button { width: 40px; padding: 0; justify-content: center; }
  .system-state { justify-self: end; margin-left: 0; font-size: 11px; }
  .system-state #health-text { display: none; }
  .system-state #health-short { display: inline; }
  main { padding-right: 14px; padding-left: 14px; }
  .search-stage { min-height: calc(100svh - var(--header-height)); padding: 36px 0 84px; }
  .search-intro { margin-bottom: 24px; }
  h1 { font-size: 32px; }
  .search-intro > p:last-child { max-width: 32ch; font-size: 15px; }
  .search-form { height: 64px; grid-template-columns: 48px minmax(0, 1fr) 40px 1px 76px; border-radius: 13px; }
  .search-form input { padding-right: 10px; font-size: 15px; }
  .search-icon { width: 23px; height: 23px; }
  .search-button { font-size: 14px; }
  .guided-search { width: calc(100% - 8px); }
  .guided-heading { align-items: flex-start; gap: 8px; padding: 14px; }
  .guided-heading p { max-width: 36ch; }
  .clear-filters { margin-top: -7px; }
  .search-categories { padding: 0 4px; grid-template-columns: repeat(5, minmax(116px, 1fr)); }
  .search-categories button { min-height: 58px; padding: 0 8px; }
  .guided-panels { min-height: 0; }
  .guided-panel { padding: 14px; }
  .tip-callout { grid-template-columns: 21px 1fr; }
  .example-grid { grid-template-columns: 1fr; }
  .structured-fields { grid-template-columns: 1fr; }
  .selection-summary { align-items: flex-start; flex-direction: column; gap: 3px; padding: 10px 14px; }
  .has-results .search-stage { padding: 20px 0 8px; }
  .has-results .search-form { width: 100%; height: 60px; grid-template-columns: 46px minmax(0, 1fr) 40px 1px 72px; }
  .has-results .search-button { font-size: 0; }
  .has-results .repeat-icon { width: 22px; height: 22px; }
  .has-results .result-refine-bar { align-items: flex-start; flex-direction: column; gap: 6px; padding: 9px 2px 2px; }
  .has-results .result-refine-bar p { width: 100%; }
  .has-results.refine-open .guided-search { max-height: 780px; }
  .results-heading { min-height: 66px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 6px; }
  .match-summary h2 { font-size: 15px; }
  .search-meta { padding-left: 43px; border: 0; font-size: 12px; }
  .result-grid { grid-template-columns: 1fr; gap: 14px; padding-top: 18px; }
  .result-action { min-height: 44px; }
  .privacy-note { font-size: 12px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-image { min-height: 280px; }
  .detail-info { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
