/* appDrop. One task per screen, the main action always in reach of a thumb, everything else a tap away. Layered
   surfaces instead of lines, motion that shows where things come from and go, and a dark mode designed as its own
   palette (true black, lifted surfaces) rather than an inversion. */

:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --raised: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #a1a1a6;
  --hairline: rgba(0, 0, 0, 0.08);
  --accent: #0071e3;
  --accent-2: #5e5ce6;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --good: #1d8a3a;
  --good-soft: rgba(52, 199, 89, 0.14);
  --warn: #b35c00;
  --warn-soft: rgba(255, 149, 0, 0.16);
  --bad: #d70015;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.9);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-2: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  --radius: 20px;
  --radius-sm: 14px;
  --spring: cubic-bezier(0.32, 1.25, 0.5, 1);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --safe-bottom: env(safe-area-inset-bottom);
  font: 17px/1.42 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --raised: #2c2c2e;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #6e6e73;
    --hairline: rgba(255, 255, 255, 0.09);
    --accent: #0a84ff;
    --accent-2: #7d7aff;
    --accent-soft: rgba(10, 132, 255, 0.18);
    --good: #32d74b;
    --good-soft: rgba(50, 215, 75, 0.16);
    --warn: #ffb340;
    --warn-soft: rgba(255, 159, 10, 0.18);
    --bad: #ff453a;
    --glass: rgba(30, 30, 32, 0.66);
    --glass-edge: rgba(255, 255, 255, 0.12);
    --shadow-1: 0 0 0 1px rgba(255, 255, 255, 0.04);
    --shadow-2: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); overscroll-behavior-y: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 10px; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Frame ---------- */

.frame { min-height: 100dvh; }
.content { max-width: 680px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 16px calc(180px + var(--safe-bottom)); }
.masthead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 20px 4px 18px; }
.masthead h1 { font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -0.022em; margin: 0; }
.masthead p { margin: 4px 0 0; color: var(--text-2); font-size: 15px; }
.masthead .tools { display: flex; gap: 8px; }

/* A phone: the app's name at the top opens the switcher, its tabs float in a glass pill above the home indicator.
   Wide screens: the apps down a sidebar, the tabs as a segmented control under the app's name. */
.sidebar { display: none; }
.tabbar { position: fixed; left: 50%; bottom: calc(14px + var(--safe-bottom)); transform: translateX(-50%); z-index: 20;
  display: flex; gap: 2px; padding: 6px; border-radius: 30px; background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow-2), inset 0 1px 0 var(--glass-edge); }
.tabbar button { position: relative; width: 84px; height: 54px; border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-2); font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em; transition: color 0.2s var(--ease), background 0.3s var(--ease), transform 0.2s var(--spring); }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.on { color: var(--accent); background: var(--accent-soft); }
.tabbar button:active { transform: scale(0.92); }
.tabbar .dot { position: absolute; top: 8px; right: 24px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--bg); }
.segmented { display: none; }

@media (min-width: 900px) {
  .frame { display: grid; grid-template-columns: 260px 1fr; }
  .content { padding: 36px 40px 120px; margin: 0; max-width: 780px; width: 100%; justify-self: center; }
  .sidebar { position: sticky; top: 0; height: 100dvh; overflow: auto; display: flex; flex-direction: column; gap: 2px; padding: 28px 14px 18px;
    background: var(--surface); box-shadow: inset -1px 0 0 var(--hairline); }
  .sidebar .brand { display: flex; }
  .tabbar, .switcher { display: none !important; }
  .segmented { display: flex; }
}
.side-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); padding: 16px 12px 6px; }
.side-row { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 42px; padding: 6px 10px; border-radius: 11px; font-size: 15px; font-weight: 500; color: var(--text);
  text-align: left; cursor: pointer; transition: background 0.15s; }
.side-row > span:not(.side-glyph) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-row:hover:not(.on) { background: var(--surface-2); }
.side-row.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.side-row.add { color: var(--accent); }
.side-icon { width: 28px; height: 28px; border-radius: 7px; flex: none; object-fit: cover; box-shadow: 0 0 0 0.5px var(--hairline); }
.side-icon.letter { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; background: linear-gradient(160deg, var(--accent), var(--accent-2)); }
.side-glyph { width: 28px; height: 28px; flex: none; display: flex; align-items: center; justify-content: center; }
.side-glyph svg { width: 20px; height: 20px; }
.side-row .badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--warn); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.side-row .count { flex: none; font-size: 13px; font-weight: 500; color: var(--text-3); }
.sidebar .spacer { flex: 1; }
.brand { align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; padding: 0 8px 22px; }
.brand svg, .mark { width: 32px; height: 32px; flex: none; }

