/*! FluxaWay — overlay styles. Generated from fluxaway-ui.css by scripts/split_css.py. */
/* AUTO-GENERATED — do not edit. Edit dist/fluxaway-ui.css and re-run scripts/split_css.py. */
/* ── Toast ─────────────────────────────────────────────── */

.m-toast {
  position: fixed;
  bottom: calc(var(--m-space-4) + var(--m-safe-bottom));
  right: var(--m-space-4);
  left: var(--m-space-4);
  z-index: var(--m-z-toast);
  animation: m-slide-up 240ms cubic-bezier(0.4, 0, 0.2, 1) both;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  gap: var(--m-space-3);
  padding: var(--m-space-4);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  background: var(--m-surface);
  box-shadow: var(--m-shadow-2);
}

@media (min-width: 576px) {
  .m-toast {
    left: auto;
    width: min(420px, calc(100vw - 32px));
  }
}

.m-toast-content {
  display: grid;
  gap: var(--m-space-1);
  min-width: 0;
}

.m-toast-content p {
  margin: 0;
  color: var(--m-text-muted);
  line-height: 1.45;
}

.m-toast-action { align-self: center; }

.m-toast-success { border-color: #75e0a7; }
.m-toast-warning { border-color: #fdb022; }
.m-toast-danger  { border-color: #fda29b; }

/* ── Dialog ────────────────────────────────────────────── */

.m-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--m-z-dialog);
  display: grid;
  place-items: end center;
  padding: 0;
  background: rgb(15 23 42 / 0.48);
  animation: m-fade-in 200ms ease both;
}

@media (min-width: 576px) {
  .m-dialog-backdrop {
    place-items: center;
    padding: var(--m-space-5);
  }
}

.m-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  max-height: calc(100dvh - var(--m-safe-top) - 24px);
  overflow: hidden;
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-xl) var(--m-radius-xl) 0 0;
  background: var(--m-surface);
  box-shadow: var(--m-shadow-3);
  animation: m-sheet-in 280ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@media (min-width: 576px) {
  .m-dialog { animation-name: m-scale-in; animation-duration: 200ms; }
}

@media (min-width: 576px) {
  .m-dialog {
    width: min(560px, 100%);
    max-height: min(720px, calc(100dvh - 40px));
    border-radius: var(--m-radius);
  }
}

.m-dialog-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--m-space-3);
  padding: var(--m-space-4);
  border-bottom: 1px solid var(--m-border);
}

.m-dialog-header h2 {
  margin: 0;
  font-size: var(--m-font-size-lg);
}

.m-dialog-body {
  min-width: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--m-space-4);
}

.m-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--m-space-2);
  justify-content: flex-end;
  padding: var(--m-space-4);
  border-top: 1px solid var(--m-border);
  background: var(--m-surface-muted);
}

/* ── Drawer ────────────────────────────────────────────── */

.m-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--m-z-drawer);
  background: rgb(15 23 42 / 0.48);
  animation: m-fade-in 200ms ease both;
}

.m-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: calc(var(--m-z-drawer) + 1);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--m-border);
  background: var(--m-surface);
  box-shadow: var(--m-shadow-2);
}

.m-drawer-left  {
  left: 0;
  border-radius: 0 var(--m-radius) var(--m-radius) 0;
  animation: m-drawer-in-left 280ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.m-drawer-right {
  right: 0;
  border-radius: var(--m-radius) 0 0 var(--m-radius);
  animation: m-drawer-in-right 280ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.m-drawer-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--m-space-3);
  padding: var(--m-space-4);
  padding-top: calc(var(--m-space-4) + var(--m-safe-top));
  border-bottom: 1px solid var(--m-border);
}

.m-drawer-header h2 {
  margin: 0;
  font-size: var(--m-font-size-lg);
}

.m-drawer-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--m-space-4);
  padding-bottom: calc(var(--m-space-4) + var(--m-safe-bottom));
}

/* ── Dropdown ──────────────────────────────────────────── */

