.dxs {
  position: relative;
  display: block;
  width: 100%;
  max-width: 440px;
}

.modal-card .dxs,
.modal-card .dxd,
.modal-card .dxn,
.modal-card .dxt,
.fgrid .dxs,
.fgrid .dxd,
.fgrid .dxn,
.fgrid .dxt,
.rec-form .dxs,
.rec-form .dxd,
.rec-form .dxn,
.rec-form .dxt {
  max-width: 100%;
}

.input-group > .dxs {
  flex: 0 0 132px;
  width: auto;
  min-width: 0;
  max-width: none;
}

.input-group > .input {
  min-width: 0;
}

.dxs-auto {
  display: inline-block;
  width: auto;
  min-width: 200px;
}

.dxs[hidden],
.dxd[hidden] {
  display: none;
}

.dxs-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  width: 100%;
  min-height: var(--h-control);
  padding: 0 var(--s3) 0 var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-m);
  line-height: 1.3;
  text-align: left;
  outline: none;
  cursor: pointer;
}

.dxs-btn .icon {
  color: var(--muted);
}

.dxs.is-open .dxs-btn .icon {
  transform: rotate(180deg);
}

.dxs-label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
}

.dxs-txt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dxs-flag {
  flex: none;
  width: 24px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

.dxs-label.is-placeholder {
  color: var(--muted);
}

.dxs-btn:hover,
.dxs-btn:focus,
.dxs-btn:focus-visible,
.dxs.is-open .dxs-btn {
  border-color: var(--accent);
  outline: none;
}

.dxs-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dxs-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 60;
  display: none;
  max-height: 320px;
  padding: var(--s1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  background: var(--bg);
  overflow-y: auto;
  animation: dxs-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.dxs.is-open .dxs-list {
  display: block;
}

.dxs.is-up .dxs-list {
  top: auto;
  bottom: calc(100% + 6px);
}

.dxs-auto .dxs-list {
  right: auto;
  min-width: 100%;
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
}

.dxs.is-right .dxs-list {
  right: 0;
  left: auto;
}

.dxs-search {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: var(--s1) var(--s1) var(--s2);
  background: var(--bg);
}

.dxs-group {
  padding: var(--s3) var(--s4) var(--s1);
  color: var(--muted);
  font-size: var(--fs-s);
  font-weight: 700;
}

.dxs-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 44px;
  padding: 0 var(--s4);
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
}

.dxs-opt.is-hover {
  color: var(--text);
}

.dxs-opt.is-selected {
  color: var(--accent);
  font-weight: 600;
}

.dxs-opt.is-selected::after {
  content: "";
  width: 6px;
  height: 11px;
  margin-left: auto;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px);
}

.dxs-opt.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dxd {
  position: relative;
  display: block;
  width: 100%;
  max-width: 260px;
}

.row > .dxd,
.row > .dxs,
.row-between > .dxd,
.row-between > .dxs {
  flex: 0 1 220px;
  width: auto;
  min-width: 160px;
}

.dxd-field {
  position: relative;
}

.dxd-text {
  padding-right: 56px;
}

.btn.dxd-toggle {
  position: absolute;
  top: 2px;
  right: 2px;
  bottom: 2px;
  width: 44px;
  min-width: 44px;
  min-height: 0;
  padding: 0;
}

.dxd-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  display: none;
  width: 320px;
  max-width: calc(100vw - 32px);
  padding: var(--s3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  animation: dxs-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.dxd.is-open .dxd-pop {
  display: block;
}

.dxd.is-right .dxd-pop {
  right: 0;
  left: auto;
}

.dxd.is-up .dxd-pop {
  top: auto;
  bottom: calc(100% + 6px);
}

.dxd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s1);
  margin-bottom: var(--s2);
}

.btn.dxd-nav {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}

.dxd-title {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-m);
  font-weight: 700;
  cursor: pointer;
}

.dxd-title:hover,
.dxd-title:focus-visible {
  color: var(--accent);
  outline: none;
}

.dxd-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.dxd-wd {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  color: var(--muted);
  font-size: var(--fs-s);
  font-weight: 600;
}

.dxd-day {
  min-height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-m);
  cursor: pointer;
}

.dxd-day:hover,
.dxd-day:focus-visible {
  color: var(--accent);
  outline: none;
}

.dxd-day:focus-visible {
  border-color: var(--accent);
}

.dxd-day.is-today {
  border-color: var(--border-strong);
}

.dxd-day.is-selected {
  border-color: transparent;
  background: var(--grad);
  color: var(--on-accent);
}

.dxd-day:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dxd-pick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s1);
}

.dxd-cell {
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: var(--fs-m);
  cursor: pointer;
}

.dxd-cell:hover,
.dxd-cell:focus-visible {
  color: var(--accent);
  outline: none;
}

.dxd-cell.is-selected {
  border-color: var(--accent);
  color: var(--accent);
}

.dxd-foot {
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
  margin-top: var(--s3);
}

.dxt-pop {
  width: 280px;
}

.dxt-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
}

.dxt-title {
  padding: 0 0 var(--s2);
  color: var(--muted);
  font-size: var(--fs-s);
  font-weight: 700;
  text-align: center;
}

.dxt-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  padding-right: 2px;
  overflow-y: auto;
}

.dxn {
  display: grid;
  max-width: 560px;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: center;
  gap: var(--s4);
}

.dxn-range {
  width: 100%;
  min-height: 44px;
  margin: 0;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
}

.dxn-hint {
  color: var(--warn);
}

@keyframes dxs-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dxs-list,
  .dxd-pop {
    animation: none;
  }
}

.icon-field {
  align-items: center;
  gap: var(--s3);
}

.icon-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--accent);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: var(--s1);
  max-height: 320px;
  overflow-y: auto;
}

.icon-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.icon-cell:hover,
.icon-cell:focus-visible {
  color: var(--accent);
  outline: none;
}

.icon-cell.is-active {
  border-color: var(--accent);
  background: var(--surface-2);
  color: var(--accent);
}

.dxi {
  position: relative;
  display: block;
  width: 100%;
}

.dxi > .dxi-ico {
  position: absolute;
  top: 50%;
  left: var(--s4);
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.dxi > .input {
  padding-left: calc(var(--s4) + 20px + var(--s3));
}

.field-code {
  max-width: 360px;
}

.input-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
}
