/* Shared tile sizing and contrast. Never constrain a tile to fewer text lines. */
#app { --tile-outline:#519dcc; --tile-glow:#269ce638; --tile-focus:#168ed8; }
html[data-theme="dark"] #app, body[data-theme="dark"] #app {
 --tile-outline:#65abd6; --tile-glow:#2ba9f34a; --tile-focus:#81d3ff;
}
#app .shell.dalux-layout :is(.project-nav-block,.crm-huske-nav-group,.crm-huske-project-nav) {
 height:auto!important;min-height:0!important;max-height:none!important;min-width:0!important;flex-shrink:0!important;
}
#app .shell.dalux-layout :is(.project-nav,.sales-project-list) {
 grid-auto-rows:max-content!important;align-items:start!important;align-content:start!important;
}
#app .shell.dalux-layout .project-nav-block > button:is([data-project-id],[data-service-task-id],[data-share-id],[data-toggle-completed-service-tasks]),
#app .shell.dalux-layout :is(.sales-project-card,.crm-huske-tile,.service-task-list-item),
#app .shell.dalux-layout :is(.crm-huske-nav-group,.crm-huske-nav-group > div) > button,
#app .shell.dalux-layout :is(.crm-huske-nav-finished,.crm-huske-archived-projects) > summary {
 height:auto!important;max-height:none!important;min-height:48px!important;min-width:0!important;
 flex-shrink:0!important;overflow:visible!important;box-sizing:border-box!important;white-space:normal!important;
}
#app .shell.dalux-layout .project-nav-block > button[data-project-id] {
 min-height:max(76px,var(--project-equal-height,76px))!important;
}
#app .shell.dalux-layout .sales-project-card {
 display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;
 align-content:start!important;gap:4px!important;padding:12px 14px!important;
}
#app .shell.dalux-layout .sales-project-card > :is(strong,span) {
 display:block!important;flex:0 0 auto!important;min-width:0!important;max-width:100%!important;
 height:auto!important;min-height:0!important;max-height:none!important;line-height:1.35!important;
 white-space:normal!important;overflow-wrap:anywhere!important;overflow:visible!important;-webkit-line-clamp:unset!important;
}
#app .shell.dalux-layout .project-nav-block > button .project-nav-title,
#app .shell.dalux-layout .project-nav-block > button .project-nav-title > span:last-child,
#app .shell.dalux-layout :is(.mobile-project-row,.mobile-project-copy,.project-nav-copy,.module-text) {
 height:auto!important;min-height:0!important;max-height:none!important;min-width:0!important;
}
#app .shell.dalux-layout :is(.project-nav-title,.project-nav-copy,.mobile-project-copy,.module-text,.crm-huske-tile) :is(strong,small,.project-nav-meta,.mobile-project-meta),
#app .shell.dalux-layout .project-nav-block > button .project-nav-meta {
 display:block!important;height:auto!important;max-height:none!important;line-height:1.3!important;
 white-space:normal!important;overflow-wrap:anywhere!important;overflow:visible!important;-webkit-line-clamp:unset!important;
}
#app .shell.dalux-layout :is(.module-item,.module-file-item,.module-file-version-item) {
 height:auto!important;max-height:none!important;min-height:40px!important;
}
#app .shell.dalux-layout :is(.module-file-name,.module-file-source,.module-file-version-name,.module-file-version-meta) {
 display:block!important;height:auto!important;max-height:none!important;white-space:normal!important;
 overflow-wrap:anywhere!important;overflow:visible!important;-webkit-line-clamp:unset!important;
}
#app .shell.dalux-layout .sidebar-section-switch > button {
 height:auto!important;max-height:none!important;min-height:52px!important;white-space:normal!important;
}
#app .shell.dalux-layout :is(.sidebar-section-switch > button,.project-nav-block > button,.sales-project-card,.crm-huske-tile,.service-task-list-item,.module-item,.module-file-item,.module-file-version-item),
#app .shell.dalux-layout :is(.crm-huske-nav-group,.crm-huske-nav-group > div) > button,
#app .shell.dalux-layout :is(.crm-huske-nav-finished,.crm-huske-archived-projects) > summary {
 border:1.5px solid var(--tile-outline)!important;border-radius:10px!important;
 box-shadow:inset 0 0 2px 1px var(--tile-glow),inset 0 0 26px 3px var(--tile-glow)!important;
 transition:border-color .15s ease,box-shadow .15s ease;
}
#app .shell.dalux-layout :is(.sidebar-section-switch > button,.project-nav-block > button,.sales-project-card,.crm-huske-tile,.service-task-list-item,.module-item,.module-file-item,.module-file-version-item):is(:focus-visible,.active),
#app .shell.dalux-layout :is(.crm-huske-nav-group,.crm-huske-nav-group > div) > button:is(:focus-visible,.active),
#app .shell.dalux-layout :is(.crm-huske-nav-finished,.crm-huske-archived-projects) > summary:is(:focus-visible) {
 border-color:var(--tile-focus)!important;
 box-shadow:inset 0 0 3px 1px var(--tile-focus),inset 0 0 34px 6px var(--tile-glow)!important;
}
@media(prefers-reduced-motion:reduce){#app .shell.dalux-layout :is(button,summary){transition:none!important;}}

/* Tree hierarchy: project stays prominent, sections recede, files brighten. */
#app .shell.dalux-layout .module-item {
 --tile-outline:#82a9c0; --tile-glow:#269ce614; --tile-focus:#519dcc;
}
#app .shell.dalux-layout :is(.module-file-item,.module-file-version-item) {
 --tile-outline:#519dcc; --tile-glow:#269ce640; --tile-focus:#168ed8;
}
html[data-theme="dark"] #app .shell.dalux-layout .module-item,
body[data-theme="dark"] #app .shell.dalux-layout .module-item {
 --tile-outline:#49758e; --tile-glow:#2ba9f316; --tile-focus:#65abd6;
}
html[data-theme="dark"] #app .shell.dalux-layout :is(.module-file-item,.module-file-version-item),
body[data-theme="dark"] #app .shell.dalux-layout :is(.module-file-item,.module-file-version-item) {
 --tile-outline:#65abd6; --tile-glow:#2ba9f34a; --tile-focus:#81d3ff;
}
#app .shell.dalux-layout .module-item:is(:focus-visible,.active) {
 background:linear-gradient(135deg,#e4eef4,#edf3f7)!important;
 box-shadow:inset 0 0 2px 0 var(--tile-outline),inset 0 0 20px 2px var(--tile-glow)!important;
}
html[data-theme="dark"] #app .shell.dalux-layout .module-item:is(:focus-visible,.active),
body[data-theme="dark"] #app .shell.dalux-layout .module-item:is(:focus-visible,.active) {
 background:linear-gradient(135deg,#1c3040,#172630)!important;
}

