/*
 * The rules of the mijn customer portal that are not part of the shared design system.
 *
 * Load this file after shell.css. The shared stylesheets (tokens, base, components,
 * pages, dashboard, shell) are derived files: their source is the _conventions
 * repository. A rule that only the portal needs belongs here.
 *
 * The portal uses the shared components for every button, field, card, badge, table
 * and empty state. This file holds the portal's own components only: the search
 * result list, the activity timeline, the meeting banner, the monitoring charts, the
 * website editor, the office pages and the digital employee passport.
 */

:root {
    /* The portal pages use the full width of the content area. */
    --shell-content-max: none;

    /* Text in the brand colour on a light surface. The layout sets --brand to the
       customer's own colour, which can be as pale as white, so the text uses a mix
       with black that stays at 4.5:1 or more for any colour. */
    --portal-accent-text: color-mix(in srgb, var(--brand) 40%, #000);
    --portal-accent-soft: color-mix(in srgb, var(--brand) 12%, transparent);
    --portal-accent-line: color-mix(in srgb, var(--brand) 24%, transparent);

    /* Colours that only the portal needs. */
    --portal-violet: #6d4bd1;
    --portal-scene-top: #eef2f8;
    --portal-scene-bottom: #e4eaf3;
}

/* ---------------------------------------------------------------- Helpers */

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

.icon {
    width: 1.2em;
    height: 1.2em;
    flex: 0 0 auto;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 8px;
    left: 12px;
    padding: 9px 14px;
    transform: translateY(-150%);
    border-radius: var(--radius-field);
    background: var(--ink);
    color: var(--paper);
    font-weight: 650;
    text-decoration: none;
    transition: transform 140ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

/* Two utilities the shared set does not carry yet. */
.ms-auto { margin-left: auto; }
.flex-column { flex-direction: column; }
.bg-danger { background: var(--danger); color: #fff; }
.text-decoration-none { text-decoration: none; }
.text-start { text-align: left; }
.justify-content-start { justify-content: flex-start; }
.icon-success { color: var(--success); }
.icon-danger { color: var(--danger); }
.icon-warning { color: var(--warning); }
.icon-info { color: var(--info); }
.flex-grow-1 { flex-grow: 1; }
.font-monospace { font-family: var(--font-mono); font-size: .8rem; }

.spin { animation: spin 1s linear infinite; }

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* The shared showcase is a standalone page, outside the shell. */
.design-system-showcase {
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: var(--space-4) var(--space-3) var(--space-5);
}

/* A card header with an icon and a count badge. */
.card-head-icon {
    width: 18px;
    height: 18px;
    flex: none;
    color: var(--portal-accent-text);
}

/* A link at the end of a card, with the arrow of the portal. */
.link-more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--portal-accent-text);
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    opacity: .85;
    transition: opacity .15s;
}

.link-more:hover { opacity: 1; }

/* Secondary text of a row or a definition list. */
.row-name {
    color: var(--ink);
    font-size: .85rem;
    font-weight: 600;
}

.row-sub {
    margin-top: 2px;
    color: var(--ink-3);
    font-size: .72rem;
}

.meta-label {
    color: var(--ink-3);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.meta-value {
    color: var(--ink);
    font-size: .85rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* A row of statistics on the right of a list row. */
.row-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    text-align: right;
}

/* A vertical list of labelled facts. */
.meta-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

/* ---------------------------------------------------------------- Portal grid */

.portal-nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    font-size: .8rem;
}

.portal-nav__link {
    color: var(--portal-accent-text);
    font-weight: 500;
    text-decoration: none;
}

.portal-nav__link:hover { text-decoration: underline; }

.portal-nav__sep {
    color: var(--ink-3);
    font-size: .7rem;
}

.portal-nav__current {
    color: var(--ink-3);
    font-weight: 500;
}

.portal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.portal-grid--full { grid-template-columns: 1fr; }

/* The shell gives every card a bottom margin. Inside a grid the gap already
   spaces the cards, so the margin would double it. */
.portal-grid > .card,
.office-kpis .card,
.office-grid > .card,
.office-form__grid .card,
.website-edit .card { margin-bottom: 0; }

@media (max-width: 768px) {
    .portal-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- Search */

.portal-search__results {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 50;
    width: 320px;
    max-height: 400px;
    margin-top: 4px;
    padding: var(--space-2);
    overflow-y: auto;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.portal-search__results--open { display: block; }

.portal-search__item {
    display: block;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-field);
    text-decoration: none;
    transition: background .1s ease;
}

.portal-search__item:hover { background: var(--paper-raise); }

.portal-search__item-type {
    color: var(--portal-accent-text);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.portal-search__item-title {
    margin-top: 1px;
    color: var(--ink);
    font-size: .85rem;
    font-weight: 600;
}

.portal-search__item-sub {
    color: var(--ink-3);
    font-size: .72rem;
}

.portal-search__empty {
    padding: var(--space-3);
    color: var(--ink-3);
    font-size: .78rem;
    text-align: center;
}

/* ---------------------------------------------------------------- Status and statistics */

.status-dot {
    display: inline-block;
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot--online { background: var(--success); }
.status-dot--degraded { background: var(--warning); }
.status-dot--offline { background: var(--danger); }
.status-dot--unknown { background: var(--ink-3); }

.summary-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
    color: var(--ink-2);
    font-size: .78rem;
}

.summary-bar__value {
    color: var(--portal-accent-text);
    font-weight: 700;
}

/* The cards of the dashboard statistics and the AI fixes page. */
.stat-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-field);
    background: var(--portal-accent-soft);
    color: var(--portal-accent-text);
}

.stat-icon svg { width: 18px; height: 18px; }

.stat-number {
    color: var(--ink);
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
}

.stat-label {
    margin-top: var(--space-1);
    color: var(--ink-3);
    font-size: .75rem;
    font-weight: 500;
}

.stat-sub {
    margin-top: var(--space-1);
    color: var(--portal-accent-text);
    font-size: .72rem;
    font-weight: 600;
}

/* ---------------------------------------------------------------- Task rows */

.task-check {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
}

.task-check--done {
    border-color: var(--mint);
    color: var(--portal-accent-text);
}

.task-name { color: var(--ink); font-size: .85rem; font-weight: 600; }
.task-name--done { color: var(--ink-3); text-decoration: line-through; }
.task-sub { margin-top: 2px; color: var(--ink-3); font-size: .72rem; }

/* ---------------------------------------------------------------- Meeting banner */

.meeting-banner-link {
    transition: border-color .15s;
}

.meeting-banner-link:hover { border-color: var(--mint); }

.meeting-banner {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.meeting-banner__label {
    color: var(--portal-accent-text);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.meeting-banner__countdown-label {
    margin-left: var(--space-2);
    color: var(--ink-3);
    font-size: .68rem;
    letter-spacing: .04em;
}

.meeting-banner__title {
    margin: var(--space-2) 0 var(--space-3);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -.02em;
    text-transform: none;
}

.meeting-banner__details {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    color: var(--ink-2);
    font-size: .85rem;
}

.meeting-banner__detail-icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    color: var(--ink-3);
    vertical-align: middle;
}

.meeting-banner__date-box {
    flex-shrink: 0;
    min-width: 64px;
    padding: var(--space-3) var(--space-4);
    background: var(--portal-accent-soft);
    border: 1px solid var(--portal-accent-line);
    border-radius: var(--radius-field);
    text-align: center;
}

.meeting-banner__date-day {
    color: var(--ink);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.03em;
}

.meeting-banner__date-month {
    margin-top: var(--space-1);
    color: var(--ink-3);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* ---------------------------------------------------------------- Chat */

.chat-box {
    padding: var(--space-3);
    margin-bottom: var(--space-3);
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
}

.chat-box__text {
    color: var(--ink-2);
    font-size: .85rem;
    line-height: 1.6;
}

.chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.chat-input-row {
    display: flex;
    gap: var(--space-2);
}

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

.activity-timeline {
    position: relative;
    padding-left: var(--space-4);
}

.activity-date {
    margin: var(--space-4) 0 var(--space-2) calc(-1 * var(--space-4));
    padding-left: var(--space-4);
    color: var(--ink-3);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.activity-date:first-child { margin-top: 0; }

.activity-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    color: inherit;
    text-decoration: none;
}

a.activity-item:hover .activity-item__message { text-decoration: underline; }

.activity-item::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(-1 * var(--space-3));
    width: 1px;
    background: var(--line);
}

.activity-item:last-child::before { display: none; }

.activity-item__dot {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    margin-left: calc(-1 * var(--space-4));
    border-radius: 50%;
    background: var(--ink-3);
}

.activity-item__dot--monitoring_alert { background: var(--danger); }
.activity-item__dot--user_joined { background: var(--mint); }
.activity-item__dot--ai_fix { background: var(--info); }

.activity-item__content { flex: 1; min-width: 0; }

.activity-item__message {
    color: var(--ink);
    font-size: .85rem;
    font-weight: 500;
}

.activity-item__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    color: var(--ink-3);
    font-size: .72rem;
}

.activity-feed__item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
}

