/* Hallmark · shape: app screen · screen: SISMUN operations register · genre modern-minimal · theme: paper and press slate · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S5 R5 V4 · weakest: E, the existing controls needed a clearer status-first register */
/* Hallmark · finish-review: rubber-duck · 1 finding · 1 resolved */
:root {
    color-scheme: light;
    --color-paper: oklch(96% 0.014 82);
    --color-paper-raised: oklch(99% 0.008 82);
    --color-paper-inset: oklch(93% 0.018 82);
    --color-ink: oklch(27% 0.026 252);
    --color-muted: oklch(48% 0.025 252);
    --color-rule: oklch(84% 0.02 82);
    --color-rule-strong: oklch(64% 0.026 252);
    --color-navy: oklch(43% 0.075 254);
    --color-navy-deep: oklch(28% 0.045 254);
    --color-peach: oklch(79% 0.09 58);
    --color-inverse: oklch(98% 0.008 82);
    --color-inverse-muted: oklch(87% 0.018 250);
    --color-danger: oklch(47% 0.14 28);
    --color-danger-wash: oklch(95% 0.025 35);
    --color-success: oklch(43% 0.09 150);
    --color-success-rule: oklch(77% 0.06 150);
    --color-danger-rule: oklch(76% 0.075 35);
    --color-status-warn: oklch(56% 0.11 70);
    --color-focus: oklch(48% 0.14 250);
    --color-backdrop: oklch(22% 0.025 252 / 0.48);
    --color-skeleton: oklch(92% 0.015 82);
    --font-body: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-seal: Georgia, "Times New Roman", serif;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --radius-control: 0.375rem;
    --radius-panel: 0.5rem;
    --shadow-panel: 0 1px 2px oklch(27% 0.026 252 / 0.07);
    --duration-press: 100ms;
    --duration-short: 180ms;
    --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html,
body {
    min-height: 100%;
    overflow-x: clip;
}
html { background: var(--color-paper); }
body {
    margin: 0;
    color: var(--color-ink);
    background: var(--color-paper);
    font: 16px/1.55 var(--font-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
button,
a { font: inherit; }
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
}
button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
code {
    padding: 0.1em 0.35em;
    border-radius: 0.2rem;
    color: var(--color-ink);
    background: var(--color-paper-inset);
    font: 0.88em ui-monospace, SFMono-Regular, Menlo, monospace;
}

.skip-link {
    position: absolute;
    z-index: 10;
    top: calc(-1 * var(--space-12));
    left: var(--space-4);
    padding: var(--space-2) var(--space-4);
    color: var(--color-inverse);
    background: var(--color-navy-deep);
}
.skip-link:focus { top: var(--space-4); }

.topbar {
    min-height: 4.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    padding-inline: max(var(--space-6), calc((100% - 74rem) / 2));
    border-bottom: 3px solid var(--color-peach);
    color: var(--color-inverse);
    background: var(--color-navy-deep);
}
.wordmark {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 44px;
    color: inherit;
    font-size: 0.94rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
}
.wordmark:focus-visible { outline-color: var(--color-peach); }
.seal {
    width: 2.15rem;
    height: 2.15rem;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--color-inverse-muted);
    border-radius: 50%;
    color: var(--color-peach);
    font: 1.25rem/1 var(--font-seal);
}
.wordmark-light {
    color: var(--color-inverse-muted);
    font-weight: 450;
}
.topbar-meta {
    color: var(--color-inverse-muted);
    font-size: 0.82rem;
}

.shell {
    width: min(calc(100% - var(--space-12)), 74rem);
    margin-inline: auto;
}
.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-8);
    padding-block: var(--space-12) var(--space-8);
}
h1,
h2,
p { margin-top: 0; }
h1 {
    max-width: 24ch;
    min-width: 0;
    margin-bottom: var(--space-2);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
    text-wrap: balance;
    overflow-wrap: break-word;
}
h2 {
    max-width: 32ch;
    min-width: 0;
    margin-bottom: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    text-wrap: balance;
    overflow-wrap: break-word;
}
.lede,
.section-copy {
    margin: 0;
    color: var(--color-muted);
}
.lede { max-width: 58ch; }
.section-copy {
    margin-top: var(--space-1);
    font-size: 0.875rem;
}