/* Open tree levels need brighter surfaces, not only brighter outlines. */
#app .shell.dalux-layout .module-file-item {
 background-image:linear-gradient(135deg,#ffffff08,#ffffff04)!important;
}
#app .shell.dalux-layout .module-file-item.status-neutral,
#app .shell.dalux-layout .module-file-item:not([class*="status-"]),
#app .shell.dalux-layout .module-file-version-item {
 background:linear-gradient(135deg,#e9f4fc,#f4f9fd)!important;
}
#app .shell.dalux-layout .module-file-children .module-file-item.status-neutral {
 background:linear-gradient(135deg,#f2f9fd,#ffffff)!important;
}
html[data-theme="dark"] #app .shell.dalux-layout,
body[data-theme="dark"] #app .shell.dalux-layout {
 --tree-open-start:#263f50; --tree-open-end:#213746;
 --tree-file-start:#253746; --tree-file-end:#21313e;
 --tree-child-start:#2c3f4e; --tree-child-end:#263947;
}
#app .shell.dalux-layout .module-item-row:has(+ .module-file-list, + * > .module-file-list) > .module-item {
 background:linear-gradient(135deg,var(--tree-open-start,#d9eaf5),var(--tree-open-end,#e7f2f9))!important;
}
html[data-theme="dark"] #app .shell.dalux-layout .module-file-item.status-neutral,
body[data-theme="dark"] #app .shell.dalux-layout .module-file-item.status-neutral,
html[data-theme="dark"] #app .shell.dalux-layout .module-file-item:not([class*="status-"]),
body[data-theme="dark"] #app .shell.dalux-layout .module-file-item:not([class*="status-"]),
html[data-theme="dark"] #app .shell.dalux-layout .module-file-version-item,
body[data-theme="dark"] #app .shell.dalux-layout .module-file-version-item {
 background:linear-gradient(135deg,var(--tree-file-start),var(--tree-file-end))!important;
}
html[data-theme="dark"] #app .shell.dalux-layout .module-file-children .module-file-item.status-neutral,
body[data-theme="dark"] #app .shell.dalux-layout .module-file-children .module-file-item.status-neutral {
 background:linear-gradient(135deg,var(--tree-child-start),var(--tree-child-end))!important;
}

