/* screens.css — the home screen, a job walk's main screen, settings,
 * Recently Deleted, the items panel and the plan source dialog.
 *
 * Uses the tokens and components of app.css only (light and dark follow
 * from the tokens). Anything drawn over the plan or the map uses a solid
 * surface and a shadow, never a see-through tint: plan lines behind a
 * banner make it unreadable in bright sun.
 */

/* ---- shared --------------------------------------------------------------------- */

.home .list-row .grow > *,
.settings .list-row .grow > *,
.ip-list .list-row .grow > * { display: block; }

.home-loading {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 32px 12px;
}

/* ---- home ------------------------------------------------------------------------ */

.home-topbar .home-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-left: 6px;
  border-radius: 10px; background: rgba(255, 255, 255, 0.16);
}

.home-slot:empty { display: none; }
.home-slot + .home-slot { margin-top: 0; }
.home-slot > .card { margin-bottom: 12px; }

.home-welcome { border-color: var(--brand); }
.home-welcome-head, .home-install-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.home-welcome-head h2, .home-install-head h2 { font-size: 18px; font-weight: 750; }
.home-welcome-ic, .home-install-ic {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand);
}
.home-install-ic { background: var(--accent-tint); color: var(--accent); }
.home-welcome-list { margin: 0 0 14px; padding-left: 20px; color: var(--text-muted); }
.home-welcome-list li { margin: 5px 0; }
.home-welcome-btns { margin-top: 4px; }

.home-install { border-left: 4px solid var(--accent); }
.home-steps { margin: 4px 0 10px; padding-left: 22px; }
.home-steps li { margin: 6px 0; }
.home-inline-ic { display: inline-flex; vertical-align: -3px; color: var(--accent); }

.home-actions { display: grid; gap: 10px; margin: 2px 0 12px; }

.home-storage {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13.5px; color: var(--text-muted);
}
.home-storage:empty { display: none; }
.home-storage-ic { display: inline-flex; color: var(--text-faint); }
.home-storage-text { flex: 1 1 200px; min-width: 0; }
.home-ok { color: var(--ok); }
.home-storage.protected .home-storage-ic { color: var(--ok); }
.home-storage.low { border-color: var(--warn); }
.home-storage-low { flex-basis: 100%; color: var(--warn); font-weight: 650; }

.home-list { margin-top: 4px; }
.home-empty .ic { width: 44px; height: 44px; }

