/* Studio Console additions on top of app.css (the Vocabloot admin's design
   system, kept as is): the App Store Connect style app switcher, app icons,
   the per-app sign-in gate and the boot skeleton. Tokens only, no colours. */

/* App icons: real app icons are 96 px WebP, shown at 28 to 40 px. */
.app-icon { width: 28px; height: 28px; flex: none; border-radius: 7px; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px var(--border); background: var(--hover); }
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-icon-studio { background: var(--primary); color: var(--primary-fg); box-shadow: none; }
.app-icon-studio .icon { width: 15px; height: 15px; }
.app-icon-lg { width: 48px; height: 48px; border-radius: 12px; }
.app-icon-lg.app-icon-studio .icon { width: 22px; height: 22px; }

/* Switcher */
.switcher { position: relative; margin: 0 0 10px; }
.switcher-btn { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.switcher-btn:hover, .switcher-btn[aria-expanded="true"] { background: var(--hover); }
.switcher-btn:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.switcher-text { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.switcher-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-chev { color: var(--muted); }
.sidebar { overflow: visible; display: flex; flex-direction: column; }
#appNav { flex: 1; min-height: 0; overflow-y: auto; }
.switcher-menu { position: absolute; left: 0; width: min(340px, calc(100vw - 24px)); top: calc(100% + 4px); z-index: 30; padding: 6px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
  box-shadow: 0 10px 30px rgb(0 0 0 / .12), var(--shadow); }
:root[data-theme="dark"] .switcher-menu { box-shadow: 0 10px 30px rgb(0 0 0 / .5); }
.switcher-head { font-size: 12px; color: var(--muted); font-weight: 500; padding: 6px 8px 4px; }
.switcher-sep { height: 1px; background: var(--border); margin: 6px 2px; }
.switcher-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 6px; text-decoration: none; }
.switcher-item:hover, .switcher-item:focus-visible { background: var(--hover); outline: none; }
.switcher-item .badge { flex: none; font-size: 11px; line-height: 18px; padding: 0 7px; }

.switcher-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; margin: 2px 2px 6px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--field); color: var(--muted); }
.switcher-search input[type="search"] { border: 0; padding: 0; height: 34px; background: none; box-shadow: none; }
.switcher-search input[type="search"]:focus-visible { outline: none; }
.switcher-search:focus-within { outline: 2px solid var(--fg); outline-offset: 1px; }
.switcher-list { display: grid; gap: 2px; max-height: 320px; overflow-y: auto; }
.switcher-empty { margin: 0; padding: 10px 8px; font-size: 13px; color: var(--muted); }
.switcher-all .switcher-name { font-weight: 500; }
.switcher-item[aria-current]:not([aria-current="false"]) { background: var(--hover); }

/* Sidebar: back to the account level from inside an app */
.sidebar nav a.nav-back { margin-bottom: 4px; }
.nav-back .icon { color: var(--muted); }

/* All apps home */
.home-table td { vertical-align: middle; }
.home-app { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.home-app .app-icon { width: 36px; height: 36px; border-radius: 9px; }
.home-app-text { display: grid; line-height: 1.3; }
.home-app-name { font-weight: 600; }
.home-app:hover .home-app-name { text-decoration: underline; }
.home-app-pkg { font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.home-store { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); }
.home-store:hover .badge { text-decoration: underline; }
.home-store .icon { width: 13px; height: 13px; }
.home-actions { white-space: nowrap; text-align: right; }
.home-actions .btn + .btn { margin-left: 4px; }
.home-actions .btn-icon { width: 30px; }
.home-table th { white-space: nowrap; }
.home-table code { white-space: nowrap; }
.home-access-project { display: none; margin-top: 4px; font: 11.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 1180px) {
  .home-col-project { display: none; }
  .home-access-project { display: block; }
}

/* Sign-in card */
.signin-icons { display: flex; justify-content: center; gap: 10px; margin-bottom: 16px; }
.signin-icons img { border-radius: 10px; box-shadow: 0 0 0 1px var(--border); }
.signin-icons .app-icon { width: 40px; height: 40px; border-radius: 10px; }
.signin-icons .app-icon .icon { width: 20px; height: 20px; }

/* Per-app gate */
.app-gate .card { max-width: 560px; }
.app-gate-body { display: grid; justify-items: start; gap: 10px; padding: 24px; }
.app-gate-body h2 { font-size: 17px; font-weight: 600; }
.app-gate-body .help { max-width: 52ch; }
.app-gate-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.app-gate-actions:not(:has(button:not([hidden]))) { display: none; }

/* Account badge in the top bar can carry a long text; keep it on one line. */
.who .badge { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 767px) {
  .who .badge { max-width: 140px; }
}

/* Pose Studio translations: one row per language with a progress bar. */
.tr-list { display: grid; }
.tr-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(80px, 2fr) 56px; align-items: center; gap: 12px;
  padding: 8px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.tr-row:last-child { border-bottom: 0; }
.tr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-bar { height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; }
.tr-fill { display: block; height: 100%; border-radius: 3px; }
.tr-full { background: var(--ok-fg); }
.tr-partial { background: var(--fg); }
.tr-low { background: var(--warn-fg); }
.tr-empty { background: transparent; }
.tr-pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
