/* Dashboard editing owns the attached control bar, two-sided cards and
   global library/appearance dialogs. Masthead and scene art keep their owners. */
.dashboard-control-icon { width:22px; height:22px; flex:none; vertical-align:middle; }
.dashboard-editor-toolbar { position:relative; z-index:90; display:flex; flex:none; flex-wrap:wrap; align-self:center; align-items:center; justify-content:space-between; width:min(760px,calc(100% - 24px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px))); gap:8px; margin:0 auto 10px; padding:8px 12px; border:1px solid #00669c; border-top:0; border-radius:0 0 14px 14px; background:#0077b5; color:#fff; box-shadow:inset 0 5px 7px #003e6b40,0 6px 14px #00334426; transform-origin:top center; animation:dashboard-toolbar-enter 650ms cubic-bezier(.16,1,.3,1); }
.dashboard-editor-toolbar[hidden] { display:none; }
@keyframes dashboard-toolbar-enter { from { opacity:0; transform:translateY(-70%) scaleY(.92); } to { opacity:1; transform:translateY(0) scaleY(1); } }
.dashboard-editor-toolbar > div { display:flex; align-items:center; gap:5px; }
.dashboard-editor-toolbar button { display:flex; align-items:center; justify-content:center; gap:7px; min-height:44px; min-width:44px; padding:7px 10px; border:0; border-radius:8px; background:transparent; color:#fff; box-shadow:none; }
@media (hover:hover) and (pointer:fine) { .dashboard-editor-toolbar button:hover { background:#ffffff22; } }
.dashboard-editor-toolbar button:disabled { opacity:.4; }
.dashboard-editor-toolbar button:focus-visible { outline:2px solid #fff; outline-offset:2px; }
.dashboard-editor-toolbar button.primary { background:#fff; color:#006c99; font-weight:700; }
.dashboard-editor-toolbar small { font-size:13px; }
.dashboard-editor-status:empty { display:none; }
.dashboard-editor-status { flex:none; margin:0; color:var(--danger); background:var(--surface); padding:12px; }
#panel-dashboard[data-editor-mode="edit"] #dashboardEditBtn { display:none; }
.workspace-canvas:has(#panel-dashboard[data-editor-mode="edit"]) { overflow-anchor:none; }
#panel-dashboard .dashboard-widget { background:transparent; border:0; box-shadow:none; align-self:start; }
#panel-dashboard[data-editor-mode="edit"] .dashboard-widget { outline:1px dashed var(--line-strong); outline-offset:4px; cursor:pointer; }
#panel-dashboard[data-editor-mode="edit"] .dashboard-widget.is-selected { outline:2px dashed var(--primary); }
#panel-dashboard[data-editor-mode="edit"] .dashboard-panel-front::after {
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  background:var(--ink);
  opacity:.11;
  -webkit-mask-image:url('/app/dashboard-edit-pattern.svg');
  mask-image:url('/app/dashboard-edit-pattern.svg');
  -webkit-mask-repeat:repeat;
  mask-repeat:repeat;
  -webkit-mask-size:160px 104px;
  mask-size:160px 104px;
  pointer-events:none;
}
.dashboard-panel-stage { position:relative; perspective:1000px; border-radius:var(--surface-card-radius); min-width:0; }
.dashboard-panel-rotor { position:relative; width:100%; height:100%; transform-style:preserve-3d; -webkit-transform-style:preserve-3d; transition:transform .8s; border-radius:inherit; }
.dashboard-widget.is-flipped .dashboard-panel-rotor { transform:rotateY(-180deg); }
.dashboard-panel-front,.dashboard-panel-back { box-sizing:border-box; width:100%; height:100%; border:1px solid color-mix(in srgb,var(--line) 90%,var(--primary)); border-radius:inherit; background:var(--surface); color:var(--ink); box-shadow:var(--surface-card-shadow); -webkit-backface-visibility:hidden; backface-visibility:hidden; }
.dashboard-panel-front { position:relative; transform:rotateY(0deg); }
.dashboard-panel-back { container:dashboard-back / inline-size; position:absolute; inset:0; transform:rotateY(180deg); display:none; }
#panel-dashboard[data-editor-mode="edit"] .dashboard-panel-back { display:block; background:#ddecf9; border-color:#82b9db; }
body[data-theme="agilent-web-dark"] #panel-dashboard[data-editor-mode="edit"] .dashboard-panel-back { background:#153d54; border-color:#4b95bc; }
/* The visibility gate also protects flattened WebKit compositing paths.
   The same rotor returns through the reverse transition when Back is pressed. */
.dashboard-panel-front,.dashboard-panel-back { transition:visibility 0s linear .4s; visibility:visible; }
.dashboard-panel-back { visibility:hidden; }
.dashboard-widget.is-flipped .dashboard-panel-front { visibility:hidden; }
.dashboard-widget.is-flipped .dashboard-panel-back { visibility:visible; }
.dashboard-panel-back[aria-hidden="true"],.dashboard-panel-front[aria-hidden="true"] { pointer-events:none; }
.dashboard-widget-body [hidden] { display:none !important; }
#panel-dashboard .dashboard-widget-editor { display:none; align-items:center; gap:7px; height:44px; min-height:44px; padding:0 7px; border:0; border-bottom:1px dashed var(--line-strong); border-radius:inherit; background:transparent; }
#panel-dashboard[data-editor-mode="edit"] .dashboard-widget-editor { display:flex; }
[data-dashboard-drag] { touch-action:none; cursor:grab; user-select:none; -webkit-user-select:none; }
[data-dashboard-drag]:active { cursor:grabbing; }
.dashboard-grip-icon { display:flex; align-items:center; flex:none; color:var(--primary-dark); }
.dashboard-grip-icon svg { width:18px; height:22px; }
.dashboard-drag-title { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; font-weight:600; color:var(--muted); }
.dashboard-widget-editor button { min-height:44px; min-width:44px; padding:5px 7px; border:0; background:transparent; color:var(--primary-dark); box-shadow:none; }
.dashboard-flip-control { display:flex; flex:none; align-items:center; justify-content:center; gap:6px; font-size:12px; cursor:pointer; }
.dashboard-resize-handle { display:none; position:absolute; right:4px; bottom:-16px; z-index:5; align-items:center; justify-content:center; width:44px; height:44px; min-height:44px; padding:0; border:2px solid #0780a4; border-radius:50%; background:#fff; color:#007398; box-shadow:0 2px 6px #00334438; touch-action:none; cursor:nwse-resize; }
#panel-dashboard[data-editor-mode="edit"] .dashboard-widget.is-selected:not(.is-dragging) > .dashboard-resize-handle { display:flex; }
.dashboard-resize-handle:active { background:#fff; color:#005a78; }
@media (hover:hover) and (pointer:fine) { .dashboard-resize-handle:hover { background:#fff; color:#005a78; } }
.dashboard-widget.is-dragging { opacity:1; transform:none; }
.dashboard-widget.is-dragging > :not(.dashboard-drag-placeholder) { visibility:hidden; }
.dashboard-drag-placeholder { position:absolute; inset:0; display:grid; place-content:center; justify-items:center; gap:6px; border:2px dashed var(--primary); border-radius:inherit; background:var(--primary-soft); color:var(--primary-dark); }
.dashboard-drag-placeholder strong { font-size:16px; }
.dashboard-drag-placeholder small { font-size:12px; color:var(--muted); }
.dashboard-drag-ghost { position:fixed; z-index:2000; pointer-events:none; opacity:.85; max-width:420px; max-height:260px; overflow:hidden; box-shadow:var(--shadow-lg); }
.dashboard-back-content { display:flex; flex-direction:column; gap:8px; padding:12px; }
.dashboard-back-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:44px; padding-bottom:6px; border-bottom:1px solid var(--line-strong); }
.dashboard-back-heading > div { min-width:0; }
.dashboard-back-heading small { display:block; color:var(--primary-dark); font-size:10px; text-transform:uppercase; letter-spacing:.08em; margin-bottom:4px; }
.dashboard-back-heading h2 { margin:0; font-size:17px; line-height:1.25; overflow-wrap:anywhere; }
.dashboard-back-heading > button { padding:5px 7px; background:var(--surface); }
.dashboard-panel-back :is(.dashboard-back-heading,.dashboard-back-controls,.dashboard-back-footer,.dashboard-priority-list) button,.dashboard-example-toggle { min-width:44px; min-height:44px; border:1px solid var(--line-strong); color:var(--primary-dark); box-shadow:none; }
.dashboard-back-options { display:grid; gap:8px; min-width:0; }
.dashboard-row-summary { margin:0; color:var(--muted); font-size:12px; line-height:1.4; }
.dashboard-back-controls { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.dashboard-back-controls:empty { display:none; }
.dashboard-boundary-moves { display:flex; gap:4px; }
.dashboard-boundary-moves button { display:grid; place-items:center; padding:6px; background:var(--surface); }
.dashboard-empty-placeholder { display:grid; width:100%; min-height:68px; gap:5px; padding:12px 14px; color:var(--ink); text-align:left; background:transparent; border:0; box-shadow:none; white-space:normal; }
.dashboard-empty-placeholder[hidden] { display:none; }
.dashboard-empty-placeholder strong { font-size:15px; }
.dashboard-empty-placeholder small { color:var(--muted); font-size:13px; line-height:1.35; }
#panel-dashboard[data-editor-mode="edit"] .dashboard-widget.is-empty-collapsed { min-height:0; }
#panel-dashboard[data-editor-mode="edit"] .dashboard-widget.is-empty-collapsed > :is(.dashboard-panel-stage,.dashboard-resize-handle) { display:none; }
.dashboard-size-cycle,.dashboard-remove-panel { display:flex; gap:7px; align-items:center; justify-content:center; padding:7px 10px; background:var(--surface); font-size:13px; }
.dashboard-panel-back :is(.dashboard-size-cycle,.dashboard-remove-panel,.dashboard-example-toggle):hover { background:var(--primary-soft); color:var(--ink); border-color:var(--primary); }
.dashboard-back-simple .dashboard-remove-panel { margin:0 44px 0 0; padding:7px; }
.dashboard-priority-heading strong { font-size:12px; }
.dashboard-back-controls > .dashboard-setting-row { margin:0; padding:0; min-height:44px; border:0; font-size:13px; }
.dashboard-back-controls .dashboard-setting-row:has(select) { flex:1; }
.dashboard-panel-back select,.dashboard-editor-dialog select { appearance:none; -webkit-appearance:none; flex:1; min-width:0; max-width:100%; min-height:44px; padding:8px; border:1px solid var(--line-strong); border-radius:8px; color:var(--ink); background-color:var(--surface); background-image:linear-gradient(45deg,transparent 50%,var(--ink) 50%),linear-gradient(135deg,var(--ink) 50%,transparent 50%); background-position:calc(100% - 15px) 50%,calc(100% - 10px) 50%; background-size:5px 5px; background-repeat:no-repeat; padding-right:28px; }
.dashboard-panel-back,.dashboard-editor-dialog { color-scheme:light; }
body[data-theme="agilent-web-dark"] :is(.dashboard-panel-back,.dashboard-editor-dialog) { color-scheme:dark; }
.dashboard-panel-back input[type="checkbox"] { accent-color:var(--primary); }
.dashboard-priority-list { display:grid; gap:4px; list-style:none; margin:0; padding:0; }
.dashboard-priority-list li { display:flex; gap:7px; align-items:center; padding:0 5px; min-height:46px; border:1px solid var(--line); border-radius:8px; background:var(--surface); }
.dashboard-priority-number { display:grid; place-items:center; flex:0 0 25px; height:28px; border-radius:6px; background:var(--surface-2); color:var(--primary-dark); font-weight:700; }
.dashboard-priority-list strong { flex:1; min-width:0; font-size:13px; line-height:1.3; }
.dashboard-priority-list li > label { display:flex; flex:1; align-items:center; min-width:0; min-height:44px; gap:7px; }
.dashboard-priority-list li input { flex:none; width:18px; height:18px; }
.dashboard-priority-list li.is-priority { background:var(--primary-soft); border-color:var(--line-strong); }
.dashboard-priority-list button { flex:none; padding:2px; width:44px; min-height:44px; border:0; background:transparent; box-shadow:none; color:var(--primary-dark); }
.dashboard-priority-list button:disabled { opacity:.25; }
.dashboard-priority-grip { touch-action:none; cursor:grab; font-size:25px; }
.dashboard-priority-list li.is-priority-dragging { opacity:.6; border-color:var(--primary); }
.dashboard-priority-list li > div { display:none; }
.dashboard-priority-list li:focus-within > div,
.dashboard-priority-list li.is-controls-open > div { display:flex; }
@media(hover:hover) {
@media (hover:hover) and (pointer:fine) { .dashboard-priority-list li:hover > div { display:flex; } } }
.dashboard-back-footer { display:flex; flex:none; justify-content:flex-start; padding-top:6px; border-top:1px solid var(--line); }
.dashboard-color-mode { display:flex; flex-wrap:wrap; gap:10px; border:0; padding:0; margin:0; }
.dashboard-color-mode legend { font-weight:700; margin-bottom:10px; }
.dashboard-color-mode button[aria-pressed="true"] { background:var(--primary-soft); border-color:var(--primary); color:var(--primary-dark); }
@media(max-width:430px) {
 .dashboard-editor-toolbar { gap:4px; padding:6px 10px; }
 .dashboard-editor-toolbar button { padding:5px 4px; gap:3px; font-size:12px; }
 .dashboard-editor-toolbar > div { gap:1px; }
 .dashboard-editor-tools button { flex-direction:column; }
 .dashboard-editor-toolbar small { font-size:11px; }
 .dashboard-back-heading h2 { font-size:16px; }
 .dashboard-widget[data-widget-size="compact"] .dashboard-drag-title { display:none; }
 .dashboard-widget[data-widget-size="compact"] .dashboard-flip-control { margin-left:auto; }
 .dashboard-widget[data-widget-size="compact"] .dashboard-back-controls .dashboard-size-cycle > span { display:none; }
 .dashboard-widget[data-widget-size="compact"] .dashboard-back-heading > button > span { display:none; }
 .dashboard-widget[data-widget-size="compact"] .dashboard-back-heading small { display:none; }
}
.dashboard-history-actions { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.dashboard-history-actions button { min-height:56px; color:var(--primary-dark); border:1px solid var(--line-strong); }
.dashboard-history-list { display:grid; gap:10px; padding:0; margin:0; list-style:none; }
.dashboard-history-list li { display:flex; align-items:center; gap:12px; padding:14px 12px; border:1px solid var(--line); border-radius:10px; }
.dashboard-history-list strong,.dashboard-history-list small { display:block; line-height:1.4; }
.dashboard-history-list small { color:var(--muted); margin-top:5px; }
#dashboardEditorDialogBody h3 { margin:8px 0 0; font-size:12px; text-transform:uppercase; color:var(--primary-dark); }
.dashboard-sheet-note { padding:12px; border-radius:8px; background:var(--primary-soft); color:var(--muted); }
.dashboard-editor-dialog { margin:auto; width:min(640px,calc(100% - 24px)); max-height:85dvh; overflow:auto; padding:20px; border:1px solid var(--line-strong); border-radius:20px; background:var(--surface); color:var(--ink); box-shadow:var(--shadow-lg); }
.dashboard-sheet-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.dashboard-sheet-head h2 { font-size:var(--ui-title-size); font-weight:var(--ui-title-weight); margin:0; }
.dashboard-sheet-head > button { width:44px; height:44px; padding:0; border:0; background:transparent; color:var(--primary-dark); box-shadow:none; font-size:27px; line-height:1; }
#dashboardEditorDialogBody { display:grid; gap:14px; margin-top:18px; }
#dashboardEditorDialogBody label { display:grid; gap:8px; font-weight:700; }
#dashboardEditorDialogBody input:not([type="checkbox"]),#dashboardEditorDialogBody select { min-height:44px; width:100%; }
.dashboard-library-filters { display:flex; flex-wrap:wrap; gap:8px; }
.dashboard-library-filters [aria-pressed="true"] { outline:2px solid var(--primary); }
.dashboard-setting-row { display:flex !important; align-items:center; gap:8px; padding:10px 0; border-bottom:1px solid var(--line); }
.dashboard-setting-row > span { flex:1; min-width:0; }
.dashboard-library-list strong,.dashboard-library-list small { display:block; }
.dashboard-library-list small { margin-top:5px; color:var(--muted); }
.dashboard-library-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
.dashboard-library-tabs button { min-width:0; min-height:44px; padding:6px; border:1px solid var(--line); box-shadow:none; background:var(--surface); color:var(--muted); font-size:13px; white-space:normal; line-height:1.2; }
.dashboard-library-tabs [aria-pressed="true"],.dashboard-library-categories [aria-pressed="true"] { border-color:var(--primary); background:var(--primary-soft); color:var(--primary-dark); }
.dashboard-library-categories { margin-top:8px; }
.dashboard-library-categories button { border:1px solid var(--line); border-radius:14px; padding:7px 12px; box-shadow:none; }
.dashboard-library-list { display:grid; gap:10px; }
.dashboard-editor-dialog[open][data-editor-sheet="library"] { display:flex; flex-direction:column; height:min(720px,85dvh); overflow:hidden; }
.dashboard-editor-dialog[data-editor-sheet="library"] :is(.dashboard-sheet-head,.dashboard-library-intro,.dashboard-library-search,.dashboard-library-tabs,.dashboard-library-footer) { flex:none; }
.dashboard-editor-dialog[data-editor-sheet="library"] #dashboardEditorDialogBody { display:flex; flex-direction:column; flex:1; min-height:0; margin-top:4px; gap:12px; }
.dashboard-library-intro { margin:0 0 2px; font-size:13px; color:var(--muted); line-height:1.4; }
.dashboard-library-search { position:relative; }
.dashboard-library-search > svg { position:absolute; left:14px; top:13px; width:20px; height:20px; color:var(--primary-dark); }
.dashboard-library-search > input { padding-left:43px; font-size:16px; font-weight:400; }
.dashboard-editor-dialog[data-editor-sheet="library"] .dashboard-library-list { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; align-content:start; padding:2px 1px; }
.dashboard-library-list > h3 { margin:4px 0 0 !important; font-size:11px !important; }
.dashboard-library-footer { display:flex; align-items:center; gap:10px; padding-top:12px; border-top:1px solid var(--line); }
.dashboard-library-footer > span { display:grid; place-items:center; width:24px; height:24px; border-radius:50%; background:var(--success-soft); color:var(--success); font-weight:700; }
.dashboard-library-footer > p { margin:0; font-size:12px; line-height:1.4; }
.dashboard-library-footer small { font-size:11px; color:var(--muted); }
.dashboard-library-icon:is([data-library-icon="all_spaces"],[data-library-icon="platform_actions"]) { color:var(--success); background:var(--success-soft); }
.dashboard-library-card { display:flex; align-items:center; gap:12px; padding:14px 12px; border:1px solid var(--line); border-radius:11px; background:var(--surface); }
.dashboard-library-card > span:nth-child(2) { flex:1; min-width:0; }
.dashboard-library-card strong { font-size:15px; line-height:1.3; }
.dashboard-library-card small { font-size:12px; line-height:1.4; }
.dashboard-library-icon { display:grid; place-items:center; width:40px; height:40px; flex:none; border-radius:50%; background:var(--primary-soft); color:var(--primary-dark); }
.dashboard-library-icon svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.dashboard-library-choice { display:grid; justify-items:center; }
.dashboard-panel-toggle { position:relative; width:48px; min-width:48px; min-height:44px; padding:0; border:0; background:transparent; box-shadow:none; }
.dashboard-panel-toggle::before { content:""; position:absolute; inset:11px 0; border-radius:12px; background:var(--line-strong); }
.dashboard-panel-toggle[aria-checked="true"]::before { background:var(--primary-dark); }
.dashboard-toggle-knob { position:absolute; width:18px; height:18px; left:3px; top:13px; border-radius:50%; background:var(--surface); }
.dashboard-panel-toggle[aria-checked="true"] .dashboard-toggle-knob { left:27px; }
.dashboard-insert-zone { grid-column:1/-1; width:100%; border:1px dashed var(--primary); background:var(--primary-soft); color:var(--primary-dark); border-radius:12px; }
#panel-dashboard[data-background-motion="false"] { --welcome-scroll-offset:0px !important; }
#panel-dashboard[data-greeting-height="compact"] #homeHero { min-height:240px; height:240px; }
@media(min-width:700px) and (max-height:500px) {
  .dashboard-editor-dialog[open][data-editor-sheet="library"] { height:calc(100dvh - 24px); max-height:calc(100dvh - 24px); padding:14px 16px; }
  .dashboard-editor-dialog[data-editor-sheet="library"]::before { display:none; }
  .dashboard-editor-dialog[data-editor-sheet="library"] #dashboardEditorDialogBody {
    display:grid;
    grid-template-columns:minmax(220px,.8fr) minmax(240px,1.2fr);
    grid-template-rows:44px 44px minmax(0,1fr) auto;
    grid-template-areas:"search list" "tabs list" "categories list" "footer footer";
    gap:8px 12px;
  }
  .dashboard-library-intro { display:none; }
  .dashboard-library-search { grid-area:search; }
  .dashboard-library-tabs { grid-area:tabs; }
  .dashboard-library-category-block { grid-area:categories; }
  .dashboard-editor-dialog[data-editor-sheet="library"] .dashboard-library-category-block > h3 { margin-top:0; }
  .dashboard-library-categories { gap:4px; margin-top:4px; }
  .dashboard-library-categories button { padding:6px 8px; font-size:12px; }
  .dashboard-library-list { grid-area:list; }
  .dashboard-library-footer { grid-area:footer; padding-top:8px; }
}
@media(prefers-reduced-motion:reduce) { .dashboard-panel-rotor,.dashboard-panel-front,.dashboard-panel-back,.dashboard-widget { transition:none; } .dashboard-editor-toolbar { animation:none; } }

@container dashboard-back (max-width:240px) { .dashboard-empty-when { display:none; } }

.dashboard-example-note { padding:7px 13px; border-bottom:1px solid var(--line); background:var(--primary-soft); color:var(--primary-dark); font-size:11px; font-weight:700; }
.dashboard-example-preview { margin:2px -12px -12px; border-top:1px solid var(--line-strong); }
.dashboard-example-toggle { display:flex; align-items:center; gap:8px; width:100%; padding:8px 12px; border:0; border-radius:0; background:transparent; text-align:left; }
.dashboard-example-toggle > span { flex:1; font-size:12px; font-weight:700; }
.dashboard-example-toggle > small { font-size:11px; font-weight:400; }
.dashboard-example-toggle::after { content:""; width:7px; height:7px; margin:0 3px 3px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg); }
.dashboard-example-toggle[aria-expanded="false"]::after { transform:rotate(-45deg); }
.dashboard-example-live { border-top:1px solid var(--line); border-radius:0 0 var(--surface-card-radius) var(--surface-card-radius); background:var(--surface); color:var(--ink); overflow:hidden; }
.dashboard-example-live[hidden] { display:none; }

.dashboard-library-state { font-size:10px !important; color:var(--muted); text-align:center; white-space:nowrap; }