.jw-card {
  display: flex; align-items: stretch;
  margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.jw-main {
  flex: 1 1 auto; min-width: 0;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px; border: 0; background: transparent; color: inherit; text-align: left;
  touch-action: manipulation;
}
.jw-main:active { background: var(--surface-2); }
.jw-cover {
  position: relative; flex: none;
  width: 88px; height: 88px; border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-faint);
}
.jw-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jw-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.jw-name { font-size: 17px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jw-addr { font-size: 14px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jw-meta { font-size: 13px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jw-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; font-size: 13.5px; font-weight: 650; color: var(--text-muted); }
.jw-count { display: inline-flex; align-items: center; gap: 4px; }
.jw-foot { margin-top: 5px; }
.jw-foot .badge { font-size: 12.5px; padding: 3px 9px; }
.jw-more { align-self: flex-start; margin: 6px 4px 0 0; color: var(--text-muted); }

.home-links { margin-top: 18px; }
.home-trash .ic { color: var(--text-muted); }
.home-version { text-align: center; margin: 18px 0 0; }

/* ---- a job walk ------------------------------------------------------------------ */

.pj-topbar { gap: 2px; }
.pj-level-chip {
  flex: none; max-width: 38vw; min-height: 40px; padding: 0 10px 0 12px; gap: 4px;
  font-size: 14px; font-weight: 700;
  background: var(--surface-2); border-color: var(--border);
  touch-action: manipulation;
}
.pj-level-chip:active { background: var(--surface-3); }
.pj-level-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-caret { flex: none; color: var(--text-muted); font-size: 13px; }

.pj-stage {
  position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden;
  background: var(--surface-3);
}
.pj-view, .pj-view-inner { position: absolute; inset: 0; }

.pj-loading {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 24px; background: var(--bg); color: var(--text-muted); text-align: center;
}
.pj-view-err { max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text); }
.pj-view-err .ic { color: var(--warn); }
.pj-view-err .row { margin-top: 8px; flex-wrap: wrap; justify-content: center; }

.pj-overlay { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.pj-overlay > * { pointer-events: auto; }
.pj-stage.picking .pj-overlay { display: none; }

.pj-tl {
  position: absolute; top: 10px; left: max(10px, var(--safe-left));
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  pointer-events: none;
}
.pj-tl > * { pointer-events: auto; }
.pj-chip { min-height: 40px; padding: 0 14px; font-size: 14px; touch-action: manipulation; }
.pj-chip .dot { width: 11px; height: 11px; box-shadow: 0 0 0 3px var(--surface-2); }
.pj-chip:active { background: var(--surface-2); }
.pj-compass-btn { box-shadow: var(--shadow); min-height: 40px; }

.pj-banners {
  position: absolute; top: 60px;
  left: max(10px, var(--safe-left)); right: max(10px, var(--safe-right));
  max-width: 560px;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.pj-banners:empty { display: none; }
.pj-banner {
  pointer-events: auto;
  align-items: center; gap: 8px;
  padding: 6px 4px 6px 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
  font-weight: 600;
}
.pj-banner.warn { background: var(--surface); border-left-color: var(--warn); }
.pj-banner.err { background: var(--surface); border-left-color: var(--danger); }
.pj-banner-ic { display: inline-flex; color: var(--accent); }
.pj-banner.warn .pj-banner-ic { color: var(--warn); }
.pj-banner.err .pj-banner-ic { color: var(--danger); }
.pj-banner-text { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.pj-banner-btn { flex: none; min-height: 40px; }
.pj-banner-x { flex: none; min-width: 40px; height: 40px; color: var(--text-muted); }

.pj-fabs {
  position: absolute; right: max(12px, var(--safe-right)); bottom: 16px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  pointer-events: none;
  transition: bottom 0.18s ease-out;
}
.pj-fabs > * { pointer-events: auto; }
.pj-fab { width: 52px; height: 52px; }
.pj-fab:active { background: var(--surface-2); }
.pj-fab.on:active { background: var(--me); }
.pj-here {
  width: auto; padding: 0 16px 0 12px; gap: 6px;
  border-radius: 26px; font-weight: 750; font-size: 15px;
  background: var(--surface); color: var(--text);
}
.pj-here .ic { color: var(--me); }
.pj-stage.has-preview .pj-fabs { bottom: 140px; }

.pj-preview {
  position: absolute; bottom: 10px;
  left: max(10px, var(--safe-left)); right: max(10px, var(--safe-right));
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: stretch; gap: 4px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: pj-up 0.16s ease-out;
}
@keyframes pj-up { from { transform: translateY(14px); opacity: 0.4; } }
.pj-prev-main {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border: 0; background: transparent; color: inherit; text-align: left;
  border-radius: 16px 0 0 16px;
}
.pj-prev-main:active { background: var(--surface-2); }
.pj-prev-thumb {
  position: relative; flex: none; width: 84px; height: 84px;
  border-radius: 10px; overflow: hidden; background: var(--surface-3);
  display: flex; align-items: center; justify-content: center; color: var(--text-faint);
}
.pj-prev-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pj-prev-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pj-prev-title { display: flex; align-items: center; gap: 6px; font-weight: 750; font-size: 16px; }
.pj-prev-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pj-prev-text {
  font-size: 13.5px; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pj-prev-time { font-size: 12.5px; color: var(--text-faint); }
.pj-prev-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; padding: 4px 8px 10px 0; }
.pj-prev-side .btn { min-height: 40px; }

.pj-bottombar { justify-content: space-around; padding-top: 6px; }
.pj-bottombar .bar-btn { flex: 1 1 0; max-width: 92px; color: var(--text); }
.pj-bar-ic { position: relative; display: inline-flex; }
.pj-count {
  position: absolute; top: -6px; left: 15px;
  min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}
.pj-shutter { flex: none; margin-left: 6px; margin-right: 6px; touch-action: manipulation; }

/* Position details */
.pj-pos-grid { display: grid; grid-template-columns: max-content 1fr; gap: 9px 14px; margin: 4px 0 14px; }
.pj-pos-grid dt { font-size: 13.5px; font-weight: 650; color: var(--text-muted); }
.pj-pos-grid dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.pj-pos-grid dd.good { color: var(--ok); }
.pj-pos-grid dd.fair { color: var(--warn); }
.pj-pos-grid dd.poor { color: var(--danger); }
.pj-pos-extra { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pj-pos-extra:empty { display: none; }
.pj-pos-extra .banner { align-items: center; }
.pj-pos-btns { display: flex; flex-direction: column; gap: 8px; }

/* Levels & plans */
.pj-levels { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.pj-lv { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--surface); }
.pj-lv.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.pj-lv-main {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 0; border: 0; background: transparent; color: inherit; text-align: left; min-height: var(--tap);
}
.pj-lv-thumb {
  position: relative; flex: none; width: 76px; height: 76px; border-radius: 8px; overflow: hidden;
  background: var(--surface-3); color: var(--text-faint);
  display: flex; align-items: center; justify-content: center;
}
.pj-lv-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pj-lv-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pj-lv-name { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 16px; }
.pj-lv-detail { font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.pj-lv-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pj-lv-btns .btn { min-height: 40px; }
.pj-danger-text { color: var(--danger); }
.pj-lv-help { margin: 10px 2px 0; }

@media (max-width: 380px) {
  .pj-here-label { display: none; }
  .pj-here { width: 52px; padding: 0; }
  .pj-level-chip { max-width: 32vw; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .pj-banners { top: 10px; left: 190px; }
  .pj-stage.has-preview .pj-fabs { bottom: 16px; right: calc(max(12px, var(--safe-right)) + 0px); }
  .pj-preview { right: max(80px, calc(var(--safe-right) + 80px)); }
}

/* ---- items panel ----------------------------------------------------------------- */

.ip-sheet { height: 88vh; }
.ip-sheet .sheet-body { flex: 1 1 auto; min-height: 0; padding-top: 0; }
.ip-controls {
  position: sticky; top: 0; z-index: 2;
  display: flex; flex-direction: column; gap: 8px;
  margin: 0 -16px; padding: 4px 16px 10px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.ip-row { display: flex; align-items: center; gap: 8px; }
.ip-row-wrap { flex-wrap: wrap; }
.ip-search { position: relative; flex: 1 1 auto; min-width: 0; display: block; }
.ip-search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); display: inline-flex; pointer-events: none; }
.ip-search-input { padding-left: 38px; }
.ip-viewtoggle { display: flex; flex: none; }
.ip-types { flex: 1 1 auto; }
.ip-types button { flex: 1 1 auto; padding: 7px 10px; }
.ip-levels button { padding: 7px 10px; }
.ip-sort { width: auto; flex: 0 0 auto; min-height: 42px; padding-top: 6px; padding-bottom: 6px; font-size: 15px; }
.ip-chips {
  display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none;
}
.ip-chips::-webkit-scrollbar { display: none; }
.ip-chips .chip { flex: none; min-height: 36px; touch-action: manipulation; }
.ip-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; font-size: 13.5px; color: var(--text-muted); }
.ip-summary:empty { min-height: 10px; }
.ip-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
.ip-tile { display: block; touch-action: manipulation; }
.ip-tile:active { opacity: 0.85; }
.ip-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-faint); }
.ip-tile img { position: relative; z-index: 1; }
.ip-tile .thumb-n, .ip-tile .thumb-kind, .ip-tile .ip-flags { z-index: 2; }
.ip-note-tile {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 4px;
  padding: 26px 8px 8px; text-align: left;
  background: var(--warn-tint); color: var(--text); border: 1px solid var(--warn-tint);
}
.ip-note-tile .ic { color: var(--pin-note); }
.ip-note-text {
  font-size: 12.5px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.ip-flags { position: absolute; right: 5px; top: 5px; display: flex; gap: 3px; }
.ip-flag {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 5px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 11px;
}
.ip-list { margin-bottom: 8px; }
.ip-row-item { align-items: center; }
.ip-list-thumb {
  position: relative; flex: none; width: 60px; height: 60px; border-radius: 8px; overflow: hidden;
  background: var(--surface-3);
}
.ip-list-thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.ip-list .list-row .grow > .ip-list-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ip-list-tags { font-weight: 500; color: var(--text-muted); }
.ip-list .list-row .grow > .ip-list-excerpt {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--text); font-size: 13.5px;
}
.ip-list .list-row .grow > .ip-list-meta { color: var(--text-faint); font-size: 12.5px; }
.ip-flags-list { position: static; flex: none; }
.ip-flags-list .ip-flag { background: var(--surface-2); color: var(--text-muted); }

/* ---- plan source dialog ------------------------------------------------------------ */

.pi-sheet { max-width: 720px; max-height: 92vh; }
.pi-sheet.pi-dragging { outline: 3px dashed var(--accent); outline-offset: -6px; }
.pi-intro { color: var(--text-muted); margin: 0 0 12px; }
.pi-error { margin-bottom: 12px; align-items: center; }
.pi-error .ic { color: var(--danger); }

.pi-options { display: grid; gap: 10px; }
.pi-opt {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 74px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--text); text-align: left;
  touch-action: manipulation;
}
.pi-opt:active { background: var(--surface-2); }
.pi-opt-ic {
  flex: none; width: 50px; height: 50px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand);
}
.pi-opt-map .pi-opt-ic { background: var(--accent-tint); color: var(--accent); }
.pi-opt-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pi-opt-label { font-weight: 750; font-size: 16.5px; }
.pi-opt-detail { font-size: 13.5px; color: var(--text-muted); }

.pi-paste { margin-top: 10px; }
.pi-paste-box {
  display: flex; align-items: center; justify-content: center;
  min-height: 58px; padding: 10px 14px;
  border: 2px dashed var(--border); border-radius: 12px;
  color: var(--text-muted); font-size: 16px; text-align: center;
  caret-color: transparent; outline: none; overflow: hidden;
  -webkit-user-select: text; user-select: text;
}
.pi-paste-box:empty::before { content: attr(data-hint); pointer-events: none; }
.pi-paste-box:focus { border-color: var(--accent); background: var(--accent-tint); }
.pi-paste-box > * { display: none; }
.pi-paste-desk { display: none; margin: 0; text-align: center; }
.pi-drop {
  display: none; align-items: center; justify-content: center; gap: 10px;
  min-height: 74px; margin-top: 10px; padding: 12px;
  border: 2px dashed var(--border); border-radius: 12px;
  color: var(--text-muted); font-weight: 600;
}
.pi-dragging .pi-drop { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .pi-paste-touch { display: none; }
  .pi-paste-desk { display: block; }
  .pi-drop { display: flex; }
}
.pi-later { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

.pi-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pi-page {
  display: flex; flex-direction: column; gap: 6px;
  padding: 6px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); text-align: left;
  touch-action: manipulation;
}
.pi-page:active { background: var(--surface-2); border-color: var(--accent); }
.pi-page-img {
  position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border);
}
.pi-page-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pi-page-ph .spinner { width: 24px; height: 24px; border-width: 3px; }
.pi-page-cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: 13.5px; padding: 0 2px 2px; }
.pi-page-label { color: var(--accent); font-weight: 700; }
.pi-page-size { margin-left: auto; color: var(--text-faint); font-size: 12px; }
.pi-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pi-use { flex: 1 1 200px; max-width: 340px; margin-left: auto; }

