/* ============================================================
   page-summary.css
   Role-based AI page summarizer — FAB + modal component
   Depends on: global.css (design tokens), Google Fonts already loaded
   ============================================================ */

/* ── FAB ── */
.lp-summary-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 28px;
  padding: 11px 20px 11px 16px;
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(12,31,61,.35);
  z-index: 900;
  transition: transform .15s, background .15s;--amber:#f59e0b;}
.lp-summary-fab:hover { background: var(--navy-mid); transform: translateY(-2px);--amber:#f59e0b;}
.lp-summary-fab svg { flex-shrink: 0; }

/* ── Backdrop ── */
.lp-summary-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12,31,61,.5);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.lp-summary-backdrop.open { opacity: 1; pointer-events: all; }

/* ── Modal ── */
.lp-summary-modal {
  background: var(--white);
  border: 1px solid var(--warm-200);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(12px);
  transition: transform .2s;
}
.lp-summary-backdrop.open .lp-summary-modal { transform: translateY(0); }

.lp-summary-head {
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--warm-100);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.lp-summary-head-text h2 {
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink-900);
  margin-bottom: 4px;
}
.lp-summary-head-text p {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-600);
}
.lp-summary-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-400);
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
  line-height: 1;
  font-size: 18px;
  transition: color .15s, background .15s;
}
.lp-summary-close:hover { color: var(--ink-900); background: var(--warm-50); }

.lp-summary-body { padding: 20px 24px 24px; }

/* ── Step label ── */
.lp-summary-step {
  font-family: var(--f-label);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 10px;
  display: block;
}

/* ── Track row ── */
.lp-track-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.lp-track-btn {
  background: var(--warm-50);
  border: 1.5px solid var(--warm-100);
  border-radius: 10px;
  padding: 12px 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.lp-track-btn:hover { background: var(--white); border-color: var(--warm-300); }
.lp-track-btn.selected { border-color: var(--navy); background: #f0f4fa; }
.lp-track-icon { display: block; font-size: 18px; margin-bottom: 6px; line-height: 1; }
.lp-track-title { display: block; font-size: 12px; font-weight: 500; color: var(--ink-900); margin-bottom: 2px; }
.lp-track-sub { display: block; font-size: 10px; font-weight: 300; color: var(--ink-500); line-height: 1.35; }

/* ── Divider ── */
.lp-summary-divider { height: 1px; background: var(--warm-100); margin: 0 0 20px; display: none; }
.lp-summary-divider.visible { display: block; }

/* ── Role chips ── */
.lp-role-chips {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.lp-role-chips.visible { display: grid; }

.lp-role-chip {
  background: var(--warm-50);
  border: 1.5px solid var(--warm-100);
  border-radius: 10px;
  padding: 13px 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.lp-role-chip:hover { background: var(--white); border-color: var(--warm-300); }
.lp-role-chip.selected { border-color: var(--amber); background: #fff8f0; }
.lp-role-chip:last-child:nth-child(odd) { grid-column: 1 / -1; }
.lp-chip-title { display: block; font-size: 13px; font-weight: 500; color: var(--ink-900); margin-bottom: 3px; }
.lp-chip-sub { display: block; font-size: 11px; font-weight: 300; color: var(--ink-500); line-height: 1.4; }

/* ── Result area ── */
.lp-summary-result {
  background: var(--warm-50);
  border: 1px solid var(--warm-100);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 16px;
  display: none;
}
.lp-summary-result.visible { display: block; }
.lp-result-overline {
  font-family: var(--f-label);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 10px;
}
.lp-result-text { font-size: 13.5px; font-weight: 300; line-height: 1.65; color: var(--ink-700); }
.lp-result-text p { margin-bottom: .55em; }
.lp-result-text p:last-child { margin-bottom: 0; }
.lp-result-text ul { margin: .45em 0 .55em 0; padding: 0; list-style: none; }
.lp-result-text li { padding-left: 14px; position: relative; margin-bottom: .35em; font-size: 13.5px; font-weight: 300; line-height: 1.55; color: var(--ink-700); }
.lp-result-text li::before { content: ''; position: absolute; left: 0; top: .55em; width: 4px; height: 4px; border-radius: 50%; background: var(--amber); }
.lp-result-text li:last-child { margin-bottom: 0; }

/* ── Go button ── */
.lp-summary-go {
  width: 100%;
  padding: 11px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;--amber:#f59e0b;}
.lp-summary-go:hover:not(:disabled) { background: var(--navy-mid);--amber:#f59e0b;}
.lp-summary-go:disabled { background: var(--warm-100); color: var(--ink-400); cursor: not-allowed; }

/* ── Spinner ── */
.lp-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lp-spin .7s linear infinite;
  display: none;
  flex-shrink: 0;
}
.lp-spinner.active { display: inline-block; }
@keyframes lp-spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 480px) {
  .lp-summary-fab { bottom: 20px; right: 16px; }
  .lp-summary-head { padding: 20px 20px 16px; }
  .lp-summary-body { padding: 16px 20px 20px; }
}
