/* Shared finishing rules for the photographer portal. */
body { font-size: 13px; }
.main-content { padding-top: 30px; }
.page-header h2 { font-size: 26px; letter-spacing: -.8px; }
.page-header p { font-size: 12px; }
.page-header { margin-bottom: 22px; }
.premium-panel { padding: 20px; border-radius: 13px; box-shadow: none; }
.panel-heading h3 { font-size: 14px; }
.btn { min-height: 36px; font-size: 12px; padding: 8px 12px; }
.portal-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.portal-results { font-size: 11px; color: #798577; margin: 15px 0; }
.portal-pill { display: inline-flex; align-items: center; font-size: 10px; font-weight: 500; border: 1px solid #e0e6db; border-radius: 5px; padding: 3px 7px; color: #667761; background: #f4f7f0; white-space: nowrap; }
.portal-pill.live { background: #edf6ee; border-color: #d3e7d8; color: #346549; }
.portal-pill.warning { background: #fff3df; border-color: #e8d4ae; color: #835f29; }
.portal-pill.muted { background: #f3f4f1; color: #6e7669; }
.library-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.portal-search { flex: 1; min-width: 160px; }
.portal-search input, .library-toolbar select { border: 1px solid #dfe6da; background: #fff; border-radius: 8px; padding: 9px 11px; min-height: 38px; font-size: 12px; width: 100%; color: #425240; }
.library-view { display: flex; gap: 3px; padding: 3px; border: 1px solid #e1e7dc; border-radius: 8px; background: #f2f5ee; }
.library-view button { border: 0; border-radius: 5px; background: transparent; padding: 7px 12px; color: #6e7e66; cursor: pointer; font-size: 11px; }
.library-view button[aria-pressed="true"] { background: #fff; color: #294c33; box-shadow: 0 1px 4px #30402110; }
.library-view button.is-active { background: #fff; color: #294c33; box-shadow: 0 1px 4px #30402110; }
#gallery-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr)); gap: 16px; }
#gallery-list .portal-gallery { border-radius: 11px; border-color: #e1e7dc; box-shadow: none; overflow: visible; min-width: 0; }
.portal-gallery-cover { position: relative; height: 125px; background: #eaf0e4; border-radius: 10px 10px 0 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.portal-gallery-cover img { width: 100%; height: 100%; object-fit: cover; }
.portal-cover-placeholder { font-size: 42px; color: #a5b69a; }
.portal-gallery-cover > .portal-pill { position: absolute; top: 10px; left: 10px; box-shadow: 0 1px 4px #1027100b; }
.portal-gallery-body { padding: 14px 15px 10px; min-width: 0; }
.portal-gallery-topline { display: flex; justify-content: space-between; gap: 8px; color: #7d8b76; font-size: 10px; }
.portal-gallery-body h3 { font-size: 14px; font-weight: 600; letter-spacing: -.2px; margin: 8px 0 5px; line-height: 1.4; overflow-wrap: anywhere; }
.portal-gallery-body p { font-size: 11px; margin: 0; color: #768570; overflow-wrap: anywhere; }
.portal-gallery-actions { padding: 8px 15px 14px; display: flex; align-items: center; gap: 6px; margin-top: auto; }
.portal-gallery-actions .btn { font-size: 11px; min-height: 32px; padding: 6px 9px; }
.portal-draft-note { font-size: 10px; color: #7e8a76; flex: 1; }
.portal-gallery-menu { position: relative; margin-left: auto; }
.portal-gallery-menu summary { width: 30px; height: 32px; border: 1px solid #e0e7da; border-radius: 6px; list-style: none; cursor: pointer; display: grid; place-items: center; font-size: 22px; color: #5d7356; }
.portal-gallery-menu summary::-webkit-details-marker { display: none; }
.portal-gallery-menu[open] summary { background: #edf3e8; }
.portal-gallery-menu > div { position: absolute; right: 0; top: 36px; z-index: 15; min-width: 165px; background: #fff; padding: 5px; border: 1px solid #dce5d5; border-radius: 8px; box-shadow: 0 8px 24px #1528131c; }
.portal-gallery-menu button { display: block; width: 100%; border: 0; border-radius: 5px; background: transparent; text-align: left; color: #425c38; padding: 10px; font-size: 11px; cursor: pointer; }
.portal-gallery-menu button:hover { background: #f1f6ed; }
.portal-index-progress { margin-top: 9px; color: #82916f; font-size: 10px; display: flex; align-items: center; gap: 10px; }
.portal-index-progress progress { width: 75px; height: 4px; accent-color: #7b9863; }
#gallery-list[data-view="list"] { grid-template-columns: minmax(0, 1fr); gap: 9px; }
#gallery-list.is-list-view { grid-template-columns: minmax(0, 1fr) !important; gap: 9px !important; }
#gallery-list[data-view="list"] .portal-gallery { display: grid; grid-template-columns: 145px minmax(0, 1fr) auto; align-items: center; }
#gallery-list.is-list-view .portal-gallery { display: grid !important; grid-template-columns: 145px minmax(0, 1fr) auto !important; align-items: center; }
#gallery-list[data-view="list"] .portal-gallery-cover { height: 95px; border-radius: 10px 0 0 10px; }
#gallery-list.is-list-view .portal-gallery-cover { height: 95px; border-radius: 10px 0 0 10px; }
#gallery-list[data-view="list"] .portal-gallery-body { padding: 12px 16px; }
#gallery-list[data-view="list"] .portal-gallery-actions { margin-top: 0; padding: 12px; }
#gallery-list[data-view="list"] .portal-gallery-topline { justify-content: flex-start; gap: 15px; }
.portal-empty { grid-column: 1 / -1; padding: 35px 12px; text-align: center; color: #485d40; }
.portal-empty strong { font-size: 14px; font-weight: 500; }
.portal-empty p { color: #7b8875; font-size: 12px; }
#tab-earnings .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
#tab-earnings .stat-card { padding: 20px; border-radius: 12px; }
#tab-earnings .stat-icon { font-size: 12px; margin-bottom: 10px; }
#tab-earnings .stat-value { font-size: 27px; letter-spacing: -.8px; }
#tab-earnings .stat-profit { background: #edf3e7; border-color: #d5e2c9; }
.portal-stat-note { display: block; font-size: 10px; color: #87917f; margin-top: 7px; }
.portal-disclosure { cursor: pointer; list-style: none; margin: 0; }
.portal-disclosure::-webkit-details-marker { display: none; }
.portal-disclosure h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.portal-disclosure-action { color: #718167; font-size: 11px; }
#tab-earnings details[open] > summary { margin-bottom: 18px; }
#tab-earnings .orders-toolbar { flex-wrap: wrap; width: 100%; gap: 12px; margin-top: 6px; align-items: flex-end; }
#tab-earnings .orders-toolbar-field { font-size: 10px; gap: 5px; }
#tab-earnings .orders-toolbar-field select { min-height: 38px; padding: 8px 10px; min-width: 130px; font-size: 12px; }
.portal-count { font-size: 11px; font-weight: 400; color: #819076; margin-left: 7px; }
#tab-earnings .data-table { font-size: 12px; }
#tab-earnings .data-table th { font-size: 10px; }
#tab-earnings .data-table td { padding: 12px; }
#tab-earnings .data-table .num-deduct { color: #8c7560; }
#tab-earnings .empty-state { padding: 22px 10px; }
#tab-earnings .empty-state-icon { display: none; }
#tab-earnings .empty-state-title { font-size: 14px; }
#tab-earnings .empty-state-text { font-size: 12px; }
#tab-earnings .payout-request-row input { min-height: 38px; font-size: 12px; }
#tab-earnings .payout-pending { padding: 14px; }
#tab-earnings .payout-pending-badge { font-size: 10px; }
#tab-earnings .payout-pending-amount { font-size: 23px; }
#join-form code, #gallery-form code { overflow-wrap: anywhere; }
@media (max-width: 1100px) {
    #gallery-list[data-view="list"] .portal-gallery { grid-template-columns: 110px minmax(0, 1fr); }
    #gallery-list[data-view="list"] .portal-gallery-cover { grid-row: 1 / 3; height: 100%; min-height: 110px; }
    #gallery-list[data-view="list"] .portal-gallery-actions { grid-column: 2; justify-content: flex-start; padding-top: 0; }
}
@media (max-width: 768px) {
    .main-content { padding-top: 24px; }
    .page-header h2 { font-size: 24px; }
    .premium-panel { padding: 16px; }
    .library-toolbar { gap: 9px; }
    .library-toolbar .portal-search { flex-basis: 100%; }
    .library-toolbar > label:not(.portal-search) { flex: 1; }
    #gallery-list { grid-template-columns: minmax(0, 1fr); }
    .portal-gallery-cover { height: 115px; }
    #gallery-list[data-view="list"] .portal-gallery { grid-template-columns: 90px minmax(0, 1fr); }
    #gallery-list[data-view="list"] .portal-gallery-body { padding: 10px; }
    #gallery-list[data-view="list"] .portal-gallery-topline { font-size: 9px; flex-wrap: wrap; gap: 3px 8px; }
    #gallery-list[data-view="list"] .portal-gallery-cover .portal-pill { font-size: 8px; top: 7px; left: 5px; padding: 2px 4px; }
    #gallery-list[data-view="list"] .portal-gallery-actions { flex-wrap: wrap; padding: 3px 10px 10px; }
    .portal-gallery-actions .btn { font-size: 10px; padding: 6px 7px; }
    #tab-earnings .stats-grid { gap: 8px; }
    #tab-earnings .stat-card { padding: 13px 10px; }
    #tab-earnings .stat-icon { font-size: 10px; min-height: 29px; margin-bottom: 6px; }
    #tab-earnings .stat-value { font-size: clamp(16px, 4.5vw, 23px); letter-spacing: -.5px; overflow-wrap: anywhere; }
    .portal-stat-note { font-size: 9px; line-height: 1.5; }
    #tab-earnings .orders-toolbar .portal-search { flex-basis: 100%; }
    #tab-earnings .orders-toolbar-field { flex: 1; min-width: 0; }
    #tab-earnings .orders-toolbar-field select { width: 100%; min-width: 0; max-width: 100%; }
    #tab-earnings .payout-request-row { flex-direction: column; align-items: stretch; }
    #tab-earnings .payout-request-row input { width: 100%; min-width: 0; }
    .portal-disclosure h3 { font-size: 12px; }
    .portal-disclosure-action { font-size: 10px; }
}
.portal-order-open { border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 5px 0; }
.portal-order-open:hover { color: #32664f; text-decoration: underline; }
/* Expanded transaction: references and files only; totals remain in the parent row. */
#tab-earnings .order-expand-row > td { padding: 0; }
#tab-earnings .order-expand-body { display: grid; grid-template-columns: minmax(200px, .8fr) minmax(0, 1.2fr); gap: 12px 24px; padding: 12px 16px; background: #f5f7f2; align-items: start; }
.transaction-reference { display: grid; gap: 6px; min-width: 0; font-size: 11px; }
.transaction-reference > div { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.transaction-reference code { font-size: 10px; padding: 1px 5px; background: #eaf0e4; overflow-wrap: anywhere; }
.transaction-label { color: #7f8a77; font-size: 10px; font-weight: 500; white-space: nowrap; }
.transaction-reference .transaction-label { min-width: 32px; }
.transaction-buyer > span:last-child { color: #67795d; overflow-wrap: anywhere; min-width: 0; }
.transaction-files { min-width: 0; }
.transaction-preview-hint { color: #98a28f; font-size: 9px; font-weight: 400; }
.transaction-file-list { margin-top: 5px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); gap: 5px; max-height: 140px; overflow-y: auto; }
.transaction-file { display: flex; align-items: center; gap: 7px; min-width: 0; border: 1px solid #e1e7da; background: #fff; border-radius: 6px; padding: 6px 8px; color: #425e37; font-size: 11px; text-align: left; cursor: pointer; }
.transaction-file:hover { background: #edf3e7; border-color: #bbcead; }
.transaction-file svg { width: 14px; height: 14px; flex-shrink: 0; color: #8d9e82; }
.transaction-file > span:not(.transaction-file-arrow) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transaction-file-arrow { margin-left: auto; color: #93a386; font-size: 11px; }
.transaction-no-files { font-size: 11px; color: #8a9583; }
@media (max-width: 768px) {
    #tab-earnings .order-expand-body { grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 10px 12px; }
    .transaction-reference { display: flex; flex-wrap: wrap; gap: 5px 18px; }
    .transaction-file { min-height: 36px; }
}
/* File chips size to their names instead of stretching across the detail row. */
.transaction-file-list { display: flex; flex-wrap: wrap; align-items: flex-start; }
.transaction-file { flex: 0 1 auto; width: fit-content; max-width: 100%; }
.transaction-file-arrow { margin-left: 5px; }
/* Popular photos belong with the photographer's gallery library. */
#tab-galleries .dashboard-photos { margin-top: 18px; margin-bottom: 0; }
#tab-galleries .dashboard-photos .top-photos-grid { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 155px; gap: 12px; overflow-x: auto; padding: 4px 2px 9px; }
#tab-galleries .dashboard-photos .top-photo-img { width: 100%; height: 110px; object-fit: cover; }
#tab-galleries .dashboard-photos .top-photo-meta { font-size: 10px; margin-top: 6px; }
#tab-galleries .dashboard-photos .top-photo-album { font-size: 10px; }
#tab-galleries .dashboard-photos .top-photo-share { opacity: 1; transform: none; }
#tab-galleries .dashboard-photos.is-empty { display: flex; align-items: center; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
#tab-galleries .dashboard-photos.is-empty .panel-heading { margin: 0; }
#tab-galleries .dashboard-photos.is-empty .dashboard-empty-note { font-size: 11px; margin: 0; }
#tab-galleries .dashboard-photos .range-label { font-size: 10px; }
@media (max-width: 768px) {
    #tab-galleries .dashboard-photos.is-empty { flex-wrap: wrap; gap: 5px; }
    #tab-galleries .dashboard-photos .top-photos-grid { grid-auto-columns: 135px; }
    #tab-galleries .dashboard-photos .top-photo-img { height: 100px; }
}

/* One advancing badge per category; previous tiers still count toward XP. */
#achievements-panel #achievements-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
#achievements-panel .progressive-badge { padding: 13px; border-radius: 12px; }
.progressive-badge .game-track-header { gap: 5px; }
.progressive-badge .game-track-header h4 { font-size: 11px; }
.progressive-badge-main { display: flex; align-items: center; gap: 10px; margin: 13px 0; }
.progressive-badge-main > .game-medal { width: 48px; height: 54px; flex: 0 0 48px; color: var(--game-accent); }
.progressive-badge-main > div { min-width: 0; }
.progressive-badge-main h5 { margin: 3px 0 5px; color: #edf2ff; font-size: 13px; line-height: 1.35; }
.progressive-badge-stage { font-size: 9px; color: #a7b4cc; }
.progressive-badge .game-progress-label { font-size: 9px; gap: 5px; }
[data-ladder="photos"] { --game-accent: #c4a8ed; --game-glow: #b895ef20; }
[data-ladder="events"] { --game-accent: #f0b49d; --game-glow: #f0b49d20; }
@media (max-width: 1200px) { #achievements-panel #achievements-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 650px) { #achievements-panel #achievements-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { #achievements-panel #achievements-grid { grid-template-columns: minmax(0, 1fr); } }

/* -- Sales / profit overlay on gallery card cover --
   Sits top-right of the cover image (mirrors the user-circled spot in
   the screenshot). Compact two-line stat block so the photographer can
   scan their event earnings without opening the gallery. Shows only
   when the album has actual sales � brand-new galleries with RM 0
   stay clean. */

.portal-stats-overlay {
    position: absolute;
    top: .55rem;
    right: .55rem;
    background: rgba(15, 23, 42, .78);
    color: #fff;
    padding: .45rem .6rem;
    border-radius: 8px;
    min-width: 120px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: .72rem;
    line-height: 1.25;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    z-index: 2;
}
.portal-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .6rem;
}
.portal-stats-row + .portal-stats-row { margin-top: .12rem; }
.portal-stats-label {
    font-size: .62rem;
    color: rgba(255, 255, 255, .65);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
}
.portal-stats-value {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: .8rem;
}
.portal-stats-row-profit .portal-stats-value { color: #4ade80; }
.portal-stats-orders {
    margin-top: .25rem;
    padding-top: .25rem;
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: .62rem;
    color: rgba(255, 255, 255, .7);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.payout-balance-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
    grid-column: 1 / -1;
}
.payout-balance-item { padding: 16px; border: 1px solid #d7e5da; border-radius: 12px; background: #f1f8f3; }
.payout-balance-item span, .payout-balance-item strong, .payout-balance-item small { display: block; }
.payout-balance-item span { font-size: 12px; font-weight: 600; color: #31563c; }
.payout-balance-item strong { margin: 8px 0; font-size: clamp(20px, 3vw, 28px); color: #21663a; font-variant-numeric: tabular-nums; }
.payout-balance-item small { font-size: 11px; line-height: 1.5; color: #506457; }
.payout-balance-cooling { background: #fff8ec; border-color: #ead8b4; }
.payout-balance-cooling span, .payout-balance-cooling strong { color: #805416; }
.payout-balance-cooling small { color: #735f40; }
.dashboard-wallet .payout-balance-summary { grid-template-columns: 1fr; }
@media (max-width: 480px) { .payout-balance-summary { grid-template-columns: 1fr; } }
.profile-editor { max-width:900px; padding:24px; }
.profile-editor h3 { margin:20px 0 10px; }
.profile-editor p { color:var(--text-dim); font-size:13px; line-height:1.6; }
.profile-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin:20px 0; }
.profile-fields label { display:grid; gap:8px; font-size:13px; font-weight:600; }
.profile-fields input { width:100%; box-sizing:border-box; padding:12px; border:1px solid #ccd5d0; background:var(--ph-surface,#fff); color:var(--text-main,#1b3024); border-radius:8px; font:inherit; }
.profile-fields input:read-only { opacity:.7; }
@media(max-width:600px) { .profile-fields { grid-template-columns:1fr; } }