.pi-stage {
  display: flex; align-items: center; justify-content: center;
  padding: 10px; border-radius: 12px;
  background: var(--surface-3);
}
.pi-frame { position: relative; background: #fff; box-shadow: var(--shadow); }
.pi-canvas { width: 100%; height: 100%; }
.pi-crop-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.pi-crop-layer.editing { pointer-events: auto; touch-action: none; }
.pi-crop-rect {
  position: absolute;
  border: 2px solid #fff; outline: 1px solid rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 0 9999px rgba(10, 16, 22, 0.5);
  touch-action: none;
}
.pi-crop-layer.editing .pi-crop-rect { cursor: move; }
.pi-h { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: none; touch-action: none; }
.pi-h::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.pi-crop-layer.editing .pi-h { display: block; }
.pi-h-nw { left: 0; top: 0; cursor: nwse-resize; }
.pi-h-n { left: 50%; top: 0; cursor: ns-resize; }
.pi-h-ne { left: 100%; top: 0; cursor: nesw-resize; }
.pi-h-e { left: 100%; top: 50%; cursor: ew-resize; }
.pi-h-se { left: 100%; top: 100%; cursor: nwse-resize; }
.pi-h-s { left: 50%; top: 100%; cursor: ns-resize; }
.pi-h-sw { left: 0; top: 100%; cursor: nesw-resize; }
.pi-h-w { left: 0; top: 50%; cursor: ew-resize; }
.pi-info { margin: 10px 0 8px; text-align: center; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.pi-lowres { margin-bottom: 10px; align-items: center; }
.pi-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pi-tool { min-height: 44px; padding: 0 14px; font-size: 15px; }
.pi-tool.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pi-hint { text-align: center; margin: 8px 0 0; }

/* ---- settings ---------------------------------------------------------------------- */

.st-section .section-title { margin-top: 20px; }
.st-section:first-child .section-title { margin-top: 6px; }
.st-card { padding: 2px 14px; }
.st-card > .btn { margin: 4px 0 12px; }
.st-card > .banner { margin: 8px 0; }
.st-card > .st-help { padding-bottom: 12px; }
.st-field { padding: 12px 0; border-bottom: 1px solid var(--border); }
.st-field:last-child { border-bottom: 0; }
.st-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.st-label { font-weight: 650; font-size: 15px; }
.st-saved { color: var(--ok); font-size: 12.5px; font-weight: 750; opacity: 0; transition: opacity 0.25s; white-space: nowrap; }
.st-saved.on { opacity: 1; }
.st-help { font-size: 13px; color: var(--text-muted); margin: 6px 0 0; }
.st-help.st-bad { color: var(--danger); font-weight: 600; }
.st-switch { padding: 4px 0; }
.st-switch .switch { min-height: var(--tap); }
.st-switch-text { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-switch .st-help { margin-top: 0; padding-bottom: 8px; }
.st-switch .banner { margin: 4px 0 8px; align-items: center; }
.st-seg button { min-height: 40px; padding: 8px 16px; }
.st-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-inline > .input { flex: 1 1 140px; min-width: 0; }
.st-dec { max-width: 160px; }

.st-how { padding: 6px 0 10px; border-top: 1px solid var(--border); }
.st-how > summary {
  display: flex; align-items: center; gap: 8px; min-height: var(--tap);
  font-weight: 650; color: var(--accent); cursor: pointer; list-style: none;
}
.st-how > summary::-webkit-details-marker { display: none; }
.st-how-body p { color: var(--text-muted); font-size: 14px; }

.st-providers { display: flex; flex-direction: column; gap: 8px; }
.st-provider {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  padding: 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); text-align: left;
}
.st-provider.on { border-color: var(--accent); background: var(--accent-tint); }
.st-radio { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--text-faint); }
.st-provider.on .st-radio { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px var(--surface); }
.st-provider-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.st-provider-label { font-weight: 700; }
.st-provider-detail { font-size: 13px; color: var(--text-muted); }
.st-key-row { display: flex; align-items: center; gap: 6px; }
.st-key { flex: 1 1 auto; min-width: 0; font-family: var(--mono); }
.st-eye { flex: none; color: var(--text-muted); }

.st-storage { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; }
.st-storage .banner { align-items: center; }
.st-storage-nums { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline; }
.st-big { font-size: 22px; font-weight: 750; }
.st-meter { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.st-meter-fill { height: 100%; background: var(--accent); border-radius: 5px; }
.st-links { margin-top: 18px; }
.st-about { padding: 12px 0 8px; display: flex; flex-direction: column; gap: 4px; }

/* ---- Recently Deleted -------------------------------------------------------------- */

.tr-empty-btn { margin-right: 6px; color: var(--danger); border-color: var(--danger); }
.tr-intro { margin-bottom: 4px; }
.tr-list { display: flex; flex-direction: column; gap: 10px; }
.tr-row {
  display: flex; gap: 12px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.tr-thumb {
  position: relative; flex: none; width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-faint);
}
.tr-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tr-info { flex: 1 1 auto; min-width: 0; }
.tr-name { font-weight: 750; overflow-wrap: anywhere; }
.tr-tags { font-weight: 500; color: var(--text-muted); }
.tr-sub { font-size: 13.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.tr-when { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }
.tr-warn { color: var(--warn); font-weight: 650; }
.tr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tr-actions .btn { min-height: 40px; }
.tr-erase { color: var(--danger); }
.tr-erase:active { background: var(--brand-tint); }
