
:root {
    --brand-blue: #00437e;
    --brand-blue-hover: #00345f;
    --brand-link: #00679c;
    --brand-accent: #0095bf;
    --page-bg: #f0f5f8;
    --surface-soft: #f2f7fa;
    --surface-hover: #e8f4f8;
    --border-color: #dce6ec;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
    background: var(--surface-soft)
}

* {
    box-sizing: border-box
}

body {
    margin: 0
}

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 20px
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px
}

.brand {
    font-weight: 750;
    font-size: 20px
}

.card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 30px rgba(20, 30, 55, .05);
    margin-bottom: 18px
}

.grid {
    display: grid;
    grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px
}

.btn {
    display: inline-block;
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    background: #172033;
    color: white;
    text-decoration: none;
    font-weight: 650;
    font-size: 1rem;
    cursor: pointer
}

.btn.secondary {
    background: #eef1f6;
    color: #172033
}

.btn.danger {
    background: #a72b35
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #98a2b3
}

.ok .dot {
    background: #1f9d61
}

.bad .dot {
    background: #d64545
}

.muted {
    color: #475467
}

.row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center
}

label {
    display: block;
    font-weight: 650;
    margin: 14px 0 6px
}

input, select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #ccd3df;
    border-radius: 9px;
    font: inherit
}

input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

select {
    max-width: 100%;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff4e5;
    margin: 0 0 18px
}

.success {
    background: #eaf8f0
}

.error {
    background: #fdecec
}

.site-header {
    background: #fff;
    border-bottom: 1px solid #dfe4ec;
}

.site-header .wrap {
    padding-top: 8px;
    padding-bottom: 0;
}

.site-header .top {
    margin-bottom: 16px;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 22px;
}

nav a {
    padding: 14px 0;
    color: #344054;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

nav a:hover {
    color: #172033;
    border-bottom-color: #98a2b3;
}

nav a[aria-current="page"] {
    color: #172033;
    font-weight: 700;
    border-bottom-color: #172033;
}

.connection-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

.connection-card:hover {
    border-color: #98a2b3;
    box-shadow: 0 8px 30px #17203318;
}

[id^="connection-"] {
    scroll-margin-top: 24px;
}

.is-loading {
    cursor: wait !important;
    opacity: .8;
}

.is-loading::before {
    content: '';
    display: inline-block;
    width: .85em;
    height: .85em;
    margin-right: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: loading-spin .8s linear infinite;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .is-loading::before {
        animation: none;
    }
}

a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
    outline: 3px solid var(--brand-link);
    outline-offset: 3px;
}

button:disabled {
    cursor: not-allowed;
    background: #5b6473;
    color: #fff;
}

table {
    border-collapse: collapse;
    width: 100%;
    text-align: left;
}

caption {
    text-align: left;
    font-weight: 700;
    padding: 12px 0;
}

th, td {
    border-bottom: 1px solid #ccd3df;
    padding: 12px;
    vertical-align: top;
}

.table-scroll {
    overflow-x: auto;
}

.participant {
    border-top: 1px solid #ccd3df;
    padding: 18px 0;
}

.inline-form {
    display: inline-block;
}

summary {
    cursor: pointer;
    padding: 12px 0;
    font-weight: 650;
}

dt {
    font-weight: 650;
}

dd {
    overflow-wrap: anywhere;
    margin: 0 0 12px;
}

pre {
    overflow: auto;
    background: #101828;
    color: #f2f4f7;
    padding: 16px;
    border-radius: 12px
}

/* Shared visual hierarchy for the bridge workspace. */
:root {
    font-size: 15px;
    background: var(--page-bg);
    color: #202c3d;
    line-height: 1.5;
}

.wrap {
    max-width: 1280px;
    padding: 28px 32px;
}

h1 {
    font-size: 1.8rem;
    letter-spacing: -.035em;
    line-height: 1.2;
    margin: 0 0 24px;
}

h2 {
    font-size: 1.08rem;
    line-height: 1.4;
    margin: 0 0 14px;
}

h3 {
    font-size: 1rem;
    margin: 20px 0 10px;
}

p {
    margin: 0 0 12px;
}

a {
    color: var(--brand-blue);
    text-underline-offset: 3px;
}

