/* =============================================================================================
   Gurori PMS – Console.Web design system
   Tokens are shared with MudBlazor (Components/Layout/GuroriTheme.cs) and the MAUI app
   (Resources/Styles/Colors.xaml). Signature: the Safety Amber / Site Navy hazard stripe, used only at
   the top edge of the portal and on the sign-in panel. Everything else stays quiet.
   ============================================================================================= */
:root {
    --gp-navy: #14304A;          /* Site Navy – primary, navigation */
    --gp-navy-2: #1C4063;        /* hover / raised navy */
    --gp-amber: #F5B301;         /* Safety Amber – signature, primary action */
    --gp-amber-2: #DDA000;
    --gp-bg: #F3F5F7;            /* Survey Grey – page */
    --gp-surface: #FFFFFF;
    --gp-ink: #0E1C2B;           /* body text */
    --gp-steel: #5A6B7D;         /* Rebar Steel – secondary text */
    --gp-line: #DDE2E8;
    --gp-go: #2F855A;            /* status: on track / approved */
    --gp-hold: #C77700;          /* status: on hold / at risk */
    --gp-stop: #C53030;          /* status: overdue / error */
    --gp-review: #2B6CB0;        /* status: submitted / in review */

    --gp-font-display: "Barlow Condensed", "Barlow", "Segoe UI", sans-serif;
    --gp-font-body: "Barlow", "Segoe UI", Roboto, Arial, sans-serif;
    --gp-font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

    --gp-radius: 6px;
    --gp-shadow: 0 1px 2px rgba(14, 28, 43, .06), 0 4px 16px rgba(14, 28, 43, .05);
    --gp-hazard: repeating-linear-gradient(-45deg, var(--gp-amber) 0 12px, var(--gp-navy) 12px 24px);
}

html, body {
    margin: 0;
    background: var(--gp-bg);
    color: var(--gp-ink);
    font-family: var(--gp-font-body);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

*:focus-visible {
    outline: 3px solid var(--gp-amber);
    outline-offset: 2px;
}

.gp-icon { display: inline-block; flex: none; vertical-align: middle; }

/* ---------------------------------------------------------------- shell */
.gp-appbar.mud-appbar {
    background: var(--gp-surface);
    color: var(--gp-ink);
    border-bottom: 1px solid var(--gp-line);
}

.gp-appbar.mud-appbar::before {             /* signature hazard stripe */
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--gp-hazard);
}

.gp-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: var(--gp-radius);
    background: transparent;
    cursor: pointer;
}

.gp-icon-btn:hover { background: var(--gp-bg); }

.gp-user { display: flex; align-items: center; gap: 10px; margin-right: 8px; }

.gp-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gp-navy);
    color: #fff;
    font-family: var(--gp-font-display);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .03em;
    flex: none;
    overflow: hidden;
}
.gp-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Avatar before a name in lists (BO-124). */
.gp-person { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.gp-avatar-btn { background: none; border: 0; padding: 0; border-radius: 50%; cursor: zoom-in; line-height: 0; }
.gp-avatar-btn:focus-visible { outline: 2px solid var(--gp-amber); outline-offset: 2px; }
.gp-avatar-zoom { display: flex; align-items: center; justify-content: center; }
.gp-avatar-zoom figure { margin: 0; padding: 24px 32px; background: #fff; border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: calc(100vw - 32px); }
.gp-avatar-zoom figcaption { font-family: var(--gp-font-display); font-weight: 600; font-size: 20px; text-align: center; }
.gp-people { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }

/* Top-right user menu: the avatar + name open the Profile photo dialog. */
.gp-user-btn { background: none; border: 0; padding: 2px 4px; border-radius: 8px; cursor: pointer; color: inherit; font: inherit; text-align: left; }
.gp-user-btn:hover, .gp-user-btn:focus-visible { background: rgba(20, 48, 74, .06); outline: none; }
.gp-photo-editor { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.gp-photo-editor .gp-photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

.gp-user-text { display: flex; flex-direction: column; line-height: 1.15; }
.gp-user-name { font-weight: 600; font-size: 14px; }
.gp-user-role { font-size: 12px; color: var(--gp-steel); }
.gp-signout { margin: 0; }

.gp-drawer.mud-drawer { background: var(--gp-navy); color: #fff; }

.gp-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 20px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.gp-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.gp-brand-name { font-family: var(--gp-font-display); font-weight: 700; font-size: 22px; letter-spacing: .02em; }
.gp-brand-sub { font-size: 12px; color: rgba(255, 255, 255, .64); }

.gp-nav { display: flex; flex-direction: column; padding: 12px 10px; gap: 2px; }

.gp-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--gp-radius);
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
    font-weight: 500;
}

.gp-nav-link .gp-icon { opacity: .78; }
.gp-nav-link:hover { background: var(--gp-navy-2); color: #fff; }

.gp-nav-link.active {
    background: var(--gp-navy-2);
    color: #fff;
    font-weight: 600;
}

.gp-nav-link.active .gp-icon { opacity: 1; }

.gp-nav-link.active::before {               /* amber marker, like a site-board tab */
    content: "";
    position: absolute;
    left: -10px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 0 3px 3px 0;
    background: var(--gp-amber);
}

.gp-main { min-height: 100vh; }
.gp-page { max-width: 1280px; margin: 0 auto; padding: 28px 32px 48px; }

/* ---------------------------------------------------------------- page header */
.gp-page-header { margin-bottom: 28px; }

.gp-eyebrow {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gp-steel);
}

.gp-title {
    margin: 0;
    font-family: var(--gp-font-display);
    font-weight: 700;
    font-size: 40px;
    line-height: 1.05;
    letter-spacing: .005em;
}

.gp-lead { margin: 8px 0 0; max-width: 64ch; color: var(--gp-steel); font-size: 16px; }

.gp-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }

.gp-section-title {
    margin: 0;
    font-family: var(--gp-font-display);
    font-weight: 600;
    font-size: 22px;
}

.gp-count {
    font-family: var(--gp-font-mono);
    font-size: 13px;
    color: var(--gp-steel);
}

/* ---------------------------------------------------------------- cards */
.gp-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.gp-card {
    background: var(--gp-surface);
    border: 1px solid var(--gp-line);
    border-radius: var(--gp-radius);
    box-shadow: var(--gp-shadow);
    padding: 18px 20px;
}

.gp-project {
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: gp-rise .45s ease-out both;
    animation-delay: calc(var(--i, 0) * 60ms);
}

.gp-project-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.gp-code {
    font-family: var(--gp-font-mono);
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--gp-bg);
    color: var(--gp-navy);
    border: 1px solid var(--gp-line);
}

.gp-project-name {
    margin: 6px 0 0;
    font-family: var(--gp-font-display);
    font-weight: 600;
    font-size: 22px;
    line-height: 1.15;
}

.gp-project-client { margin: 0; color: var(--gp-steel); }

.gp-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 0; }
.gp-meta dt { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gp-steel); }
.gp-meta dd { margin: 3px 0 0; font-weight: 600; }

.gp-money {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--gp-line);
    font-size: 13px;
    color: var(--gp-steel);
}

.gp-money strong { font-family: var(--gp-font-mono); font-size: 15px; font-weight: 500; color: var(--gp-ink); }

/* Status pills – colour always paired with a word, never colour alone. */
.gp-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #EEF1F4;
    color: var(--gp-steel);
}

