/* Shared frame, dialog and selection presentation. No positioning changes to native/fullscreen dialogs. */ body.portal-layout  {
  --portal-gutter:clamp(16px,2vw,32px);
}
body.portal-layout > .app-shell > .hero  {
  padding:24px var(--portal-gutter) 20px;
}
body.portal-layout .main-panel  {
  padding-inline:var(--portal-gutter);
  padding-bottom:24px;
}
body.portal-layout .main-panel > :is(.crm-workspace,.calendar-workspace,.time-workspace,.project-workspace,.settings-workspace,.settings-shell,.settings-session-status,.todo-workspace,.tasks-workspace,.detail-layout,.user-workspace,.invoice-workspace,.wizard,.support-workspace,.placeholder)  {
  width:100%;
  max-width:none;
  margin-inline:0;
}
body.portal-layout .hero h1  {
  margin:8px 0 12px;
  font-size:clamp(1.65rem,3vw,2.5rem);
  line-height:1.2;
  overflow-wrap:break-word;
}
body.portal-layout .hero .eyebrow  {
  margin:0;
  color:var(--accent-text);
  font-size:.8rem;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}
body.portal-layout .hero .back-link  {
  margin-bottom:16px;
}
.notification-panel, .account-dropdown  {
  background:var(--panel);
}
.notification-panel [hidden]  {
  display:none;
}
:is(form.modal,.project-dialog,.workflow-dialog,.customer-removal-dialog)  {
  border-radius:var(--dialog-radius);
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--text);
  box-shadow:var(--shadow);
}
:is(form.modal,.project-dialog,.workflow-dialog,.customer-removal-dialog) :is(.btn,.icon-btn,.icon-button,.close)  {
  min-height:44px;
}
:is(form.modal,.project-dialog,.workflow-dialog,.customer-removal-dialog) :is(.icon-btn,.icon-button,.close)  {
  min-width:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
:is(form.modal,.project-dialog,.workflow-dialog,.customer-removal-dialog) > :is(header,form>header)  {
  padding:20px 24px;
  border-bottom:1px solid var(--line);
  gap:16px;
}
:is(form.modal,.project-dialog,.workflow-dialog,.customer-removal-dialog) :is(header h2,header h3)  {
  margin:0;
  font-size:1.25rem;
  line-height:1.3;
}
:is(form.modal,.project-dialog,.workflow-dialog,.customer-removal-dialog) :is(.modal-body,.dialog-content)  {
  padding:24px;
}
:is(form.modal,.project-dialog,.workflow-dialog,.customer-removal-dialog) :is(footer,.modal-footer)  {
  padding:16px 24px;
  gap:12px;
  border-top:1px solid var(--line);
}
:is(form.modal,.project-dialog,.workflow-dialog,.customer-removal-dialog) .btn.secondary  {
  background:var(--panel-2);
  border:1px solid var(--line);
  color:var(--text);
}
body .btn.danger, body .btn.btn-danger, body .customer-removal-delete  {
  background:var(--danger);
  color:var(--on-accent);
  border-color:var(--danger);
}
body :is(.view-switch,.task-presentation,.task-views) button[aria-pressed="true"], body .task-view[aria-pressed="true"]  {
  background:var(--selected-surface);
  color:var(--text);
  border-color:var(--line);
  box-shadow:inset 0 0 0 1px var(--line);
}
body .nav-item[aria-selected="true"]  {
  color:var(--accent-text);
  background:var(--accent-soft);
  border-color:var(--orange);
}
body .mini-month button.is-today  {
  border-radius:50%;
  background:var(--orange);
  border-color:var(--orange);
  color:var(--on-accent);
}
input:is([type="date"],[type="datetime-local"])  {
  font-weight:400;
}
input.date-empty::-webkit-datetime-edit  {
  color:var(--muted);
  font-weight:400;
}
input.date-empty  {
  color:var(--muted);
}
@media(max-width:700px)  {
  :is(form.modal,.project-dialog,.workflow-dialog,.customer-removal-dialog) :is(.modal-body,.dialog-content)  {
    padding:16px;
  }
  :is(form.modal,.project-dialog,.workflow-dialog,.customer-removal-dialog) > header  {
    padding:16px;
  }
}
@media(prefers-reduced-motion:reduce)  {
  html  {
    scroll-behavior:auto;
  }
  *, *::before, *::after  {
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:0s!important;
  }
}
/* The frame owns outer spacing; page grids retain only their internal layout. */ body.portal-layout .main-panel > :is(.time-shell,.todo-shell,.calendar-shell)  {
  width:100%;
  max-width:none;
  margin-inline:0;
}
body.portal-layout .main-panel > .project-workspace  {
  padding:0;
}
.crm-workspace .workspace-head .btn  {
  min-height:44px;
}
.contact-link .contact-chevron  {
  width:18px;
  height:18px;
}
.direction-icon  {
  display:inline-block;
  width:18px;
  height:18px;
  flex:0 0 18px;
  vertical-align:middle;
  background:currentColor;
  /* Keep direction-specific mask images defined by the base stylesheet. */
  mask-position:center;
  mask-size:contain;
  mask-repeat:no-repeat;
  -webkit-mask-position:center;
  -webkit-mask-size:contain;
  -webkit-mask-repeat:no-repeat;
}
.direction-right  {
  mask-image:url('/assets/page/move-right.svg');
  -webkit-mask-image:url('/assets/page/move-right.svg');
}
.direction-down  {
  mask-image:url('/assets/page/move-down.svg');
  -webkit-mask-image:url('/assets/page/move-down.svg');
}
:is(form.modal,.project-dialog,.workflow-dialog,.customer-removal-dialog) select  {
  appearance:none;
  background-image:url('/assets/page/chevron-down.svg');
  background-position:right 12px center;
  background-repeat:no-repeat;
  background-size:18px;
  padding-right:38px;
}
/* Shared notice spacing; existing consent storage and dismissal stay unchanged. */
/* Both public pages use the same notice and the existing is-visible lifecycle. */
.cookie-banner {
  box-sizing:border-box;
  position:fixed;
  z-index:60;
  inset:auto 16px 16px;
  width:auto;
  max-width:700px;
  margin:0 auto;
  display:none;
  align-items:center;
  justify-content:space-between;
  flex-direction:row;
  flex-wrap:nowrap;
  gap:16px;
  padding:16px 20px;
  border:1px solid var(--line);
  border-radius:var(--dialog-radius);
  background:var(--panel);
  color:var(--muted);
  box-shadow:var(--shadow);
  font-size:1rem;
  line-height:1.42;
}
.cookie-banner.is-visible {display:flex;}
.cookie-banner p {margin:0;min-width:0;color:var(--muted);line-height:inherit;}
.cookie-banner a {color:inherit;text-decoration:underline;text-underline-offset:2px;}
.cookie-banner .btn {
  display:inline-flex;align-items:center;justify-content:center;
  min-height:44px;width:auto;flex:0 0 auto;padding:10px 16px;
  border:1px solid #ffffff26;border-radius:8px;
  background:var(--orange);color:#fff;font:inherit;font-weight:720;
}
.cookie-banner[hidden],.cookie-banner.hidden {display:none;}
@media(max-width:700px){
  .cookie-banner {flex-direction:column;align-items:stretch;}
  .cookie-banner .btn {width:100%;}
}
:is(form.modal, .project-dialog, .workflow-dialog, .customer-removal-dialog) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select) { min-height:44px; }
/* Task completion feedback preserves control dimensions while the write is pending. */
.task-completion-pending:disabled {opacity:1;cursor:wait}
.task-completion-check {display:inline-block;width:1.25em;height:1.25em;flex-shrink:0;background:currentColor;mask:url('/assets/page/check.svg') center/contain no-repeat;animation:task-completion-check-in 180ms var(--ease-out) both}
.task-completion-strike {background-image:linear-gradient(currentColor,currentColor);background-repeat:no-repeat;background-position:left 55%;background-size:100% 2px;box-decoration-break:clone;-webkit-box-decoration-break:clone;animation:task-completion-line 320ms var(--ease-out) both}
@keyframes task-completion-check-in {from{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}
@keyframes task-completion-line {from{background-size:0 2px}to{background-size:100% 2px}}
@media(prefers-reduced-motion:reduce){.task-completion-check,.task-completion-strike{animation:none}}
.helper-disclosure>summary{display:flex;align-items:center;gap:10px;min-height:44px;cursor:pointer;user-select:none;list-style:none;width:fit-content;max-width:100%;border-radius:4px}
.helper-disclosure>summary::before{content:'+';width:16px;flex:none;text-align:center;color:var(--orange);font-size:1.15rem}
.helper-disclosure[open]>summary::before{content:'−'}
.helper-disclosure>summary::-webkit-details-marker{display:none}
.helper-disclosure>summary:focus-visible{outline:2px solid var(--orange);outline-offset:3px}
/* Completion undo stays reachable; timers pause during interaction and in hidden tabs. */
.task-undo-notices{position:fixed;right:20px;bottom:76px;z-index:500;display:grid;gap:8px;max-width:min(480px,calc(100vw - 40px));max-height:60vh;overflow:auto}
.task-undo-notice{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid var(--line,#ffffff26);border-radius:10px;background:var(--panel,#202634);color:var(--text);box-shadow:var(--shadow)}
.task-undo-notice>span{flex:1;min-width:0}.task-undo-notice button{min-height:44px;flex-shrink:0}.task-undo-notice .icon-button{min-width:44px}
@media(max-width:480px){.task-undo-notice{flex-wrap:wrap}.task-undo-notice>span{flex-basis:100%}}
.task-undo-notice .icon-button{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:1px solid var(--line,#ffffff26);border-radius:8px;background:#ffffff08;color:var(--text);cursor:pointer}
.task-undo-notice .x-icon{display:block;width:18px;height:18px;background:currentColor;mask:url('/assets/page/x.svg') center/contain no-repeat}
/* Equal geometry for primary and secondary actions, including nested share forms. */
body :is(dialog,[role="dialog"],.modal) :is(footer,.modal-footer,.dialog-actions,.form-actions,.modal-actions,.partner-dialog-actions,.task-editor-footer,.app-install-actions,.actions) > .btn {
 min-height:44px;box-sizing:border-box;padding-block:10px;margin-block:0;
 border:1px solid var(--line);font-size:.9rem;line-height:1.35;
 display:inline-flex;align-items:center;justify-content:center;align-self:stretch;
}
/* Equal tracks also cover wrapped labels and busy/success content changes.
   Mixed-content footers (reviews, statuses, toolbars) keep their own layout. */
@media(max-width:700px){
 body :is(dialog,[role="dialog"],.modal) :is(footer,.modal-footer,.dialog-actions,.form-actions,.modal-actions,.partner-dialog-actions,.task-editor-footer,.app-install-actions,.actions):has(> .btn ~ .btn):not(:has(> :not(.btn):not([hidden]))) {
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));
  grid-auto-rows:minmax(44px,1fr);align-items:stretch;
 }
 body :is(dialog,[role="dialog"],.modal) :is(footer,.modal-footer,.dialog-actions,.form-actions,.modal-actions,.partner-dialog-actions,.task-editor-footer,.app-install-actions,.actions) > .btn {
  min-width:0;max-width:100%;height:auto;white-space:normal;overflow-wrap:anywhere;
 }
 body :is(.modal,.dashboard-dialog-card) footer:has(> .btn:nth-child(2):last-child),
 body .partner-dialog-actions:has(> .btn:nth-child(2):last-child),
 body #fileReplace[data-approved-replacement] .file-replace-actions:has(> .btn:nth-child(2):last-child),
 body .task-editor-footer:has(> .btn:nth-child(2):last-child) {
  grid-template-columns:minmax(0,1fr);
 }
 body :is(.modal,.dashboard-dialog-card) footer:has(> .btn:nth-child(2):last-child) > .btn:first-child,
 body .partner-dialog-actions:has(> .btn:nth-child(2):last-child) > .btn:first-child,
 body #fileReplace[data-approved-replacement] .file-replace-actions:has(> .btn:nth-child(2):last-child) > .btn:first-child {
  order:1;
 }
}
