/* ending-design.css — canonical shell styles for the Ending Design page */

.ed-app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
html.sidebar-collapsed .ed-app { grid-template-columns: 60px minmax(0, 1fr); }

.ed-content {
  max-width: 1500px;
  padding: 40px 64px;
  margin: 0 auto;
  min-width: 0;
}

.hidden { display: none !important; }

/* ─── Wizard step — page-specific second class ───────────────────────────── */

/* Layout and card styles come from .pb-wizard-choices / .pb-wizard-choice
   in premise.css (Foundation 5). Add Ending Design-specific overrides here. */
.ed-wizard {
  /* (empty — inherits .pb-empty-state and .pb-wizard from premise.css) */
}

/* ─── Forms (path-a / path-b) ─────────────────────────────────────────────── */

.ed-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.ed-form-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.ed-form-head svg { flex-shrink: 0; color: var(--violet); }
.ed-form-head h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.ed-form p {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
  margin: 0 0 12px;
}

.ed-form textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  font-family: var(--sans);
  line-height: 1.6;
  resize: vertical;
  min-height: 360px;
  color: var(--ink);
  background: var(--bg);
}
.ed-form textarea:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.12);
}

.ed-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.ed-status { font-size: 12px; color: var(--ink-3); }

/* ─── Suggestion note ─────────────────────────────────────────────────────── */

.ed-suggestion-note {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 13px;
  color: #1e40af;
}

/* ─── Constraint card (dark) ──────────────────────────────────────────────── */

.ed-constraint-card {
  background: var(--ink);
  color: #f3f4f6;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.ed-constraint-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.ed-constraint-card-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c4b5fd;
}

.ed-constraint-card > p {
  font-size: 13px;
  line-height: 1.6;
  color: #e5e7eb;
  margin: 0 0 4px;
}

.ed-constraint-field {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
  margin-top: 12px;
}

.ed-constraint-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-bottom: 4px;
}

.ed-constraint-field p {
  font-size: 13px;
  color: #e5e7eb;
  margin: 4px 0 0;
}

/* ─── Design state ────────────────────────────────────────────────────────── */

.ed-path-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 9999px;
  background: #ede9fe;
  color: #6d28d9;
  margin-bottom: 16px;
}
.ed-path-badge svg { width: 12px; height: 12px; }

.ed-next-strip {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ed-next-strip > div > p:first-child {
  font-size: 13px;
  font-weight: 600;
  color: #4c1d95;
  margin: 0;
}
.ed-next-strip .sub {
  font-size: 11px;
  color: #7c3aed;
  margin-top: 2px;
}

/* ─── Discovered Theme section ────────────────────────────────────────────── */

.ed-theme-section { margin-top: 40px; }

.ed-theme-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ed-theme-section-head h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.ed-theme-hint {
  font-size: 11px;
  color: var(--ink-4);
  margin: 0 0 16px;
}

.ed-theme-statement {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 20px;
}

.ed-theme-statement-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #4338ca;
  background: #e0e7ff;
  padding: 2px 8px;
  border-radius: 9999px;
  margin-bottom: 12px;
}

.ed-theme-statement > p {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 12px;
}

.ed-theme-question { border-top: 1px solid #c7d2fe; padding-top: 12px; }
.ed-theme-question .lbl {
  font-size: 11px;
  font-weight: 600;
  color: #4338ca;
  margin-bottom: 4px;
}
.ed-theme-question p {
  font-size: 13px;
  font-style: italic;
  color: var(--ink-2);
  margin: 0;
}

.ed-theme-patterns { border-top: 1px solid #c7d2fe; padding-top: 12px; margin-top: 12px; }
.ed-theme-patterns .lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.ed-theme-patterns p {
  font-size: 11px;
  color: var(--ink-3);
  margin: 0;
}

.ed-theme-empty {
  font-size: 13px;
  color: var(--ink-4);
  font-style: italic;
}

/* ─── Toast ───────────────────────────────────────────────────────────────── */

.ed-toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 50;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.ed-toast.success { background: #16a34a; }
.ed-toast.error   { background: #dc2626; }

/* topbar reflows instead of clipping the breadcrumb at narrow widths */
.pb-topbar { flex-wrap: wrap; gap: 4px 12px; }
.pb-topbar .crumbs { min-width: 0; }

/* let the shared two-column prose grid and its fields shrink, not overflow */
.ed-content .wb-prose-grid { min-width: 0; }
.ed-content .wb-prose-grid > * { min-width: 0; }

/* NARROW: auto-collapse the sidebar to the existing 60px icon-rail.
   Reuses the html.sidebar-collapsed presentation, applied automatically by
   width so the nav stays visible as icons rather than going off-canvas. */
@media (max-width: 899px) {
  .ed-app { grid-template-columns: 60px minmax(0, 1fr); }

  /* stack the two-column ending prose grid into one column */
  .ed-content .wb-prose-grid { grid-template-columns: 1fr; gap: 18px; }

  .pb-topbar { padding: 12px 20px; }
  .ed-content { padding: 32px 24px; }
}

@media (max-width: 480px) {
  .ed-content { padding: 24px 16px; }
  .pb-topbar { padding: 12px 14px; }
}
