/* Shared One modal contract. See docs/modal-style.md. Keep module layout local. */
:root {
  --one-dialog-border: #dde5ef;
  --one-dialog-radius: 17px;
  --one-dialog-shadow: 0 20px 80px #1a314735;
  --one-dialog-backdrop: #1c30414a;
  --one-dialog-header-bg: #edf2f8;
  --one-dialog-ink: #263949;
  --one-dialog-muted: #8393a1;
}
.one-dialog {
  width: 580px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--one-dialog-border);
  border-radius: var(--one-dialog-radius);
  background: #fff;
  color: var(--one-dialog-ink);
  box-shadow: var(--one-dialog-shadow);
  overflow: hidden;
  font-family: inherit;
}
.one-dialog--compact { width: 460px; }
.one-dialog--wide { width: 850px; }
.one-dialog[open], .one-dialog > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.one-dialog > form { max-height: inherit; overflow: hidden; margin: 0; }
.one-dialog, .one-dialog * { box-sizing: border-box; }
.one-dialog [hidden] { display: none !important; }
.one-dialog::backdrop {
  background: var(--one-dialog-backdrop);
  backdrop-filter: blur(2px);
}
.one-dialog .one-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 14px 24px;
  background: var(--one-dialog-header-bg);
  border-bottom: 1px solid #e4eaf1;
}
.one-dialog-header > :first-child { min-width: 0; }
.one-dialog .one-dialog-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.one-dialog .one-dialog-body {
  padding: 18px 24px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.one-dialog .one-dialog-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
  padding: 16px 24px;
  border-top: 1px solid #eef1f4;
  background: #fff;
}
.one-dialog label {
  display: block;
  margin: 15px 0 7px;
  font-size: .81rem;
  font-weight: 600;
  line-height: 1.3;
  color: #5c6e7e;
}
.one-dialog :is(input:where(:not([type=checkbox],[type=radio],[type=hidden],[type=color])), select, textarea) {
  width: 100%;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #d8e2ec;
  border-radius: 8px;
  background-color: #f8fafc;
  color: #314456;
  font: inherit;
  font-size: .83rem;
  line-height: 1.5;
  box-shadow: inset 0 1px 2px #263f5204;
}
.one-dialog :is(input:where(:not([type=checkbox],[type=radio],[type=hidden],[type=color],[type=file])), select) { height: 40px; }
.one-dialog textarea { resize: vertical; }
.one-dialog :is(input, textarea)::placeholder { color: #97a4b0; opacity: 1; }
.one-dialog :is(input, select, textarea):focus {
  background-color: #fff;
  border-color: #779ac8;
  outline: 2px solid #dce8f8;
  outline-offset: 0;
}
.one-dialog :is(input, select, textarea):disabled { color: var(--one-dialog-muted); background-color: #f0f3f6; cursor: default; }
.one-dialog input:where([type=checkbox],[type=radio]) { accent-color: #4c78b7; width: 15px; height: 15px; flex-shrink: 0; }
.one-dialog small { color: var(--one-dialog-muted); font-size: .73rem; line-height: 1.6; }
.one-dialog :is(.one-dialog-button, .one-dialog-primary, .one-dialog-danger, .one-dialog-close) {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #314456;
  font: inherit;
  font-size: .84rem;
  font-weight: 400;
  line-height: 1.5;
  text-decoration: none;
  max-width: 100%;
  white-space: normal;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.one-dialog .one-dialog-button:hover { background: #f0f5fa; }
.one-dialog .one-dialog-primary {
  background: var(--bs-primary, #1f65aa);
  color: #fff;
  padding: 10px 20px;
  font-size: .87rem;
  font-weight: 600;
}
.one-dialog .one-dialog-primary:hover { filter: brightness(.96); }
.one-dialog .one-dialog-danger { color: var(--bs-primary, #1f65aa); }
.one-dialog .one-dialog-danger:hover { background: var(--one-accent-soft, #edf4fb); }
.one-dialog .one-dialog-close {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 1rem;
  color: inherit;
}
.one-dialog .one-dialog-close:hover { background: #eaf0f5; }
.one-dialog button:disabled { opacity: .45; cursor: default; }
.one-dialog :is(button, a):focus-visible { outline: 2px solid #668bd1; outline-offset: 2px; }
.one-dialog .one-dialog-error { color: var(--bs-primary, #1f65aa); font-size: .8rem; line-height: 1.5; margin: 12px 0 0; }
.one-dialog .one-dialog-error:empty { display: none; }
.one-dialog-spacer { flex: 1; }
/* Bootstrap table filters use the same content classes and their existing controller. */
.sitix-filter-modal .modal-dialog { max-width: 850px; }
.sitix-filter-modal .modal-content.one-dialog { width: 100%; max-width: 100%; }
.modal-backdrop.show { background: var(--one-dialog-backdrop); opacity: 1; backdrop-filter: blur(2px); }
/* The legacy generator icon picker keeps its existing behavior, using the same surface. */
.tt-backdrop, .tt-backdrop-noclickclose { background: var(--one-dialog-backdrop); backdrop-filter: blur(2px); }
.tt-dialog.one-dialog { display: flex; flex-direction: column; margin: 16px auto; }
.tt-dialog .one-dialog-body { max-height: calc(100dvh - 120px) !important; }
@media (max-width: 600px) {
  .one-dialog .one-dialog-header, .one-dialog .one-dialog-body, .one-dialog .one-dialog-footer { padding-left: 20px; padding-right: 20px; }
  .one-dialog .one-dialog-footer :is(.one-dialog-button, .one-dialog-primary, .one-dialog-danger) { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .one-dialog button { transition: none; }
}