html[data-theme="dark"] #app .shell.dalux-layout .module-item-row:has(+ .module-file-list, + * > .module-file-list) > .module-item,
body[data-theme="dark"] #app .shell.dalux-layout .module-item-row:has(+ .module-file-list, + * > .module-file-list) > .module-item {
 background:linear-gradient(135deg,var(--tree-open-start),var(--tree-open-end))!important;
}

/* Selection is route state. Touch Safari can retain :hover after a tap;
   it must never paint an inactive navigation tile like the active one. */
#app .shell.dalux-layout .sidebar-section-switch > button,
#app .shell.dalux-layout .module-item {
 --crm-nav-rest:linear-gradient(135deg,#edf2f5,#e7eef3);
 background:var(--crm-nav-rest)!important;
}
html[data-theme="dark"] #app .shell.dalux-layout .sidebar-section-switch > button,
body[data-theme="dark"] #app .shell.dalux-layout .sidebar-section-switch > button,
html[data-theme="dark"] #app .shell.dalux-layout .module-item,
body[data-theme="dark"] #app .shell.dalux-layout .module-item {
 --crm-nav-rest:linear-gradient(135deg,#151e28,#121c25);
}
#app .shell.dalux-layout .sidebar-section-switch > button.active {
 background:linear-gradient(135deg,#cce6f7,#e0f0fa)!important;
}
html[data-theme="dark"] #app .shell.dalux-layout .sidebar-section-switch > button.active,
body[data-theme="dark"] #app .shell.dalux-layout .sidebar-section-switch > button.active {
 background:linear-gradient(135deg,#213f52,#183142)!important;
}
/* A hover keeps the resting text, edge and inner glow on inactive tiles. */
#app .shell.dalux-layout :is(.sidebar-section-switch > button,.module-item):not(.active):not(:focus-visible):hover {
 color:var(--crm-text-435563,#435563)!important;
 border-color:var(--tile-outline)!important;
 box-shadow:inset 0 0 2px 1px var(--tile-glow),inset 0 0 26px 3px var(--tile-glow)!important;
}
html[data-theme="dark"] #app .shell.dalux-layout :is(.sidebar-section-switch > button,.module-item):not(.active):not(:focus-visible):hover,
body[data-theme="dark"] #app .shell.dalux-layout :is(.sidebar-section-switch > button,.module-item):not(.active):not(:focus-visible):hover {
 color:var(--crm-text-c1ced7,#c1ced7)!important;
}

/* Resting files show hierarchy without imitating a selected tile. */
#app .shell.dalux-layout :is(.module-file-item,.module-file-version-item):not(.active) {
 box-shadow:none!important;
 border-color:var(--crm-tree-rest-edge,#b7cbd8)!important;
}
html[data-theme="dark"] #app .shell.dalux-layout,
body[data-theme="dark"] #app .shell.dalux-layout {
 --crm-tree-rest-edge:#4d697d;
}
#app .shell.dalux-layout :is(.module-file-item,.module-file-version-item).active {
 --tree-file-start:#345064; --tree-file-end:#2b4354;
 --tree-child-start:#345064; --tree-child-end:#2b4354;
}

