/* ============================================
   CLIENT PORTAL STYLES
   Reuses admin primary sidebar from styles.css
   Fresh secondary sidebar + content styles below
   ============================================ */

/* --- Portal Secondary Sidebar --- */
.portal-secondary {
    position: fixed;
    top: 0;
    left: 7.2em;
    width: 14em;
    height: 100vh;
    padding-top: 3.5em;
    overflow-y: auto;
}

.portal-secondary-inner {
    border-right: 1px solid #ddd;
    padding-right: 1em;
    text-align: right;
}

.portal-secondary-logo {
    max-height: 3em;
    max-width: 9em;
    display: inline-block;
}

.portal-secondary-header h3 {
    margin: 0.75em 0 0;
    font-size: 1.15em;
    line-height: 1.2;
}

.portal-secondary-header h3 strong {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.2em;
}

.portal-secondary-header h3 span {
    display: block;
    font-weight: 400;
    color: #999;
}

/* --- Portal Secondary Nav --- */
.portal-secondary-nav {
    list-style: none;
    padding: 1.5em 0 0;
}

.portal-secondary-nav li {
    margin-bottom: 0.8em;
}

.portal-secondary-nav li a {
    color: #555;
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.15s;
}

.portal-secondary-nav li a:hover {
    color: var(--color-pink);
}

.portal-secondary-nav li a.active {
    color: var(--color-pink);
    font-weight: 500;
}

.portal-my-projects {
    padding: 3.5em 4em 4em 4em;
}

.portal-secondary-fav {
    margin-top: 2em;
    text-align: right;
}

.portal-fav-star {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
    font-size: 1.3em;
    color: #ddd;
    transition: color 0.15s;
}

.portal-fav-star:hover {
    color: #aaa;
}

.portal-fav-star.active {
    color: #f0e0a4;
}

.portal-nav-home-link-item {
    margin-top: 1.5em;
}

.portal-nav-home-link {
    border-top: 1px solid #ddd;
    padding-top: 0.7em;
    padding-left: 0.5em;
}

.portal-nav-home-link i {
    display: inline-block;
    width: 1.6em;
    font-size: 0.9em;
    color: #bbb;
    text-align: left;
}

.portal-secondary-nav-heading {
    font-size: 0.7em;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}

/* --- Portal Main Content --- */
.portal-main {
    margin-left: 15em;
    min-height: 100vh;
    padding: 5em;
    padding-top: 3.5em;
}

.portal-main:has(.portal-feed) {
    padding-top: 3.5em;
}

/* --- Portal Body Content (pages using PortalLayout directly, no secondary sidebar) --- */
.portal-body-content {
    padding: 0;
    background: none;
}

/* --- Feed Container --- */
.portal-feed {
    max-width: 1200px;
    margin: auto;
}

/* --- Cards --- */
.portal-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25em;
}

.portal-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
    cursor: pointer;
}

.portal-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* Company Card */
.portal-company-card {
    display: flex;
    align-items: stretch;
    padding: 0;
    gap: 0;
    border: 1px solid #ddd;
}

.portal-company-card:hover {
    box-shadow: none;
    transform: none;
}

.portal-company-card-logo {
    flex: 0 0 33.333%;
    padding: 1em 1.5em;
    border-right: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: #f6f6f8;
    transition: background 200ms;
}

.portal-company-card:hover .portal-company-card-logo {
    background: #f1f1f3;
}

.portal-company-card-logo img {
    max-width: 100%;
    height: 4.5em;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.portal-company-card-initial {
    font-weight: 600;
    color: #999;
    font-size: 1.5em;
}

.portal-company-card-info {
    flex: 1;
    padding: 1em 1.5em;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.portal-company-card-info h3 {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    margin: 0 0 0.15em;
}

.portal-company-card-info p {
    font-size: 0.8em;
    color: #999;
    margin: 0;
}

/* Project Card */
.portal-project-card {
    display: flex;
    flex-direction: column;
}

.portal-project-card-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f0f0f0;
}

.portal-project-card-body {
    padding: 1em;
}

.portal-project-card-brand {
    font-size: 0.75em;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25em;
}

.portal-project-card-body h3 {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.5em;
}

.portal-project-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75em;
    font-size: 0.8em;
    color: #999;
}

/* Brand Card */
.portal-brand-card {
    padding: 1.5em;
    display: flex;
    align-items: center;
    gap: 1em;
}

.portal-brand-card-logo {
    width: 3em;
    height: 3em;
    object-fit: contain;
    flex-shrink: 0;
}

.portal-brand-card-info h3 {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.15em;
}

.portal-brand-card-info p {
    font-size: 0.8em;
    color: #999;
    margin: 0;
}

/* --- Status Badges --- */
.portal-badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    border-radius: 1em;
    font-size: 0.8em;
    font-weight: 500;
    margin-top: 0.5em;
}

.portal-badge-awaiting {
    color: var(--color-pink);
    background: var(--color-pink-tint);
}

.portal-badge-briefing {
    color: var(--color-aqua);
    background: var(--color-aqua-tint);
}

.portal-badge-approved {
    color: var(--color-purple);
    background: var(--color-purple-tint);
}

.portal-badge-production {
    color: var(--color-green);
    background: var(--color-green-tint);
}

.portal-badge-completed {
    color: var(--color-green);
    background: var(--color-green-tint);
}

/* --- Section Headers --- */
.portal-section {
    margin-bottom: 4em;
}

.portal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1em;
}

.portal-section-header a {
    font-size: 0.85em;
    color: var(--color-pink);
    text-decoration: none;
    font-weight: 500;
}

.portal-section-header a:hover {
    text-decoration: underline;
}

/* --- Greeting --- */
.portal-greeting {
    margin-bottom: 2em;
}

.portal-greeting h1 {
    font-size: 1.8em;
    font-weight: 600;
    color: var(--color-pink);
}

.portal-greeting h1.portal-morn-egg {
    font-size: 3em;
    font-weight: 800;
}

/* --- Feed / Timeline --- */
.portal-timeline {
    position: relative;
    padding-left: 2em;
}

.portal-feed-item {
    position: relative;
    padding: 1em;
    margin-bottom: 1.2em;
    border-radius: 1em;
    background: #f5f5f7;
}

.portal-feed-item-content {
    background: #fff;
    padding: 1.5em;
    border-radius: 0.6em;
    position: relative;
    box-shadow: 0 0 0.5em rgb(0 0 0 / 3%);
    transition: box-shadow 100ms;
}

.portal-feed-item-content:hover {
    box-shadow: 0 0 0.7em rgb(0 0 0 / 8%);
}

