/* Shared selection surfaces: event app, canonical shift preview and UI review. */
:root {
  --rs-ink: #252c45;
  --rs-muted: #606b83;
  --rs-line: #a4aec3;
  --rs-accent: #4f69b8;
  --rs-soft: #edf1fb;
  --rs-surface: #fff;
}
select.rs-native {
  position: absolute !important; width: 1px !important; height: 1px !important;
  min-width: 0 !important; min-height: 0 !important; padding: 0 !important;
  margin: -1px !important; border: 0 !important; overflow: hidden !important;
  clip-path: inset(50%) !important; white-space: nowrap !important;
}
button.rs-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 16px;
  min-width: 0; max-width: 100%; min-height: 44px; margin: 0; padding: 9px 12px;
  border: 1px solid var(--rs-line); border-radius: 8px; background: var(--rs-surface);
  color: var(--rs-ink); font: inherit; font-size: 13px; font-weight: 600; line-height: 1.5;
  text-align: left; cursor: pointer; box-shadow: 0 1px 2px #252c4505;
  transition: border-color 140ms ease-out, background-color 140ms ease-out, box-shadow 140ms ease-out;
}
button.rs-trigger[hidden] { display: none; }
.rs-trigger .rs-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: inherit; color: inherit; }
.rs-trigger .rs-chevron { flex: 0 0 7px; width: 7px; height: 7px; border: solid var(--rs-muted); border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform 140ms ease-out; }
button.rs-trigger:hover:not(:disabled) { border-color: var(--rs-accent); background: #fafbfe; }
button.rs-trigger[aria-expanded="true"] { border-color: var(--rs-accent); box-shadow: 0 0 0 3px #4f69b814; }
.rs-trigger[aria-expanded="true"] .rs-chevron { transform: translateY(2px) rotate(225deg); }
button.rs-trigger:focus-visible { outline: 2px solid var(--rs-accent); outline-offset: 3px; }
button.rs-trigger:disabled { color: #788196; border-color: #d2d8e3; background: #f0f2f7; cursor: not-allowed; box-shadow: none; }
button.rs-trigger[aria-invalid="true"] { border-color: #b04444; }
.field > .rs-trigger, :is(.utility-form,.event-form-grid,.extra-admin-toolbar,.calendar-edit,.decision-time) label > .rs-trigger,
:is(.store-select,.absence-filter,.stacked-field,.qsel) > .rs-trigger { width: 100%; }
.scenario-picker > .rs-trigger { min-width: 200px; }
:is(.help-date-filter,.help-status-filter,.help-category-filter) > .rs-trigger { min-height: 42px; border: 0; background: transparent; padding: 7px 4px; box-shadow: none; }
:is(.help-date-filter,.help-category-filter) > .rs-trigger { min-width: 102px; }
.help-status-filter > .rs-trigger { min-width: 86px; }
.rs-panel, .rs-panel * { box-sizing: border-box; }
.rs-panel {
  position: fixed; inset: auto; z-index: 10000; display: flex; flex-direction: column;
  margin: 0; padding: 0; min-width: 0; overflow: hidden;
  border: 1px solid #c0c8da; border-radius: 10px;
  background: var(--rs-surface); color: var(--rs-ink);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 14px; line-height: 1.5; font-weight: 400; text-align: left;
  box-shadow: 0 12px 32px #252c451f, 0 2px 6px #252c4510;
}
.rs-panel::backdrop { background: transparent; }
.rs-panel .rs-heading { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 8px; }
.rs-panel .rs-title { font-size: 12px; font-weight: 700; color: var(--rs-ink); }
.rs-panel .rs-count { flex: 0 0 auto; font-size: 11px; font-weight: 500; color: var(--rs-muted); font-variant-numeric: tabular-nums; }
.rs-panel .rs-search { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; margin: 0 10px 8px; padding: 0 12px; min-height: 44px; border: 1px solid #b9c4df; border-radius: 6px; background: #f7f8fc; }
.rs-panel .rs-search:focus-within { border-color: var(--rs-accent); box-shadow: 0 0 0 2px #4f69b810; }
.rs-panel input.rs-input { width: 100%; min-width: 0; min-height: 42px; height: auto; margin: 0; padding: 8px 0; border: 0; border-radius: 0; background: transparent; color: var(--rs-ink); font: inherit; font-size: 16px; outline: none; box-shadow: none; }
.rs-panel input.rs-input::placeholder { color: var(--rs-muted); }
.rs-panel input.rs-input:focus-visible { outline: none !important; box-shadow: none !important; }
.rs-search-icon { position: relative; width: 13px; height: 13px; flex: 0 0 13px; border: 1.5px solid var(--rs-muted); border-radius: 50%; }
.rs-search-icon::after { content: ""; position: absolute; width: 5px; height: 1.5px; right: -4px; bottom: -2px; background: var(--rs-muted); transform: rotate(45deg); }
.rs-panel .rs-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding: 4px; scrollbar-width: thin; padding: 0 6px 6px; border-top: 1px solid #edf0f6; }
.rs-panel .rs-group-label { padding: 12px 8px 5px; font-size: 11px; font-weight: 700; color: var(--rs-muted); }
.rs-panel .rs-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 10px 10px; margin-top: 2px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; }
.rs-panel .rs-option-label { min-width: 0; overflow-wrap: anywhere; white-space: pre-line; font-size: 14px; line-height: 1.55; color: inherit; }
.rs-panel .rs-option.is-selected { color: #344f99; font-weight: 700; background: var(--rs-soft); }
.rs-panel .rs-option.is-active { border-color: #879ccb; background: #f1f4fb; }
.rs-panel .rs-option.is-selected.is-active { background: #e8eefb; }
.rs-panel .rs-option[aria-disabled="true"] { color: #858da0; cursor: not-allowed; background: #f7f8fb; }
/* Status meaning is carried by a distinct symbol and its original label as well as color. */
[data-rs-tone="danger"] { --rs-tone: #9c3d4d; --rs-tone-soft: #faecee; }
[data-rs-tone="success"] { --rs-tone: #34765a; --rs-tone-soft: #eaf4ee; }
[data-rs-tone="info"] { --rs-tone: #4269a0; --rs-tone-soft: #eaf1fc; }
[data-rs-tone="warning"] { --rs-tone: #875814; --rs-tone-soft: #fbf3df; }
[data-rs-tone="neutral"] { --rs-tone: #606b83; --rs-tone-soft: #f0f2f7; }
.rs-trigger[data-rs-tone] .rs-value { display: flex; align-items: center; gap: 7px; color: var(--rs-tone); }
.rs-trigger .rs-value-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; font: inherit; color: inherit; }
.rs-trigger .rs-semantic-icon, .rs-panel .rs-semantic-icon { display: inline-flex; flex: 0 0 28px; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; background: var(--rs-tone-soft); color: var(--rs-tone); }
.rs-trigger .rs-semantic-icon { flex-basis: 22px; width: 22px; height: 22px; border-radius: 5px; }
.rs-semantic-icon svg { display: block; width: 18px; height: 18px; }
.rs-trigger .rs-semantic-icon svg { width: 16px; height: 16px; }
.rs-trigger .rs-option-count, .rs-panel .rs-option-count { flex: 0 0 auto; padding: 2px 6px; border-radius: 5px; background: var(--rs-tone-soft); color: var(--rs-tone); font-size: 11px; font-weight: 700; line-height: 1.6; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rs-panel .rs-option[data-rs-tone] { gap: 10px; min-height: 52px; }
.rs-panel .rs-option[data-rs-tone] .rs-option-label { flex: 1; color: var(--rs-tone); font-weight: 600; }
.rs-panel .rs-option[data-rs-tone].is-selected { background: var(--rs-tone-soft); }
.rs-panel .rs-option[data-rs-tone].is-selected .rs-semantic-icon { background: var(--rs-surface); }
.rs-panel .rs-option[data-rs-request=true] {background:var(--rs-tone-soft)}
.rs-panel .rs-option[data-rs-request=true].is-active {border-color:var(--rs-tone)}
.rs-trigger[data-rs-request=true] {border-color:var(--rs-tone)}
.rs-panel .rs-option[data-rs-tone][aria-disabled="true"] { opacity: .55; }
.rs-panel .rs-check { flex: 0 0 14px; width: 14px; height: 14px; }
.rs-panel .is-selected .rs-check::after { content: ""; display: block; width: 5px; height: 9px; margin: 0 3px; border: solid var(--rs-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.rs-panel .rs-empty { padding: 28px 14px; color: var(--rs-muted); text-align: center; font-size: 13px; }
.rs-panel .rs-footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 8px 12px; border-top: 1px solid #e2e7f1; background: #f8f9fc; }
.rs-panel .rs-selection-count { color: var(--rs-muted); font-size: 12px; }
.rs-panel button.rs-done { min-height: 40px; padding: 8px 16px; border: 0; border-radius: 6px; color: #fff; background: var(--rs-accent); font: inherit; font-weight: 600; cursor: pointer; }
@media (max-width: 700px) {
  button.rs-trigger { min-height: 44px; font-size: 14px; }
  .scenario-picker > .rs-trigger { flex: 1; min-width: 0; }
  .rs-panel .rs-option { min-height: 48px; }
}
@media (prefers-reduced-motion: no-preference) {
  .rs-panel { animation: rs-reveal 120ms cubic-bezier(.22,1,.36,1); }
  @keyframes rs-reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
}
@media (forced-colors: active) {
  .rs-panel .rs-option.is-active { border-color: Highlight; }
  .rs-panel .is-selected .rs-check::after { border-color: Highlight; }
}

/* Production containers retain their full-width field layout after enhancement. */
#shiftroot :is(.u-admin-filters,.unified-store-filters,.u-crm-month) label > .rs-trigger,
#shiftroot .fs-edit > .rs-trigger,#shiftroot .ad-field > .rs-trigger {width:100%;box-sizing:border-box}
#shiftroot .unified-store-filters label {min-width:0}
#shiftroot .unified-store-filters .rs-trigger {max-width:250px}
#shiftroot .u-crm-actions .rs-trigger {min-width:88px;max-width:120px}
#shiftroot .exrow > .rs-trigger {flex:1;min-width:80px}
#shiftroot .rs-panel input.rs-input {border:0;background:transparent;min-height:42px;font-size:16px;padding:8px 0}
#shiftroot .rs-panel {font-size:14px}
@media(max-width:820px){
 #shiftroot .unified-store-filters .rs-trigger {max-width:none}
 #shiftroot .exrow > .rs-trigger {min-width:0}
}
