/* Shared page anatomy follows the approved Gallery workbench. Controllers keep
   ownership of every form, list, dialog and photo-layout container. */
.workspace { padding:0; }
.workspace .workspace-topbar { height:54px; padding:0 22px; }
.workspace-breadcrumb { overflow:hidden; }
.workspace-breadcrumb>[aria-current=page] { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#route-content[data-screen] { border-radius:10px 0 0; border-right:0; border-bottom:0; min-height:calc(100dvh - 54px); }
#route-content[data-screen]:not([data-screen=gallery]) { --page-gutter:24px; padding:0 var(--page-gutter) 40px; }
#route-content[data-screen]:not([data-screen=gallery])>.page-header {
 min-height:82px; padding:18px var(--page-gutter); margin:0 calc(-1 * var(--page-gutter)) 0;
 border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:16px;
}
#route-content[data-screen]:not([data-screen=gallery])>.page-header>div:first-child { padding-left:51px; position:relative; min-width:0; }
#route-content[data-screen]:not([data-screen=gallery])>.page-header>div:first-child::before {
 content:''; position:absolute; left:0; top:5px; width:38px; height:38px; border-radius:7px; background:var(--accent-soft);
}
#route-content[data-screen]:not([data-screen=gallery])>.page-header h1 { font-size:21px; line-height:1.3; margin:0; letter-spacing:-.5px; overflow-wrap:anywhere; }
#route-content[data-screen]:not([data-screen=gallery])>.page-header h1::before {
 content:''; position:absolute; top:13px; left:8px; width:22px; height:22px; background:var(--muted);
 mask:var(--screen-icon) center / contain no-repeat;
}
#route-content[data-screen]:not([data-screen=gallery])>.page-header p { font-size:11px; color:var(--muted); margin-top:5px; }
#route-content[data-screen=galleries],#route-content[data-screen=archive],#route-content[data-screen=trash] {
 --screen-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.65' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h18v18H3zM3 16l5-5 4 4 4-6 5 7M8 7h.01'/%3E%3C/svg%3E");
}
#route-content[data-screen=archive] { --screen-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.65'%3E%3Cpath d='M3 3h18v5H3zM5 8v13h14V8M9 12h6'/%3E%3C/svg%3E"); }
#route-content[data-screen=trash] { --screen-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.65' stroke-linecap='round'%3E%3Cpath d='M3 6h18M9 6V3h6v3M5 6l1 15h12l1-15M10 10v7M14 10v7'/%3E%3C/svg%3E"); }
#route-content[data-screen=notifications] { --screen-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.65' stroke-linecap='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9ZM10 21h4'/%3E%3C/svg%3E"); }
#route-content[data-screen=statistics] { --screen-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.65' stroke-linecap='round'%3E%3Cpath d='M4 3v18h17M9 16v-5M14 16V6M19 16v-8'/%3E%3C/svg%3E"); }
#route-content[data-screen=account] { --screen-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.65' stroke-linecap='round'%3E%3Cpath d='M12 3a4 4 0 1 0 0 8 4 4 0 0 0 0-8ZM4 21v-3a8 8 0 0 1 16 0v3'/%3E%3C/svg%3E"); }
#route-content[data-screen]:not([data-screen=gallery])>.tabs { padding:0 var(--page-gutter); margin:0 calc(-1 * var(--page-gutter)) 24px; gap:24px; min-height:58px; display:flex; align-items:stretch; }
#route-content[data-screen]:not([data-screen=gallery])>.tabs>a { display:flex; align-items:center; padding:0; min-height:58px; font-size:12px; white-space:nowrap; }
/* List workspaces have the same slim property/toolbar separation as photos. */
#route-content[data-screen]>.admin-summary { min-height:52px; align-items:center; padding:12px var(--page-gutter); margin:0 calc(-1 * var(--page-gutter)) 0; gap:24px; background:var(--surface-alt); }
#route-content[data-screen]>.admin-list-tools { min-height:70px; margin:0 0 20px; padding:16px 0; border-bottom:1px solid var(--border); }
#route-content[data-screen] .admin-gallery-card { overflow:visible; border:0; background:transparent; }
#route-content[data-screen] .admin-gallery-cover { border:0; border-radius:7px; }
#route-content[data-screen] .admin-gallery-copy { padding:13px 0; }
#route-content[data-screen] .admin-gallery-title { font-weight:500; font-size:13px; }
#route-content[data-screen] .admin-gallery-foot { margin-top:13px; padding-top:10px; border-top:1px solid var(--border); }
#route-content[data-screen] .gallery-table-wrap { border:1px solid var(--border); border-radius:7px; }
#route-content[data-screen] .gallery-table th { background:var(--surface-alt); }
#route-content[data-screen] .gallery-table td { height:64px; }
#route-content[data-screen] .gallery-table tfoot td { height:42px; background:var(--surface-alt); }
#route-content[data-screen] .empty-state { border:0; border-radius:0; padding:60px 22px; min-height:280px; }
#route-content[data-screen] .empty-state>svg,#route-content[data-screen] .empty-icon { width:38px; height:38px; padding:8px; border-radius:7px; background:var(--accent-soft); color:var(--muted); margin-bottom:16px; }
#route-content[data-screen] .empty-state h2,#route-content[data-screen] .empty-state h3 { font-size:16px; font-weight:500; }
/* Notifications are a single coherent inbox rather than separate floating cards. */
#route-content[data-screen=notifications] [data-notifications-content]>.admin-section-heading { min-height:50px; margin-bottom:14px; }
#route-content[data-screen=notifications] [data-notifications-content]>.admin-section-heading h2 { font-size:13px; font-weight:500; color:var(--muted); }
.notification-list { border:1px solid var(--border); border-radius:7px; overflow:hidden; }
.notification-item { border:0; border-bottom:1px solid var(--border); border-radius:0; box-shadow:none; padding:19px 18px; background:var(--surface); }
.notification-item:last-child { border-bottom:0; }
.notification-item.unread { background:var(--surface-alt); border-left:2px solid var(--muted); padding-left:16px; }
.notification-symbol { display:grid; place-items:center; width:36px; height:36px; background:var(--accent-soft); color:var(--muted); border-radius:7px; flex-shrink:0; }
.notification-symbol svg { width:18px; height:18px; }
.notification-item strong { font-size:12px; font-weight:500; }
.notification-item small { color:var(--muted); font-size:10px; }
.notification-item p { font-size:12px; }
.notification-settings .features-columns { grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); gap:0; border:1px solid var(--border); border-radius:7px; overflow:hidden; }
.notification-settings .features-columns>.surface { border:0; border-radius:0; padding:24px; background:var(--surface); }
.notification-settings .features-columns>.surface+section { border-left:1px solid var(--border); background:var(--surface-alt); }
/* Analytics, profile and preferences use the same property surfaces. */
#route-content[data-screen=statistics]>.toolbar { margin:0 calc(-1 * var(--page-gutter)) 24px; padding:16px var(--page-gutter); border-bottom:1px solid var(--border); background:var(--surface-alt); }
#route-content[data-screen=statistics]>.toolbar>.ui-select { min-width:180px; width:auto; }
.admin-metrics { border:1px solid var(--border); border-radius:7px; gap:0; overflow:hidden; margin-bottom:24px; }
.admin-metrics>.surface { background:var(--surface-alt); border:0; border-radius:0; border-right:1px solid var(--border); padding:22px; }
.admin-metrics>.surface:last-child { border-right:0; }
.admin-metrics strong { font-size:28px; font-weight:500; }
.admin-chart,.admin-statistics-table { border-radius:7px; background:var(--surface); padding:22px; border:1px solid var(--border); }
.admin-statistics-table h2,.admin-chart h2,.admin-stat-events>h2 { font-size:14px; font-weight:500; }
.admin-statistics-table table th { background:var(--surface-alt); font-size:11px; }
.admin-statistics-table td { font-size:12px; }
.admin-events>article { box-shadow:none; border-radius:0; border-bottom:1px solid var(--border); }
#route-content[data-screen=account] .profile-layout { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); gap:0; border:1px solid var(--border); border-radius:7px; overflow:hidden; align-items:stretch; }
#route-content[data-screen=account] .profile-layout>.surface { padding:24px; background:var(--surface); border:0; border-radius:0; }
#route-content[data-screen=account] .profile-layout>.surface+section { background:var(--surface-alt); border-left:1px solid var(--border); }
#route-content[data-screen=account] .account-content>section { background:var(--surface-alt); border-color:var(--border); padding:24px; }
#route-content[data-screen=account] .profile-layout h2,#route-content[data-screen=account] .account-content>section h2,.notification-settings h2 { font-size:15px; font-weight:600; }
#route-content[data-screen=account] .avatar-editor { border-bottom:1px solid var(--border); padding-bottom:22px; margin-bottom:2px; }
#route-content[data-screen=account] .profile-layout fieldset { border:1px solid var(--border); border-radius:6px; padding:16px; }
#route-content[data-screen=account] .profile-layout legend { font-size:11px; color:var(--muted); padding:0 6px; }
#route-content[data-screen=account] .check-line { font-size:12px; }
#route-content[data-screen=account] .theme-grid { gap:16px; }
#route-content[data-screen=account] .theme-card { border:1px solid var(--border); background:var(--surface); padding:12px; border-radius:7px; }
#route-content[data-screen=account] .theme-card.selected { outline:1px solid var(--text); outline-offset:0; }
#route-content[data-screen=account] .theme-card strong { font-size:12px; font-weight:500; }
#route-content[data-screen=account] .save-bar,.notification-settings .save-bar { border-radius:7px; background:var(--surface); border:1px solid var(--border); box-shadow:0 3px 12px #00000006; padding:14px 18px; margin-top:22px; }
/* Public chrome shares the same hierarchy without adding owner navigation. */
.client-topbar { background:var(--surface); border-bottom:1px solid var(--border); min-height:70px; }
.client-brand { font-size:17px; letter-spacing:-.4px; }
.client-topbar-actions .btn { min-height:34px; border:1px solid var(--border); background:var(--surface); border-radius:6px; }
.client-main { padding-top:28px; }
.client-section-heading { padding-bottom:20px; border-bottom:1px solid var(--border); margin-bottom:0; }
.client-section-heading h2 { font-size:20px; letter-spacing:-.4px; }
.client-section-heading h2 span { font-size:12px; margin-left:7px; }
.client-selection-lists { border-radius:6px; }
.client-filterbar { border-top:0; border-bottom:1px solid var(--border); padding:16px 0; margin-bottom:22px; }
.client-filter { min-height:34px; border-radius:6px; font-weight:400; }
.client-filter.active { border:1px solid var(--border); background:var(--accent-soft); }
.client-selection-panel { background:var(--surface); box-shadow:0 4px 18px #0000000a; border:1px solid var(--border); border-radius:7px; }
.client-footer { background:var(--surface); }
.client-access-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; box-shadow:none; }
.client-access-card h1 { font-size:24px; letter-spacing:-.5px; }
.auth-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:28px; box-shadow:none; }
.auth-card h2 { font-size:21px; }
.auth-card form { margin-top:24px; }
.auth-intro,.auth-panel { max-width:390px; }
.auth-switch { margin-bottom:0; }
/* Shared modals keep identical headers and commit/entry controls across routes. */
dialog.app-dialog .dialog-header { background:var(--surface); border-bottom:1px solid var(--border); padding:20px 22px; }
dialog.app-dialog .dialog-header h2 { font-size:17px; letter-spacing:-.3px; }
dialog.app-dialog .dialog-body { padding:22px; }
@media(max-width:1100px) {
 #route-content[data-screen]:not([data-screen=gallery]) { --page-gutter:20px; }
 #route-content[data-screen=account] .profile-layout { grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); }
 .admin-metrics>.surface { padding:18px; }
}
@media(max-width:820px) {
 .workspace .workspace-topbar { height:48px; padding:0 16px; }
 #route-content[data-screen] { border-radius:0; min-height:calc(100dvh - 48px); }
 #route-content[data-screen]:not([data-screen=gallery]) { --page-gutter:18px; }
 #route-content[data-screen]:not([data-screen=gallery])>.page-header { min-height:84px; }
 #route-content[data-screen=account] .profile-layout,.notification-settings .features-columns { grid-template-columns:1fr; }
 #route-content[data-screen=account] .profile-layout>.surface+section,.notification-settings .features-columns>.surface+section { border-left:0; border-top:1px solid var(--border); }
 #route-content[data-screen=account] .profile-layout>.surface,.notification-settings .features-columns>.surface { padding:20px; }
}
@media(max-width:600px) {
 #route-content[data-screen]:not([data-screen=gallery]) { --page-gutter:16px; }
 #route-content[data-screen]:not([data-screen=gallery])>.page-header { align-items:center; gap:10px; flex-wrap:wrap; padding-top:17px; padding-bottom:17px; }
 #route-content[data-screen]:not([data-screen=gallery])>.page-header>div:first-child { flex:1; min-width:170px; padding-left:44px; }
 #route-content[data-screen]:not([data-screen=gallery])>.page-header h1 { font-size:19px; }
 #route-content[data-screen]:not([data-screen=gallery])>.page-header>div:first-child::before { width:34px; height:34px; }
 #route-content[data-screen]:not([data-screen=gallery])>.page-header h1::before { width:19px; height:19px; top:12px; left:7px; }
 #route-content[data-screen]:not([data-screen=gallery])>.page-header p { font-size:10px; }
 #route-content[data-screen]:not([data-screen=gallery])>.page-header>.btn { min-height:38px; font-size:11px; }
 #route-content[data-screen]:not([data-screen=gallery])>.tabs { gap:20px; margin-bottom:18px; overflow:auto; }
 #route-content[data-screen]:not([data-screen=gallery])>.tabs>a { min-height:52px; }
 #route-content[data-screen]>.admin-summary { flex-wrap:wrap; gap:8px 20px; font-size:10px; min-height:52px; }
 #route-content[data-screen]>.admin-list-tools { margin-bottom:16px; gap:8px; }
 #route-content[data-screen] .admin-gallery-copy { padding:12px 0; }
 #route-content[data-screen] .gallery-table td { height:auto; }
 #route-content[data-screen] .gallery-table tfoot td { height:40px; }
 .admin-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .admin-metrics>.surface { padding:18px; border-bottom:1px solid var(--border); }
 .admin-metrics>.surface:nth-child(even) { border-right:0; }
 .admin-metrics strong { font-size:25px; }
 .admin-chart,.admin-statistics-table { padding:16px; }
 #route-content[data-screen=statistics]>.toolbar>.ui-select { min-width:0; flex:1; }
 #route-content[data-screen=account] .profile-layout>.surface,.notification-settings .features-columns>.surface { padding:18px; }
 #route-content[data-screen=account] .account-content>section { padding:18px; }
 #route-content[data-screen=account] .save-bar,.notification-settings .save-bar { padding:12px; gap:12px; }
 #route-content[data-screen=account] .save-bar>div { display:flex; justify-content:flex-end; gap:7px; flex-wrap:wrap; }
 .notification-item { padding:16px 12px; gap:11px; }
 .notification-item.unread { padding-left:10px; }
 .notification-symbol { width:30px; height:30px; }
 .notification-item .icon-button { width:34px; min-width:34px; min-height:34px; height:34px; }
 .client-topbar { padding:14px 16px; min-height:64px; }
 .client-topbar-actions .btn { min-width:36px; min-height:36px; padding:8px; }
 .client-main { padding-top:24px; }
 .client-section-heading h2 { font-size:18px; }
 .client-section-heading { padding-bottom:16px; }
 .client-filterbar { gap:10px; padding:14px 0; }
 .auth-page { padding:28px 18px; }
 .auth-card { padding:24px 20px; }
 dialog.app-dialog .dialog-header { padding:18px; }
 dialog.app-dialog .dialog-body { padding:18px; }
}
.workspace-topbar .workspace-navigation-toggle { flex-shrink:0; width:28px; min-width:28px; height:28px; min-height:28px; padding:6px; border-color:transparent; background:transparent; color:var(--muted); }
@media(max-width:760px) { .gallery-workbench-header .gallery-heading-title { flex:1 1 180px; } }
.workspace-navigation-toggle>svg { width:16px; height:16px; transform:rotate(90deg); }
.workspace-navigation-toggle[aria-expanded="false"]>svg { transform:rotate(-90deg); }
.workspace-topbar .workspace-breadcrumb { margin-right:auto; }
#app.workspace-nav-collapsed>.app-shell { grid-template-columns:minmax(0,1fr); }
#app .sidebar[hidden] { display:none; }
#route-content .gallery-properties[hidden] { display:none; }
#route-content.gallery-properties-collapsed .gallery-workbench-body { grid-template-columns:minmax(0,1fr); }
@media(min-width:1101px) {
 #route-content.gallery-properties-collapsed .gallery-workbench-body:has(.gallery-photo-inspector:not([hidden])) { grid-template-columns:minmax(0,1fr) clamp(220px,15.6vw,310px); }
}