/* ---------- Sections and surfaces ---------- */

.section { margin-top: 30px; }
.section:first-of-type { margin-top: 4px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 12px; }
.section-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.section-head .aside { font-size: 15px; color: var(--text-2); }
.section-head .step { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--text); color: var(--bg);
  font-size: 12px; font-weight: 700; margin-right: 8px; transform: translateY(-2px); }

.surface { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.list > * + * { box-shadow: inset 0 1px 0 var(--hairline); }
.item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 12px 16px; text-align: left; transition: background 0.15s; }
button.item:active, .item.tappable:active { background: color-mix(in srgb, var(--text) 8%, transparent); }
@media (hover: hover) { button.item:hover { background: color-mix(in srgb, var(--text) 4%, transparent); } button.item.on:hover { background: color-mix(in srgb, var(--accent) 11%, transparent); } }
.item .main { flex: 1; min-width: 0; }
.item .title { font-weight: 600; font-size: 16.5px; letter-spacing: -0.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .detail { color: var(--text-2); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.item .chev { color: var(--text-3); flex: none; width: 8px; }

.empty { text-align: center; padding: 44px 24px; color: var(--text-2); }
.empty svg { width: 44px; height: 44px; color: var(--text-3); margin-bottom: 10px; }
.empty h3 { color: var(--text); font-size: 19px; margin: 0 0 6px; }
.empty p { margin: 0 auto 18px; max-width: 300px; font-size: 15px; }

/* ---------- Avatars, icons, pills ---------- */

.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px;
  letter-spacing: 0.02em; background: linear-gradient(160deg, hsl(var(--h) 70% 62%), hsl(calc(var(--h) + 25) 65% 48%)); }
.app-icon { width: 52px; height: 52px; border-radius: 12px; flex: none; object-fit: cover; box-shadow: 0 0 0 0.5px var(--hairline), 0 2px 6px rgba(0, 0, 0, 0.08); background: var(--surface-2); }
.app-icon.letter { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 22px; background: linear-gradient(160deg, var(--accent), var(--accent-2)); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; white-space: nowrap; flex: none; }
.pill svg { width: 12px; height: 12px; }
.pill.good { color: var(--good); background: var(--good-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.quiet { color: var(--text-2); background: var(--surface-2); }
.pill.accent { color: var(--accent); background: var(--accent-soft); }

/* ---------- Buttons ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 16px;
  background: var(--surface-2); color: var(--text); transition: transform 0.2s var(--spring), opacity 0.2s, background 0.2s; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(0.96); }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.tint { color: var(--accent); background: var(--accent-soft); }
.btn.danger { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.btn.big { min-height: 56px; font-size: 17px; border-radius: 18px; width: 100%; }
.btn:disabled { opacity: 0.35; cursor: default; box-shadow: none; transform: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); box-shadow: var(--shadow-1); color: var(--text); transition: transform 0.2s var(--spring); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(0.9); }
.text-btn { color: var(--accent); font-weight: 600; font-size: 15px; padding: 8px 4px; }
.text-btn.danger { color: var(--bad); }

/* ---------- Lists ---------- */

.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 14px; padding: 0 12px; box-shadow: var(--shadow-1); margin-bottom: 12px; }
.search svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.search input { flex: 1; border: 0; background: none; outline: none; height: 44px; font-size: 16.5px; min-width: 0; }
.search input::placeholder { color: var(--text-3); }

.select-box { width: 26px; height: 26px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px var(--text-3); display: flex; align-items: center; justify-content: center; color: #fff;
  transition: background 0.2s var(--ease), box-shadow 0.2s; }
.select-box svg { width: 14px; height: 14px; transform: scale(0); transition: transform 0.3s var(--spring); }
.item.on .select-box { background: var(--accent); box-shadow: none; }
.item.on .select-box svg { transform: scale(1); }
.item.on { background: color-mix(in srgb, var(--accent) 7%, transparent); }
/* ---------- Apps ---------- */

.upload { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1); cursor: pointer;
  outline: 2px dashed transparent; outline-offset: -8px; transition: outline-color 0.2s, background 0.2s; }
.upload.over { outline-color: var(--accent); background: var(--accent-soft); }
.upload .ring { width: 52px; height: 52px; flex: none; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.upload .ring svg { width: 26px; height: 26px; }
.upload .progress-ring { width: 52px; height: 52px; flex: none; transform: rotate(-90deg); }
.upload .progress-ring circle { fill: none; stroke-width: 5; }
.upload .progress-ring .track { stroke: var(--surface-2); }
.upload .progress-ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.3s var(--ease); }
.upload h3 { margin: 0; font-size: 17px; }
.upload p { margin: 2px 0 0; color: var(--text-2); font-size: 14.5px; }

.app-block { margin-top: 18px; }
.app-head { display: flex; align-items: center; gap: 14px; padding: 16px; }
.app-head .app-icon { width: 60px; height: 60px; border-radius: 14px; }
.app-head h3 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.app-head .bundle { color: var(--text-2); font-size: 13.5px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.build { padding: 14px 16px; }
.build .line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.build .ver { font-weight: 650; font-size: 16.5px; }
.build .facts { color: var(--text-2); font-size: 14px; margin-top: 3px; }
.build .devices { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.build .devices .who { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--surface-2); }
.build .devices .who .avatar { width: 20px; height: 20px; font-size: 10px; }
.build .devices .more { font-size: 13px; color: var(--text-2); padding: 3px 6px; }
.build .notes { margin-top: 8px; font-size: 14.5px; color: var(--text-2); font-style: italic; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; margin-top: 6px; }

/* ---------- Activity ---------- */

.day { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin: 26px 4px 10px; }
.event { display: flex; gap: 14px; padding: 12px 16px; align-items: flex-start; }
.event .glyph { width: 34px; height: 34px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; }
.event .glyph svg { width: 18px; height: 18px; }
.event .glyph.open { background: var(--accent-soft); color: var(--accent); }
.event .glyph.manifest { background: rgba(94, 92, 230, 0.14); color: var(--accent-2); }
.event .glyph.download { background: var(--good-soft); color: var(--good); }
.event .what { font-size: 15.5px; }
.event .when { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }

/* ---------- Sheets ---------- */

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0); transition: background 0.35s var(--ease); display: flex; align-items: flex-end; justify-content: center; }
.scrim.open { background: rgba(0, 0, 0, 0.36); }
.sheet { width: 100%; max-width: 560px; max-height: calc(100dvh - 40px); overflow: auto; overscroll-behavior: contain; background: var(--bg); border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(24px + var(--safe-bottom)); transform: translateY(100%); transition: transform 0.5s var(--spring); box-shadow: var(--shadow-2); touch-action: pan-y; }
.scrim.open .sheet { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet .grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--text-3); opacity: 0.5; margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-head h2 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.sheet-head p { margin: 4px 0 0; color: var(--text-2); font-size: 15px; }
.sheet .close { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); display: flex; align-items: center; justify-content: center; flex: none; }
.sheet .close svg { width: 14px; height: 14px; }
@media (min-width: 700px) {
  .scrim { align-items: center; }
  .sheet { border-radius: 28px; transform: translateY(24px) scale(0.97); opacity: 0; transition: transform 0.45s var(--spring), opacity 0.25s; }
  .scrim.open .sheet { opacity: 1; transform: none; }
  .sheet .grabber { display: none; }
}