.card {
    border-color: var(--border-color);
    border-radius: 10px;
    padding: 22px;
    box-shadow: none;
}

.grid {
    gap: 16px;
}

.btn {
    background: var(--brand-blue);
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 9px 14px;
    font: 600 .9rem/1.4 Inter, system-ui, sans-serif;
    min-height: 40px;
}

.btn:hover {
    background: var(--brand-blue-hover);
}

.btn.secondary {
    background: #fff;
    color: #354459;
    border-color: #cfd7e2;
}

.btn.secondary:hover {
    background: #f0f4f8;
}

.btn.danger:hover {
    background: #86212a;
}

.site-header .top {
    margin-bottom: 0;
}

.site-header .brand {
    font-size: 1.1rem;
    letter-spacing: -.02em;
}

.site-header .btn.secondary {
    border-color: transparent;
    background: transparent;
    color: #566276;
}

nav {
    gap: 0 26px;
}

nav a {
    padding: 8px 0;
    font-size: .9rem;
}

nav a[aria-current="page"] {
    color: var(--brand-blue);
    border-bottom-color: var(--brand-accent);
}

input, select, textarea {
    font: inherit;
    border: 1px solid #cfd7e2;
    border-radius: 6px;
    background: #fff;
    color: inherit;
    padding: 9px 11px;
    max-width: 100%;
}

textarea {
    width: 100%;
    resize: vertical;
}

input[type="checkbox"] {
    accent-color: var(--brand-blue);
}

select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--brand-link);
    outline-offset: 3px;
}

th {
    font-size: .8rem;
    color: #536176;
    background: var(--surface-soft);
    font-weight: 600;
}

th, td {
    border-bottom-color: #e3e8ef;
    padding: 12px 14px;
}

.alert {
    border-radius: 6px;
    font-size: .9rem;
}

.status-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    background: #eaf0f7;
    border: 1px solid #dbe4ef;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: .85rem;
    margin-bottom: 24px;
    color: #42536b;
}

.page-heading, .course-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-heading h1 {
    margin: 0;
}

.eyebrow {
    color: #647187;
    font-size: .78rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.dashboard-metrics .card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 180px;
}

.dashboard-metrics h2 {
    color: #59677a;
    font-size: .85rem;
    font-weight: 600;
}

.dashboard-metrics .card > a:last-child {
    margin-top: auto;
    font-size: .87rem;
    text-decoration: none;
}

.metric {
    font-size: 2.5rem;
    line-height: 1.1;
    font-weight: 650;
    letter-spacing: -.04em;
}

.status-pill {
    display: inline-flex;
    border-radius: 5px;
    padding: 3px 9px;
    background: #edf2f8;
    color: #354b68;
    font-size: .85rem;
    font-weight: 600;
}

.connection-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 28px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: .85rem;
}

.connection-strip a {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.connection-strip a:hover {
    text-decoration: underline;
}

.connection-strip .status {
    font-size: .8rem;
    font-weight: 500;
    color: #536176;
}

.dot {
    width: 7px;
    height: 7px;
}

.onboarding {
    margin-top: 18px;
    color: #536176;
    font-size: .9rem;
}

.help-details {
    margin-bottom: 18px;
    max-width: 760px;
    color: #536176;
    font-size: .85rem;
}

summary {
    font-size: .9rem;
}

.participant > h3 {
    margin-top: 0;
}

.participant .card {
    background: var(--surface-soft);
    padding: 14px;
    margin-top: 12px;
}

form > .btn {
    margin-top: 8px;
}

.inline-form > .btn {
    margin-top: 0;
}

@media (max-width: 640px) {
    .wrap {
        padding: 20px 16px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 16px;
    }

    nav {
        gap: 0 16px;
    }

    .dashboard-metrics .card {
        min-height: 140px;
    }

    .connection-strip {
        gap: 14px;
    }
}

.billing-card {
    padding: 20px;
}

.billing-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
}

.billing-filters label {
    margin: 0;
    font-size: .85rem;
}

.billing-filters label:first-child {
    flex: 1;
    min-width: 240px;
}

.billing-filters input, .billing-filters select {
    display: block;
    margin-top: 6px;
}

#billing-table {
    min-width: 900px;
}

#billing-table caption {
    font-size: .8rem;
    color: #536176;
    font-weight: 400;
    padding: 0 0 12px;
}