.portal-feed-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5em;
}

.portal-feed-item-header h3 {
    font-size: 1.4em;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.4;
    position: relative;
}

.portal-feed-item-header h3 span {
    font-size: 0.85em;
    font-weight: normal;
    color: #777;
}

.portal-feed-item-header h3::before {
    content: '';
    width: 2rem;
    height: 2rem;
    border: 2px dashed #d0d0d0;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: -4rem;
    box-sizing: border-box;
    pointer-events: none;
}

.item-complete .portal-feed-item-header h3::before {
    opacity: 1;
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.2rem;
    text-align: center;
    line-height: 2rem;
    border: 0;
    color: #fff;
    background: var(--color-blue);
}

.portal-feed-item-date {
    font-size: 0.8em;
    color: #999;
}

.portal-feed-item-date::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 0.4em;
    color: #bbb;
}

/* --- Feed Messages --- */
.portal-message {
    position: relative;
    padding-left: 4.6em;
    margin: 0 auto 2.4em auto;
    max-width: 40em;
}

.portal-message-avatar {
    position: absolute;
    top: 0;
    left: 0;
    width: 3.5em;
    height: 3.5em;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.portal-message-bubble strong {
    font-weight: 500;
    color: var(--color-pink);
    background: var(--color-pink-tint);
    white-space: nowrap;
    padding: 0.1em 0.3em;
    border-radius: 5px;
}

.portal-message-bubble {
    display: inline-block;
    padding: 0.9em 1.2em;
    background: #fff;
    border-radius: 0.5em;
    border: 1px solid #e2e2e2;
    box-shadow: 0 0.1em 0.3em #eee;
    color: #555;
    line-height: 1.5;
}

.portal-message-multi .portal-message-bubble {
    display: block;
    margin-bottom: 0.8em;
    position: relative;
}

.portal-message-multi .portal-message-bubble::after {
    content: '';
    position: absolute;
    bottom: -0.8em;
    left: 50%;
    width: 2px;
    height: 0.8em;
    background: #e2e2e2;
}

.portal-message-multi .portal-message-bubble:last-child {
    margin-bottom: 0;
}

.portal-message-multi .portal-message-bubble:last-child::after {
    content: none;
}

/* --- Feed Team --- */
.portal-feed-team {
    display: grid;
    grid-template-columns: 32% 1fr;
    gap: 2em;
}

.portal-feed-team-section {
    margin-bottom: 2em;
}

.portal-feed-team-section:last-child {
    margin-bottom: 0;
}

.portal-feed-team-heading {
    font-weight: 500;
    color: #999;
    margin-bottom: 0.6em;
    text-transform: capitalize;
}

.portal-feed-team-approvers {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.portal-feed-team-member-full {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.4em 0.6em;
    background: #f5f6f9;
    border-radius: 1.9em;
    height: 3.8em;
    line-height: 1.2;
}

.portal-feed-team-avatar {
    width: 2.5em;
    height: 2.5em;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.portal-feed-team-name {
    font-weight: 600;
    font-size: 0.9em;
    color: #333;
}

.portal-feed-team-email {
    font-size: 0.8em;
    color: #999;
}

.portal-feed-team-commenters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4em 0.6em;
}

.portal-feed-team-member-compact {
    display: flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.3em 0.7em 0.3em 0.3em;
    background: #f5f6f9;
    border-radius: 1.4em;
    height: 2.8em;
    font-size: 0.85em;
    font-weight: 500;
    color: #555;
}

.portal-feed-team-avatar-sm {
    width: 2em;
    height: 2em;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* --- SOW Details --- */
.portal-feed-sow-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;
    color: #555;
    line-height: 1.6;
}

.portal-feed-sow-right {
    border-left: 1px solid #ddd;
    padding-left: 0.7em;
}

/* --- Terms of service modal (View terms) --- */
.modal-content.portal-terms-modal {
    max-width: 760px;
    width: 92%;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.portal-terms-modal .modal-close {
    position: absolute;
    top: 0.6em;
    right: 0.9em;
    z-index: 2;
}

.portal-terms-body {
    padding: 2.2em 2.4em 1.6em;
    max-height: 70vh;
    overflow-y: auto;
    color: #333;
    line-height: 1.55;
    counter-reset: terms-top;   /* continuous across the document's separate top-level <ol>s */
}

.portal-terms-body h1,
.portal-terms-body h2,
.portal-terms-body h3 {
    margin-top: 0;
}

.portal-terms-body a {
    color: var(--color-pink);
    text-decoration: none;
}

.portal-terms-body p {
    margin-bottom: 1em;
}

.portal-terms-body ul {
    padding-left: 1.2em;
}

.portal-terms-body li {
    margin-bottom: 0.4em;
}

.portal-terms-body ol li {
    margin-bottom: 0.5em;
}

/* Ordered lists: top-level numbers run continuously across the document's separate lists
   (1, 2, 3 ...); nested lists use a, b, c restarting within each item. Assumes the <ol>s are
   direct children of the terms body (flat heading + list structure). */
.portal-terms-body > ol {
    list-style: none;
    padding-left: 1.9em;
}

.portal-terms-body > ol > li {
    counter-increment: terms-top;
    position: relative;
}

.portal-terms-body > ol > li::before {
    content: counter(terms-top) ".";
    position: absolute;
    left: -1.9em;
}

.portal-terms-body > ol > li > ol {
    list-style: none;
    counter-reset: terms-sub;
    padding-left: 1.9em;
    margin-top: 0.5em;
}

.portal-terms-body > ol > li > ol > li {
    counter-increment: terms-sub;
    position: relative;
}

.portal-terms-body > ol > li > ol > li::before {
    content: counter(terms-sub, lower-alpha) ".";
    position: absolute;
    left: -1.9em;
}

.portal-terms-toggle {
    width: 100%;
    border: none;
    border-top: 1px solid #e5e7eb;
    background: #eceef2;
    padding: 0.95em;
    cursor: pointer;
    font-size: 0.95em;
    color: #555;
}

.portal-terms-toggle:hover {
    background: #e2e5ea;
}

/* --- Feed Thumbnails --- */
/* "Hold up!" outstanding-feedback modal */
.modal-content.portal-holdup-modal {
    max-width: 940px;
}

.portal-holdup-thumbs {
    display: flex;
    gap: 0.75em;
    max-width: 900px;
    margin-top: 1em;
    overflow-x: auto;
    padding-bottom: 0.5em;
    scrollbar-width: thin;
}

.portal-holdup-thumbs::-webkit-scrollbar {
    height: 6px;
}

.portal-holdup-thumbs::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.portal-holdup-thumbs::-webkit-scrollbar-track {
    background: transparent;
}

.portal-holdup-thumb {
    height: 8em;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #fff;
}

.portal-holdup-thumb-placeholder {
    width: 8em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e2e2;
    color: #bbb;
    font-size: 1.6em;
    box-sizing: border-box;
}

.portal-holdup-thumbs.square-thumbs .portal-holdup-thumb {
    aspect-ratio: 1;
    object-fit: contain;
    padding: 0.6em;
    box-sizing: border-box;
    border: 1px solid #e2e2e2;
}

.portal-feed-intro {
    display: flex;
    gap: 1em;
    align-items: flex-start;
    max-width: 50em;
    margin-bottom: 2em;
}

.portal-feed-intro .intro-content {
    flex: 1;
    border-left: 1px solid #ddd;
    padding-left: 1em;
    line-height: 1.5;
    white-space: pre-wrap;
}

.portal-feed-thumbs {
    display: flex;
    gap: 1em;
    margin-top: 2em;
    margin-bottom: 2em;
    overflow-x: auto;
    padding-top: 0.5em;
    padding-bottom: 0.5em;
    cursor: grab;
    user-select: none;
}

.portal-feed-thumbs.dragging {
    cursor: grabbing;
}

.portal-feed-thumbs.dragging a {
    pointer-events: none;
}

.portal-feed-thumb-link {
    position: relative;
    flex-shrink: 0;
    display: block;
}

.portal-feed-thumb-badges {
    position: absolute;
    top: -0.4em;
    right: -0.4em;
    display: flex;
    gap: 0.3em;
}

.portal-feed-thumb-badge {
    width: 1.8em;
    height: 1.8em;
    border-radius: 50%;
    color: #fff;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-feed-thumb-badge.badge-approved {
    background: var(--color-green);
}

.portal-feed-thumb-badge.badge-comment {
    background: var(--color-blue);
}

.portal-feed-thumb {
    height: 20em;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

/* When any thumb in the set is wider than 1.5:1, square off every tile (mirrors the review filmstrip). */
.portal-feed-thumbs.square-thumbs .portal-feed-thumb {
    aspect-ratio: 1;
    object-fit: contain;
    padding: 1.2em;
    box-sizing: border-box;
    border: 1px solid #e2e2e2;
    box-shadow: 0 0.1em 0.3em #eee;
}

.portal-link-muted {
    font-size: 0.85em;
    color: #999;
    text-decoration: none;
}

.portal-link-muted:hover {
    color: #666;
}

/* --- Brief (read-only) --- */
.portal-brief {
    background: #f5f5f7;
    border-radius: .7em;
    padding: 3em 3.5em 3.5em;
    max-width: 1200px;
    margin: 0 auto;
}

.portal-brief h1 { margin-bottom: 1em; outline: none; }

.portal-brief-contact {
    margin-top: 1em;
    line-height: 1.6;
}

.portal-brief-contact a {
    color: var(--color-pink);
    text-decoration: none;
}
/* Admin reserves space for the comments panel (width: calc(100% - 33rem)); the portal has none. */
.portal-brief .brief-section { width: 100%; max-width: 100%; }

.portal-feed-item-link { display: block; text-decoration: none; color: inherit; cursor: pointer; }

.portal-team-grid { display: flex; gap: 2em; }
.portal-team-col { flex: 1; background: #fff; border-radius: 0.5em; padding: 1.5em; box-shadow: 0 0 0.5em rgb(0 0 0 / 3%); }
.portal-team-col h3 { margin: 0 0 0.3em; font-size: 1em; font-weight: 600; }
.portal-team-desc { color: #999; font-size: 0.85em; margin: 0 0 1em; }
.portal-team-empty { color: #999; font-size: 0.9em; }

.portal-team-search { position: relative; margin-bottom: 2em; }
.portal-team-search .form-input { border: 1px solid #ddd; border-radius: 0.4em; border-bottom-width: 3px; }

.portal-team-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border-radius: 0.5em;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-top: 0.3em;
    max-height: 250px;
    overflow-y: auto;
}

.portal-team-suggestion {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.5em 0.8em;
    cursor: pointer;
    font-size: 0.9em;
}

.portal-team-suggestion:hover { background: #f5f5f7; }
.portal-team-suggestion-email { color: #999; font-size: 0.85em; margin-left: auto; }
.portal-team-suggestion .portal-feed-team-avatar { width: 1.8em; height: 1.8em; }

.portal-team-suggestion-new {
    color: var(--color-blue);
    font-weight: 500;
    gap: 0.3em;
}

.portal-team-suggestion-new:hover { background: var(--color-blue-tint); }

.portal-team-menu-wrapper { position: relative; margin-left: auto; }
.portal-team-menu-btn { background: none; border: none; color: #ccc; cursor: pointer; padding: 0.2em 0.4em; font-size: 0.9em; }
.portal-team-menu-btn:hover { color: #999; }

.portal-team-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 100;
    background: #fff;
    border-radius: 0.4em;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    min-width: 12em;
    padding: 0.3em 0;
}

.portal-team-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5em 1em;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.85em;
    cursor: pointer;
}

.portal-team-menu button:hover { background: #f5f5f7; }
.portal-team-menu button.danger { color: var(--color-pink); }
.portal-team-menu button.danger:hover { background: var(--color-pink-tint); }

.portal-brief-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5em;
    padding-bottom: 1em;
    border-bottom: 1px solid #f0f0f0;
}

/* "Brief submitted" pill (reuses the admin .estimate-accepted-bar style), centred + spaced. */
.portal-brief-submitted {
    text-align: center;
    margin-bottom: 1.5em;
}
/* No Undo button here (unlike admin), so balance the pill with extra right padding. */
.portal-brief-submitted .estimate-accepted-bar {
    padding-right: 1em;
}

.portal-brief-header p {
    font-size: 0.9em;
    color: #666;
}

.portal-brief-actions {
    display: flex;
    gap: 0.5em;
}

.portal-brief-section {
    margin-bottom: 1.5em;
}

.portal-brief-section h2 {
    font-size: 1em;
    font-weight: 600;
    color: var(--color-pink);
    margin: 0 0 0.75em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--color-pink-tint);
}

.portal-brief-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1em;
    padding: 0.5em 0;
    border-bottom: 1px solid #f8f8f8;
}

.portal-brief-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.portal-brief-value {
    color: #333;
    font-size: 0.9em;
}

/* --- Assets --- */
.portal-assets-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5em;
}

.portal-assets-archived {
    color: #888;
}

/* Portal assets page: drop zone below the filter lozenges. The InputFile inside is stretched
   invisibly across the whole zone so drop and click both work without JS interop. */
.portal-asset-dropzone {
    position: relative;
    height: 6em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    border: 2px dashed #ccc;
    border-radius: 8px;
    color: #888;
    margin-bottom: 1.5em;
    background: #fffa;
}
.portal-asset-dropzone.drag-over {
    border-color: var(--color-pink, #e91e63);
    color: #555;
    background: #fff;
}
/* Extra specificity: the global input:disabled { opacity: .5 } rule must not reveal the input
   while uploads are in flight. */
.portal-asset-dropzone input.portal-asset-dropzone-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Portal assets page: cap the asset grid at 5 columns (admin goes to 6 on wide screens). */
.portal-assets .asset-grid {
    grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 1500px) {
    .portal-assets .asset-grid { grid-template-columns: repeat(4, 1fr); }
}

.portal-asset-panel {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 1.25em;
}

.portal-asset-panel h3 {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    margin: 0 0 1em;
}

.portal-asset-item {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0.5em 0;
    border-bottom: 1px solid #f8f8f8;
    font-size: 0.9em;
    color: #555;
}

.portal-asset-item i {
    color: #999;
    width: 1.2em;
    text-align: center;
}

.portal-asset-item .portal-asset-size {
    margin-left: auto;
    color: #999;
    font-size: 0.85em;
}

/* --- Team --- */
.portal-team-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5em;
}

.portal-team-panel {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 1.25em;
}

.portal-team-panel h3 {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    margin: 0 0 1em;
}

.portal-team-member {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0.6em 0;
    border-bottom: 1px solid #f8f8f8;
}

.portal-team-avatar {
    width: 2.25em;
    height: 2.25em;
    border-radius: 50%;
    background: var(--color-pink-tint);
    color: var(--color-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    font-weight: 600;
    flex-shrink: 0;
    object-fit: cover;
}

.portal-team-info {
    flex: 1;
    min-width: 0;
}

.portal-team-info .name {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.portal-team-info .email {
    color: #999;
    font-size: 0.8em;
}

/* --- Review --- */
.content:has(.portal-review-layout) {
    margin-left: 0;
    padding: 0;
}

body:has(.portal-review-layout) .sidebar {
    display: none;
}

.portal-review-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    height: 100vh;
    background: #39393f;
    padding: 1em;
}

@media (min-width: 1800px) {
    .portal-review-layout {
        grid-template-columns: 1fr 500px;
    }
}

.portal-review-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.portal-review-back {
    position: absolute;
    top: 0.75em;
    left: 0.75em;
    z-index: 10;
}

.portal-review-back a {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.4em 0.8em;
    background: rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.8em;
    border-radius: 1em;
}

.portal-review-back a:hover {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

.portal-review-filmstrip {
    display: flex;
    justify-content: center;
    gap: 0.5em;
    padding: 0.75em 1em;
    background: #ffffff11;
    overflow-x: auto;
    border-radius: 0.7em;
}

.portal-review-thumb {
    width: auto;
    height: 6em;
    border-radius: 4px;
    object-fit: cover;
    border: 2px solid transparent;
    box-sizing: content-box;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.15s, border-color 0.15s;
}

/* When any deliverable in the set is very wide (ratio > 1.5), square off every thumbnail. */
.portal-review-filmstrip.square-thumbs .portal-review-thumb {
    object-fit: contain;
    aspect-ratio: 1;
    background: #fff2;
}

.portal-review-thumb:hover {
    opacity: 0.8;
}

.portal-review-thumb.active {
    border-color: var(--color-pink);
    opacity: 1;
}

.portal-review-preview {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 3.5em 2.5em;
}

.portal-review-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 0.7em rgba(0, 0, 0, 0.08);
}

.portal-review-video {
    max-width: 100%;
    max-height: 100%;
    border: none;
    box-shadow: 0 0 0.7em rgba(0, 0, 0, 0.08);
}

.portal-review-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
}

.portal-review-nav:hover {
    background: rgba(0, 0, 0, 0.3);
}

.portal-review-nav.prev {
    left: 1em;
}

.portal-review-nav.next {
    right: 1em;
}

.portal-review-counter {
    position: absolute;
    top: 1em;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85em;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.25em 0.75em;
    border-radius: 1em;
}

/* --- Review Panel (right side) --- */
.portal-review-panel {
    background: #fff;
    border-radius: 0.7em;
    margin-left: 1em;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.portal-review-panel-header {
    padding: 1em 1.25em;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 0.75em;
}

.portal-review-panel-header .filename {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
    flex: 1;
}

.portal-review-panel-header.approved {
    background: var(--color-green);
}

.portal-review-panel-header.approved .filename {
    color: #fff;
}

.portal-review-actions {
    display: flex;
    gap: 0.5em;
}

.portal-review-comments {
    flex: 1;
    overflow-y: auto;
    padding: 1em 1.25em 1em 4em;
}

.portal-review-round-heading-wrap {
    display: flex;
    align-items: center;
    margin: 2em 0 1em -2.75em;
}

.portal-review-round-heading-wrap:first-child {
    margin-top: 0;
}

.portal-review-round-heading-wrap::before,
.portal-review-round-heading-wrap::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.portal-review-round-heading {
    font-size: 0.9em;
    font-weight: 500;
    color: #999;
    background: #f5f5f7;
    border: 1px solid #ddd;
    padding: 0.35em 1.2em;
    border-radius: 2em;
    white-space: nowrap;
}

.portal-review-comment {
    position: relative;
    margin-bottom: 1.5em;
    margin-right: 1em;
}

.portal-review-comment-header {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.2em;
}

.portal-review-comment-avatar {
    position: absolute;
    left: -4.2em;
    top: 0;
    width: 3em;
    height: 3em;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65em;
    font-weight: 600;
    object-fit: cover;
}

.portal-review-comment-avatar-initials {
    background: var(--color-blue-tint);
    color: var(--color-blue);
}

.portal-review-comment-name {
    font-weight: 600;
    font-size: 0.92em;
    color: #333;
}

.portal-review-comment-role {
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-blue);
    background: var(--color-blue-tint);
    padding: 0.1em 0.4em;
    border-radius: 3px;
}

.portal-review-comment-date {
    font-size: 0.75em;
    color: #999;
}

.portal-review-comment-menu {
    position: relative;
    margin-left: auto;
}

.portal-review-comment-menu-btn {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    padding: 0.2em 0.4em;
    font-size: 0.9em;
    border-radius: 4px;
}

.portal-review-comment-menu-btn:hover {
    color: #666;
    background: #f0f0f2;
}

.portal-review-comment-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    min-width: 8em;
    overflow: hidden;
}

.portal-review-comment-menu-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.5em;
    width: 100%;
    padding: 0.5em 0.75em;
    border: none;
    background: none;
    font-size: 0.85em;
    color: #555;
    cursor: pointer;
    font-family: inherit;
}

.portal-review-comment-menu-dropdown button:hover {
    background: #f5f5f7;
}

.portal-review-comment-edit textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.6em;
    font-size: 0.9em;
    font-family: inherit;
    resize: none;
    min-height: 3em;
    outline: none;
    field-sizing: content;
}

.portal-review-comment-edit textarea:focus {
    border-color: var(--color-blue);
}

.portal-review-comment-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4em;
    margin-top: 0.4em;
}

.portal-review-comment-body {
    font-size: 0.9em;
    color: #555;
    line-height: 1.5;
    white-space: pre-wrap;
}

.portal-review-approved-banner {
    text-align: center;
    padding: 1.5em;
    background: #f5f5f7;
    border-bottom: 1px solid #ddd;
    margin-bottom: 1em;
}

.portal-review-approved-banner h2 {
    margin: 0;
    color: #999;
}

.portal-review-input {
    position: relative;
    background: #f5f5f7;
    border-bottom: 1px solid #ddd;
    margin-bottom: 2em;
}

.portal-review-input-avatar {
    position: absolute;
    top: 0.8em;
    left: 1.2em;
    width: 1.95em;
    height: 1.95em;
    border-radius: 50%;
    object-fit: cover;
}

.portal-review-input textarea {
    width: 100%;
    border: 0;
    background: none;
    min-height: 6em;
    padding: 1.2em;
    padding-left: 4rem;
    padding-bottom: 3em;
    font-size: 0.9em;
    font-family: inherit;
    resize: none;
    field-sizing: content;
}

.portal-review-input textarea:focus {
    outline: none;
    border-color: var(--color-pink);
}

.portal-review-paste-previews {
    display: flex;
    gap: 0.5em;
    padding: 0 1.2em 1.2em;
    flex-wrap: wrap;
}

.portal-review-paste-preview {
    position: relative;
    width: 4em;
    height: 4em;
}

.portal-review-paste-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.portal-review-paste-remove {
    position: absolute;
    top: -0.4em;
    right: -0.4em;
    width: 1.5em;
    height: 1.5em;
    border-radius: 50%;
    background: var(--color-pink);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
}

.portal-review-comment-images {
    display: flex;
    gap: 0.4em;
    margin-top: 0.5em;
}

.portal-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    padding: 2em;
}

.portal-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.portal-review-comment-thumb {
    display: block;
    width: 4em;
    height: 4em;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
}

.portal-review-input-actions {
    position: absolute;
    bottom: 0.6em;
    right: 1.2em;
}

/* --- Buttons --- */
.portal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.5em 1em;
    border-radius: 6px;
    font-size: 0.9em;
    line-height: 1.2;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.portal-btn-primary {
    background: var(--color-pink);
    color: #fff;
    border-color: var(--color-pink);
}

.portal-btn-primary:hover {
    background: #d42d6a;
    border-color: #d42d6a;
}

.portal-btn-secondary {
    background: #fff;
    color: #555;
    border-color: #ddd;
}

.portal-btn-secondary:hover {
    background: #f5f6f9;
}

.portal-btn-success {
    background: var(--color-green);
    color: #fff;
    border-color: var(--color-green);
}

.portal-btn-success:hover {
    background: #1f9d59;
    border-color: #1f9d59;
}

.portal-btn-sm {
    padding: 0.35em 0.75em;
    font-size: 0.8em;
}

/* --- Login --- */
.portal-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f5f6f9;
}

