/* The icon picker (COMMAND-1004, public/icon-picker): an icon field's button, and the popup with every icon and a search
   box, above any other popup (the record form under it: z-index 21). Loaded by index.html after app.css, so it uses the
   app's colours. No design yet: the POC marker (poc-ui). */

/* The field: the icon and its name on one button the size of an input. */
.icon-picker-field { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.icon-picker-field:disabled { cursor: not-allowed; opacity: 0.6; }
.icon-picker-field-empty .icon-picker-field-name { color: var(--muted); }
.icon-picker-field-icon { display: inline-flex; flex: none; }
.icon-picker-field-icon svg { width: 20px; height: 20px; }

/* The popup: at the bottom on a phone, in the middle on a wide screen. */
.icon-picker-back {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px; background: rgba(0, 0, 0, 0.45);
}
@media (min-width: 900px) { .icon-picker-back { align-items: center; } }
.icon-picker { border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 8px 28px rgb(0 0 0 / 25%); }
.icon-picker .modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.icon-picker h2 { margin: 0; font-size: 1.05rem; }
.icon-picker-close { flex: none; font-size: 1.4rem; line-height: 1; }
.icon-picker-search { width: 100%; margin-bottom: 12px; }

/* The icons: a grid of tiles, each the icon over its name; more columns as the screen gets wider. */
.icon-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.icon-picker-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0;
  padding: 10px 6px; border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--text); font: inherit; cursor: pointer;
}
.icon-picker-item:hover, .icon-picker-item:focus-visible { border-color: var(--accent); }
.icon-picker-current { border-color: var(--accent); background: var(--surface-2, transparent); }
.icon-picker-item-icon { display: inline-flex; }
.icon-picker-item-icon svg { width: 24px; height: 24px; }
.icon-picker-item-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; }
.icon-picker-none { grid-column: 1 / -1; margin: 0; }
