/* Arena Cloud Styles - Mimic Design System */
/* Left sidebar layout matching the Mimic Management Plane */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
    --color-bg: #191919;
    --color-surface: #1c1c1c;
    --color-surface-elevated: #252525;
    --color-text: #ffffff;
    --color-text-secondary: #b5b3af;
    /* Was #666 — failed WCAG AA on the dark bg (~3.2:1) and read as
       barely-visible on dense surfaces (events list timestamps, tab
       labels, badge text, breadcrumbs). Bumped to a clearly legible
       grey that still sits below secondary in the visual hierarchy
       (text > secondary > muted). */
    --color-text-muted: #8a8a8a;
    --color-border: #333333;
    --color-accent: #D4B25A;
    --color-accent-hover: #e5c36b;

    --color-success: #22c55e;
    --color-info: #3b82f6;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;

    /* PA-215 run-actions design tokens.
       The handoff doc at docs/design_handoff_run_actions/ defines an
       overlapping palette — we map most names to existing tokens
       (gold↔accent, panel↔surface, fg1/2/3↔text/secondary/muted,
       danger↔danger) and only add what doesn't exist:
         --color-suspend: amber for the SUSPENDED state badge + dot.
                          Distinct from --color-warning which is used
                          for other UI affordances.
         --color-running-strong: vivid green for the RUNNING dot in
                          the new action-system surfaces. Doesn't
                          replace --color-success (button affordances).
         --color-hover:   menu/sheet item hover background. Sits
                          between --color-surface and -surface-elevated.
    */
    --color-suspend: #e0a23c;
    --color-running-strong: #5db14e;
    --color-hover: #202020;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);

    --sidebar-width: 220px;
    --radius: 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}

body:has(.app-layout) {
    height: 100vh;
    overflow: hidden;
}

/* ==================== Sidebar Layout ==================== */

.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: #000000;
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
}

.sidebar-brand-env {
    color: var(--color-text);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.sidebar-section {
    padding: 0.5rem 1.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-top: 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s, background-color 0.15s;
}

.sidebar-link:hover {
    color: var(--color-text);
    background-color: var(--color-surface-elevated);
}

.sidebar-link.active {
    color: var(--color-accent);
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-link.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: var(--color-text-secondary);
    font-size: 0.8125rem;
}

.sidebar-user:hover {
    color: var(--color-text);
}

.sidebar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--color-accent);
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    flex-shrink: 0;
}

.sidebar-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Main content area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
}

main {
    max-width: 1200px;
    padding: 2rem;
}

/* Mobile hamburger */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5rem;
    background-color: #000000;
    border-bottom: 1px solid var(--color-border);
    z-index: 90;
    align-items: center;
    padding: 0 1rem;
    gap: 0.75rem;
}

.mobile-header .nav-brand {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.mobile-header .btn {
    height: 1.75rem;
    padding: 0 0.625rem;
    font-size: 0.75rem;
}

.hamburger-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger-btn:hover {
    color: var(--color-text);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 99;
}

/* ==================== Responsive ==================== */

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding-top: 3.5rem;
        height: 100vh;
    }

    main {
        padding: 1.25rem;
    }
}

/* ==================== Page Components ==================== */

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--color-text-secondary);
}

.breadcrumb a:hover {
    color: var(--color-accent);
}

.breadcrumb-sep {
    color: var(--color-text-muted);
    user-select: none;
}

.breadcrumb-current {
    color: var(--color-text);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.subtitle {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .page-header h1,
    .page-header .subtitle {
        display: none;
    }
    .page-header {
        margin-bottom: 0.75rem;
    }
    .page-header-actions {
        width: 100%;
    }
    .page-header-actions .btn {
        flex: 1;
    }
}

/* Cards */
.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s, border-color 0.2s;
}

