/* Shared form controls. Native customizable selects retain browser semantics. */
html body select:not([multiple]):not([size]:not([size="1"])) {
  --ts-dd-bg: var(--tsu-panel, var(--surface, #fff));
  --ts-dd-ink: var(--tsu-ink, var(--ink, #172033));
  --ts-dd-muted: var(--tsu-muted, var(--muted, #667085));
  --ts-dd-line: var(--tsu-border, var(--line, #d8dee8));
  --ts-dd-brand: var(--tsu-brand, var(--brand, #3157d5));
  --ts-dd-hover: color-mix(in srgb, var(--ts-dd-brand) 9%, var(--ts-dd-bg));
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--ts-dd-line);
  border-radius: 8px;
  padding: 10px 12px;
  background-color: var(--ts-dd-bg);
  color: var(--ts-dd-ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 22px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: border-color .15s, box-shadow .15s;
}
html body select:not([multiple]):hover { border-color: var(--ts-dd-brand); }
html body select:not([multiple]):focus-visible {
  outline: 2px solid var(--ts-dd-brand);
  outline-offset: 2px;
  box-shadow: none;
}
html body select:not([multiple]):disabled { opacity: .55; cursor: not-allowed; }
html body .select-control { padding: 0 10px; }
html body .select-control select:not([multiple]):not([size]:not([size="1"])) { border: 0; background-color: transparent; padding-inline-start: 0; }
html body .tsu-page-picker select:not([multiple]):not([size]:not([size="1"])) { font-size: 13px; }
html body select[data-i18n-select]:not([multiple]):not([size]:not([size="1"])) { background-color: transparent; color: inherit; font-size: 13px; }
html body .theater-season-picker select:not([multiple]):not([size]:not([size="1"])) { --ts-dd-bg: #101a2a; --ts-dd-ink: #fff; --ts-dd-line: #334155; }

@supports (appearance: base-select) {
  html body select:not([multiple]):not([size]:not([size="1"])),
  html body select:not([multiple]):not([size]:not([size="1"]))::picker(select) { appearance: base-select; }
  html body select:not([multiple]):not([size]:not([size="1"])) { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; }
  html body .tsu-page-picker select:not([multiple]):not([size]:not([size="1"])) { justify-content: center; }
  html body select:not([multiple])::picker-icon {
    color: var(--ts-dd-muted);
    width: 14px;
    height: 14px;
    flex: none;
    content: "";
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform .15s;
  }
  html body select:open::picker-icon { transform: rotate(180deg); }
  html body select::picker(select) {
    box-sizing: border-box;
    margin-block: 6px;
    padding: 5px;
    border: 1px solid var(--ts-dd-line);
    border-radius: 10px;
    background: var(--ts-dd-bg);
    color: var(--ts-dd-ink);
    box-shadow: 0 12px 32px #07162b26, 0 2px 6px #07162b0d;
    min-width: anchor-size(width);
    max-width: min(440px, calc(100vw - 24px));
    max-height: min(360px, 55svh);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    font: 500 14px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
    text-align: start;
  }
  html body select:not([multiple]):not([size]:not([size="1"])) option {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 0;
    border-radius: 6px;
    background: var(--ts-dd-bg);
    color: var(--ts-dd-ink);
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
  }
  html body select:not([multiple]):not([size]:not([size="1"])) option:hover, html body select:not([multiple]):not([size]:not([size="1"])) option:focus {
    background: var(--ts-dd-hover);
    outline: none;
  }
  html body select:not([multiple]):not([size]:not([size="1"])) option:checked { background: var(--ts-dd-hover); color: var(--ts-dd-brand); font-weight: 600; }
  html body select:not([multiple]):not([size]:not([size="1"])) option:disabled { color: var(--ts-dd-muted); opacity: .55; cursor: not-allowed; }
  html body select:not([multiple]):not([size]:not([size="1"])) option::checkmark { order: 1; margin-inline-start: auto; color: var(--ts-dd-brand); }
  html body select:not([multiple]):not([size]:not([size="1"])) optgroup { padding: 6px; color: var(--ts-dd-muted); font-size: 12px; }
  html body select[data-i18n-select]::picker(select) { min-width: 230px; }
  html body .tsu-page-picker > svg { display: none; }
  @media(max-width:1100px) {
    html body .ts-public-header__inner > .ts-language-control select:not([multiple]):not([size]:not([size="1"])) { color: transparent; }
    html body .ts-public-header__inner > .ts-language-control select::picker-icon { visibility: hidden; }
  }
  @media(max-width:600px) {
    html body .topbar__tools .ts-language-control select:not([multiple]):not([size]:not([size="1"])) { color: transparent; }
    html body .topbar__tools .ts-language-control select::picker-icon { visibility: hidden; }
  }
}

/* Same menu for browsers which have not implemented base-select yet. */
.ts-select-menu {
  position: fixed; inset: auto; box-sizing: border-box; margin: 0; padding: 5px;
  border: 1px solid var(--ts-dd-line, #d8dee8); border-radius: 10px;
  background: var(--ts-dd-bg, #fff); color: var(--ts-dd-ink, #172033);
  box-shadow: 0 12px 32px #07162b26, 0 2px 6px #07162b0d;
  overflow: auto; overscroll-behavior: contain; scrollbar-width: thin;
  z-index: 2147483647; font: 500 14px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
}
.ts-select-menu [role="option"] {
  display: flex; align-items: center; gap: 12px; min-height: 40px;
  padding: 10px 12px; border-radius: 6px; box-sizing: border-box; cursor: pointer;
}
.ts-select-menu [role="option"].is-active,
.ts-select-menu [role="option"][aria-selected="true"] { background: var(--ts-dd-hover, #edf1fc); }
.ts-select-menu [role="option"][aria-selected="true"] { color: var(--ts-dd-brand, #3157d5); font-weight: 600; }
.ts-select-menu [role="option"][aria-selected="true"]::after { content: "✓"; margin-inline-start: auto; }
.ts-select-menu [role="option"][aria-disabled="true"] { color: var(--ts-dd-muted, #667085); opacity: .55; cursor: not-allowed; }
.ts-select-menu__group { padding: 8px 12px 4px; color: var(--ts-dd-muted); font-size: 12px; }
@media(prefers-reduced-motion:reduce) { html body select { transition: none; } }

html body.dark-mode select:not([multiple]):not([size]:not([size="1"])), html body[data-theme="dark"] select:not([multiple]):not([size]:not([size="1"])) {
  --ts-dd-bg: var(--tsu-panel, var(--surface, #111b2e));
  --ts-dd-ink: var(--tsu-ink, var(--ink, #edf2fc));
  --ts-dd-muted: var(--tsu-muted, var(--muted, #9baac3));
  --ts-dd-line: var(--tsu-border, var(--line, #34435d));
  --ts-dd-brand: var(--tsu-brand, var(--brand, #9baeff));
}
@media (max-width: 600px) {
  html body select:not([multiple]):not([size]:not([size="1"])) { font-size: 16px; }
}