.sidebar-quick-actions .notification-count {
 display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
 min-width:20px; height:20px; margin-left:auto; padding:0 5px;
 border-radius:5px; background:var(--accent-soft); color:var(--text);
 font-size:10px; font-weight:600; line-height:1; font-variant-numeric:tabular-nums;
}
.sidebar-quick-actions .notification-count[hidden] { display:none; }
.sidebar-quick-actions [data-notifications-link]>span:not(.notification-count) { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

#route-content[data-screen=galleries] { position:relative; }
.gallery-list-drop { position:absolute; inset:10px; z-index:26; display:none; border:2px dashed var(--text); border-radius:8px; background:var(--surface); pointer-events:none; }
[data-gallery-folder-drop]>.gallery-list-drop { display:block; }
.gallery-list-drop>div { position:sticky; top:20px; min-height:min(500px,calc(100dvh - 150px)); display:grid; align-content:center; justify-items:center; gap:14px; padding:24px; text-align:center; }
.gallery-list-drop svg { width:36px; height:36px; color:var(--muted); }
.gallery-list-drop strong { font-size:20px; font-weight:500; }
.gallery-list-drop span { font-size:13px; color:var(--muted); }

/* One shared intake form keeps all dropped gallery metadata visible together. */
dialog.app-dialog.folder-import-dialog { width:1040px; max-width:calc(100vw - 32px); }
.folder-import-form { display:grid; gap:18px; min-width:0; }
.folder-import-form>p { margin:0; }
.folder-import-list { min-width:0; max-height:calc(80dvh - 230px); overflow-y:auto; padding-right:4px; scrollbar-gutter:stable; }
.folder-import-row { padding:18px 0; border-bottom:1px solid var(--border); }
.folder-import-row:first-child { padding-top:0; }
.folder-import-source { display:flex; align-items:center; gap:9px; min-width:0; margin-bottom:13px; }
.folder-import-source svg { width:17px; height:17px; flex-shrink:0; color:var(--muted); }
.folder-import-source strong { font-size:13px; font-weight:500; overflow-wrap:anywhere; }
.folder-import-source>span { margin-left:auto; font-size:12px; white-space:nowrap; color:var(--muted); }
.folder-import-fields { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,1.25fr) minmax(0,1fr); gap:12px; border:0; padding:0; margin:0; min-width:0; }
.folder-import-fields .field { min-width:0; margin:0; font-size:12px; }
.folder-import-fields input,.folder-import-fields .ui-select { width:100%; min-width:0; box-sizing:border-box; }
.folder-import-fields:disabled { opacity:.65; }
.folder-import-row-status { margin:10px 0 0; font-size:12px; color:var(--muted); }
.folder-import-row-status.error { color:var(--danger); }
.folder-import-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.folder-import-footer>span { font-size:12px; }
.folder-import-footer .toolbar { flex-wrap:nowrap; margin:0; }
@media(max-width:760px) {
 .folder-import-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .folder-import-footer { align-items:stretch; flex-direction:column; gap:12px; }
 .folder-import-footer .toolbar { justify-content:flex-end; }
 .folder-import-list { max-height:calc(85dvh - 260px); }
}
@media(max-width:420px) {
 dialog.app-dialog.folder-import-dialog { max-width:calc(100vw - 16px); }
 .folder-import-fields { grid-template-columns:minmax(0,1fr); }
 .folder-import-footer .toolbar { flex-wrap:wrap; }
 .folder-import-footer [type="submit"] { flex:1; }
 .folder-import-source { flex-wrap:wrap; }
 .folder-import-list { max-height:calc(90dvh - 260px); }
}

.gallery-list-upload-actions { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:8px; margin-top:18px; }
.gallery-list-heading-actions { gap:8px; margin:0; flex-wrap:wrap; }
.gallery-list-heading-actions .gallery-list-upload-actions { margin:0; }
