@import 'tailwindcss';

@source '../views/portal/**/*.blade.php';

:root {
    --portal-primary: #95c11f;
    --portal-primary-dark: #7fa519;
    --portal-text: #24282d;
    --portal-muted: #707780;
    --portal-border: #e3e6e8;
    --portal-background: #f5f6f7;
    --portal-surface: #ffffff;
    --portal-danger: #b42318;
    --portal-danger-bg: #fff3f2;
    --portal-success: #527a0f;
    --portal-success-bg: #f3f8e9;
    --portal-shadow: 0 18px 50px rgba(31, 38, 45, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--portal-background);
}

body.portal-body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(
            circle at top right,
            rgba(149, 193, 31, 0.08),
            transparent 32rem
        ),
        var(--portal-background);
    color: var(--portal-text);
    font-family:
        'Instrument Sans',
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

.portal-shell {
    width: min(1320px, calc(100% - 40px));
    margin-inline: auto;
}

.portal-public-header {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--portal-border);
}

.portal-public-header__inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--portal-text);
    text-decoration: none;
}

.portal-brand__mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--portal-primary);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.portal-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.portal-brand__text strong {
    font-size: 15px;
    font-weight: 700;
}

.portal-brand__text small {
    margin-top: 3px;
    color: var(--portal-muted);
    font-size: 12px;
}

.portal-public-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.portal-link {
    color: #515860;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.portal-link:hover {
    color: var(--portal-text);
}

.portal-guest-main {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    padding: 54px 20px;
}

.portal-auth-shell {
    width: 100%;
    max-width: 470px;
    margin-inline: auto;
}

.portal-card {
    overflow: hidden;
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow);
}

.portal-card__body {
    padding: 34px;
}

.portal-auth-heading {
    margin-bottom: 26px;
}

.portal-auth-heading h1 {
    margin: 0;
    color: var(--portal-text);
    font-size: clamp(26px, 5vw, 34px);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.portal-auth-heading p {
    margin: 10px 0 0;
    color: var(--portal-muted);
    font-size: 14px;
}

.portal-form {
    display: grid;
    gap: 18px;
}

.portal-field {
    display: grid;
    gap: 7px;
}

.portal-field label {
    color: #3b4147;
    font-size: 14px;
    font-weight: 600;
}

.portal-input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cfd4d8;
    border-radius: 10px;
    background: #fff;
    padding: 10px 13px;
    color: var(--portal-text);
    font: inherit;
    outline: none;
    transition:
        border-color 120ms ease,
        box-shadow 120ms ease;
}

.portal-input:hover {
    border-color: #aeb5bb;
}

.portal-input:focus {
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px rgba(149, 193, 31, 0.16);
}

.portal-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--portal-primary);
    border-radius: 10px;
    background: var(--portal-primary);
    padding: 9px 18px;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition:
        background 120ms ease,
        border-color 120ms ease,
        transform 120ms ease;
}

.portal-button:hover {
    border-color: var(--portal-primary-dark);
    background: var(--portal-primary-dark);
}

.portal-button:active {
    transform: translateY(1px);
}

.portal-button--small {
    min-height: 38px;
    padding-inline: 15px;
}

.portal-button--full {
    width: 100%;
}

.portal-error {
    margin: 0;
    color: var(--portal-danger);
    font-size: 13px;
}

.portal-alert {
    margin-bottom: 20px;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
}

.portal-alert--success {
    border: 1px solid #d8e7b7;
    background: var(--portal-success-bg);
    color: var(--portal-success);
}

.portal-auth-links {
    display: grid;
    gap: 10px;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--portal-border);
    text-align: center;
}

.portal-auth-links a {
    color: #586069;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.portal-auth-links a:hover {
    color: var(--portal-primary-dark);
}

.portal-home-card {
    text-align: center;
}

.portal-home-card__icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin: 0 auto 24px;
    border-radius: 20px;
    background: rgba(149, 193, 31, 0.12);
    color: var(--portal-primary-dark);
    font-size: 28px;
    font-weight: 700;
}

.portal-home-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 28px;
}

.portal-button--secondary {
    border-color: var(--portal-border);
    background: #fff;
    color: #4d545b;
}

.portal-button--secondary:hover {
    border-color: #c7ccd0;
    background: #f8f9f9;
}