.portal-login-box {
    background: #fff;
    border-radius: 12px;
    padding: 2.5em;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.portal-login-box img {
    display: block;
    margin: 0 auto 1.5em;
    height: 3em;
}

.portal-login-box h1 {
    text-align: center;
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5em;
}

.portal-form-group {
    margin-bottom: 1em;
}

.portal-form-group label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.3em;
}

.portal-form-group input {
    width: 100%;
    padding: 0.6em 0.8em;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: inherit;
}

.portal-form-group input:focus {
    outline: none;
    border-color: var(--color-pink);
}

.portal-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.6em 1em;
    border-radius: 6px;
    font-size: 0.85em;
    margin-bottom: 1em;
}

.portal-loading {
    text-align: center;
    padding: 3em;
    color: #999;
}

/* --- People Grid --- */
.portal-people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1em;
}

/* --- Empty State --- */
.portal-empty {
    color: #999;
}

.portal-empty i {
    font-size: 2em;
    margin-bottom: 0.5em;
    display: block;
    opacity: 0.4;
}

/* --- Filter Bar --- */
.portal-filter-bar {
    display: flex;
    gap: 0.75em;
    margin-bottom: 3em;
}

.portal-filter-select {
    padding: 0.5em 0.75em;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: inherit;
    background: #fff;
    color: #333;
    min-width: 10em;
}