.m-dropdown { position: relative; display: inline-block; }

.m-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  z-index: var(--m-z-dropdown);
  min-width: 180px;
  max-width: calc(100vw - var(--m-space-8));
  margin: 0;
  padding: var(--m-space-1);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  background: var(--m-surface);
  box-shadow: var(--m-shadow-2);
  list-style: none;
  animation: m-slide-up 160ms ease both;
  transform-origin: top center;
}

.m-dropdown-menu-left  { left: 0; }
.m-dropdown-menu-right { right: 0; }

.m-dropdown-button {
  display: flex;
  align-items: center;
  gap: var(--m-space-2);
  width: 100%;
  min-height: 44px;
  padding: var(--m-space-2) var(--m-space-3);
  border: none;
  border-radius: calc(var(--m-radius) - 2px);
  background: transparent;
  color: var(--m-text);
  font-size: var(--m-font-size-sm);
  text-align: left;
  touch-action: manipulation;
}

.m-dropdown-button:hover { background: var(--m-surface-muted); }

.m-dropdown-button:focus-visible {
  outline: 3px solid var(--m-focus);
  outline-offset: 1px;
}

.m-dropdown-button-danger { color: var(--m-danger); }
.m-dropdown-button-danger:hover { background: var(--m-danger-soft); }

.m-dropdown-divider {
  margin: var(--m-space-1) 0;
  border: none;
  border-top: 1px solid var(--m-border);
}

.m-dropdown-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* ── Tooltip ───────────────────────────────────────────── */

.m-tooltip-wrap {
  position: relative;
  display: inline-flex;
}

.m-tooltip-bubble {
  position: absolute;
  z-index: var(--m-z-tooltip);
  padding: 5px 10px;
  border-radius: var(--m-radius-sm);
  background: #1e2a38;
  color: #f1f5f9;
  font-size: var(--m-font-size-xs);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
}

.m-tooltip-wrap:hover .m-tooltip-bubble,
.m-tooltip-wrap:focus-within .m-tooltip-bubble { opacity: 1; }

.m-tooltip-wrap.m-tooltip-dismissed .m-tooltip-bubble { opacity: 0 !important; }

.m-tooltip-top .m-tooltip-bubble    { bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); }
.m-tooltip-bottom .m-tooltip-bubble { top: calc(100% + 6px);    left: 50%; transform: translateX(-50%); }
.m-tooltip-left .m-tooltip-bubble   { right: calc(100% + 6px);  top: 50%;  transform: translateY(-50%); }
.m-tooltip-right .m-tooltip-bubble  { left: calc(100% + 6px);   top: 50%;  transform: translateY(-50%); }

/* ── ContextMenu ───────────────────────────────────────── */

.m-context-menu {
  position: fixed;
  z-index: var(--m-z-dropdown);
  min-width: 160px;
  max-width: 240px;
  margin: 0;
  padding: var(--m-space-1);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  background: var(--m-surface);
  box-shadow: var(--m-shadow-2);
  list-style: none;
  animation: m-scale-in 140ms ease both;
  transform-origin: top left;
}

.m-context-menu-item { list-style: none; }