.portal-footer {
    padding: 18px 0 26px;
    color: #92989e;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 640px) {
    .portal-shell {
        width: min(100% - 28px, 1180px);
    }

    .portal-public-header__inner {
        min-height: 68px;
    }

    .portal-brand__text small {
        display: none;
    }

    .portal-public-nav {
        gap: 10px;
    }

    .portal-card__body {
        padding: 26px 22px;
    }

    .portal-guest-main {
        padding: 34px 14px;
        align-items: flex-start;
    }

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

/* Portal dynamic branding */

.portal-brand__logo {
    width: 150px;
    height: 46px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.portal-brand__image {
    display: block;
    width: auto;
    max-width: 150px;
    height: auto;
    max-height: 46px;
    object-fit: contain;
}

.portal-home-card__logo {
    width: min(240px, 100%);
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.portal-home-card__logo-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 82px;
    object-fit: contain;
}

@media (max-width: 640px) {
    .portal-brand__logo {
        width: 120px;
        height: 40px;
    }

    .portal-brand__image {
        max-width: 120px;
        max-height: 40px;
    }
}

/* Authenticated Customer Area */

.portal-body--customer-area {
    background: #f6f7f8;
}

.portal-area-header {
    background: #fff;
    border-bottom: 1px solid var(--portal-border);
}

.portal-area-header__inner {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.portal-area-user {
    display: flex;
    align-items: center;
    gap: 18px;
}

.portal-area-user__identity {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.portal-area-user__identity strong {
    color: var(--portal-text);
    font-size: 14px;
}

.portal-area-user__identity small {
    margin-top: 2px;
    color: var(--portal-muted);
    font-size: 12px;
}

.portal-area-nav {
    background: #fff;
    border-bottom: 1px solid var(--portal-border);
}

.portal-area-nav__inner {
    min-height: 51px;
    display: flex;
    align-items: stretch;
    gap: 30px;
}

.portal-area-nav__link {
    display: flex;
    align-items: center;
    position: relative;
    color: #676e75;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.portal-area-nav__link:hover {
    color: var(--portal-text);
}

.portal-area-nav__link.is-active {
    color: var(--portal-text);
}

.portal-area-nav__link.is-active::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--portal-primary);
}

.portal-area-main {
    min-height: calc(100vh - 190px);
    padding: 42px 0 56px;
}

.portal-area-page-heading {
    margin-bottom: 28px;
}

.portal-area-page-heading--row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.portal-area-page-heading h1 {
    margin: 3px 0 7px;
    color: var(--portal-text);
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.portal-area-page-heading p:not(.portal-eyebrow) {
    max-width: 720px;
    margin: 0;
    color: var(--portal-muted);
    font-size: 14px;
}

.portal-eyebrow {
    margin: 0;
    color: var(--portal-primary-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.portal-dashboard-card {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: #fff;
    padding: 28px;
    color: var(--portal-text);
    text-decoration: none;
    box-shadow: 0 8px 28px rgba(31, 38, 45, 0.05);
    transition:
        border-color 120ms ease,
        box-shadow 120ms ease,
        transform 120ms ease;
}

a.portal-dashboard-card:hover {
    border-color: #ccd4ba;
    box-shadow: 0 12px 34px rgba(31, 38, 45, 0.08);
    transform: translateY(-2px);
}

.portal-dashboard-card__icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 12px;
    background: rgba(149, 193, 31, 0.12);
    color: var(--portal-primary-dark);
    font-size: 18px;
    font-weight: 700;
}

.portal-dashboard-card h2 {
    margin: 0 0 7px;
    font-size: 19px;
}

.portal-dashboard-card p {
    margin: 0;
    color: var(--portal-muted);
    font-size: 14px;
}

.portal-dashboard-card__action {
    margin-top: auto;
    padding-top: 22px;
    color: var(--portal-primary-dark);
    font-size: 14px;
    font-weight: 700;
}

.portal-ticket-list-card {
    overflow: visible;
}

.portal-ticket-table-wrap {
    overflow-x: auto;
}

.portal-ticket-table {
    width: 100%;
    border-collapse: collapse;
}

.portal-ticket-table th {
    border-bottom: 1px solid var(--portal-border);
    background: #fafafa;
    padding: 14px 18px;
    color: #777e85;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
}

.portal-ticket-table td {
    border-bottom: 1px solid #eceeef;
    padding: 18px;
    color: #535a61;
    font-size: 14px;
    vertical-align: middle;
}

.portal-ticket-table tbody tr:last-child td {
    border-bottom: 0;
}

.portal-ticket-table tbody tr:hover {
    background: #fafbf8;
}

.portal-ticket-number,
.portal-ticket-subject {
    text-decoration: none;
}

.portal-ticket-number {
    color: #697177;
    font-size: 12px;
    font-weight: 500;
}

.portal-ticket-subject {
    color: var(--portal-text);
    font-weight: 500;
}

.portal-ticket-number:hover,
.portal-ticket-subject:hover {
    color: var(--portal-primary-dark);
}

.portal-ticket-department {
    display: block;
    margin-top: 4px;
    color: var(--portal-muted);
    font-size: 12px;
}

.portal-meta-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border: 1px solid #dfe5d0;
    border-radius: 999px;
    background: #f6f9ee;
    padding: 4px 10px;
    color: #627631;
    font-size: 12px;
    font-weight: 700;
}

.portal-meta-badge--large {
    min-height: 32px;
    padding-inline: 13px;
}

.portal-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    margin-top: 22px;
    font-size: 13px;
}

.portal-pagination > div:last-child {
    text-align: right;
}

.portal-pagination__link {
    color: #555d64;
    font-weight: 700;
    text-decoration: none;
}

.portal-pagination__link:hover {
    color: var(--portal-primary-dark);
}

.portal-pagination__disabled {
    color: #b0b5b9;
}

.portal-pagination__current {
    color: var(--portal-muted);
}

.portal-empty-state {
    border: 1px dashed #d7dbde;
    border-radius: 16px;
    background: #fff;
    padding: 54px 24px;
    text-align: center;
}

.portal-empty-state--compact {
    padding: 30px 22px;
}

.portal-empty-state__icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 15px;
    background: rgba(149, 193, 31, 0.1);
    color: var(--portal-primary-dark);
    font-size: 22px;
    font-weight: 700;
}

.portal-empty-state h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.portal-empty-state p {
    margin: 0;
    color: var(--portal-muted);
    font-size: 14px;
}

.portal-ticket-back {
    margin-bottom: 18px;
}

.portal-ticket-back a {
    color: #626970;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.portal-ticket-back a:hover {
    color: var(--portal-primary-dark);
}

.portal-ticket-id {
    margin: 0 0 6px;
    color: #7b8389;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.portal-ticket-title {
    margin-bottom: 26px;
}

.portal-ticket-title .portal-eyebrow {
    margin-bottom: 6px;
}

.portal-ticket-title h1 {
    max-width: 980px;
    margin: 0;
    color: var(--portal-text);
    font-size: clamp(24px, 3vw, 30px);
    line-height: 1.2;
}

.portal-ticket-layout--detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 292px;
    align-items: start;
    gap: 22px;
}

.portal-ticket-content {
    min-width: 0;
    display: grid;
    gap: 30px;
}

.portal-ticket-section {
    min-width: 0;
}