a.activity-feed__item:hover .activity-feed__message { text-decoration: underline; }

.activity-feed__item:last-child { border-bottom: 0; }

.activity-feed__dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--ink-3);
}

.activity-feed__dot--monitoring_alert { background: var(--danger); }
.activity-feed__dot--user_joined { background: var(--mint); }
.activity-feed__dot--ai_fix { background: var(--info); }

.activity-feed__content { flex: 1; min-width: 0; }

.activity-feed__message {
    color: var(--ink);
    font-size: .85rem;
    font-weight: 500;
}

.activity-feed__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    color: var(--ink-3);
    font-size: .72rem;
}

/* ---------------------------------------------------------------- Monitoring */

.monitor-detail__header { margin-bottom: var(--space-4); }

.monitor-detail__title-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: 6px;
}

.monitor-detail__name {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.02em;
    text-transform: none;
}

.monitor-detail__url {
    margin-left: var(--space-4);
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: .85rem;
}

.monitor-detail__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    padding: var(--space-3);
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
}

.monitor-detail__stat-label {
    margin-bottom: var(--space-1);
    color: var(--ink-3);
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.monitor-detail__stat-value {
    color: var(--ink);
    font-size: .9rem;
    font-weight: 700;
}

.monitor-detail__stat-value--green { color: var(--portal-accent-text); }

@media (max-width: 768px) {
    .monitor-detail__grid { grid-template-columns: repeat(2, 1fr); }
}

.monitor-row__status {
    font-size: .78rem;
    font-weight: 700;
    text-transform: capitalize;
}

.monitor-row__status--online { color: var(--success); }
.monitor-row__status--degraded { color: var(--warning); }
.monitor-row__status--offline { color: var(--danger); }
.monitor-row__status--unknown { color: var(--ink-3); }

/* Uptime chart: one bar per check. */
.uptime-chart {
    position: relative;
    min-height: 100px;
}

.uptime-chart__loading {
    padding: var(--space-4);
    color: var(--ink-3);
    font-size: .85rem;
    text-align: center;
}

.uptime-chart__bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 120px;
    padding-bottom: var(--space-4);
}