/* Route defaults and retained keyboard/touch state are not an explicit selection. */
html[data-crm-navigation-selection="intent"] #app .shell.dalux-layout :is(.module-nav .module-item,.sidebar-section-switch > button):not([data-crm-nav-chosen]) {
 background:var(--crm-nav-rest)!important;
 border-color:var(--tile-outline)!important;
 box-shadow:none!important;
}
html[data-crm-navigation-selection="intent"] #app .shell.dalux-layout :is(.module-nav .module-item,.sidebar-section-switch > button)[data-crm-nav-chosen="true"] {
 background:linear-gradient(135deg,#d9eaf5,#e7f2f9)!important;
 border-color:var(--tile-focus)!important;
 box-shadow:inset 0 0 2px 0 var(--tile-outline),inset 0 0 16px 1px var(--tile-glow)!important;
}
html[data-theme="dark"][data-crm-navigation-selection="intent"] #app .shell.dalux-layout :is(.module-nav .module-item,.sidebar-section-switch > button)[data-crm-nav-chosen="true"] {
 background:linear-gradient(135deg,#263f50,#213746)!important;
}

/* Approval is a workflow state: it stays green even when selected or starred. */
#app .shell.dalux-layout .module-nav .module-file-item.status-approved,
#app .shell.dalux-layout .drawing-main.status-approved,
#app .crm-home-favorites .crm-home-favorite-entry.status-approved {
 background:linear-gradient(135deg,#d8efdf,#e3f4e8)!important;
 border-color:#79b68d!important;color:#234b30!important;
 --tree-file-start:#d8efdf;--tree-file-end:#e3f4e8;
 --tree-child-start:#d8efdf;--tree-child-end:#e3f4e8;
}
html[data-theme="dark"] #app .shell.dalux-layout .module-nav .module-file-item.status-approved,
body[data-theme="dark"] #app .shell.dalux-layout .module-nav .module-file-item.status-approved,
html[data-theme="dark"] #app .shell.dalux-layout .drawing-main.status-approved,
body[data-theme="dark"] #app .shell.dalux-layout .drawing-main.status-approved,
html[data-theme="dark"] #app .crm-home-favorites .crm-home-favorite-entry.status-approved,
body[data-theme="dark"] #app .crm-home-favorites .crm-home-favorite-entry.status-approved {
 background:linear-gradient(135deg,#214b37,#193c2c)!important;
 border-color:#66ad80!important;color:#d5f2de!important;
 --tree-file-start:#214b37;--tree-file-end:#193c2c;
 --tree-child-start:#214b37;--tree-child-end:#193c2c;
}
#app .crm-home-favorites .crm-home-favorite-entry.status-approved [data-open-favorite] {color:inherit!important;}

/* Main navigation uses the same resting/selected inner glow as project tiles.
   Unchosen routes keep their resting fill; a glow never marks them selected. */
html[data-crm-navigation-selection="intent"] #app .shell.dalux-layout .sidebar .sidebar-rail .sidebar-section-switch > button:not([data-crm-nav-chosen]),
html[data-crm-navigation-selection="intent"] #app .shell.dalux-layout .sidebar .sidebar-rail .sidebar-section-switch > .crm-account-files-tile {
 box-shadow:inset 0 0 2px 1px var(--tile-glow),inset 0 0 26px 3px var(--tile-glow)!important;
}
html[data-crm-navigation-selection="intent"] #app .shell.dalux-layout .sidebar .sidebar-rail .sidebar-section-switch > button[data-crm-nav-chosen="true"] {
 box-shadow:inset 0 0 3px 1px var(--tile-focus),inset 0 0 34px 6px var(--tile-glow)!important;
}