.linkcard { background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--shadow-1); }
.linkcard .who { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.linkcard .url { font: 14px/1.4 ui-monospace, "SF Mono", Menlo, monospace; color: var(--text-2); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; word-break: break-all; user-select: all; }
.linkcard + .linkcard { margin-top: 12px; }
.share-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.share-row .act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; background: var(--surface-2); font-size: 12.5px; font-weight: 600;
  color: var(--text); transition: transform 0.2s var(--spring); }
.share-row .act svg { width: 22px; height: 22px; color: var(--accent); }
.share-row .act:active { transform: scale(0.94); }
.share-row .act.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.share-row .act.primary svg { color: #fff; }
.note { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 12px 14px; font-size: 14.5px; margin-top: 12px; }
.note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.note.good { background: var(--good-soft); color: color-mix(in srgb, var(--good) 70%, var(--text)); }
.note.warn { background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 70%, var(--text)); }

.form { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-1); overflow: hidden; }
.form label { display: block; padding: 10px 16px 11px; }
.form label + label { box-shadow: inset 0 1px 0 var(--hairline); }
.form span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: 0.01em; }
.form input { width: 100%; border: 0; background: none; outline: none; font-size: 17px; padding: 3px 0 0; }
.form input::placeholder { color: var(--text-3); }
.hint { color: var(--text-2); font-size: 13.5px; margin: 10px 6px 18px; }
.stack > * + * { margin-top: 12px; }