.uptime-bar {
    position: relative;
    flex: 1;
    min-width: 4px;
    border-radius: 2px 2px 0 0;
    cursor: pointer;
    transition: opacity .15s ease;
}

.uptime-bar:hover { opacity: .8; }

.uptime-bar--good { background: var(--success); }
.uptime-bar--warn { background: var(--warning); }
.uptime-bar--bad { background: var(--danger); }
.uptime-bar--empty { background: var(--line); }

.uptime-chart__labels {
    display: flex;
    justify-content: space-between;
    padding-top: var(--space-1);
}

.uptime-chart__label {
    color: var(--ink-3);
    font-size: .65rem;
}

.uptime-chart__tooltip {
    display: none;
    position: absolute;
    z-index: 10;
    padding: var(--space-2) var(--space-3);
    background: var(--white);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-field);
    box-shadow: var(--shadow-card);
    color: var(--ink);
    font-size: .78rem;
    white-space: nowrap;
    pointer-events: none;
}

.uptime-chart__tooltip--visible { display: block; }

/* Response time chart: the same bars, in the brand tint. */
.ping-chart {
    position: relative;
    min-height: 80px;
}

.ping-chart__bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 80px;
    padding-bottom: var(--space-4);
}

.ping-bar {
    flex: 1;
    min-width: 4px;
    border-radius: 2px 2px 0 0;
    background: var(--portal-accent-soft);
    cursor: pointer;
    transition: background-color .15s ease;
}

