/* Projects, new project, settings, setup, login, error. Shared parts live in style.css. */

/* Projects list ---------------------------------------------------------- */
.project-list .tracklist-head, .project-row { grid-template-columns: minmax(0, 1fr) minmax(150px, 1.3fr) 96px 112px; }
.project-row { min-height: 72px; }
.project-row .figure { font-size: var(--fs-3); }

/* Settings and new project ----------------------------------------------- */
.narrow-panel { max-width: 520px; padding-top: 0; border-top: 0; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.settings-help { margin: 10px 0 0; }
.settings-actions > form { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.rotate-details > summary { list-style: none; }
.rotate-details > summary::-webkit-details-marker { display: none; }
.rotate-details[open] > summary { background: var(--surface-2); }
.rotate-details form { max-width: 44ch; margin-top: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.rotate-details form p { margin: 0; }
.panel .code-scroll { margin-bottom: 12px; border-radius: var(--radius); }
.danger-zone h2 { color: var(--red-text); }
.panel .copybox + .copybox { margin-top: -6px; }
/* Setup steps: the heading and its Copy/Download actions share one line, so
   the button is found where the step is read, not below a long block. */
.step-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 20px 0 8px; }
.step-head .snippet-title { margin: 0; }
.step-actions { display: flex; align-items: center; gap: 8px; }
.snippet-title { margin: 20px 0 8px; font-size: var(--fs-3); font-weight: 600; }
.step-help { margin: -2px 0 8px; }
/* Long code scrolls in place (about 24 lines) instead of pushing the rest
   of the page down; Copy and Download still take all of it. */
.code-scroll.is-tall { max-height: 28rem; overflow: auto; border: 1px solid var(--border); }
.code-scroll.is-tall pre.code { border: 0; border-radius: 0; overflow: visible; }
.code-scroll.is-tall:focus-visible { outline-offset: 2px; }

/* Row lists: teams, members, invites, users ------------------------------ */
.rows { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--border); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
a.row-title { color: var(--text); }
.row-meta { flex: none; color: var(--muted); font-size: var(--fs-1); }
.row-meta .count-hot { font-family: var(--mono); }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; flex: none; }
.inline-form { display: flex; align-items: center; gap: 6px; }
.inline-form select { min-height: 34px; padding-block: 4px; }
/* An inline confirmation: the summary is the button, the form opens below. */
.row-confirm > summary { list-style: none; }
.row-confirm > summary::-webkit-details-marker { display: none; }
.row-confirm[open] { flex-basis: 100%; order: 9; }
.row-confirm[open] > summary { background: var(--surface-2); }
.row-confirm form { max-width: 44ch; margin-top: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.row-confirm form p { margin: 0; }
.team-group { margin: 28px 0 10px; font-size: var(--fs-3); }
.team-group:first-of-type { margin-top: 8px; }
.invite-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; max-width: 760px; margin-top: 14px; }
.invite-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.invite-form label:first-of-type { flex: 1 1 280px; }
.invite-help { margin: 8px 0 0; }
.row > .pill { align-self: flex-start; }
.auth-note { margin-top: 18px; }
.owner-note { margin: 24px 0 0; }
.test-email-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }

/* Webhooks --------------------------------------------------------------- */
.webhook-list { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--border); }
.webhook { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.webhook-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.webhook-url { overflow-wrap: anywhere; }
.webhook-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.webhook-empty { margin: 12px 0 0; padding: 12px 14px; border: 1px dashed var(--rule); border-radius: var(--radius); color: var(--muted); }
.webhook-form { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; max-width: 640px; margin-top: 20px; }
.webhook-form > label { align-self: stretch; display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.webhook-triggers { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; border: 0; }
.webhook-triggers legend { width: 100%; margin-bottom: 8px; padding: 0; font-weight: 500; }
.delete-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; max-width: 640px; }
.delete-form label { flex: 1 1 260px; display: flex; flex-direction: column; gap: 6px; font-weight: 500; }

/* Auth ------------------------------------------------------------------- */
.auth-shell main { display: flex; justify-content: center; padding-top: 48px; }
.auth-card { width: min(380px, 100%); }
.auth-fox { display: block; width: 120px; margin: 0 0 12px -8px; }
.auth-fox .fox { display: block; width: 100%; height: auto; }
.auth-card h1 { font-size: var(--fs-4); margin-bottom: 4px; }
.auth-card > p { margin-bottom: 20px; }
.auth-card .stack { margin-top: 20px; }
.auth-card .alert { margin: 16px 0 0; }
.auth-submit { align-self: stretch !important; min-height: 44px; }

/* Error ------------------------------------------------------------------ */
.error-card { width: min(460px, 100%); margin: 48px auto; }
.error-fox { display: block; width: 140px; margin: 0 0 14px -8px; }
.error-fox.burrow .fox { display: block; width: 100%; height: auto; }
.error-fox .fox { display: block; width: 100%; height: auto; }

@media (max-width: 1100px) {
  .project-list .tracklist-head, .project-row { grid-template-columns: minmax(0, 1fr) 120px 96px 104px; }
}
@media (max-width: 700px) {
  .project-list .tracklist-head { display: none; }
  .project-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main main" "events seen" "act act"; gap: 6px 14px; padding: 14px 4px; }
  .project-row .track-main { grid-area: main; }
  .project-row .track-events { grid-area: events; text-align: left; }
  .project-row .track-seen { grid-area: seen; }
  .project-row .track-activity { grid-area: act; }
  .project-row .track-events .cell-label { position: static; width: auto; height: auto; clip-path: none; color: var(--muted); }
  .project-row .figure { font-size: var(--fs-2); }
  .settings-actions { flex-direction: column; }
  .delete-form button { width: 100%; }
  .webhook, .row { flex-direction: column; align-items: stretch; }
  .row-actions { justify-content: flex-start; }
  .webhook-actions > form, .webhook-actions button { flex: 1; width: 100%; }
}