/* ---------- Toast: an island that drops from the top ---------- */

.toast { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; z-index: 60; transform: translate(-50%, -140%); display: flex; align-items: center; gap: 10px;
  padding: 12px 18px 12px 14px; border-radius: 999px; background: #1d1d1f; color: #fff; font-size: 15px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.5s var(--spring); white-space: nowrap; }
.toast.show { transform: translate(-50%, 0); }
.toast svg { width: 20px; height: 20px; color: #32d74b; }
@media (prefers-color-scheme: dark) { .toast { background: #2c2c2e; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08); } }

/* ---------- Sign in ---------- */

.signin { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 20px calc(24px + var(--safe-bottom));
  background: radial-gradient(1000px 600px at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), var(--bg); }
.signin-card { width: 100%; max-width: 380px; text-align: center; }
.signin .mark { width: 76px; height: 76px; margin: 0 auto 18px; filter: drop-shadow(0 10px 24px color-mix(in srgb, var(--accent) 40%, transparent)); }
.signin h1 { font-size: 32px; letter-spacing: -0.025em; margin: 0 0 6px; }
.signin .lede { color: var(--text-2); margin: 0 0 28px; font-size: 16px; }
.signin .or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; margin: 20px 0; }
.signin .or::before, .signin .or::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.signin .form { text-align: left; margin-bottom: 14px; }
.signin .error { color: var(--bad); font-size: 15px; margin: 12px 0 0; min-height: 1.4em; }

/* Skeleton while loading. */
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Tabs change with a short cross-fade and lift. */
::view-transition-old(content) { animation: 0.18s var(--ease) both fade-out; }
::view-transition-new(content) { animation: 0.32s var(--ease) both fade-in; }
.content { view-transition-name: content; }
@keyframes fade-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } }
/* Only as a screen first appears, not every time it redraws (an upload redraws it at each part). */
.fresh .appear { animation: appear 0.45s var(--spring) both; }
@keyframes appear { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  ::view-transition-old(content), ::view-transition-new(content) { animation: none; }
}

.btn.reg { min-height: 32px; padding: 0 12px; font-size: 13.5px; gap: 4px; }
.btn.reg svg { width: 14px; height: 14px; }
.pill svg { stroke-width: 3; }

/* ---------- An app's workspace ---------- */

.switcher { display: inline-flex; align-items: center; gap: 8px; margin: 6px 0 2px -2px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--surface);
  box-shadow: var(--shadow-1); font-weight: 650; font-size: 15px; color: var(--text); transition: transform 0.2s var(--spring); max-width: 100%; }
.switcher > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher svg { color: var(--text-3); flex: none; }
.switcher:active { transform: scale(0.96); }
.switch-icon { width: 24px; height: 24px; border-radius: 6px; flex: none; object-fit: cover; }
.switch-icon.letter { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; background: linear-gradient(160deg, var(--accent), var(--accent-2)); }
.switch-glyph { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.switch-glyph svg { width: 15px !important; height: 15px !important; color: var(--accent) !important; }
.app-header { padding: 8px 4px 20px; }
.app-title { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.app-title .main { flex: 1; min-width: 0; }
.app-title h1 { font-size: 32px; line-height: 1.1; font-weight: 700; letter-spacing: -0.022em; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-title p { margin: 4px 0 0; color: var(--text-2); font-size: 15px; }
.app-title .tools { display: flex; gap: 8px; align-items: center; }
.big-icon { width: 64px !important; height: 64px !important; border-radius: 15px !important; }
.big-icon.letter { font-size: 28px; }
@media (max-width: 420px) { .big-icon { width: 52px !important; height: 52px !important; border-radius: 12px !important; } .app-title h1 { font-size: 27px; } .app-title { gap: 12px; } }
@media (min-width: 900px) { .app-title { margin-top: 0; } }
.segmented { margin-top: 20px; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--text) 7%, transparent); width: fit-content; gap: 2px; }
.segmented button { padding: 7px 22px; border-radius: 9px; font-size: 14.5px; font-weight: 600; color: var(--text-2); transition: background 0.2s var(--ease), color 0.2s; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); }