.ping-bar:hover { background: var(--mint); }

.ping-chart__labels {
    display: flex;
    justify-content: space-between;
    padding-top: var(--space-1);
}

.ping-chart__label {
    color: var(--ink-3);
    font-size: .65rem;
}

/* ---------------------------------------------------------------- AI fixes */

.ai-confidence-bar {
    width: 100%;
    height: 6px;
    margin: var(--space-1) 0;
    overflow: hidden;
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: 3px;
}

.ai-confidence-bar__fill {
    width: var(--confidence, 0%);
    height: 100%;
    border-radius: 3px;
    background: var(--portal-accent-text);
    transition: width .3s ease;
}

.ai-dash-stats {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
}

.ai-dash-stat {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
}

.ai-dash-stat__value {
    color: var(--ink);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
}

.ai-dash-stat__label {
    margin-top: var(--space-1);
    color: var(--ink-3);
    font-size: .65rem;
    font-weight: 500;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.ai-explanation {
    padding: var(--space-3) var(--space-4);
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
    color: var(--ink-2);
    font-size: .85rem;
    line-height: 1.7;
}

/* ---------------------------------------------------------------- Service and roadmap */

.service-month {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-3);
}

.service-month__label {
    margin: 0;
    color: var(--ink-3);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.service-month__title {
    margin: var(--space-1) 0 var(--space-2);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: none;
}

.service-month__summary {
    margin: 0;
    color: var(--ink-2);
    font-size: .85rem;
}

.service-meter {
    height: 8px;
    margin-top: var(--space-3);
    overflow: hidden;
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
}

.service-meter__fill {
    width: var(--progress, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--mint);
    transition: width .3s ease;
}

.service-meter__fill--full { background: var(--warning); }

.month-nav {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.milestone-list {
    margin: 0;
    padding: 0 0 0 var(--space-1);
    list-style: none;
}

.milestone {
    position: relative;
    display: flex;
    gap: var(--space-3);
    padding: 0 0 var(--space-3) 0;
}

.milestone::before {
    content: "";
    position: absolute;
    top: 14px;
    bottom: 0;
    left: 6px;
    width: 2px;
    background: var(--line);
}

.milestone:last-child::before { display: none; }
.milestone:last-child { padding-bottom: 0; }

.milestone__marker {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    margin-top: 2px;
    background: var(--white);
    border: 2px solid var(--mint);
    border-radius: 50%;
}

.milestone--done .milestone__marker { background: var(--mint); }

.milestone__name {
    color: var(--ink);
    font-size: .9rem;
    font-weight: 600;
}

.milestone--done .milestone__name { color: var(--ink-3); }

.milestone__date {
    margin-top: 2px;
    color: var(--ink-3);
    font-size: .78rem;
}

.roadmap-progress {
    height: 6px;
    margin: 0 0 var(--space-3);
    overflow: hidden;
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
}

.roadmap-progress__fill {
    width: var(--progress, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--mint);
}

.roadmap-phase--complete .card-title { color: var(--ink-3); }

/* ---------------------------------------------------------------- Website editor */

.website-edit {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
    gap: var(--space-4);
}

@media (max-width: 1100px) {
    .website-edit { grid-template-columns: 1fr; }
}

.website-edit__preview {
    display: flex;
    flex-direction: column;
}

.website-edit__preview-header { margin-bottom: var(--space-3); }

.website-edit__views {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
}

.shell .website-edit__view {
    padding: 5px var(--space-3);
    background: transparent;
    border: 0;
    border-radius: calc(var(--radius-field) - 3px);
    color: var(--ink-3);
    font: inherit;
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
}

.shell .website-edit__view[aria-pressed="true"] {
    background: var(--white);
    box-shadow: 0 0 0 1px var(--line);
    color: var(--ink);
}

.shell .website-edit__view:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.website-edit__domain {
    margin-left: auto;
    font-size: .78rem;
}

.website-edit__iframe {
    --website-edit-chrome: 250px;

    width: 100%;
    height: calc(100vh - var(--website-edit-chrome));
    min-height: 480px;
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
}

.website-edit__iframe--preview { border-color: var(--portal-accent-line); }

@media (max-width: 1100px) {
    .website-edit__iframe { height: 70vh; }
}

.website-edit__chat {
    display: flex;
    flex-direction: column;
}

.website-chat__thread {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-2);
    min-height: 220px;
    max-height: 420px;
    margin-bottom: var(--space-3);
    overflow-y: auto;
}

.website-chat__msg {
    padding: var(--space-2) var(--space-3);
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
}

.website-chat__msg--user {
    background: var(--portal-accent-soft);
    border-color: var(--portal-accent-line);
}

.website-chat__msg--system {
    background: var(--warning-tint);
    border-color: var(--warning);
}

.website-chat__msg-role {
    margin-bottom: var(--space-1);
    color: var(--ink-3);
    font-size: .68rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.website-chat__msg-content {
    color: var(--ink);
    font-size: .85rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.website-chat__approval {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.website-chat__upload { margin-bottom: var(--space-3); }

.website-chat__upload-label {
    display: block;
    margin-bottom: var(--space-1);
    color: var(--ink-3);
    font-size: .78rem;
}

.website-chat__upload-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.website-chat__upload-slot { flex: 0 1 180px; }

.website-chat__upload-file {
    flex: 1 1 160px;
    min-width: 0;
    color: var(--ink);
    font-size: .85rem;
}

.website-chat__history { margin-top: var(--space-3); }

/* ---------------------------------------------------------------- Avatar */

.portal-avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--portal-accent-soft);
    border-radius: var(--radius-field);
    color: var(--portal-accent-text);
    font-size: .75rem;
    font-weight: 700;
}

.portal-avatar--small {
    width: 28px;
    height: 28px;
    font-size: .7rem;
}

/* ---------------------------------------------------------------- Profile */

.profile-avatar {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--mint);
    border-radius: var(--radius-card);
    color: var(--ink);
    font-size: 1.4rem;
    font-weight: 800;
}

.profile-avatar-img {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-card);
    object-fit: cover;
}

