/* keys screens — see design/canvas/Console-Keys.dc.html and design/STYLE.md. Shared components are in /app.css. */
.kp { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.kp .page-head .lede { font-size: 14px; color: var(--muted); }
.kp .page-head .lede code { background: none; padding: 0; color: var(--text-2); }
.kp code { overflow-wrap: anywhere; }

.kp-card { max-width: 880px; padding: 24px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.kp-card h2 { margin: 0; }

/* ----- create ----- */
.kp-form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.kp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kp-f-name { flex: 1 1 220px; }
.kp-f-access { flex: 1.4 1 280px; }
.kp-f-go { flex: 0 0 auto; }
.kp-field input, .kp-field select { width: 100%; }
.kp-field input.invalid { border-color: var(--bad); }
.kp-ghostlbl { font-size: 13px; line-height: 1.5; visibility: hidden; }
.kp-note { margin: 0; font-size: 13px; color: var(--body); max-width: 720px; }

/* ----- just created ----- */
#kp-new { display: contents; } /* no empty flex item (and double gap) when there is no new key */
.kp-new { border-color: var(--warn-line); }
.kp-new-head { display: flex; align-items: flex-start; gap: 12px; }
.kp-new-head > svg { flex: none; margin-top: 2px; color: var(--accent-text); }
.kp-new-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kp-new-head p { margin: 0; font-size: 14px; color: var(--body); }
.kp-new-head b { font-weight: 500; }
.kp-secret-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.kp-secret-row input { flex: 1 1 360px; min-width: 0; min-height: 44px; padding: 0 14px; background: var(--well); font: 14px var(--mono); letter-spacing: 0.01em; }
.kp-copy-key { min-height: 44px; padding: 0 18px; }
.kp-ic { display: inline-flex; }
.kp-try { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kp-try-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); }
.kp-try-head > span { flex: 1 1 auto; min-width: 0; }
.kp-try-head button { gap: 6px; flex: none; }
.kp button.done { color: var(--ok-text); }
.kp button.primary.done { color: var(--accent-ink); }
.kp-new-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; font-size: 13px; color: var(--muted); }

/* ----- code samples ----- */
.kp-code { flex: 1 1 auto; min-width: 0; margin: 0; background: var(--well); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font: 13px/1.6 var(--mono); color: #d6dae0; overflow-x: auto; white-space: pre; }
.kp-try-code { padding: 16px 18px; line-height: 1.75; }
.kp-str { color: #8fd3a8; }
.kp-com { color: var(--faint); }

/* ----- list ----- */
.card.flush.kp-list { max-width: 880px; padding: 20px 0 8px; display: flex; flex-direction: column; gap: 8px; }
.kp-list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 0 24px; }
.kp-list-head h2 { margin: 0; }
.kp-count { font-size: 13px; color: var(--muted); }
.kp-table { min-width: 680px; }
.kp-table caption { caption-side: bottom; text-align: left; padding: 14px 24px 12px; font-size: 13px; color: var(--muted); }
.kp-table th { padding: 10px 12px; }
.kp-table td { padding: 8px 12px; height: 56px; }
.kp-table th:first-child, .kp-table td:first-child { padding-left: 24px; }
.kp-table th:last-child, .kp-table td:last-child { padding-right: 24px; text-align: right; }
.kp-table tbody tr:last-child td { border-bottom: 0; }
.kp-nm-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.kp-nm { font-weight: 600; overflow-wrap: anywhere; }
.kp-scope { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); background: var(--raised); border: 1px solid var(--line-3); border-radius: 999px; padding: 1px 10px; white-space: nowrap; }
.kp-c-key { color: var(--text-2); }
.kp-c-created { color: var(--body); white-space: nowrap; }
.kp-c-used { color: var(--text); white-space: nowrap; }
.kp-c-used.never { color: var(--muted); }
.kp-empty { margin: 8px 24px 16px; border: 1px dashed var(--line-2); border-radius: 10px; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.kp-empty > svg { color: var(--muted); }
.kp-empty p { margin: 0; }
.kp-empty-t { font-weight: 600; }
.kp-empty-d { font-size: 14px; color: var(--body); max-width: 440px; }
.kp-empty code { background: none; padding: 0; }
.kp-empty button { margin-top: 8px; }

/* ----- use it from ----- */
.kp-use-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.kp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kp-chip { min-height: 32px; padding: 0 12px; border-radius: 999px; font: 400 13px var(--mono); color: var(--body); }
.kp-chip[aria-pressed="true"] { background: var(--raised); border-color: var(--accent-text); color: var(--text); font-weight: 500; }
.kp-ex { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
.kp-ex-copy { flex: none; width: 44px; padding: 0; min-height: 0; }
.kp-hint { margin: 0; font-size: 13px; color: var(--muted); }

/* ----- phones: keys as stacked rows ----- */
@media (max-width: 640px) {
  .kp-card { padding: 20px 16px; }
  .kp-list-head { padding: 0 16px; }
  .kp-f-go, .kp-f-go button { width: 100%; }
  .kp-ghostlbl { display: none; }
  .kp-copy-key { flex: 1 1 auto; }
  .kp-chip { min-height: 44px; }
  .kp button:not(.kp-ex-copy), .kp-field input, .kp-field select { min-height: 44px; }
  .kp-empty { margin: 8px 16px 16px; }
  .kp-table { min-width: 0; }
  .kp-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .kp-table { display: flex; flex-direction: column; }
  .kp-table caption { display: block; order: 2; padding: 12px 16px; }
  .kp-table tbody, .kp-table tr, .kp-table td { display: block; }
  .kp-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .kp-table tbody tr:last-child { border-bottom: 0; }
  .kp-table td, .kp-table td:first-child, .kp-table td:last-child { padding: 0; height: auto; border: 0; text-align: left; }
  .kp-table .kp-c-name { grid-column: 1; grid-row: 1; }
  .kp-table .kp-c-act { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
  .kp-table .kp-c-key, .kp-table .kp-c-created, .kp-table .kp-c-used { grid-column: 1; font-size: 13px; }
  .kp-table td[data-label]::before { content: attr(data-label) " · "; color: var(--muted); font-family: var(--sans); }
}

/* the AI-agent prompt is prose: wrap it instead of scrolling sideways */
.kp-code.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