.gp-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.gp-status-active { background: #E6F4EC; color: var(--gp-go); }
.gp-status-onhold { background: #FFF3DC; color: var(--gp-hold); }
.gp-status-completed { background: #E7F0FA; color: var(--gp-review); }
.gp-status-closed, .gp-status-tender { background: #EEF1F4; color: var(--gp-steel); }

.gp-skeleton {
    min-height: 190px;
    background: linear-gradient(90deg, #fff 0%, #F0F3F6 50%, #fff 100%);
    background-size: 200% 100%;
    animation: gp-shimmer 1.2s linear infinite;
}

/* ---------------------------------------------------------------- empty / alerts */
.gp-empty {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 28px;
    background: var(--gp-surface);
    border: 1px dashed #C9D1DA;
    border-radius: var(--gp-radius);
    max-width: 720px;
}

.gp-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: #FFF6DB;
    flex: none;
}

.gp-empty h2 { margin: 2px 0 6px; font-family: var(--gp-font-display); font-weight: 600; font-size: 22px; }
.gp-empty p { margin: 0; color: var(--gp-steel); }

.gp-alert {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: var(--gp-radius);
    background: #FDECEC;
    color: var(--gp-stop);
    font-weight: 500;
}

/* ---------------------------------------------------------------- buttons */
.gp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: var(--gp-radius);
    border: 1px solid transparent;
    font-family: var(--gp-font-body);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.gp-btn-primary { background: var(--gp-amber); color: var(--gp-navy); }
.gp-btn-primary:hover { background: var(--gp-amber-2); }
.gp-btn-secondary { background: #fff; color: var(--gp-navy); border-color: #C9D1DA; }
.gp-btn-secondary:hover { border-color: var(--gp-navy); }
.gp-btn-ghost { background: transparent; color: var(--gp-ink); }
.gp-btn-ghost:hover { background: var(--gp-bg); }
.gp-btn-block { width: 100%; min-height: 48px; margin-top: 22px; font-size: 16px; }

/* ---------------------------------------------------------------- account (static SSR) pages */
.gp-account { display: grid; grid-template-columns: minmax(360px, 5fr) 7fr; min-height: 100vh; }

.gp-account-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 48px 56px;
    background: var(--gp-navy);
    color: #fff;
    overflow: hidden;
}

.gp-account-panel .gp-hazard {
    position: absolute;
    inset: auto 0 0 0;
    height: 14px;
    background: var(--gp-hazard);
}

.gp-account-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--gp-font-display);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: .02em;
}

.gp-account-kicker {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gp-amber);
}

.gp-account-headline {
    margin: 0;
    font-family: var(--gp-font-display);
    font-weight: 700;
    font-size: clamp(40px, 4.4vw, 60px);
    line-height: 1.02;
}

.gp-account-points { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 14px; color: rgba(255, 255, 255, .86); }
.gp-account-points li { display: flex; align-items: center; gap: 12px; font-size: 16px; }

.gp-account-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.gp-account-card {
    width: 100%;
    max-width: 420px;
    background: var(--gp-surface);
    border: 1px solid var(--gp-line);
    border-radius: 10px;
    box-shadow: var(--gp-shadow);
    padding: 36px 36px 32px;
    box-sizing: border-box;
}

.gp-account-brand-compact { display: none; margin-bottom: 20px; color: var(--gp-navy); font-size: 22px; }
.gp-account-foot { max-width: 420px; margin: 18px 0 0; font-size: 13px; color: var(--gp-steel); text-align: center; }

.gp-form-title { margin: 0; font-family: var(--gp-font-display); font-weight: 700; font-size: 32px; line-height: 1.1; }
.gp-form-lead { margin: 6px 0 18px; color: var(--gp-steel); }

.gp-account-card label { display: block; margin: 16px 0 6px; font-size: 14px; font-weight: 600; }

.gp-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid #C9D1DA;
    border-radius: var(--gp-radius);
    background: #fff;
}

.gp-field:focus-within { border-color: var(--gp-navy); box-shadow: 0 0 0 3px rgba(245, 179, 1, .35); }

.gp-field input {
    flex: 1;
    min-width: 0;
    height: 46px;
    border: 0;
    outline: none;
    background: transparent;
    font-family: var(--gp-font-body);
    font-size: 16px;
    color: var(--gp-ink);
}

.gp-field input.gp-code-input { font-family: var(--gp-font-mono); font-size: 22px; letter-spacing: .3em; }

.gp-form-error {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: var(--gp-radius);
    background: #FDECEC;
    color: var(--gp-stop);
    font-weight: 500;
}

.gp-account-card .validation-message { margin-top: 4px; font-size: 13px; color: var(--gp-stop); }
.gp-hint { margin: 12px 0 0; font-size: 13px; color: var(--gp-steel); }

.gp-step { display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin-bottom: 4px; border-radius: var(--gp-radius); background: #FFF6DB; }
.gp-step p { margin: 0; }

.gp-steps { margin: 0 0 12px; padding-left: 20px; color: var(--gp-ink); }
.gp-steps li { margin: 4px 0; }

.gp-secret { padding: 14px; margin: 12px 0 4px; border-radius: var(--gp-radius); background: var(--gp-bg); border: 1px solid var(--gp-line); }
.gp-secret-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gp-steel); }
.gp-secret-key { display: block; margin: 6px 0 12px; font-family: var(--gp-font-mono); font-size: 18px; letter-spacing: .08em; color: var(--gp-navy); }
.gp-secret-uri { font-size: 12px; word-break: break-all; color: var(--gp-review); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 960px) {
    .gp-account { grid-template-columns: 1fr; }
    .gp-account-panel { display: none; }
    .gp-account-brand-compact { display: flex; }
    .gp-account-main { border-top: 6px solid transparent; border-image: var(--gp-hazard) 1; }
}

@media (max-width: 600px) {
    .gp-page { padding: 20px 16px 40px; }
    .gp-title { font-size: 32px; }
    .gp-user-text, .gp-signout span { display: none; }
    .gp-card-grid { grid-template-columns: 1fr; }
    .gp-account-card { padding: 28px 20px; }
}


/* =============================================================================================
   Admin & data screens (P3): tables, forms, toolbars. Quiet by design – amber only for primary actions.
   ============================================================================================= */
.gp-muted { color: var(--gp-steel); }
.gp-strong { font-weight: 600; }
.gp-mono { font-family: var(--gp-font-mono); font-size: .92em; }
.gp-nowrap { white-space: nowrap; }
.gp-section-gap { margin-top: 36px; }

.gp-subnav { display: flex; flex-wrap: wrap; gap: 4px; margin: -12px 0 24px; border-bottom: 1px solid var(--gp-line); }
.gp-subnav-link {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px;
    color: var(--gp-steel); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent;
}
.gp-subnav-link:hover { color: var(--gp-ink); }
.gp-subnav-link.active { color: var(--gp-navy); font-weight: 600; border-bottom-color: var(--gp-amber); }

.gp-hub { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; transition: border-color .15s ease; }
.gp-hub:hover { border-color: var(--gp-navy); }
.gp-hub-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; background: #FFF6DB; margin-bottom: 6px; }
.gp-hub-title { font-family: var(--gp-font-display); font-weight: 600; font-size: 22px; }
.gp-hub-text { color: var(--gp-steel); }

.gp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.gp-toolbar-spacer { flex: 1; }
.gp-search { display: flex; align-items: center; gap: 8px; min-width: 280px; flex: 1 1 280px; max-width: 420px;
    padding: 0 12px; background: #fff; border: 1px solid #C9D1DA; border-radius: var(--gp-radius); }
.gp-search:focus-within { border-color: var(--gp-navy); box-shadow: 0 0 0 3px rgba(245, 179, 1, .35); }
.gp-search input { flex: 1; height: 40px; border: 0; outline: none; font: inherit; background: transparent; }

.gp-input, .gp-select {
    height: 40px; padding: 0 10px; box-sizing: border-box; font: inherit; color: var(--gp-ink);
    background: #fff; border: 1px solid #C9D1DA; border-radius: var(--gp-radius);
}
.gp-input:focus, .gp-select:focus { outline: none; border-color: var(--gp-navy); box-shadow: 0 0 0 3px rgba(245, 179, 1, .35); }
.gp-input:disabled { background: var(--gp-bg); color: var(--gp-steel); }
.gp-narrow { width: 120px; }
.gp-tiny { width: 72px; height: 34px; }
.gp-inline-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--gp-steel); }

