/*
 * Installer main page.
 * Scoped to body.inst so the shared styles.css (admin and download pages) is untouched.
 * One centered panel; neutral graphite, green only for the Install action, progress and live status.
 */

body.inst {
    --ground: #0f1012;
    --panel: #18191d;
    --field: #0f1012;
    --raised: #23252a;
    --line: #2a2d33;
    --line-hover: #4a4f58;
    --text: #eceef1;
    --muted: #8d939d;
    --focus: #c4c8d0;
    --sel: rgba(255, 255, 255, 0.08);
    --accent: #00c850;
    --accent-hover: #1bd964;
    --accent-ink: #04210f;
    --amber: #f2b33d;
    --danger: #ff6b6b;
    --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Bricolage Grotesque", var(--font-ui);

    padding: 0;
    background: var(--ground);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Bootstrap's reboot paints an orange ring on mouse focus; keep the ring for keyboard users only. */
.inst button:focus:not(:focus-visible),
.inst a:focus:not(:focus-visible) { outline: none; }
.inst *:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* text fields already change their own border on focus; no second outline on top */
.inst input:focus-visible, .inst textarea:focus-visible, .inst select:focus-visible { outline: none; }

html { overflow-y: scroll; }
.inst-shell { max-width: 1200px; margin: 0 auto; padding: 24px 24px 80px; }

/* ---------- Top bar ---------- */

.inst .topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.inst .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.inst .brand-link { display: flex; align-items: center; gap: 10px; }
.inst .brand-icon { height: 34px; width: auto; }
.inst .brand-text { height: 14px; width: auto; }

.inst .topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.inst .conn { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.inst .conn-label { display: inline-block; min-width: 76px; } /* "Connecting" and "Connected" must not change the bar's width */
.inst .conn-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.inst .conn[data-state="reconnecting"] .conn-dot { background: var(--amber); animation: conn-pulse 1.2s ease-in-out infinite; }
.inst .conn[data-state="live"] .conn-dot { background: var(--accent); }
.inst .conn[data-state="offline"] .conn-dot { background: var(--danger); }
@keyframes conn-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.inst .user-name {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.inst .icon-btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    border: 0;
    background: transparent;
    color: var(--muted);
    transition: color 0.15s, background-color 0.15s;
}
.inst .icon-btn:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.inst .icon-btn svg { width: 18px; height: 18px; }

/* ---------- Panel ---------- */

.inst .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
}

.inst .panel-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 19px;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 0 0 14px;
    overflow-wrap: anywhere;
}

.inst .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.inst .field { position: relative; min-width: 0; --lw: 90px; }
#stepJob { --lw: 54px; }
#stepBuild { --lw: 62px; }
#stepDevices { --lw: 78px; }
.inst .field::after { content: ""; position: absolute; left: var(--lw); top: 11px; height: 22px; width: 1px; background: var(--line); z-index: 3; pointer-events: none; }
.inst .field-job { grid-column: 1 / -1; }
@media (min-width: 1100px) {
    .inst .fields { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr) minmax(0, 1.2fr); }
    .inst .field-job { grid-column: auto; }
}
.inst .field-top { position: absolute; left: 14px; top: 0; height: 44px; z-index: 3; display: flex; align-items: center; gap: 8px; margin: 0; pointer-events: none; }
.inst .field-top label { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); transition: color 0.2s; }
.inst .field[data-done="true"] .field-top label { color: var(--text); }