/* The main action floats: above the tab bar on a phone, top right on a wide screen. */
.fab { position: fixed; right: 18px; bottom: calc(92px + var(--safe-bottom)); z-index: 25; display: flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 20px 0 16px; border-radius: 26px; color: #fff; font-weight: 650; font-size: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 30px -6px color-mix(in srgb, var(--accent) 60%, transparent), inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform 0.25s var(--spring); }
.fab svg { width: 22px; height: 22px; }
.fab:active { transform: scale(0.92); }
.wide-only { display: none !important; }
@media (min-width: 900px) { .fab { display: none; } .wide-only { display: inline-flex !important; } }

/* Three numbers above People: who needs you, who's on their way, who's done. */
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stat.accent::after { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* A person in an app: the row opens them; an action may sit at its end. */
.item.member { padding: 0; gap: 0; }
.item.member .hit { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 12px 16px; min-height: 68px; text-align: left; transition: background 0.15s; }
.item.member .hit:active { background: color-mix(in srgb, var(--text) 8%, transparent); }
@media (hover: hover) { .item.member .hit:hover { background: color-mix(in srgb, var(--text) 3%, transparent); } }
.item.member .trail { display: flex; align-items: center; padding-right: 14px; }
.item.member .pill { margin-left: 2px; }
@media (max-width: 420px) { .item.member .hit { gap: 12px; padding: 12px 14px; } .item.member .feats { display: none; } }
.app-dots { display: flex; gap: 4px; flex: none; }
.dot-icon { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; box-shadow: 0 0 0 0.5px var(--hairline); }
.dot-icon.letter { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; background: linear-gradient(160deg, var(--accent), var(--accent-2)); }

.banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 12px; border-radius: var(--radius); background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 65%, var(--text)); }
.banner > svg { width: 24px; height: 24px; flex: none; }
.banner .main { flex: 1; min-width: 0; }
.banner b { display: block; font-size: 15.5px; color: var(--text); }
.banner span { display: block; font-size: 14px; margin-top: 2px; }

/* The status of one person in one app: a tracker of the steps, where they are, and the next thing to do. */
.status-card { padding: 20px 18px 18px; }
.tracker { display: flex; align-items: flex-start; }
.tstep { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: none; width: 64px; }
.tdot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: #fff; box-shadow: inset 0 0 0 2px var(--hairline); }
.tdot svg { width: 14px; height: 14px; }
.tstep.done .tdot { background: var(--good); box-shadow: none; }
.tstep.now .tdot { background: var(--surface); box-shadow: inset 0 0 0 2.5px var(--accent), 0 0 0 5px var(--accent-soft); }
.tlabel { font-size: 12px; font-weight: 600; color: var(--text-3); text-align: center; }
.tstep.done .tlabel { color: var(--text-2); }
.tstep.now .tlabel { color: var(--accent); }
.tline { flex: 1; height: 2.5px; margin-top: 12px; border-radius: 2px; background: var(--hairline); min-width: 8px; }
.tstep.done + .tline { background: var(--good); }
.status-line { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 15px; }
.status-hint { margin: 8px 0 0; font-size: 14px; color: var(--text-2); }
.status-next { margin-top: 16px; }
.status-card + .linkcard { margin-top: 14px; }

.sheet .section-head { margin-top: 26px; }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.sheet-foot .text-btn { display: inline-flex; align-items: center; gap: 6px; }
.sheet-foot .text-btn svg { width: 17px; height: 17px; }
.sheet-cta { position: sticky; bottom: calc(-24px - var(--safe-bottom)); margin: 22px -20px calc(-24px - var(--safe-bottom)); padding: 14px 20px calc(18px + var(--safe-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg) 30%); }
.newperson .row-buttons { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 12px; }
.avatar.plus { background: var(--accent-soft); color: var(--accent); }
.pick-list { max-height: 46dvh; overflow: auto; }
.link-entry + .link-entry { margin-top: 22px; }
.link-entry .who { display: flex; align-items: center; gap: 12px; margin: 0 4px 10px; }
.link-entry .who .main { flex: 1; min-width: 0; }
.link-entry .who .title { font-weight: 650; }
.link-entry .who .detail { font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-actions { margin: 6px 2px 14px; }
.inline-actions .text-btn { display: inline-flex; align-items: center; gap: 6px; }
.inline-actions .text-btn svg { width: 17px; height: 17px; }
.history { margin-top: 12px; }
.history summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 15px; padding: 6px 4px; list-style: none; }
.history summary::-webkit-details-marker { display: none; }
.history[open] summary { margin-bottom: 8px; }
.in-app { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; }
.upload-empty { display: block; cursor: pointer; }
.tick-on { color: var(--accent); width: 20px; flex: none; }

