:root {
    --ink: #241b16;
    --muted: #70665e;
    --line: #eaded3;
    --paper: #fffdfb;
    --cream: #fff3e7;
    --dark: #211711;
    --accent: #ff7900;
    --accent-deep: #b94d00;
}

body { background: var(--paper); }
.site-header { background: #fffdfb; border-bottom-color: var(--line); box-shadow: 0 2px 16px #3d210c0a; }
.brand { gap: 9px; }
.brand-logo { display: block; flex: none; width: 50px; height: 40px; object-fit: contain; }
.brand-thin { color: var(--accent-deep); }
.main-nav a:hover, .text-button:hover, .arrow-link:hover, .back-link:hover, .site-footer a:hover { color: var(--accent-deep); }

.button-light, .hero-search button { background: var(--accent); color: var(--ink); }
.button-dark { background: var(--accent-deep); color: #fff; }
.button-light:hover, .hero-search button:hover { background: #ff8e29; filter: none; }
.button-dark:hover { background: #963d00; filter: none; }
.button:focus-visible, .hero-search button:focus-visible, .text-button:focus-visible, a:focus-visible, .inline-form button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.hero { background: radial-gradient(circle at 82% 44%, #5e2b0d 0%, #2a1d16 45%, #1d1714 100%); }
.eyebrow { color: var(--accent-deep); }
.eyebrow.light, .hero em, .dark-band em { color: #ff9b3d; }
.hero-copy > p { color: #f1dfcf; }
.hero-pills { color: #e6b995; }
.hero-pills a { border-color: #a66d47; color: #fff3e8; }
.hero-pills a:hover { border-color: var(--accent); color: #fff; }
.art-frame { border-color: #ffe0bf; }
.frame-back { background: linear-gradient(150deg, #f6b86b 8%, #d9793b 45%, #814c33 46%, #2b1e1b 100%); }
.frame-front { background: linear-gradient(165deg, #ffd193 0%, #e2a46d 38%, #a8603c 50%, #3c2924 100%); }
.art-sun { background: #ffad50; }
.art-mountain { background: #8c4429; }
.art-mountain.two { background: #3c2924; }
.art-sticker { background: var(--accent); color: var(--ink); }

.photo-card-image { background: #f6e2ce; }
.photo-card:hover, .gallery-card:hover { box-shadow: 0 14px 26px #71370d24; }
.gallery-cover { background: linear-gradient(135deg, #ff9a38, #9d3d00); color: #fff4e8; }
.avatar { background: #ffe0bd; color: #843700; }
.dark-band { background: #2b1c15; }
.band-grid p { color: #f0d8c4; }
.site-footer { background: #fff6ed; }

.filter-bar input, .filter-bar select, .field input, .field textarea, .field select { border-color: #d9c7b5; outline-color: var(--accent-deep); }
.filter-bar input:focus, .filter-bar select:focus, .field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent-deep); }
.empty-state { border-color: #e8c8aa; background: #fff8f1; }
.empty-icon { color: var(--accent-deep); }
.photo-stage { background: #251a15; }
.price-panel { border: 1px solid #f0d6bc; }
.dashboard-nav a:hover { background: var(--cream); border-color: #e5b88f; }
.inline-form button:hover { border-color: var(--accent-deep); color: var(--accent-deep); }
.status.Pending { background: #fff0cf; }
.status.Approved { background: #e5f3dc; }
.toast.success { background: #e8f5dd; }
.info-box { background: #fff1e2; border-left-color: var(--accent); }

/* Thumbnails stay at or below their actual 200 px longest side. */
.photo-card-image { display: grid; place-items: center; }
.photo-card-image img, .gallery-cover img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, 200px);
    max-height: 200px;
    object-fit: contain;
}
.photo-card-image, .gallery-cover { position: relative; }
.photo-card.is-purchased { border-color: #89b477; }
.purchased-badge {
    position: absolute;
    z-index: 1;
    top: 10px;
    right: 10px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #1e623d;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    box-shadow: 0 2px 8px #171b1670;
}
.credit-balance { display: block; margin-top: 4px; color: #9a4200; font-size: 12px; font-weight: 700; line-height: 1.4; }
.gallery-card-body .credit-balance { margin-top: 6px; }
.photo-sidebar .credit-balance { text-align: right; }
.purchase-confirmation { display: grid; gap: 5px; margin: 18px 0 14px; padding: 16px; border: 1px solid #a8cca3; border-radius: 9px; background: #eaf6e7; color: #245b32; }
.purchase-confirmation strong { font-size: 16px; }
.purchase-confirmation span { font-size: 13px; }

.dashboard-nav a[aria-current="page"] { background: var(--cream); border-color: #e5b88f; color: var(--accent-deep); }
.studio-shortcuts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin: 24px 0; }
.studio-shortcut { display: block; color: inherit; text-decoration: none; }
.studio-shortcut h2 { margin: 0 0 8px; }
.studio-shortcut p { margin: 0; color: var(--muted); }
.studio-shortcut:hover { border-color: var(--accent); }
.studio-state { display: inline-block; margin-top: 8px; color: var(--accent-deep); font-size: 12px; font-weight: 700; }
.studio-filter { margin-top: 20px; }
.studio-filter label { font-weight: 700; white-space: nowrap; }
.studio-photo-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 18px; }
.studio-photo-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-decoration: none; }
.studio-photo-card:hover { border-color: var(--accent); box-shadow: 0 10px 22px #71370d20; }
.studio-photo-thumb { display: grid; place-items: center; min-height: 220px; background: #f6e2ce; }
.studio-photo-thumb img { display: block; width: auto; height: auto; max-width: min(100%,200px); max-height: 200px; object-fit: contain; }
.studio-photo-info { padding: 14px; }
.studio-photo-info h3 { margin: 4px 0 12px; font-size: 17px; }
.studio-photo-info small { display: block; margin-top: 12px; color: var(--muted); }
.studio-metrics { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--muted); }
.studio-metrics strong { color: var(--ink); }
.studio-edit-layout { display: grid; grid-template-columns: minmax(280px,1fr) minmax(320px,1.2fr); gap: 20px; margin: 22px 0; align-items: start; }
.studio-preview img { display: block; width: auto; height: auto; max-width: 100%; max-height: 600px; margin: 0 auto 16px; object-fit: contain; }
.studio-editor h2 { margin-top: 0; }
.studio-delete { margin: 22px 0; border-color: #e5b8ad; }
.button-danger { background: #a92f20; color: #fff; }
.button-danger:hover { background: #832116; }
.cover-picker { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 10px; margin: 16px 0 24px; }
.cover-option { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 12px; }
.cover-option:has(input:checked) { border-color: var(--accent-deep); box-shadow: 0 0 0 2px #ff790033; }
.cover-option input { align-self: flex-start; }
.cover-option-image, .cover-auto { display: grid; place-items: center; width: 100%; height: 150px; background: #f6e2ce; border-radius: 5px; }
.cover-option-image img { display: block; width: auto; height: auto; max-width: min(100%,140px); max-height: 140px; object-fit: contain; }
.cover-option > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.collection-choice { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.collection-choice legend { padding: 0 6px; font-weight: 700; }
.collection-choice label { cursor: pointer; }

.photo-card-shell { min-width: 0; display: flex; flex-direction: column; }
.photo-card-shell > .photo-card { flex: 1; }
.photo-card-shell > form { margin-top: 8px; }
.photo-basket-button { width: 100%; min-height: 40px; }
.basket-state { display: block; margin-top: 8px; padding: 10px; border-radius: 7px; background: #e9f3e5; color: #276040; text-align: center; font-size: 13px; font-weight: 700; }
.photo-save-link { display: block; margin-top: 8px; color: var(--accent-deep); text-align: center; font-size: 13px; font-weight: 700; text-decoration: none; }
.shopping-page { padding-top: 42px; padding-bottom: 70px; }
.shopping-page .dashboard-head p { color: var(--muted); }
.basket-group { margin: 16px 0; }
.basket-group-head, .basket-line, .basket-checkout { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.basket-group-head h2 { margin: 0; }
.basket-line { padding: 14px 0; border-top: 1px solid var(--line); }
.basket-line img { display: block; max-width: 90px; max-height: 90px; width: auto; height: auto; object-fit: contain; }
.basket-line > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
.basket-line > div a { color: var(--ink); text-decoration: none; }
.basket-checkout { margin-top: 22px; flex-wrap: wrap; }
.basket-checkout strong { font-size: 24px; }
.basket-checkout .muted { width: 100%; margin: 0; }
.collection-create { margin: 24px 0; }
.collection-create h2 { margin-top: 0; }
.collection-form-row { display: flex; flex-wrap: wrap; gap: 10px; }
.collection-form-row input, .share-url { flex: 1; min-width: 200px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.private-collection-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 16px; }
.private-collection-card { display: grid; align-content: space-between; gap: 12px; }
.private-collection-card > a { color: var(--ink); text-decoration: none; }
.private-collection-card h2 { margin: 0 0 8px; }
.private-collection-card p { margin: 0; }
.collection-tools { display: grid; gap: 24px; margin: 24px 0; }
.collection-tools label { display: block; margin-bottom: 8px; font-weight: 700; }
.collection-share h2 { margin: 0; }
.collection-share .share-url { width: 100%; margin: 5px 0 12px; }
.collection-share p { color: var(--muted); }
.danger-text { color: #a92f20; }
.private-photo-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 16px; }
.private-photo-item { display: grid; justify-items: center; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: center; }
.private-photo-item a { display: grid; justify-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.private-photo-item img { display: block; max-width: min(100%,200px); max-height: 200px; width: auto; height: auto; object-fit: contain; }
.photographer-profile { display: grid; grid-template-columns: minmax(200px,330px) 1fr; gap: 36px; align-items: center; padding-top: 44px; }
.photographer-portrait { display: grid; place-items: center; min-height: 280px; border-radius: 14px; background: var(--cream); overflow: hidden; }
.photographer-portrait img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.photographer-identity { display: flex; align-items: center; gap: 15px; }
.photographer-identity img { max-width: 72px; max-height: 72px; object-fit: contain; }
.photographer-contact { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.photographer-contact a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--accent-deep); text-decoration: none; }
.photographer-contact a:hover { border-color: var(--accent); }
.profile-upload-preview { display: block; max-width: 160px; max-height: 160px; width: auto; height: auto; margin-top: 10px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; }
.header-basket { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); flex: none; }
.header-basket:hover { border-color: var(--accent); color: var(--accent-deep); }
.header-basket svg { width: 23px; height: 23px; }
.basket-count { position: absolute; top: -8px; right: -9px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; background: var(--accent-deep); color: #fff; font-size: 11px; font-weight: 800; }
.collection-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.collection-tag { display: inline-flex; align-items: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 8px; border-radius: 99px; background: #fff0df; color: #873b00; font-size: 11px; font-weight: 700; }
.detail-collections { margin: 15px 0; }
.detail-collections > strong { font-size: 13px; }
.photo-collection-picker { display: grid; gap: 12px; margin: 22px 0; padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: #fff8f1; }
.photo-collection-picker h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.photo-collection-picker form { display: grid; gap: 9px; }
.photo-collection-picker label { font-size: 13px; font-weight: 700; }
.photo-collection-picker select { width: 100%; min-height: 44px; padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.photo-collection-picker .muted { margin: 0; }
.search-filters { flex-wrap: wrap; }
.search-filters input { flex: 2 1 220px; }
.search-filters select { flex: 1 1 160px; }
.collection-visibility { display: inline-flex; width: fit-content; margin: 5px 0; padding: 5px 10px; border-radius: 999px; background: #fff0df; color: #a34800; font-size: 12px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.upload-progress { margin: 22px 0 60px; }
.upload-progress h2 { margin-top: 0; }
.upload-file-list { display: grid; gap: 10px; margin: 18px 0; padding: 0; list-style: none; }
.upload-file { padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.upload-file-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.upload-file-name { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.upload-file-status { flex: none; font-size: 13px; color: var(--muted); }
.upload-file progress { display: block; width: 100%; height: 10px; margin: 10px 0 4px; accent-color: var(--accent); }
.upload-file button { border: 0; background: none; padding: 6px 0; cursor: pointer; font: inherit; }
.upload-file[data-state="success"] { border-color: #98c9a8; background: #f2faf4; }
.upload-file[data-state="success"] .upload-file-status { color: #276040; }
.upload-file[data-state="failed"] { border-color: #dfaca2; background: #fff5f2; }
.upload-file[data-state="failed"] .upload-file-status { color: #a92f20; }
.upload-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.upload-progress[hidden], .upload-actions [hidden] { display: none; }
.form-page-upload { max-width: 720px; }
.form-page-profile { max-width: 800px; }
.legal-content { max-width: 900px; }
.error-page { margin-block: 80px; }

@media (max-width: 900px) {
    .header-inner { flex-wrap: wrap; column-gap: 16px; row-gap: 5px; padding-block: 10px; }
    .main-nav { order: 3; width: 100%; margin: 0; gap: 20px; overflow-x: auto; white-space: nowrap; }
    .main-nav a { white-space: nowrap; }
    .header-actions { margin-left: auto; }
}

@media (max-width: 700px) {
    .brand-logo { width: 40px; height: 32px; }
    .studio-shortcuts, .studio-edit-layout { grid-template-columns: 1fr; }
    .studio-photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
    .studio-photo-thumb { min-height: 150px; }
    .studio-photo-thumb img { max-width: min(100%,140px); max-height: 140px; }
    .studio-metrics { display: grid; gap: 2px; }
    .basket-line { display: grid; grid-template-columns: 75px 1fr; gap: 8px 14px; }
    .basket-line > strong, .basket-line > form { grid-column: 2; }
    .photographer-profile { grid-template-columns: 1fr; }
}