.inst .panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.inst .foot-buttons { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* ---------- Pickers (bootstrap-select) ---------- */

.inst .field .bootstrap-select { width: 100% !important; }
.inst .field .bootstrap-select > .dropdown-toggle.btn,
.inst .field .bootstrap-select > .dropdown-toggle.btn-light { min-height: 44px; padding-top: 10px; padding-bottom: 10px; padding-left: calc(var(--lw) + 14px); }
.inst .panel-foot .inst-btn { height: 42px; padding: 0 18px; }

.inst .bootstrap-select > .dropdown-toggle,
.inst .bootstrap-select > .dropdown-toggle.btn-light,
.inst .bootstrap-select .btn {
    min-height: 48px;
    padding: 12px 38px 12px 14px;
    line-height: 24px;
    font-size: 15px;
    border-radius: 10px !important;
    background-color: var(--field) !important;
    border: 1px solid var(--line) !important;
    color: var(--text) !important;
    transition: border-color 0.15s;
}
.inst .bootstrap-select > .dropdown-toggle:hover { border-color: var(--line-hover) !important; }
.inst .bootstrap-select > .dropdown-toggle:focus,
.inst .bootstrap-select.show > .dropdown-toggle {
    border-color: var(--focus) !important;
    box-shadow: none !important;
    outline: none !important;
}
.inst .bootstrap-select .filter-option { color: var(--text); }
.inst .bootstrap-select .filter-option-inner-inner { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inst .bootstrap-select .dropdown-toggle.bs-placeholder,
.inst .bootstrap-select .dropdown-toggle.bs-placeholder .filter-option { color: var(--muted) !important; }
.inst .bootstrap-select .dropdown-toggle::after {
    border-top-color: var(--muted);
    border-top-width: 5px;
    border-right-width: 5px;
    border-left-width: 5px;
    margin-right: 4px;
}

.inst .bootstrap-select .dropdown-menu {
    background-color: var(--raised);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px;
    margin-top: 6px;
    box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.6);
}
.inst .bootstrap-select .dropdown-menu.inner { background: transparent; border: 0; box-shadow: none; margin: 0; padding: 0; }
.inst .bootstrap-select .bs-searchbox { padding: 4px 4px 8px; }
.inst .bootstrap-select .bs-searchbox .form-control,
.inst .bootstrap-select .bs-searchbox .form-control:focus {
    height: 38px;
    background-color: var(--field);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    box-shadow: none;
}
.inst .bootstrap-select .bs-searchbox .form-control:focus { border-color: var(--focus); }

.inst .bootstrap-select .bs-actionsbox { padding: 0 4px 6px; }
.inst .bootstrap-select .bs-actionsbox .btn {
    min-height: 32px;
    padding: 4px 8px;
    font-size: 13px;
    line-height: 24px;
    background-color: transparent !important;
    border: 0 !important;
    color: var(--muted) !important;
    border-radius: 8px !important;
}
.inst .bootstrap-select .bs-actionsbox .btn:hover { color: var(--text) !important; background-color: var(--field) !important; }

.inst .bootstrap-select .dropdown-menu li a { border-radius: 8px; padding: 9px 12px; color: var(--text); }
.inst .bootstrap-select .dropdown-menu li a:hover,
.inst .bootstrap-select .dropdown-menu li a:focus { background-color: rgba(255, 255, 255, 0.06); color: var(--text); }
.inst .bootstrap-select .dropdown-menu li.active > a,
.inst .bootstrap-select .dropdown-menu li a.active,
.inst .bootstrap-select .dropdown-menu li.selected > a { background-color: var(--sel); color: var(--text); font-weight: 600; }
.inst .bootstrap-select .dropdown-menu li small.text-muted { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--muted) !important; }
.inst .bootstrap-select .no-results { background: transparent; color: var(--muted); padding: 10px 12px; }

/* ---------- Switch and buttons ---------- */

.inst .switch { position: relative; display: flex; align-items: center; gap: 12px; margin: 0; cursor: pointer; }
.inst .switch input { position: absolute; opacity: 0; width: 40px; height: 22px; margin: 0; cursor: pointer; }
.inst .switch-ui { flex: none; position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--raised); transition: background-color 0.2s; }
.inst .switch-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform 0.2s, background-color 0.2s;
}
.inst .switch input:checked + .switch-ui { background: var(--text); }
.inst .switch input:checked + .switch-ui::after { transform: translateX(18px); background: var(--ground); }
.inst .switch input:focus-visible + .switch-ui { outline: 2px solid var(--focus); outline-offset: 2px; }
.inst .switch-text strong { display: block; font-size: 14px; font-weight: 500; line-height: 1.25; }
.inst .switch-text small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.3; }