.button {
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 650;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    touch-action: manipulation;
    transition:
        color var(--duration-short) var(--ease-out),
        background-color var(--duration-short) var(--ease-out),
        border-color var(--duration-short) var(--ease-out),
        transform var(--duration-press) var(--ease-out);
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { transform: none; }
.button-primary {
    color: var(--color-inverse);
    background: var(--color-navy);
}
.button-primary:hover:not(:disabled) { background: var(--color-navy-deep); }
.button-secondary {
    border-color: var(--color-rule-strong);
    color: var(--color-ink);
    background: transparent;
}
.button-secondary:hover:not(:disabled) { background: var(--color-paper-inset); }
.button-production {
    border-color: var(--color-danger);
    color: var(--color-danger);
    background: transparent;
}
.button-production:hover:not(:disabled) {
    color: var(--color-inverse);
    background: var(--color-danger);
}
.refresh-button { min-width: 9rem; }
.button[aria-busy="true"] { cursor: progress; }

.status-panel {
    padding: var(--space-5) var(--space-6) var(--space-2);
    border-top: 3px double var(--color-ink);
    border-bottom: 3px double var(--color-ink);
    background: var(--color-paper-raised);
}
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}
.run-state {
    min-height: 1.75rem;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-rule-strong);
    border-radius: 999px;
    color: var(--color-muted);
    background: var(--color-paper-raised);
    font-size: 0.75rem;
    font-weight: 650;
    line-height: 1.2;
}
.run-state[data-state="success"] {
    border-color: var(--color-success-rule);
    color: var(--color-success);
}
.run-state[data-state="error"] {
    border-color: var(--color-danger-rule);
    color: var(--color-danger);
}
.status-list {
    margin-top: var(--space-4);
    border-top: 1px solid var(--color-rule);
}
.status-row {
    min-height: 3.5rem;
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) minmax(8rem, 0.55fr) minmax(12rem, 1fr);
    align-items: center;
    gap: var(--space-4);
    border-bottom: 1px solid var(--color-rule);
}
.status-name {
    min-width: 0;
    font-weight: 650;
}
.status-detail {
    min-width: 0;
    color: var(--color-muted);
    font-size: 0.875rem;
}
.status-value {
    width: fit-content;
    min-height: 1.75rem;
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-rule);
    border-radius: 999px;
    color: var(--color-muted);
    font-size: 0.8125rem;
    font-weight: 650;
}
.status-value[data-state="active"] {
    border-color: var(--color-success-rule);
    color: var(--color-success);
}
.status-value[data-state="inactive"] {
    border-color: var(--color-danger-rule);
    color: var(--color-danger);
}
.status-value[data-state="unknown"] {
    border-color: var(--color-rule-strong);
    color: var(--color-muted);
}
.skeleton {
    color: transparent;
    background: linear-gradient(90deg, transparent, var(--color-skeleton), transparent);
    background-size: 200% 100%;
    animation: status-loading 1.4s linear infinite;
}
@keyframes status-loading {
    to { background-position: -200% 0; }
}
.feedback {
    min-height: 1lh;
    margin: var(--space-3) 0;
    color: var(--color-muted);
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}
.feedback[data-state="error"] { color: var(--color-danger); }
.feedback[data-state="success"] { color: var(--color-success); }

.control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-8);
    margin-top: var(--space-8);
}
.control-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-5);
    padding-block: var(--space-5) var(--space-6);
    border-top: 1px solid var(--color-rule-strong);
}
.panel-heading { min-width: 0; }
.panel-heading p {
    max-width: 48ch;
    margin: var(--space-2) 0 0;
    color: var(--color-muted);
    font-size: 0.9rem;
}
.button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}
.supporting-action {
    display: grid;
    justify-items: start;
    gap: var(--space-1);
}
.text-button {
    min-height: 2.75rem;
    padding: 0;
    border: 0;
    color: var(--color-navy);
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
    touch-action: manipulation;
    transition: color var(--duration-short) var(--ease-out);
}
.text-button:hover:not(:disabled) { color: var(--color-navy-deep); }
.text-button:disabled { cursor: not-allowed; opacity: 0.55; }
.note {
    max-width: 48ch;
    margin: 0;
    color: var(--color-muted);
    font-size: 0.8125rem;
}
.launch-state {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding-block: var(--space-3);
    border-top: 1px solid var(--color-rule);
    border-bottom: 1px solid var(--color-rule);
}
.launch-state span {
    color: var(--color-muted);
    font-size: 0.875rem;
}
.launch-state strong {
    font-size: 0.875rem;
    font-weight: 700;
}
.production-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-6);
    margin-top: var(--space-2);
    padding: var(--space-5) 0;
    border-top: 1px solid var(--color-danger-rule);
    border-bottom: 1px solid var(--color-danger-rule);
    background: var(--color-danger-wash);
}
.production-panel .panel-heading { padding-left: var(--space-5); }
.production-panel .button-row { padding-right: var(--space-5); }

