/* NEXUS Web 8: a clear working surface, contextual guidance and document-first attachments. */
.ui-icon { width: 18px; height: 18px; flex: 0 0 18px; vertical-align: middle; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #60d9f6; outline-offset: 3px; }
.desktop-workspace { --text: #edf5ff; --muted: #a5b8cc; --line: #294158; --panel-soft: #163047;background:var(--panel-soft); }
.desktop-workspace .practice-topbar {background:var(--panel-soft); border-bottom-color: #243a50; }
.desktop-workspace .brand b { font-size: 1rem; letter-spacing: .14em; }
.desktop-workspace .brand small {color:var(--text); }
.desktop-workspace .top-actions button { display: inline-flex; align-items: center; gap: 7px; font-size: .72rem; min-height: 38px; }
.desktop-workspace .top-actions .secondary-button {background:var(--panel-soft);border-color:var(--line);color:var(--text); }
.desktop-workspace .phase-rail {background:var(--panel-soft); border-right-color: #21394e; padding: 24px 10px; }
.practice-label { padding: 0 12px 22px;border-color:var(--line); }
.practice-label b { line-height: 1.45; font-size: .9rem; }
.practice-label small {color:var(--text); font-size: .65rem; }
.desktop-workspace .phase-button { position: relative; grid-template-columns: 30px minmax(0,1fr); gap: 8px; margin: 2px 0; padding: 10px 10px; min-height: 52px; border: 1px solid transparent; border-radius: 10px; }
.desktop-workspace .phase-button small { font-size: .75rem; line-height: 1.45; font-weight: 550;color:var(--text); }
.desktop-workspace .phase-number { display: grid; place-items: center; width: 28px; height: 28px; font-size: .67rem; font-weight: 650;border:1px solid var(--line); border-radius: 8px;background:var(--panel-soft);color:var(--text); }
.desktop-workspace .phase-button.active {background:var(--panel-soft);border-color:var(--line); box-shadow: inset 3px 0 #43d5ed; }
.desktop-workspace .phase-button.active small {color:var(--text); font-weight: 700; }
.desktop-workspace .phase-button.active .phase-number {color:var(--text);background:var(--panel-soft);border-color:var(--line); }
.desktop-workspace .phase-button.done:not(.active) .phase-number {color:var(--text);background:var(--panel-soft);border-color:var(--line); }
.desktop-workspace .phase-button.done small {color:var(--text); }
.desktop-workspace .phase-button:hover:not(.active) {background:var(--panel-soft);border-color:var(--line); }
.practice-scroll { padding: 24px clamp(18px,3vw,56px) 0;background:var(--panel-soft); }
.practice-heading { margin-bottom: 24px; }
.practice-breadcrumb { display: flex; align-items: center; gap: 5px;color:var(--text); font-size: .7rem; margin-bottom: 20px; overflow-wrap: anywhere; }
.practice-breadcrumb .ui-icon { width: 12px; height: 12px; flex-basis: 12px; }
.practice-step-label {color:var(--text); font-size: .65rem; font-weight: 750; letter-spacing: .1em; margin-bottom: 7px; }
.practice-step-label span {color:var(--text); }
.practice-heading h1 { font-size: clamp(1.35rem,2vw,1.85rem); letter-spacing: -.035em; font-weight: 650; line-height: 1.2; margin-bottom: 8px; }
.practice-heading p { font-size: .8rem; line-height: 1.6;color:var(--text); }
.practice-columns { gap: 22px; align-items: start; }
.desktop-workspace .phase-card {background:var(--panel-soft);border-color:var(--line); border-radius: 16px; padding: 26px; box-shadow: 0 12px 32px #020a131f; }
.practice-core { position: sticky; top: 16px; align-self: start;background:var(--panel-soft); padding: 24px 18px;border-color:var(--line); }
.practice-core .eyebrow { margin-top: 22px; font-size: .7rem; }
.web-progress-orbit { position: relative; border: 0; width: 140px; height: 140px;background:var(--panel-soft); }
.web-progress-orbit::before { position: absolute; content: ''; inset: 0; padding: 5px; border-radius: 50%;background:var(--panel-soft); -webkit-mask: linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.web-progress-orbit strong { font-size: 2rem; }
.web-progress-orbit > span { margin-top: 7px;color:var(--text); }
.online-label {background:var(--panel-soft);border-color:var(--line);color:var(--text); font-size: .6rem; }
.core-stat { padding: 16px 0; font-size: .72rem; align-items: baseline; line-height: 1.4; }
.core-stat:last-child { padding-bottom: 0; }
.desktop-workspace .form-grid { gap: 20px 18px; align-items: start; }
.desktop-workspace .form-subsection { padding: 20px; margin: 4px 0;border:1px solid var(--line); border-radius: 12px;background:var(--panel-soft); }
.desktop-workspace .form-subsection h3 { display: flex; align-items: center; gap: 8px;color:var(--text); font-size: .68rem; font-weight: 700; letter-spacing: .085em; margin-bottom: 20px; }
.desktop-workspace .form-subsection h3::before { content: ''; width: 4px; height: 14px; border-radius: 3px;background:var(--panel-soft); }
.desktop-workspace .field { gap: 7px; }
.desktop-workspace .field label {color:var(--text); font-size: .82rem; font-weight: 550; line-height: 1.5; }
.desktop-workspace .field > small {color:var(--text); font-size: .67rem; line-height: 1.6; }
.desktop-workspace .control { min-height: 44px; padding: 10px 12px;color:var(--text);border:1px solid var(--line); border-radius: 8px;background:var(--panel-soft); font-size: .9rem; box-shadow: inset 0 1px 3px #02080f24; transition: border-color .15s,box-shadow .15s; }
.desktop-workspace .control::placeholder {color:var(--text); opacity: 1; }
.desktop-workspace .control:focus {border-color:var(--line); box-shadow: 0 0 0 3px #50cbe71f; }
.desktop-workspace .control:disabled, .desktop-workspace .control[readonly] {background:var(--panel-soft);color:var(--text); border-style: dashed; }
.desktop-workspace .radio-card {background:var(--panel-soft);border-color:var(--line);color:var(--text); font-size: .75rem; line-height: 1.6; }
.desktop-workspace .radio-card input { accent-color: #5fd6eb; width: 17px; height: 17px; flex-shrink: 0; }
.desktop-workspace .notice { padding: 14px 16px;border:1px solid var(--line);border-left:3px solid var(--line); border-radius: 10px;background:var(--panel-soft);color:var(--text); font-size: .74rem; line-height: 1.7; }
.desktop-workspace .notice b {color:var(--text); }
.desktop-workspace .notice.warning {border-color:var(--line); border-left-color: #e3b866;background:var(--panel-soft);color:var(--text); }
.desktop-workspace .notice.warning b {color:var(--text); }
.regulatory-note { margin-top: 3px;background:var(--panel-soft);border-color:var(--line); border-radius: 8px; }
.regulatory-note summary { padding: 10px 11px; gap: 7px; font-size: .68rem; line-height: 1.5; list-style: none; }
.regulatory-note summary::-webkit-details-marker { display: none; }
.regulatory-note summary > .ui-icon:first-child { width: 15px; height: 15px; flex-basis: 15px;color:var(--text); }
.regulatory-note summary > .ui-icon:last-child { width: 13px; height: 13px; flex-basis: 13px; margin-left: auto;color:var(--text); transition: transform .15s; }
.regulatory-note[open] summary > .ui-icon:last-child { transform: rotate(90deg); }
.regulatory-note summary b {color:var(--text); font-size: .65rem; }
.regulatory-note summary > span {color:var(--text); }
.regulatory-note p { padding: 0 12px 12px;color:var(--text); font-size: .7rem; line-height: 1.75; }
.desktop-workspace .section-title { font-size: .75rem;color:var(--text); margin: 26px 0 14px; }
.desktop-workspace .drop-grid { gap: 18px; }
.drop-zone { padding: 16px;border:1px solid var(--line); border-radius: 12px;background:var(--panel-soft); overflow: hidden; transition: border-color .15s; }
.drop-zone.has-file {border:1px solid var(--line);background:var(--panel-soft); }
.drop-zone:focus-visible, .drop-zone:focus-within { outline: none;border-color:var(--line); }
.attachment-heading { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.attachment-kind { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 38px;background:var(--panel-soft);border:1px solid var(--line); border-radius: 8px;color:var(--text); }
.has-file .attachment-kind {background:var(--panel-soft);border-color:var(--line);color:var(--text); }
.attachment-heading > div:nth-child(2) { flex: 1; min-width: 0; }
.attachment-heading h4 { font-size: .82rem; font-weight: 650; line-height: 1.45;color:var(--text); margin: 0; }
.attachment-heading p {color:var(--text); font-size: .72rem; line-height: 1.6; margin: 4px 0 0; }
.attachment-status { display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex-shrink: 0; font-size: .59rem; font-weight: 650; white-space: nowrap; padding: 4px 7px; border-radius: 6px;color:var(--text);background:var(--panel-soft);border:1px solid var(--line); }
.attachment-status.is-complete {color:var(--text);background:var(--panel-soft);border-color:var(--line); }
.attachment-status .ui-icon { width: 12px; height: 12px; flex-basis: 12px; }
.empty-upload { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 24px 14px;background:var(--panel-soft);border:1px dashed var(--line); border-radius: 9px; }
.empty-upload > .ui-icon { width: 28px; height: 28px;color:var(--text); }
.empty-upload b {color:var(--text); font-size: .76rem; }
.empty-upload span { max-width: 30ch; font-size: .66rem; line-height: 1.6;color:var(--text); }
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,165px),1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.document-card { min-width: 0; overflow: hidden;border:1px solid var(--line); border-radius: 9px;background:var(--panel-soft); }
.document-thumb { position: relative; display: block; width: 100%; height: 170px; padding: 0; overflow: hidden; border: 0;border-bottom:1px solid var(--line);background:var(--panel-soft);color:var(--text); cursor: pointer; }
.thumbnail-content { display: grid; align-content: center; justify-items: center; gap: 6px; width: 100%; height: 100%; position: relative; }
.thumbnail-content > .ui-icon { width: 30px; height: 30px; }
.thumbnail-content > span:last-child { font-size: .6rem; }
.thumbnail-content > :is(img,canvas) { display: block; width: 100%; height: 100%; object-fit: contain;background:var(--panel-soft); }
.document-thumb.is-pdf .thumbnail-content > canvas { width: auto; height: 100%; max-width: 100%; margin: auto; box-shadow: 0 2px 12px #1c344329; }
.document-thumb.is-image .thumbnail-content > img { object-fit: cover; }
.document-format { position: absolute; top: 8px; left: 8px; padding: 4px 6px;border:1px solid var(--line); border-radius: 5px;background:var(--panel-soft);color:var(--text); font-size: .55rem; font-weight: 750; }
.thumbnail-open { position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px;background:var(--panel-soft);color:var(--text); font-size: .62rem; opacity: 0; transition: opacity .15s; }
.document-thumb:hover .thumbnail-open, .document-thumb:focus-visible .thumbnail-open { opacity: 1; }
.document-info { display: grid; gap: 4px; padding: 11px 10px 10px; }
.document-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; font-size: .67rem;color:var(--text); }
.document-info small {color:var(--text); font-size: .59rem; }
.document-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 4px 5px;background:var(--panel-soft);border-top:1px solid var(--line); }
.doc-action { display: inline-flex; justify-content: center; align-items: center; gap: 4px; flex: 1 1 auto; min-height: 36px; padding: 6px; border: 0; border-radius: 5px; background: transparent;color:var(--text); font-size: .59rem; cursor: pointer; }
.doc-action .ui-icon { width: 14px; height: 14px; flex-basis: 14px; }
.doc-action:hover {background:var(--panel-soft);color:var(--text); }
.doc-action.is-danger {color:var(--text); }
.doc-action.is-danger:hover {background:var(--panel-soft);color:var(--text); }
.attachment-actions { margin: 14px 0 9px; gap: 7px; }
.desktop-workspace .attachment-actions .secondary-button { min-height: 40px; padding: 8px 11px;border:1px solid var(--line);background:var(--panel-soft);color:var(--text); border-radius: 7px; font-size: .66rem; gap: 6px; }
.desktop-workspace .attachment-actions .camera-button {background:var(--panel-soft);border-color:var(--line);color:var(--text); }
.attachment-actions .ui-icon { width: 15px; height: 15px; flex-basis: 15px; }
.attachment-example { display: inline-flex; align-items: center; gap: 5px; padding: 7px; background: transparent; border: 0;color:var(--text); font-size: .63rem; cursor: pointer; }
.attachment-footnote { display: flex; align-items: flex-start; gap: 5px; font-size: .59rem;color:var(--text); line-height: 1.6; }
.attachment-footnote .ui-icon { width: 12px; height: 12px; flex-basis: 12px; margin-top: 2px; }
.practice-footer { position: sticky; z-index: 10; bottom: 0; margin: 18px -1px 0; padding: 16px 0 max(16px,env(safe-area-inset-bottom));background:var(--panel-soft); backdrop-filter: blur(16px);border-top:1px solid var(--line); }
.practice-footer button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; }
.desktop-workspace .practice-footer .primary-button { padding: 12px 20px;background:var(--panel-soft); font-weight: 650; box-shadow: 0 4px 12px #1699bc24; font-size: .76rem; }
.practice-footer .save-state {color:var(--text); font-size: .64rem; }
.practice-footer .save-state .ui-icon {color:var(--text); width: 14px; height: 14px; }
.remove-dialog-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;color:var(--text);background:var(--panel-soft); margin-bottom: 14px; }
.modal .danger-button { display: inline-flex; align-items: center; gap: 7px; }
.document-viewer { width: min(1100px,96vw); height: min(94dvh,1100px); max-width: 96vw; max-height: 94dvh; padding: 0; overflow: hidden;border:1px solid var(--line); border-radius: 14px;background:var(--panel-soft);color:var(--text); box-shadow: 0 28px 90px #0008; }
.document-viewer[open] { display: flex; flex-direction: column; }
.document-viewer::backdrop {background:var(--panel-soft); backdrop-filter: blur(7px); }
.viewer-header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px;background:var(--panel-soft);border-bottom:1px solid var(--line); }
.viewer-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.viewer-title > div { min-width: 0; }
.viewer-header h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; font-weight: 550; }
.viewer-close { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0;border:1px solid var(--line); border-radius: 7px;background:var(--panel-soft);color:var(--text); cursor: pointer; }
.viewer-toolbar { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 18px;background:var(--panel-soft);border-bottom:1px solid var(--line); }
.viewer-pagination, .viewer-zoom { display: flex; align-items: center; gap: 8px; font-size: .7rem; }
.viewer-toolbar button { display: grid; place-items: center; width: 34px; height: 34px;border:1px solid var(--line); border-radius: 6px;background:var(--panel-soft);color:var(--text); cursor: pointer; }
.viewer-toolbar [hidden] { display: none; }
.viewer-download { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 7px 10px;border:1px solid var(--line); border-radius: 6px;background:var(--panel-soft); text-decoration: none; font-size: .7rem; }
.viewer-stage { flex: 1 1 0; min-height: 0; display: block; overflow: auto; text-align: center; padding: 20px;background:var(--panel-soft); }
.viewer-stage canvas, .viewer-stage img { display: block; margin: auto; box-shadow: 0 4px 20px #03101e50; background: white; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
@container practice (max-width: 900px) {
 .desktop-workspace .phase-rail { padding: 12px 5px; }
 .desktop-workspace .phase-button { grid-template-columns: 1fr; justify-items: center; padding: 8px 3px; margin: 1px 0; }
 .desktop-workspace .phase-card { padding: 20px; }
 .desktop-workspace .form-subsection { padding: 16px; }
 .practice-scroll { padding: 18px 14px 0; }
}
@container practice (max-width: 600px) {
 .practice-layout { grid-template-columns: 52px minmax(0,1fr); }
 .desktop-workspace .practice-topbar { min-height: 0; padding: 10px 12px; }
 .desktop-workspace .top-actions { gap: 5px; }
 .desktop-workspace .top-actions button { min-height: 38px; font-size: .61rem; }
 .desktop-workspace .phase-button { min-height: 44px; }
 .desktop-workspace .phase-number { width: 25px; height: 25px; font-size: .6rem; }
 .practice-scroll { padding: 16px 10px 0; }
 .practice-breadcrumb { font-size: .62rem; margin-bottom: 14px; }
 .desktop-workspace .phase-card { padding: 13px; border-radius: 12px; }
 .desktop-workspace .form-subsection { padding: 12px; }
 .desktop-workspace .control { font-size: max(16px,.85rem); }
 .desktop-workspace .form-grid { gap: 17px; }
 .drop-zone { padding: 12px; }
 .attachment-heading { flex-wrap: wrap; gap: 8px; }
 .attachment-status { margin-left: 44px; }
 .document-thumb { height: 185px; }
 .doc-action { min-height: 44px; }
 .thumbnail-open { opacity: 1; padding: 6px; }
 .attachment-actions .file-picker { flex: 1 1 100%; width: 100%; min-height: 44px; }
 .practice-footer { grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: 8px; padding: 12px 0 max(12px,env(safe-area-inset-bottom)); }
 .practice-footer button { padding: 10px; font-size: .67rem; }
 .desktop-workspace .practice-footer .primary-button { padding: 10px; font-size: .68rem; }
 .practice-footer .save-state { grid-column: 1 / -1; font-size: .58rem; }
}
@media(max-width:600px) {
 .document-viewer { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
 .viewer-header { padding: 12px; }
 .viewer-toolbar { padding: 8px 12px; }
 .viewer-toolbar button { width: 40px; height: 40px; }
 .viewer-stage { padding: 12px; }
 .viewer-toolbar { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
 .viewer-zoom { display:flex; grid-column:1; grid-row:2; }
 .viewer-download { grid-column:2; grid-row:1; min-height:40px; }
 .viewer-download span { display: none; }
}
:root[data-theme="light"] .desktop-workspace { --text:#193147; --muted:#567086; --line:#c4d5e2;background:var(--panel-soft); }
:root[data-theme="light"] .practice-scroll {background:var(--panel-soft); }
:root[data-theme="light"] .desktop-workspace .phase-card {background:var(--panel-soft);border-color:var(--line); box-shadow:0 6px 24px #193c5910; }
:root[data-theme="light"] .desktop-workspace .form-subsection {background:var(--panel-soft);border-color:var(--line); }
:root[data-theme="light"] .desktop-workspace .form-subsection h3 {color:var(--text); }
:root[data-theme="light"] .desktop-workspace .control {background:var(--panel-soft);color:var(--text);border-color:var(--line); box-shadow:inset 0 1px 2px #1b385b08; }
:root[data-theme="light"] .desktop-workspace .field label {color:var(--text); }
:root[data-theme="light"] .desktop-workspace .field > small {color:var(--text); }
:root[data-theme="light"] .desktop-workspace .notice {background:var(--panel-soft);border-color:var(--line);color:var(--text); }
:root[data-theme="light"] .desktop-workspace .notice b {color:var(--text); }
:root[data-theme="light"] .desktop-workspace .notice.warning {background:var(--panel-soft);border-color:var(--line);color:var(--text); }
:root[data-theme="light"] .regulatory-note {background:var(--panel-soft);border-color:var(--line); }
:root[data-theme="light"] .regulatory-note summary :is(b,span), :root[data-theme="light"] .regulatory-note p {color:var(--text); }
:root[data-theme="light"] .practice-heading p, :root[data-theme="light"] .practice-breadcrumb {color:var(--text); }
:root[data-theme="light"] .drop-zone {background:var(--panel-soft);border-color:var(--line); }
:root[data-theme="light"] .drop-zone.has-file {background:var(--panel-soft);border-color:var(--line); }
:root[data-theme="light"] .attachment-heading h4 {color:var(--text); }
:root[data-theme="light"] .attachment-heading p {color:var(--text); }
:root[data-theme="light"] .document-card {background:var(--panel-soft);border-color:var(--line); }
:root[data-theme="light"] .document-info b {color:var(--text); }
:root[data-theme="light"] .document-info small {color:var(--text); }
:root[data-theme="light"] .document-actions {background:var(--panel-soft);border-color:var(--line); }
:root[data-theme="light"] .doc-action {color:var(--text); }
:root[data-theme="light"] .doc-action:hover {background:var(--panel-soft); }
:root[data-theme="light"] .doc-action.is-danger {color:var(--text); }
:root[data-theme="light"] .doc-action.is-danger:hover {background:var(--panel-soft); }
:root[data-theme="light"] .empty-upload {background:var(--panel-soft);border-color:var(--line); }
:root[data-theme="light"] .empty-upload b {color:var(--text); }
:root[data-theme="light"] .empty-upload span {color:var(--text); }
:root[data-theme="light"] .practice-footer {background:var(--panel-soft);border-color:var(--line); }
:root[data-theme="light"] .practice-footer .save-state {color:var(--text); }

.thumbnail-content[data-loaded="true"] { display:flex; align-items:center; justify-content:center; }
.thumbnail-content[data-loaded="true"] > :is(img,canvas) { min-width:0; min-height:0; max-width:100%; max-height:100%; object-fit:contain; }

:root[data-theme="light"] .desktop-workspace .section-title {color:var(--text); }
:root[data-theme="light"] .practice-step-label {color:var(--text); }
:root[data-theme="light"] .practice-step-label span {color:var(--text); }
:root[data-theme="light"] .save-state {color:var(--text); }

.attachment-grid, .attachment-heading, .document-card { width:100%; box-sizing:border-box; }

/* Progress keeps its measured arc; a separate highlight orbits around it. */
.web-progress-orbit { --ring-color:#5bd6ea; isolation:isolate;  }
.web-progress-orbit::after { content:''; position:absolute; inset:-7px; border:1px solid transparent; border-top-color:var(--ring-color); border-right-color:color-mix(in srgb,var(--ring-color) 22%,transparent); border-radius:50%; pointer-events:none; animation:nexus-orbit 7s linear infinite; opacity:.65; }
.web-progress-orbit.is-complete { --ring-color:#59e5a5;background:var(--panel-soft); box-shadow:0 0 24px #43da8d13; }
.web-progress-orbit.is-complete strong {color:var(--text); }
.web-progress-orbit.is-complete>span {color:var(--text); }
.online-label { display:inline-flex; align-items:center; gap:8px; }
.status-led { position:relative; display:inline-block; width:7px; height:7px; flex:0 0 7px; border-radius:50%;background:var(--panel-soft); box-shadow:0 0 7px #4de6a48c; }
.is-online .status-led::after { content:''; position:absolute; inset:-4px;border:1px solid var(--line); border-radius:50%; box-shadow:0 0 5px #53e7a44d; animation:nexus-online-pulse 2.8s ease-out infinite; }
.online-label.is-offline {color:var(--text);background:var(--panel-soft);border-color:var(--line); }
.is-offline .status-led {background:var(--panel-soft); box-shadow:none; }
@keyframes nexus-orbit { to { transform:rotate(360deg); } }
@keyframes nexus-online-pulse { 0% { transform:scale(.5); opacity:0; } 14% { opacity:.8; } 78%,100% { transform:scale(1.8); opacity:0; } }
:root[data-theme="light"] .web-progress-orbit.is-complete {background:var(--panel-soft); box-shadow:0 0 20px #21a96916; }
:root[data-theme="light"] .web-progress-orbit.is-complete strong {color:var(--text); }
:root[data-theme="light"] .web-progress-orbit.is-complete>span {color:var(--text); }
@media(prefers-reduced-motion:reduce) { .web-progress-orbit,.web-progress-orbit::after,.is-online .status-led::after { animation:none; } .is-online .status-led::after { opacity:0; } }

.intervention-options { min-width:0; margin:0; border:1px solid var(--line); border-radius:10px; padding:14px; display:grid; gap:9px; }
.intervention-options legend { padding:0 6px; color:var(--muted); font-size:.78rem; }
.intervention-options .radio-card { margin:0; min-height:44px; display:flex; align-items:center; gap:10px; padding:10px; }
.intervention-options .radio-card input { flex-shrink:0; }
.intervention-options .radio-card span { min-width:0; overflow-wrap:anywhere; }
@media(max-width:900px),(pointer:coarse) {
 .desktop-workspace button,.desktop-workspace .upload-button,.desktop-workspace .camera-button,.inline-note-button,.note-tooltip-close { min-height:44px; }
 .note-tooltip-close { width:44px; height:44px; }
 .inline-note-tooltip header { grid-template-columns:auto minmax(0,1fr) 44px; }
 .desktop-workspace .control { min-height:44px; }
 .document-actions { flex-wrap:wrap; }
 .stamp-workflow button { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
}

.section-title.field-label-row { flex-wrap: wrap; }

.signing-details { margin: 14px 0; }
.signing-details p { color: var(--muted); margin: 0 0 10px; }
.desktop-workspace .signature-item {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 10px;
}
.desktop-workspace .signature-item > span b { font-size: .9rem; line-height: 1.4; }
.desktop-workspace .signature-item > span small { font-size: .75rem; line-height: 1.4; }
.desktop-workspace .signature-item .drop-zone { padding: 10px; min-height: 0; }
.desktop-workspace .signature-item .empty-upload,
.desktop-workspace .signature-item .attachment-footnote,
.desktop-workspace .signature-item .attachment-kind { display: none; }
.desktop-workspace .signature-item .attachment-heading { grid-template-columns: minmax(0,1fr) auto; }
.desktop-workspace .signature-item .attachment-actions { margin-top: 8px; }
@media (max-width: 900px) {
  .desktop-workspace .signature-item { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 640px) {
  .desktop-workspace .drop-grid.personal-documents-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.desktop-workspace .intervention-choice {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.intervention-illustration {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.intervention-illustration img {
  display: block;
  width: 100%;
  height: auto;
}

.intervention-illustration figcaption {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

.intervention-illustration figcaption span {
  font-size: .72rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .desktop-workspace .intervention-choice {
    grid-template-columns: minmax(0, 1fr);
  }
}
.nexus-error-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 30px; box-sizing: border-box; overflow: auto;color:var(--text);background:var(--panel-soft);border:1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 80px #0009; }
.nexus-error-dialog::backdrop {background:var(--panel-soft); backdrop-filter: blur(4px); }
.nexus-error-dialog .error-dismiss { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent;color:var(--text); font: 30px/1 sans-serif; cursor: pointer; }
.nexus-error-dialog .error-dismiss:hover {background:var(--panel-soft); color: white; }
.nexus-error-dialog .error-symbol { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px; border-radius: 50%;background:var(--panel-soft);color:var(--text); font-size: 26px; font-weight: 700; }
.nexus-error-dialog h2 { margin: 0 24px 14px 0; font-size: 23px; line-height: 1.25; }
.nexus-error-dialog p { margin: 0 0 16px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-line; }
.nexus-error-dialog .error-help {color:var(--text); }
.nexus-error-dialog .error-confirm { display: block; min-height: 46px; margin: 24px 0 0 auto; }
.nexus-error-dialog button:focus-visible { outline: 2px solid #59def4; outline-offset: 3px; }
@media(max-width: 480px) { .nexus-error-dialog { padding: 24px; } .nexus-error-dialog h2 { font-size: 21px; } .nexus-error-dialog .error-confirm { width: 100%; } }
.nexus-delivery-dialog { margin: auto; width: min(640px,calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; overflow: auto; padding: 30px;border:1px solid var(--line); border-radius: 18px;background:var(--panel-soft);color:var(--text); box-shadow: 0 24px 80px #0009; }
.nexus-delivery-dialog::backdrop {background:var(--panel-soft); backdrop-filter: blur(4px); }
.nexus-delivery-dialog h2 { margin: 0 36px 16px 0; font-size: 24px; }
.nexus-delivery-dialog p { line-height: 1.6; overflow-wrap: anywhere; }
.nexus-delivery-dialog .delivery-close { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent;color:var(--text); font-size: 30px; cursor: pointer; }
.nexus-delivery-dialog [data-delivery-content] { display: grid; gap: 12px; }
.nexus-delivery-dialog label { display: grid; gap: 6px;color:var(--text); font-size: 14px; }
.nexus-delivery-dialog textarea { box-sizing: border-box; width: 100%; min-width: 0; padding: 12px;border:1px solid var(--line); border-radius: 8px;background:var(--panel-soft);color:var(--text); font: inherit; line-height: 1.5; resize: vertical; }
.nexus-delivery-dialog .secondary-button { width: 100%; box-sizing: border-box; min-height: 46px; white-space: normal; text-align: center; justify-content: center; text-decoration: none; }
.nexus-delivery-dialog .delivery-hint { margin: 4px 0 0;color:var(--text); font-size: 13px; }
.nexus-delivery-dialog :focus-visible { outline: 2px solid #59def4; outline-offset: 3px; }
@media(max-width:480px) { .nexus-delivery-dialog { padding: 24px; } }
.package-actions .package-action-ready:not(:disabled) {background:var(--panel-soft);border:1px solid var(--line);color:var(--text); box-shadow: 0 0 16px #27c78224; }
.package-actions .package-action-ready:not(:disabled):hover {background:var(--panel-soft);border-color:var(--line); }
.nexus-delivery-dialog .delivery-steps { margin: 0; padding-left: 22px;color:var(--text); line-height: 1.65; }
.nexus-delivery-dialog .delivery-steps li + li { margin-top: 10px; }

.integration-request-panel { display: grid; justify-items: start; gap: 6px; width: fit-content; max-width: 100%; box-sizing: border-box; margin: 12px 0 0; padding: 10px 12px;border-left:2px solid var(--line);background:var(--panel-soft); border-radius: 0 8px 8px 0; }
.integration-request-panel h4 { margin: 0; color: var(--text); font-size: 13px; line-height: 1.3; }
.integration-request-panel small { color: var(--muted); font-size: 11px; }
.integration-message { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; font-size: 13px; color: var(--text); }
.integration-in-review, .status-pill.in-elaborazione {color:var(--text); }
.integration-admin-files { display: grid; gap: 8px; }
.integration-admin-files button { white-space: normal; overflow-wrap: anywhere; text-align: left; }
.approve-integration-action { margin-top: 8px; white-space: normal; min-height: 40px; font-size: 12px; padding: 8px 12px; }
.integration-request-panel .integration-request-button { width: auto; max-width: 100%; min-height: 36px; margin-top: 2px; padding: 6px 10px; font-size: 12px; white-space: normal; text-align: left; }
.integration-request-panel .integration-request-button { color: var(--amber);background:var(--panel-soft);border-color:var(--line); }
.integration-request-panel .integration-request-button:hover { color: var(--amber);background:var(--panel-soft); border-color: var(--amber); }
.practice-scroll > .integration-request-panel { margin: 0 0 16px; }
@media(any-pointer:coarse) { .integration-request-panel .integration-request-button { min-height: 44px; } }
.integration-request-badge { cursor: pointer; font-family: inherit; white-space: normal; text-align: left; animation: nexus-integration-breathe 3.8s ease-in-out infinite; }
.integration-request-badge:hover { border-color: var(--amber); }
.integration-request-badge:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.practice-label .integration-request-badge { margin-top: 8px; }
@keyframes nexus-integration-breathe { 0%,100% { opacity: .83; box-shadow: 0 0 0 #eebd5e00; } 50% { opacity: 1; box-shadow: 0 0 10px #eebd5e28; } }
.is-online .status-led, .is-online .status-dot { animation: nexus-led-breathe 2.8s ease-in-out infinite; }
@keyframes nexus-led-breathe { 0%,100% { opacity: .55; box-shadow: 0 0 4px #4de6a455; } 50% { opacity: 1; box-shadow: 0 0 11px #4de6a4b0; } }
.online-label { text-transform: uppercase; }
.online-label.is-offline {color:var(--text);background:var(--panel-soft);border-color:var(--line); }
.is-offline .status-led, .is-offline .status-dot {background:var(--panel-soft); box-shadow: 0 0 5px #f16b7d55; animation: none; }
.is-checking .status-led, .is-checking .status-dot {background:var(--panel-soft); box-shadow: none; animation: none; }
.is-offline .status-led::after, .is-checking .status-led::after { display: none; animation: none; }
.brand img, .login-mark { transform-origin: center; }
html[data-connection="online"][data-page-active="true"] .brand img,
html[data-connection="online"][data-page-active="true"] .login-mark { animation: nexus-logo-breathe 6s ease-in-out infinite; }
@keyframes nexus-logo-breathe { 0%,100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 1px #3ad3e52b); } 50% { transform: translateY(-1px) scale(1.025); filter: drop-shadow(0 0 5px #3ad3e55c); } }
html[data-page-active="false"] .integration-request-badge,
html[data-page-active="false"] .status-led,
html[data-page-active="false"] .status-dot,
html[data-page-active="false"] .status-led::after { animation-play-state: paused; }
@media(prefers-reduced-motion:reduce) { .integration-request-badge,.is-online .status-led,.is-online .status-dot,html[data-connection="online"][data-page-active="true"] .brand img,html[data-connection="online"][data-page-active="true"] .login-mark { animation: none; } }

.integration-files { display: grid; gap: 10px; margin: 16px 0; }
.integration-file { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 12px;border:1px solid var(--line); border-radius: 10px; }
.integration-file span { overflow-wrap: anywhere; min-width: 0; }
.integration-file .secondary-button { min-width: 0; min-height: 44px; }
.integration-actions { display: grid; gap: 10px; }
.integration-actions .package-action-ready:not(:disabled) {background:var(--panel-soft);border:1px solid var(--line);color:var(--text); }
.integration-actions .package-action-ready:not(:disabled):hover {background:var(--panel-soft); }
.integration-actions .integration-confirm-awaiting:not(:disabled) {background:var(--panel-soft);border-color:var(--line);color:var(--text); font-weight: 800; }
.integration-actions .integration-confirm-awaiting:not(:disabled):hover {background:var(--panel-soft); }
.integration-actions .integration-confirm-done:disabled {background:var(--panel-soft);border-color:var(--line);color:var(--text); opacity: 1; cursor: default; }
.integration-received {color:var(--text);background:var(--panel-soft);border-color:var(--line); white-space: normal; }
.nexus-drive-dialog .drive-confirm { grid-template-columns: 24px minmax(0,1fr); align-items: start; line-height: 1.5; }
.nexus-drive-dialog input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: #37d8ea; }
.nexus-drive-dialog input.control { width: 100%; min-width: 0; box-sizing: border-box; }
.nexus-drive-dialog details { padding: 12px;border:1px solid var(--line); border-radius: 10px; }
.nexus-drive-dialog details label { margin-bottom: 12px; }
.nexus-drive-dialog .drive-practices { min-inline-size: 0;border:1px solid var(--line); border-radius: 10px; padding: 12px; }
.nexus-drive-dialog .drive-practices label + label { margin-top: 12px; }
.nexus-drive-dialog .drive-practices label { overflow-wrap: anywhere; }
.nexus-integration-dialog .file-picker { cursor: pointer; }
.nexus-delivery-dialog .primary-button { white-space: normal; overflow-wrap: anywhere; min-height: 46px; }
@media(max-width:480px) { .integration-file { grid-template-columns: minmax(0,1fr); } }
.integration-review { display: grid; gap: 8px; min-width: 0; margin-top: 8px; }
.integration-review small { overflow-wrap: anywhere; }
.integration-review-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.integration-review-actions .approve-integration-action { display: inline-flex; align-items: center; max-width: 100%; margin-top: 0; }
.integration-review-actions a { white-space: nowrap; text-decoration: none; }
.integration-review > .text-button { justify-self: start; overflow-wrap: anywhere; }

/* Moduli firmati: titolo sopra il caricamento, senza colonna vuota. */
.desktop-workspace .signature-upload-item{grid-template-columns:minmax(0,1fr);gap:8px;padding:12px;align-items:start}
.desktop-workspace .signature-upload-title{text-align:center;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:4px 10px;overflow-wrap:anywhere}
.desktop-workspace .signature-upload-title small{flex-basis:100%}
.desktop-workspace .signature-upload-count{font-size:.72rem;color:var(--muted);border:1px solid var(--line);border-radius:20px;padding:2px 8px}
.desktop-workspace .signature-upload-item .drop-zone{width:100%;box-sizing:border-box;margin:0 auto;padding:10px;min-width:0}
.desktop-workspace .signature-upload-item .attachment-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),320px));justify-content:center;gap:10px}
.desktop-workspace .signature-upload-item .document-thumb{height:340px}
.desktop-workspace .signature-upload-item .attachment-heading{display:none}
.desktop-workspace .signature-upload-item .attachment-heading{margin-bottom:8px}
.desktop-workspace .signature-upload-item .attachment-actions{justify-content:center;gap:8px}
@media(max-width:480px){.desktop-workspace .signature-upload-item{padding:9px}.desktop-workspace .signature-upload-title b{font-size:.82rem}}

.desktop-workspace .signed-modules-card{container-type:inline-size}
.desktop-workspace .signature-upload-list{grid-template-columns:minmax(0,1fr);align-items:start;gap:12px}
.desktop-workspace .signature-upload-list .signature-upload-item{min-width:0;height:100%;box-sizing:border-box}


.desktop-workspace .package-generating:disabled{position:relative;isolation:isolate;overflow:hidden;opacity:1;cursor:wait;background:var(--panel-soft);color:var(--text);border-color:var(--line)}
.package-generating::before{content:"";position:absolute;inset:0;z-index:-1;background:var(--panel-soft);width:55%;animation:package-sweep 1.7s ease-in-out infinite}
@keyframes package-sweep{from{transform:translateX(-110%)}to{transform:translateX(240%)}}
@media(prefers-reduced-motion:reduce){.package-generating::before{animation:none;transform:none;width:100%;opacity:.4}}

.account-security-dialog h3{margin:1.2rem 0 .6rem}.account-security-dialog p{line-height:1.5}.account-security-dialog .control{width:100%;box-sizing:border-box;margin:.4rem 0 .7rem}.security-credentials{list-style:none;padding:0}.security-credentials li{display:flex;justify-content:space-between;align-items:center;gap:.75rem;flex-wrap:wrap;margin:.5rem 0}.security-recovery-codes{font-family:monospace;white-space:pre;overflow-x:auto}.account-security-dialog[aria-busy="true"]{cursor:wait}

.password-access-panel{width:100%;max-width:440px;margin-inline:auto}.password-access-panel h2{margin-bottom:10px}.password-access-intro{font-size:14px;line-height:1.6;color:var(--muted);margin:0 0 24px}.password-access-fields{display:grid;gap:8px}.password-access-fields label:not(:first-child){margin-top:10px}.password-access-fields .control{width:100%;min-height:48px}.password-access-submit{width:100%;margin-top:24px;min-height:48px}.password-access-help{text-align:center;margin-top:12px}.password-access-help .text-button{font-size:14px;padding:8px}.password-access-first{margin:20px 0 0;padding-top:18px;border-top:1px solid var(--line,var(--line));font-size:12px;line-height:1.6;text-align:center;color:var(--muted)}

.account-security-dialog .delivery-close{position:absolute;right:14px;top:12px;width:38px;height:38px;border:1px solid var(--line);border-radius:10px;background:var(--panel-soft);color:var(--text);font-size:28px;line-height:1;cursor:pointer}.account-security-dialog .delivery-close:hover{background:var(--panel-soft);color:var(--text)}.account-security-dialog h2{padding-right:40px}.password-request-success{padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--panel-soft);color:var(--text);font-size:14px}.top-actions .ui-icon{width:21px;height:21px}.sidebar .nav-button>.ui-icon{width:20px;height:20px;flex-shrink:0}

.account-security-dialog{width:min(520px,calc(100vw - 32px));max-height:calc(100vh - 40px);box-sizing:border-box;overflow:auto;border:1px solid var(--line);border-radius:18px;padding:28px;background:var(--panel-solid);color:var(--text);box-shadow:var(--shadow)}.account-security-dialog::backdrop{background:var(--panel-soft)}.account-security-dialog h2{font-size:24px;margin:0 0 18px}.account-security-dialog p{font-size:14px;color:var(--muted)}.company-welcome{margin-bottom:20px;padding:12px 0;overflow:hidden;border-block:1px solid var(--line);color:var(--cyan);font-size:14px;white-space:nowrap;animation:welcome-hide .5s 13.5s forwards}.company-welcome span{display:inline-block;min-width:100%;padding-left:100%;animation:welcome-scroll 14s linear both}@keyframes welcome-scroll{from{transform:translateX(0)}to{transform:translateX(-100%)}}@keyframes welcome-hide{to{opacity:0}}@media(prefers-reduced-motion:reduce){.company-welcome{white-space:normal;animation:none}.company-welcome span{padding-left:16px;padding-right:16px;min-width:0;animation:none}}

.archive-active{display:inline-flex;align-items:center;gap:7px}.archive-active i{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--panel-soft);animation:archive-led-pulse 2.8s ease-in-out infinite}@keyframes archive-led-pulse{0%,100%{opacity:.65;box-shadow:0 0 0 0 rgba(67,213,160,.08)}50%{opacity:1;box-shadow:0 0 0 4px rgba(67,213,160,.15)}}@media(prefers-reduced-motion:reduce){.archive-active i{animation:none}}
.company-welcome{text-align:center}.company-welcome span{min-width:0;padding-left:0;animation:welcome-arrive 14s both}@keyframes welcome-arrive{0%{transform:translateX(100vw);animation-timing-function:cubic-bezier(.15,.65,.2,1)}32%{transform:translateX(0)}68%{transform:translateX(0);animation-timing-function:cubic-bezier(.55,0,1,.45)}100%{transform:translateX(-100vw)}}@media(prefers-reduced-motion:reduce){.company-welcome span{animation:none}}

.archive-active::before{content:none}

#setting-companyName:disabled{background:var(--panel-soft);color:var(--muted);border-color:var(--line);opacity:1;cursor:default;pointer-events:none}