.portal-filter-select:focus {
    outline: none;
    border-color: var(--color-pink);
}

.portal-filter-search {
    padding: 0.5em 0.75em;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: inherit;
    flex: 1;
    max-width: 20em;
}

.portal-filter-search:focus {
    outline: none;
    border-color: var(--color-pink);
}

/* --- Board Cards --- */
.portal-board-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.6em;
}

@media (min-width: 1600px) {
    .portal-board-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1800px) {
    .portal-board-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.portal-board-card {
    background: #fff;
    border-radius: 0.5em;
    border: 1px solid #ddd;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 25em;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.portal-board-card:hover .portal-board-card-thumb {
    background: #eaeaec;
}

.portal-board-card-thumb {
    height: 16em;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f1f1f3;
    padding: 1.3em;
    flex-shrink: 0;
    transition: background 200ms;
}

.portal-board-card-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.portal-board-card-thumb img.portal-board-card-logo {
    max-width: 6.5em;
    max-height: 5em;
    mix-blend-mode: multiply;
    border-radius: 0;
}

.portal-board-card-thumb i {
    font-size: 2em;
    color: #ccc;
}

.portal-board-card-body {
    height: 8em;
    padding: 0.75em 1em;
    border-top: 1px solid #ddd;
    line-height: 1.3;
}

.portal-board-card-brand {
    font-weight: 600;
    color: #333;
}

.portal-board-card-name {
    font-size: 0.9em;
    color: #999;
}

.portal-board-card-project {
    font-size: 0.9em;
    color: #999;
}

/* --- Year Groups --- */
.portal-year-group {
    margin-bottom: 3em;
}

/* --- Brief Stepper --- */
.portal-brief-stepper-wrap {
    display: flex;
    align-items: center;
    gap: 1.5em;
    max-width: 60em;
    margin: 0 auto;
}

.portal-brief-stepper {
    display: flex;
    align-items: center;
    flex: 1;
}

.portal-brief-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2em;
    width: 25%;
}

