/* file-picker.css — styles for frontend/js/file-picker.js ("Choose from Files"
   picker + its N-button choice dialog).

   Classes, not inline style="" attributes: the strict CSP still allows
   `style-src-attr 'unsafe-inline'` only because of legacy markup, and this
   module must keep working once that exception is dropped. Colours come from
   penna-tokens.css, so light and dark themes both follow the tokens. The
   module also injects this stylesheet itself if a page did not link it.
   Scanned by scripts/check_hardcoded_colors.py (ALWAYS_SCAN). */

/* ── Overlay + card (shared by the picker and the choice dialog) ─────────── */
.fpk-scrim {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  /* Theme-invariant modal scrim (no token for it); same value as project-attach.js. */
  background: rgba(0, 0, 0, .45); /* lint-allow-color */
}
.fpk-scrim[hidden] { display: none; }

.fpk-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: 82vh;
  padding: 22px 24px;
  border-radius: 12px;
  background: var(--paper-hi);
  box-shadow: var(--shadow-lg);
}
.fpk-card--narrow { max-width: 440px; }

.fpk-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate-800);
}
.fpk-sub {
  margin: 4px 0 10px;
  font-size: .8rem;
  color: var(--slate-400);
}

/* ── Picker ──────────────────────────────────────────────────────────────── */
.fpk-search {
  margin-bottom: 10px;
  padding: 7px 10px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  font-size: .84rem;
  background: var(--paper-hi);
  color: var(--slate-700);
}
.fpk-list {
  flex: 1;
  min-height: 60px;
  overflow-y: auto;
}
.fpk-note {
  padding: 16px;
  text-align: center;
  font-size: .85rem;
  color: var(--slate-400);
}
.fpk-note--error { color: var(--danger); }

.fpk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-bottom: 6px;
  padding: 9px 12px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: var(--paper-hi);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.fpk-row-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fpk-row-name {
  font-size: .85rem;
  color: var(--slate-800);
}
.fpk-row-size {
  font-size: .72rem;
  color: var(--slate-400);
  white-space: nowrap;
}
.fpk-tag {
  margin-left: 6px;
  font-size: .64rem;
  white-space: nowrap;
}
.fpk-tag--locked { color: var(--warning); }
.fpk-tag--client { color: var(--accent); }
.fpk-tag--blocked { color: var(--slate-500); }

/* A row the destination cannot take (locked for a public page, too large):
   still listed so the user sees why it is not offered, but not pickable. */
.fpk-row--disabled {
  background: var(--paper-lo);
  cursor: not-allowed;
}
.fpk-row--disabled .fpk-row-name { color: var(--slate-500); }

/* The "Choose from Files" buttons and the chosen-file chip on caller pages
   (portfolio editor, settings, invoice editor). */
.fpk-chosen {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: .78rem;
  color: var(--slate-600);
}
.fpk-chosen[hidden] { display: none; }
.fpk-chosen-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fpk-from-files { margin-top: 6px; }

.fpk-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* ── Choice dialog ───────────────────────────────────────────────────────── */
.fpk-body {
  margin: 8px 0 4px;
  font-size: .86rem;
  line-height: 1.5;
  color: var(--slate-600);
}