.inst .inst-btn {
    box-sizing: border-box;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 22px;
    border-radius: 10px;
    border: 0;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, transform 0.1s;
}
.inst .inst-btn svg { width: 18px; height: 18px; flex: none; }
.inst .inst-btn:active:not(:disabled) { transform: translateY(1px); }
.inst .inst-btn-primary { background: var(--accent); color: var(--accent-ink); min-width: 130px; }
.inst .inst-btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.inst .inst-btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.inst .inst-btn-ghost:hover:not(:disabled) { background: var(--raised); border-color: var(--line-hover); }
.inst .inst-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.inst .inst-btn-primary:disabled { background: var(--raised); color: var(--muted); opacity: 1; }
.inst .inst-btn-ghost:disabled { color: var(--muted); }

/* ---------- Share panel ---------- */

.inst [hidden] { display: none !important; }

.inst .share { margin-top: 16px; padding: 22px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.inst .share-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.inst .share-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.inst .app-icon { flex: none; width: 48px; height: 48px; border-radius: 11px; overflow: hidden; display: block; background: var(--raised); }
.inst .app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.inst .share-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 18px; margin: 0; overflow-wrap: anywhere; }
.inst .share-meta { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }

.inst .share-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }

.inst .share-section { margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--text); }

.inst .share-install { display: flex; flex-direction: column; }
.inst .share-qr { padding: 10px; background: #fff; border-radius: 12px; line-height: 0; }
.inst .share-qr img, .inst .share-qr canvas { width: 100%; height: auto !important; display: block; }
.inst .share-qr-hint { margin: 10px 0 14px; color: var(--muted); font-size: 13px; text-align: center; }
.inst .share-install .inst-btn { width: 100%; padding: 0 12px; }

.inst .share-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; padding-left: 32px; border-left: 1px solid var(--line); }
.inst .share-main .share-section { margin-bottom: -4px; }

.inst .share-label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--muted); }

/* link field and Copy as one control */
.inst .share-copy { display: flex; align-items: stretch; height: 46px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); overflow: hidden; }
.inst .share-copy:focus-within { border-color: var(--focus); }
.inst .share .share-copy .form-control,
.inst .share .share-copy .form-control:focus { flex: 1; min-width: 0; height: auto; border: 0; border-radius: 0; background: transparent; font-size: 13.5px; text-overflow: ellipsis; box-shadow: none; }
.inst .copy-btn {
    flex: none;
    min-width: 84px;
    padding: 0 18px;
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--raised);
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.inst .copy-btn:hover { background: #2c2f35; }
.inst .copy-btn.is-copied { color: var(--accent); }

.inst .share-pickers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.inst .share .form-control { background-color: var(--field); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 10px 14px; }
.inst .share .form-control:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07); }
.inst .share-note { display: block; width: 100%; min-height: 104px; max-height: 320px; resize: vertical; line-height: 1.5; }