.m-context-menu-button {
  display: flex;
  align-items: center;
  gap: var(--m-space-2);
  width: 100%;
  min-height: 36px;
  padding: var(--m-space-2) var(--m-space-3);
  border: none;
  border-radius: calc(var(--m-radius) - 2px);
  background: transparent;
  color: var(--m-text);
  font-size: var(--m-font-size-sm);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.m-context-menu-button:hover { background: var(--m-surface-muted); }

.m-context-menu-button:focus-visible {
  outline: 3px solid var(--m-focus);
  outline-offset: 1px;
}

.m-context-menu-button-danger { color: var(--m-danger); }
.m-context-menu-button-danger:hover { background: var(--m-danger-soft); }

.m-context-menu-icon {
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.m-context-menu-divider {
  margin: var(--m-space-1) 0;
  border: none;
  border-top: 1px solid var(--m-border);
}

/* ── ToastStack ────────────────────────────────────────── */

.m-toast-stack {
  position: fixed;
  bottom: calc(var(--m-space-4) + var(--m-safe-bottom));
  right: var(--m-space-4);
  left: var(--m-space-4);
  z-index: var(--m-z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--m-space-2);
  pointer-events: none;
}

.m-toast-stack > * {
  position: static;
  bottom: auto;
  right: auto;
  left: auto;
  pointer-events: auto;
}

@media (min-width: 576px) {
  .m-toast-stack {
    left: auto;
    width: min(420px, calc(100vw - 32px));
  }
}

/* ── Dialog size variants ──────────────────────────────── */

@media (min-width: 576px) {
  .m-dialog-sm   { width: min(400px, 100%); }
  .m-dialog-lg   { width: min(720px, 100%); max-height: min(80dvh, 100%); }
  .m-dialog-xl   { width: min(900px, 100%); max-height: min(85dvh, 100%); }
  .m-dialog-full {
    width: calc(100% - var(--m-space-8));
    max-height: calc(100dvh - var(--m-space-8));
  }
}

/* ── Bottom Sheet ──────────────────────────────────────── */

.m-bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--m-z-drawer);
  background: rgb(15 23 42 / 0.48);
  animation: m-fade-in 200ms ease both;
}

.m-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: calc(var(--m-z-drawer) + 1);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(92dvh - var(--m-safe-top));
  overflow: hidden;
  background: var(--m-surface);
  border-radius: var(--m-radius-xl) var(--m-radius-xl) 0 0;
  box-shadow: var(--m-shadow-3);
  padding-bottom: var(--m-safe-bottom);
  animation: m-sheet-in 320ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.m-bottom-sheet:focus-visible {
  outline: 3px solid var(--m-focus);
  outline-offset: -3px;
}

@media (min-width: 768px) {
  .m-bottom-sheet {
    left: 50%;
    transform: translateX(-50%);
    width: min(560px, 100%);
    border-radius: var(--m-radius-xl);
    bottom: var(--m-space-6);
    animation-name: m-scale-in;
    animation-duration: 220ms;
  }
}

.m-bottom-sheet-handle {
  display: flex;
  justify-content: center;
  padding-top: var(--m-space-3);
  padding-bottom: var(--m-space-2);
  cursor: grab;
}

.m-bottom-sheet-handle::before {
  content: "";
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--m-border);
}

.m-bottom-sheet-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--m-space-3);
  padding: var(--m-space-2) var(--m-space-4) var(--m-space-4);
}

.m-bottom-sheet-header h2 {
  margin: 0;
  font-size: var(--m-font-size-lg);
}

.m-bottom-sheet-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--m-space-4) var(--m-space-4);
}

/* ── Menu ──────────────────────────────────────────────── */

.m-menu { position: relative; display: inline-block; }

.m-menu-list {
  position: absolute;
  top: calc(100% + 4px);
  z-index: var(--m-z-dropdown);
  min-width: 200px;
  max-width: calc(100vw - var(--m-space-8));
  margin: 0;
  padding: var(--m-space-1);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  background: var(--m-surface);
  box-shadow: var(--m-shadow-2);
  list-style: none;
  animation: m-slide-up 160ms ease both;
  transform-origin: top center;
}

.m-menu-list-left  { left: 0; }
.m-menu-list-right { right: 0; }

.m-menu-list-submenu {
  top: calc(var(--m-space-1) * -1);
  left: 100%;
  z-index: calc(var(--m-z-dropdown) + 1);
  margin-left: 2px;
  /* The 3px overlap with the parent list is intentional: this directional
     edge shadow makes the flyout read as a raised plane instead of a layout
     collision, while the regular dropdown shadow preserves elevation. */
  box-shadow:
    -10px 0 18px -12px rgb(0 0 0 / 0.52),
    var(--m-shadow-3);
}