.profile-name {
    margin: 0 0 var(--space-1);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.02em;
    text-transform: none;
}

.profile-job {
    display: block;
    color: var(--portal-accent-text);
    font-size: .85rem;
    font-weight: 500;
}

.profile-email {
    display: block;
    margin-top: 2px;
    color: var(--ink-3);
    font-size: .78rem;
}

.profile-2fa {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.profile-company { flex-shrink: 0; }

.profile-2fa__status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--ink);
    font-size: .85rem;
    font-weight: 600;
}

.profile-2fa__hint {
    color: var(--ink-3);
    font-size: .78rem;
    line-height: 1.6;
}

.profile-2fa--enabled .profile-2fa__status span:last-child {
    color: var(--success);
}

/* ---------------------------------------------------------------- Login card extras */

.auth-logo {
    width: 200px;
    height: auto;
    margin-bottom: var(--space-3);
    color: var(--ink);
}

.code-input {
    padding: var(--space-3);
    font-size: 1.4rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: .4em;
    text-align: center;
}

.twofa-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: twofa-step;
}

.twofa-steps > li {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    counter-increment: twofa-step;
}

.twofa-step-title {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin: 0;
    color: var(--ink);
    font-size: .9rem;
    line-height: 1.5;
}

.twofa-step-title::before {
    content: counter(twofa-step);
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--portal-accent-soft);
    border-radius: 50%;
    color: var(--portal-accent-text);
    font-size: .75rem;
    font-weight: 700;
}

.twofa-qr {
    align-self: center;
    padding: var(--space-2);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
    line-height: 0;
}

.twofa-secret {
    display: block;
    padding: var(--space-2) var(--space-3);
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: .85rem;
    letter-spacing: .06em;
    text-align: center;
    overflow-wrap: anywhere;
    user-select: all;
}

/* ---------------------------------------------------------------- Single sign-on */

