/* Shared GridMango teal interface layer. Loaded after page-specific styles. */
:root {
    --gm-teal-900: #145e63;
    --gm-teal-800: #176f73;
    --gm-teal-700: #1b7f82;
    --gm-teal-600: #218f91;
    --gm-teal-500: #2aa6a5;
    --gm-teal-100: #e2f5f3;
    --gm-teal-050: #f1fbfa;
    --gm-teal-shadow: rgba(27, 127, 130, 0.2);
}

/* Shared tool-shell treatment: quiet canvas, clear hierarchy, and consistent
   surfaces across workspace tools and standalone protocol consoles. */
body:has(.app-container),
body:has(.layout),
body:has(.oadr20a-page),
body:has(.workflow-page) {
    background: var(--gm-page-background);
    background-attachment: fixed;
}

.app-container .controls-panel,
.app-container .results-panel,
.layout .content,
.layout .sidebar,
.oadr20a-card,
.workflow-panel {
    border-color: #d8e7e7;
    box-shadow: 0 16px 42px rgba(20, 94, 99, .08);
}

.app-container .controls-panel:hover,
.app-container .results-panel:hover {
    border-color: rgba(27, 127, 130, .24);
}

.app-container .panel-header,
.oadr20a-card h2,
.workflow-panel h2 {
    color: var(--gm-text, #0f172a);
}

.oadr20a-page h1,
.oadr20a-page h2,
.oadr20a-page h3,
.workflow-page h1,
.workflow-page h2,
.workflow-page h3,
.layout h2,
.layout h3,
.layout h4 {
    font-family: "Instrument Sans", sans-serif;
    letter-spacing: -.025em;
}

.app-container .panel-header {
    border-bottom-color: rgba(27, 105, 113, .16);
}

.app-container .tool-card.is-active {
    border-color: #91d5d1;
    box-shadow: inset 0 0 0 1px rgba(27, 127, 130, .18);
}

.app-container .tool-card:hover {
    border-color: rgba(27, 127, 130, .28);
}

.workflow-node {
    border-left-color: var(--gm-teal-700) !important;
}

.workflow-step-label,
.workflow-kicker,
.workflow-fingerprint {
    color: var(--gm-teal-800) !important;
}

.oadr20a-boundary,
.oadr20a-status {
    border-color: #cce8e6;
    background: var(--gm-teal-050);
    color: var(--gm-teal-900);
}

.oadr20a-table th,
.oadr20a-table td {
    border-bottom-color: #dcebea;
}

.checkbox-row input[type="checkbox"]:checked {
    background: var(--gm-teal-700) !important;
    border-color: var(--gm-teal-700) !important;
}

/* Compact journey rail used by tools that do not need the full baseline sidebar. */
.tool-journey {
    display: grid;
    grid-template-columns: minmax(170px, .7fr) minmax(0, 2.3fr);
    gap: 1rem;
    align-items: center;
    margin: 0 0 1.2rem;
    padding: .9rem 1rem;
    border: 1px solid #cce8e6;
    border-radius: 16px;
    background: linear-gradient(135deg, #f3fbfa 0%, #f8fcfd 100%);
}

.tool-journey-heading {
    display: grid;
    gap: .18rem;
}

.tool-journey-eyebrow {
    color: var(--gm-teal-800);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tool-journey-heading strong {
    color: var(--gm-text, #0f172a);
    font-size: .95rem;
}

.tool-journey-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .55rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tool-journey-step {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    padding: .55rem .65rem;
    border: 1px solid #d8e7e7;
    border-radius: 11px;
    background: #fff;
}

.tool-journey-step.is-current {
    border-color: #91d5d1;
    background: var(--gm-teal-100);
}

.tool-journey-number {
    display: inline-grid;
    place-items: center;
    flex: 0 0 1.45rem;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 999px;
    background: #dcebea;
    color: var(--gm-teal-900);
    font-size: .73rem;
    font-weight: 800;
}

.tool-journey-step.is-current .tool-journey-number {
    background: var(--gm-teal-700);
    color: #fff;
}

.tool-journey-copy {
    display: grid;
    min-width: 0;
    gap: .08rem;
}

.tool-journey-copy strong,
.tool-journey-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-journey-copy strong {
    color: var(--gm-text, #0f172a);
    font-size: .77rem;
}

.tool-journey-copy small {
    color: var(--gm-text-muted, #475569);
    font-size: .68rem;
}

@media (max-width: 1050px) {
    .tool-journey {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .tool-journey-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Primary actions use one restrained teal surface instead of blue-to-cyan gradients. */
.primary-btn,
.primary-action,
.primary-cta,
.hero-primary-btn,
.hero-search-btn,
.btn.primary,
.workflow-primary,
.oadr20a-btn.primary,
.auth-form .primary,
.auth-card .primary,
.contact-submit,
.pricing-primary-btn,
.academy-primary-btn,
.cap-primary,
.trust-primary-action {
    background: var(--gm-teal-700) !important;
    border-color: var(--gm-teal-700) !important;
    color: #fff !important;
    box-shadow: 0 8px 18px var(--gm-teal-shadow);
}

.primary-btn:hover:not(:disabled),
.primary-action:hover:not(:disabled),
.primary-cta:hover,
.hero-primary-btn:hover,
.hero-search-btn:hover,
.btn.primary:hover:not(:disabled),
.workflow-primary:hover:not(:disabled),
.oadr20a-btn.primary:hover:not(:disabled),
.auth-form .primary:hover:not(:disabled),
.auth-card .primary:hover:not(:disabled),
.contact-submit:hover:not(:disabled),
.pricing-primary-btn:hover,
.academy-primary-btn:hover,
.cap-primary:hover,
.trust-primary-action:hover {
    background: var(--gm-teal-900) !important;
    border-color: var(--gm-teal-900) !important;
}

.primary-btn:focus-visible,
.primary-action:focus-visible,
.primary-cta:focus-visible,
.hero-primary-btn:focus-visible,
.hero-search-btn:focus-visible,
.btn.primary:focus-visible,
.workflow-primary:focus-visible,
.oadr20a-btn.primary:focus-visible,
.contact-submit:focus-visible,
.pricing-primary-btn:focus-visible,
.academy-primary-btn:focus-visible {
    outline: 3px solid rgba(42, 166, 165, 0.35);
    outline-offset: 2px;
}

/* Keep the OpenADR 2.0a stepper aligned with the shared teal system. */
.oadr20a-step-card::before {
    background: var(--gm-teal-700) !important;
}

.oadr20a-stepper-eyebrow {
    color: var(--gm-teal-800) !important;
}

.oadr20a-step-pill.is-current .oadr20a-step-number {
    border-color: var(--gm-teal-700) !important;
    background: var(--gm-teal-700) !important;
}

/* Secondary controls and active states share the same teal vocabulary. */
.secondary-btn.is-active,
.tool-tag.is-active,
.nav-btn.is-active,
.tab-btn.is-active,
.mode-btn.active,
.workspace-return-link:hover,
.oadr20a-pill,
.workflow-private-badge {
    border-color: #91d5d1 !important;
    background: var(--gm-teal-100) !important;
    color: var(--gm-teal-900) !important;
}

.secondary-btn:hover,
.tool-tag:hover,
.nav-btn:hover,
.tab-btn:hover,
.mode-btn:hover {
    border-color: #91d5d1 !important;
    background: var(--gm-teal-050) !important;
}

.btn-inline,
.ghost-btn,
.secondary-inline-btn,
.oadr20a-btn:not(.primary):not(.danger),
.workflow-actions button:not(.workflow-primary) {
    border-color: #b8dedd !important;
}

/* Teal replaces residual blue accents in tool labels, focus states, and navigation. */
.hero-compact-kicker,
.workflow-private-badge,
.workflow-kicker,
.workflow-step-label,
.workflow-fingerprint,
.oadr20a-eyebrow,
.cap-kicker,
.section-kicker,
.tool-card a,
.tool-card .tool-link,
.openadr3-eyebrow {
    color: var(--gm-teal-800) !important;
}

input:focus,
select:focus,
textarea:focus,
.input:focus,
.oadr20a-input:focus,
.workflow-panel input:focus,
.workflow-panel select:focus,
.workflow-panel textarea:focus {
    border-color: #66c2be !important;
    box-shadow: 0 0 0 3px rgba(42, 166, 165, 0.16) !important;
    outline: none;
}

.checkbox-row input[type="checkbox"]:checked,
input[type="radio"]:checked {
    accent-color: var(--gm-teal-700);
}

.status.success,
.inline-status.success,
.workflow-message.success {
    color: #0f766e !important;
}

@media (prefers-reduced-motion: reduce) {
    .primary-btn,
    .primary-action,
    .primary-cta,
    .hero-primary-btn,
    .hero-search-btn,
    .btn.primary,
    .workflow-primary,
    .oadr20a-btn.primary {
        transition: none !important;
    }
}
