/* Customer workspace: restrained surfaces, strong hierarchy, image-first layout.
   Scoped away from the universal viewer to preserve its dedicated dark workspace. */
:root {
    --bg-dark: #f7f7f9;
    --bg-surface: #fff;
    --bg-glass: #fff;
    --text-main: #202126;
    --text-muted: #64666f;
    --border-glass: #e7e7eb;
    --shadow-soft: 0 2px 8px #20212605;
}
body > .bg-blob { display: none; }
body > nav { min-height: 76px; padding: 14px 32px; background: #ffffffed; border-bottom: 1px solid var(--border-glass); }
body > nav .logo-symbol { width: 34px; height: 34px; filter: none; }
body > nav .logo-wordmark { font-size: 19px; }
body > nav .nav-links { gap: 6px; }
body > nav .nav-links a { padding: 10px 16px; white-space: nowrap; border-radius: 10px; font-size: 14px; }
body > nav .nav-links a.active { background: #f0efff; color: #5145cc; }
#header-user-name { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#user-profile-summary { position: relative; padding: 4px 8px !important; border: 0 !important; background: transparent !important; gap: 10px !important; }
#nav-admin-link { color: var(--text-main) !important; font-weight: 500 !important; }
#main-content { max-width: 1200px; margin: 0 auto; padding: 32px 32px 64px; }
#main-content > .view > header h2, #view-persons h2, #view-history h1, #view-pricing h1 {
    font-size: clamp(26px, 3vw, 36px) !important; letter-spacing: -.035em;
    background: none !important; -webkit-text-fill-color: currentColor !important;
}
#main-content > .view > header p, .studio-page-description { color: var(--text-muted); line-height: 1.55; margin: 8px 0 24px; }
#main-content .btn { border-radius: 12px; box-shadow: none; min-height: 42px; }
#main-content .btn:hover { transform: none; }
#main-content .glass-card { box-shadow: var(--shadow-soft); }
.studio-back { display: inline-block; color: var(--text-muted); text-decoration: none; margin-bottom: 24px; font-size: 14px; }
.studio-back:hover { color: var(--primary); }
:where(button, a, summary, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid #8277ee; outline-offset: 3px; }
#view-home { padding: 16px 0 0; text-align: left; }
#view-home > h1 { font-size: clamp(36px, 5vw, 58px); letter-spacing: -.055em; color: var(--text-main); background: none; -webkit-text-fill-color: currentColor; }
#view-home .hero-subtitle { margin: 12px 0 30px; max-width: none; font-size: 17px; }
#view-home .home-services-kicker { font-size: 11px; letter-spacing: .13em; color: var(--text-muted); margin-bottom: 16px; }
#view-home .home-services-kicker::before { display: none; }
.studio-services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.studio-service { background: #fff; border: 1px solid var(--border-glass); border-radius: 20px; overflow: hidden; text-decoration: none; color: var(--text-main); transition: border-color .2s, transform .2s; }
.studio-service:hover { border-color: #aaa2ec; transform: translateY(-3px); }
.studio-service > img, .studio-service-symbol { display: flex; width: 100%; height: 150px; object-fit: cover; align-items: center; justify-content: center; background: #e9e7f5; font-size: 70px; color: #6c628e; }
.studio-service:nth-child(2) .studio-service-symbol { background: #ede8df; color: #8c785c; }
.studio-service:nth-child(3) .studio-service-symbol { background: #e3ebef; color: #527889; }
.studio-service-symbol--poster { font-family: Georgia, serif; letter-spacing: -.1em; background: #eae8ee; }
.studio-service-symbol--poster::before { content: 'Aa'; }
.studio-service > div { padding: 20px; position: relative; }
.studio-service h2 { font-size: 18px; letter-spacing: -.025em; margin: 0 16px 8px 0; }
.studio-service p { color: var(--text-muted); font-size: 13px; line-height: 1.55; margin: 0; }
.studio-service > div > span { position: absolute; right: 16px; top: 20px; color: var(--text-muted); }
.studio-home-links { display: flex; align-items: center; gap: 24px; margin: 24px 0 36px; }
.studio-home-links a { text-decoration: none; color: var(--text-muted); font-size: 14px; }
.studio-home-links a:first-child { color: var(--primary); font-weight: 600; }
.studio-walkthrough { border-top: 1px solid var(--border-glass); padding-top: 20px; }
.studio-walkthrough > summary { cursor: pointer; color: var(--text-muted); font-size: 14px; width: fit-content; }
.studio-walkthrough .home-services { margin-top: 24px; }
/* Compact existing guided flows without altering generation state or billing. */
.wizard-container { max-width: 940px; }
.wizard-content { padding: 24px !important; border-radius: 18px !important; }
.wizard-content > div:first-child { margin-bottom: 20px !important; }
.wizard-steps { margin: 16px auto 24px !important; }
.wizard-steps .step { width: auto; min-width: 70px; height: auto; min-height: 34px; border: 0; border-radius: 9px; padding: 8px 10px; font-size: 12px; white-space: nowrap; }
.wizard-steps .step-line { max-width: 32px; }
#restore-upload-zone { padding: 28px 20px !important; border-radius: 14px !important; }
#restore-upload-placeholder > div:first-child { font-size: 32px !important; margin-bottom: 8px !important; }
.wizard-actions, .restore-wizard-actions { margin-top: 16px !important; position: sticky; bottom: 12px; background: #f7f7f9f5; padding: 12px 0; z-index: 3; }
#wizard-content .persons-horizontal-list { max-height: 260px; overflow-y: auto; }
#wizard-saved-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)); grid-template-rows: none; grid-auto-flow: row; padding: 8px; gap: 10px; }
#wizard-saved-list .person-card-mini { width: 100%; font: inherit; color: var(--text-main); }
#wizard-saved-list .name { display: block; font-size: 12px; }
.studio-person-search { max-width: 320px; margin-bottom: 12px; }
.studio-chosen-people { display: grid; gap: 10px; }
.studio-chosen-person { border: 1px solid var(--border-glass); border-radius: 12px; padding: 12px; background: #fff; }
.studio-chosen-person summary { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; }
.studio-chosen-person summary img { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; }
.studio-chosen-person summary span { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.studio-chosen-person summary::after { content: '⌄'; color: var(--text-muted); }
.studio-chosen-person[open] summary::after { content: '⌃'; }
#wizard-next { margin-left: auto; }
.studio-chosen-person label { display: block; margin: 16px 0 8px; font-size: 13px; }
.studio-chosen-person .btn { margin-top: 8px; padding: 6px 10px; font-size: 12px; }
.wizard-steps[hidden] { display: none !important; }
.wizard-actions button:disabled, .restore-wizard-actions button:disabled { opacity: .45; cursor: not-allowed; }
#view-change-image .change-image-model-selector { margin-bottom: 16px; }
/* Library: the photo, not its metadata, is the main target. */
#view-history > .container { max-width: none !important; margin: 0 auto !important; }
#view-history h1 { margin-bottom: 8px !important; }
#history-generations-container > .glass-card { padding: 0 !important; border: 0; background: none; }
#gen-history-list { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px !important; align-items: start; }
.history-card { position: relative; padding: 0 !important; border: 1px solid var(--border-glass); border-radius: 18px; overflow: visible; background: white; box-shadow: none !important; }
.history-card .hc-top-row { display: flex; flex-direction: column; padding: 0; gap: 0; }
.history-card .hc-thumb-wrapper { width: 100%; height: 230px; border-radius: 18px 18px 0 0; overflow: hidden; background: #eaeaec; flex: none; }
.hc-open-image { width: 100%; height: 100%; border: 0; background: transparent; padding: 0; cursor: zoom-in; display: block; }
.history-card .hc-thumb-wrapper img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.history-card .hc-thumb-placeholder { width: 100%; height: 100%; }
.history-card .hc-info-col { width: 100%; padding: 16px 16px 12px; }
.history-card .hc-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; font-size: 14px; line-height: 1.45; }
.history-card .hc-service-icon { display: none; }
.history-card .hc-meta-row { margin: 10px 0 6px; }
.history-card .hc-meta-row > span { text-transform: none !important; font-weight: 500 !important; }
.history-card .hc-time { font-size: 11px; color: var(--text-muted); }
.history-card .hc-action-row { flex-wrap: wrap; padding: 10px 16px; min-height: 54px; justify-content: flex-start; border-top: 1px solid var(--border-glass); }
.history-card .hc-action-row button { border-radius: 8px; min-height: 34px; font-size: 12px; }
.history-card .hc-btn-fix { background: #f1f0fa; color: #574da3; box-shadow: none; }
.studio-more { position: relative; margin-left: auto; }
.studio-more > summary { list-style: none; cursor: pointer; width: 34px; height: 34px; display: grid; place-items: center; font-size: 20px; border-radius: 8px; }
.studio-more > summary::-webkit-details-marker { display: none; }
.studio-more[open] > summary { background: #f1f0fa; }
.studio-more > div { position: absolute; right: 0; top: 38px; z-index: 6; min-width: 160px; background: white; border: 1px solid var(--border-glass); border-radius: 12px; padding: 6px; box-shadow: 0 8px 24px #0002; }
.studio-more > div button { width: 100%; justify-content: flex-start; padding: 10px !important; border: 0; background: none; color: var(--text-main); }
.studio-more > div button:hover { background: #f7f7f9; }
.studio-more .hc-btn-delete { color: #ae3434 !important; margin: 0 !important; opacity: 1 !important; }
.studio-status-note { font-size: 12px; color: #7c5b20; line-height: 1.5; }
.studio-load-error { grid-column: 1 / -1; padding: 20px; border: 1px solid var(--border-glass); border-radius: 12px; }
#view-persons .person-card { box-shadow: none; border: 1px solid var(--border-glass); }
#view-persons .person-card-name { font-size: 16px; }
@media (max-width: 1000px) {
    body > nav { padding: 12px 20px; }
    #header-user-name { display: none; }
    body > nav .nav-links a { padding: 10px; }
    .studio-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #gen-history-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    body > nav { min-height: 64px; flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
    body > nav .logo-wordmark { font-size: 16px; }
    body > nav .logo-symbol { width: 28px; height: 28px; }
    body > nav .header-actions { margin-left: auto; gap: 6px !important; }
    body > nav .lang-switch { display: flex !important; }
    body > nav .lang-btn { padding: 5px !important; font-size: 10px !important; }
    #header-user-credits { display: none; }
    body > nav .mobile-menu-btn { display: inline-flex !important; }
    body > nav .nav-links { position: static; display: none; order: 3; flex: 1 0 100%; padding: 6px 0; box-shadow: none; background: transparent; border: 0; flex-direction: row; justify-content: space-between; }
    body > nav .nav-links.active { display: flex; }
    body > nav .nav-links .lang-switch { flex-shrink: 0; }
    body > nav .nav-links a { padding: 8px 6px; font-size: 12px; }
    #main-content { padding: 24px 16px 40px; }
    #view-home { padding-top: 0; }
    #view-home > h1 { font-size: 38px; }
    #view-home .hero-subtitle { font-size: 15px; margin-bottom: 24px; }
    .studio-services { gap: 12px; }
    .studio-service > img, .studio-service-symbol { height: 100px; font-size: 46px; }
    .studio-service > div { padding: 14px; }
    .studio-service h2 { font-size: 15px; margin-right: 10px; }
    .studio-service p { font-size: 12px; }
    .studio-service > div > span { right: 10px; top: 14px; font-size: 12px; }
    .studio-home-links { gap: 16px; flex-wrap: wrap; }
    .studio-home-links a { font-size: 13px; }
    .wizard-content { padding: 18px !important; }
    .wizard-steps { gap: 4px; flex-wrap: wrap; }
    .wizard-steps .step { min-width: 0; font-size: 10px; padding: 7px; }
    .wizard-steps .step-line { max-width: 10px; }
    #gen-history-list { grid-template-columns: 1fr; }
    .history-card .hc-thumb-wrapper { height: 300px; }
    #notification-dropdown { width: min(320px, calc(100vw - 32px)) !important; right: -60px !important; }
    #user-dropdown { max-width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) {
    #main-content *, body > nav * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