.portal-brief-step-icon {
    font-size: 1.4em;
    color: var(--color-blue);
}

.portal-brief-step-circle {
    width: 1.4em;
    height: 1.4em;
    border-radius: 50%;
    border: 2px dashed #ccc;
    box-sizing: border-box;
}

.portal-brief-step-label {
    font-weight: 500;
    color: #555;
    line-height: 1;
    margin-top: 0.3em;
}

.portal-brief-step-num {
    font-size: 0.85em;
    color: #aaa;
}

.portal-brief-stepper-chevron {
    color: #eee;
    font-size: 2.5em;
}

.portal-feed-action-btn {
    white-space: nowrap;
    border-radius: 2em;
    padding: 0.5em 2em;
    position: absolute;
    top: 2.5em;
    right: 2.7em;
    z-index: 1;
    min-width: 12em;
    text-align: center;
    justify-content: center;
}

/* --- Brief Step Active --- */
.portal-brief-step.is-active .portal-brief-step-label {
    color: var(--color-pink);
}

.portal-brief-step-icon.is-active {
    color: var(--color-pink);
}

/* --- Brief Form --- */
.brief-editor {
    max-width: 1200px;
    margin: 0 auto;
}

.brief-form-content {
    background: #f5f5f7;
    border-radius: 0.7em;
    margin: 2em 0;
}