/* A line with "or" in the middle, between the password form and the SSO links. */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-3) 0;
    color: var(--ink-3);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.auth-sso {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* ---------------------------------------------------------------- Office */

.office-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.office-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
}

.office-hero__title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    line-height: 1.2;
}

.office-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin: var(--space-2) 0 0;
    color: var(--ink-2);
    font-size: .78rem;
}

.office-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.office-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: var(--space-3);
}

.office-kpi__label {
    color: var(--ink-2);
    font-size: .78rem;
    font-weight: 600;
}

.office-kpi__value {
    color: var(--ink);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
}

.office-kpi__hint {
    color: var(--ink-3);
    font-size: .78rem;
}

.office-kpi--attention .office-kpi__value { color: var(--warning); }

.office-pill__glyph {
    margin-right: 6px;
    font-size: .85em;
    font-weight: 800;
    letter-spacing: .04em;
    opacity: .85;
}

.office-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
    gap: var(--space-4);
}

.office-wide { grid-column: 1 / -1; }

@media (max-width: 1023px) {
    .office-grid { grid-template-columns: minmax(0, 1fr); }
}

.office-detail > * + * { margin-top: var(--space-4); }

.office-detail__grid {
    display: grid;
    grid-template-columns: minmax(140px, auto) minmax(0, 1fr);
    gap: var(--space-2) var(--space-4);
    margin: var(--space-3) 0 0;
    font-size: .78rem;
}

.office-detail__grid dt {
    color: var(--ink-2);
    font-weight: 600;
}

.office-detail__grid dd {
    margin: 0;
    color: var(--ink);
}

.office-filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    align-items: end;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.office-filters .btn { justify-self: start; }

.office-form { margin: var(--space-4) 0 0; }

.office-form__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: start;
    gap: var(--space-3) var(--space-4);
}

.office-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-2);
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.office-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin: var(--space-2) 0 0;
    padding: 0;
    color: var(--ink-2);
    font-size: .78rem;
    list-style: none;
}

.office-legend li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.office-legend__dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    background: var(--ink-3);
    border-radius: 50%;
}

.office-legend__dot[data-health="healthy"] { background: var(--success); }
.office-legend__dot[data-health="degraded"] { background: var(--warning); }
.office-legend__dot[data-health="stale"] { background: var(--portal-violet); }
.office-legend__dot[data-health="failed"] { background: var(--danger); }

.office-resources {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.office-resource {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-3);
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
}

.office-resource__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.office-resource__name {
    color: var(--ink);
    font-size: .85rem;
    font-weight: 650;
}

.office-resource__kind {
    padding: 2px 6px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--ink-3);
    font-size: .65rem;
    font-weight: 700;
}

.office-resource__line,
.office-resource__active {
    color: var(--ink-2);
    font-size: .78rem;
}

.office-traces {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
    list-style: none;
}

.office-trace {
    display: grid;
    grid-template-areas:
        "path status"
        "meta meta"
        "preview preview";
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 4px var(--space-3);
    padding: var(--space-3);
    background: var(--white);
    color: inherit;
    text-align: left;
    text-decoration: none;
}

.office-trace:hover { background: var(--paper-raise); }

.office-trace[aria-current="true"] { background: var(--portal-accent-soft); }

.office-trace__path {
    grid-area: path;
    color: var(--ink);
    font-size: .85rem;
    font-weight: 600;
}

.office-trace__meta {
    display: flex;
    grid-area: meta;
    flex-wrap: wrap;
    gap: 2px var(--space-3);
    color: var(--ink-2);
    font-size: .78rem;
}

.office-trace__preview {
    grid-area: preview;
    color: var(--ink-3);
    font-size: .78rem;
}

.office-trace__status {
    grid-area: status;
    justify-self: end;
}

.office-preview {
    margin: 0;
    padding: var(--space-3);
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: .78rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.office-attention {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.office-attention__item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: var(--space-3);
    background: var(--warning-tint);
    border: 1px solid var(--warning);
    border-radius: var(--radius-field);
    color: var(--ink);
    font-size: .78rem;
}

.office-attention__reason {
    color: var(--warning-ink);
    font-weight: 600;
}

.office-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: var(--space-3) 0 0;
    padding: 0;
    list-style: none;
}