.portal-ticket-section__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.portal-ticket-section__heading h2 {
    margin: 0;
    font-size: 19px;
}

.portal-ticket-section__heading > span {
    color: var(--portal-muted);
    font-size: 12px;
}

.portal-ticket-reply {
    padding: 20px 22px;
}

.portal-ticket-reply__form {
    gap: 18px;
}

.portal-ticket-reply .portal-textarea {
    min-height: 132px;
}

.portal-ticket-reply__footer {
    display: flex;
    justify-content: flex-end;
}

.portal-ticket-upload {
    display: grid;
    gap: 8px;
}

.portal-ticket-upload__dropzone {
    position: relative;
    overflow: hidden;
    border: 1px dashed #cbd2d8;
    border-radius: 11px;
    background: #fafbfb;
    transition:
        border-color 0.16s ease,
        background 0.16s ease;
}

.portal-ticket-upload__dropzone:focus-within,
.portal-ticket-upload__dropzone:hover {
    border-color: #aab5be;
    background: #f7f9f9;
}

.portal-ticket-upload__dropzone.is-dragging {
    border-color: var(--portal-primary);
    background: #f5f9eb;
}

.portal-ticket-upload__input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.portal-ticket-upload__label {
    position: relative;
    z-index: 1;
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    padding: 18px 22px;
    cursor: pointer;
    text-align: left;
}

.portal-ticket-upload__icon {
    width: 38px;
    height: 38px;
    display: grid;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 9px;
    background: #eef1f2;
    font-size: 18px;
}

.portal-ticket-upload__content {
    display: grid;
    gap: 4px;
}

.portal-ticket-upload__content strong {
    color: #555d64;
    font-size: 13px;
}

.portal-ticket-upload__content small {
    color: var(--portal-muted);
    font-size: 11px;
    line-height: 1.5;
}

.portal-ticket-upload__selected {
    display: grid;
    gap: 6px;
}

.portal-ticket-upload__selected[hidden] {
    display: none;
}

.portal-ticket-upload__file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    border: 1px solid #e2e6e8;
    border-radius: 8px;
    background: #fff;
    padding: 9px 11px;
}