.brief-form-step-title {
    margin-bottom: 1.5em;
}

.brief-form-step-desc {
    color: #777;
    font-size: 0.9em;
    margin: 0 0 1.5em;
}

.brief-form-fields {
    display: flex;
    flex-wrap: wrap;
    --brief-fields-gap: 2.25em;
    gap: var(--brief-fields-gap);
}
.portal-brief-modal .brief-form-fields {
    --brief-fields-gap: 1.8em;
}

.brief-field {
    width: 100%;
}

/* --- Required-field validation --- */
/* Layout-transparent wrapper: the widget stays a direct flex child of
   .brief-form-fields, the wrapper only carries the invalid flag. */
.brief-field-wrap {
    display: contents;
}
.brief-field-invalid .brief-field-label,
.brief-field-invalid .brief-images h4 {
    color: var(--color-pink);
}
.brief-field-invalid .brief-field-label {
    background: var(--color-pink-tint);
}
/* yes-no fields flag via their side border, not the label text */
.brief-field-invalid .brief-field-yesno {
    border-left-color: var(--color-pink);
}

/* --- Image uploader widget --- */
.brief-images h4 {
    margin-bottom: 0.2em;
}
.brief-images-intro {
    color: #888;
    margin: 0 0 0.2em;
}
.brief-images-choose {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    cursor: pointer;
    margin-top: 0.5em;
}
.brief-images-input {
    display: none;
}
.brief-images-error {
    color: #c0506a;
    margin: 0.6em 0 0;
}
.brief-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25em;
    margin-top: 1.25em;
    margin-bottom: 0.5em;
}
.brief-image-card {
    position: relative;
    width: 8em;
    height: 8em;
    padding: 6px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}
.brief-image-card.is-dragging {
    opacity: 0.45;
}
.brief-image-card.drag-over {
    outline: 2px dashed var(--color-blue);
    outline-offset: 2px;
}
.brief-image-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none; /* let the card receive the drag, not the image */
    -webkit-user-drag: none;
    user-select: none;
}
.brief-image-hero {
    pointer-events: none;
}
.brief-image-remove {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.brief-image-remove:hover {
    color: #c0506a;
}
.brief-image-hero {
    position: absolute;
    bottom: -6px;
    left: calc(50% - 2em);
    padding: 0.15em 0.6em;
    background: var(--color-blue);
    color: #fff;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 4px;
    width: 4em;
    text-align: center;
}

.brief-field-half-left,
.brief-field-half-right {
    /* Half the row minus half the flex gap (gap varies between page and modal forms). */
    width: calc(50% - var(--brief-fields-gap, 1.5em) / 2);
}

.brief-field-label {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.85em;
    font-weight: 500;
    border-radius: 0.4em 0.4em 0 0;
    color: var(--color-blue);
    background: var(--color-blue-tint);
}

.brief-field:focus-within .brief-field-label {
    color: var(--color-green);
    background: var(--color-green-tint);
}

.brief-field-text {
    margin-bottom: 1em;
}

.brief-form-fields > .brief-field-text {
    margin-bottom: 0;
}

.brief-field-yesno {
    padding-left: 1em;
    border-left: 0.3em solid var(--color-blue-tint);
}

.brief-field-label-inline {
    display: block;
    margin-bottom: 1em;
}

.brief-textarea {
    display: block;
    width: 100%;
    padding: 0.7em 0.9em;
    font-family: inherit;
    font-size: 1em;
    color: #333;
    background: #fff;
    border: none;
    border-bottom: 3px solid #ddd;
    border-radius: 0 0.4em 0.4em 0.4em;
    min-height: 4.5em;
    resize: none;
    field-sizing: content;
    overflow: hidden;
}

.brief-textarea:focus {
    outline: none;
    border-bottom-color: var(--color-green-tint);
}

.brief-input {
    display: block;
    width: 100%;
    padding: 0.7em 0.9em;
    font-family: inherit;
    font-size: 1em;
    color: #333;
    background: #fff;
    border: none;
    border-bottom: 3px solid #ddd;
    border-radius: 0 0.4em 0.4em 0.4em;
}

.brief-input:focus {
    outline: none;
    border-bottom-color: var(--color-green-tint);
}

.brief-dropdown {
    display: block;
    width: 100%;
    padding: 0.7em 0.9em;
    font-family: inherit;
    font-size: 1em;
    color: #333;
    background: #fff;
    border: none;
    border-bottom: 3px solid #ddd;
    border-radius: 0 0.4em 0.4em 0.4em;
}

.brief-dropdown:focus {
    outline: none;
    border-bottom-color: var(--color-green-tint);
}

.brief-textarea::placeholder {
    color: #aaa;
}

.brief-textarea-detail {
    margin-top: 1em;
    min-height: 3em;
    border-radius: 0.4em;
}

/* Card Select */
.brief-card-select-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75em;
}

