:root{--red:#df0b12;--red2:#9f060b;--ink:#14161b;--muted:#667085;--line:#e6e9ef;--bg:#f5f6f8;--card:#fff;--soft:#fafbfc;--green:#0b8f4d;--amber:#b86b00;--blue:#1d4d9f;--shadow:0 8px 24px rgba(20,22,27,.07);--radius:14px;--font:"Inter","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}*{box-sizing:border-box}html{font-size:14px}body{margin:0;font-family:var(--font);font-size:13px;line-height:1.42;background:var(--bg);color:var(--ink);letter-spacing:-.01em}a{color:var(--red);text-decoration:none}a:hover{text-decoration:underline}small,.muted{display:block;color:var(--muted);font-size:11.5px}.sidebar{position:fixed;inset:0 auto 0 0;width:238px;background:#15171d;color:white;padding:12px 12px 16px;display:flex;flex-direction:column;gap:12px;box-shadow:8px 0 24px #0002}.brand{background:#fff;border-radius:16px;padding:10px;min-height:122px;display:grid;place-items:center;box-shadow:inset 0 0 0 1px #ffffff44}.brand img{width:100%;max-height:112px;object-fit:contain;display:block}.nav{display:flex;flex-direction:column;gap:3px;overflow:auto;padding-right:2px}.nav span{margin:10px 8px 4px;color:#838995;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.08em}.nav a{color:#d9dde6;padding:8px 10px;border-radius:9px;font-weight:650;font-size:12.5px}.nav a:hover,.nav a.active{background:linear-gradient(135deg,var(--red),var(--red2));color:#fff;text-decoration:none}.logout{margin-top:auto;border:1px solid #414752;background:#20242b;color:#fff;border-radius:10px;padding:9px;width:100%;font-weight:800;cursor:pointer}.main{margin-left:238px;padding:16px 20px 24px}.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.topbar h1{font-size:23px;margin:0;letter-spacing:-.035em}.topbar p{margin:3px 0 0;color:var(--red);font-weight:800;font-size:12.5px}.userbox{text-align:right;background:#fff;border:1px solid var(--line);border-radius:13px;padding:9px 12px;box-shadow:0 5px 14px rgba(20,22,27,.04)}.login-page{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at 30% 0,#fff 0,#f8f9fb 44%,#e8ecf3 100%);padding:28px}.login-card{width:540px;background:rgba(255,255,255,.96);border:1px solid var(--line);border-radius:26px;padding:26px 30px;box-shadow:0 28px 80px rgba(20,22,27,.15)}.login-logo{width:380px;max-width:100%;display:block;margin:0 auto 12px}.login-card h2{font-size:24px;margin:0;text-align:center;letter-spacing:-.035em}.login-card p{text-align:center;color:var(--muted);line-height:1.5;margin:7px 0 18px}label{display:block;font-weight:700;margin:9px 0 5px;text-transform:none}input,select,textarea{width:100%;border:1px solid #d8dde7;border-radius:10px;padding:9px 10px;font:inherit;background:#fff;outline:none}input:focus,select:focus,textarea:focus{border-color:var(--red);box-shadow:0 0 0 3px rgba(223,11,18,.08)}textarea{resize:vertical}.primary,.primary-link{display:inline-block;background:linear-gradient(135deg,var(--red),var(--red2));border:0;color:white!important;border-radius:10px;padding:9px 13px;font-weight:800;cursor:pointer}.primary-link{margin:0 8px 10px 0}.primary:hover,.primary-link:hover{text-decoration:none;filter:brightness(.98)}.soft-link,.danger-link{display:inline-block;background:#fff;border:1px solid var(--line);color:var(--ink);border-radius:10px;padding:8px 12px;font-weight:750;margin:0 8px 10px 0}.danger-link{color:var(--red);border-color:#ffd1d4}.actions-row,.page-actions,.form-actions{display:flex;justify-content:flex-end;gap:8px;align-items:center;margin-bottom:10px;flex-wrap:wrap}.validation-summary{color:var(--red);font-size:12px}.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:12px}.kpi{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px;box-shadow:var(--shadow)}.kpi span{color:var(--muted);font-weight:750;font-size:11.5px}.kpi strong{display:block;font-size:30px;margin:4px 0;letter-spacing:-.04em}.kpi em{font-style:normal;color:var(--green);font-weight:750}.kpi.danger strong,.kpi.danger em{color:var(--red)}.kpi.warning strong,.kpi.warning em{color:var(--amber)}.grid{display:grid;gap:12px}.grid.two{grid-template-columns:1fr 1fr}.grid.three{grid-template-columns:repeat(3,1fr)}.card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px;box-shadow:var(--shadow);margin-bottom:12px}.card h2,.card h3{margin:0 0 9px;letter-spacing:-.025em}.card h2{font-size:18px}.card h3{font-size:15px}.table-wrap{overflow:auto}.hn-table,table{width:100%;border-collapse:collapse}th{font-size:10.5px;text-transform:uppercase;text-align:left;color:var(--muted);border-bottom:1px solid var(--line);padding:8px;letter-spacing:.035em}td{border-bottom:1px solid var(--line);padding:8px;vertical-align:top}tr:hover td{background:#fff8f8}.nowrap{white-space:nowrap}.badge{display:inline-block;background:#fff0f1;color:var(--red);border:1px solid #ffd1d4;border-radius:999px;padding:3px 8px;font-weight:800;font-size:10.5px}.badge.big{font-size:12px;padding:6px 10px}.score{display:inline-block;margin-left:8px;color:var(--muted);font-weight:700}.form-card{max-width:1120px}.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:6px 14px}.form-grid.three{grid-template-columns:repeat(3,1fr)}.check{display:flex;gap:8px;align-items:center}.check input{width:auto}.status-bars div{position:relative;margin:10px 0;padding:9px;background:#f9fafb;border-radius:10px;overflow:hidden}.status-bars i{position:absolute;left:0;bottom:0;height:3px;background:var(--red);border-radius:4px}.status-bars span{float:right;font-weight:800}.timeline div,.notification,.calendar-item{padding:10px;border-left:4px solid var(--red);background:#fafafa;border-radius:10px;margin-bottom:7px}.timeline span,.notification span{float:right;color:var(--muted);font-size:11.5px}.notification.unread{background:#fff5f5}.record-hero{display:flex;justify-content:space-between;align-items:center;background:linear-gradient(135deg,#fff,#fff6f6);border:1px solid #ffd1d4;border-radius:18px;padding:16px;margin-bottom:12px}.record-hero h2{font-size:25px;margin:0}.record-hero p{color:var(--muted);font-weight:700}.mini-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.mini-grid div{background:#f9fafb;border-radius:12px;padding:10px}.mini-grid b{display:block;color:var(--muted);font-size:10.5px;text-transform:uppercase;margin-bottom:5px}.calendar-item{display:grid;grid-template-columns:88px 1fr 180px;align-items:center;border-left-color:var(--blue)}button{border:1px solid var(--line);background:#fff;border-radius:9px;padding:7px 9px;cursor:pointer;font:inherit}.admin-hero{background:linear-gradient(135deg,#fff,#fff7f7)}.quick-actions{display:flex;gap:8px;flex-wrap:wrap}.master-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:11px}.master-tile{display:block;border:1px solid var(--line);border-radius:14px;padding:12px;background:var(--soft);color:var(--ink)}.master-tile:hover{border-color:#ffb8bd;text-decoration:none;box-shadow:var(--shadow)}.master-tile b{display:block;font-size:14px}.master-tile span{display:block;color:var(--muted);font-size:11.5px;margin-top:4px}.tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}.tabs a{padding:7px 10px;border:1px solid var(--line);border-radius:999px;background:#fff;color:var(--ink);font-weight:750}.tabs a.active{background:var(--red);color:white;border-color:var(--red)}.section-title{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:900;margin:8px 0}.hint{background:#fff8f8;border:1px solid #ffd1d4;border-radius:12px;padding:10px;margin:8px 0;color:#5a2022}@media(max-width:1100px){.master-grid{grid-template-columns:repeat(2,1fr)}.sidebar{position:static;width:auto}.main{margin:0}.kpi-grid,.grid.two,.grid.three,.form-grid,.form-grid.three,.mini-grid{grid-template-columns:1fr}.topbar{display:block}.userbox{text-align:left;margin-top:10px}}@media(max-width:640px){.master-grid{grid-template-columns:1fr}.login-card{width:100%;padding:22px}.main{padding:14px}}

/* V4 Branded Workflow Studio */
.workflow-hero{background:linear-gradient(135deg,#fff 0,#fff5f5 55%,#f4f6f9 100%);border:1px solid #ffd1d4;border-radius:20px;padding:16px 18px;display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;box-shadow:var(--shadow)}
.workflow-hero img{height:74px;object-fit:contain}.workflow-hero h2{font-size:24px;margin:0;letter-spacing:-.04em}.workflow-hero p{margin:4px 0 0;color:var(--muted);font-weight:650}.workflow-pill-row{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.workflow-pill{background:#fff;border:1px solid #ffd1d4;color:var(--red);border-radius:999px;padding:4px 8px;font-size:10.5px;font-weight:850}.designer-shell{display:grid;grid-template-columns:260px 1fr 300px;gap:12px;align-items:start}.palette,.properties{background:#fff;border:1px solid var(--line);border-radius:16px;padding:12px;box-shadow:var(--shadow)}.palette h3,.properties h3{font-size:14px;margin:0 0 8px}.activity-chip{display:block;background:#fafbfc;border:1px solid var(--line);border-radius:12px;padding:9px 10px;margin-bottom:7px;color:var(--ink);font-weight:760}.activity-chip small{margin-top:2px}.canvas{background:#fff;border:1px solid var(--line);border-radius:18px;padding:18px;min-height:520px;box-shadow:var(--shadow);overflow:auto}.flow-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.flow-card{min-width:166px;background:linear-gradient(180deg,#fff,#fafafa);border:1px solid #e5e7ef;border-radius:15px;padding:11px 12px;box-shadow:0 8px 18px rgba(20,22,27,.05)}.flow-card b{display:block;font-size:13px}.flow-card span{display:block;color:var(--muted);font-size:10.5px;margin-top:4px}.flow-card.start{border-color:#ffc1c5;background:#fff6f6}.flow-card.approval{border-color:#fee2a8}.flow-card.action{border-color:#cce1ff}.flow-card.end{border-color:#cdebd9}.flow-arrow{font-size:22px;color:var(--red);font-weight:900}.instance-status{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:4px 9px;font-size:10.5px;font-weight:850;background:#eef4ff;color:#1d4d9f;border:1px solid #cce1ff}.instance-status.waiting{background:#fff8e8;color:#9a5c00;border-color:#fee2a8}.instance-status.completed{background:#effaf3;color:#0b8f4d;border-color:#cdebd9}.instance-status.rejected{background:#fff0f1;color:var(--red);border-color:#ffd1d4}.template-card{display:flex;flex-direction:column;gap:8px;min-height:168px}.template-card .meta{display:flex;gap:5px;flex-wrap:wrap}.template-card code{font-size:10.5px;background:#f4f5f7;padding:3px 6px;border-radius:7px}.brand-watermark{position:absolute;right:18px;bottom:12px;opacity:.055;width:260px;pointer-events:none}.relative{position:relative}.codebox{font-family:Consolas,Monaco,monospace;background:#111827;color:#f8fafc;border-radius:14px;padding:12px;overflow:auto;font-size:11.5px;line-height:1.45}.approval-strip{display:grid;grid-template-columns:36px 1fr 130px;gap:8px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:12px;margin-bottom:8px;background:#fff}.step-number{width:30px;height:30px;border-radius:999px;background:var(--red);color:#fff;display:grid;place-items:center;font-weight:900}.studio-menu{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:12px}.studio-menu a{background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px;color:var(--ink);font-weight:850;box-shadow:var(--shadow)}.studio-menu a:hover{text-decoration:none;border-color:#ffb8bd}.studio-menu span{display:block;color:var(--muted);font-size:11.5px;font-weight:600;margin-top:3px}@media(max-width:1180px){.designer-shell{grid-template-columns:1fr}.studio-menu{grid-template-columns:1fr 1fr}}@media(max-width:640px){.studio-menu{grid-template-columns:1fr}.workflow-hero{display:block}.workflow-hero img{margin-top:10px}}

/* V9 Full Workflow Studio Designer */
.designer-topline{display:flex;justify-content:space-between;gap:14px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:18px;padding:14px 16px;margin-bottom:12px;box-shadow:var(--shadow)}
.designer-topline h2{margin:0;font-size:22px;letter-spacing:-.035em}.designer-topline p{margin:4px 0 0;color:var(--muted);font-weight:650}.designer-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.designer-actions .soft-link{margin:0}.hn-studio{display:grid;grid-template-columns:250px minmax(620px,1fr) 310px;gap:12px;align-items:stretch}.hn-components,.hn-properties,.hn-canvas-wrap{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);overflow:hidden}.hn-components,.hn-properties{padding:10px}.tabline{display:flex;gap:6px;border-bottom:1px solid var(--line);margin:-2px -2px 10px;padding:0 0 8px}.tabline button{border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;font-weight:850;color:var(--muted)}.tabline button.active{color:var(--red);border-bottom-color:var(--red)}.hn-components h4{font-size:10px;letter-spacing:.08em;color:var(--muted);margin:12px 0 6px}.draggable-node{border:1px solid var(--line);background:#fafbfc;border-radius:10px;padding:8px 10px;margin-bottom:6px;font-weight:780;cursor:grab}.draggable-node:hover{border-color:#ffb8bd;background:#fff8f8}.smallhint{font-size:11.5px}.canvas-toolbar{height:44px;display:flex;align-items:center;gap:7px;border-bottom:1px solid var(--line);padding:7px;background:#fafbfc}.canvas-toolbar .active{background:var(--red);color:#fff;border-color:var(--red)}.toolbar-spacer{flex:1}.hn-canvas{height:650px;position:relative;overflow:auto;background-image:radial-gradient(#d9dde7 1px,transparent 1px);background-size:18px 18px;background-color:#fff}.hn-canvas svg,.hn-canvas #nodeLayer{position:absolute;left:0;top:0;width:1600px;height:1200px;transform-origin:top left}.wf-node{position:absolute;width:185px;min-height:72px;border:2px solid #d8dde7;background:linear-gradient(180deg,#fff,#fafafa);border-radius:14px;padding:9px 10px;box-shadow:0 9px 20px rgba(20,22,27,.07);cursor:move;user-select:none}.wf-node.selected{outline:4px solid rgba(223,11,18,.12);border-color:var(--red)}.wf-node-head{display:flex;gap:7px;align-items:center}.wf-node-head span{width:24px;height:24px;border-radius:999px;display:grid;place-items:center;background:#f1f3f7;color:var(--red);font-weight:900}.wf-node b{font-size:12.5px}.wf-node small{font-size:10.5px;margin-top:4px}.wf-node.start,.wf-node.end{border-color:#1ca45b;background:#f7fff9}.wf-node.approval{border-color:#f59e0b;background:#fffaf0}.wf-node.review{border-color:#7c3aed;background:#fbf8ff}.wf-node.decision{border-color:#f59e0b;background:#fffdf5;transform:rotate(0deg)}.wf-node.evidence{border-color:#06b6d4;background:#f5feff}.wf-node.ai{border-color:#8b5cf6;background:#fbf8ff}.wf-edge{fill:none;stroke:#667085;stroke-width:2.1;marker-end:url(#arrow)}.wf-edge-label{font-size:12px;fill:var(--red);font-weight:900;background:#fff}.validation-dock{border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 13px;background:#fff}.validation-counters{display:flex;gap:8px}.validation-counters span{border:1px solid var(--line);border-radius:10px;padding:7px 10px;background:#fafbfc;color:var(--muted);font-size:11px}.validation-counters b{display:block;color:var(--ink);font-size:16px}.selected-step-title{display:flex;align-items:center;gap:8px;background:#fff8f8;border:1px solid #ffd1d4;border-radius:12px;padding:10px;margin-bottom:10px}.selected-step-title span{width:30px;height:30px;border-radius:999px;background:var(--red);color:#fff;display:grid;place-items:center}.connection-row{border:1px solid var(--line);border-radius:12px;padding:8px;margin-bottom:8px;background:#fafbfc}.connection-row b{font-size:11.5px;display:block;margin-bottom:6px}.connection-row input{margin-bottom:6px}.hn-toast{position:fixed;right:24px;bottom:24px;background:#15171d;color:#fff;border-radius:13px;padding:12px 15px;box-shadow:0 18px 45px rgba(0,0,0,.25);opacity:0;transform:translateY(10px);pointer-events:none;transition:.2s;z-index:50}.hn-toast.show{opacity:1;transform:translateY(0)}.studio-library{display:grid;grid-template-columns:310px 1fr;gap:12px}.tree-panel{margin:0}.tree-root{font-weight:900;background:#15171d;color:#fff;border-radius:11px;padding:9px 10px;margin-bottom:8px}.tree-sector{font-weight:900;color:var(--red);margin:10px 0 4px}.tree-company{display:flex;justify-content:space-between;border:1px solid var(--line);border-radius:9px;padding:7px 8px;margin-bottom:4px;background:#fafbfc;cursor:pointer}.tree-company:hover{border-color:#ffb8bd;background:#fff8f8}.tree-company span{background:#fff0f1;color:var(--red);border-radius:999px;padding:1px 7px;font-size:11px;font-weight:900}@media(max-width:1280px){.hn-studio{grid-template-columns:1fr}.hn-canvas{height:560px}.studio-library{grid-template-columns:1fr}.designer-topline{display:block}.designer-actions{justify-content:flex-start;margin-top:10px}}
/* V10 Document Type Studio */
.studio-shell{display:grid;grid-template-columns:260px 1fr 320px;gap:16px;align-items:start}.studio-shell .studio-main{min-width:0}.studio-panel{background:#fff;border:1px solid #e8e8e8;border-radius:16px;padding:16px;box-shadow:0 10px 24px rgba(0,0,0,.04)}.studio-panel.left{position:sticky;top:12px}.studio-panel.right{position:sticky;top:12px}.studio-header{display:flex;justify-content:space-between;gap:16px;align-items:center}.component-palette{display:grid;grid-template-columns:1fr 1fr;gap:8px}.component-item{border:1px solid #eee;border-radius:10px;padding:9px 10px;background:#fafafa;cursor:grab;font-size:13px}.component-item:hover,.drag-over{border-color:#c40019;background:#fff4f5}.designer-canvas-wrap{background:#fff;border:1px solid #e7e7e7;border-radius:16px;padding:16px}.toolbar,.hero-actions,.button-row,.form-actions,.filter-bar,.meta-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.form-canvas{min-height:520px;background:radial-gradient(#ececec 1px,transparent 1px);background-size:18px 18px;border:1px dashed #ddd;border-radius:16px;padding:16px}.form-section-drop{background:rgba(255,255,255,.96);border:1px solid #ececec;border-radius:14px;margin-bottom:14px;padding:14px}.field-dropzone{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;min-height:60px}.preview-field{background:#fff;border:1px solid #e9e9e9;border-left:4px solid #c40019;border-radius:12px;padding:10px}.preview-field input,.preview-field textarea,.preview-field select{width:100%;margin-top:6px}.validation-dock{margin-top:12px;padding:12px;border-radius:12px;background:#f8f8f8;border:1px solid #e8e8e8}.template-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px}.template-card{background:#fff;border:1px solid #e8e8e8;border-radius:16px;padding:16px;box-shadow:0 8px 18px rgba(0,0,0,.04)}.tree-list{display:grid;gap:8px}.tree-node{border-left:3px solid #c40019;background:#fafafa;border-radius:8px;padding:10px}.dynamic-doc-panel{margin:18px 0;padding:16px;border:1px solid #eee;border-radius:14px;background:#fffafa}.warning-box{background:#fff8e1;border:1px solid #ffd36a;color:#6f4c00;border-radius:10px;padding:10px 12px;margin-bottom:12px}.validation-summary{color:#b00020;margin-bottom:10px}.checkline{display:flex;gap:8px;align-items:center}.checkline input{width:auto!important}.preview-section{border:1px solid #eee;border-radius:14px;margin:14px 0;padding:14px} .preview-section legend{font-weight:700;color:#9b0014}.button-row form{display:inline}.button-row button{margin:0}.status-pill{display:inline-block;border-radius:999px;padding:4px 8px;background:#f2f2f2}.muted{color:#667085;font-size:12px}.eyebrow{text-transform:uppercase;letter-spacing:.08em;color:#c40019;font-size:12px;font-weight:700}.secondary{display:inline-flex;align-items:center;justify-content:center;border:1px solid #ddd;border-radius:10px;padding:9px 12px;background:#fff;color:#222;text-decoration:none}.primary{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:10px;padding:10px 14px;background:#c40019;color:#fff!important;text-decoration:none}.data-table .action-cell a{margin-right:10px}.kpi-grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}@media(max-width:1100px){.studio-shell{grid-template-columns:1fr}.studio-panel.left,.studio-panel.right{position:static}.field-dropzone{grid-template-columns:1fr}.kpi-grid.four{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Document Type Studio index layout fixes */
.doc-types-index.kpi-grid.four{margin-top:4px}
.doc-types-index .kpi-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px 12px;min-height:78px;display:flex;flex-direction:column;justify-content:center;box-shadow:0 4px 12px rgba(20,22,27,.04)}
.doc-types-index .kpi-card span{display:block;color:var(--muted);font-weight:750;font-size:11px;line-height:1.2;text-transform:uppercase;letter-spacing:.04em}
.doc-types-index .kpi-card strong{display:block;margin-top:6px;font-size:24px;line-height:1.1;letter-spacing:-.03em}
.doc-types-filters{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr)) auto;gap:8px 10px;align-items:center}
.doc-types-filters button{height:38px}
.doc-types-table td{line-height:1.28}
.doc-types-table .action-cell{white-space:nowrap}
.doc-types-table .action-cell a{display:inline-block;margin-right:8px}
.doc-types-table .action-cell a:last-child{margin-right:0}
@media(max-width:1200px){.doc-types-filters{grid-template-columns:repeat(2,minmax(180px,1fr)) auto}}
@media(max-width:740px){.doc-types-filters{grid-template-columns:1fr}.doc-types-index .kpi-card strong{font-size:22px}}

/* Balanced scorecard color bands */
.band{display:inline-flex;align-items:center;justify-content:center;min-width:72px;border-radius:999px;padding:4px 10px;font-size:11px;font-weight:800;border:1px solid var(--line);background:#f6f7fa;color:#334155}
.band-green{background:#edf9f1;border-color:#b7e5c4;color:#0f7a44}
.band-amber{background:#fff7e8;border-color:#ffd48f;color:#995d00}
.band-red{background:#fff0f1;border-color:#ffb8bd;color:#b42318}

/* Searchable select enhancer */
.hn-select-search{display:block}
.hn-select-search-input{margin-bottom:6px;background:#fff;border:1px solid #d8dde7;border-radius:10px;padding:8px 10px;font:inherit}
.hn-select-search-input:focus{border-color:var(--red);box-shadow:0 0 0 3px rgba(223,11,18,.08);outline:none}
.hn-hidden{display:none}
.hn-modal-backdrop{position:fixed;inset:0;background:rgba(20,22,27,.48);display:flex;align-items:center;justify-content:center;padding:18px;z-index:1000}
.hn-modal-backdrop.hn-hidden{display:none}
.hn-modal{width:min(1100px,96vw);max-height:90vh;overflow:auto;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 56px rgba(0,0,0,.24);padding:14px}
.hn-modal-head{display:flex;align-items:center;justify-content:space-between;gap:10px}

/* Auth + shell branding refinements */
.login-links{margin:8px 0 4px}
.login-links a{font-weight:700;font-size:12px}
.shell-mark img{max-width:34px;max-height:34px;border-radius:999px;object-fit:cover}
.shell-wordmark-image{display:flex;align-items:center;line-height:1;margin-right:6px}
.shell-wordmark-image img{height:38px;max-width:260px;width:auto;display:block}
@media(max-width:1100px){.shell-wordmark-image img{height:30px;max-width:200px}}

/* Header alignment override */
.profile-chip{margin-left:auto!important}
.shell-mark img{width:40px!important;height:40px!important;max-width:40px!important;max-height:40px!important;object-fit:contain}
.shell-wordmark-image img{height:40px!important;max-width:420px!important;width:auto;display:block}
.login-logo{width:420px;max-width:100%;display:block;margin:0 auto 12px}
@media(max-width:1100px){.shell-wordmark-image img{height:32px!important;max-width:290px!important}}
.plugin-subtitle{display:block;color:var(--hnx-muted);font-size:11px;line-height:1.2;margin:-2px 0 6px 0;font-weight:700}
.tenant-switcher-form{display:flex;align-items:center;gap:8px}
.tenant-switcher-form select{border:0;background:transparent;font:inherit;color:#344054;font-weight:700;min-width:190px;outline:none}

/* =========================================================
   HeirsNexus Core + Plugin Deck UI Refresh - v17
   Main shell, plugin deck, unified work queue and platform health.
   Additive CSS only: preserves existing module screens while upgrading the
   overall product feel to the HeirsNexus deck standard.
   ========================================================= */
:root{--hnx-red:#c90012;--hnx-red-dark:#9b0010;--hnx-black:#07090d;--hnx-ink:#111827;--hnx-muted:#667085;--hnx-line:#e6e9ef;--hnx-bg:#f6f7fa;--hnx-card:#fff;--hnx-green:#07883d;--hnx-orange:#f97316;--hnx-blue:#1d4ed8;--hnx-purple:#7c3aed;--hnx-shadow:0 14px 42px rgba(16,24,40,.08)}
*{box-sizing:border-box}body{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--hnx-bg);color:var(--hnx-ink);margin:0}.shell-rail{position:fixed;inset:0 auto 0 0;width:96px;background:linear-gradient(180deg,#05070a,#101318);display:flex;flex-direction:column;align-items:center;z-index:30;color:#fff}.shell-mark{height:68px;width:100%;display:grid;place-items:center;border-bottom:1px solid rgba(255,255,255,.08)}.shell-mark img{max-width:46px;max-height:46px;object-fit:contain}.rail-nav{width:100%;display:flex;flex-direction:column;gap:7px;padding:12px 8px}.rail-nav a{height:64px;border-radius:12px;color:#d7dbe5;text-decoration:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;position:relative;font-size:12px;font-weight:720;transition:.15s}.rail-nav a:hover,.rail-nav a.active{background:linear-gradient(180deg,var(--hnx-red),var(--hnx-red-dark));color:#fff;box-shadow:0 12px 28px rgba(201,0,18,.28)}.rail-nav a b{position:absolute;right:12px;top:8px;background:#ef4444;color:#fff;border-radius:99px;font-size:10px;width:18px;height:18px;display:grid;place-items:center}.rail-icon{width:22px;height:22px;border:2px solid currentColor;border-radius:7px;display:block;position:relative}.rail-icon.home:before{content:"";position:absolute;left:4px;right:4px;top:-6px;height:12px;border-left:2px solid currentColor;border-top:2px solid currentColor;transform:rotate(45deg)}.rail-icon.work:before{content:"✓";position:absolute;inset:-6px 0 0 3px;font-size:20px}.rail-icon.bell{border-radius:50% 50% 8px 8px}.rail-icon.calendar:before{content:"";position:absolute;left:3px;right:3px;top:5px;border-top:2px solid currentColor}.rail-icon.report:before{content:"";position:absolute;left:4px;bottom:3px;width:3px;height:10px;background:currentColor;box-shadow:6px -5px 0 currentColor,12px -1px 0 currentColor}.rail-icon.settings{border-radius:999px}.rail-icon.settings:before{content:"⚙";position:absolute;inset:-7px 0 0 0;text-align:center;font-size:22px}.core-badge{margin-top:auto;margin-bottom:12px;width:78px;border:1px solid rgba(255,255,255,.12);border-radius:16px;padding:10px 7px;text-align:center;background:rgba(255,255,255,.03);font-size:11px}.core-badge span{display:block;width:34px;height:34px;margin:0 auto 7px;border:2px dashed rgba(255,255,255,.35);border-radius:999px;position:relative}.core-badge span:after{content:"";position:absolute;right:2px;top:2px;width:7px;height:7px;border-radius:999px;background:var(--hnx-red)}.core-badge strong,.core-badge small{display:block}.core-badge i{display:block;margin-top:8px;color:#d1fae5;font-style:normal;line-height:1.25}.rail-logout{width:100%;padding:0 8px 10px}.rail-logout button{width:100%;border:0;background:rgba(255,255,255,.08);color:#fff;border-radius:11px;padding:9px 5px;font-weight:800;cursor:pointer}.shell-main{margin-left:96px;min-height:100vh}.shell-topbar{height:68px;background:rgba(255,255,255,.92);backdrop-filter:blur(10px);border-bottom:1px solid var(--hnx-line);display:flex;align-items:center;gap:18px;padding:0 26px;position:sticky;top:0;z-index:20}.shell-wordmark{font-size:26px;font-weight:900;letter-spacing:-.04em;color:var(--hnx-red);text-decoration:none;white-space:nowrap}.shell-wordmark span{color:#080a0f}.global-search{flex:1;max-width:560px;height:40px;border:1px solid var(--hnx-line);background:#fff;border-radius:12px;display:flex;align-items:center;gap:10px;padding:0 12px;margin-left:20px;box-shadow:0 5px 16px rgba(16,24,40,.04)}.global-search input{border:0;outline:0;background:transparent;flex:1;font:inherit;color:var(--hnx-ink)}.global-search kbd{border:1px solid var(--hnx-line);border-radius:7px;padding:2px 7px;color:#98a2b3;background:#f8fafc}.tenant-switcher{height:40px;border:1px solid var(--hnx-line);background:#fff;border-radius:12px;padding:0 14px;display:flex;align-items:center;gap:8px;color:#344054}.topbar-icon{width:38px;height:38px;border:1px solid var(--hnx-line);border-radius:999px;display:grid;place-items:center;color:#1f2937;text-decoration:none;background:#fff;position:relative;font-weight:900}.topbar-icon b{position:absolute;right:5px;top:5px;width:8px;height:8px;border-radius:999px;background:var(--hnx-red)}.profile-chip{height:44px;display:flex;align-items:center;gap:10px}.profile-chip>span{width:38px;height:38px;border-radius:999px;background:linear-gradient(135deg,var(--hnx-red),#111827);color:#fff;display:grid;place-items:center;font-weight:900}.profile-chip strong{font-size:13px;display:block;max-width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.profile-chip small{display:block;color:var(--hnx-muted);font-size:11px}.shell-content{padding:24px 26px 34px}.deck-hero{display:grid;grid-template-columns:minmax(320px,1fr) minmax(640px,1.5fr);gap:18px;align-items:stretch;margin-bottom:18px}.deck-hero>div:first-child{background:linear-gradient(135deg,#fff,#fff7f8);border:1px solid var(--hnx-line);border-radius:18px;padding:22px 24px;box-shadow:var(--hnx-shadow)}.deck-hero h2{font-size:28px;letter-spacing:-.04em;margin:5px 0 6px}.deck-hero p{margin:0;color:var(--hnx-muted);line-height:1.5}.deck-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr));gap:12px}.deck-summary-card{background:#fff;border:1px solid var(--hnx-line);border-radius:16px;padding:14px 16px;text-decoration:none;color:var(--hnx-ink);box-shadow:var(--hnx-shadow);position:relative;overflow:hidden}.deck-summary-card:after{content:"";position:absolute;inset:auto -40px -60px auto;width:120px;height:120px;border-radius:999px;background:rgba(201,0,18,.05)}.deck-summary-card b{font-size:30px;letter-spacing:-.05em;display:block;margin-top:4px}.deck-summary-card small{font-weight:850;display:block}.deck-summary-card em{font-style:normal;color:var(--hnx-muted);font-size:12px}.summary-icon{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;color:#fff}.deck-summary-card.danger{border-color:#ffd4d8;background:#fffafa}.plugin-deck-panel,.deck-lower-grid .card,.deck-note{background:#fff;border:1px solid var(--hnx-line);border-radius:18px;padding:16px;box-shadow:var(--hnx-shadow)}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}.section-heading h2{margin:0;font-size:20px;letter-spacing:-.03em}.section-heading p{margin:4px 0 0;color:var(--hnx-muted)}.section-heading.compact h2{font-size:18px}.deck-actions{display:flex;gap:10px}.plugin-grid{display:grid;grid-template-columns:repeat(5,minmax(180px,1fr));gap:12px}.plugin-card{border:1px solid var(--hnx-line);border-radius:16px;padding:14px;background:linear-gradient(180deg,#fff,#fff);min-height:188px;display:flex;flex-direction:column;transition:.17s;position:relative}.plugin-card:hover{transform:translateY(-2px);border-color:#ffc6ca;box-shadow:0 18px 38px rgba(16,24,40,.12)}.plugin-card.pinned:before{content:"Pinned";position:absolute;right:13px;top:12px;color:#b42318;background:#fff1f2;border:1px solid #ffd7db;border-radius:999px;padding:2px 7px;font-size:10px;font-weight:900}.plugin-card-top{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:9px}.plugin-icon{width:50px;height:50px;border-radius:14px;color:#fff;display:grid;place-items:center;box-shadow:0 12px 24px rgba(201,0,18,.18)}.plugin-card h3{font-size:15px;line-height:1.15;margin:0 0 5px;padding-right:50px}.plugin-card p{font-size:12px;line-height:1.35;color:#475467;margin:0 0 10px;min-height:49px}.plugin-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto;font-size:11px;color:var(--hnx-muted)}.status-dot{display:inline-flex;align-items:center;gap:5px;font-weight:850}.status-dot:before{content:"";width:7px;height:7px;border-radius:99px;background:#98a2b3}.status-dot.operational:before{background:var(--hnx-green)}.status-dot.attention:before{background:var(--hnx-orange)}.status-dot.pending:before{background:var(--hnx-red)}.plugin-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}.primary,.secondary{display:inline-flex;align-items:center;justify-content:center;border-radius:10px;text-decoration:none;font-size:12px;font-weight:850;padding:9px 12px}.primary{background:linear-gradient(180deg,var(--hnx-red),var(--hnx-red-dark));color:#fff!important;border:1px solid var(--hnx-red-dark)}.secondary{background:#fff;color:#344054!important;border:1px solid var(--hnx-line)}.icon-only{border:0;background:transparent;font-weight:900;color:#667085;cursor:pointer;font-size:18px;padding:0 3px}.deck-lower-grid{display:grid;grid-template-columns:minmax(0,1.9fr) minmax(330px,.8fr);gap:18px;margin-top:18px}.count-pill{background:var(--hnx-red);color:#fff;border-radius:999px;padding:2px 8px;font-size:12px}.queue-tabs{display:flex;gap:22px;border-bottom:1px solid var(--hnx-line);margin-bottom:8px}.queue-tabs span{padding:8px 0;color:#475467;font-size:13px;font-weight:800}.queue-tabs .active{color:var(--hnx-red);border-bottom:2px solid var(--hnx-red)}.responsive-table{overflow:auto}.deck-table{width:100%;border-collapse:collapse}.deck-table th{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#667085;text-align:left;border-bottom:1px solid var(--hnx-line);padding:10px 8px}.deck-table td{padding:10px 8px;border-bottom:1px solid #f0f2f5;font-size:13px;vertical-align:middle}.deck-table a{text-decoration:none;color:var(--hnx-ink)}.deck-table small{display:block;color:var(--hnx-muted);margin-top:2px}.type-pill,.status-badge{border-radius:999px;padding:4px 9px;font-size:11px;font-weight:850;background:#f2f4f7;color:#344054}.status-badge.operational{background:#ecfdf3;color:#027a48}.status-badge.pending{background:#fff1f3;color:#c01048}.status-badge.progress{background:#eff6ff;color:#175cd3}.status-badge.attention{background:#fff7ed;color:#c2410c}.priority-dot{display:inline-flex;align-items:center;gap:6px;font-weight:800}.priority-dot:before{content:"";width:7px;height:7px;border-radius:99px}.priority-dot.high:before{background:var(--hnx-red)}.priority-dot.medium:before{background:var(--hnx-orange)}.priority-dot.low:before{background:var(--hnx-green)}.health-list{display:grid;gap:8px;margin:10px 0 14px}.health-row{display:grid;grid-template-columns:42px 1fr auto;gap:10px;align-items:center;border-bottom:1px solid #f0f2f5;padding:9px 0}.health-icon{width:36px;height:36px;border-radius:12px;background:#fff1f2;color:var(--hnx-red);display:grid;place-items:center}.health-row b,.health-row small{display:block}.health-row small{color:var(--hnx-muted);font-size:12px}.health-row em{font-style:normal;font-size:12px;font-weight:900}.health-row em.operational{color:var(--hnx-green)}.health-row em.attention{color:var(--hnx-orange)}.all-green{background:#ecfdf3;color:#027a48;border-radius:8px;padding:5px 9px;font-size:11px;font-weight:900}.link-red{color:var(--hnx-red);font-weight:850;text-decoration:none}.deck-note{margin-top:18px}.deck-note h2{margin-top:0}.deck-note p{color:#475467;line-height:1.55}.hnx-accent-red{background:linear-gradient(135deg,#ef233c,#b00014)}.hnx-accent-maroon{background:linear-gradient(135deg,#9f1239,#7f1d1d)}.hnx-accent-rose{background:linear-gradient(135deg,#fb7185,#e11d48)}.hnx-accent-orange{background:linear-gradient(135deg,#fb923c,#ea580c)}.hnx-accent-purple{background:linear-gradient(135deg,#a855f7,#6d28d9)}.hnx-accent-blue{background:linear-gradient(135deg,#2563eb,#1e3a8a)}.hnx-accent-teal{background:linear-gradient(135deg,#14b8a6,#0f766e)}.hnx-accent-cyan{background:linear-gradient(135deg,#06b6d4,#0e7490)}.hnx-accent-navy{background:linear-gradient(135deg,#1d4ed8,#172554)}.hnx-accent-indigo{background:linear-gradient(135deg,#6366f1,#3730a3)}.hnx-accent-violet{background:linear-gradient(135deg,#8b5cf6,#6d28d9)}.hnx-accent-pink{background:linear-gradient(135deg,#ec4899,#be123c)}.hnx-accent-brown{background:linear-gradient(135deg,#b45309,#7c2d12)}.hnx-icon-meeting:before{content:"👥"}.hnx-icon-target:before{content:"◎"}.hnx-icon-bolt:before{content:"⚡"}.hnx-icon-folder:before{content:"▰"}.hnx-icon-approval:before{content:"✓"}.hnx-icon-raci:before{content:"♟"}.hnx-icon-flow:before{content:"⌘"}.hnx-icon-doc:before{content:"◧"}.hnx-icon-shield:before{content:"◇"}.hnx-icon-asset:before{content:"▣"}.hnx-icon-chart:before{content:"↗"}.hnx-icon-bell:before{content:"●"}.hnx-icon-calendar:before{content:"▦"}.hnx-icon-community:before{content:"☷"}.hnx-icon-briefcase:before{content:"▤"}.hnx-icon-puzzle:before{content:"✚"}.hnx-icon-alert:before{content:"!"}.hnx-icon-data:before{content:"◉"}.hnx-icon-api:before{content:"⟲"}.hnx-icon-cloud:before{content:"☁"}.hnx-icon-app:before{content:"▦"}.plugin-icon:before,.summary-icon:before,.health-icon:before{font-size:23px;font-weight:900}.health-icon:before{font-size:18px}.summary-icon:before{font-size:21px}@media(max-width:1400px){.plugin-grid{grid-template-columns:repeat(4,minmax(180px,1fr))}.deck-hero{grid-template-columns:1fr}.deck-summary-grid{grid-template-columns:repeat(4,1fr)}}@media(max-width:1100px){.plugin-grid{grid-template-columns:repeat(3,minmax(180px,1fr))}.deck-lower-grid{grid-template-columns:1fr}.shell-topbar{gap:10px}.tenant-switcher,.topbar-icon{display:none}}@media(max-width:820px){.shell-rail{width:76px}.shell-main{margin-left:76px}.rail-nav a em{font-size:10px}.global-search{display:none}.plugin-grid{grid-template-columns:1fr}.deck-summary-grid{grid-template-columns:repeat(2,1fr)}.shell-content{padding:18px 14px}.profile-chip div{display:none}}

/* HNX Stabilization Pass - Layout, Header, Queue, Context Selector */
.shell-content{padding-top:18px}
.shell-topbar{min-height:68px;overflow:visible}
.tenant-switcher{position:relative;min-width:280px;max-width:420px}
.context-switcher{border:1.5px solid #d7dceb;background:linear-gradient(180deg,#fff,#fbfcff);box-shadow:0 7px 18px rgba(16,24,40,.08)}
.context-switcher:hover{border-color:#c8cfdf}
.context-switcher-toggle{width:100%;border:0;background:transparent;display:flex;align-items:center;gap:8px;padding:0;color:#1f2937;cursor:pointer}
.context-switcher-toggle .context-icon{font-weight:900;color:#475467}
.context-intent{font-size:10.5px;font-weight:900;letter-spacing:.06em;text-transform:uppercase;color:#9b0010;background:#fff3f4;border:1px solid #ffd7db;border-radius:999px;padding:2px 7px;white-space:nowrap}
.context-switcher-toggle strong{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}
.context-switcher-toggle em{font-style:normal;color:#98a2b3}
.context-switcher-menu{position:absolute;top:44px;left:0;z-index:120;width:min(460px,78vw);background:#fff;border:1px solid var(--hnx-line);border-radius:12px;box-shadow:0 20px 40px rgba(16,24,40,.14);padding:10px}
.context-switcher-menu input{margin:0 0 8px 0}
.context-switcher-list{display:grid;gap:4px;max-height:260px;overflow:auto}
.context-option{width:100%;text-align:left;border:1px solid transparent;background:#fff;border-radius:8px;padding:8px 10px;font-weight:650;color:#1f2937;cursor:pointer}
.context-option:hover,.context-option.active{background:#fff4f5;border-color:#ffd3d7;color:#9b0010}
.context-static{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:750}

.profile-chip{margin-left:auto!important}
.profile-chip img{width:38px;height:38px;border-radius:999px;object-fit:cover;border:1px solid #e5e7eb;display:block}
.profile-chip .initial-fallback{width:38px;height:38px;border-radius:999px;background:linear-gradient(135deg,var(--hnx-red),#111827);color:#fff;display:grid;place-items:center;font-weight:900}
.profile-chip img + .initial-fallback{display:none}
.profile-chip.fallback-initial img{display:none}
.profile-chip.fallback-initial .initial-fallback{display:grid}

.shell-mark{padding:8px}
.shell-mark img{object-fit:contain!important}
.core-badge{margin-bottom:8px}
.rail-logout{padding-bottom:12px}

.hnx-page{display:grid;gap:12px}
.hnx-page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:2px}
.hnx-page-title{margin:0;font-size:24px;line-height:1.1;letter-spacing:-.03em}
.hnx-page-subtitle{margin:4px 0 0;color:#667085;max-width:900px}
.hnx-page-actions{display:flex;gap:8px;flex-wrap:wrap}
.hnx-card{background:#fff;border:1px solid var(--hnx-line);border-radius:14px;padding:14px;box-shadow:0 8px 20px rgba(16,24,40,.06)}
.hnx-table-wrap{overflow:auto}
.hnx-table{width:100%;border-collapse:collapse}
.hnx-table th,.hnx-table td{padding:9px 8px;border-bottom:1px solid #edf0f5;vertical-align:top}
.hnx-empty-state{padding:18px;color:#667085;text-align:center;border:1px dashed #d0d5dd;border-radius:10px;background:#fafbfc}

.queue-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.queue-tools input{max-width:300px}
.queue-tabs{gap:10px;flex-wrap:wrap}
.queue-tabs button{border:0;background:transparent;color:#475467;font-size:13px;font-weight:800;padding:8px 0;border-bottom:2px solid transparent}
.queue-tabs button.active{color:var(--hnx-red);border-bottom-color:var(--hnx-red)}
.deck-table .type-col,.deck-table .due-col,.deck-table .priority-col,.deck-table .status-col,.deck-table .action-col{white-space:nowrap}
.deck-table .item-col{min-width:300px}
.deck-table .action-col{text-align:right}
.queue-open{font-weight:800;color:var(--hnx-red);text-decoration:none}

.plugin-card.pinned:before{opacity:.88}
.plugin-actions{grid-template-columns:1fr}

.login-logo-orbit{width:420px;max-width:100%;max-height:230px;object-fit:contain;display:block;margin:0 auto 14px}
.login-card{border-radius:20px}

details>summary{cursor:pointer;list-style:none}
details>summary::-webkit-details-marker{display:none}

@media(max-width:1200px){
  .tenant-switcher{min-width:220px;max-width:320px}
  .context-switcher-menu{left:auto;right:0}
}
@media(max-width:1100px){
  .queue-tools{flex-direction:column;align-items:stretch}
  .queue-tools input{max-width:none}
}

/* User Access Matrix redesign */
.user-access-list td{vertical-align:middle}
.user-access-list .badge{min-width:66px;text-align:center}
.access-form-section h4{margin:0 0 8px;font-size:13px;letter-spacing:.01em;color:#344054}
.access-divider{height:1px;background:#e6e9ef;margin:4px 0 8px}
.js-access-editor td{background:#fff9f9;border-top:1px solid #ffe0e3;border-bottom:1px solid #ffd2d8}
.js-access-editor .form-grid.three{grid-template-columns:repeat(3,minmax(220px,1fr))}
@media(max-width:1100px){.js-access-editor .form-grid.three{grid-template-columns:1fr}}

/* Users Master list + modal editor redesign */
.user-master-list th,.user-master-list td{vertical-align:middle}
.user-master-actions .soft-link{margin:0}
.hnx-modal-overlay{position:fixed;inset:0;background:rgba(10,13,20,.5);display:grid;place-items:center;z-index:160}
.hnx-modal-overlay[hidden]{display:none!important}
.hnx-modal{width:min(1080px,94vw);max-height:90vh;overflow:auto;background:#fff;border:1px solid #e6e9ef;border-radius:16px;box-shadow:0 30px 80px rgba(16,24,40,.32);padding:14px}
.hnx-modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.hnx-modal-header h3{margin:0;font-size:20px;letter-spacing:-.02em}
.hnx-modal-header .soft-link{margin:0}
#user-edit-form .form-grid.three{grid-template-columns:repeat(3,minmax(220px,1fr))}
#user-edit-form .form-actions{margin-top:10px}
@media(max-width:1100px){#user-edit-form .form-grid.three{grid-template-columns:1fr}}

/* Login page right-side visual panel */
.login-shell{width:min(1320px,96vw);display:grid;grid-template-columns:minmax(460px,560px) minmax(420px,1fr);gap:22px;align-items:stretch}
.login-shell .login-card{width:100%;margin:0;align-self:stretch}
.login-right-panel{border-radius:24px;overflow:hidden;box-shadow:0 28px 80px rgba(20,22,27,.24);border:1px solid rgba(255,255,255,.2);background:#0a0c10;display:flex;align-items:stretch;min-height:720px}
.login-right-panel img{width:100%;height:100%;object-fit:cover;display:block}
@media(max-width:1100px){
  .login-shell{grid-template-columns:1fr;max-width:640px}
  .login-right-panel{display:none}
}

/* Global table pagination */
.hnx-table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 8px 0;
}

.hnx-pagination-left,
.hnx-pagination-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hnx-pagination-left label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 700;
  color: var(--hnx-muted, #667085);
}

.hnx-pagination-left select {
  width: auto;
  min-width: 88px;
  padding: 6px 8px;
  border-radius: 8px;
}

.hnx-pagination-summary,
.hnx-pagination-page {
  color: var(--hnx-muted, #667085);
  font-weight: 700;
  font-size: 12px;
}

.hnx-pagination-right .secondary {
  margin: 0;
  padding: 7px 11px;
}

.hnx-pagination-right .secondary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Dual-list picker (users/roles/rights) */
.hnx-dual-list {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
}

.hnx-dual-list select {
  width: 100%;
  min-height: 180px;
}

.hnx-picklist-actions {
  display: grid;
  gap: 6px;
  align-content: center;
  justify-items: center;
}

.hnx-picklist-actions .secondary,
.hnx-picklist-actions .soft-link {
  margin: 0;
  min-width: 44px;
  text-align: center;
}

.hnx-dual-list input[type="search"] {
  margin-bottom: 6px;
}

.role-rights-picklist select {
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
}

/* User Access: align "Assigned roles" list with "Available roles" list body */
.user-access-form .hnx-dual-list .hnx-picklist-assigned {
  margin-top: 34px;
}

@media (max-width: 1100px) {
  .hnx-dual-list {
    grid-template-columns: 1fr;
  }

  .hnx-picklist-actions {
    grid-auto-flow: column;
    justify-content: flex-start;
  }
}

/* Header profile self-service menu */
.profile-menu {
  margin-left: auto;
  position: relative;
}

.profile-menu .profile-chip {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  height: auto;
  transition: border-color .16s ease, background .16s ease;
}

.profile-menu .profile-chip img,
.profile-menu .profile-chip .initial-fallback {
  width: 57px;
  height: 57px;
}

.profile-menu .profile-chip:hover,
.profile-menu .profile-chip[aria-expanded="true"] {
  border-color: #e4e7ec;
  background: #fff;
}

.profile-menu-panel {
  position: absolute;
  right: 0;
  top: 48px;
  z-index: 160;
  width: min(310px, 84vw);
  border: 1px solid var(--hnx-line, #e6e9ef);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(16, 24, 40, .18);
  padding: 8px;
  display: grid;
  gap: 6px;
}

.profile-menu-panel[hidden] {
  display: none !important;
}

.profile-menu-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-menu-upload small {
  margin: 2px 8px 4px;
}

.profile-workspace-form {
  border: 1px solid #eef1f5;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 6px;
  margin-bottom: 2px;
}

.profile-workspace-label {
  margin: 0;
  font-size: 11px;
  color: #667085;
  font-weight: 760;
}

.profile-workspace-select {
  font-size: 12px;
  padding: 8px;
}

.profile-menu-item {
  width: 100%;
  display: block;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #fff;
  color: #111827;
  padding: 9px 10px;
  font-size: 12.5px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.profile-menu-item:hover {
  border-color: #e4e7ec;
  background: #f9fafb;
  text-decoration: none;
}

.profile-menu-item.danger {
  color: #b42318;
}

@media (max-width: 1100px) {
  .profile-menu-panel {
    right: -6px;
  }
}

@media (max-width: 760px) {
  .hnx-table-pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Logo size increase request: +30% */
.shell-mark img {
  width: 52px !important;
  height: 52px !important;
  max-width: 52px !important;
  max-height: 52px !important;
}

.shell-wordmark-image img {
  height: 52px !important;
  width: auto !important;
}

@media (max-width: 1100px) {
  .shell-wordmark-image img {
    height: 42px !important;
  }
}

/* Global JSON editor modal (Phase 1) */
.hnx-json-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 18px;
}

.hnx-json-overlay[hidden] {
  display: none !important;
}

.hnx-json-modal {
  width: min(1000px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.25);
  padding: 14px;
}

.hnx-json-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.hnx-json-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hnx-json-head h3 {
  margin: 0;
}

.hnx-json-badge {
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  color: #475467;
  background: #f9fafb;
}

.hnx-json-badge.ok {
  border-color: #b7ebcf;
  color: #067647;
  background: #ecfdf3;
}

.hnx-json-badge.bad {
  border-color: #fecdd3;
  color: #b42318;
  background: #fff1f3;
}

.hnx-json-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.hnx-json-tabs button {
  border-radius: 8px;
  padding: 7px 10px;
}

.hnx-json-tabs button.active {
  border-color: #c90012;
  color: #c90012;
  background: #fff2f4;
}

.hnx-json-pane textarea,
#hnxJsonRawEditor {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.hnx-json-pane .hn-table input {
  width: 100%;
}

.hnx-json-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.hnx-json-launch {
  margin-top: 6px;
}

/* User-controlled UI scale */
:root { --hnx-ui-scale: 1; }
html { font-size: calc(14px * var(--hnx-ui-scale, 1)); }

.hnx-form-shell {
  border-radius: 14px;
}

.hnx-form-section {
  background: #fff;
  border: 1px solid #e7ebf1;
  border-radius: 12px;
  padding: 12px;
}

.hnx-form-section-head {
  margin-bottom: 10px;
}

.hnx-form-section-head h3 {
  margin: 0;
  font-size: 15px;
}

.hnx-form-section-head p {
  margin: 3px 0 0;
  color: #667085;
  font-size: 12px;
}

.hnx-form-aside-card h4 {
  margin: 12px 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #667085;
}

.task-section-nav {
  display: grid;
  gap: 6px;
}

.task-section-nav a {
  display: block;
  padding: 7px 9px;
  border: 1px solid #e8ecf2;
  border-radius: 9px;
  color: #1f2937;
  text-decoration: none;
  font-weight: 700;
}

.task-section-nav a:hover {
  background: #fff4f5;
  border-color: #ffd4d9;
  color: #9f060b;
}

.required-star {
  color: #b42318;
  font-weight: 900;
}

.ui-scale-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ui-scale-controls .topbar-icon {
  width: 36px;
  height: 36px;
  font-size: 12px;
  font-weight: 800;
}

.ui-scale-controls .ui-scale-label {
  width: auto;
  min-width: 58px;
  padding: 0 8px;
  border-radius: 999px;
}

/* Unified filter/search UX */
.hnx-filter-form {
  background: linear-gradient(180deg, #fbfcff, #ffffff);
  border: 1px solid #e8edf5;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  gap: 10px 12px;
}

.hnx-filter-form label {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #fff;
}

.hnx-filter-form label:focus-within {
  border-color: #f2b3bb;
  box-shadow: 0 0 0 3px rgba(223, 11, 18, 0.08);
}

.hnx-filter-form input,
.hnx-filter-form select {
  margin-top: 6px;
}

.hnx-filter-form .form-actions.hnx-filter-actions {
  grid-column: 1 / -1;
  margin: 2px 0 0;
}

.hnx-search-field {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
}

.hnx-search-icon {
  color: #98a2b3;
  font-weight: 900;
  text-align: center;
}

.hnx-search-field .hnx-filter-search-input {
  margin-top: 0;
}

.hnx-search-clear {
  border: 1px solid #d9e0ea;
  border-radius: 999px;
  background: #f8fafc;
  color: #475467;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 9px;
}

.hnx-search-clear:hover {
  border-color: #cfd8e5;
  background: #ffffff;
}

@media (max-width: 1100px) {
  .hnx-filter-form {
    padding: 10px;
  }
}

/* Tasks Create revamp */
.task-create-shell .hint {
  margin-bottom: 12px;
}

.task-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
}

.hnx-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
}

.task-create-main {
  display: grid;
  gap: 12px;
}

.hnx-create-main {
  display: grid;
  gap: 12px;
}

.task-form-section {
  background: #fff;
  border: 1px solid #e7ebf1;
  border-radius: 12px;
  padding: 12px;
}

.task-form-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.task-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-grid-two .span-2 {
  grid-column: 1 / -1;
}

.task-workflow-message {
  margin-top: 8px;
}

.task-create-aside {
  display: grid;
  align-content: start;
}

.hnx-create-aside {
  display: grid;
  align-content: start;
}

.task-aside-card {
  position: sticky;
  top: 82px;
  margin: 0;
}

.hnx-create-aside-card {
  position: sticky;
  top: 82px;
  margin: 0;
}

.task-aside-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.task-aside-card li {
  margin-bottom: 8px;
  color: #475467;
}

.task-create-actions {
  margin-top: 12px;
}

.hnx-create-actions {
  margin-top: 12px;
}

.hnx-sheet-grid {
  gap: 8px;
  border: 1px solid #d9e2ee;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #f6f9ff, #f3f7fd);
  padding: 8px;
}

.hnx-sheet-grid > label {
  margin: 0;
  padding: 10px 12px 9px;
  border: 1px solid #dce5f2;
  background: linear-gradient(180deg, #ffffff, #fcfdff);
  border-radius: 10px;
}

.hnx-sheet-grid > label:nth-child(odd) {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.hnx-sheet-grid > label > small {
  margin-top: 5px;
}

.hnx-sheet-grid input,
.hnx-sheet-grid select,
.hnx-sheet-grid textarea {
  border-color: #d4dcea;
  background: #fff;
}

.hnx-sheet-grid .span-2 {
  border-right: 1px solid #dce5f2 !important;
}

.hnx-tone-basic {
  border-top: 3px solid #3b82f6;
}

.hnx-tone-context {
  border-top: 3px solid #14b8a6;
}

.hnx-tone-workflow {
  border-top: 3px solid #f59e0b;
}

.hnx-tone-docfields {
  border-top: 3px solid #df0b12;
}

.hnx-tone-basic .hnx-form-section-head h3 { color: #1d4ed8; }
.hnx-tone-context .hnx-form-section-head h3 { color: #0f766e; }
.hnx-tone-workflow .hnx-form-section-head h3 { color: #b45309; }
.hnx-tone-docfields .hnx-form-section-head h3 { color: #9f060b; }

.hnx-tone-basic .hnx-sheet-grid > label { border-color: #d6e6ff; }
.hnx-tone-context .hnx-sheet-grid > label { border-color: #d4efe9; }
.hnx-tone-workflow .hnx-sheet-grid > label { border-color: #fde7c2; }
.hnx-tone-docfields .hnx-sheet-grid > label { border-color: #ffd9de; }

.hnx-tone-auto-1 { border-top: 3px solid #3b82f6; }
.hnx-tone-auto-2 { border-top: 3px solid #14b8a6; }
.hnx-tone-auto-3 { border-top: 3px solid #f59e0b; }
.hnx-tone-auto-4 { border-top: 3px solid #df0b12; }

.hnx-tone-auto-1 h2,.hnx-tone-auto-1 h3 { color: #1d4ed8; }
.hnx-tone-auto-2 h2,.hnx-tone-auto-2 h3 { color: #0f766e; }
.hnx-tone-auto-3 h2,.hnx-tone-auto-3 h3 { color: #b45309; }
.hnx-tone-auto-4 h2,.hnx-tone-auto-4 h3 { color: #9f060b; }

.hnx-tone-auto-1 .hnx-sheet-grid > label { border-color: #d6e6ff; }
.hnx-tone-auto-2 .hnx-sheet-grid > label { border-color: #d4efe9; }
.hnx-tone-auto-3 .hnx-sheet-grid > label { border-color: #fde7c2; }
.hnx-tone-auto-4 .hnx-sheet-grid > label { border-color: #ffd9de; }

.hnx-helptext-soft {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #8591a3;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .01em;
}

/* Ensure labels are at least equal/larger than field text */
label {
  font-size: 13.5px;
  line-height: 1.3;
}

input,
select,
textarea {
  font-size: 13px;
}

/* Fallback style for legacy plugin forms without .form-grid */
.hnx-legacy-sheet-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid #d9e2ee;
  border-radius: 12px;
  background: linear-gradient(180deg, #f6f9ff, #f3f7fd);
}

.hnx-legacy-sheet-form > .hnx-legacy-sheet-cell {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #dce5f2;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #fafdff);
}

.hnx-legacy-sheet-form > .hnx-legacy-sheet-cell:nth-child(odd) {
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.hnx-legacy-sheet-form > .hnx-legacy-sheet-cell input,
.hnx-legacy-sheet-form > .hnx-legacy-sheet-cell select,
.hnx-legacy-sheet-form > .hnx-legacy-sheet-cell textarea {
  border-color: #d4dcea;
}

.task-create-wizard-actions {
  justify-content: flex-end;
}

.task-create-wizard-actions [data-wizard-prev][disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.hnx-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #d5dbe6;
  background: #f8fafc;
  color: #667085;
  font-size: 11px;
  font-weight: 900;
  cursor: help;
  vertical-align: middle;
  position: relative;
}

.hnx-help::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translateX(-50%) translateY(4px);
  width: min(280px, 72vw);
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #d6deea;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.15);
  color: #7b8797;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 40;
}

.hnx-help:hover::after,
.hnx-help:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.task-create-shell small,
.task-create-shell .hnx-form-section-head p {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #8591a3;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .01em;
}

.hnx-wizard-top {
  margin: 8px 0 12px;
  padding: 10px;
  border: 1px solid #e8ecf3;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.hnx-wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 9px;
}

.hnx-wizard-steps.hnx-wizard-steps-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hnx-wizard-steps.hnx-wizard-steps-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hnx-wizard-step {
  border: 1px solid #dfe5ef;
  border-radius: 9px;
  background: #fff;
  color: #475467;
  font-weight: 800;
  font-size: 11.5px;
  padding: 8px 10px;
}

.hnx-wizard-step.is-active {
  border-color: #f3b5bd;
  background: #fff2f4;
  color: #9f060b;
}

.hnx-wizard-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e7f6ec;
  overflow: visible;
  margin-bottom: 6px;
  position: relative;
}

.hnx-wizard-progress-bar {
  width: 25%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #15803d);
  transition: width .2s ease;
}

.hnx-wizard-progress-label {
  position: absolute;
  top: -22px;
  left: 25%;
  transform: translateX(-50%);
  background: #166534;
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow: 0 5px 12px rgba(21, 128, 61, .25);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .task-create-layout {
    grid-template-columns: 1fr;
  }

  .hnx-create-layout {
    grid-template-columns: 1fr;
  }

  .task-aside-card {
    position: static;
  }

  .hnx-create-aside-card {
    position: static;
  }

  .hnx-wizard-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hnx-sheet-grid > label {
    border-right: 1px solid #dce5f2 !important;
  }
}

/* Post-login AI welcome callout */
.hnx-welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(5, 10, 20, .35);
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}
.hnx-welcome-overlay[hidden] {
  display: none !important;
}

.hnx-welcome-card {
  width: min(640px, 95vw);
  background: linear-gradient(160deg, #ffffff, #f8fbff);
  border: 1px solid #dfe8f5;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(10, 18, 32, .28);
  padding: 18px 20px 16px;
  position: relative;
  animation: hnxWelcomePop .22s ease-out;
}

.hnx-welcome-card::after {
  content: "";
  position: absolute;
  left: 118px;
  top: -12px;
  width: 22px;
  height: 22px;
  transform: rotate(45deg);
  background: #f8fbff;
  border-left: 1px solid #dfe8f5;
  border-top: 1px solid #dfe8f5;
  z-index: 0;
  pointer-events: none;
}

.hnx-welcome-close {
  position: absolute;
  right: 10px;
  top: 10px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-weight: 800;
  cursor: pointer;
}

.hnx-welcome-intro {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  animation: hnxWelcomeIntroFade .24s ease-out;
  z-index: 1250;
  pointer-events: none;
}

.hnx-welcome-intro-stage {
  position: relative;
  width: min(92vw, 760px);
  min-height: min(56vw, 330px);
  display: grid;
  place-items: center;
}

.hnx-welcome-intro-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.hnx-globe-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

.hnx-welcome-intro-text {
  margin: 0;
  padding: 12px 16px;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(15, 23, 42, .96), rgba(30, 41, 59, .94));
  border: 1px solid rgba(248, 113, 113, .55);
  border-radius: 12px;
  box-shadow: 0 12px 26px rgba(2, 6, 23, .28);
  font-family: "Avenir Next", "Segoe UI", Inter, Arial, sans-serif;
  font-weight: 800;
  font-size: clamp(16px, 1.8vw, 22px);
  letter-spacing: -.01em;
  line-height: 1.2;
  white-space: normal;
  max-width: min(88vw, 620px);
  animation: hnxWelcomeIntroText 5s ease both;
}

.hnx-welcome-intro-globe {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(112px, 24vw);
  height: min(112px, 24vw);
  transform-origin: center;
  animation: hnxWelcomeOrbit 5s linear both;
  filter: drop-shadow(0 12px 26px rgba(213, 11, 23, .26));
}

.hnx-welcome-intro[hidden] {
  display: none !important;
}

.hnx-welcome-card-globe {
  position: absolute;
  left: -28px;
  top: -34px;
  width: 74px;
  height: 74px;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 8px 16px rgba(213, 11, 23, .24));
}

.hnx-welcome-card-globe img {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  object-fit: cover;
}

.hnx-welcome-kicker {
  margin: 0 0 4px;
  color: #9f060b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}

.hnx-welcome-card h3 {
  margin: 0 0 4px;
  font-size: 23px;
  letter-spacing: -.03em;
}

.hnx-welcome-headline {
  margin: 0 0 10px;
  color: #334155;
}

.hnx-welcome-list {
  margin: 6px 0 8px 18px;
  padding: 0;
}

.hnx-welcome-list li {
  margin: 5px 0;
  color: #0f172a;
}

.hnx-welcome-list.secondary li {
  color: #334155;
}

.hnx-welcome-list.tips {
  border-top: 1px dashed #d8e0ee;
  padding-top: 8px;
  margin-top: 10px;
}

.hnx-welcome-list.tips li::marker {
  color: #9f060b;
}

.hnx-welcome-focus {
  margin: 8px 0 4px;
  padding: 8px 10px;
  border: 1px solid #d3f3df;
  border-radius: 10px;
  background: #f0fdf4;
  color: #166534;
  font-weight: 700;
}

.hnx-welcome-time {
  margin: 0;
  color: #64748b;
  font-size: 12px;
}

.hnx-welcome-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

@keyframes hnxWelcomeFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes hnxWelcomePop {
  from { transform: translateY(8px) scale(.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes hnxWelcomeIntroFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hnxWelcomeIntroDance {
  0% { transform: scale(.8) rotate(0deg) translateY(0); }
  16% { transform: scale(1.04) rotate(120deg) translateY(-10px); }
  33% { transform: scale(1) rotate(210deg) translateY(2px); }
  52% { transform: scale(1.06) rotate(300deg) translateY(-14px); }
  72% { transform: scale(1.01) rotate(420deg) translateY(4px); }
  88% { transform: scale(1.05) rotate(520deg) translateY(-8px); }
  100% { transform: scale(.4) rotate(560deg) translateY(0); }
}

@keyframes hnxWelcomeOrbit {
  0% { transform: rotate(0deg) translateX(172px) rotate(0deg) scale(.95); }
  25% { transform: rotate(90deg) translateX(162px) rotate(-90deg) scale(1); }
  50% { transform: rotate(180deg) translateX(172px) rotate(-180deg) scale(1.03); }
  75% { transform: rotate(270deg) translateX(162px) rotate(-270deg) scale(1); }
  100% { transform: rotate(360deg) translateX(172px) rotate(-360deg) scale(.96); }
}

@keyframes hnxWelcomeIntroText {
  0% { opacity: 0; transform: translateY(8px) scale(.98); }
  12% { opacity: 1; transform: translateY(0) scale(1); }
  88% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
  .hnx-welcome-intro-stage {
    min-height: min(70vw, 300px);
  }
  .hnx-welcome-intro-globe {
    width: min(96px, 22vw);
    height: min(96px, 22vw);
    animation: hnxWelcomeOrbitMobile 5s linear both;
  }
  .hnx-welcome-card-globe {
    left: -18px;
    top: -26px;
    width: 62px;
    height: 62px;
  }
  .hnx-welcome-card-globe img {
    width: 62px;
    height: 62px;
  }
}

@keyframes hnxWelcomeOrbitMobile {
  0% { transform: rotate(0deg) translateX(128px) rotate(0deg) scale(.95); }
  25% { transform: rotate(90deg) translateX(118px) rotate(-90deg) scale(1); }
  50% { transform: rotate(180deg) translateX(128px) rotate(-180deg) scale(1.02); }
  75% { transform: rotate(270deg) translateX(118px) rotate(-270deg) scale(1); }
  100% { transform: rotate(360deg) translateX(128px) rotate(-360deg) scale(.95); }
}

/* Persistent Nexus companion */
.hnx-nexus-dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1100;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.hnx-nexus-dock.left {
  left: 112px;
  right: auto;
}

.hnx-nexus-orb {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid #dce3ef;
  background: radial-gradient(circle at 30% 22%, #ffffff 0%, #f5f8ff 62%, #e2e8f0 100%);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .22);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.hnx-nexus-orb:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 16px 36px rgba(15, 23, 42, .28);
}

.hnx-nexus-orb > img {
  position: absolute;
  inset: 0;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: block;
  object-fit: contain;
  opacity: 1 !important;
  filter: none !important;
}

.hnx-nexus-dot {
  position: absolute;
  right: -1px;
  top: -1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d50b17;
  border: 2px solid #fff;
}

.hnx-nexus-orb.attention {
  animation: hnxNexusBob 1.1s ease-in-out infinite;
}

.hnx-nexus-orb.idle-roam {
  animation: hnxNexusRoam 14s ease-in-out infinite;
}

.hnx-nexus-panel {
  width: min(340px, 92vw);
  background: linear-gradient(160deg, #fff, #fbfdff);
  border: 1px solid #dbe4f2;
  border-radius: 14px;
  box-shadow: 0 20px 56px rgba(15, 23, 42, .28);
  padding: 10px 12px 12px;
}

.hnx-nexus-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #475467;
}

.hnx-nexus-origin {
  margin-left: auto;
  color: #94a3b8;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.hnx-nexus-panel-head button {
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.hnx-nexus-panel h4 {
  margin: 2px 0 6px;
  font-size: 16px;
}

.hnx-nexus-panel p {
  margin: 0 0 7px;
  color: #0f172a;
  line-height: 1.35;
}

.hnx-nexus-bookmark {
  margin: 0 0 8px;
  padding: 8px;
  border: 1px solid #dbe4f2;
  border-radius: 10px;
  background: #f8fafc;
  display: grid;
  gap: 6px;
}

.hnx-nexus-missed {
  color: #475569;
  font-size: 11.5px;
}

.hnx-nexus-panel small {
  color: #64748b;
  font-size: 11.5px;
}

.hnx-nexus-policy {
  display: block;
  margin-top: 2px;
}

.hnx-nexus-scope {
  display: block;
  margin-top: 2px;
  color: #475569;
}

.hnx-nexus-caps {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hnx-cap-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbe4f2;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  transition: all .14s ease;
}

.hnx-cap-chip:hover {
  border-color: #fecdd3;
  background: #fff4f6;
  color: #9f1239;
}

.hnx-nexus-chat-feed {
  margin-top: 10px;
  max-height: 190px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 2px;
}

.hnx-nexus-bubble {
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.35;
  max-width: 95%;
}

.hnx-nexus-bubble.nexus {
  background: #f3f7fd;
  border: 1px solid #d9e5f5;
  color: #0f172a;
  justify-self: start;
}

.hnx-nexus-bubble.user {
  background: #fff1f2;
  border: 1px solid #ffd0d5;
  color: #7f1d1d;
  justify-self: end;
}

.hnx-nexus-chat-form {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.hnx-nexus-chat-form input {
  border: 1px solid #dbe4f2;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  min-width: 0;
  background: #fff;
}

.hnx-nexus-chat-form button {
  white-space: nowrap;
}

.hnx-nexus-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.hnx-nexus-action-btn {
  margin: 0 !important;
  min-height: 28px;
  padding: 5px 8px !important;
  font-size: 11px !important;
  line-height: 1.1;
  border-radius: 9px !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hnx-nexus-action-btn::after {
  content: "›";
  font-size: 13px;
  font-weight: 900;
  color: #9ca3af;
  transform: translateY(-0.5px);
}

.hnx-nexus-action-btn:hover::after {
  color: #b91c1c;
}

@media (max-width: 420px) {
  .hnx-nexus-actions {
    grid-template-columns: 1fr;
  }
}

.hnx-nexus-whisper {
  max-width: min(320px, 80vw);
  background: #ffffff;
  border: 1px solid #dbe4f2;
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, .22);
  color: #0f172a;
  font-size: 12px;
  line-height: 1.35;
  animation: hnxWhisperPop .2s ease-out;
}

@keyframes hnxWhisperPop {
  from { transform: translateY(4px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes hnxNexusBob {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
  60% { transform: translateY(-2px); }
}

@keyframes hnxNexusRoam {
  0% { transform: translate(0, 0); }
  30% { transform: translate(-110px, -8px); }
  60% { transform: translate(-220px, 6px); }
  100% { transform: translate(0, 0); }
}

.hnx-nexus-traveler {
  position: fixed;
  width: 58px;
  height: 58px;
  z-index: 1400;
  pointer-events: none;
  transform-origin: center;
}

.hnx-nexus-traveler img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
}