.portal-ticket-upload__file-info {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.portal-ticket-upload__file-name {
    overflow: hidden;
    color: #444b51;
    font-size: 12px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-ticket-upload__file-size {
    color: var(--portal-muted);
    font-size: 10px;
}

.portal-ticket-upload__remove {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    padding: 4px 2px;
    color: #737b81;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.portal-ticket-upload__remove:hover,
.portal-ticket-upload__remove:focus-visible {
    color: var(--portal-text);
    text-decoration: underline;
}

.portal-ticket-conversation {
    min-width: 0;
}

.portal-thread {
    display: grid;
    gap: 12px;
}

.portal-thread-message {
    border: 1px solid var(--portal-border);
    border-radius: 9px;
    background: #fff;
    padding: 16px 18px;
}

.portal-thread-message__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}

.portal-thread-message__author {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.portal-thread-message__identity {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.portal-thread-message__header strong {
    color: var(--portal-text);
    font-size: 14px;
    font-weight: 600;
}

.portal-thread-message__header time {
    flex-shrink: 0;
    color: var(--portal-muted);
    font-size: 12px;
    white-space: nowrap;
}

.portal-thread-message__role {
    color: #8a9196;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.portal-thread-message__body {
    color: #444b51;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.portal-ticket-sidebar {
    position: sticky;
    top: 24px;
}

.portal-ticket-details {
    padding: 18px 20px;
}

.portal-ticket-details .portal-ticket-section__heading {
    margin-bottom: 8px;
}

.portal-ticket-details__list {
    margin: 0;
}

.portal-ticket-details__list > div {
    padding: 12px 0;
    border-bottom: 1px solid #eef0f1;
}

.portal-ticket-details__list > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.portal-ticket-details__list dt {
    margin-bottom: 6px;
    color: var(--portal-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-ticket-details__list dd {
    margin: 0;
    color: var(--portal-text);
    font-size: 13px;
    font-weight: 400;
}

.portal-alert--error {
    border: 1px solid #f0c9c5;
    background: var(--portal-danger-bg);
    color: var(--portal-danger);
}

.portal-alert ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.portal-closed-state {
    border: 1px solid #e3e5e6;
    border-radius: 10px;
    background: #f7f8f8;
    padding: 16px;
}

.portal-closed-state strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.portal-closed-state p {
    margin: 0;
    color: var(--portal-muted);
    font-size: 13px;
}

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

    .portal-ticket-layout--detail {
        grid-template-columns: 1fr;
    }

    .portal-ticket-sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .portal-ticket-title {
        margin-bottom: 22px;
    }

    .portal-ticket-title h1 {
        font-size: 24px;
    }

    .portal-ticket-reply {
        padding: 20px;
    }

    .portal-ticket-upload__label {
        align-items: flex-start;
        justify-content: flex-start;
        min-height: 96px;
        padding: 16px;
    }

    .portal-ticket-reply__footer {
        display: block;
    }

    .portal-ticket-reply__footer .portal-button {
        width: 100%;
    }

    .portal-thread-message {
        padding: 17px;
    }

    .portal-thread-message__header {
        display: grid;
        gap: 10px;
    }

    .portal-thread-message__header time {
        padding-left: 47px;
    }

    .portal-area-header__inner {
        min-height: auto;
        align-items: flex-start;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .portal-area-brand .portal-brand__text {
        display: none;
    }

    .portal-area-user {
        gap: 10px;
    }

    .portal-area-user__identity {
        display: none;
    }

    .portal-area-nav__inner {
        gap: 24px;
    }

    .portal-area-main {
        padding-top: 28px;
    }

    .portal-area-page-heading {
        margin-bottom: 22px;
    }

    .portal-ticket-list-card {
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .portal-ticket-table,
    .portal-ticket-table tbody,
    .portal-ticket-table tr,
    .portal-ticket-table td {
        display: block;
        width: 100%;
    }

    .portal-ticket-table thead {
        display: none;
    }

    .portal-ticket-table tbody {
        display: grid;
        gap: 12px;
    }

    .portal-ticket-table tr {
        overflow: hidden;
        border: 1px solid var(--portal-border);
        border-radius: 12px;
        background: #fff;
    }

    .portal-ticket-table td {
        display: grid;
        grid-template-columns: 115px minmax(0, 1fr);
        gap: 12px;
        border-bottom: 1px solid #eceeef;
        padding: 12px 14px;
    }

    .portal-ticket-table td:last-child {
        border-bottom: 0;
    }

    .portal-ticket-table td::before {
        content: attr(data-label);
        color: var(--portal-muted);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
    }

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

    .portal-pagination__current {
        grid-column: 1 / -1;
        grid-row: 1;
        text-align: center;
    }

    .portal-ticket-header__main {
        flex-direction: column;
        gap: 14px;
        padding: 22px 20px;
    }

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

    .portal-ticket-meta > div,
    .portal-ticket-meta > div:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid var(--portal-border);
        padding: 13px 20px;
    }

    .portal-ticket-meta > div:last-child {
        border-bottom: 0;
    }

    .portal-ticket-section.portal-card,
    .portal-reply-card {
        padding: 21px 18px;
    }

    .portal-thread-message {
        padding: 17px;
    }

    .portal-thread-message__header {
        flex-direction: column;
        gap: 6px;
    }

    .portal-thread-message__header time {
        white-space: normal;
    }
}

.portal-thread-message__author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-thread-message__author > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-preview-open {
    overflow: hidden;
}

.portal-attachment-preview {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 28px;
}

.portal-attachment-preview[hidden] {
    display: none;
}

.portal-attachment-preview__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgb(15 23 42 / 72%);
    cursor: pointer;
}

.portal-attachment-preview__dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, 100%);
    max-height: calc(100vh - 56px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgb(15 23 42 / 25%);
}

.portal-attachment-preview__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--portal-border);
    padding: 12px 16px;
}

.portal-attachment-preview__title {
    min-width: 0;
    overflow: hidden;
    color: var(--portal-text);
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-attachment-preview__close {
    width: 34px;
    height: 34px;
    display: grid;
    flex: 0 0 34px;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: #f1f3f4;
    color: #555d64;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.portal-attachment-preview__close:hover,
.portal-attachment-preview__close:focus-visible {
    background: #e7eaec;
    color: var(--portal-text);
}

.portal-attachment-preview__content {
    min-height: 0;
    overflow: auto;
    background: #f5f6f7;
}

.portal-attachment-preview__image {
    max-width: 100%;
    max-height: calc(100vh - 130px);
    display: block;
    margin: auto;
    object-fit: contain;
}

.portal-attachment-preview__frame {
    width: 100%;
    height: min(78vh, 850px);
    display: block;
    border: 0;
    background: #fff;
}

@media (max-width: 640px) {
    .portal-attachment-preview {
        padding: 12px;
    }

    .portal-attachment-preview__dialog {
        max-height: calc(100vh - 24px);
    }

    .portal-attachment-preview__frame {
        height: calc(100vh - 96px);
    }
}

/* Customer Portal Contracts */

.portal-contract-list-card {
    overflow: visible;
}

.portal-contract-table-wrap {
    overflow-x: auto;
}

.portal-contract-table {
    width: 100%;
    border-collapse: collapse;
}

.portal-contract-table th {
    border-bottom: 1px solid var(--portal-border);
    background: #fafafa;
    padding: 14px 18px;
    color: #777e85;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
}

.portal-contract-table td {
    border-bottom: 1px solid #eceeef;
    padding: 18px;
    color: #535a61;
    font-size: 14px;
    vertical-align: middle;
}

.portal-contract-table tbody tr:last-child td {
    border-bottom: 0;
}

.portal-contract-table tbody tr:hover {
    background: #fafbf8;
}

.portal-contract-title-link {
    color: var(--portal-text);
    font-weight: 500;
    text-decoration: none;
}

.portal-contract-title-link:hover {
    color: var(--portal-primary-dark);
}

.portal-contract-domain {
    display: block;
    margin-top: 4px;
    color: var(--portal-muted);
    font-size: 12px;
}

.portal-contract-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    background: #f1f3f4;
    padding: 4px 10px;
    color: #626a70;
    font-size: 12px;
    font-weight: 400;
}

.portal-contract-period {
    white-space: nowrap;
}

.portal-contract-period span {
    margin-inline: 4px;
    color: #a2a8ad;
}

.portal-contract-back {
    margin-bottom: 18px;
}

.portal-contract-back a {
    color: #626970;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.portal-contract-back a:hover {
    color: var(--portal-primary-dark);
}

.portal-contract-heading {
    margin-bottom: 26px;
}

.portal-contract-heading .portal-eyebrow {
    margin-bottom: 6px;
}

.portal-contract-heading h1 {
    max-width: 980px;
    margin: 0;
    color: var(--portal-text);
    font-size: clamp(24px, 3vw, 30px);
    line-height: 1.2;
}

.portal-contract-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 292px;
    align-items: start;
    gap: 22px;
}

.portal-contract-content {
    min-width: 0;
    display: grid;
    gap: 22px;
}

.portal-contract-sidebar {
    position: sticky;
    top: 24px;
}

.portal-contract-card {
    padding: 20px 22px;
}

.portal-contract-card__header {
    margin-bottom: 16px;
}

.portal-contract-card__header h2 {
    margin: 0;
    color: var(--portal-text);
    font-size: 18px;
}

.portal-contract-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
}

.portal-contract-detail-grid > div {
    border-bottom: 1px solid #eef0f1;
    padding: 14px 0;
}

.portal-contract-detail-grid > div:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.portal-contract-detail-grid > div:nth-child(odd) {
    padding-right: 22px;
}

.portal-contract-detail-grid > div:nth-child(even) {
    border-left: 1px solid #eef0f1;
    padding-left: 22px;
}

.portal-contract-detail-grid dt,
.portal-contract-sidebar-list dt {
    margin-bottom: 6px;
    color: var(--portal-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-contract-detail-grid dd,
.portal-contract-sidebar-list dd {
    margin: 0;
    color: var(--portal-text);
    font-size: 13px;
    font-weight: 400;
}

.portal-contract-price {
    font-size: 15px;
    font-weight: 500;
}

.portal-contract-external-link {
    color: #59646d;
    text-decoration: none;
}

.portal-contract-external-link:hover {
    color: var(--portal-primary-dark);
}

.portal-contract-sidebar-list {
    margin: 0;
}

.portal-contract-sidebar-list > div {
    border-bottom: 1px solid #eef0f1;
    padding: 12px 0;
}

.portal-contract-sidebar-list > div:first-child {
    padding-top: 0;
}

.portal-contract-sidebar-list > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.portal-contract-rich-content {
    color: #444b51;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.portal-contract-rich-content > :first-child {
    margin-top: 0;
}

.portal-contract-rich-content > :last-child {
    margin-bottom: 0;
}

.portal-contract-empty-text {
    margin: 0;
    color: var(--portal-muted);
    font-size: 14px;
}

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

    .portal-contract-sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .portal-contract-list-card {
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .portal-contract-table,
    .portal-contract-table tbody,
    .portal-contract-table tr,
    .portal-contract-table td {
        display: block;
        width: 100%;
    }

    .portal-contract-table thead {
        display: none;
    }

    .portal-contract-table tbody {
        display: grid;
        gap: 12px;
    }

    .portal-contract-table tr {
        overflow: hidden;
        border: 1px solid var(--portal-border);
        border-radius: 12px;
        background: #fff;
    }

    .portal-contract-table td {
        display: grid;
        grid-template-columns: 115px minmax(0, 1fr);
        gap: 12px;
        border-bottom: 1px solid #eceeef;
        padding: 12px 14px;
    }

    .portal-contract-table td:last-child {
        border-bottom: 0;
    }

    .portal-contract-table td::before {
        content: attr(data-label);
        color: var(--portal-muted);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .portal-contract-period {
        white-space: normal;
    }

    .portal-contract-heading h1 {
        font-size: 24px;
    }

    .portal-contract-card {
        padding: 20px 18px;
    }

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

    .portal-contract-detail-grid > div,
    .portal-contract-detail-grid > div:nth-child(odd),
    .portal-contract-detail-grid > div:nth-child(even) {
        border-left: 0;
        border-bottom: 1px solid #eef0f1;
        padding: 13px 0;
    }

    .portal-contract-detail-grid > div:last-child {
        border-bottom: 0;
    }
}

/* Portal rich editor */

.portal-rich-editor {
    position: relative;
}

.portal-rich-editor__toolbar {
    display: none;
}

.portal-rich-editor.is-enhanced {
    overflow: hidden;
    border: 1px solid #cfd4d8;
    border-radius: 10px;
    background: #fff;
    transition:
        border-color 120ms ease,
        box-shadow 120ms ease;
}

.portal-rich-editor.is-enhanced:hover {
    border-color: #aeb5bb;
}

.portal-rich-editor.is-enhanced:focus-within {
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px rgba(149, 193, 31, 0.16);
}

.portal-rich-editor.is-enhanced .portal-rich-editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #e1e4e7;
    background: #fafbfb;
}

.portal-rich-editor__toolbar-group {
    display: flex;
    gap: 3px;
    align-items: center;
    padding-right: 9px;
    border-right: 1px solid #e1e4e7;
}

.portal-rich-editor__toolbar-group:last-child {
    padding-right: 0;
    border-right: 0;
}

.portal-rich-editor__toolbar-button {
    min-width: 30px;
    min-height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    padding: 4px 7px;
    color: #4a5157;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.portal-rich-editor__toolbar-button:hover,
.portal-rich-editor__toolbar-button:focus-visible {
    background: #edf0f1;
    color: var(--portal-text);
    outline: none;
}

.portal-rich-editor__toolbar-button.is-active {
    background: #e8efd7;
    color: #567f00;
}

.portal-rich-editor__toolbar-button:disabled {
    cursor: default;
    opacity: 0.38;
}

.portal-rich-editor__toolbar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.portal-rich-editor__toolbar-icon svg {
    width: 18px;
    height: 18px;
}

.portal-rich-editor__link-dialog {
    width: min(430px, calc(100vw - 32px));
    border: 0;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 18px 55px rgba(32, 38, 43, 0.22);
}

.portal-rich-editor__link-dialog::backdrop {
    background: rgba(32, 38, 43, 0.38);
}

.portal-rich-editor__link-dialog-form {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.portal-rich-editor__link-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.portal-rich-editor__link-dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--portal-text);
    font: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.portal-rich-editor__link-dialog-close:hover,
.portal-rich-editor__link-dialog-close:focus-visible {
    background: #edf0f1;
    outline: none;
}

.portal-rich-editor__link-error {
    color: #b42318;
    font-size: 13px;
}

.portal-rich-editor__link-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.portal-rich-editor__editable {
    display: none;
}

.portal-rich-editor.is-enhanced .portal-rich-editor__editable {
    display: block;
    min-height: 154px;
    padding: 12px 14px;
    color: var(--portal-text);
    font: inherit;
    line-height: 1.6;
    outline: none;
    overflow-wrap: anywhere;
}

.portal-rich-editor.is-enhanced .portal-rich-editor__editable .ProseMirror {
    min-height: inherit;
    outline: none;
    cursor: text;
}

.portal-rich-editor.is-enhanced .portal-rich-editor__editable .ProseMirror:focus {
    outline: none;
}

.portal-ticket-reply .portal-rich-editor.is-enhanced .portal-rich-editor__editable {
    min-height: 132px;
}

.portal-rich-editor__editable > :first-child,
.portal-thread-message__rich-body > :first-child {
    margin-top: 0;
}

.portal-rich-editor__editable > :last-child,
.portal-thread-message__rich-body > :last-child {
    margin-bottom: 0;
}

.portal-rich-editor__editable p,
.portal-rich-editor__editable ul,
.portal-rich-editor__editable ol,
.portal-rich-editor__editable blockquote,
.portal-rich-editor__editable pre,
.portal-rich-editor__editable h2,
.portal-rich-editor__editable h3,
.portal-thread-message__rich-body p,
.portal-thread-message__rich-body ul,
.portal-thread-message__rich-body ol,
.portal-thread-message__rich-body blockquote,
.portal-thread-message__rich-body pre,
.portal-thread-message__rich-body h2,
.portal-thread-message__rich-body h3 {
    margin: 0 0 10px;
}

.portal-rich-editor__editable ul,
.portal-rich-editor__editable ol,
.portal-thread-message__rich-body ul,
.portal-thread-message__rich-body ol {
    padding-left: 24px;
}

.portal-rich-editor__editable blockquote,
.portal-thread-message__rich-body blockquote {
    margin-left: 0;
    padding-left: 12px;
    border-left: 3px solid #d5dadd;
    color: #626970;
}

.portal-rich-editor__editable pre,
.portal-thread-message__rich-body pre {
    overflow-x: auto;
    border-radius: 8px;
    background: #f4f5f5;
    padding: 10px 12px;
    white-space: pre-wrap;
}

.portal-rich-editor__editable code,
.portal-thread-message__rich-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.portal-rich-editor__editable a,
.portal-thread-message__rich-body a {
    color: #567f00;
    text-decoration: underline;
}

.portal-rich-editor__source--enhanced {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

/* Customer Portal Work Approvals */

.portal-work-approval-sections {
    display: grid;
    gap: 40px;
}

.portal-work-approval-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.portal-work-approval-section-heading h2 {
    margin: 0 0 4px;
    color: var(--portal-text);
    font-size: 20px;
}

.portal-work-approval-section-heading p {
    margin: 0;
    color: var(--portal-muted);
    font-size: 13px;
}

.portal-work-approval-count {
    min-width: 32px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef2e5;
    padding: 4px 10px;
    color: #60762e;
    font-size: 12px;
    font-weight: 700;
}

.portal-work-approval-list-card {
    overflow: visible;
}

.portal-work-approval-table-wrap,
.portal-work-approval-items-wrap {
    overflow-x: auto;
}

.portal-work-approval-table,
.portal-work-approval-items {
    width: 100%;
    border-collapse: collapse;
}

.portal-work-approval-table th,
.portal-work-approval-items th {
    border-bottom: 1px solid var(--portal-border);
    background: #fafafa;
    padding: 14px 18px;
    color: #777e85;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
}

.portal-work-approval-table td,
.portal-work-approval-items td {
    border-bottom: 1px solid #eceeef;
    padding: 18px;
    color: #535a61;
    font-size: 14px;
    vertical-align: middle;
}

.portal-work-approval-table tbody tr:last-child td,
.portal-work-approval-items tbody tr:last-child td {
    border-bottom: 0;
}

.portal-work-approval-table tbody tr:hover {
    background: #fafbf8;
}

.portal-work-approval-title-link {
    color: var(--portal-text);
    font-weight: 600;
    text-decoration: none;
}

.portal-work-approval-title-link:hover {
    color: var(--portal-primary-dark);
}

.portal-work-approval-status {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.portal-work-approval-status--pending {
    background: #fff7dc;
    color: #8b6500;
}

.portal-work-approval-status--approved {
    background: #edf7e7;
    color: #46752d;
}

.portal-work-approval-status--rejected {
    background: #fff0ef;
    color: #a33b34;
}

.portal-work-approval-back {
    margin-bottom: 18px;
}

.portal-work-approval-back a {
    color: #626970;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.portal-work-approval-back a:hover {
    color: var(--portal-primary-dark);
}

.portal-work-approval-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.portal-work-approval-heading h1 {
    max-width: 850px;
    margin: 5px 0 0;
    color: var(--portal-text);
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.2;
}

.portal-work-approval-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
    gap: 22px;
}

.portal-work-approval-content {
    min-width: 0;
    display: grid;
    gap: 22px;
}

.portal-work-approval-card {
    padding: 24px;
}

.portal-work-approval-card__header {
    margin-bottom: 18px;
}

.portal-work-approval-card__header h2 {
    margin: 0;
    color: var(--portal-text);
    font-size: 18px;
}

.portal-work-approval-description {
    color: #535a61;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-line;
}

.portal-work-approval-items td small {
    display: block;
    margin-top: 5px;
    color: var(--portal-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
}

.portal-work-approval-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
    border-top: 1px solid var(--portal-border);
    padding-top: 20px;
    margin-top: 4px;
}

.portal-work-approval-total span {
    color: var(--portal-muted);
    font-size: 13px;
    font-weight: 600;
}

.portal-work-approval-total strong {
    color: var(--portal-text);
    font-size: 20px;
}

.portal-work-approval-meta {
    margin: 0;
}

.portal-work-approval-meta > div {
    display: grid;
    gap: 4px;
    border-bottom: 1px solid #eceeef;
    padding: 13px 0;
}

.portal-work-approval-meta > div:first-child {
    padding-top: 0;
}

.portal-work-approval-meta > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.portal-work-approval-meta dt {
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.portal-work-approval-meta dd {
    margin: 0;
    color: var(--portal-text);
    font-size: 14px;
}

.portal-work-approval-rejection {
    border-color: #ecd2cf;
    background: #fffafa;
}

.portal-work-approval-rejection p {
    margin: 0;
    color: #72403b;
    font-size: 14px;
    line-height: 1.65;
}

@media (max-width: 780px) {
    .portal-work-approval-layout {
        grid-template-columns: 1fr;
    }

    .portal-work-approval-heading {
        flex-direction: column;
        gap: 14px;
    }

    .portal-work-approval-table,
    .portal-work-approval-table tbody,
    .portal-work-approval-table tr,
    .portal-work-approval-table td,
    .portal-work-approval-items,
    .portal-work-approval-items tbody,
    .portal-work-approval-items tr,
    .portal-work-approval-items td {
        display: block;
        width: 100%;
    }

    .portal-work-approval-table thead,
    .portal-work-approval-items thead {
        display: none;
    }

    .portal-work-approval-table tbody,
    .portal-work-approval-items tbody {
        display: grid;
        gap: 12px;
    }

    .portal-work-approval-table tr,
    .portal-work-approval-items tr {
        overflow: hidden;
        border: 1px solid var(--portal-border);
        border-radius: 12px;
        background: #fff;
    }

    .portal-work-approval-table td,
    .portal-work-approval-items td {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 12px;
        border-bottom: 1px solid #eceeef;
        padding: 12px 14px;
    }

    .portal-work-approval-table td:last-child,
    .portal-work-approval-items td:last-child {
        border-bottom: 0;
    }

    .portal-work-approval-table td::before,
    .portal-work-approval-items td::before {
        content: attr(data-label);
        color: var(--portal-muted);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .portal-work-approval-card {
        padding: 20px 18px;
    }

    .portal-work-approval-total {
        justify-content: space-between;
    }
}

/* Customer Portal Work Approval decisions */

.portal-button--danger {
    border-color: #b7473f;
    background: #b7473f;
    color: #fff;
}

.portal-button--danger:hover {
    border-color: #963a34;
    background: #963a34;
}

.portal-work-approval-decision__intro {
    margin: 0 0 18px;
    color: var(--portal-muted);
    font-size: 13px;
    line-height: 1.6;
}

.portal-work-approval-decision__separator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: var(--portal-muted);
    font-size: 11px;
    text-transform: uppercase;
}

.portal-work-approval-decision__separator::before,
.portal-work-approval-decision__separator::after {
    content: '';
    height: 1px;
    flex: 1;
    background: var(--portal-border);
}

.portal-work-approval-reject-form {
    display: grid;
    gap: 16px;
}

.portal-work-approval-rejection-textarea {
    min-height: 116px;
    resize: vertical;
}

/* Customer Area — Projects / Client Onboarding */

.portal-project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.portal-project-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        transform 150ms ease;
}

.portal-project-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
    transform: translateY(-1px);
    text-decoration: none;
}

.portal-project-card__header,
.portal-project-overview__main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.portal-project-card__eyebrow,
.portal-project-overview__label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.portal-project-card h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
}

.portal-project-card__progress-value,
.portal-project-overview__percentage {
    font-size: 22px;
    color: #0f172a;
}

.portal-project-progress {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.portal-project-progress--large {
    height: 10px;
    margin-top: 18px;
}

.portal-project-progress__bar {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: #95c11f;
    transition: width 200ms ease;
}

.portal-project-card__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #64748b;
}

.portal-project-card__action {
    margin-top: auto;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.portal-project-back {
    margin-bottom: 20px;
}

.portal-project-back a {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
}

.portal-project-overview {
    margin-bottom: 22px;
    padding: 22px;
}

.portal-project-overview__main strong:not(.portal-project-overview__percentage) {
    display: block;
    font-size: 18px;
    color: #0f172a;
}

.portal-project-onboarding-list {
    display: grid;
    gap: 18px;
}

.portal-project-section {
    padding: 22px;
}

.portal-project-section__header {
    margin-bottom: 16px;
}

.portal-project-section__header h2 {
    margin: 0;
    font-size: 18px;
    color: #0f172a;
}

.portal-project-section__header p {
    margin: 5px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: #64748b;
}

.portal-project-requirements {
    display: grid;
    gap: 10px;
}

.portal-project-requirement {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.portal-project-requirement.is-complete {
    background: #f8fbef;
    border-color: #dce9b5;
}

.portal-project-requirement__status {
    display: flex;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    font-weight: 700;
    color: #64748b;
}

.portal-project-requirement.is-complete
.portal-project-requirement__status {
    border-color: #95c11f;
    background: #95c11f;
    color: #ffffff;
}

.portal-project-requirement__content {
    min-width: 0;
}

.portal-project-requirement__content h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
    color: #0f172a;
}

.portal-project-requirement__content p {
    margin: 5px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: #64748b;
}

.portal-project-requirement__state {
    display: inline-block;
    margin-top: 9px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

.portal-project-requirement.is-complete
.portal-project-requirement__state {
    color: #65870f;
}

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

    .portal-project-card__header,
    .portal-project-overview__main {
        gap: 12px;
    }
}

/* Customer Area — editable Client Onboarding */

.portal-project-flash {
    margin-bottom: 18px;
    padding: 12px 15px;
    border: 1px solid #dce9b5;
    border-radius: 10px;
    background: #f8fbef;
    color: #526f0c;
    font-size: 14px;
}

.portal-project-requirement--editable {
    padding: 18px;
}

.portal-project-requirement__content {
    flex: 1 1 auto;
}

.portal-project-requirement__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.portal-project-requirement__heading
.portal-project-requirement__state {
    flex: 0 0 auto;
    margin-top: 1px;
}

.portal-onboarding-form {
    margin-top: 18px;
}

.portal-onboarding-input,
.portal-onboarding-textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
}

.portal-onboarding-input {
    min-height: 44px;
    padding: 10px 12px;
}

.portal-onboarding-textarea {
    min-height: 140px;
    padding: 12px 14px;
    line-height: 1.6;
    resize: vertical;
}

.portal-onboarding-input:focus,
.portal-onboarding-textarea:focus {
    outline: none;
    border-color: #95c11f;
    box-shadow: 0 0 0 3px rgba(149, 193, 31, 0.12);
}

.portal-onboarding-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    color: #334155;
}

.portal-onboarding-checkbox input {
    width: 18px;
    height: 18px;
}

.portal-onboarding-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border: 1px dashed #94a3b8;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
}

.portal-onboarding-upload > span {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.portal-onboarding-upload input[type="file"] {
    width: 100%;
    font-size: 13px;
}

.portal-onboarding-files {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.portal-onboarding-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #ffffff;
    font-size: 13px;
}

.portal-onboarding-file small {
    color: #64748b;
    white-space: nowrap;
}

.portal-onboarding-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
}

.portal-onboarding-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.portal-onboarding-footer
.portal-onboarding-actions {
    margin-top: 0;
}

.portal-onboarding-save-state {
    min-height: 18px;
    font-size: 12px;
    color: #64748b;
}

.portal-onboarding-save-state.is-saving {
    color: #64748b;
}

.portal-onboarding-save-state.is-saved {
    color: #65870f;
}

.portal-onboarding-error {
    margin: 8px 0 0;
    font-size: 13px;
    color: #b91c1c;
}

@media (max-width: 680px) {
    .portal-project-requirement__heading,
    .portal-onboarding-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-onboarding-actions {
        justify-content: stretch;
    }

    .portal-onboarding-actions .portal-button {
        flex: 1 1 auto;
    }
}

/* Customer onboarding — rich text / document alternative */

.portal-onboarding-editor-help {
    margin: 0 0 10px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

.portal-onboarding-document-option {
    margin-top: 18px;
}

.portal-onboarding-document-option__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: #94a3b8;
    font-size: 12px;
}

.portal-onboarding-document-option__divider::before,
.portal-onboarding-document-option__divider::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: #e2e8f0;
}

