/* ── app-misc-erd.css — mobile form fixes, ERD context, entities tab, bootstrap wizard ── */
/* Auto-split from app.css 2026-05-27 (Phase J.6). Cascade order preserved by
   the <link> sequence in index.html. Edit the file whose concern matches your
   change; do NOT recreate app.css. See _docs/canonical/coding-conventions.md §0. */

/* ── Mobile / responsive form fixes ─────────────────────────────────────── */

/* Prevent auth buttons from wrapping to separate rows */
.header-actions {
  flex-wrap: nowrap;
}

/* All inputs and selects never overflow their container */
input,
select,
textarea {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Date/time inputs need explicit width on Safari iOS */
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="week"],
input[type="month"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

/* Prevent zoom on tap in iOS (font-size must be ≥ 16px on focus) */
@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
  }

  .details-grid {
    grid-template-columns: 1fr !important;
  }

  .filter-row {
    flex-wrap: wrap;
  }

  .filter-row .filter-select,
  .filter-row input[type="search"],
  .filter-row input[type="text"] {
    width: 100%;
    min-width: 0;
  }

  .app-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .app-header-side {
    width: 100%;
    align-items: flex-start;
  }

  .erd-floating-toolbar {
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    gap: 4px;
    padding: 6px;
  }

  .erd-toolbar-btn {
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.84rem;
  }

  .erd-toolbar-btn-wide {
    min-width: 52px;
  }
}

/* ── ERD right-click context menu ────────────────────────────────────────── */

.erd-context-menu {
  background: var(--panel-bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  min-width: 180px;
  overflow: hidden;
  padding: 4px 0;
}

.erd-ctx-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 8px 16px;
  text-align: left;
  font-size: 0.87rem;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.erd-ctx-item:hover {
  background: var(--panel-alt);
}

.erd-ctx-danger {
  color: var(--danger, #ef4444);
}

.erd-connect-banner {
  background: rgba(37,99,235,.12);
  border: 1.5px solid #2563eb;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: #2563eb;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

/* ── Entities tab ─────────────────────────────────────────────────────────── */

.entity-schema-card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.entity-schema-focus {
  box-shadow: 0 0 0 2px var(--accent);
}

.entity-schema-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-left: 10px;
  margin-bottom: 8px;
}

.entity-schema-rels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  max-width: 240px;
}

/* ── Phase H.2: new-app bootstrap wizard ──────────────────────────────────── */

.bootstrap-wizard .login-title { margin-bottom: 4px; }
.bootstrap-wizard .login-subtitle { margin-bottom: 0; }

.bootstrap-template-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.bootstrap-template-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  cursor: pointer;
  font-size: 0.9rem;
}

.bootstrap-template-card input[type="radio"] {
  grid-row: 1 / span 2;
  width: 16px;
  height: 16px;
  min-height: 0;
}

.bootstrap-template-card.is-active {
  border-color: var(--accent);
  background: rgba(108, 215, 255, 0.07);
}

.bootstrap-template-card.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bootstrap-template-label { font-weight: 600; color: var(--text); }
.bootstrap-template-desc { grid-column: 2; color: var(--muted); font-size: 0.82rem; font-weight: 400; }
