/* Поиск билетов на главной (site/_search.py, assets/search.js): форма «Откуда — Куда — Когда — Найти» и чипы, как в приложении (webapp/css/desktop.css .sf*).
   Только токены из tokens.css. Без inline-стилей (CSP). Цели касания ≥ 44 px; от 320 px без горизонтальной прокрутки. */

.ss { padding-top: clamp(8px, 2vw, 20px); }
.ss [hidden] { display: none !important; }
.ss__card { position: relative; padding: clamp(18px, 3vw, 28px); border-radius: var(--r-2xl); background: radial-gradient(120% 90% at 0% 0%, var(--glass-hi), transparent 60%), var(--card);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line); }
.ss__head h2 { margin: 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.12; letter-spacing: -0.015em; }
.ss__head p { margin: 8px 0 0; color: var(--ink-2); font-size: clamp(15px, 1.6vw, 17px); max-width: 60ch; }

.ss__form { position: relative; margin-top: 18px; }
.ss__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr) auto; gap: 10px; align-items: stretch; }

/* поле: рамка и подпись внутри (как .sf__f в приложении) */
.ss__f { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 1px; min-width: 0; min-height: 60px; padding: 8px 14px; border-radius: 16px; scroll-margin-top: 80px;
  background: var(--card-2); box-shadow: inset 0 0 0 1.5px var(--line-2); transition: box-shadow var(--dur-fast) var(--ease); }
@media (hover: hover) { .ss__f:hover { box-shadow: inset 0 0 0 1.5px var(--accent); } }
.ss__f:focus-within { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.ss__l { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.ss__i { display: block; width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; border-radius: 0; background: none; color: var(--ink); font: 700 17px/1.3 var(--font);
  height: 24px; text-overflow: ellipsis; appearance: none; -webkit-appearance: none; }
.ss__i::placeholder { color: var(--ink); font-weight: 600; opacity: 0.62; }
.ss__date { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
.ss__dv { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss__di { flex: none; width: 18px; height: 18px; color: var(--muted); }
.ss__date[aria-expanded="true"] .ss__di { color: var(--accent-text); }
.ss__f--when { cursor: pointer; }
.ss__f--when:has(.ss__date[aria-expanded="true"]) { box-shadow: inset 0 0 0 2px var(--accent); }
.ss__go { min-height: 60px; padding: 0 26px; border-radius: 16px; white-space: nowrap; }
.ss__go svg { width: 20px; height: 20px; }
.ss__go.is-busy { opacity: 0.7; pointer-events: none; }
.ss__go:focus-visible, .ss__wx:focus-visible, .ss__chips .chip:focus-visible, .ss__wc .chip:focus-visible, .ss__date:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* чипы-подсказки: те же, что в приложении */
.ss__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ss .chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--ink); font: 600 15px/1 var(--font); white-space: nowrap; cursor: pointer; transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
@media (hover: hover) { .ss .chip:hover { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); } }
.ss .chip[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent-text); }

/* подсказки городов */
.ss__list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; max-height: 320px; overflow: auto; border-radius: 16px; background: var(--card);
  box-shadow: 0 18px 40px -16px rgba(10, 30, 50, 0.45), inset 0 0 0 1px var(--line-2); min-width: min(320px, 88vw); }
.ss__list li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 12px; cursor: pointer; font-weight: 600; color: var(--ink); }
.ss__list li[aria-selected="true"] { background: var(--accent-soft); }
@media (hover: hover) { .ss__list li:hover { background: var(--accent-soft); } }
.ss__list li small { color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss__list .ss__opt--cc .ss__nm { font-weight: 800; }
.ss__flag { flex: none; width: 24px; text-align: center; font-size: 20px; }
.ss__nm { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss__none { color: var(--muted) !important; cursor: default !important; background: none !important; }
.ss__msg { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; font-weight: 600; font-size: 14px; color: var(--bad); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line-2); }

/* «Когда»: окно под полем (компьютер) и нижний лист (телефон) */
.ss__wp { position: absolute; z-index: 40; left: 0; top: calc(100% + 6px); width: min(380px, calc(100vw - 32px)); padding: 14px; border-radius: 18px; background: var(--card); cursor: default;
  box-shadow: 0 22px 48px -18px rgba(10, 30, 50, 0.5), inset 0 0 0 1px var(--line-2); text-transform: none; letter-spacing: 0; }
.ss__wh { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ss__wh b { font-size: 17px; }
.ss__wx { display: grid; place-items: center; width: 44px; height: 44px; margin: -8px -8px -8px 0; border: 0; border-radius: 12px; background: none; color: var(--muted); font: 600 26px/1 var(--font); cursor: pointer; }
@media (hover: hover) { .ss__wx:hover { color: var(--ink); background: var(--accent-soft); } }
.ss__wc { display: flex; flex-wrap: wrap; gap: 8px; }
.ss__wl { margin: 14px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.ss__wr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: end; }
.ss__wd { display: block; min-width: 0; }
.ss__wd > span { display: block; margin: 0 0 4px 2px; font-size: 12px; font-weight: 700; color: var(--muted); }
.ss__wd input { display: block; width: 100%; min-width: 0; height: 48px; padding: 0 10px; border: 0; border-radius: 12px; background: var(--card-2); box-shadow: inset 0 0 0 1.5px var(--line-2);
  color: var(--ink); font: 600 16px/1 var(--font); outline: none; }
.ss__wd input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.ss__wok { grid-column: 1 / -1; min-height: 48px; }
.ss__werr { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--bad); }
.ss__wbg { position: fixed; z-index: 80; inset: 0; background: rgba(10, 20, 30, 0.45); }
html.ss-lock { overflow: hidden; }

@media (max-width: 1080px) {
  .ss__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ss__go { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .ss__wp { position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 82vh; overflow: auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; }
}
@media (max-width: 560px) {
  .ss__card { border-radius: var(--r-xl); }
  .ss__row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ss__f { min-height: 58px; padding: 7px 12px; border-radius: 14px; }
  .ss__i { font-size: 16px; }                                         /* 16 px: iOS не приближает страницу при фокусе */
  .ss__go { min-height: 56px; border-radius: 14px; }
  .ss__chips { flex-wrap: nowrap; overflow-x: auto; margin: 12px -14px 0; padding: 0 14px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .ss__chips::-webkit-scrollbar { display: none; }
  .ss__chips .chip { flex: none; }
  .ss__list { min-width: 0; max-height: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  .ss__f, .ss .chip { transition: none; }
}