.card:hover {
    background-color: var(--color-surface-elevated);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card h2, .card h3 {
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.4375rem 1rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

/* PA-215: cap any inline SVG inside a button to text-size. Without
   this rule, SVGs emitted by static/js/run-actions.js render at their
   intrinsic viewBox (24px) or worse stretch to fill — leading to
   icons bleeding outside the button bounds. */
.btn svg {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
}

/* btn-row removed — use Tailwind: flex flex-col sm:flex-row gap-2 mt-4 sm:max-w-sm */

.btn-primary {
    background-color: var(--color-accent);
    color: #000000;
    border-color: var(--color-accent);
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: #000000;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-surface-elevated);
    border-color: var(--color-text-secondary);
}

.btn-danger {
    background-color: transparent;
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 0.375rem;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

/* Make <select class="form-input"> obviously a dropdown in dark mode.
   The native arrow is near-invisible against our dark surface, so swap
   it for a chevron SVG matched to --color-text-muted. Padding-right
   keeps the chosen label clear of the chevron. */
select.form-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    background-size: 14px;
    padding-right: 2rem;
    cursor: pointer;
}

/* iOS Safari auto-zooms the page when an <input>/<select>/<textarea> has a
   font-size below 16px on focus. Bump every form input to 16px below the
   sm breakpoint to suppress the zoom. The desktop size (0.875rem) is
   restored at >= 640px where the issue doesn't apply. */
@media (max-width: 639px) {
    .form-input {
        font-size: 16px;
    }
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-surface);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

tr:hover td {
    background-color: var(--color-surface-elevated);
}

/* Status Badges
   PA-215 design-handoff conformance: 5px border-radius gives the
   pill shape the run-actions design system mockups use (was
   square-cornered before). Affects every existing badge variant —
   visual change is small, applies site-wide. */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid;
    border-radius: 0.3125rem;
}

.badge-success { color: var(--color-success); border-color: var(--color-success); background-color: rgba(34, 197, 94, 0.1); }
.badge-warning { color: var(--color-warning); border-color: var(--color-warning); background-color: rgba(245, 158, 11, 0.1); }
.badge-danger  { color: var(--color-danger);  border-color: var(--color-danger);  background-color: rgba(239, 68, 68, 0.1); }
.badge-info    { color: var(--color-info);    border-color: var(--color-info);    background-color: rgba(59, 130, 246, 0.1); }
.badge-muted   { color: var(--color-text-muted); border-color: var(--color-text-muted); background-color: rgba(102, 102, 102, 0.1); }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; box-sizing: border-box; }
.status-dot-success { background-color: var(--color-success); }
.status-dot-warning { background-color: var(--color-warning); }
.status-dot-danger  { background-color: var(--color-danger); }
.status-dot-info    { background-color: var(--color-info); }
.status-dot-muted   { background-color: var(--color-text-muted); }
/* PA-215: outline dot for destroyed — matches the "Destroyed" pill
   which is also outline/muted. Conveys terminal-but-not-failed. */
.status-dot-outline {
    background-color: transparent;
    border: 1.5px solid var(--color-text-secondary);
}
.status-dot-pulse   { animation: status-dot-pulse 1.4s ease-in-out infinite; }

@keyframes status-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.85); }
}

/* Stats */
.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid;
    font-size: 0.875rem;
}

.alert-error   { background-color: rgba(239, 68, 68, 0.1); border-color: var(--color-danger);  color: var(--color-danger); }
.alert-success { background-color: rgba(34, 197, 94, 0.1);  border-color: var(--color-success); color: var(--color-success); }
.alert-info    { background-color: rgba(59, 130, 246, 0.1);  border-color: var(--color-info);    color: var(--color-info); }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-muted);
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Monospace */
.mono { font-family: 'DM Mono', monospace; }

/* Links */
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }

