/* The search engine stays shared; this is the application's own workspace. */
.app-models-search .app-tool-content { display: flex; overflow: hidden; }
.models-search-workspace { display: flex; flex-direction: column; width: 100%; min-width: 0; min-height: 0; background: #fff; }
.models-search-start { flex: 0 0 auto; width: min(100%, 844px); margin: auto; padding: 36px 32px; }
.models-search-welcome { text-align: center; }
.models-search-mark { display: grid; place-items: center; width: 72px; height: 68px; margin: 0 auto 24px; }
.models-search-mark svg { width: 61px; height: 61px; stroke-width: 1.6; }
.models-search-welcome :is(h1, h2) { margin: 0 0 14px; color: var(--app-ink); font: inherit; font-size: 42px; font-weight: 600; line-height: 1.15; letter-spacing: -1.5px; }
.models-search-welcome p { margin: 0 0 32px; color: var(--app-muted); font-size: 18px; line-height: 1.6; }
.models-search-form { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0; padding: 10px; border: 1px solid #d9dee7; border-radius: 17px; background: #fff; box-shadow: 0 5px 20px #17223408; }
.models-search-form:focus-within { border-color: #ffb66b; }
.models-search-form input { flex: 1; width: 100%; min-width: 0; min-height: 49px; padding: 12px 10px; border: 0; outline: 0; background: transparent; color: var(--app-ink); font: inherit; font-size: 16px; line-height: 1.5; }
.models-search-form input::placeholder { color: #9099aa; }
.models-search-form input::-webkit-search-cancel-button { -webkit-appearance: none; }
.models-search-submit, .models-search-clear { display: grid; place-items: center; flex-shrink: 0; width: 49px; height: 49px; padding: 0; border: 0; border-radius: 12px; cursor: pointer; }
.models-search-submit { background: var(--app-orange); --app-icon-ink: #fff; --app-icon-accent: #fff; }
.models-search-submit:hover { background: #ec7900; }
.models-search-clear { width: 36px; height: 36px; background: transparent; --app-icon-ink: #000; --app-icon-accent: #000; }
.models-search-clear:hover { background: var(--app-soft); }
.models-search-clear svg { width: 19px; height: 19px; }
.models-search-suggestions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.models-search-suggestions button { display: flex; align-items: center; gap: 19px; min-height: 82px; padding: 21px 24px; border: 1px solid var(--app-line); border-radius: 12px; background: #fff; color: var(--app-ink); font: inherit; font-size: 15px; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.models-search-suggestions button:hover { background: #fffaf5; border-color: #ffc387; }
.models-search-suggestions svg { width: 30px; height: 30px; flex-shrink: 0; }
.models-search-note { margin: 22px 0 0; color: var(--app-muted); font-size: 12px; line-height: 1.5; text-align: center; }
.models-search-history { max-width: 900px; margin: 14px auto 0; min-width: 0; }
.models-search-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--app-muted); font-size: 12px; }
.models-search-history-heading button { padding: 4px 0 4px 10px; border: 0; background: transparent; color: var(--app-muted); font: inherit; cursor: pointer; }
.models-search-history-heading button:hover { color: var(--app-ink); }
.models-search-history-links { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; padding: 6px 0; }
.models-search-history-links a { flex: 0 0 auto; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--app-line); border-radius: 8px; padding: 7px 11px; color: var(--app-ink); font-size: 13px; text-decoration: none; }
.models-search-history-links a:hover, .models-search-history-links a[aria-current] { border-color: #ffc387; background: #fffaf5; }
.models-search-saved-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.models-search-saved-heading p { margin: 0; color: var(--app-muted); font-size: 13px; }
.models-search-saved-heading button { padding: 8px 12px; border: 1px solid var(--app-line); border-radius: 8px; background: #fff; color: var(--app-ink); font: inherit; font-size: 13px; cursor: pointer; }
.models-search-saved-heading button:hover { border-color: var(--app-orange); }
.models-search-saved-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); align-items: start; gap: 16px; }
.models-search-workspace .models-search-saved-card { width: 100%; min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--app-line); border-radius: 12px; background: #fff; overflow-wrap: anywhere; }
.models-search-saved-card > img { width: 100%; height: 170px; object-fit: contain; background: var(--app-soft); border-radius: 8px; margin-bottom: 14px; }
.models-search-workspace .models-search-saved-card h2 { margin: 0 0 8px; color: var(--app-ink); font: inherit; font-size: 17px; font-weight: 600; line-height: 1.4; }
.models-search-saved-card p { margin: 0 0 12px; font-size: 13px; line-height: 1.6; }
.models-search-saved-card .models-search-saved-host { color: var(--app-muted); font-size: 12px; }
.models-search-saved-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.models-search-saved-actions :is([data-gsc-preview-button], [data-gsc-source-button]) { margin: 0; font-size: 12px; padding: 8px 10px; }
.models-search-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.models-search-feedback p { margin: 12px 0 0; color: var(--app-muted); font-size: 13px; }
.models-search-feedback button { margin-top: 12px; padding: 6px 10px; border: 1px solid var(--app-line); border-radius: 8px; background: #fff; color: var(--app-ink); font: inherit; font-size: 13px; cursor: pointer; }
.models-search-feedback button:hover { border-color: var(--app-orange); }
.models-search-workspace[data-search-state="error"] .models-search-feedback p { color: #a83418; }
.models-search-workspace[data-state="results"] .models-search-start { width: 100%; margin: 0; padding: 20px 32px; border-bottom: 1px solid var(--app-line); }
.models-search-workspace[data-state="results"] :is(.models-search-form, .models-search-feedback) { max-width: 900px; margin-left: auto; margin-right: auto; }
.models-search-workspace[data-state="results"] :is(.models-search-suggestions, .models-search-note) { display: none; }
.models-search-output { flex: 1; min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; padding: 16px 32px 28px; scroll-padding: 16px; outline: 0; }
.models-search-output:focus-visible { outline: 2px solid var(--app-orange); outline-offset: -4px; }
.models-search-noscript { padding: 16px; text-align: center; }
.models-search-output .gsc-control-cse { width: 100%; margin: 0; padding: 0; border: 0; background: transparent; font: inherit; }
.models-search-output .gsc-wrapper { width: 100%; max-width: none; }
.models-search-output .gsc-results, .models-search-output .gsc-results-wrapper-nooverlay { width: 100%; max-width: none; }
/* Image results are the only search mode; no mode switch is needed. */
.models-search-output .gsc-tabsArea { display: none !important; }
.models-search-output .gsc-webResult.gsc-result { margin-bottom: 12px; padding: 18px; border: 1px solid var(--app-line); border-radius: 12px; }
.models-search-output .gsc-imageResult .gs-image { border-radius: 10px; }
.models-search-output .gsc-cursor-box { margin: 24px 0; }
.models-search-output .gsc-cursor-page { display: inline-block; padding: 8px 12px; border-radius: 8px; }
.models-search-output .gsc-cursor-current-page { background: var(--app-soft); }
.models-search-output :is([data-gsc-preview-button], [data-gsc-source-button]) { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 14px; border: 1px solid var(--app-line); border-radius: 9px; font-size: 14px; line-height: 1.5; text-decoration: none; }
.models-search-output [data-gsc-preview-button] { border-color: var(--app-orange); background: var(--app-orange); color: #fff; }
.models-search-output [data-gsc-source-button] { background: #fff; color: var(--app-ink); }
.models-search-output .gs-mobilePreview :is([data-gsc-preview-button], [data-gsc-source-button]) { display: block; width: 100%; margin-left: 0; }
.models-order-dialog { width: min(720px, calc(100% - 40px)); max-width: 720px; max-height: 90vh; max-height: 90dvh; margin: auto; padding: 0; overflow: hidden; border: 1px solid var(--app-line); border-radius: 20px; background: #fff; color: var(--app-ink); box-shadow: 0 24px 80px #17223433; }
.models-order-dialog[open] { display: flex; flex-direction: column; }
.models-order-dialog::backdrop { background: #17223480; backdrop-filter: blur(3px); }
.models-order-header { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--app-line); }
.models-order-header h2 { margin: 0; color: var(--app-ink); font: inherit; font-size: 22px; font-weight: 600; line-height: 1.3; }
.models-order-header button { flex-shrink: 0; }
.models-order-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 20px 24px; }
.models-order-model { margin: 0 0 12px; color: var(--app-muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.models-order-model a { color: var(--app-ink); text-decoration: underline; text-underline-offset: 3px; }
.models-order-feedback p { margin: 8px 0 16px; color: var(--app-muted); font-size: 14px; }
.models-order-feedback button { margin-bottom: 16px; }
#models-order-form { --b24-primary-color: #ff8500; --b24-primary-text-color: #fff; min-height: 0; }
#models-order-form .b24-form-wrapper { min-width: 0; max-width: none; margin: 0; box-shadow: none; }
#models-order-form .b24-form-content { padding: 0; }
#models-order-form .b24-form-btn { background: var(--app-orange); border-radius: 10px; }
#models-order-form .b24-form-btn:hover { background: #ec7900; }
.models-order-footer { flex-shrink: 0; padding: 14px 24px; border-top: 1px solid var(--app-line); }
.models-order-footer a { display: inline-flex; align-items: center; gap: 8px; color: var(--app-muted); font-size: 12px; text-decoration: none; }
.models-order-footer a:hover { color: var(--app-ink); }
.models-order-footer svg { width: 16px; height: 16px; }
.models-source-dialog { width: min(1240px, calc(100% - 40px)); max-width: 1240px; height: min(920px, calc(100dvh - 40px)); max-height: calc(100dvh - 40px); }
.models-source-host { margin: 4px 0 0; color: var(--app-muted); font-size: 12px; overflow-wrap: anywhere; }
.models-source-dialog [data-model-source-close] { --app-icon-ink: #000; --app-icon-accent: #000; }
.models-source-content { flex: 1; min-height: 0; background: #f4f5f7; }
.models-source-content iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.models-source-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; }
.models-source-footer > span { color: var(--app-muted); font-size: 12px; }
.models-source-footer a { color: var(--app-ink); white-space: nowrap; }
@media (max-width: 1000px) {
  .models-search-welcome :is(h1, h2) { font-size: 36px; }
  .models-search-welcome p { font-size: 16px; }
}
@media (max-width: 700px) {
  .models-search-start { padding: 24px 16px; }
  .models-search-mark { width: 58px; height: 54px; margin-bottom: 18px; }
  .models-search-mark svg { width: 49px; height: 49px; }
  .models-search-welcome :is(h1, h2) { font-size: 30px; letter-spacing: -.8px; }
  .models-search-welcome p { max-width: 300px; margin: 0 auto 24px; font-size: 14px; }
  .models-search-form { gap: 4px; padding: 8px; border-radius: 14px; }
  .models-search-form input { min-height: 44px; padding: 10px 4px; }
  .models-search-submit { width: 44px; height: 44px; }
  .models-search-clear { width: 28px; }
  .models-search-suggestions { gap: 9px; margin-top: 20px; }
  .models-search-suggestions button { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 12px; min-height: 88px; font-size: 12px; }
  .models-search-suggestions svg { width: 22px; height: 22px; }
  .models-search-note { font-size: 11px; }
  .models-search-workspace[data-state="results"] .models-search-start { padding: 12px 16px; }
  .models-search-output { padding: 12px 16px 20px; }
  .models-order-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 24px); border-radius: 16px; }
  .models-order-header { padding: 16px; gap: 10px; }
  .models-order-header h2 { font-size: 19px; }
  .models-order-body { padding: 16px; }
  .models-order-footer { padding: 12px 16px; }
  .models-source-dialog { height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); }
}
@media (max-height: 650px) {
  .models-search-workspace[data-state="welcome"] { overflow: auto; }
  .models-search-start { padding-top: 20px; padding-bottom: 20px; }
  .models-search-mark { display: none; }
}