.inst .share-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.inst .share-send-hint { flex: 1; min-width: 0; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.inst .share-actions .inst-btn { flex: none; min-width: 120px; }

.inst a.inst-btn { text-decoration: none; }

.inst .btn-primary,
.inst .btn-success {
    height: 46px;
    border-radius: 10px;
    border: 0;
    background-color: var(--accent);
    color: var(--accent-ink);
    font-family: var(--font-display);
    font-weight: 600;
}
.inst .btn-primary:hover,
.inst .btn-success:hover,
.inst .btn-primary:focus,
.inst .btn-success:focus { background-color: var(--accent-hover); color: var(--accent-ink); }
.inst .btn-primary:active,
.inst .btn-success:active { background-color: var(--accent) !important; color: var(--accent-ink) !important; }

/* ---------- Download page (opened from the email link) ---------- */

.inst .dl-shell {
    max-width: 560px;
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center; /* logo and card sit together in the middle of the screen */
    padding-bottom: 24px;
}
.inst .dl-shell .topbar { margin-bottom: 20px; justify-content: center; }
.inst .dl-shell #downloadLinkDetails { margin: 0; }
/* a soft glow of the brand green in the middle of the screen, behind the card */
.inst.dl-page, .inst.glow-page { background: transparent; }
.inst.dl-page::before, .inst.glow-page::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(55% 48% at 50% 50%, rgba(0, 200, 80, 0.11) 0, rgba(0, 200, 80, 0) 72%); }
.inst .dl-card {
    padding: 28px 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
}
.inst .dl-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.inst .dl-head-text { min-width: 0; }
.inst .dl-icon { width: 76px; height: 76px; border-radius: 18px; }
.inst .dl-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(19px, 5vw, 23px);
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0 0 10px;
    text-wrap: balance;
    overflow-wrap: break-word;
}
.inst .dl-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.inst .dl-chip { padding: 2px 11px; border-radius: 999px; background: var(--raised); color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.7; font-variant-numeric: tabular-nums; }
.inst .dl-chip-platform { color: var(--text); }
.inst .dl-chip-ios { color: #8cc4ff; background: rgba(108, 180, 255, 0.16); }
.inst .dl-chip-android { color: #4be07f; background: rgba(0, 200, 80, 0.15); }

.inst .dl-note { margin-bottom: 24px; padding: 14px 16px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; }
.inst .dl-note-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.inst .dl-notes { margin: 0; color: var(--text); line-height: 1.55; overflow-wrap: anywhere; }
/* Rendered Markdown (same rules as the share email): compact headings, no outer margins. */
.inst .dl-notes > :first-child { margin-top: 0; }
.inst .dl-notes > :last-child { margin-bottom: 0; }
.inst .dl-notes p, .inst .dl-notes ul, .inst .dl-notes ol, .inst .dl-notes pre, .inst .dl-notes blockquote { margin: 0 0 10px; }
.inst .dl-notes h1, .inst .dl-notes h2, .inst .dl-notes h3, .inst .dl-notes h4 { margin: 14px 0 6px; font-family: var(--font-display); font-weight: 600; line-height: 1.25; color: var(--text); }
.inst .dl-notes h1 { font-size: 20px; }
.inst .dl-notes h2 { font-size: 17px; }
.inst .dl-notes h3, .inst .dl-notes h4 { font-size: 15px; }
.inst .dl-notes ul, .inst .dl-notes ol { padding-left: 20px; }
.inst .dl-notes a { color: var(--accent); }
.inst .dl-notes code { padding: 1px 5px; border-radius: 5px; background: var(--raised); color: var(--text); font-size: 13px; }
.inst .dl-notes pre { padding: 10px 12px; border-radius: 8px; background: var(--raised); overflow-x: auto; }
.inst .dl-notes pre code { padding: 0; background: none; }
.inst .dl-notes blockquote { padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.inst .dl-notes img { max-width: 100%; border-radius: 8px; }
.inst .dl-notes hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

.inst .dl-qr-wrap { margin-bottom: 24px; padding: 4px 0 24px; border-bottom: 1px solid var(--line); text-align: center; }
.inst .dl-qr { display: inline-block; padding: 10px; background: #fff; border-radius: 12px; line-height: 0; }
.inst .dl-qr img, .inst .dl-qr canvas { width: 184px; height: 184px; object-fit: contain; }
.inst .dl-qr-hint { margin: 14px 0 0; color: var(--muted); font-size: 13.5px; }
.inst a.dl-install { width: 100%; height: 52px; font-size: 16px; }
.inst a.dl-install:hover { color: var(--accent-ink); text-decoration: none; }

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

.inst .login-shell { min-height: 100vh; min-height: 100dvh; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.inst .login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.inst .login-brand .brand-icon { height: 40px; width: auto; }
.inst .login-brand .brand-text { height: 16px; width: auto; }
.inst .login-card { width: 100%; max-width: 400px; box-sizing: border-box; padding: 32px 28px 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.inst .login-card h1 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 600; font-size: 26px; letter-spacing: -0.02em; line-height: 1.15; }
.inst .login-sub { margin: 0; color: var(--muted); }
.inst .login-error { margin-top: 20px; padding: 12px 14px; background: var(--raised); border-left: 3px solid var(--danger); border-radius: 10px; font-size: 14.5px; }
.inst .google-btn { text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 12px; height: 50px; margin-top: 24px; border-radius: 10px; background: #fff; color: #1f1f1f; font-family: var(--font-display); font-weight: 600; font-size: 15px; transition: background-color 0.15s; }
.inst .google-btn:hover { background: #eef0f2; color: #1f1f1f; text-decoration: none; }
.inst .login-note { margin: 18px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

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

.inst .activity { margin-top: 20px; padding: 20px 22px 22px; }
.inst .activity h2 { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--text); margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.inst .activity-note { margin-left: 8px; font-family: var(--font-ui); font-weight: 400; font-size: 12.5px; color: var(--muted); opacity: 0.8; }
.inst .activity-empty { margin: 0; padding: 4px 0 2px; color: var(--muted); }
.inst #progressList:not(:empty) + .activity-empty { display: none; }

/* Timeline */
.inst .tl-item { position: relative; display: flex; gap: 14px; padding: 0 0 20px; }
.inst .tl-item:last-child { padding-bottom: 4px; }
.inst .tl-item:not(:last-child)::before { content: ""; position: absolute; left: 13.5px; top: 34px; bottom: 4px; width: 1px; background: var(--line); }

.inst .tl-dot { flex: none; position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--muted); }
.inst .tl-dot svg { width: 14px; height: 14px; }
.inst .tl-dot .i-ok, .inst .tl-dot .i-err { display: none; }
.inst .tl-item.is-running .tl-dot { color: var(--text); animation: tl-pulse 1.6s ease-in-out infinite; }
.inst .tl-item.is-done .tl-dot .i-run, .inst .tl-item.is-error .tl-dot .i-run { display: none; }
.inst .tl-item.is-done .tl-dot .i-ok, .inst .tl-item.is-error .tl-dot .i-err { display: block; }
.inst .tl-item.is-success .tl-dot, .inst .tl-item.is-done .tl-dot { background: rgba(0, 200, 80, 0.14); color: var(--accent); }
/* a finished item is a plain green dot: the tick said nothing the colour does not */
.inst .tl-item.is-success .tl-dot svg, .inst .tl-item.is-done .tl-dot svg { display: none; }
.inst .tl-item.is-success .tl-dot::after, .inst .tl-item.is-done .tl-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.inst .activity[hidden], .inst .share[hidden] { display: none; }
.inst .tl-item.is-failed .tl-dot, .inst .tl-item.is-error .tl-dot { background: rgba(255, 107, 107, 0.14); color: var(--danger); }
.inst .tl-item.is-cancelled .tl-dot { background: rgba(242, 179, 61, 0.14); color: var(--amber); }
@keyframes tl-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(236, 238, 241, 0.25); } 50% { box-shadow: 0 0 0 5px rgba(236, 238, 241, 0); } }

.inst .tl-body { flex: 1; min-width: 0; padding-top: 3px; }
.inst .tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.inst .tl-title { font-weight: 500; overflow-wrap: anywhere; }
.inst .tl-sub { margin-left: 8px; font-weight: 400; color: var(--muted); }
.inst .tl-time { flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.inst .tl-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; margin-top: 2px; font-size: 13.5px; }
.inst .tl-status { overflow-wrap: anywhere; }
.inst .tl-item.is-error .tl-status { color: var(--danger); }
.inst .tl-job { color: var(--muted); overflow-wrap: anywhere; }

.inst .tl-progress { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.inst .tl-item:not(.is-running) .tl-progress { display: none; }
.inst .tl-track { flex: 1; height: 4px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.inst .tl-fill {
    height: 100%;
    width: 5%;
    border-radius: 999px;
    background: var(--accent);
    background-image: linear-gradient(90deg, transparent 0, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    background-size: 120px 100%;
    background-repeat: no-repeat;
    animation: tl-sheen 1.4s linear infinite;
    transition: width 0.4s ease;
}
@keyframes tl-sheen { from { background-position: -120px 0; } to { background-position: calc(100% + 120px) 0; } }
.inst .tl-pct { min-width: 38px; text-align: right; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.inst .tl-meta { margin-top: 6px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------- Toasts (bootstrap-notify) and modals ---------- */

.inst .alert {
    min-width: 280px;
    background: var(--raised);
    color: var(--text);
    border: 0;
    border-left: 3px solid var(--line-hover);
    border-radius: 10px;
    box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.6);
}
.inst .alert-success { border-left-color: var(--accent); }
.inst .alert-danger { border-left-color: var(--danger); }
.inst .alert-info { border-left-color: var(--muted); }
.inst .alert-warning { border-left-color: var(--amber); }
.inst .alert .close { color: var(--text); text-shadow: none; }

.inst .modal-content { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.inst .modal-header, .inst .modal-footer { border-color: var(--line); }
.inst .modal-title { font-family: var(--font-display); font-weight: 600; }

/* ---------- Small screens ---------- */

@media (max-width: 575.98px) {
    .inst .dl-qr-wrap { display: none; }
    .inst .dl-head { gap: 14px; }
    .inst .dl-icon { width: 60px; height: 60px; border-radius: 15px; }
        .inst-shell { padding: 16px 14px 56px; }
    .inst .topbar { margin-bottom: 18px; gap: 8px; }
    .inst .topbar-actions { gap: 6px; }
    .inst .conn-label, .inst .user { display: none; }
    .inst .brand { gap: 8px; }
    .inst .brand-link { gap: 8px; }
    .inst .brand-icon { height: 30px; }
    .inst .brand-text { height: 11px; }

    .inst .panel { padding: 18px; border-radius: 14px; }
    .inst .panel-title { margin-bottom: 18px; }
    .inst .fields { grid-template-columns: 1fr; gap: 16px; }
    .inst .panel-foot { flex-direction: column; align-items: stretch; margin-top: 20px; padding-top: 18px; }
    .inst .foot-buttons { width: 100%; }
    .inst .inst-btn-primary { flex: 1; }

    .inst .share { padding: 18px; border-radius: 14px; }
    .inst .share-body { grid-template-columns: 1fr; gap: 20px; }
    .inst .share-install .share-section, .inst .share-qr, .inst .share-qr-hint { display: none; }
    .inst .share-main { padding-left: 0; border-left: 0; padding-top: 20px; border-top: 1px solid var(--line); }
    .inst .share-pickers { grid-template-columns: 1fr; }
    .inst .share-actions { flex-direction: column; align-items: stretch; }
    .inst .share-actions .inst-btn { width: 100%; }
    .inst .share-send-hint { order: 2; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .inst *, .inst *::before, .inst *::after { animation: none !important; transition: none !important; }
}

/* scrollbars: same shape as GameMaster's (10px, tinted track, rounded thumb, no arrows), in this palette */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background-color: rgba(255, 255, 255, 0.04); }
*::-webkit-scrollbar-thumb { border-radius: 14px; box-shadow: inset 0 0 14px rgba(120, 126, 138, 0.75); }
*::-webkit-scrollbar-thumb:hover { box-shadow: inset 0 0 14px rgba(160, 166, 178, 0.85); }
*::-webkit-scrollbar-corner { background-color: rgba(255, 255, 255, 0.04); }
*::-webkit-scrollbar-button { display: none; }