/* Utility */
.text-muted     { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-accent    { color: var(--color-accent); }
.text-success   { color: var(--color-success); }
.text-danger    { color: var(--color-danger); }
.text-sm        { font-size: 0.875rem; }
.text-xs        { font-size: 0.75rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* JSON syntax highlighting */
.json-display {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    padding: 1rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    color: #e0e0e0;
}

.jh-key     { color: #e06c75; }
.jh-string  { color: #98c379; }
.jh-number  { color: #d19a66; }
.jh-bool    { color: #d19a66; }
.jh-null    { color: #666; }

/* Share form row */
.share-form-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: stretch;
    height: 2.25rem;
}

.share-target-input {
    flex: 1;
    max-width: 300px;
}

@media (max-width: 768px) {
    .share-form-row {
        flex-direction: column;
        height: auto;
    }
    .share-target-input {
        max-width: 100%;
    }
}

/* Resource list items (configs, projects, etc.) */
.resource-list,
.project-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.resource-item,
.project-item {
    display: block;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: inherit;
}

/* The global `a:hover` recolors anchors to the accent on hover — keep
   the project-item card inheriting its parent text colour instead so
   the card surface doesn't suddenly flash accent-coloured. */
.project-item:hover {
    color: inherit;
    text-decoration: none;
}

.resource-item-header,
.project-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.625rem;
}

.resource-item-name,
.project-item-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-accent);
}

.resource-item-badges,
.project-item-badges {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.resource-item-details,
.project-item-details {
    display: flex;
    gap: 2rem;
    padding-left: 0.25rem;
}

.resource-item-detail,
.project-item-detail {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

/* Mobile show/hide helpers */
.show-mobile { display: none !important; }
.hide-mobile { }

@media (max-width: 768px) {
    .show-mobile { display: inline !important; }
    .hide-mobile { display: none !important; }

    .resource-item-header,
    .project-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .resource-item-details,
    .project-item-details {
        flex-direction: column;
        gap: 0.5rem;
        padding-left: 0.75rem;
        border-left: 2px solid var(--color-border);
        margin-top: 0.25rem;
    }
}

/* Syntax highlighting */
.syn-key { color: var(--color-accent); }
.syn-str { color: #4ade80; }
.syn-num { color: #60a5fa; }
.syn-bool { color: #c084fc; }
.syn-null { color: #6b7280; }
.syn-punct { color: #9ca3af; }
.syn-comment { color: #6b7280; font-style: italic; }

.preview-code {
    font-size: 0.8125rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    color: var(--color-text);
}

/* ==================== PA-210: shared-link minimal layout ==================== */

/* When ``hide_chrome`` is set on the base template (anonymous viewer
   on a public share link), the sidebar is omitted entirely and the
   main-content takes the full viewport width with a slim brand bar
   pinned to the top. */

.shared-link-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3.25rem;
    background-color: #000000;
    border-bottom: 1px solid var(--color-border);
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
}

.shared-link-brand-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-text);
}

.shared-link-brand-name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.shared-link-brand-right {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.app-layout-no-sidebar {
    /* Override the flex layout so the main-content can use the full
       viewport without the sidebar's fixed-width column eating space. */
    display: block;
}

.main-content-no-sidebar {
    /* The default ``.main-content`` has ``margin-left: var(--sidebar-width)``
       to clear the fixed sidebar; here there's no sidebar, so reclaim
       that space. ``padding-top`` makes room for the brand header. */
    margin-left: 0;
    padding-top: 3.25rem;
}

/* ============================================================
   PA-215 run-actions design system
   ============================================================
   State-aware action surfaces: kebab dropdown (list rows + detail
   "More"), primary-action cluster (detail header), bottom sheet
   (mobile). Single source of truth is static/js/run-actions.js;
   these classes are the visual primitives it composes.
*/

/* Kebab trigger — icon-only outline button. Border is permanent
   (matches the handoff's "icon-only outline button" spec) so it
   reads as a peer of the .btn-secondary buttons next to it in the
   detail-header cluster, not a low-emphasis hover affordance.
   Sized to .btn-sm height (~30 px) for vertical alignment. */
.kebab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.875rem;
    width: 1.875rem;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 0.4375rem;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

/* "⋮ Actions" trigger on the run-detail header. .btn renders square
   by default (--rounded-btn: 0 in tailwind.config.js / daisyUI) but
   the list-row kebab is rounded — this overrides just the detail-page
   trigger so the two read as one family. Matches the kebab's
   0.4375rem so the visual radius is identical regardless of which
   surface the user is looking at. */
.run-actions-trigger {
    border-radius: 0.4375rem;
}
.kebab:hover {
    background: var(--color-surface-elevated);
    border-color: var(--color-text-secondary);
    color: var(--color-text);
}
.kebab[aria-expanded="true"] {
    background: var(--color-surface-elevated);
    border-color: var(--color-text-secondary);
    color: var(--color-text);
}
.kebab svg {
    width: 1.0625rem;
    height: 1.0625rem;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Dropdown menu — anchored top-right relative to the kebab.
   Closed via the ``hidden`` Tailwind utility; the open state lives
   on the wrapper rather than this element. */
.run-action-menu {
    position: absolute;
    top: calc(100% + 0.375rem);
    right: 0;
    min-width: 13rem;
    padding: 0.375rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.625rem;
    box-shadow: 0 14px 32px -8px rgba(0, 0, 0, 0.7), 0 4px 12px -4px rgba(0, 0, 0, 0.6);
    z-index: 60;
    animation: ramenu-in 130ms cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top right;
}
@keyframes ramenu-in {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.run-action-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0 0.625rem;
    height: 2.375rem;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-size: 0.84375rem;
    font-weight: 500;
    text-align: left;
    border-radius: 0.3125rem;
    cursor: pointer;
    transition: background-color 0.1s ease;
}
.run-action-menu .menu-item:hover {
    background: var(--color-hover);
}
.run-action-menu .menu-item:hover svg {
    color: var(--color-text);
}
.run-action-menu .menu-item svg {
    width: 1rem;
    height: 1rem;
    color: var(--color-text-secondary);
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.run-action-menu .menu-item.danger {
    color: var(--color-danger);
}
.run-action-menu .menu-item.danger svg {
    color: var(--color-danger);
}
.run-action-menu .menu-item.danger:hover {
    background: rgba(234, 90, 61, 0.12);
}
.run-action-menu .menu-sep {
    height: 1px;
    margin: 0.375rem 0.25rem;
    background: var(--color-border);
}

/* Mobile bottom sheet — slides up from the bottom; populated from
   the same action model as the desktop menu. Fixes the run-show
   mobile bug where action buttons reflowed to the foot of long pages. */
.bottom-sheet-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    z-index: 90;
    opacity: 0;
    transition: opacity 200ms ease;
    pointer-events: none;
}
.bottom-sheet-scrim.open {
    opacity: 1;
    pointer-events: auto;
}
.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-top-left-radius: 1.25rem;
    border-top-right-radius: 1.25rem;
    padding: 0.75rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 270ms cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    overflow-y: auto;
}
.bottom-sheet.open {
    transform: translateY(0);
}
.bottom-sheet-grip {
    width: 2.25rem;
    height: 0.25rem;
    margin: 0.25rem auto 0.625rem;
    background: var(--color-border);
    border-radius: 9999px;
}
.bottom-sheet-eyebrow {
    padding: 0 0.625rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.0875rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.bottom-sheet .sheet-item {
    display: flex;
    align-items: center;
    gap: 0.9375rem;
    width: 100%;
    height: 3.375rem;
    padding: 0 0.875rem;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    border-radius: 0.6875rem;
    cursor: pointer;
}
.bottom-sheet .sheet-item:active {
    background: var(--color-hover);
}
.bottom-sheet .sheet-item svg {
    width: 1.3125rem;
    height: 1.3125rem;
    color: var(--color-text-secondary);
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.bottom-sheet .sheet-item.danger {
    color: var(--color-danger);
}
.bottom-sheet .sheet-item.danger svg {
    color: var(--color-danger);
}
.bottom-sheet .menu-sep {
    height: 1px;
    margin: 0.375rem 0.625rem;
    background: var(--color-border);
}

/* Toast — bottom-centre, used by suspend/resume/copy/teardown/share
   to confirm an action. Auto-removed after ~1.6s. */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(0.5rem);
    padding: 0.625rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.6);
    color: var(--color-text);
    font-size: 0.875rem;
    z-index: 120;
    opacity: 0;
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Confirm dialog — used by Teardown (and any future destructive
   action). Centred, pop-in animation. The destructive button is
   NOT default-focused (per handoff spec). */
.confirm-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.confirm-dialog {
    width: 27.5rem;
    max-width: 92vw;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.875rem;
    box-shadow: 0 14px 32px -8px rgba(0, 0, 0, 0.7), 0 4px 12px -4px rgba(0, 0, 0, 0.6);
    padding: 1.25rem;
    animation: rdlg-pop 180ms cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes rdlg-pop {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.confirm-tile-danger,
.confirm-tile-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.625rem;
    height: 2.625rem;
    border-radius: 0.625rem;
    margin-bottom: 0.75rem;
    border: 1px solid;
}
.confirm-tile-danger {
    background: rgba(234, 90, 61, 0.12);
    border-color: rgba(234, 90, 61, 0.45);
    color: var(--color-danger);
}
/* PA-215: warning variant for confirms on reversible-but-disruptive
   actions like Suspend (stops every VM but resume restores). Same
   amber palette as the SUSPENDED status pill so the affordance
   reads as "pausing", not "destroying". */
.confirm-tile-warning {
    background: rgba(224, 162, 60, 0.12);
    border-color: rgba(224, 162, 60, 0.45);
    color: var(--color-suspend);
}
.confirm-tile-danger svg,
.confirm-tile-warning svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* btn-warning — amber CTA for non-destructive-but-significant
   actions (currently the Suspend confirm). Solid fill so it reads
   as the primary action, distinct from btn-danger's red. */
.btn-warning {
    background: var(--color-suspend);
    color: #000000;
    border-color: var(--color-suspend);
}
.btn-warning:hover:not(:disabled) {
    background: #c4862a;
    border-color: #c4862a;
}
.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* btn-ghost — handoff's third button variant, missing from existing
   set. Transparent button with muted text, hover fills surface-hover. */
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--color-text-secondary);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--color-hover);
    color: var(--color-text);
}

/* SUSPENDED state badge — amber. Mirrors the existing badge variants
   in colour treatment but uses --color-suspend so the SUSPENDED chip
   is visually distinct from the WARNING badge used elsewhere. */
.badge-suspend {
    background-color: rgba(224, 162, 60, 0.12);
    color: var(--color-suspend);
    border-color: rgba(224, 162, 60, 0.45);
}
.status-dot-suspend {
    background-color: var(--color-suspend);
}

/* Kebab cell on runs-list rows. Always visible per the handoff
   prototype — the ⋮ trigger is part of the row's visual rhythm,
   not a hover affordance. */
.run-row-actions {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
