.sel { position: relative; display: inline-flex; }
.sel-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); cursor: pointer; white-space: nowrap; }
.sel-btn:hover { background: var(--surface-2); }
.sel-btn[aria-expanded="true"] { border-color: var(--accent); }
.sel.compact .sel-btn { height: 28px; border-color: transparent; background: transparent; color: var(--muted); }
.sel.compact .sel-btn:hover, .sel.compact .sel-btn[aria-expanded="true"] { color: var(--text); background: var(--surface-2); }
.sel-icon { display: inline-flex; }
.sel-icon:empty { display: none; }
.sel-chev { display: inline-flex; color: var(--faint); transition: transform .15s; }
.sel-chev svg { width: 14px; height: 14px; }
.sel-btn[aria-expanded="true"] .sel-chev { transform: rotate(180deg); }

.sel-list { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; display: none; min-width: max(100%, 160px); max-height: 300px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); outline: none; }
.sel.open .sel-list { display: block; }
.sel-list.up { top: auto; bottom: calc(100% + 6px); }
.sel-list.right { left: auto; right: 0; }
.sel-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.sel-opt:hover, .sel-opt[data-active="true"] { background: var(--surface-2); }
.sel-opt[aria-selected="true"] { color: var(--accent); font-weight: 600; }
.sel-opt .sel-icon { color: var(--muted); }
.sel-opt[aria-selected="true"] .sel-icon { color: inherit; }
.sel-check { margin-left: auto; padding-left: 12px; display: inline-flex; visibility: hidden; }
.sel-opt[aria-selected="true"] .sel-check { visibility: visible; }
.sel-check svg { width: 16px; height: 16px; }

.dp { position: relative; display: block; }
.dp-btn { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 36px 0 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); text-align: left; cursor: pointer; }
.dp-btn:hover { background: var(--surface-2); }
.dp-btn[aria-expanded="true"] { border-color: var(--accent); }
.dp-btn svg { color: var(--muted); }
.dp-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-text.placeholder { color: var(--faint); }
.dp-clear { position: absolute; top: 3px; right: 3px; width: 34px; height: 34px; }
.dp-clear svg { width: 14px; height: 14px; }

.dp-pop { position: absolute; z-index: 70; top: calc(100% + 6px); left: 0; display: none; width: 300px; max-width: calc(100vw - 24px); padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); color: var(--text); }
.dp.open .dp-pop { display: block; }
.dp-pop.up { top: auto; bottom: calc(100% + 6px); }
.dp-pop.right { left: auto; right: 0; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-weight: 600; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { padding: 4px 0; text-align: center; font-size: 12px; color: var(--muted); }
.dp-day { height: 36px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--text); font-variant-numeric: tabular-nums; cursor: pointer; }
.dp-day:hover { background: var(--surface-2); }
.dp-day.out { color: var(--faint); }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.dp-day[aria-selected="true"] { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.dp-day:disabled { opacity: .35; cursor: not-allowed; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.dp-foot .btn { padding: 4px 10px; }

@media (pointer: coarse) {
  .sel-btn { min-height: 44px; }
  .sel.compact .sel-btn { min-height: 44px; }
  .sel-opt { min-height: 44px; }
  .dp-btn { height: 44px; }
  .dp-day { height: 40px; }
}
@media (max-width: 960px) {
  .sel.icon-only-narrow .sel-text { display: none; }
}
