/* Shared finish for authenticated dialogs, including legacy modal surfaces.
   Geometry, save handlers, inspectors and image canvases keep their own layout. */
body:has(.app-shell) :is(.plan-dialog,.app-confirm,dialog,.project-photos-picker,.task-detail-dialog,.ol-dialog-surface),
body:has(.app-shell) .fixed.inset-0 > [class*="max-w-"][class*="bg-"] {
  --dialog-surface:var(--ui-surface,#fff); --dialog-soft:var(--ui-soft,#f3f5f8); --dialog-line:var(--ui-line,#e5e9ef); --dialog-ink:var(--ui-ink,#172334); --dialog-muted:var(--ui-muted,#657184);
  border-radius:var(--ui-radius-surface,8px); border-color:var(--dialog-line)!important; background-color:var(--dialog-surface)!important; color:var(--dialog-ink)!important; box-shadow:0 16px 48px rgb(8 16 28 / .18)!important;
}
body:has(.app-shell) :is(dialog,.plan-dialog,.project-photos-picker,.ol-dialog-surface) :is(h1,h2,h3) { font-weight:600; letter-spacing:normal; text-transform:none; font-style:normal; line-height:1.4; }
body:has(.app-shell) :is(dialog,.plan-dialog,.project-photos-picker,.ol-dialog-surface) :is(h1,h2) { font-size:20px; }
body:has(.app-shell) :is(dialog,.plan-dialog,.project-photos-picker,.ol-dialog-surface) :is(button,a,select,input:not([type=checkbox]):not([type=radio]):not([type=range])) { min-height:44px; border-radius:var(--ui-radius-control,5px); }
body:has(.app-shell) :is(dialog,.plan-dialog,.project-photos-picker,.ol-dialog-surface) :is(input,textarea,select) { font-size:16px; }
body:has(.app-shell) :is(dialog,.plan-dialog,.project-photos-picker,.ol-dialog-surface) :is(button,a,input,textarea,select):focus-visible { outline:2px solid var(--ui-blue,#2463eb); outline-offset:3px; }
body:has(.app-shell) :is(dialog,.plan-dialog,.project-photos-picker,.ol-dialog-surface) :is(.font-black,.font-extrabold) { font-weight:600; }
body:has(.app-shell) :is(dialog,.plan-dialog,.project-photos-picker,.ol-dialog-surface) :is(.uppercase,.italic) { text-transform:none; font-style:normal; letter-spacing:normal; }
body:has(.app-shell) :is(dialog,.plan-dialog,.project-photos-picker,.ol-dialog-surface) :is(.bg-gradient-to-r,.bg-gradient-to-br,.bg-gradient-to-b) { background-image:none; }
body:has(.app-shell) .plan-dialog>header { padding:16px 20px; }
body:has(.app-shell) .plan-dialog>footer { padding:12px 20px; background:var(--dialog-soft); }
body:has(.app-shell) .plan-dialog-content { padding:20px; }
body:has(.app-shell) .app-confirm { border:1px solid var(--dialog-line); }
body:has(.app-shell) dialog::backdrop { background:rgb(8 16 28 / .48); backdrop-filter:none; }
body:has(.app-shell) :is(.plan-dialog-overlay,.project-photos-picker-overlay) { background:rgb(8 16 28 / .48); backdrop-filter:none; }
@media(max-width:767px){body:has(.app-shell) .plan-dialog:not(.is-compact),body:has(.app-shell) .task-detail-dialog{border-radius:0}body:has(.app-shell) .plan-dialog>header{padding:max(16px,env(safe-area-inset-top)) 16px 16px}body:has(.app-shell) .plan-dialog>footer{padding:12px 16px max(12px,env(safe-area-inset-bottom))}body:has(.app-shell) .plan-dialog-content{padding:16px}}
@media(prefers-reduced-motion:reduce){body:has(.app-shell) :is(dialog,.plan-dialog,.project-photos-picker,.ol-dialog-surface){animation:none!important;transition:none!important}}

@media(max-width:767px){body:has(.app-shell) .ol-dialog-surface[class*="h-[100dvh]"]{border-radius:0}}

body:has(.app-shell) :is(dialog,.plan-dialog,.ol-dialog-surface) select:not([multiple]) { appearance:none; height:44px; padding-right:32px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23657184' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 10px center; }
@media(prefers-reduced-motion:reduce){body:has(.app-shell) :is(.task-form-overlay,.task-form-dialog){opacity:1!important;transform:none!important;animation:none!important;transition:none!important}}

.ol-gallery { --gallery-ink:#172334; --gallery-muted:#657184; --gallery-line:#e5e9ef; --gallery-surface:#fff; --gallery-soft:#f3f5f8; position:fixed; inset:0; z-index:100000; display:flex; flex-direction:column; color:var(--gallery-ink); background:var(--gallery-surface)!important; outline:none; }
.dark .ol-gallery { --gallery-ink:#edf2f9; --gallery-muted:#a2aec0; --gallery-line:#2b3748; --gallery-surface:#151f2e; --gallery-soft:#0d1623; }
.ol-gallery-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:max(12px,env(safe-area-inset-top)) 20px 12px; border-bottom:1px solid var(--gallery-line); flex-shrink:0; background:var(--gallery-surface); }
.ol-gallery-title { min-width:0; }
.ol-gallery-title h2 { margin:0; font-size:18px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ol-gallery-title>span { display:block; margin-top:3px; font-size:13px; color:var(--gallery-muted); }
.ol-gallery-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.ol-gallery :is(button,a,summary) { min-width:44px; min-height:44px; display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:8px 12px; border:1px solid var(--gallery-line); border-radius:var(--ui-radius-control,5px); background:var(--gallery-surface); color:var(--gallery-ink); font-size:14px; cursor:pointer; }
.ol-gallery button:disabled { opacity:.5; cursor:wait; }
.ol-gallery :is(button,a,summary):hover { background:var(--gallery-soft); }
.ol-gallery :is(button,a,summary):focus-visible { outline:2px solid #2463eb; outline-offset:3px; }
.ol-gallery-body { display:flex; flex:1; min-height:0; }
.ol-gallery-workspace { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; background:#101827; }
.ol-gallery-stage { flex:1; min-height:0; }
.ol-gallery-stage .interactive-image-canvas { height:calc(100% - 64px); align-self:flex-start; }
.ol-gallery-thumbnails { display:flex; justify-content:flex-start; flex-shrink:0; gap:8px; padding:10px 16px max(10px,env(safe-area-inset-bottom)); overflow:auto; border-top:1px solid #344157; background:#162132; }
.ol-gallery-thumbnails>button { padding:0; min-width:64px; width:64px; height:52px; border:2px solid transparent; background:#101827; overflow:hidden; flex-shrink:0; }
.ol-gallery-thumbnails>button[aria-pressed=true] { border-color:#8bb4ff; }
.ol-gallery-thumbnails img { width:100%; height:100%; object-fit:cover; }
.ol-gallery-details { width:280px; flex-shrink:0; border-left:1px solid var(--gallery-line); padding:20px; background:var(--gallery-surface); overflow:auto; }
.ol-gallery-details-heading { display:flex; justify-content:space-between; align-items:center; }
.ol-gallery-details-heading h3 { font-size:16px; font-weight:600; }
.ol-gallery-details-heading>button,.ol-gallery-actions .ol-gallery-info-toggle { display:none; }
.ol-gallery-details dl>div { padding:16px 0; border-bottom:1px solid var(--gallery-line); }
.ol-gallery-details dt { font-size:12px; color:var(--gallery-muted); margin-bottom:6px; }
.ol-gallery-details dd { font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
.ol-gallery-caption { font-size:14px; line-height:1.6; white-space:pre-wrap; margin-top:16px; }
.ol-gallery-hint { margin-top:24px; font-size:12px; line-height:1.6; color:var(--gallery-muted); }
.ol-gallery-message { padding:10px 20px; background:var(--gallery-soft); color:var(--gallery-ink); font-size:14px; }
.ol-gallery-message.is-error { color:#b42318; }
.dark .ol-gallery-message.is-error { color:#ffb1a7; }
.ol-gallery-menu { position:relative; }
.ol-gallery-menu>summary { list-style:none; }
.ol-gallery-menu>summary::-webkit-details-marker { display:none; }
.ol-gallery-menu>div { position:absolute; z-index:10; top:calc(100% + 6px); right:0; width:240px; padding:6px; border:1px solid var(--gallery-line); border-radius:8px; background:var(--gallery-surface); box-shadow:0 8px 24px rgb(0 0 0 / .16); }
.ol-gallery-menu>div :is(button,a) { width:100%; justify-content:flex-start; border:0; text-align:left; }
.ol-gallery-menu .is-danger { color:#b42318; }
.dark .ol-gallery-menu .is-danger { color:#ffb1a7; }
@media(max-width:1023px){.ol-gallery-details{display:none}.ol-gallery-details.is-open{display:block;position:absolute;z-index:50;inset:80px 0 0 auto;width:min(360px,100%);box-shadow:-8px 0 28px rgb(0 0 0 / .2);padding-bottom:max(20px,env(safe-area-inset-bottom))}.ol-gallery-details-heading>button,.ol-gallery-actions .ol-gallery-info-toggle{display:inline-flex}}
@media(max-width:600px){.ol-gallery-header{padding: max(10px,env(safe-area-inset-top)) 12px 10px;gap:8px}.ol-gallery-actions{gap:4px}.ol-gallery-actions :is(button,a,summary){padding:8px;min-width:44px}.ol-gallery-actions :is(button,a)>span{display:none}.ol-gallery-title h2{font-size:15px}.ol-gallery-title>span{font-size:12px}.ol-gallery-thumbnails>button{width:56px;min-width:56px;height:48px}}

.ol-gallery-thumbnails>button{position:relative}.ol-gallery-thumb-number{position:absolute;color:#edf2f9;font-size:13px}.ol-gallery-thumbnails img{position:relative}.ol-gallery-thumbnails img[data-failed=true]{visibility:hidden}

@media(min-width:601px){.ol-gallery-mobile-action,.ol-gallery .ol-gallery-menu>div .ol-gallery-mobile-action,.ol-gallery-mobile-menu{display:none}}
@media(max-width:600px){.ol-gallery .ol-gallery-download,.ol-gallery .ol-gallery-annotate{display:none}}

.ol-gallery-unavailable{display:flex;flex:1;align-items:center;justify-content:center;flex-direction:column;gap:16px;padding:24px;color:var(--gallery-muted);text-align:center}

.interactive-image-viewer .interactive-image-controls { display:flex; gap:4px; padding:4px; min-height:52px; border:1px solid #344157; border-radius:5px; background:#162132; box-shadow:none; backdrop-filter:none; white-space:nowrap; }
.interactive-image-controls :is(button,a) { display:inline-flex; align-items:center; justify-content:center; min-height:44px; min-width:44px; padding:8px; border:0; border-radius:5px; background:transparent; color:#edf2f9; font-size:13px; }
.interactive-image-controls button:disabled { color:#a2aec0; opacity:.55; }
.interactive-image-controls button:focus-visible,.interactive-image-navigation:focus-visible { outline:2px solid #8bb4ff; outline-offset:2px; }
.interactive-image-controls button:hover { background:#29384e; }
.interactive-image-viewer .ol-gallery-controls { bottom:8px; }
.interactive-image-navigation { position:absolute; z-index:20; top:calc(50% - 22px); display:grid; place-items:center; width:44px; height:44px; border:1px solid #64748b; border-radius:5px; background:#162132; color:#edf2f9; }
.interactive-image-navigation.is-prev { left:12px; }.interactive-image-navigation.is-next { right:12px; }
.interactive-image-feedback { position:absolute; z-index:5; inset:0 0 64px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; color:#edf2f9; background:#101827; font-size:14px; }
.interactive-image-feedback button { min-height:44px; padding:8px 16px; border:1px solid #64748b; border-radius:5px; color:#edf2f9; }
@media(prefers-reduced-motion:reduce){.interactive-image-viewer *{transition:none!important;animation:none!important}}

.project-overview-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:24px 0; color:var(--ui-ink,#172334); }
.project-overview-summary>section { border:1px solid var(--ui-line,#e5e9ef); border-radius:8px; background:var(--ui-surface,#fff); padding:16px 20px; min-width:0; }
.project-overview-summary>section:last-child:nth-child(3) { grid-column:1 / -1; }
.project-overview-summary header { display:flex; gap:12px; justify-content:space-between; align-items:center; min-height:44px; margin-bottom:8px; }
.project-overview-summary h2 { font-size:17px; font-weight:600; }
.project-overview-summary header>span { color:var(--ui-muted,#657184); font-size:13px; }
.project-overview-rows { max-height:340px; overflow:auto; overscroll-behavior:contain; }
.project-overview-rows>a { display:flex; flex-direction:column; gap:4px; min-height:64px; padding:12px 0; border-bottom:1px solid var(--ui-line,#e5e9ef); overflow-wrap:anywhere; }
.project-overview-rows>a:last-child { border:0; }
.project-overview-rows strong { font-weight:600; font-size:14px; }
.project-overview-rows :is(span,small,p) { font-size:13px; color:var(--ui-muted,#657184); line-height:1.5; }
.project-overview-rows .is-overdue { color:#b42318; }.dark .project-overview-rows .is-overdue { color:#ffb1a7; }
.project-overview-summary :is(button,.project-overview-all) { display:inline-flex; align-items:center; min-height:44px; padding:8px 0; color:var(--ui-blue,#2463eb); font-size:13px; }
.project-overview-empty { padding:20px 0; color:var(--ui-muted,#657184); font-size:14px; }
.project-overview-summary :focus-visible { outline:2px solid var(--ui-blue,#2463eb); outline-offset:3px; }
.project-workspace-nav section { margin-top:16px; }.project-workspace-nav section h2 { font-weight:600; margin-bottom:4px; }
.project-workspace-nav a { overflow-wrap:anywhere; flex-shrink:0; }.project-workspace-nav>a,.project-workspace-nav section>a { min-height:44px; }
@media(min-width:1024px) and (pointer:fine){.has-project-workspace .mobile-project-page>main>div:first-child>div>div{flex-direction:column;align-items:flex-start}.has-project-workspace .mobile-project-page h1{max-width:none;font-size:28px}.has-project-workspace .project-home-actions{justify-content:flex-start}}
@media(max-width:767px){.project-overview-summary{grid-template-columns:minmax(0,1fr)}.project-overview-summary>section:last-child:nth-child(3){grid-column:auto}}

@media(min-width:1280px){.project-overview-summary{grid-template-columns:minmax(0,1.2fr) repeat(2,minmax(0,1fr))}.project-overview-summary>section:last-child:nth-child(3){grid-column:auto}}
.has-project-workspace .project-home-actions a[href*="/client-space?invite="]{background:var(--ui-surface,#fff)!important;color:var(--ui-blue,#2463eb)!important;border:1px solid var(--ui-line,#e5e9ef)}