/* An upload in progress, wherever you are; and a file dragged over the page. */
.upload-pill { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 55; overflow: hidden; display: flex; align-items: center; gap: 10px;
  padding: 11px 18px 11px 14px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow-2); font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.upload-pill svg { width: 18px; height: 18px; color: var(--accent); position: relative; }
.upload-pill span:not(.fill) { position: relative; }
.upload-pill .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); transition: width 0.3s var(--ease); }
body.dropping::after { content: "Drop the .ipa to upload it"; position: fixed; inset: 12px; z-index: 70; display: flex; align-items: center; justify-content: center; border-radius: 28px;
  border: 3px dashed var(--accent); background: color-mix(in srgb, var(--accent) 12%, color-mix(in srgb, var(--bg) 80%, transparent)); color: var(--accent); font-size: 22px; font-weight: 700;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; }
.btn.reg { min-height: 32px; padding: 0 12px; font-size: 13.5px; gap: 4px; }
.btn.reg svg { width: 14px; height: 14px; }
.pill svg { stroke-width: 3; }

/* A re-sign under way, and the button that starts one. */
.job { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 16px; }
.job .main { flex: 1; min-width: 0; }
.job b { display: block; font-size: 16px; }
.job span:not(.spinner) { display: block; color: var(--text-2); font-size: 14px; margin-top: 2px; }
.spinner { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.resign-row { margin-top: 14px; }
button.item[disabled] { opacity: 0.45; pointer-events: none; }
.spinner.slow { animation-duration: 2.4s; }

/* ⓘ: help text behind a button, in a bubble that grows from it. */
.info-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin: -4px -2px; border-radius: 50%; color: var(--accent);
  vertical-align: middle; transition: background 0.15s, transform 0.2s var(--spring); flex: none; }
.info-btn svg { width: 19px; height: 19px; }
.info-btn:active { transform: scale(0.88); background: var(--accent-soft); }
@media (hover: hover) { .info-btn:hover { background: var(--accent-soft); } }
.section-head h2 .info-btn, .sheet-head h2 .info-btn { margin-left: 4px; }
.popover { position: fixed; z-index: 80; padding: 12px 14px; border-radius: 16px; background: var(--glass); color: var(--text); font-size: 14.5px; line-height: 1.4;
  backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%); box-shadow: var(--shadow-2), inset 0 0.5px 0 var(--glass-edge);
  opacity: 0; transform: scale(0.92); transition: opacity 0.18s var(--ease), transform 0.3s var(--spring); pointer-events: auto; }
.popover.show { opacity: 1; transform: none; }
.popover p { margin: 0; }
.popover p + p { margin-top: 8px; }
.resign-row { padding: 0 14px 0 0; gap: 0; }
.resign-row .hit { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-align: left; }
.status-line .info-btn { margin-left: auto; }
.item > .info-btn { margin-right: -4px; }
.banner b .info-btn { margin: -4px 0 -4px 2px; }

/* A build's What's New: tap to edit. */
.whatsnew-edit { display: block; width: 100%; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); text-align: left; transition: background 0.15s; }
.whatsnew-edit:active { background: color-mix(in srgb, var(--text) 10%, var(--surface-2)); }
.whatsnew-edit .label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); }
.whatsnew-edit .text { display: block; margin-top: 2px; font-size: 15px; color: var(--text); white-space: pre-line; }
.whatsnew-edit .text.empty { color: var(--accent); }
.form textarea { width: 100%; border: 0; background: none; outline: none; font-size: 17px; padding: 3px 0 0; resize: vertical; font-family: inherit; color: inherit; }
.status-card + .expiry, .expiry { margin-top: 14px; }
.expiry + .linkcard { margin-top: 14px; }
.glyph-tile.bad { background: var(--bad-soft); color: var(--bad); }
