/* settings-modal.css — generic, reusable tabbed "Settings" modal.
   Not page-specific: any view can spin one up via window.MnSettings.create().
   Styling deliberately borrows the same CSS variables as the other .mn-modal
   dialogs so it feels native wherever it's dropped in. */

.mn-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;                 /* above the .mn-modal stack (120) */
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.mn-settings-overlay.hidden { display: none !important; }

.mn-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.mn-settings-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 1.2rem));
  max-height: calc(100vh - 6.5rem);
  margin: 4.5rem auto 2rem;
  border-radius: var(--radius-panel);
  border: 1px solid var(--panel-border);
  background: var(--topbar-bg);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.mn-settings-panel-wide {
  width: min(980px, calc(100vw - 1.2rem));
}

/* ===== Header ===== */
.mn-settings-head {
  flex: 0 0 auto;               /* fixed chrome: never shrink when a pane is tall */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 0.9rem 0.6rem;
}

.mn-settings-title {
  font-family: var(--font-header);
  font-weight: 900;
  letter-spacing: 0.02em;
  font-size: 1.15rem;
}

/* ===== Tabs ===== */
.mn-settings-tabs {
  flex: 0 0 auto;               /* fixed chrome: overflow-x:auto gives min-height:0,
                                   so without this the flex column collapses the tab
                                   strip when a pane's content is very tall */
  display: flex;
  gap: 0.25rem;
  padding: 0 0.9rem;
  border-bottom: 1px solid var(--divider);
  overflow-x: auto;
  scrollbar-width: none;
}
.mn-settings-tabs::-webkit-scrollbar { display: none; }

.mn-settings-tab {
  position: relative;
  flex: 0 0 auto;
  padding: 0.6rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-header);
  font-weight: 700;
  letter-spacing: 0.01em;
  opacity: 0.65;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;           /* overlap the tablist bottom border */
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.mn-settings-tab:hover { opacity: 0.9; }

.mn-settings-tab.is-active {
  opacity: 1;
  border-bottom-color: var(--color-accent, currentColor);
}

.mn-settings-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent-soft) 40%, transparent);
  border-radius: calc(var(--radius-panel) - 4px);
}

/* ===== Body / panes ===== */
.mn-settings-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 0.9rem;
  min-height: 160px;
}

.mn-settings-pane { display: none; }
.mn-settings-pane.is-active { display: block; }

/* Placeholder shown for the (currently) blank tabs. */
.mn-settings-pane-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  text-align: center;
  opacity: 0.55;
  font-size: 0.95rem;
}

/* ===== Footer ===== */
.mn-settings-foot {
  flex: 0 0 auto;               /* fixed chrome: never shrink when a pane is tall */
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-top: 1px solid var(--divider);
}

@media (max-width: 560px) {
  .mn-settings-panel { margin-top: 3rem; }
}