.brief-card-select-item {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 1.2em;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 0.3em;
    cursor: pointer;
    box-shadow: 0 0 1em rgba(0, 0, 0, 0.03);
    transition: all 200ms;
}

.brief-card-select-item:hover {
    border-color: var(--color-blue-tint);
}

.brief-card-select-item.is-selected {
    background: var(--color-blue);
    color: #fff;
}

.brief-card-select-icon {
    font-size: 1.5em;
    color: var(--color-blue);
    opacity: 0.5;
    width: 1.5em;
    text-align: center;
}

.brief-card-select-item.is-selected .brief-card-select-icon {
    color: #fff;
    opacity: 1;
}

/* Yes/No */
.brief-yes-no {
    display: flex;
    gap: 0.4em;
}

.brief-yes-no-btn {
    padding: 0.5em;
    min-width: 5em;
    border: none;
    border-bottom: 1px solid #d2d2d2;
    box-shadow: 0 0.1em 0.2em rgb(0 0 0 / 4%);
    border-radius: 2em;
    background: #fff;
    font-family: inherit;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 200ms;
}

.brief-yes-no-btn:hover {
    border-bottom-color: #bbb;
}

.brief-yes-no-btn.is-selected {
    background: var(--color-blue);
    color: #fff;
    border-color: var(--color-blue);
}

.brief-field-note {
    margin-top: 1em;
    padding: 0.6em 1em;
    background: #fef9e7;
    border-radius: 6px;
    font-size: 0.85em;
    color: #856404;
}

/* Multi Column Select */
.brief-multi-col-grid {
    display: grid;
    gap: 1.5em;
}

.brief-multi-col-heading {
    display: block;
    padding: 0.25em 0.6em;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--color-blue);
    background: var(--color-blue-tint);
    border-radius: 0.4em;
    margin-bottom: 0.5em;
    text-align: center;
}

.brief-multi-col-item {
    display: flex;
    position: relative;
    color: inherit;
    background: #fff;
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: 0 0 1em rgba(0, 0, 0, 0.03);
    font-size: 1rem;
    font-weight: normal;
    align-items: center;
    justify-content: center;
    padding: 0.2em 0.5em;
    margin: 0;
    margin-bottom: 0.3em;
    border-radius: 0.3em;
    transition: all 200ms;
}

.brief-multi-col-item:hover {
    border-color: var(--color-blue-tint);
}

.brief-multi-col-item.is-selected {
    background: var(--color-blue);
    color: #fff;
}

/* Tag Pills */
.brief-tag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
}

.brief-tag-pill {
    padding: 0.3em 0.8em;
    border: none;
    border-radius: 2em;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 200ms;
    color: var(--color-blue);
    background: var(--color-blue-tint);
}

.brief-tag-pill:hover {
    border-color: #bbb;
}

.brief-tag-pill.is-selected {
    background: var(--color-blue);
    color: #fff;
    border-color: var(--color-blue);
}

/* Country Picker */
.brief-country-picker {
    display: flex;
    gap: 0.5em;
    align-items: center;
}

.brief-country-select {
    padding: 0.5em 0.75em;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9em;
    min-width: 15em;
}

.brief-country-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    margin-top: 0.5em;
}

.brief-country-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.25em 0.6em;
    background: var(--color-blue);
    color: #fff;
    border-radius: 2em;
    font-size: 0.85em;
}

.brief-country-tag button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 0.8em;
    padding: 0;
    opacity: 0.7;
}

.brief-country-tag button:hover {
    opacity: 1;
}

/* Form Nav */
.brief-form-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3em;
}

.brief-form-nav-prev {
    border-radius: 2em;
}

.brief-form-nav-next {
    border-radius: 2em;
    margin-left: auto;
}

/* --- Timeline modal preview --- */
.portal-timeline-intro {
    margin: 0 0 1.25em;
    color: #555;
}

.portal-timeline-summary {
    display: flex;
    gap: 2.5em;
    margin-bottom: 2em;
}

.portal-timeline-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
}

.portal-timeline-summary-label {
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
}

.portal-timeline-earlier {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    margin-top: 1.5em;
    padding-top: 1.5em;
    border-top: 1px solid #eee;
}
.portal-timeline-earlier-label {
    font-weight: 500;
    color: #555;
}
.portal-timeline-earlier-input {
    width: 14em;
}

/* --- Timeline Chart --- */
.portal-timeline-chart {
    display: grid;
    grid-template-rows: auto 2em auto;
    margin: 1em 0 3em;
    row-gap: 0;
}

.portal-timeline-chart:first-child {
    margin-top: 0;
}

.portal-feed-item-content .portal-timeline-chart {
    margin-bottom: 1em;
}

/* Milestones */
.portal-timeline-milestone {
    position: relative;
    overflow: visible;
    height: 3.5em;
}

.portal-timeline-milestone-line {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    border-left: 1px solid #ccc;
    z-index: 2;
}

.portal-timeline-milestone-text {
    position: absolute;
    top: 0;
    right: 0.5em;
    white-space: nowrap;
    text-align: right;
    line-height: 1.2;
    color: #999;
}

.portal-timeline-milestone-label {
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
}

.portal-timeline-milestone-date {
    font-size: 0.8em;
}

.portal-timeline-milestone.is-start .portal-timeline-milestone-line {
    left: 0;
    right: auto;
}

.portal-timeline-milestone.is-start .portal-timeline-milestone-text {
    right: auto;
    left: 0.5em;
    text-align: left;
}

/* Segments */
.portal-timeline-bar-bg {
    background: #e8f4fc;
    border-radius: 3em;
}

.portal-timeline-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    font-size: 0.8em;
    font-weight: 600;
    line-height: 1.2;
}

.portal-timeline-segment.seg-design {
    background: var(--color-aqua);
    color: #fff;
}

.portal-timeline-segment.seg-feedback {
    background: rgba(128, 90, 180, 0.55);
    color: #fff;
}

.portal-timeline-segment.seg-feedback::before {
    content: 'feedback';
    position: absolute;
    top: -1.4em;
    left: calc(50% - 3em);
    width: 6em;
    text-align: center;
    font-size: 0.9em;
    font-weight: normal;
    color: rgba(128, 90, 180, 0.7);
    line-height: 1.05;
}

.portal-timeline-segment.seg-first {
    border-radius: 3em 0 0 3em;
}

.portal-timeline-segment.seg-last {
    border-radius: 0 3em 3em 0;
}

.portal-timeline-segment.seg-first.seg-last {
    border-radius: 3em;
}

.portal-timeline-seg-days {
    line-height: 1;
}

