/* Search tool layout only. Every control reuses xagio.com's own classes and values:
   card = .card (wow), engine tabs = .seg (wow-tabs + indigo blob, added by wow.min.js),
   query = .try-form input + .btn-primary (wow gel), switches = .mk-filters label.mk-ver,
   small buttons = .chip, badge = .pill. Values below are copied from those rules
   (html.wow .try-form input, .chip, .card) so selects match the input exactly. */

.xs-tool [hidden] { display: none !important; }
.xs-hero { padding-bottom: 36px !important; }
.xs-wrap { position: relative; z-index: 2; padding-bottom: 96px; }
.xs-tool { max-width: 1000px; margin: 0 auto; padding: 22px; text-align: left; }

.xs-top { display: flex; justify-content: center; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.xs-top::-webkit-scrollbar { display: none; }
.xt-tabs > button { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; font: 600 13px/1 var(--font); color: var(--ink-2); padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.xt-tabs button svg { width: 16px !important; height: 16px !important; flex: none; }
.xs-top .xt-tabs { display: inline-flex !important; flex-wrap: nowrap !important; }

/* query row = homepage "Try it" form */
.xs-q { display: flex; gap: 8px; align-items: center; width: 100%; }
.xs-q input { flex: 1; width: auto !important; min-width: 0; }
.xs-q .btn { flex: none; }

/* selects and location input: same pill as html.wow .try-form input */
.xs-grid { display: grid; grid-template-columns: 1fr 1.7fr 1fr; gap: 12px; margin-top: 16px; }
.xs-grid-3 { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
.xs-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; transition: opacity .2s; }
.xs-field > label { font-size: 13px; font-weight: 600; color: #c9cdf6; padding-left: 4px; }
.xs-field > label em { font-style: normal; font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.xs-field select, .xs-loc input {
  width: 100%; height: 46px; padding: 0 18px; border: 0; border-radius: 999px;
  background: #ffffff0d; color: #fff; font: 500 15px/1 var(--font); outline: none;
  transition: box-shadow .2s, background-color .2s;
}
.xs-field select { -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer;
  background: #ffffff0d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23AAB2C0' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 18px center; }
.xs-field select option { background: var(--card); color: var(--ink); }
.xs-field select:focus, .xs-loc input:focus { box-shadow: 0 0 0 3px #7b7cff47; }
.xs-loc input::placeholder, .xs-q input::placeholder { color: #7b8494; }
.xs-field.is-off, .mk-ver.is-off { opacity: .35; }
.xs-field.is-off *, .mk-ver.is-off * { cursor: not-allowed !important; }

.xs-loc { position: relative; }
.xs-loc > svg { position: absolute; left: 17px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.xs-loc input { padding-left: 42px; padding-right: 40px; }
#sf-loc-clear { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 999px; background: none; color: var(--ink-3); font-size: 18px; cursor: pointer; }
#sf-loc-clear:hover { color: #fff; background: #ffffff14; }

/* suggestions: .nav-dd-menu look (card, 12px radius, shadow-pop, 8px item radius) */
.xs-list { position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--card); border-radius: 12px; box-shadow: var(--shadow-pop); max-height: 320px; overflow-y: auto; transform-origin: top center; transition: opacity .15s cubic-bezier(.23,1,.32,1), transform .15s cubic-bezier(.23,1,.32,1); }
.xs-list.is-enter { opacity: 0; transform: scale(.96) translateY(-4px); }
.xs-list li { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.xs-list li[aria-selected="true"] { background: var(--raised); }
.sf-opt-name { font-size: 14px; font-weight: 500; color: var(--ink); }
.sf-opt-name mark { background: none; color: #a9abff; }
.sf-opt-rest { grid-row: 2; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-opt-type { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.xs-list .sf-empty { display: block; font-size: 14px; color: var(--ink-3); cursor: default; }

/* engine note */
.sf-note-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s cubic-bezier(.23,1,.32,1), margin .3s cubic-bezier(.23,1,.32,1); }
.sf-note-wrap.is-open { grid-template-rows: 1fr; margin-top: 14px; }
.sf-note-wrap > div { overflow: hidden; }
.xs-note { margin: 0; padding: 10px 16px; border-radius: 999px; background: #3a33e833; color: #c9cdf6; font-size: 13.5px; }

/* switches row: mk-filters + mk-ver are xagio's own switch styles */
.xs-toggles { flex-direction: row !important; flex-wrap: wrap; align-items: center; gap: 12px 22px !important; margin-top: 18px; }
.xs-toggles label.mk-ver { margin: 0 !important; align-self: center !important; }
.xs-dim { color: var(--ink-3); font-weight: 400; }
.xs-adv-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.xs-adv-btn .pill { padding: 2px 8px; font-size: 11px; }
.xs-chev { width: 14px; height: 14px; transition: transform .25s cubic-bezier(.23,1,.32,1); }
.xs-adv-btn[aria-pressed="true"] .xs-chev { transform: rotate(180deg); }
.xs-adv { margin-top: 16px; animation: xs-rise .3s cubic-bezier(.23,1,.32,1); }
@keyframes xs-rise { from { opacity: 0; transform: translateY(6px); } }

/* link row */
.xs-out { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding: 6px 6px 6px 18px; border-radius: 999px; background: #ffffff0d; }
.xs-out-l { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #b3b4ff; }
#sf-url { flex: 1; min-width: 0; font: 400 12.5px var(--mono); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sf-url:hover { color: #fff; }
#sf-url.flash { animation: xs-flash .45s; }
@keyframes xs-flash { from { color: #b3b4ff; } }
.xs-copy { flex: none; display: inline-grid; place-items: center; }
.xs-copy > span { grid-area: 1 / 1; transition: opacity .2s, transform .2s, filter .2s; }
.xs-copy .done { opacity: 0; transform: translateY(6px); filter: blur(2px); color: #4ade80; }
.xs-copy.is-done .lbl { opacity: 0; transform: translateY(-6px); filter: blur(2px); }
.xs-copy.is-done .done { opacity: 1; transform: none; filter: none; }

/* recent searches */
.xs-recent { margin-top: 16px; }
.xs-recent-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding: 0 4px; }
.xs-recent-h button { border: 0; background: none; color: var(--ink-3); font: 500 12.5px var(--font); cursor: pointer; }
.xs-recent ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.xs-recent a { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; background: #11151cb3; color: #e4e7f0; font-size: 13px; font-weight: 600; transition: background .2s; }
.xs-recent a:hover { background: var(--raised); }
.sf-r-engine { color: #b3b4ff; font-size: 11px; }
.sf-r-q { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-r-where { color: var(--ink-3); font-weight: 500; }

.shake { animation: xs-shake .4s; }
@keyframes xs-shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* light mode (xagio theme toggle) */
html.light .xs-field > label { color: #45516a; }
html.light .xs-field select, html.light .xs-loc input { background-color: #fff; color: #172033; box-shadow: inset 0 0 0 1px #e8ebf2; }
html.light .xs-field select option { background: #fff; color: #172033; }
html.light .xs-field select:focus, html.light .xs-loc input:focus { box-shadow: 0 0 0 3px #6364f133; }
html.light .xs-out { background: #1018280d; }
html.light .xs-out-l { color: #6364f1; }
html.light .xs-note { color: #2a1fc4; background: #6364f11a; }
html.light .xs-recent a { background: #fff; color: #172033; }
html.light .xt-tabs > button:not(.wow-sel) { color: #3b4660; }

@media (prefers-reduced-motion: reduce) { .xs-tool *, .xs-tool *::before { animation: none !important; transition: none !important; } }

@media (max-width: 860px) {
  .xs-grid { grid-template-columns: 1fr 1fr; }
  .xs-grid .xs-field[data-cap="location"], .xs-grid .xs-field[data-cap="yregion"] { grid-column: 1 / -1; order: -1; }
  .xs-grid-3 { grid-template-columns: 1fr 1fr; }
  .xs-top { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .xs-tool { padding: 14px; }
  /* engine tabs: one row that scrolls sideways, fade hints at more */
  .xs-top { margin: 0 -14px 16px; padding: 0 14px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .xs-top .xt-tabs { display: inline-flex !important; flex-wrap: nowrap !important; width: max-content !important; max-width: none !important; white-space: nowrap; }
  .xt-tabs > button { padding: 8px 12px !important; }
  /* query: stack input over button; flex:1 in a column collapses the input's height, so reset it */
  .xs-q { flex-direction: column; align-items: stretch; }
  .xs-q input { flex: none !important; width: 100% !important; height: 46px !important; min-width: 0 !important; }
  .xs-q .btn { width: 100%; }
  .xs-hero .x-lede { margin-bottom: 0; }
  .xs-grid, .xs-grid-3 { grid-template-columns: 1fr; }
  .xs-adv-btn { margin-left: 0; }
  .xs-out { flex-wrap: wrap; border-radius: 16px; padding: 12px; }
  #sf-url { flex-basis: 100%; order: 3; }
  .xs-copy { flex: 1; }
}

/* wow.min.js draws a white "ink" copy of the tabs over the blob; keep its spacing identical
   to the real tabs so the selected label never looks doubled */
.xt-tabs button { gap: 8px !important; }
.xt-tabs .wow-ink button { gap: 8px !important; }
@media (max-width: 560px) { .xt-tabs .wow-ink button { padding: 8px 12px !important; } }