.office-timeline__item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: var(--space-3);
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line-strong);
    border-radius: var(--radius-field);
}

.office-timeline__type {
    color: var(--ink);
    font-size: .78rem;
    font-weight: 650;
}

.office-timeline__meta {
    color: var(--ink-2);
    font-size: .78rem;
}

.office-zone {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
}

.office-zone__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
}

.office-zone__name {
    color: var(--ink);
    font-size: .85rem;
    font-weight: 650;
}

.office-zone__meta {
    color: var(--ink-3);
    font-size: .78rem;
}

.office-zone-rows {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.office-zone-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
}

@media (max-width: 640px) {
    .office-zone-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.office-zone-row__name {
    color: var(--ink);
    font-size: .85rem;
    font-weight: 600;
}

.office-zone-row__meta {
    color: var(--ink-3);
    font-size: .78rem;
}

.office-floors {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.office-floors__label {
    color: var(--ink-2);
    font-size: .78rem;
    font-weight: 600;
}

.office-floor-tab {
    min-height: 32px;
    padding: 6px 11px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--ink-2);
    font-size: .78rem;
    font-weight: 600;
}

.office-floor-tab[aria-pressed="true"] {
    background: var(--portal-accent-soft);
    border-color: var(--portal-accent-line);
    color: var(--portal-accent-text);
}

.office-floor-tab--all { font-weight: 700; }

.office-floor-plan {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
}

.office-floor-plan__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.office-floor-plan__inherit {
    color: var(--ink-3);
    font-size: .78rem;
}

.office-column details > summary {
    color: var(--ink-2);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
}

.office-column details > summary:hover { color: var(--ink); }

/* The canvas keeps its own light backdrop; the border makes it read as a panel. */
.office-scene-stage {
    position: relative;
    min-height: 460px;
    overflow: hidden;
    background: linear-gradient(180deg, var(--portal-scene-top) 0%, var(--portal-scene-bottom) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.office-scene {
    position: absolute;
    inset: 0;
}

.office-scene canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.office-scene-controls {
    position: absolute;
    z-index: 2;
    top: var(--space-3);
    left: var(--space-3);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.office-scene-control {
    min-height: 32px;
    padding: 6px 11px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink-2);
    font-size: .78rem;
    font-weight: 600;
}

.office-scene-control:hover {
    background: var(--paper-raise);
    border-color: var(--line-strong);
    color: var(--ink);
}

.office-scene-fullscreen {
    position: absolute;
    z-index: 2;
    top: var(--space-3);
    right: var(--space-3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgb(255 255 255 / 92%);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink-2);
    font-size: .78rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
}

.office-scene-fullscreen__icon { font-size: .85rem; }

.office-scene-tip {
    position: absolute;
    z-index: 3;
    min-width: 190px;
    max-width: 280px;
    padding: var(--space-3);
    background: rgb(255 255 255 / 97%);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
    box-shadow: var(--shadow-card);
    pointer-events: none;
}

.office-scene-tip__name {
    display: block;
    color: var(--ink);
    font-size: .85rem;
    font-weight: 650;
}

.office-scene-tip__kind {
    color: var(--ink-3);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.office-scene-tip__meta,
.office-scene-tip__work {
    display: block;
    margin-top: 3px;
    color: var(--ink-2);
    font-size: .78rem;
}

.office-scene-tip__status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    font-size: .78rem;
    font-weight: 600;
}

.office-scene-tip__dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--ink-3);
    border-radius: 50%;
}

.office-scene-tip__dot[data-status="healthy"] { background: var(--success); }
.office-scene-tip__dot[data-status="degraded"],
.office-scene-tip__dot[data-status="stale"] { background: var(--warning); }
.office-scene-tip__dot[data-status="failed"] { background: var(--danger); }

.office-scene-fallback { margin-top: var(--space-5); }

.office-scene-hint--touch { display: none; }

@media (hover: none) and (pointer: coarse) {
    .office-scene-hint--pointer { display: none; }
    .office-scene-hint--touch { display: inline; }
}

.office-scene-fallback__label {
    margin: var(--space-4) 0 var(--space-2);
    color: var(--ink-3);
    font-size: .78rem;
    font-weight: 600;
}

[data-office-scene-target="fallback"]:not(:has(.office-scene-fallback__node)) .office-scene-fallback__label {
    display: none;
}

.office-scene-fallback__node {
    min-height: 32px;
    margin: 0 var(--space-2) var(--space-2) 0;
    padding: 6px 11px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--ink-2);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
}

