/* Owner: dialogs. Component states and responsive rules live here. See AGENTS.md. */

body.modal-open {
  overflow: hidden;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(380px, calc(100% - 36px));
  padding: 12px 14px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-close-button {
  cursor: pointer;
}

.modal-close-button:hover,
.modal-close-button:focus-visible {
  color: var(--green);
  outline: none;
}

html:root .modal-close-button {
  min-height: 38px;
  border: 1px solid var(--pencil-soft);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  box-shadow: var(--shadow-control);
  font: 700 12px/1.4 'Inter','Noto Sans KR',sans-serif;
  transition: background .12s,border-color .12s;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 8px;
  flex-shrink: 0;
}

html:root .modal-close-button:is(:hover,:focus-visible):not(:disabled) {
  background: color-mix(in srgb,var(--input-bg) 58%,var(--paper-raised));
  border-color: var(--pencil-strong);
  color: var(--text);
}

html:root .modal-close-button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: none;
}

html:root .modal-close-button:disabled {
  opacity: .45;
  background: var(--paper-muted);
  color: var(--ink-subtle);
  box-shadow: none;
}

html:root .modal-close-button svg {
  width: 20px;
  height: 20px;
}

html:root .toast {
  z-index: 10100;
  border: 1px solid var(--green);
  font-size: 13px;
  background: var(--paper-main);
  color: var(--ink-strong);
  border-color: var(--pencil-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-popover);
}

html:root :is(#mastery-modal,#amp-modal,#facility-modal,#playstyle-modal,#build-library-modal,#free-palette-modal,.profile-dialog) :is(button,input,select,textarea,a,[tabindex]):focus-visible {
  outline: 2px solid var(--focus-blue);
  outline-offset: 2px;
}

html:root :is(#mastery-modal,#amp-modal,#facility-modal,#playstyle-modal,#build-library-modal,#free-palette-modal,.profile-dialog) button:disabled {
  opacity: .45;
  box-shadow: none;
}

html:root :is(#mastery-modal,#amp-modal,#facility-modal,#playstyle-modal,#build-library-modal,#free-palette-modal,.profile-dialog) .utility-button.primary:not(:disabled) {
  background: var(--brand-green-dark);
  border-color: var(--brand-green-dark);
  color: #fff;
}