#billing-table td, #billing-table th {
    vertical-align: middle;
}

#billing-table tbody th {
    background: transparent;
    color: #202c3d;
}

#billing-table td {
    font-size: .87rem;
}

#billing-table small {
    display: block;
    margin-top: 4px;
}

.billing-reference {
    display: block;
    max-width: 200px;
    overflow-wrap: anywhere;
}

.billing-badge {
    display: block;
    width: fit-content;
    border-radius: 4px;
    background: #fff0d3;
    color: #77500b;
    padding: 2px 7px;
    margin-bottom: 5px;
    font-size: .75rem;
    font-weight: 600;
}

.billing-details > summary {
    color: var(--brand-blue);
    white-space: nowrap;
}

.billing-details[open] .billing-detail-content {
    min-width: 300px;
}

#billing-dialog {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0;
    width: min(960px, calc(100% - 32px));
    max-height: 88vh;
    color: #202c3d;
    box-shadow: 0 24px 80px #17203340;
}

#billing-dialog::backdrop {
    background: #17203380;
}

.billing-dialog-header {
    position: sticky;
    top: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
}

.billing-dialog-header h2 {
    margin: 0;
}

#billing-dialog-body {
    padding: 24px;
    overflow-wrap: anywhere;
}

.billing-amount {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

[hidden] {
    display: none !important;
}

.workflow-state {
    background: #eef3f8;
    border-left: 3px solid #617994;
    border-radius: 6px;
    padding: 14px 16px;
    margin: 12px 0 20px;
}

.workflow-state > .eyebrow, .workflow-state > strong {
    display: block;
}

.workflow-state > p {
    margin: 6px 0 0;
    font-size: .9rem;
}

.resolution-record {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 18px;
    margin: 16px 0;
    background: #fff;
}

.resolution-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.resolution-heading h4 {
    margin: 0;
    font-size: 1rem;
}

.resolution-heading > span {
    font-size: .85rem;
}

.resolution-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 36px;
    margin: 16px 0;
}

.resolution-facts dt {
    color: #536176;
    font-size: .8rem;
    font-weight: 500;
}

.resolution-facts dd {
    margin: 3px 0 0;
    font-weight: 600;
}

.resolution-note {
    border-left: 3px solid var(--brand-blue);
    border-radius: 4px;
    background: var(--surface-soft);
    padding: 12px 16px;
}

.resolution-note h5 {
    margin: 0 0 3px;
    font-size: .9rem;
}

.resolution-note > .muted {
    font-size: .78rem;
    margin: 0 0 10px;
}

.resolution-note-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin: 0;
}

.workflow-empty {
    color: #536176;
    border-top: 1px solid #e3e8ef;
    padding-top: 16px;
    margin-top: 20px;
    font-size: .9rem;
}

/* Lernen im Freiamt branding, shared by the workspace and sign-in. */
h1, h2, h3, h4, .metric {
    color: var(--brand-blue);
}

.site-header {
    border-top: 4px solid var(--brand-accent);
    border-bottom-color: var(--border-color);
}

.site-header .top {
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.brand-logo {
    display: block;
    width: 96px;
    max-width: 100%;
    height: auto;
    flex-shrink: 0;
}

.brand-title {
    color: var(--brand-blue);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
}

nav a:hover {
    color: var(--brand-link);
    border-bottom-color: var(--brand-accent);
}

th {
    color: var(--brand-blue);
}

tbody tr:hover {
    background: var(--surface-hover);
}

.login-card {
    max-width: 460px;
    margin: 48px auto;
    padding: 32px;
    border-top: 4px solid var(--brand-accent);
}

.login-brand {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.login-brand .brand-logo {
    width: 180px;
    margin-bottom: 12px;
}

.login-brand .brand-title {
    margin: 0;
}

.btn:disabled, .btn:disabled:hover {
    cursor: not-allowed;
    background: #5b6473;
    color: #fff;
}

@media (max-width: 640px) {
    .brand {
        align-items: center;
        gap: 10px;
    }

    .brand-logo {
        width: 72px;
    }

    .brand-title {
        font-size: .9rem;
    }

    .site-header .top {
        align-items: center;
        gap: 12px;
    }

    .login-card {
        margin: 20px auto;
        padding: 24px;
    }
}