.office-scene-fallback__node:hover {
    background: var(--paper-raise);
    border-color: var(--line-strong);
    color: var(--ink);
}

.office-scene-fallback__node[aria-current="true"] {
    background: var(--portal-accent-soft);
    border-color: var(--portal-accent-line);
    color: var(--portal-accent-text);
}

/* The shared shell sets the colour of its own chrome. Page-level controls state
   their colour at the same weight, so a control keeps its own colour. */
.shell .office-floor-tab,
.shell .office-scene-control,
.shell .office-scene-fallback__node {
    color: var(--ink-2);
}

.shell .office-floor-tab[aria-pressed="true"],
.shell .office-scene-fallback__node[aria-current="true"] {
    color: var(--portal-accent-text);
}

.shell .office-scene-control:hover,
.shell .office-scene-fallback__node:hover {
    color: var(--ink);
}

.shell .office-trace { color: var(--ink); }

/* ---------------------------------------------------------------- Passport */

.passport-intro {
    margin: 0 0 var(--space-3);
    color: var(--ink-2);
    font-size: .85rem;
    line-height: 1.6;
}

.passport-meta {
    color: var(--ink-3);
    font-size: .78rem;
    line-height: 1.6;
}

.passport-meta code,
.passport-digest code {
    padding: 1px 5px;
    background: var(--paper-raise);
    border-radius: 4px;
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: .72rem;
}

.passport-row__name {
    color: var(--ink);
    font-size: .9rem;
    font-weight: 600;
}

.passport-row__runtime {
    color: var(--ink-3);
    font-size: .78rem;
}

.passport-row__stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.passport-row__stat { min-width: 72px; }

.passport-scope {
    margin: 0 0 var(--space-2);
    color: var(--ink-2);
    font-size: .9rem;
    line-height: 1.7;
}

.passport-digest {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
}

.passport-capability {
    padding: var(--space-3) 0;
    border-top: 1px solid var(--line);
}

.passport-capability__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}

.passport-capability__name {
    color: var(--ink);
    font-size: .9rem;
    font-weight: 600;
}

.passport-capability__key code {
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: .72rem;
}

.passport-capability__states {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.passport-capability__description {
    margin: var(--space-2) 0;
    color: var(--ink-2);
    font-size: .85rem;
    line-height: 1.6;
}

.passport-boundaries {
    margin: var(--space-2) 0 0;
    padding-left: var(--space-4);
    color: var(--ink-2);
    font-size: .78rem;
}

.passport-boundaries__key {
    color: var(--ink-3);
    font-family: var(--font-mono);
}

.passport-pending {
    margin-top: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--warning-tint);
    border: 1px solid var(--warning);
    border-radius: var(--radius-field);
    color: var(--warning-ink);
    font-size: .78rem;
}

.passport-warning { color: var(--warning-ink); }

.passport-history { margin-top: var(--space-2); }

.passport-history summary {
    color: var(--ink-3);
    font-size: .78rem;
    cursor: pointer;
}

.passport-history__list {
    margin: var(--space-2) 0 0;
    padding-left: var(--space-4);
    color: var(--ink-2);
    font-size: .78rem;
    line-height: 1.7;
}

.passport-decide { margin-top: var(--space-3); }

.passport-decide summary {
    color: var(--portal-accent-text);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
}

.passport-form__pair {
    display: flex;
    gap: var(--space-2);
}

.passport-evidence {
    padding: var(--space-3) 0;
    border-top: 1px solid var(--line);
}

.passport-evidence__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.passport-evidence__kind {
    color: var(--ink);
    font-size: .85rem;
    font-weight: 600;
}

.passport-evidence__summary {
    margin: var(--space-1) 0;
    color: var(--ink-2);
    font-size: .85rem;
    line-height: 1.6;
}