.gp-table-card { padding: 0; overflow-x: auto; }
.gp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gp-table th {
    text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: var(--gp-steel); background: #F8FAFB; border-bottom: 1px solid var(--gp-line); white-space: nowrap;
}
.gp-table td { padding: 10px 14px; border-bottom: 1px solid #EEF1F4; vertical-align: top; }
.gp-table tbody tr:last-child td { border-bottom: 0; }
.gp-row { cursor: pointer; }
.gp-row:hover td { background: #F8FAFB; }
.gp-row.selected td { background: #FFF9E6; }
.gp-row:focus-visible { outline: 3px solid var(--gp-amber); outline-offset: -3px; }
.gp-row-error td { background: #FFF6F6; }
.gp-detail-row td { background: #F8FAFB; }
.gp-cell-actions { text-align: right; white-space: nowrap; }

.gp-tag {
    display: inline-block; margin: 1px 4px 1px 0; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600;
    background: #EEF1F4; color: var(--gp-navy);
}
.gp-action-create { background: #E6F4EC; color: var(--gp-go); }
.gp-action-update { background: #E7F0FA; color: var(--gp-review); }
.gp-action-delete { background: #FDECEC; color: var(--gp-stop); }
.gp-status-stop { background: #FDECEC; color: var(--gp-stop); }

.gp-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--gp-line); color: var(--gp-steel); font-size: 14px; }

.gp-split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.gp-panel { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
/* Write-only secret setting (Gemini API key): password field, status and remove button on one row. */
.gp-secret { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.gp-secret .gp-input { flex: 1 1 280px; }
/* Input with an icon button at its right end (e.g. suggest a task title). */
.gp-input-wrap { position: relative; display: block; }
.gp-input-wrap .gp-input { padding-right: 48px; }
.gp-input-btn { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--gp-radius); background: transparent; cursor: pointer; }
.gp-input-btn:hover { background: var(--gp-bg); }
.gp-input-btn:focus-visible { outline: 3px solid rgba(245, 179, 1, .6); }
/* A panel that is part of the page flow (long review tables), not a sticky side panel. */
.gp-panel.gp-panel-flow { position: static; max-height: none; overflow: visible; }
.gp-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.gp-panel-head h2 { margin: 0; font-family: var(--gp-font-display); font-weight: 600; font-size: 24px; }
.gp-panel-head p { margin: 2px 0 0; }

.gp-form { display: grid; gap: 12px; border: 0; margin: 0; padding: 0; min-width: 0; }
.gp-form label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; }
.gp-form .gp-input { width: 100%; }
.gp-form-inline { grid-template-columns: repeat(auto-fit, minmax(140px, max-content)); align-items: end;
    padding: 16px; margin-bottom: 16px; background: #fff; border: 1px solid var(--gp-line); border-left: 4px solid var(--gp-amber); border-radius: var(--gp-radius); }
.gp-form-inline .gp-grow { min-width: 260px; }
.gp-form-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end;
    padding: 16px; margin-bottom: 16px; background: #fff; border: 1px solid var(--gp-line); border-left: 4px solid var(--gp-amber); border-radius: var(--gp-radius); }
.gp-span-all { grid-column: 1 / -1; }
.gp-mobile-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.gp-mobile-label { font-size: 14px; font-weight: 600; }
.gp-mobile-input { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); gap: 8px; }
.gp-mobile-hint { font-size: 13px; }
.gp-field-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gp-steel); margin: 4px 0 6px; }

.gp-form label.gp-check, label.gp-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.gp-check input { width: 18px; height: 18px; accent-color: var(--gp-navy); flex: none; }
.gp-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; }
.gp-checks-scroll { max-height: 220px; overflow-y: auto; margin-top: 8px; padding: 8px; border: 1px solid var(--gp-line); border-radius: var(--gp-radius); }

.gp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.gp-danger-zone { display: grid; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--gp-line); }
.gp-danger-zone .gp-btn { justify-content: flex-start; }
.gp-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--gp-radius); background: #FFF6DB; font-size: 14px; }
.gp-btn-danger { background: var(--gp-stop); color: #fff; }
.gp-btn-danger:hover { background: #A62828; }
.gp-btn-danger-outline { color: var(--gp-stop); }
.gp-btn:disabled { opacity: .5; cursor: not-allowed; }

.gp-credentials {
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px;
    background: #FFF6DB; border: 1px solid #F3D57A; border-radius: var(--gp-radius);
}
.gp-credentials p { margin: 2px 0 0; color: var(--gp-steel); font-size: 14px; }
.gp-credentials code { font-family: var(--gp-font-mono); font-size: 20px; letter-spacing: .06em; padding: 6px 12px; background: #fff; border-radius: 4px; }

.gp-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.gp-pill {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px;
    border: 1px solid #C9D1DA; background: #fff; color: var(--gp-ink); font: inherit; font-weight: 500; cursor: pointer;
}
.gp-pill:hover { border-color: var(--gp-navy); }
.gp-pill.active { background: var(--gp-navy); border-color: var(--gp-navy); color: #fff; }
.gp-pill.active .gp-count { color: rgba(255, 255, 255, .7); }

.gp-perm-card { padding: 20px 24px; }
.gp-perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px 32px; }
.gp-perm-groups section { display: grid; gap: 8px; align-content: start; }
.gp-perm-groups .gp-check { font-weight: 500; }
.gp-perm-groups code { margin-left: auto; font-size: 11px; }
.gp-money-perm span::after { content: "MYR"; margin-left: 6px; padding: 0 5px; border-radius: 3px; font-size: 10px; font-weight: 700; background: #FFF3DC; color: var(--gp-hold); }
.gp-note { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--gp-radius); background: var(--gp-bg); color: var(--gp-steel); }

.gp-editor .gp-panel-head { align-items: center; }
.gp-hint-line { margin: -4px 0 14px; max-width: 80ch; }

.gp-days { display: flex; flex-wrap: wrap; gap: 6px; }
.gp-day { display: inline-flex !important; flex-direction: row !important; align-items: center; justify-content: center; min-width: 52px; height: 38px;
    border: 1px solid #C9D1DA; border-radius: var(--gp-radius); cursor: pointer; font-weight: 600 !important; background: #fff; }
.gp-day input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gp-day.on { background: var(--gp-navy); border-color: var(--gp-navy); color: #fff; }
.gp-day:focus-within { box-shadow: 0 0 0 3px rgba(245, 179, 1, .45); }

.gp-stepper { display: flex; gap: 0; margin: 0 0 20px; padding: 0; list-style: none; counter-reset: step; }
.gp-stepper li { counter-increment: step; display: flex; align-items: center; gap: 8px; padding-right: 28px; color: var(--gp-steel); font-weight: 500; }
.gp-stepper li::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
    border-radius: 50%; border: 2px solid #C9D1DA; font-family: var(--gp-font-mono); font-size: 13px; }
.gp-stepper li.current { color: var(--gp-ink); font-weight: 600; }
.gp-stepper li.current::before { border-color: var(--gp-amber); background: var(--gp-amber); color: var(--gp-navy); }
.gp-stepper li.done::before { content: "✓"; border-color: var(--gp-go); background: var(--gp-go); color: #fff; }

.gp-dropzone, .gp-result { display: flex; gap: 18px; align-items: flex-start; padding: 28px; max-width: 820px; }
.gp-dropzone { border: 2px dashed #C9D1DA; box-shadow: none; }
.gp-dropzone h2, .gp-result h2 { margin: 0 0 6px; font-family: var(--gp-font-display); font-weight: 600; font-size: 24px; }
.gp-dropzone p, .gp-result p { margin: 0; color: var(--gp-steel); }
.gp-result { margin-bottom: 16px; }
.gp-file { position: relative; overflow: hidden; }
.gp-file input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.gp-ok { display: inline-flex; align-items: center; gap: 4px; color: var(--gp-go); font-weight: 600; }
.gp-row-errors { margin: 0; padding-left: 16px; color: var(--gp-stop); font-size: 13px; }
/* Microsoft Project re-import preview (BO-38): "what: old → new" lines of a changed row. */
.gp-row-changes { margin: 0; padding-left: 16px; font-size: 13px; }

/* Register entry files side by side (BO-97): original / reply, RFWI before / after. Stacks on narrow screens. */
.gp-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gp-compare-side { display: grid; gap: 12px; align-content: start; padding: 12px; border: 1px solid var(--gp-line); border-radius: var(--gp-radius); }
.gp-compare-side .gp-section-title { margin: 0; }
.gp-compare-files { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.gp-compare-files li { padding: 8px 10px; border-radius: var(--gp-radius); border-left: 3px solid transparent; background: var(--gp-bg); }
.gp-compare-files li.active { border-left-color: var(--gp-amber); }
.gp-compare-files .gp-actions { margin-top: 4px; }
.gp-compare-preview { display: grid; place-items: center; min-height: 320px; padding: 8px; background: var(--gp-bg); border-radius: var(--gp-radius); }
.gp-compare-preview img { max-width: 100%; max-height: 70vh; object-fit: contain; }
.gp-compare-preview iframe { width: 100%; height: 70vh; border: 0; background: #fff; }
.gp-section-gap-sm { margin-top: 16px; }
.gp-history { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.gp-history li { padding: 6px 10px; border-left: 3px solid var(--gp-line); }
.gp-link-btn { padding: 0; border: 0; background: none; color: var(--gp-review); font: inherit; font-weight: 600; text-align: left; cursor: pointer; word-break: break-all; }
.gp-link-btn:hover { text-decoration: underline; }
/* Variation order documents (BO-45). */
.gp-vo-files { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
/* BOQ descriptions show 5 lines until "Show more" (BO-40). */
.gp-clamp-5 { display: -webkit-box; -webkit-line-clamp: 5; line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.gp-pre-line { white-space: pre-line; }
.gp-boq-bills { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.gp-boq-bills .gp-btn { min-height: 0; padding: 4px 10px; }
@media (max-width: 900px) { .gp-compare { grid-template-columns: minmax(0, 1fr); } }

.gp-settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.gp-settings-group h2 { margin: 0 0 8px; font-family: var(--gp-font-display); font-weight: 600; font-size: 20px; }
.gp-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid #EEF1F4; }
.gp-setting label { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.gp-setting code { font-size: 11px; }
.gp-setting input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--gp-navy); }
.gp-sticky-actions {
    position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 10px;
    margin: 16px -32px 0; padding: 12px 32px; background: rgba(243, 245, 247, .94); border-top: 1px solid var(--gp-line);
    backdrop-filter: blur(4px);
}
.gp-sticky-actions .gp-muted { margin-right: auto; }

.gp-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.gp-chip { height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid #C9D1DA; background: #fff; font: inherit; font-size: 12px; font-weight: 600; color: var(--gp-steel); cursor: pointer; }
.gp-chip.on { background: var(--gp-navy); border-color: var(--gp-navy); color: #fff; }

.gp-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
.gp-diff pre { margin: 0; padding: 10px 12px; max-height: 320px; overflow: auto; font-family: var(--gp-font-mono); font-size: 12px;
    background: #fff; border: 1px solid var(--gp-line); border-radius: var(--gp-radius); white-space: pre-wrap; word-break: break-word; }

/* Modal editor (EditDialog): page scroll is locked while it is open; the body scrolls, the footer with Save stays put. */
body:has(.gp-modal-backdrop) { overflow: hidden; }
.gp-modal-backdrop { position: fixed; inset: 0; z-index: 1400; display: grid; place-items: center; padding: 24px;
    background: rgba(14, 28, 43, .45); }
.gp-modal { display: flex; flex-direction: column; width: min(1100px, 100%); max-height: calc(100vh - 48px); padding: 0; overflow: hidden; }
.gp-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px;
    border-bottom: 1px solid var(--gp-line); }
.gp-modal-head h2 { margin: 0; font-family: var(--gp-font-display); font-weight: 600; font-size: 24px; }
.gp-modal-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 24px; }
.gp-modal-foot { padding: 12px 24px; border-top: 1px solid var(--gp-line); background: var(--gp-bg); }
.gp-modal-foot .gp-actions { margin-top: 0; }

@media (max-width: 1100px) {
    .gp-split { grid-template-columns: 1fr; }
    .gp-panel { position: static; max-height: none; }
}

@media (max-width: 600px) {
    .gp-settings { grid-template-columns: 1fr; }
    .gp-sticky-actions { margin: 16px -16px 0; padding: 12px 16px; }
    .gp-diff { grid-template-columns: 1fr; }
    .gp-search { min-width: 0; max-width: none; }
}

/* ---------------------------------------------------------------- motion */
@keyframes gp-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes gp-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- Blazor error UI */
#blazor-error-ui {
    background: #FFF6DB;
    border-top: 4px solid var(--gp-amber);
    bottom: 0;
    display: none;
    left: 0;
    padding: .7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .6rem; }

/* ---------------------------------------------------------------- project workspace (P4+) */
.gp-header-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 8px; }
.gp-header-meta .gp-muted { display: inline-flex; align-items: center; gap: 6px; }
.gp-header-meta .gp-header-chat { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; font-size: 14px; text-decoration: none; }
.gp-status-tender { background: #EEF2F6; color: var(--gp-steel); }
.gp-status-notstarted { background: #EEF2F6; color: var(--gp-steel); }
.gp-status-inprogress { background: #E6F4EC; color: var(--gp-go); }
.gp-status-submitted { background: #E7F0FA; color: var(--gp-review); }
.gp-status-approved { background: #E6F4EC; color: var(--gp-go); }
.gp-status-rework { background: #FDECEC; color: var(--gp-stop); }
.gp-status-hold { background: #FFF3E0; color: var(--gp-hold); }
.gp-text-stop { color: var(--gp-stop); }
.gp-text-go { color: var(--gp-go); }
.gp-text-hold { color: var(--gp-hold); }
.gp-num { text-align: right; font-variant-numeric: tabular-nums; }
.gp-pad { padding: 16px; }
.gp-scroll-y { max-height: 420px; overflow-y: auto; }
.gp-plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.gp-tree-name { display: inline-block; padding-left: calc(var(--level, 0) * 20px); }
.gp-tree-name::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-left: 2px solid var(--gp-line);
    border-bottom: 2px solid var(--gp-line); vertical-align: middle; }
.gp-tree tr[draggable="true"] { cursor: grab; }
.gp-drop-target td { background: #FFF6DB; box-shadow: inset 0 2px 0 var(--gp-amber); }
.gp-drop-root td { text-align: center; color: var(--gp-steel); background: #FFFBEA; border: 2px dashed var(--gp-amber); }
.gp-kanban { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.gp-kanban-col { background: var(--gp-surface); border: 1px solid var(--gp-line); border-radius: var(--gp-radius); padding: 10px; min-height: 200px; }
.gp-kanban-col h3 { margin: 0 0 8px; font-family: var(--gp-font-display); font-size: 16px; display: flex; justify-content: space-between; }
.gp-kanban-card { display: block; width: 100%; text-align: left; background: var(--gp-bg); border: 1px solid var(--gp-line); border-radius: var(--gp-radius);
    padding: 8px 10px; margin-bottom: 8px; font: inherit; color: inherit; cursor: pointer; }
.gp-kanban-card.overdue { border-left: 4px solid var(--gp-stop); }
.gp-gantt { position: relative; overflow-x: auto; }
.gp-gantt-row { display: grid; grid-template-columns: 260px 1fr; align-items: center; border-bottom: 1px solid var(--gp-line); min-height: 30px; }
.gp-gantt-label { padding: 4px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-gantt-track { position: relative; height: 30px; }
.gp-gantt-bar { position: absolute; top: 7px; height: 16px; border-radius: 3px; background: var(--gp-navy); }
.gp-gantt-bar.baseline { top: 22px; height: 4px; background: var(--gp-steel); opacity: .5; }
.gp-gantt-bar.done { background: var(--gp-go); }
.gp-gantt-bar.late { background: var(--gp-stop); }
.gp-gantt-bar.phase { background: var(--gp-amber); height: 8px; top: 11px; }
.gp-gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--gp-amber); }
.gp-gantt-scale { display: grid; grid-template-columns: 260px 1fr; font-size: 12px; color: var(--gp-steel); }
.gp-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gp-photo { background: var(--gp-surface); border: 1px solid var(--gp-line); border-radius: var(--gp-radius); overflow: hidden; font-size: 13px; }
.gp-photo img, .gp-photo video { width: 100%; height: 160px; object-fit: cover; display: block; background: #0E1C2B; }
.gp-photo dl { margin: 0; padding: 8px 10px; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; }
.gp-photo dt { color: var(--gp-steel); }
.gp-photo dd { margin: 0; }
.gp-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.gp-kpi { background: var(--gp-surface); border: 1px solid var(--gp-line); border-radius: var(--gp-radius); padding: 12px 14px; text-decoration: none; color: inherit; }
.gp-kpi span { display: block; color: var(--gp-steel); font-size: 13px; }
.gp-kpi strong { display: block; font-family: var(--gp-font-display); font-size: 26px; }
.gp-light { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.gp-light::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.gp-light-green { color: var(--gp-go); }
.gp-light-amber { color: var(--gp-hold); }
.gp-light-red { color: var(--gp-stop); }
.gp-bell { position: relative; margin-right: 8px; }
.gp-bell-count { position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--gp-stop);
    color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.gp-bell-panel { position: absolute; right: 0; top: 44px; width: 360px; max-height: 70vh; overflow-y: auto; z-index: 1300; padding: 12px; color: var(--gp-ink); }
.gp-bell-item { display: grid; gap: 2px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--gp-line); padding: 8px 4px;
    font: inherit; color: inherit; cursor: pointer; }
.gp-bell-item:hover { background: var(--gp-bg); }
.gp-pre-wrap { white-space: pre-wrap; font-size: 13px; }
.gp-ai { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.gp-ai-list { padding: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.gp-ai-conv { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 8px; cursor: pointer; font: inherit; color: inherit; }
.gp-ai-conv:hover, .gp-ai-conv.active { background: var(--gp-bg); }
.gp-ai-chat { padding: 16px; display: flex; flex-direction: column; gap: 12px; min-height: 60vh; }
.gp-ai-messages { flex: 1; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: 60vh; }
.gp-ai-msg { max-width: 80%; padding: 10px 12px; border-radius: 8px; background: var(--gp-bg); }
.gp-ai-msg.user { align-self: flex-end; background: #E6EDF4; }
.gp-ai-pending { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px; border-left: 4px solid var(--gp-amber); background: #FFF8E1; border-radius: 6px; }
.gp-ai-input { display: flex; gap: 8px; align-items: flex-end; }
.gp-ai-input textarea { flex: 1; resize: vertical; }
@media (max-width: 900px) { .gp-ai { grid-template-columns: 1fr; } }
.gp-mt { margin-top: 16px; }
.gp-consent { padding: 20px; margin-bottom: 16px; border-top: 6px solid var(--gp-amber); } .gp-consent h2 { margin: 0 0 8px; font-family: var(--gp-font-display); }
.gp-tag-go { background: #E6F4EC; color: var(--gp-go); }
.gp-tag-hold { background: #FDF1DE; color: var(--gp-hold); }
.gp-tag-stop { background: #FBE7E7; color: var(--gp-stop); }
.gp-tag-review { background: #E5EEF8; color: var(--gp-review); }
.gp-row-link { cursor: pointer; }
.gp-row-link:hover td { background: var(--gp-bg); }
.gp-po-lines input.gp-input, .gp-po-lines select.gp-select { min-width: 0; width: 100%; }
.gp-po-lines td { vertical-align: top; }
.gp-po-totals { display: grid; grid-template-columns: auto auto; gap: 4px 24px; justify-content: end; padding: 12px 16px; }
.gp-po-totals dt { color: var(--gp-steel); }
.gp-po-totals dd { margin: 0; text-align: right; font-family: var(--gp-font-mono); }
.gp-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; } .gp-facts dt { color: var(--gp-steel); } .gp-facts dd { margin: 0; }
/* Project site map (BO-20) */
.gp-site-map { margin: 4px 0 8px; }
.gp-site-map-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.gp-site-map-hint { margin: 0 0 8px; font-size: 13px; }
.gp-map-canvas { height: 420px; border: 1px solid var(--gp-line); border-radius: 6px; }
.gp-map-placeholder { display: flex; align-items: center; gap: 10px; padding: 16px; border: 1px dashed #C9D1DA; border-radius: 6px; background: var(--gp-bg); color: var(--gp-steel); }
.gp-site-map-area { margin: 8px 0 0; }

/* HR employees and payroll (BO-100..BO-107) */
.gp-table .gp-cell-input { width: 76px; padding: 4px 6px; min-height: 0; }
.gp-table .gp-cell-select { width: 92px; padding: 4px 6px; min-height: 0; }
.gp-table tr.gp-row-flag td { background: #FFF8EB; }
.gp-table tfoot td { font-weight: 600; border-top: 2px solid var(--gp-line); }
.gp-designations { display: flex; flex-wrap: wrap; gap: 6px 16px; }
/* Task log timeline and recurring proof (BO-110, BO-111) */
.gp-occurrences { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.gp-occurrences .gp-tag { border: 1px solid transparent; cursor: pointer; }
.gp-occurrences .gp-tag:disabled { cursor: default; }
.gp-occurrences .gp-tag.active { border-color: var(--gp-navy); box-shadow: 0 0 0 2px rgba(245, 179, 1, .45); }
.gp-timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.gp-timeline > li { border-left: 3px solid var(--gp-line); padding: 4px 0 12px 12px; margin-left: 4px; }
.gp-log-files { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin: 6px 0; }
.gp-log-files img { width: 120px; height: 90px; object-fit: cover; border-radius: 4px; border: 1px solid var(--gp-line); }
.gp-log-files video { width: 240px; max-height: 180px; border-radius: 4px; background: #000; }
.gp-log-files audio { width: 240px; }

/* Daily job sheet (BO-114) */
.gp-js-summary { display: flex; flex-wrap: wrap; gap: 20px; color: var(--gp-steel); margin: 12px 0; }
.gp-js-summary strong { color: var(--gp-ink); font-family: var(--gp-font-mono); }
.gp-js-table td { vertical-align: top; }
.gp-js-table .gp-select, .gp-js-table .gp-input { width: 100%; min-width: 0; }
.gp-js-job { border-top: 2px solid var(--gp-line); }
.gp-js-site { min-width: 240px; }
.gp-js-site .gp-select + .gp-select { margin-top: 6px; }
.gp-js-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.gp-js-order { min-width: 110px; }
.gp-js-num { width: 96px !important; font-family: var(--gp-font-mono); }
.gp-js-trip { width: 64px !important; font-family: var(--gp-font-mono); }
.gp-js-center { text-align: center; }
.gp-js-share { width: 100%; font-family: var(--gp-font-mono); white-space: pre; }
.gp-js-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Weather log calendar (BO-115) */
.gp-wx-month { width: auto; }
.gp-wx-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.gp-wx-head { padding: 8px 10px; background: var(--gp-navy); color: #fff; font-family: var(--gp-font-display); font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.gp-wx-day { min-height: 112px; padding: 6px; border-right: 1px solid var(--gp-line); border-bottom: 1px solid var(--gp-line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gp-wx-day:nth-child(7n) { border-right: 0; }
.gp-wx-day.outside { background: var(--gp-bg); }
.gp-wx-day.outside .gp-wx-date { color: #9AA6B2; }
.gp-wx-day.wet { background: #EEF4FB; }
.gp-wx-day.today .gp-wx-date span:first-child { background: var(--gp-amber); color: var(--gp-ink); border-radius: 12px; padding: 0 7px; }
.gp-wx-date { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 2px 4px; border: 0; background: none; border-radius: var(--gp-radius);
  font: inherit; font-family: var(--gp-font-mono); font-size: 13px; font-weight: 600; color: var(--gp-ink); text-align: left; }
button.gp-wx-date { cursor: pointer; }
button.gp-wx-date:hover, button.gp-wx-date:focus-visible { background: #E5EEF8; outline: none; }
.gp-wx-add { color: var(--gp-steel); font-family: var(--gp-font-body); font-size: 16px; line-height: 1; opacity: 0; }
button.gp-wx-date:hover .gp-wx-add, button.gp-wx-date:focus-visible .gp-wx-add { opacity: 1; }
.gp-wx-entry { display: flex; flex-wrap: wrap; gap: 0 6px; width: 100%; padding: 3px 6px; border: 1px solid #B8CDE6; border-left: 3px solid var(--gp-review); border-radius: 4px;
  background: #fff; font: inherit; font-size: 12px; line-height: 1.35; color: var(--gp-ink); text-align: left; cursor: pointer; min-width: 0; }
.gp-wx-entry:hover, .gp-wx-entry:focus-visible { border-color: var(--gp-review); box-shadow: 0 0 0 2px rgba(43, 108, 176, .2); outline: none; }
.gp-wx-type { font-weight: 700; color: var(--gp-review); }
.gp-wx-time { font-family: var(--gp-font-mono); }
.gp-wx-projects { flex-basis: 100%; color: var(--gp-steel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-wx-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.gp-wx-pick .gp-input { flex: 1 1 220px; }
@media (max-width: 760px) {
  .gp-wx-day { min-height: 76px; padding: 3px; }
  .gp-wx-entry { padding: 2px 3px; font-size: 11px; }
  .gp-wx-projects { display: none; }
}

/* Focus tasks From / To date filters (BO-37): full-size date boxes, not the checkbox sizing of .gp-check */
label.gp-date-filter { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
label.gp-date-filter .gp-input { width: 160px; min-width: 0; }

/* Searchable lookup picker, e.g. BOQ item on the task form (BO-31) */
.gp-search-picker-field { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; }
.gp-search-picker { position: relative; font-weight: 400; }
.gp-search-picker-chosen { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; margin-top: 6px; padding: 6px 10px; background: var(--gp-bg); border-radius: 6px; }
.gp-search-picker-chosen .gp-link-btn { word-break: normal; flex: none; }
.gp-search-picker-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto; margin: 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid var(--gp-line); border-radius: 6px; box-shadow: 0 8px 24px rgba(14, 28, 43, .16); }
.gp-search-picker-list li { padding: 8px 12px; cursor: pointer; line-height: 1.35; }
.gp-search-picker-list li.active, .gp-search-picker-list li[role=option]:hover { background: #FFF6D6; }
.gp-search-picker-list li.gp-muted { cursor: default; }

/* Restricted documents (BO-116..BO-119) */
.gp-doc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; font-weight: 600; }
.gp-doc-crumbs a { color: var(--gp-review); text-decoration: none; }
.gp-doc-crumbs a:hover { text-decoration: underline; }
.gp-doc-search { min-width: 260px; }
.gp-doc-drop { position: relative; display: block; margin-bottom: 14px; padding: 18px; border: 2px dashed #C9D1DA; border-radius: 8px; background: #fff; color: var(--gp-steel); text-align: center; cursor: pointer; }
.gp-doc-drop:hover { border-color: var(--gp-amber); background: #FFF9E6; }
.gp-doc-drop.busy { opacity: .6; }
.gp-doc-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.gp-doc-name { display: inline-flex; align-items: center; gap: 8px; color: var(--gp-ink); font-weight: 600; text-decoration: none; word-break: break-word; }
.gp-doc-name:hover span { text-decoration: underline; }
.gp-doc-sort { color: inherit; white-space: nowrap; }
.gp-doc-actions { white-space: nowrap; }
.gp-doc-actions .gp-btn { padding: 4px 8px; min-height: 0; font-size: 13px; }
.gp-doc-modes { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0 0 8px; }
.gp-doc-modes legend { font-weight: 600; margin-bottom: 4px; }
.gp-doc-modes label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.gp-doc-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.gp-doc-owner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 12px; }
.gp-doc-browse { list-style: none; margin: 8px 0; padding: 0; max-height: 280px; overflow-y: auto; }
.gp-doc-browse li { padding: 4px 0; }
/* Daily progress row entry (BO-122): quantity, photos and Add on one line, wrapping on narrow screens. */
.gp-inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gp-inline-form input[type=file] { max-width: 14rem; font-size: 0.85rem; }

/* Floating help chat "Ask Boss Ping" (AI-29) – bottom right on every signed-in page, under dialogs (1400). */
.gp-help { position: fixed; right: 24px; bottom: 24px; z-index: 1350; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; pointer-events: none; }
.gp-help > * { pointer-events: auto; }
.gp-help-fab { position: relative; width: 64px; height: 64px; padding: 2px; border: 3px solid var(--gp-navy); border-radius: 50%; background: var(--gp-amber); cursor: pointer;
    box-shadow: 0 6px 18px rgba(14, 28, 43, .28); transition: transform .15s ease, box-shadow .15s ease; }
.gp-help-fab img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.gp-help-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 10px 24px rgba(14, 28, 43, .32); }
.gp-help-fab:focus-visible { outline: 3px solid var(--gp-review); outline-offset: 3px; }
.gp-help-fab-badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--gp-navy); color: #fff;
    font: 700 13px/22px var(--gp-font-body); text-align: center; border: 2px solid #fff; }
.gp-help-panel { width: 380px; height: min(600px, calc(100vh - 140px)); display: flex; flex-direction: column; background: var(--gp-surface); color: var(--gp-ink);
    border-radius: 12px; overflow: hidden; box-shadow: 0 16px 48px rgba(14, 28, 43, .28); border: 1px solid var(--gp-line); }
.gp-help-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; background: var(--gp-navy); color: #fff; border-top: 4px solid var(--gp-amber); }
.gp-help-head > img { border-radius: 50%; background: var(--gp-amber); flex: none; }
.gp-help-title { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2; }
.gp-help-title strong { font: 600 20px/1.1 var(--gp-font-display); letter-spacing: .02em; }
.gp-help-title span { font-size: 12px; opacity: .8; }
.gp-help-head-btn { border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; border-radius: 6px; height: 30px; min-width: 30px; padding: 0 8px;
    font: 600 13px var(--gp-font-body); cursor: pointer; }
.gp-help-head-btn:hover { background: var(--gp-navy-2); }
.gp-help-close { font-size: 20px; line-height: 1; padding: 0; }
.gp-help-messages { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; background: var(--gp-bg); }
.gp-help-msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.gp-help-msg p { margin: 0 0 6px; }
.gp-help-msg p:last-child, .gp-help-msg ul:last-child, .gp-help-msg ol:last-child { margin-bottom: 0; }
.gp-help-msg ul, .gp-help-msg ol { margin: 0 0 6px; padding-left: 20px; }
.gp-help-msg li { margin: 2px 0; }
.gp-help-msg code { font: 12px var(--gp-font-mono); background: var(--gp-bg); padding: 0 3px; border-radius: 3px; }
.gp-help-msg.bot { align-self: flex-start; background: var(--gp-surface); border: 1px solid var(--gp-line); border-bottom-left-radius: 4px; }
.gp-help-msg.me { align-self: flex-end; background: var(--gp-navy); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.gp-help-msg.refused { border-color: var(--gp-hold); color: var(--gp-hold); }
.gp-help-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gp-help-chip { border: 1px solid var(--gp-navy); background: var(--gp-surface); color: var(--gp-navy); border-radius: 16px; padding: 5px 11px; font: 500 13px var(--gp-font-body);
    cursor: pointer; text-align: left; }
.gp-help-chip:hover { background: var(--gp-navy); color: #fff; }
.gp-help-typing { display: flex; gap: 4px; padding: 12px 14px; }
.gp-help-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--gp-steel); animation: gp-help-dot 1s infinite ease-in-out; }
.gp-help-typing span:nth-child(2) { animation-delay: .15s; }
.gp-help-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes gp-help-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.gp-help-input { display: flex; gap: 8px; padding: 10px 12px 4px; border-top: 1px solid var(--gp-line); background: var(--gp-surface); }
.gp-help-input .gp-input { flex: 1; min-width: 0; }
.gp-help-input .gp-btn { flex: none; padding: 0 12px; }
.gp-help-note { margin: 0; padding: 2px 12px 8px; font-size: 11px; color: var(--gp-steel); background: var(--gp-surface); }
@media (max-width: 600px) {
    .gp-help { right: 16px; bottom: 16px; }
    .gp-help.open { left: 16px; }
    .gp-help-panel { width: 100%; height: calc(100vh - 120px); }
    .gp-help-fab { width: 56px; height: 56px; }
}

/* ---------------------------------------------------------------- organisation chart (BO-130) */
/* Laid out like the company's site organisation chart: director on top with HR beside, department boxes below (Site Navy, the
   header colour), reporting trees inside a department, and the Project department as one box per running site. Each <li> is a
   box, its <ul> the boxes below; the connecting lines are the li / ul pseudo elements. */
.gp-org-main { min-width: 0; display: grid; gap: 24px; align-content: start; }
.gp-org-canvas { overflow-x: auto; padding: 24px 16px 28px; }
.gp-org ul { position: relative; display: flex; justify-content: center; margin: 0; padding: 22px 0 0; list-style: none; }
.gp-org > ul { padding-top: 0; width: max-content; min-width: 100%; }
.gp-org li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 6px 0; }
.gp-org > ul > li { padding-top: 0; }
.gp-org li::before, .gp-org li::after {
    content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid #B8C2CE;
}
.gp-org li::after { right: auto; left: 50%; border-left: 2px solid #B8C2CE; }
.gp-org li:only-child::before, .gp-org li:only-child::after { display: none; }
.gp-org li:only-child { padding-top: 0; }
.gp-org li:first-child::before, .gp-org li:last-child::after { border: 0 none; }
.gp-org li:last-child::before { border-right: 2px solid #B8C2CE; border-radius: 0 6px 0 0; }
.gp-org li:first-child::after { border-radius: 6px 0 0 0; }
.gp-org > ul > li::before, .gp-org > ul > li::after { display: none; }
.gp-org ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid #B8C2CE; }

/* Top row: the director in the middle (the line down starts under them), HR hangs to the right on a dashed staff line. */
.gp-org-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-self: stretch; }
.gp-org-head-main { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gp-org-head-line::after { content: ""; flex: 1; min-height: 0; border-left: 2px solid #B8C2CE; margin-top: -10px; }
.gp-org-side { position: relative; justify-self: start; margin-left: 44px; display: flex; flex-direction: column; gap: 8px; width: 230px; }
.gp-org-side::before { content: ""; position: absolute; right: calc(100% + 2px); top: 36px; width: 42px; border-top: 2px dashed #B8C2CE; }

.gp-org-dept {
    display: inline-flex; flex-direction: column; align-items: center; min-width: 180px; padding: 8px 16px; border-radius: var(--gp-radius);
    background: var(--gp-navy); color: #fff; font-family: var(--gp-font-display); font-weight: 600; font-size: 17px;
    letter-spacing: .02em; text-align: center; text-decoration: none;
}
.gp-org-dept span { font-family: var(--gp-font-body); font-weight: 400; font-size: 12px; color: #C9D6E3; letter-spacing: 0; }
.gp-org-dept-link:hover { background: var(--gp-navy-2); }
.gp-org-dept-hr { background: var(--gp-review); }
.gp-org-dept-top { font-size: 20px; }

.gp-org-card {
    display: flex; align-items: center; gap: 10px; width: 220px; padding: 10px 12px; text-align: left;
    background: var(--gp-surface); border: 1px solid var(--gp-line); border-top: 3px solid var(--gp-steel);
    border-radius: var(--gp-radius); box-shadow: var(--gp-shadow); font: inherit; color: inherit; cursor: pointer;
    transition: border-color .15s, box-shadow .15s, opacity .15s;
}
.gp-org-card:hover { border-color: #B8C2CE; box-shadow: 0 2px 10px rgba(14, 28, 43, .12); }
.gp-org-card-top { width: 250px; border-top-color: var(--gp-navy); padding: 14px 16px; }
.gp-org-card-top .gp-org-name { font-size: 20px; }
.gp-org-side .gp-org-card { width: 100%; border-top-color: var(--gp-review); }
.gp-org-card-compact { width: 100%; padding: 7px 10px; border-top-width: 1px; box-shadow: none; }
.gp-org-card-compact .gp-org-name { font-size: 15px; }
.gp-org-card.selected { border-color: var(--gp-amber); box-shadow: 0 0 0 2px rgba(245, 179, 1, .35); }
.gp-org-card.match { border-color: var(--gp-amber); background: #FFFBEB; }
.gp-org-card.dim { opacity: .4; }
.gp-org-text { display: flex; flex-direction: column; min-width: 0; }
.gp-org-name { font-family: var(--gp-font-display); font-weight: 600; font-size: 17px; line-height: 1.15; overflow-wrap: anywhere; }
.gp-org-role { font-size: 13px; color: var(--gp-steel); line-height: 1.25; }
.gp-org-team { margin-top: 2px; font-family: var(--gp-font-mono); font-size: 11px; color: var(--gp-steel); }

/* A lead and their team as one column with a short line between people (HR, small teams, site boxes). */
.gp-org-chain { display: flex; flex-direction: column; gap: 10px; width: 220px; }
.gp-org-chain > .gp-org-card { position: relative; }
.gp-org-chain > .gp-org-card + .gp-org-card::before {
    content: ""; position: absolute; left: 50%; top: -12px; height: 10px; border-left: 2px solid #B8C2CE;
}

/* Project department: one box per running site. */
.gp-org-sites-section p { margin: 4px 0 12px; }
.gp-org-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; align-items: start; }
.gp-org-site { background: var(--gp-surface); border: 1px solid var(--gp-line); border-radius: var(--gp-radius); box-shadow: var(--gp-shadow); overflow: hidden; }
.gp-org-site header { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: #EEF1F4; border-bottom: 1px solid var(--gp-line); }
.gp-org-site.match header { background: #FFF6DB; }
.gp-org-site-name { font-family: var(--gp-font-display); font-weight: 600; font-size: 17px; color: var(--gp-navy); text-decoration: none; overflow-wrap: anywhere; }
a.gp-org-site-name:hover { text-decoration: underline; }
.gp-org-site .gp-org-chain { width: auto; padding: 12px; }
.gp-org-site > p { padding: 12px; margin: 0; }
.gp-org-site-none header { background: var(--gp-bg); }
.gp-org-site-none .gp-org-site-name { color: var(--gp-steel); }

.gp-org-detail { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.gp-org-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.gp-org-list .gp-link-btn { color: var(--gp-ink); word-break: normal; }

@media (max-width: 600px) {
    .gp-org-card, .gp-org-chain { width: 180px; }
    .gp-org-card-top { width: 200px; }
    .gp-org-head { grid-template-columns: 1fr; justify-items: center; }
    .gp-org-head > div[aria-hidden] { display: none; }
    .gp-org-side { margin: 12px 0; width: 200px; }
    .gp-org-side::before { display: none; }
    .gp-org-sites { grid-template-columns: 1fr; }
}
/* Task status dot (BO-134): colour from the status tokens, always with a label (title / aria-label). */
.gp-task-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; vertical-align: middle; margin-right: 6px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(14, 28, 43, .12); }
.gp-task-dot-done { background: var(--gp-go); }
.gp-task-dot-pendingapproval { background: var(--gp-hold); }
.gp-task-dot-overdue { background: var(--gp-stop); }
.gp-task-dot-open { background: #8A97A6; }
.gp-task-dot-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: .85rem; color: var(--gp-steel, #5A6B7D); }

/* ----- Instant messaging (BO-140..BO-143): chat list left, open chat right; navy for own messages, amber for an @ of the reader. ----- */
.gp-chat { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; height: calc(100vh - 150px); min-height: 480px; }
.gp-chat > .gp-card { padding: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.gp-chat-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 8px; }
.gp-chat-list-head h1 { margin: 0; font-family: var(--gp-font-display); font-weight: 700; font-size: 28px; color: var(--gp-navy); }
.gp-chat-search { min-width: 0; max-width: none; flex: none; margin: 0 14px 8px; }
.gp-chat-items { list-style: none; margin: 0; padding: 0 0 8px; overflow-y: auto; flex: 1; }
.gp-chat-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 0; border-left: 3px solid transparent; background: none; color: var(--gp-ink); text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
.gp-chat-item:hover { background: var(--gp-bg); }
.gp-chat-item.active { background: #E8EEF5; border-left-color: var(--gp-amber); }
.gp-chat-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.gp-chat-item-top, .gp-chat-item-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.gp-chat-item-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-chat-time { font-size: 12px; color: var(--gp-steel); flex: none; }
.gp-chat-preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.gp-chat-count { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gp-navy); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.gp-chat-at { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--gp-amber); color: var(--gp-navy); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.gp-chat-group-face { flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--gp-navy); }
.gp-chat-people { display: flex; flex-direction: column; min-height: 0; flex: 1; border-top: 1px solid var(--gp-line); }
.gp-chat-people-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; }

.gp-chat-room-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--gp-line); background: #fff; }
.gp-chat-room-title { display: flex; flex-direction: column; min-width: 0; }
.gp-chat-room-title strong { font-family: var(--gp-font-display); font-size: 22px; font-weight: 600; color: var(--gp-navy); line-height: 1.1; }
.gp-chat-room-title .gp-muted { font-size: 13px; }
.gp-chat-back { display: none; font-size: 26px; text-decoration: none; color: var(--gp-navy); }
.gp-chat-empty { margin: auto; text-align: center; padding: 32px; max-width: 380px; }

.gp-chat-messages { flex: 1; overflow-y: auto; padding: 12px 18px; background: var(--gp-bg); display: flex; flex-direction: column; gap: 4px; }
.gp-chat-messages.dragging { outline: 3px dashed var(--gp-amber); outline-offset: -6px; }
.gp-chat-older { text-align: center; }
.gp-chat-first { text-align: center; margin: auto; }
.gp-chat-day { text-align: center; margin: 12px 0 6px; }
.gp-chat-day span { display: inline-block; padding: 2px 12px; border-radius: 12px; background: #E1E6EC; color: var(--gp-steel); font-size: 12px; font-weight: 600; }
.gp-chat-msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; max-width: 78%; }
.gp-chat-msg.grouped { margin-top: 0; }
.gp-chat-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.gp-chat-msg-face { width: 32px; flex: none; }
.gp-chat-bubble { position: relative; min-width: 72px; padding: 7px 11px 5px; border-radius: 12px; background: #fff; border: 1px solid var(--gp-line); box-shadow: 0 1px 1px rgba(14, 28, 43, .04); overflow-wrap: anywhere; }
.gp-chat-msg.mine .gp-chat-bubble { background: var(--gp-navy); border-color: var(--gp-navy); color: #fff; }
.gp-chat-msg.tagged .gp-chat-bubble { border-color: var(--gp-amber); box-shadow: 0 0 0 2px rgba(245, 179, 1, .45); }
.gp-chat-sender { font-size: 12px; font-weight: 700; color: var(--gp-review); margin-bottom: 2px; }
.gp-chat-text { line-height: 1.4; white-space: normal; }
.gp-chat-meta { font-size: 11px; color: var(--gp-steel); text-align: right; margin-top: 2px; }
.gp-chat-msg.mine .gp-chat-meta { color: #B9C7D6; }
.gp-chat-mention { font-weight: 700; color: var(--gp-review); }
.gp-chat-mention.me { background: #FFF1C2; color: var(--gp-navy); border-radius: 4px; padding: 0 3px; }
.gp-chat-msg.mine .gp-chat-mention { color: #FFD966; }
.gp-chat-msg.mine .gp-chat-mention.me { color: var(--gp-navy); }
.gp-chat-task { font-weight: 700; color: var(--gp-review); text-decoration: underline; text-underline-offset: 2px; }
.gp-chat-msg.mine .gp-chat-task { color: #9FD0FF; }
.gp-chat-record { font-weight: 700; color: var(--gp-navy); text-decoration: underline; text-underline-offset: 2px; }
.gp-chat-msg.mine .gp-chat-record { color: #FFD966; }
.gp-chat-media { display: block; max-width: min(360px, 100%); margin: 2px 0 4px; border-radius: 8px; overflow: hidden; background: #000; }
.gp-chat-media img { display: block; max-width: 100%; max-height: 320px; object-fit: contain; background: #fff; }
video.gp-chat-media { max-height: 320px; }
.gp-chat-voice { display: flex; align-items: center; gap: 6px; margin: 2px 0 4px; }
.gp-chat-voice audio { height: 36px; max-width: 280px; }
.gp-chat-download { display: block; font-size: 12px; color: inherit; opacity: .75; }

.gp-chat-status { padding: 6px 16px; font-size: 13px; background: #E5EEF8; color: var(--gp-review); border-top: 1px solid var(--gp-line); }
.gp-chat-status.error { background: #FBE7E7; color: var(--gp-stop); }
.gp-chat-readonly { padding: 12px 16px; margin: 0; border-top: 1px solid var(--gp-line); }
.gp-chat-composer { position: relative; padding: 10px 12px 6px; border-top: 1px solid var(--gp-line); background: #fff; }
.gp-chat-input-row { display: flex; align-items: flex-end; gap: 6px; }
.gp-chat-tool { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; cursor: pointer; font-size: 20px; line-height: 1; }
.gp-chat-tool:hover { background: var(--gp-bg); }
.gp-chat-textarea { flex: 1; min-height: 40px; max-height: 160px; resize: none; padding: 9px 12px; border: 1px solid #C9D1DA; border-radius: 20px; font: inherit; line-height: 1.4; outline: none; }
.gp-chat-textarea:focus { border-color: var(--gp-navy); box-shadow: 0 0 0 3px rgba(245, 179, 1, .35); }
.gp-chat-send { flex: none; width: 44px; height: 40px; padding: 0; border-radius: 20px; justify-content: center; }
.gp-chat-hint { margin: 4px 0 0 4px; font-size: 11px; color: var(--gp-steel); }
.gp-chat-recording { display: flex; align-items: center; gap: 10px; padding: 4px 4px 8px; font-weight: 600; color: var(--gp-stop); }
.gp-chat-rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gp-stop); animation: gp-chat-pulse 1s infinite; }
@keyframes gp-chat-pulse { 50% { opacity: .3; } }
.gp-chat-emoji { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; padding: 8px 12px; border-top: 1px solid var(--gp-line); background: #fff; max-height: 180px; overflow-y: auto; }
.gp-chat-emoji button { border: 0; background: none; font-size: 22px; line-height: 1; padding: 6px 0; border-radius: 6px; cursor: pointer; }
.gp-chat-emoji button:hover { background: var(--gp-bg); }

/* @ / # picker above the message box, drawn by gurori.chat */
.gp-chat-pop { display: none; position: absolute; left: 12px; right: 12px; bottom: calc(100% - 4px); z-index: 40; max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid var(--gp-line); border-radius: 8px; box-shadow: 0 -8px 24px rgba(14, 28, 43, .16); }
.gp-chat-pop.open { display: block; }
.gp-chat-pop-head { position: sticky; top: 0; display: flex; justify-content: space-between; gap: 8px; padding: 6px 12px; background: var(--gp-navy); color: #fff; font-size: 12px; font-weight: 700; }
.gp-chat-pop-head span { font-weight: 400; opacity: .75; }
.gp-chat-pop-empty { padding: 10px 12px; color: var(--gp-steel); font-size: 13px; }
.gp-chat-pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 12px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.gp-chat-pop-item.active, .gp-chat-pop-item:hover { background: #FFF6D6; }
.gp-chat-pop-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-chat-pop-sub { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--gp-steel); }
.gp-chat-pop-code { flex: none; font-family: var(--gp-font-mono); font-size: 13px; color: var(--gp-navy); }

/* Floating chat (BO-140): round navy Chat button left of the help button; the window opens above the two buttons, over every page. */
.gp-chat-fab { position: fixed; right: 100px; bottom: 26px; z-index: 1350; width: 60px; height: 60px; display: grid; place-items: center; padding: 0;
    border: 3px solid var(--gp-amber); border-radius: 50%; background: var(--gp-navy); cursor: pointer; box-shadow: 0 6px 18px rgba(14, 28, 43, .28);
    transition: transform .15s ease, box-shadow .15s ease; }
.gp-chat-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 10px 24px rgba(14, 28, 43, .32); }
.gp-chat-fab:focus-visible { outline: 3px solid var(--gp-review); outline-offset: 3px; }
.gp-chat-fab.open { background: var(--gp-navy-2); }
.gp-chat-fab .gp-nav-badge { position: absolute; top: -6px; right: -6px; margin: 0; border: 2px solid #fff; }
.gp-chat-dock { position: fixed; right: 24px; bottom: 100px; z-index: 1340; width: min(820px, calc(100vw - 48px)); height: min(640px, calc(100vh - 190px));
    display: flex; flex-direction: column; background: var(--gp-surface); border: 1px solid #C9D1DA; border-radius: 12px; overflow: hidden;
    box-shadow: 0 18px 48px rgba(14, 28, 43, .28); }
.gp-chat-dock[hidden] { display: none; }
.gp-chat-dock.large { width: min(1500px, calc(100vw - 296px)); height: calc(100vh - 190px); }
.gp-chat-dock-bar { flex: none; display: flex; align-items: center; gap: 2px; padding: 4px 6px 4px 12px; background: var(--gp-navy); color: #fff; }
.gp-chat-dock-title { display: inline-flex; align-items: center; gap: 8px; font-family: var(--gp-font-display); font-size: 20px; font-weight: 600; }
.gp-chat-dock-btn { width: 34px; height: 34px; border: 0; border-radius: 6px; background: none; color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.gp-chat-dock-btn:hover { background: rgba(255, 255, 255, .12); }
.gp-chat-dock-body { flex: 1; min-height: 0; display: flex; flex-direction: column; container-type: inline-size; }
.gp-chat-dock .gp-chat { flex: 1; height: auto; min-height: 0; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 0; }
.gp-chat-dock .gp-chat > .gp-card { border: 0; border-radius: 0; box-shadow: none; }
.gp-chat-dock .gp-chat-list { border-right: 1px solid var(--gp-line); }
.gp-chat-dock .gp-chat-list-head { justify-content: flex-end; padding: 10px 14px 8px; }
.gp-chat-dock .gp-chat-room-title strong { font-size: 19px; }
.gp-chat-dock .gp-chat-msg { max-width: min(86%, 760px); }
@container (max-width: 640px) {
    .gp-chat-dock .gp-chat { grid-template-columns: minmax(0, 1fr); }
    .gp-chat-dock .gp-chat.has-current .gp-chat-list { display: none; }
    .gp-chat-dock .gp-chat:not(.has-current) .gp-chat-room { display: none; }
    .gp-chat-dock .gp-chat-list { border-right: 0; }
    .gp-chat-dock .gp-chat-back { display: grid; }
    .gp-chat-dock .gp-chat-hint { display: none; }
}
@media (max-width: 1100px) {
    .gp-chat-dock.large { width: calc(100vw - 48px); }
}
@media (max-width: 700px) {
    .gp-chat-dock, .gp-chat-dock.large { right: 8px; left: 8px; bottom: 96px; width: auto; height: calc(100vh - 170px); }
}.gp-nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gp-amber); color: var(--gp-navy); font-size: 12px; font-weight: 700; display: grid; place-items: center; }

@media (max-width: 900px) {
    .gp-chat { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 130px); }
    .gp-chat.has-current .gp-chat-list { display: none; }
    .gp-chat:not(.has-current) .gp-chat-room { display: none; }
    .gp-chat-back { display: grid; }
    .gp-chat-msg { max-width: 92%; }
    .gp-chat-hint { display: none; }
}