.activity {
    padding-block: var(--space-8) var(--space-6);
    border-top: 1px solid var(--color-rule-strong);
}
.activity-row {
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-4);
    padding-block: var(--space-3);
    border-top: 1px solid var(--color-rule);
    border-bottom: 1px solid var(--color-rule);
    font-size: 0.875rem;
}
.activity-row a,
.history-link { color: var(--color-navy); }
.history-link {
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    margin-top: var(--space-2);
    font-size: 0.875rem;
    font-weight: 650;
    text-underline-offset: 0.2em;
}
.footer {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding-block: var(--space-4) var(--space-8);
    border-top: 1px solid var(--color-rule);
    color: var(--color-muted);
    font-size: 0.8125rem;
}
.footer span:first-child {
    color: var(--color-ink);
    font-weight: 700;
}

.confirm-dialog {
    position: fixed;
    inset: 0;
    width: min(calc(100% - var(--space-8)), 28rem);
    max-height: min(80dvh, 40rem);
    margin: auto;
    padding: 0;
    border: 1px solid var(--color-rule-strong);
    border-radius: var(--radius-panel);
    color: var(--color-ink);
    background: var(--color-paper-raised);
    box-shadow: var(--shadow-panel);
}
.confirm-dialog::backdrop { background: var(--color-backdrop); }
.dialog-body { padding: var(--space-6); }
.dialog-body h2 {
    margin-bottom: var(--space-3);
    font-size: 1.375rem;
}
.dialog-body > p:not(.eyebrow) { color: var(--color-muted); }
.dialog-actions {
    justify-content: flex-end;
    margin-top: var(--space-6);
}
.toast {
    position: fixed;
    right: var(--space-6);
    bottom: var(--space-6);
    z-index: 5;
    max-width: min(27.5rem, calc(100% - var(--space-12)));
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-rule-strong);
    border-radius: var(--radius-control);
    color: var(--color-ink);
    background: var(--color-paper-raised);
    box-shadow: var(--shadow-panel);
    opacity: 0;
    pointer-events: none;
    transform: translateY(var(--space-2));
    transition:
        transform var(--duration-short) var(--ease-out),
        opacity var(--duration-short) var(--ease-out);
}
.toast[data-visible="true"] {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

@media (max-width: 48rem) {
    .shell { width: min(calc(100% - var(--space-8)), 35rem); }
    .topbar {
        min-height: 3.75rem;
        padding-inline: var(--space-4);
    }
    .page-heading {
        align-items: flex-start;
        padding-block: var(--space-8) var(--space-6);
    }
    .control-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-5);
        margin-top: var(--space-6);
    }
    .production-panel {
        grid-column: auto;
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-4);
    }
    .production-panel .panel-heading { padding-inline: var(--space-4); }
    .production-panel .button-row { padding-inline: var(--space-4); }
}
@media (max-width: 32rem) {
    .shell { width: calc(100% - var(--space-6)); }
    .topbar-meta { font-size: 0.75rem; }
    .page-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }
    .status-panel { padding-inline: var(--space-4); }
    .status-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: var(--space-1) var(--space-3);
        padding-block: var(--space-2);
    }
    .status-detail {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    .status-value {
        grid-column: 2;
        grid-row: 1;
    }
    .control-panel { padding-block: var(--space-4); }
    .button-row { width: 100%; }
    .button-row .button { flex: 1 1 8rem; }
    .activity-row { flex-wrap: wrap; }
    .footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
@media (prefers-reduced-transparency: reduce) {
    .topbar { background: var(--color-navy-deep); }
}
@media (prefers-contrast: more) {
    :root {
        --color-muted: oklch(38% 0.025 252);
        --color-rule: oklch(72% 0.02 82);
    }
}
