/* The apps: the list dialog, the overlay that shows one app, the rows of the dashboard panel.
   Tokens of home.css only, so both themes follow. */

/* The list. */
.apps-list { border-top: 1px solid var(--line); }
.apps-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.apps-ic { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--sunk); color: var(--muted); }
.apps-main { min-width: 0; }
.apps-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.apps-h b { font-size: .92rem; overflow-wrap: anywhere; }
.apps-line { font-size: .84rem; color: var(--muted); overflow-wrap: anywhere; }
.apps-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* A pinned artifact that is gone, and the word of a device for an app at the machine. */
.apps-gone { font-size: .84rem; color: var(--bad); overflow-wrap: anywhere; }
.apps-note { align-self: center; font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* The form of "+ Add app". */
.apps-form { margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--sunk); max-width: 60ch; }
.apps-form .tab-acts { margin: 10px 0 0; }
.apps-field { display: grid; gap: 3px; margin-top: 8px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.apps-field:first-child { margin-top: 0; }
.apps-field input { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); padding: 7px 9px; font: inherit; font-size: .88rem; font-weight: 400; min-width: 0; width: 100%; box-sizing: border-box; }
.apps-field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.apps-field input[aria-invalid="true"] { border-color: var(--bad); }
.apps-err { margin-top: 3px; font-size: .8rem; color: var(--bad); overflow-wrap: anywhere; }
.apps-help { margin-top: 8px; font-size: .8rem; color: var(--muted); }

/* A row of the dashboard panel: a button, so it takes the look of the text around it. */
.apps-row { width: 100%; text-align: left; font: inherit; color: inherit; }
.apps-row:disabled { opacity: .6; cursor: default; }
a.apps-row { text-decoration: none; }
.apps-row .apps-ic { width: 24px; height: 24px; }

/* The overlay: wide, and as high as the window less the same margin on every side. */
dialog.apps-overlay { width: min(1200px, calc(100vw - 2 * var(--gap))); height: calc(100vh - 2 * var(--gap)); height: calc(100dvh - 2 * var(--gap)); }
.apps-o-title { flex-wrap: wrap; row-gap: 4px; }
.apps-frame { flex: 1 1 auto; min-height: 0; width: 100%; border: 0; background: var(--bg); }
.apps-blocked { display: grid; align-content: center; justify-items: center; gap: 10px; text-align: center; }
.apps-blocked h3 { font-size: 1rem; font-weight: 600; }
.apps-blocked p { max-width: 62ch; font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }
.apps-blocked .tab-acts { margin: 4px 0 0; justify-content: center; }

@media (max-width: 559px) {
  /* The overlay is the whole screen, as every dialog of the page is on a phone. */
  dialog.apps-overlay { inset: 0; width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; margin: 0; }
  .apps-item { grid-template-columns: auto minmax(0, 1fr); }
  .apps-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .apps-form { padding: 10px; }
  /* The address takes a line of its own, so the name and the buttons keep theirs. */
}