.portal-onboarding-document-heading {
    display: grid;
    gap: 3px;
    margin-bottom: 10px;
}

.portal-onboarding-document-heading strong {
    color: #334155;
    font-size: 14px;
}

.portal-onboarding-document-heading span {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.portal-onboarding-submitted-text {
    padding: 13px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    line-height: 1.65;
}

/* Customer onboarding — section overview */

.portal-project-section-overview {
    margin-top: 22px;
}

.portal-project-section-overview__heading {
    margin-bottom: 14px;
}

.portal-project-section-overview__heading h2 {
    margin: 0;
    font-size: 20px;
}

.portal-project-section-overview__heading p {
    margin: 5px 0 0;
    color: #64748b;
    line-height: 1.55;
}

.portal-project-section-grid {
    display: grid;
    gap: 12px;
}

.portal-project-section-card {
    display: block;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        transform 150ms ease;
}

.portal-project-section-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.portal-project-section-card__top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 13px;
    align-items: start;
}

.portal-project-section-card__status {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #64748b;
    font-weight: 700;
}

.portal-project-section-card__content h3 {
    margin: 1px 0 0;
    font-size: 16px;
}

.portal-project-section-card__content p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

.portal-project-section-card__percentage {
    color: #334155;
    font-size: 14px;
}