/* Invisible bridge over the 2px visual gap. Because the flyout is a child of
   the item, this keeps pointer travel inside the owning <li>. */
.m-menu-list-submenu::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -8px;
  width: 8px;
}

.m-menu-item { position: relative; }

.m-menu-button {
  display: flex;
  align-items: center;
  gap: var(--m-space-2);
  width: 100%;
  min-height: 44px;
  padding: var(--m-space-2) var(--m-space-3);
  border: none;
  border-radius: calc(var(--m-radius) - 2px);
  background: transparent;
  color: var(--m-text);
  font-size: var(--m-font-size-sm);
  text-align: left;
  touch-action: manipulation;
}

.m-menu-button:hover { background: var(--m-surface-muted); }

.m-menu-button:focus-visible {
  outline: 3px solid var(--m-focus);
  outline-offset: 1px;
}

.m-menu-button-danger { color: var(--m-danger); }
.m-menu-button-danger:hover { background: var(--m-danger-soft); }

.m-menu-button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.m-menu-divider {
  margin: var(--m-space-1) 0;
  border: none;
  border-top: 1px solid var(--m-border);
}

.m-menu-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.m-menu-label { flex: 1; }

.m-menu-caret {
  flex-shrink: 0;
  color: var(--m-text-muted);
}

/* ── Popover ─────────────────────────────────────────────── */

.m-popover {
  position: relative;
  display: inline-block;
}

.m-popover-trigger { display: inline-flex; }

.m-popover-panel {
  position: absolute;
  z-index: var(--m-z-dropdown);
  min-width: 220px;
  max-width: 320px;
  padding: var(--m-space-4);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-lg);
  background: var(--m-surface);
  color: var(--m-text);
  box-shadow: var(--m-shadow-2);
}

.m-popover-bottom { top: calc(100% + 8px); left: 0; }
.m-popover-top    { bottom: calc(100% + 8px); left: 0; }
.m-popover-right  { left: calc(100% + 8px); top: 0; }
.m-popover-left   { right: calc(100% + 8px); top: 0; }

.m-popover-title {
  margin: 0 0 var(--m-space-2);
  font-size: var(--m-font-size-sm);
  font-weight: 700;
}

/* ── CommandPalette ──────────────────────────────────────── */

.m-command-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--m-z-dialog);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh var(--m-space-4) var(--m-space-4);
  background: rgb(15 23 42 / 0.45);
}

.m-command {
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-lg);
  background: var(--m-surface);
  box-shadow: var(--m-shadow-3);
}

.m-command-input {
  width: 100%;
  padding: var(--m-space-4);
  border: none;
  border-bottom: 1px solid var(--m-border);
  background: transparent;
  color: var(--m-text);
  font-size: var(--m-font-size-base);
  outline: none;
}

.m-command-input::placeholder { color: var(--m-text-muted); }

.m-command-list {
  max-height: 320px;
  margin: 0;
  padding: var(--m-space-2);
  overflow-y: auto;
  list-style: none;
}

.m-command-section {
  padding: var(--m-space-2) var(--m-space-3) var(--m-space-1);
  color: var(--m-text-muted);
  font-size: var(--m-font-size-xs);
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.m-command-option {
  display: flex;
  align-items: center;
  gap: var(--m-space-3);
  padding: var(--m-space-2) var(--m-space-3);
  border-radius: var(--m-radius);
  color: var(--m-text);
  font-size: var(--m-font-size-sm);
  cursor: pointer;
}

.m-command-option-active {
  background: var(--m-primary-soft);
  color: var(--m-primary);
}

.m-command-icon {
  display: inline-flex;
  width: 20px;
  flex-shrink: 0;
  justify-content: center;
}

.m-command-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-command-hint {
  margin-inline-start: auto;
  flex-shrink: 0;
  color: var(--m-text-muted);
  font-size: var(--m-font-size-xs);
}

.m-command-empty {
  padding: var(--m-space-4);
  color: var(--m-text-muted);
  font-size: var(--m-font-size-sm);
  text-align: center;
}