/* Day cells */
.portal-timeline-day {
    text-align: center;
    font-size: 0.75em;
    color: #999;
    padding: 0.2em 0;
    cursor: default;
}

.portal-timeline-day.is-off {
    background: #f0f0f0;
    color: #ccc;
}

.portal-timeline-day.is-today {
    background: var(--color-pink);
    color: #fff;
    font-weight: 700;
    border-radius: 3px;
}

/* ===== Package / Unit selection ===== */
.portal-select {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}
.portal-select-intro {
    color: #666;
    margin: 0 0 24px;
}
.portal-select-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.portal-select-header h1 {
    margin: 0;
}
.portal-select-section {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.portal-select-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}
.portal-select-section-header h3 {
    margin: 0;
}
.portal-select-section-rule {
    font-size: 13px;
    color: #666;
}
.portal-select-section-count.is-warn {
    color: #c44;
    margin-left: 8px;
}
.portal-select-section-count.is-ok {
    color: #2a7;
    margin-left: 8px;
}
.portal-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.portal-select-card {
    position: relative;
    padding: 16px;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.portal-select-card:hover:not(.is-disabled) {
    border-color: #888;
}
.portal-select-card.is-selected {
    border-color: var(--color-pink, #e91e63);
    background: #fff8fb;
}
.portal-select-card.is-disabled {
    opacity: .5;
    cursor: not-allowed;
}
.portal-select-card-icon {
    font-size: 28px;
    color: #555;
    margin-bottom: 8px;
}
.portal-select-card-name {
    font-weight: 600;
    margin-bottom: 4px;
}
.portal-select-card-desc {
    font-size: 13px;
    color: #777;
    margin-bottom: 8px;
}
.portal-select-card-price {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}
.portal-select-card-check {
    position: absolute;
    top: 10px;
    right: 12px;
    color: var(--color-pink, #e91e63);
    font-size: 18px;
}
.portal-select-card:not(.is-selected) .portal-select-card-check {
    color: #ccc;
}
.portal-select-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ===== Project builder (NewUnit dropdown + provisional list) ===== */
.portal-builder {
    background: #f5f5f7;
    border-radius: .7em;
    padding: 3em 3.5em;
    max-width: 1200px;
    margin: 0 auto;
}
.portal-builder-add {
    display: flex;
    gap: 10px;
    margin: 1em 0 2em 0;
    max-width: 40em;
}
.portal-builder-dropdown {
    flex: 1;
    padding: 12px 14px;
    border: none;
    border-bottom: 3px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 1em;
    font-family: inherit;
    outline: 0;
}
.portal-builder-list {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
}
.portal-builder-general {
    margin: 1em 0 2.5em 0;
}
.portal-builder-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 1.5em;
    background: #fff;
    border-radius: 8px;
    border-bottom: 3px solid #ddd;
}
.portal-builder-row-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}
.portal-builder-row-name {
    flex: 1;
    font-size: 1.1em;
    font-weight: 600;
}
.portal-builder-row-main .portal-builder-row-name {
    flex: none;
}
.portal-builder-row-timeline {
    display: flex;
    align-items: center;
    gap: 1em;
    font-size: 0.85em;
}
.portal-builder-row-timeline-dates {
    color: #666;
}
.portal-builder-row-timeline-dates i {
    margin-right: 0.4em;
}
.portal-builder-timeline-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--color-blue, #2f6fed);
    cursor: pointer;
    text-decoration: underline;
}
.portal-builder-timeline-link:hover {
    text-decoration: none;
}
.portal-builder-brief-btn {
    width: 7em;
    text-align: center;
    justify-content: center;
}

.portal-builder-brief-status {
    display: inline-block;
    font-size: 0.85em;
    font-weight: 500;
    width: 8.5em;
    text-align: center;
    padding: 0.2em 0.7em;
    border-radius: 1em;
    color: #b6781f;
    background: #f6ecd9;
}
.portal-builder-brief-status.is-done {
    color: var(--color-green);
    background: var(--color-green-tint);
}
.portal-builder-qty {
    display: flex;
    align-items: center;
    gap: 10px;
}
.portal-builder-qty-val {
    min-width: 1.5em;
    text-align: center;
}
.portal-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ccc;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    color: #555;
}
.portal-qty-btn:hover:not(:disabled) {
    border-color: var(--color-pink);
    color: var(--color-pink);
}
.portal-qty-btn:disabled {
    opacity: 0.5;
    cursor: default;
}
.portal-builder-remove {
    border: none;
    background: none;
    cursor: pointer;
    color: #999;
    padding: 4px 6px;
}
.portal-builder-remove:hover:not(:disabled) {
    color: #c0506a;
}

/* ===== Brief list landing ===== */
.portal-brief-list {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}
.portal-brief-list h1 {
    margin: 0 0 8px;
}
.portal-brief-list-intro {
    color: #666;
    margin: 0 0 20px;
}
.portal-brief-list-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.portal-brief-list-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s;
}
.portal-brief-list-row:hover {
    border-color: #888;
}
.portal-brief-list-row-label {
    font-weight: 500;
}
.portal-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.portal-pill.is-complete { background: #e0f6e9; color: #2a7; }
.portal-pill.is-progress { background: #fff5e0; color: #c80; }
.portal-pill.is-pending  { background: #f1f1f1; color: #666; }

.portal-brief-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

/* Brief feed item: product list + prompt */
.portal-brief-prompt {
    margin: 0;
    color: #555;
}
.portal-brief-products {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6em;
}
.portal-brief-products li {
    display: flex;
    align-items: center;
    gap: 0.75em;
}
.portal-brief-product-name {
    font-weight: 500;
}
/* Status lozenge (matches the select-page style, slightly smaller), sits after the product name */
.portal-brief-product-status {
    display: inline-block;
    font-size: 0.75em;
    font-weight: 500;
    text-align: center;
    padding: 0.2em 0.7em;
    border-radius: 1em;
    white-space: nowrap;
    color: #b6781f;
    background: #f6ecd9;
}
.portal-brief-product-status.is-complete {
    color: var(--color-green);
    background: var(--color-green-tint);
}

/* ===== Brief modal sizing ===== */
.modal-content-xl {
    max-width: 1000px;
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
}
.portal-brief-modal .modal-body {
    padding: 0;
}
.portal-brief-modal .modal-footer {
    background: #fff;
}
/* Step title moves to the modal header in this context. */
.portal-brief-modal .brief-form-step-title {
    display: none;
}
.portal-brief-modal {
    max-width: 850px;
}
.portal-brief-modal .brief-form-content {
    margin: 0;
    padding: 2.5em;
}