.portal-project-section-card .portal-project-progress {
    margin-top: 16px;
}

.portal-project-section-card__footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 12px;
    color: #64748b;
    font-size: 13px;
}

.portal-project-section-card__footer strong {
    color: #475569;
}

.portal-project-section-card.is-complete
.portal-project-section-card__status {
    border-color: #84cc16;
    color: #65a30d;
}

@media (max-width: 640px) {
    .portal-project-section-card {
        padding: 16px;
    }

    .portal-project-section-card__top {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .portal-project-section-card__percentage {
        grid-column: 2;
    }

    .portal-project-section-card__footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Customer onboarding — section context */

.portal-project-section-context {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

/* Customer onboarding — review attention */

.portal-project-section-card.is-needs-action {
    border-color: #f0c36b;
}

.portal-project-section-card.is-needs-action
.portal-project-section-card__status {
    border-color: #d99b28;
    color: #a16207;
}

.portal-project-section-card__attention {
    display: block;
    margin-top: 8px;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}

.portal-onboarding-review-note {
    margin: 16px 0 20px;
    padding: 16px 18px;
    border: 1px solid #f0c36b;
    border-radius: 12px;
    background: #fffbeb;
}

.portal-onboarding-review-note strong {
    display: block;
    margin-bottom: 7px;
    color: #78350f;
    font-size: 14px;
}

.portal-onboarding-review-note > div {
    color: #713f12;
    font-size: 14px;
    line-height: 1.6;
}

/* Customer onboarding — private stored file actions */

.portal-onboarding-file__main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.portal-onboarding-file__main strong {
    overflow-wrap: anywhere;
    color: #334155;
    font-size: 13px;
}

.portal-onboarding-file__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.portal-onboarding-file__actions a,
.portal-onboarding-file__actions button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.portal-onboarding-file__actions a:hover,
.portal-onboarding-file__actions button:hover {
    color: #0f172a;
    text-decoration: underline;
}

.portal-onboarding-file__actions
.portal-onboarding-file__delete-form button {
    color: #b91c1c;
}

.portal-onboarding-file__delete-form {
    margin: 0;
}

@media (max-width: 680px) {
    .portal-onboarding-file {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-onboarding-file__actions {
        flex-wrap: wrap;
    }
}
