:root{
  color-scheme:light;
  --bg:#f4f7fb;--surface:#fff;--soft:#eef4fb;--text:#101828;--muted:#667085;
  --border:#d9e3ef;--primary:#0f766e;--primary2:#2563eb;--danger:#dc2626;
  --shadow:0 18px 48px rgba(15,23,42,.10);
}
[data-theme="dark"]{
  color-scheme:dark;
  --bg:#07111f;--surface:#0f1b2d;--soft:#16263b;--text:#eef4ff;--muted:#a9b8cf;
  --border:#293c55;--primary:#2dd4bf;--primary2:#60a5fa;--danger:#f87171;
  --shadow:0 18px 48px rgba(0,0,0,.28);
}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;font-family:Inter,system-ui,sans-serif;background:var(--bg);color:var(--text);--hub-topbar-height:72px;scroll-padding-top:calc(var(--hub-topbar-height) + 18px)}
button,input,textarea,select{font:inherit}
body,.soft-btn,.primary-btn,input,textarea,select{font-size:.88rem}
.topbar{
  position:fixed;top:0;left:0;right:0;z-index:900;display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center;
  min-height:var(--hub-topbar-height);padding:14px clamp(14px,3vw,32px);border-bottom:1px solid var(--border);
  background:color-mix(in srgb,var(--surface) 92%,transparent);backdrop-filter:blur(18px);
  box-shadow:0 10px 26px rgba(15,23,42,.065)
}
.brand{display:flex;align-items:center;gap:12px;min-width:0}.brand strong,.brand small{display:block}.brand small{color:var(--muted);font-size:.82rem}
.brand-mark{width:42px;height:42px;display:grid;place-items:center;border-radius:12px;background:var(--primary);color:#fff;font-weight:800}
.back-link,.icon-btn,.soft-btn,.primary-btn{
  min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:10px;
  border:1px solid var(--border);text-decoration:none;font-weight:800;cursor:pointer;padding:9px 13px
}
.back-link,.icon-btn,.soft-btn{background:var(--surface);color:var(--text)}.icon-btn{width:42px;padding:0}
.primary-btn{background:var(--surface);border-color:color-mix(in srgb,var(--primary) 28%,var(--border));color:var(--text);box-shadow:0 6px 14px rgba(15,23,42,.045)}
.primary-btn:hover,.soft-btn:hover,.back-link:hover,.icon-btn:hover{border-color:color-mix(in srgb,var(--primary) 45%,var(--border));background:color-mix(in srgb,var(--primary) 6%,var(--surface));color:var(--text)}
.primary-btn i{color:var(--primary)}
.primary-btn:disabled{opacity:.55;cursor:not-allowed}
.primary-btn.is-loading{position:relative;opacity:.92;cursor:wait}
.btn-spinner{width:17px;height:17px;border:2px solid rgba(255,255,255,.45);border-top-color:#fff;border-radius:50%;animation:uploadSpin .82s linear infinite}
.full{width:100%}.shell{width:min(1720px,calc(100% - 28px));margin:0 auto;padding:calc(var(--hub-topbar-height) + 18px) 0 42px}
.hub-app{display:grid;grid-template-columns:320px minmax(0,1fr);gap:16px;align-items:start;transition:grid-template-columns .2s ease}
.hub-app.is-sidebar-collapsed{grid-template-columns:78px minmax(0,1fr)}
.hub-sidebar{
  position:sticky;top:calc(var(--hub-topbar-height) + 14px);display:flex;flex-direction:column;gap:12px;height:calc(100vh - var(--hub-topbar-height) - 28px);
  min-height:0;padding:12px;border:1px solid var(--border);border-radius:16px;background:var(--surface);box-shadow:var(--shadow);
  --ai-hub-card-bg:var(--surface);
  --ai-hub-card-bg-hover:var(--soft);
  --ai-hub-card-text:var(--text);
  --ai-hub-card-muted:var(--muted);
  --ai-hub-card-border:var(--border);
  --ai-hub-card-border-hover:color-mix(in srgb,var(--primary2) 48%,var(--border));
  --ai-hub-back-bg:var(--surface);
  --ai-hub-back-color:var(--muted);
  --ai-hub-btn-bg:var(--surface);
  --ai-hub-btn-bg-hover:color-mix(in srgb,var(--primary) 6%,var(--surface));
  --ai-hub-btn-disabled:var(--muted)
}
.hub-sidebar-toggle{
  width:42px;height:38px;min-height:38px;display:grid;place-items:center;align-self:flex-end;
  border:1px solid var(--border);border-radius:11px;background:var(--soft);color:var(--text);cursor:pointer;
  transition:background .16s ease,border-color .16s ease,color .16s ease
}
.hub-sidebar-toggle:hover{border-color:var(--primary2);color:var(--primary2);background:var(--surface)}
.hub-app.is-sidebar-collapsed .hub-sidebar{align-items:center;padding:10px}
.hub-app.is-sidebar-collapsed .hub-sidebar-toggle{align-self:center}
.hub-app.is-sidebar-collapsed .agent-tabs button{
  display:flex;align-items:center;justify-content:center;width:46px;height:46px;min-height:46px;padding:0;border-radius:13px
}
.hub-app.is-sidebar-collapsed .agent-tabs button i{width:34px;height:34px}
.hub-app.is-sidebar-collapsed .agent-tabs button span,
.hub-app.is-sidebar-collapsed .agent-tabs button small,
.hub-app.is-sidebar-collapsed .hub-chat-sessions,
.hub-app.is-sidebar-collapsed .modal-launch-row span{display:none}
.hub-app.is-sidebar-collapsed .modal-launch-row{margin-top:auto}
.hub-app.is-sidebar-collapsed .modal-launch-btn{
  width:42px;height:42px;min-height:42px;padding:0;justify-content:center;border-radius:12px
}
.hub-app:not([data-active-agent="chat"]) .hub-chat-sessions{display:none}
.hub-app:not([data-active-agent="chat"]) .modal-launch-row{margin-top:auto}
.hub-content{min-width:0}
.hub-chat-sessions{display:block;min-height:0;overflow:hidden;flex:1}
.hub-session-card{
  display:flex;flex-direction:column;gap:10px;height:100%;min-height:0;padding:12px;
  border:1px solid var(--border);border-radius:14px;background:var(--soft)
}
.hub-session-card .ai-hub-session-header{padding:0 0 2px;border-bottom:1px solid var(--border)}
.hub-session-card .ai-hub-session-heading{color:var(--text);font-size:.9rem;font-weight:900}
.hub-session-card .ai-hub-inline-status{color:var(--muted);font-size:.72rem;line-height:1.35}
.hub-session-card .ai-hub-session-list{min-height:0;overflow:auto;padding:1px 2px 2px;gap:8px}
.hub-session-card .ai-hub-session-item{
  border-color:var(--border);background:var(--surface);border-radius:12px;padding:10px 40px 10px 11px;
  box-shadow:0 8px 18px rgba(15,23,42,.045)
}
.hub-session-card .ai-hub-session-row.active .ai-hub-session-item{
  border-color:color-mix(in srgb,var(--primary2) 55%,var(--border));
  background:color-mix(in srgb,var(--primary2) 7%,var(--surface));
  box-shadow:inset 3px 0 0 var(--primary2),0 10px 22px rgba(15,23,42,.07)
}
.hub-session-card .ai-hub-session-title{font-size:.86rem;font-weight:850;color:var(--text)}
.hub-session-card .ai-hub-session-preview{font-size:.76rem;color:var(--muted);min-height:auto}
.hub-session-card .ai-hub-session-meta{font-size:.68rem;color:var(--muted)}
.hub-session-card .ai-hub-session-delete{
  top:9px;right:9px;width:26px;height:26px;border-radius:9px;background:var(--soft);color:var(--muted)
}
.hub-new-session{width:100%;min-height:38px}
.dashboard-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:16px}
.eyebrow{display:inline-flex;padding:6px 10px;border-radius:999px;background:var(--soft);color:var(--primary);font-size:.75rem;font-weight:800;text-transform:uppercase}
h1,h2,h3,p{margin-top:0}h1{max-width:850px;margin:12px 0 8px;font-size:clamp(1.8rem,3.5vw,3.1rem);line-height:1.05;font-weight:800}
.dashboard-head p,.module-head p{max-width:760px;margin:0;color:var(--muted);line-height:1.6}
.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px}
.dashboard-bottom{margin-top:14px}
.dashboard-toggle-row{display:flex;justify-content:center;margin:16px 0 0}
.dashboard-toggle{background:var(--surface)}
.dashboard-bottom-wrap{animation:dashboardReveal .22s ease both}
@keyframes dashboardReveal{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.stat-card{
  position:relative;overflow:hidden;display:grid;grid-template-columns:auto 1fr;gap:5px 12px;align-items:center;
  padding:17px;border:1px solid var(--border);border-radius:18px;background:var(--surface-2);
  box-shadow:var(--shadow);min-height:118px
}
.stat-card::after{content:"";position:absolute;inset:auto -26px -42px auto;width:120px;height:120px;border-radius:50%;background:color-mix(in srgb,var(--primary2) 13%,transparent)}
.stat-card.stat-main::after{background:color-mix(in srgb,var(--primary) 18%,transparent)}
.stat-card i{grid-row:1/span 3;width:46px;height:46px;display:grid;place-items:center;border-radius:14px;background:var(--surface);color:var(--primary2);box-shadow:0 8px 18px rgba(15,23,42,.08)}
.stat-card span{color:var(--muted);font-weight:800;font-size:.82rem}.stat-card strong{font-size:1.72rem;line-height:1}.stat-card small{color:var(--muted);font-size:.76rem;font-weight:700}
.ops-grid{display:grid;grid-template-columns:1.05fr 1fr 1fr;gap:12px;margin-bottom:14px}
.ops-panel{min-width:0;border:1px solid var(--border);border-radius:18px;background:var(--surface);box-shadow:var(--shadow);padding:15px}
.ops-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.ops-head h2{font-size:1rem;margin:0;font-weight:800}.ops-head span{color:var(--muted);font-size:.78rem;font-weight:800}
.mini-list{display:grid;gap:8px;max-height:220px;overflow:auto}
.mini-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px;border:1px solid var(--border);border-radius:13px;background:var(--soft)}
a.mini-row{color:var(--text);text-decoration:none}
a.mini-row:hover{border-color:var(--primary2);text-decoration:none;opacity:1}
.mini-row i{width:32px;height:32px;display:grid;place-items:center;border-radius:10px;background:var(--surface);color:var(--primary2)}
.mini-row strong,.mini-row span{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mini-row span{color:var(--muted);font-size:.78rem}.mini-row em{font-style:normal;color:var(--muted);font-size:.76rem;font-weight:800}
.workflow-bars{display:grid;gap:10px}
.workflow-bar{display:grid;gap:6px}.workflow-bar-head{display:flex;justify-content:space-between;gap:12px;color:var(--text);font-weight:800;font-size:.84rem}
.workflow-track{height:9px;border-radius:999px;background:var(--soft);overflow:hidden}.workflow-track span{display:block;height:100%;border-radius:inherit;background:var(--primary)}
.dashboard-detail-section{
  display:grid;
  gap:12px;
  margin-top:14px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--surface-2);
  box-shadow:var(--shadow)
}
.dashboard-section-head{margin-bottom:0}
.dashboard-module-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.dashboard-insight-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.dashboard-module-card{
  display:grid;
  gap:12px;
  min-width:0;
  padding:14px;
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--surface);
  box-shadow:0 10px 24px rgba(15,23,42,.055)
}
.dashboard-module-card > header{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:11px;
  align-items:center;
  padding-bottom:10px;
  border-bottom:1px solid var(--border)
}
.dashboard-module-card > header > i{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:13px;
  background:color-mix(in srgb,var(--primary2) 10%,var(--surface));
  color:var(--primary2);
  font-size:1.05rem
}
.dashboard-module-card h3{margin:0;color:var(--text);font-size:.98rem;font-weight:900;line-height:1.25}
.dashboard-module-card p{margin:3px 0 0;color:var(--muted);font-size:.78rem;line-height:1.4}
.dashboard-metric-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.dashboard-metric{
  display:grid;
  gap:2px;
  min-width:0;
  padding:9px 8px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--soft)
}
.dashboard-metric span{color:var(--muted);font-size:.68rem;font-weight:900;text-transform:uppercase}
.dashboard-metric strong{color:var(--text);font-size:1.12rem;font-weight:950;line-height:1.1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dashboard-metric small{color:var(--muted);font-size:.7rem;font-weight:800}
.dashboard-recent-list{display:grid;gap:7px}
.dashboard-recent-row{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:9px;
  align-items:center;
  min-width:0;
  padding:9px;
  border:1px solid color-mix(in srgb,var(--border) 76%,transparent);
  border-radius:12px;
  background:color-mix(in srgb,var(--soft) 62%,var(--surface))
}
.dashboard-recent-row > i{width:30px;height:30px;display:grid;place-items:center;border-radius:9px;background:var(--surface);color:var(--primary2)}
.dashboard-recent-row strong,.dashboard-recent-row span{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dashboard-recent-row strong{font-size:.82rem;font-weight:900;color:var(--text)}
.dashboard-recent-row span{margin-top:2px;color:var(--muted);font-size:.73rem}
.dashboard-recent-row em{font-style:normal;color:var(--muted);font-size:.72rem;font-weight:850;white-space:nowrap}
.dashboard-module-card footer{padding-top:9px;border-top:1px solid var(--border);color:var(--muted);font-size:.76rem;font-weight:800}
.dashboard-loading-card{
  grid-column:1/-1;
  display:grid;
  place-items:center;
  gap:9px;
  min-height:170px;
  border:1px dashed var(--border);
  border-radius:16px;
  background:var(--surface);
  color:var(--muted);
  font-weight:850
}
.agent-tabs{display:grid;grid-template-columns:1fr;gap:8px;margin:0}
.agent-tabs button{
  position:relative;overflow:hidden;display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;align-items:center;
  gap:2px 11px;min-height:68px;border:1px solid transparent;border-radius:12px;background:transparent;
  color:var(--text);font-weight:800;cursor:pointer;text-align:left;padding:12px;box-shadow:none
}
.agent-tabs button:hover{background:var(--soft);border-color:var(--border)}
.agent-tabs button::after{display:none}
.agent-tabs button i{grid-row:1/span 2;width:38px;height:38px;display:grid;place-items:center;border-radius:10px;background:color-mix(in srgb,var(--tab-color,var(--primary2)) 11%,var(--surface));color:var(--tab-color,var(--primary2));font-size:1.05rem}
.agent-tabs button span{position:relative;z-index:1}.agent-tabs button small{position:relative;z-index:1;color:var(--muted);font-size:.75rem;font-weight:800}
.agent-tabs button.is-active{background:var(--soft);border-color:var(--border);box-shadow:none}
.agent-tabs button.is-active i{background:var(--tab-color,var(--primary2));color:#fff}
.agent-tab-chat{--tab-color:#2563eb}.agent-tab-upload{--tab-color:#7c3aed}.agent-tab-adapt{--tab-color:#f97316}.agent-tab-offer{--tab-color:#0f766e}
.modal-launch-row{display:grid;grid-template-columns:1fr;gap:8px;margin-top:auto}
.modal-launch-btn{
  width:100%;min-height:34px;border-radius:10px;background:color-mix(in srgb,var(--surface) 86%,var(--soft));
  justify-content:center;padding:7px 8px;font-size:.74rem
}
.modal-launch-btn i{color:var(--primary2)}
.agent-view{display:none;min-height:calc(100vh - 96px);padding:16px;border:1px solid var(--border);border-radius:18px;background:var(--surface);box-shadow:var(--shadow)}
.agent-view.is-active{display:block}.module-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:16px}
.module-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:wrap}
.history-top-btn{
  min-height:42px;
  padding:10px 15px;
  border-radius:13px;
  border-color:color-mix(in srgb,var(--primary2) 34%,var(--border));
  background:var(--surface-2);
  box-shadow:0 10px 22px rgba(37,99,235,.08)
}
.history-top-btn i{
  width:24px;height:24px;display:grid;place-items:center;border-radius:8px;
  background:var(--primary2);color:#fff;font-size:.9rem
}
.history-top-btn:hover{transform:translateY(-1px);box-shadow:0 14px 28px rgba(37,99,235,.12)}
.reset-adapt-btn{
  min-height:42px;padding:10px 15px;border-radius:13px;
  background:var(--surface-2);
  border-color:color-mix(in srgb,var(--primary2) 34%,var(--border));
  box-shadow:0 10px 22px rgba(37,99,235,.10)
}
.reset-adapt-btn i{
  width:24px;height:24px;display:grid;place-items:center;border-radius:8px;
  background:var(--primary2);color:#fff;font-size:.9rem
}
.reset-adapt-btn:hover{transform:translateY(-1px);box-shadow:0 14px 28px rgba(37,99,235,.14)}
.advanced-ai-chat-scope .ai-hub-root,
.advanced-ai-chat-scope .ai-hub-panel,
.advanced-ai-chat-scope .ai-hub-shell,
.advanced-ai-chat-scope .ai-hub-chat-main{
  min-height:0!important;
}
.advanced-ai-chat-scope .ai-hub-root{
  background:transparent!important;
  --ai-hub-btn-bg:var(--surface);
  --ai-hub-btn-bg-hover:color-mix(in srgb,var(--primary) 6%,var(--surface));
}
.advanced-ai-chat-scope .ai-hub-btn{
  border:1px solid color-mix(in srgb,var(--primary) 28%,var(--border))!important;
  background:var(--surface)!important;
  color:var(--text)!important;
  box-shadow:0 6px 14px rgba(15,23,42,.045)!important;
}
.advanced-ai-chat-scope .ai-hub-btn:hover{
  border-color:color-mix(in srgb,var(--primary) 45%,var(--border))!important;
  background:color-mix(in srgb,var(--primary) 6%,var(--surface))!important;
}
.advanced-ai-chat-scope .ai-hub-btn i{color:var(--primary)}
.advanced-ai-chat-scope .btn,
.advanced-ai-chat-scope .btn-ghost{
  border-color:var(--border)!important;
  background:var(--surface)!important;
  color:var(--text)!important;
}
.advanced-ai-chat-scope .btn:hover,
.advanced-ai-chat-scope .btn-ghost:hover{
  border-color:color-mix(in srgb,var(--primary) 45%,var(--border))!important;
  background:color-mix(in srgb,var(--primary) 6%,var(--surface))!important;
}
.advanced-ai-chat-scope .ai-hub-shell{
  padding:0!important;
}
.advanced-ai-chat-scope .ai-hub-panel{
  padding:0!important;
  border:0!important;
  box-shadow:none!important;
  background:transparent!important;
}
.advanced-ai-chat-scope .ai-hub-chat-layout{
  display:block!important;
  align-items:start!important;
}
.advanced-ai-chat-scope .ai-hub-session-panel{
  position:sticky!important;
  top:86px;
  height:calc(100vh - 104px)!important;
  min-height:0!important;
  max-height:none!important;
  overflow:hidden;
}
.advanced-ai-chat-scope .ai-hub-session-list{
  overflow:auto!important;
}
.advanced-ai-chat-scope .ai-hub-chat-log{
  min-height:calc(100vh - 308px)!important;
  max-height:none!important;
  overflow:visible!important;
}
.advanced-ai-chat-scope .ai-hub-chat-toolbar{
  justify-content:flex-end!important;
  margin-bottom:12px!important;
}
.advanced-ai-chat-scope .ai-hub-agent{
  border-radius:14px!important;
}
.advanced-ai-chat-scope .ai-hub-profile-cards{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:14px;
}
.advanced-ai-chat-scope .ai-hub-profile-card{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:0;
  width:100%;
  padding:16px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface);
  color:var(--text);
  box-shadow:var(--shadow);
}
.advanced-ai-chat-scope .ai-hub-profile-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.advanced-ai-chat-scope .ai-hub-profile-card h4{
  margin:0;
  font-size:1rem;
  line-height:1.25;
  font-weight:800;
  color:var(--text);
}
.advanced-ai-chat-scope .ai-hub-profile-sub{
  margin-top:4px;
  color:var(--muted);
  font-size:.78rem;
  line-height:1.35;
}
.advanced-ai-chat-scope .ai-hub-profile-years{
  display:grid;
  place-items:center;
  flex:0 0 auto;
  min-width:54px;
  min-height:48px;
  padding:6px 8px;
  border-radius:12px;
  background:var(--soft);
  color:var(--primary2);
  font-weight:900;
  line-height:1;
}
.advanced-ai-chat-scope .ai-hub-profile-years span{
  margin-top:3px;
  color:var(--muted);
  font-size:.68rem;
  font-weight:800;
  text-transform:uppercase;
}
.advanced-ai-chat-scope .ai-hub-profile-age{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-top:5px;
  color:var(--muted);
  font-size:.8rem;
  font-weight:750;
}
.advanced-ai-chat-scope .ai-hub-profile-age i{
  color:var(--primary2);
  font-size:.82rem;
}
.advanced-ai-chat-scope .ai-hub-profile-info-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.advanced-ai-chat-scope .ai-hub-profile-info{
  display:grid;
  grid-template-columns:18px minmax(70px,.7fr) minmax(0,1.3fr);
  align-items:center;
  gap:6px;
  min-width:0;
  padding:8px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--soft);
  font-size:.78rem;
}
.advanced-ai-chat-scope .ai-hub-profile-info-location{
  grid-template-columns:18px minmax(0,1fr);
}
.advanced-ai-chat-scope .ai-hub-profile-info strong{
  min-width:0;
  color:var(--text);
  font-weight:750;
  overflow-wrap:anywhere;
  white-space:normal;
}
.advanced-ai-chat-scope .ai-hub-profile-info i{
  color:var(--primary2);
}
.advanced-ai-chat-scope .ai-hub-profile-info span{
  color:var(--muted);
  font-weight:700;
}
.advanced-ai-chat-scope .ai-hub-profile-summary{
  padding:10px 12px;
  border-radius:12px;
  background:var(--soft);
}
.advanced-ai-chat-scope .ai-hub-profile-summary span{
  display:block;
  margin-bottom:5px;
  color:var(--muted);
  font-size:.72rem;
  font-weight:800;
  text-transform:uppercase;
}
.advanced-ai-chat-scope .ai-hub-profile-summary p{
  margin:0;
  color:var(--text);
  font-size:.86rem;
  line-height:1.45;
}
.advanced-ai-chat-scope .ai-hub-profile-footer{
  margin-top:auto;
  padding-top:10px;
  border-top:1px solid var(--border);
}
.advanced-ai-chat-scope .ai-hub-profile-footer .actions-inline{
  justify-content:flex-end;
  flex-wrap:wrap;
}
.advanced-ai-chat-scope .ai-hub-profile-answer{
  display:grid;
  gap:14px;
}
.advanced-ai-chat-scope .ai-hub-profile-answer-text{
  padding:12px 14px;
  border:1px solid var(--ai-hub-log-border);
  border-radius:14px;
  background:color-mix(in srgb,var(--ai-hub-card-bg) 78%,transparent);
  color:var(--ai-hub-model-text);
  line-height:1.6;
}
.advanced-ai-chat-scope .msg:has(.ai-hub-msg-table),
.advanced-ai-chat-scope .msg:has(.ai-hub-summary-table-wrap){
  max-width:min(96%, 1080px);
}
.advanced-ai-chat-scope .ai-hub-summary-table-wrap{
  width:100%;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface);
}
.advanced-ai-chat-scope .ai-hub-summary-table{
  width:100%;
  min-width:680px;
  border-collapse:separate;
  border-spacing:0;
  color:var(--text);
}
.advanced-ai-chat-scope .ai-hub-summary-table th,
.advanced-ai-chat-scope .ai-hub-summary-table td{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:top;
  font-size:.84rem;
}
.advanced-ai-chat-scope .ai-hub-summary-table tr:last-child td{
  border-bottom:0;
}
.advanced-ai-chat-scope .ai-hub-summary-table th{
  background:var(--soft);
  color:var(--muted);
  font-size:.72rem;
  font-weight:850;
  text-transform:uppercase;
}
.advanced-ai-chat-scope .ai-hub-summary-table td:first-child,
.advanced-ai-chat-scope .ai-hub-summary-table td:nth-child(3){
  width:88px;
  white-space:nowrap;
  font-weight:800;
}
.advanced-ai-chat-scope .ai-hub-thinking{
  display:inline-flex;
  align-items:center;
  min-width:205px;
  font-weight:500;
}
.advanced-ai-chat-scope .ai-hub-thinking-main{
  display:inline-flex;
  align-items:center;
  gap:9px;
}
.advanced-ai-chat-scope .ai-hub-thinking-text{
  opacity:.68;
  animation:advancedAiHubThinkingPulse 1.35s ease-in-out infinite;
}
.advanced-ai-chat-scope .ai-hub-thinking-spinner{
  width:18px;
  height:18px;
  justify-content:center;
}
.advanced-ai-chat-scope .ai-hub-thinking-spinner::before{
  width:16px;
  height:16px;
}
.advanced-ai-chat-scope .ai-hub-response-timer{
  display:inline-flex;
  margin-top:5px;
  margin-left:12px;
  padding:2px 6px;
  border-radius:999px;
  background:var(--soft);
  color:var(--primary2);
  font-size:.68rem;
  font-weight:700;
}
@keyframes advancedAiHubThinkingPulse{
  0%,100%{opacity:.48}
  50%{opacity:.86}
}
.advanced-ai-chat-scope .ai-hub-composer{
  position:sticky;
  bottom:12px;
  z-index:5;
  padding:10px;
  border:1px solid var(--border);
  border-radius:16px;
  background:color-mix(in srgb,var(--surface) 92%,transparent);
  backdrop-filter:blur(14px);
}
.module-head h2{font-size:1.18rem;margin-bottom:5px}.chat-layout{display:grid;grid-template-columns:280px minmax(0,1fr);gap:14px}
.two-col{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:stretch}.upload-layout{display:grid;grid-template-columns:1fr;gap:14px}.pipeline{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px}
.adapt-stack{grid-template-columns:1fr}
.tool-panel,.work-panel,.result-panel{border:1px solid var(--border);border-radius:15px;background:var(--soft);padding:14px;min-width:0}
.tool-panel h3,.work-panel h3{font-size:1rem;margin-bottom:12px}.chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.chip{border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text);padding:8px 10px;font-weight:700;cursor:pointer}
label{font-weight:800;color:var(--text);display:block;margin-bottom:7px}
input,textarea,select{width:100%;border:1px solid var(--border);border-radius:11px;background:var(--surface);color:var(--text);padding:12px;outline:none}
textarea{min-height:140px;resize:vertical}.composer,.search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px}.chat-log{min-height:430px;max-height:54vh;overflow:auto;border:1px solid var(--border);border-radius:13px;background:var(--surface);padding:14px;margin-bottom:12px}
.msg{max-width:min(820px,86%);padding:12px 14px;border-radius:15px;margin-bottom:10px;background:var(--soft);line-height:1.55;white-space:pre-wrap}.msg.user{margin-left:auto;background:var(--primary2);color:#fff}
.dropzone{display:grid;place-items:center;text-align:center;gap:8px;min-height:132px;border:2px dashed var(--border);border-radius:15px;background:var(--surface);cursor:pointer;padding:16px}
.dropzone i{font-size:2rem;color:var(--primary2)}.dropzone span{color:var(--muted)}.dropzone.compact{min-height:78px;grid-template-columns:auto 1fr;place-items:center start;text-align:left;margin:10px 0}.dropzone.compact i{font-size:1.35rem}
.form-hint{margin:-2px 0 10px;color:var(--muted);font-size:.82rem;line-height:1.35}
.progress-steps{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin:12px 0}
.step{position:relative;overflow:hidden;display:grid;gap:4px;min-height:88px;padding:12px;border:1px solid var(--border);border-radius:13px;background:var(--surface);color:var(--muted);font-size:.82rem;font-weight:800}
.step::after{content:"";position:absolute;inset:auto -20px -34px auto;width:90px;height:90px;border-radius:50%;background:color-mix(in srgb,var(--primary2) 10%,transparent)}
.step i{width:30px;height:30px;display:grid;place-items:center;border-radius:10px;background:var(--soft);color:var(--primary2)}
.step strong{color:var(--text);line-height:1.2}.step span{font-size:.72rem;line-height:1.35}
.step.active{border-color:color-mix(in srgb,var(--primary2) 45%,var(--border));color:var(--text)}
.step.current i{background:var(--primary2);color:#fff;animation:stepPulse 1.1s ease-in-out infinite}
.step.current::before{content:"";position:absolute;inset:0;background:var(--surface-2);animation:stepSweep 1.35s linear infinite}
.step.done{border-color:color-mix(in srgb,var(--primary) 48%,var(--border))}
.step.done i{background:var(--primary);color:#fff}
.step.done i::before{content:"\F26E";font-family:"bootstrap-icons";font-style:normal}
.step.error{border-color:var(--danger);color:var(--danger)}
.step.error i{background:var(--danger);color:#fff}
@keyframes stepPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.08)}}
@keyframes stepSweep{from{transform:translateX(-100%)}to{transform:translateX(100%)}}
.result-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}
.result-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}
.upload-result-empty,.upload-loading-panel,.upload-error-panel{min-height:320px;display:grid;place-items:center;text-align:center;border:1px dashed var(--border);border-radius:14px;background:var(--surface);color:var(--muted);padding:22px}
.adapt-empty-result{min-height:180px;display:grid;place-items:center;text-align:center;border:1px dashed var(--border);border-radius:14px;background:var(--surface);color:var(--muted);font-weight:800;padding:22px}
.adapt-loading-panel{min-height:220px;display:grid;place-items:center;text-align:center;gap:11px;border:1px solid color-mix(in srgb,var(--primary2) 34%,var(--border));border-radius:14px;background:var(--surface-2);padding:24px;color:var(--text)}
.adapt-loading-panel strong{font-size:1rem}.adapt-loading-panel p{margin:0;max-width:430px;color:var(--muted);line-height:1.55}
.adapt-loading-ring{width:58px;height:58px;border-radius:50%;border:4px solid color-mix(in srgb,var(--primary2) 18%,transparent);border-top-color:var(--primary2);border-right-color:var(--primary);animation:uploadSpin .9s linear infinite}
.template-chip{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid color-mix(in srgb,var(--primary2) 36%,var(--border));border-radius:10px;background:color-mix(in srgb,var(--primary2) 8%,var(--surface));padding:10px 12px;color:var(--text);font-size:.9rem}
.template-chip strong{display:block}.template-chip span{display:block;color:var(--muted);font-size:.78rem;margin-top:2px}.template-chip button{border:0;background:transparent;color:var(--danger);cursor:pointer;font-size:1rem}
.adapt-document-result{display:grid;gap:12px}
.adapt-result-head{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:13px 14px;border:1px solid var(--border);border-radius:14px;background:var(--surface)
}
.adapt-result-head span{display:block;color:var(--primary2);font-size:.72rem;font-weight:850;text-transform:uppercase;letter-spacing:.04em}
.adapt-result-head strong{display:block;margin-top:3px;font-size:.96rem;line-height:1.4;color:var(--text)}
.adapt-result-head em{display:block;margin-top:4px;color:var(--muted);font-size:.76rem;font-style:normal;font-weight:800}
.adapt-result-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.adapt-print-btn{min-height:36px;padding:8px 11px;font-size:.8rem;white-space:nowrap}
.adapt-document-frame-wrap{
  overflow:hidden;border:1px solid var(--border);border-radius:14px;background:#e9eef6;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.6)
}
.adapt-document-frame{display:block;width:100%;height:min(78vh,920px);min-height:620px;border:0;background:#fff}
.offer-workflow{display:grid;grid-template-columns:1fr;gap:14px;align-items:start}
.offer-search-panel,.offer-analysis-panel,.offer-selection-panel,.offer-adapt-panel{grid-column:1/-1;width:100%}
.offer-step-panel{display:grid;gap:12px;align-content:start;background:var(--soft)}
.offer-step-title{display:flex;align-items:flex-start;gap:11px;margin-bottom:2px}
.offer-step-title > span{
  width:34px;height:34px;display:grid;place-items:center;flex:0 0 auto;border-radius:11px;
  background:var(--primary);color:#fff;font-weight:900
}
.offer-step-title h3{margin:0;font-size:1rem;font-weight:900}.offer-step-title p{margin:3px 0 0;color:var(--muted);font-size:.78rem;line-height:1.4}
.offer-search-panel textarea,.offer-adapt-panel textarea{min-height:118px}
.offer-analysis-empty,.offer-empty-result{
  min-height:170px;display:grid;place-items:center;text-align:center;border:1px dashed var(--border);
  border-radius:14px;background:var(--surface);color:var(--muted);font-weight:800;padding:20px
}
.offer-ocr-required{
  min-height:170px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:14px;align-items:center;
  border:1px solid color-mix(in srgb,var(--primary2) 42%,var(--border));border-radius:14px;
  background:var(--surface-2);
  padding:16px;color:var(--text)
}
.offer-ocr-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:13px;background:color-mix(in srgb,var(--primary2) 12%,var(--surface));color:var(--primary2);font-size:1.18rem}
.offer-ocr-copy strong{display:block;font-size:.96rem;line-height:1.35}.offer-ocr-copy p{margin:4px 0 0;color:var(--muted);font-size:.82rem;line-height:1.5}
.offer-analysis{display:grid;gap:12px}
.offer-analysis-summary{
  display:grid;grid-template-columns:auto minmax(0,1fr);gap:11px;align-items:start;
  padding:13px;border:1px solid var(--border);border-radius:14px;background:var(--surface)
}
.offer-analysis-summary i{width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:color-mix(in srgb,var(--primary) 10%,var(--surface));color:var(--primary)}
.offer-analysis-summary strong{display:block;font-size:.94rem;line-height:1.45}.offer-analysis-summary p{margin:5px 0 0;color:var(--muted);font-size:.82rem;line-height:1.5}
.offer-required-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.offer-required-card{
  display:grid;gap:8px;align-content:start;min-width:0;padding:12px;border:1px solid var(--border);
  border-radius:13px;background:var(--surface);box-shadow:0 8px 18px rgba(15,23,42,.04)
}
.offer-required-card header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.offer-required-card strong{font-size:.9rem;line-height:1.35}.offer-required-card header span{white-space:nowrap;color:var(--primary);font-weight:900;font-size:.78rem}
.offer-required-tags{display:flex;flex-wrap:wrap;gap:6px}
.offer-required-tags em{
  padding:5px 7px;border-radius:999px;border:1px solid var(--border);
  background:var(--soft);color:var(--muted);font-style:normal;font-size:.7rem;font-weight:800
}
.offer-required-card p,.offer-required-card small{margin:0;color:var(--muted);font-size:.78rem;line-height:1.45}
.offer-required-card small{color:var(--text)}
.offer-missing-box{padding:12px;border:1px solid color-mix(in srgb,var(--danger) 34%,var(--border));border-radius:13px;background:color-mix(in srgb,var(--danger) 6%,var(--surface))}
.offer-missing-box strong{display:block;margin-bottom:8px;color:var(--danger);font-size:.86rem}
.offer-missing-box ul{margin:0;padding-left:18px;color:var(--text);font-size:.8rem;line-height:1.5}.offer-missing-box em{display:block;color:var(--muted);font-style:normal}
.ocr-modal-body{display:grid;gap:12px}
.ocr-modal-grid{display:grid;gap:12px}
.ocr-modal-card{display:grid;gap:7px;padding:13px;border:1px solid var(--border);border-radius:13px;background:var(--surface)}
.ocr-modal-card strong{font-size:.9rem}.ocr-modal-card p{margin:0;color:var(--muted);line-height:1.5}.ocr-modal-card small,.ocr-modal-card em{color:var(--primary2);font-style:normal;font-weight:800;font-size:.78rem}
.ocr-modal-preview pre{max-height:420px;overflow:auto;margin:0;padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--soft);white-space:pre-wrap;color:var(--text);font-size:.8rem;line-height:1.45}
.ocr-modal-actions{display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap;margin-top:14px}
.offer-selection-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.offer-selection-actions{display:flex;gap:8px;flex-wrap:wrap}.offer-selection-actions .soft-btn{min-height:34px;padding:7px 10px;font-size:.78rem}
.offer-profile-grid.profiles-list{grid-template-columns:repeat(3,minmax(320px,1fr));max-height:650px;align-content:start;gap:12px;padding:2px 7px 2px 2px}
.profile-card[data-mode="multi"]{min-height:0;height:auto;padding-bottom:12px}
.offer-profile-card{
  min-height:322px;padding:13px;border-radius:12px;gap:11px;overflow:visible;
  border-color:color-mix(in srgb,var(--border) 86%,var(--primary2));
  background:var(--surface-2);
  box-shadow:0 10px 24px rgba(15,23,42,.055)
}
.offer-profile-card::before{width:4px;border-radius:12px 0 0 12px}
.profile-card.offer-profile-card h4{
  white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  font-size:.94rem;line-height:1.25;letter-spacing:0;overflow:hidden
}
.profile-card.offer-profile-card p{display:block;overflow:visible;-webkit-line-clamp:unset;color:inherit;font-size:inherit;line-height:inherit}
.profile-card.offer-profile-card p:first-of-type{
  width:auto;max-width:none;padding:0;border:0;border-radius:0;background:transparent;color:inherit;font-size:inherit;font-weight:inherit
}
.profile-card.offer-profile-card input{
  position:static;width:18px;height:18px;flex:0 0 auto;margin:0;padding:0;accent-color:var(--primary)
}
.offer-profile-top{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:start}
.offer-profile-identity{min-width:0;display:grid;gap:4px}
.offer-profile-identity p{
  margin:0;color:var(--text);font-size:.8rem;font-weight:850;line-height:1.35;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden
}
.offer-profile-tools{display:flex;align-items:flex-start;gap:7px;min-width:max-content}
.offer-profile-tools .profile-view-btn{position:static}
.offer-profile-badges{display:flex;flex-wrap:wrap;gap:6px;min-height:25px}
.profile-badge{
  display:inline-flex;align-items:center;min-height:24px;padding:4px 8px;border-radius:999px;
  border:1px solid color-mix(in srgb,var(--primary2) 18%,var(--border));
  background:color-mix(in srgb,var(--primary2) 7%,var(--surface));
  color:color-mix(in srgb,var(--primary2) 78%,var(--text));font-size:.72rem;font-weight:850;line-height:1
}
.profile-badge-id{color:#1d4ed8;background:color-mix(in srgb,#2563eb 9%,var(--surface));border-color:color-mix(in srgb,#2563eb 24%,var(--border))}
.offer-profile-meta{
  display:grid;grid-template-columns:minmax(96px,.55fr) minmax(0,1fr);gap:8px;align-items:start;
  padding:8px 9px;border:1px solid color-mix(in srgb,var(--border) 85%,var(--primary2));border-radius:10px;background:color-mix(in srgb,var(--soft) 55%,var(--surface))
}
.offer-profile-meta span,.offer-profile-block span{
  color:var(--muted);font-size:.68rem;font-weight:900;text-transform:uppercase;letter-spacing:0
}
.offer-profile-meta span{display:flex;align-items:center;gap:6px;line-height:1.25}.offer-profile-meta i{color:var(--primary2)}
.offer-profile-meta strong{min-width:0;color:var(--text);font-size:.78rem;line-height:1.35;word-break:break-word}
.offer-profile-block{display:grid;gap:5px;min-width:0}
.offer-profile-block p{
  margin:0;color:var(--muted);font-size:.8rem;line-height:1.42;
  display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3
}
.offer-profile-match p{color:var(--text)}
.offer-profile-risk{
  margin-top:auto;padding:8px 9px;border-radius:10px;
  background:color-mix(in srgb,var(--danger) 5%,var(--surface));
  border:1px solid color-mix(in srgb,var(--danger) 18%,var(--border))
}
.offer-profile-risk span{color:color-mix(in srgb,var(--danger) 76%,var(--text))}
.offer-profile-risk p{color:var(--danger);font-weight:820;-webkit-line-clamp:2}
.profile-card h4{display:flex;align-items:flex-start;gap:7px;min-width:0}
.profile-score{
  margin-left:auto;flex:0 0 auto;padding:2px 6px;border-radius:999px;
  background:color-mix(in srgb,var(--primary) 12%,var(--surface));color:var(--primary);font-size:.66rem;font-weight:900
}
.profile-card .profile-required{color:var(--primary);font-weight:850}
.profile-card .profile-match-reason{color:var(--text);-webkit-line-clamp:3}
.profile-card .profile-risk{color:var(--danger);font-weight:800}
.offer-check{display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px;align-items:start;padding:10px;border:1px solid var(--border);border-radius:12px;background:var(--surface);font-size:.82rem;line-height:1.45}
.offer-check input{width:18px;height:18px;margin-top:1px;padding:0}.offer-check span{color:var(--text)}
.offer-detected-structure{padding:11px;border:1px solid var(--border);border-radius:12px;background:var(--surface)}
.offer-detected-structure strong{display:block;margin-bottom:6px;font-size:.82rem;color:var(--primary2)}
.offer-detected-structure p{margin:0;color:var(--muted);font-size:.8rem;line-height:1.45}
.offer-detected-structure pre{margin:0;max-height:170px;overflow:auto;white-space:pre-wrap;color:var(--text);font-size:.78rem;line-height:1.45}
.offer-detected-structure.is-empty{color:var(--muted);font-weight:800;text-align:center;border-style:dashed}
.offer-adapt-results{display:grid;gap:14px}
.offer-adapt-card{display:grid;gap:12px;border:1px solid var(--border);border-radius:15px;background:var(--surface);padding:13px}
.offer-adapt-card > header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:10px;border-bottom:1px solid var(--border)}
.offer-adapt-card header span{display:block;color:var(--primary2);font-size:.7rem;font-weight:850;text-transform:uppercase}
.offer-adapt-card h3{margin:3px 0 3px;font-size:1rem;font-weight:900}.offer-adapt-card p{margin:0;color:var(--muted);font-size:.8rem}
.offer-adapt-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}.offer-adapt-actions em{color:var(--muted);font-style:normal;font-size:.78rem;font-weight:800}
.offer-adapt-running{border-color:color-mix(in srgb,var(--primary2) 44%,var(--border))}.offer-adapt-done{border-color:color-mix(in srgb,var(--primary) 38%,var(--border))}
.offer-adapt-error{padding:12px;border-radius:12px;background:color-mix(in srgb,var(--danger) 8%,var(--surface));color:var(--danger);font-weight:800}
.offer-adapt-pending{display:grid;place-items:center;align-content:center;gap:9px;min-height:170px;border:1px dashed var(--border);border-radius:13px;color:var(--muted);font-weight:800;text-align:center}
.offer-adapt-pending .upload-orbit{width:48px;height:48px}
.offer-adapt-workspace{display:grid;gap:12px}
.offer-adapt-strip{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(205px,1fr));
  gap:8px;
  align-items:stretch;
}
.offer-adapt-mini-card{
  display:grid;
  gap:4px;
  min-height:78px;
  padding:10px 11px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface);
  color:var(--text);
  text-align:left;
  cursor:pointer;
}
.offer-adapt-mini-card:hover,.offer-adapt-mini-card.is-active{
  border-color:color-mix(in srgb,var(--primary2) 38%,var(--border));
  background:color-mix(in srgb,var(--primary2) 5%,var(--surface));
}
.offer-adapt-mini-card strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:.86rem;
}
.offer-adapt-mini-card small{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-size:.72rem;
  font-weight:750;
}
.offer-adapt-mini-status{
  display:flex;
  align-items:center;
  gap:6px;
  color:var(--primary2);
  font-size:.68rem;
  font-weight:900;
  text-transform:uppercase;
}
.offer-adapt-done .offer-adapt-mini-status{color:var(--primary)}
.offer-adapt-error .offer-adapt-mini-status{color:var(--danger)}
.mini-loader{
  width:13px;
  height:13px;
  border:2px solid color-mix(in srgb,var(--primary2) 22%,transparent);
  border-top-color:var(--primary2);
  border-radius:50%;
  animation:uploadSpin .82s linear infinite;
}
.offer-adapt-current{
  display:grid;
  gap:12px;
  border:1px solid var(--border);
  border-radius:15px;
  background:var(--surface);
  padding:14px;
  box-shadow:0 10px 24px rgba(15,23,42,.045);
}
.offer-adapt-current > header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding-bottom:11px;
  border-bottom:1px solid var(--border);
}
.offer-adapt-current header span{display:block;color:var(--primary2);font-size:.7rem;font-weight:900;text-transform:uppercase}
.offer-adapt-current h3{margin:3px 0;font-size:1.02rem;font-weight:900}
.offer-adapt-current p{margin:0;color:var(--muted);font-size:.8rem}
.offer-adapt-pending.is-current{min-height:320px}
.ocr-modal-loader{display:grid;place-items:center;gap:8px;margin-top:8px;padding:12px;border:1px dashed color-mix(in srgb,var(--primary2) 34%,var(--border));border-radius:12px;background:color-mix(in srgb,var(--primary2) 6%,var(--surface));color:var(--text)}
.ocr-modal-loader .upload-orbit{width:46px;height:46px;margin-bottom:0}
.offer-adapt-frame{height:min(70vh,760px);min-height:520px}

/* AO workflow polish */
.offer-step-panel{
  gap:14px;
  padding:16px;
  border-radius:18px;
  background:var(--surface-2);
}
.offer-step-title{align-items:center;margin:0}
.offer-step-title > span{width:38px;height:38px;border-radius:12px}
.offer-step-title h3{font-size:1.03rem}.offer-step-title p{font-size:.8rem}
.offer-search-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(250px,320px);
  gap:12px;
  align-items:stretch;
}
.offer-search-panel textarea{
  min-height:142px;
  resize:vertical;
  line-height:1.45;
}
.offer-search-side{
  display:grid;
  grid-template-rows:minmax(88px,1fr) auto;
  gap:10px;
  align-items:stretch;
}
.offer-file-drop,.offer-template-drop{
  min-height:88px!important;
  margin:0!important;
  padding:12px!important;
  border-width:1.5px;
  grid-template-columns:auto minmax(0,1fr)!important;
  align-content:center;
  transition:border-color .18s ease,background .18s ease,box-shadow .18s ease,transform .18s ease;
}
.offer-file-drop i,.offer-template-drop i{
  grid-row:1 / span 2;
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:color-mix(in srgb,var(--primary2) 10%,var(--surface));
}
.offer-file-drop strong,.offer-template-drop strong{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--text);
}
.offer-file-drop small,.offer-template-drop small{
  display:block;
  grid-column:2;
  margin-top:3px;
  color:var(--muted);
  font-size:.72rem;
  font-weight:800;
}
.offer-file-drop.has-file,.offer-template-drop.has-file{
  border-color:color-mix(in srgb,var(--primary) 58%,var(--border));
  background:var(--surface-2);
  box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 10%,transparent);
}
.offer-file-drop.has-file i,.offer-template-drop.has-file i{background:var(--primary);color:#fff}
.offer-search-footer{display:flex;justify-content:flex-end;gap:10px;align-items:center}
.offer-search-submit,.offer-adapt-submit{
  width:100%;
  min-width:0;
  justify-content:center;
  white-space:nowrap;
}
.offer-step-feedback{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:10px;
  align-items:center;
  min-height:48px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--surface);
  color:var(--text);
}
.offer-step-feedback[hidden]{display:none}
.offer-step-feedback.is-loading{
  border-color:color-mix(in srgb,var(--primary2) 36%,var(--border));
  background:var(--surface-2);
}
.offer-step-feedback.is-info i{color:var(--primary2)}
.offer-step-feedback strong{display:block;font-size:.86rem}
.offer-step-feedback p{margin:0;color:var(--muted);font-size:.82rem;line-height:1.45}
.offer-analysis-empty,.offer-empty-result{min-height:118px}
.offer-loading-panel,.offer-analysis-loading{
  min-height:170px;
  display:grid;
  place-items:center;
  align-content:center;
  gap:10px;
  text-align:center;
  border:1px dashed color-mix(in srgb,var(--primary2) 38%,var(--border));
  border-radius:14px;
  background:var(--surface-2);
  color:var(--text);
  padding:22px;
}
.offer-loading-panel strong,.offer-analysis-loading strong{font-size:1rem}
.offer-loading-panel p,.offer-analysis-loading p{max-width:460px;margin:0;color:var(--muted);line-height:1.6}
.offer-analysis-summary{
  grid-template-columns:auto minmax(0,1fr);
  padding:14px;
  border-radius:15px;
}
.offer-required-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.offer-required-card{
  gap:0;
  overflow:hidden;
  padding:0;
  border-radius:14px;
  background:var(--surface);
}
.offer-required-card header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:12px 13px;
  border-bottom:1px solid var(--border);
  background:color-mix(in srgb,var(--soft) 62%,var(--surface));
}
.offer-required-kicker{
  display:block;
  margin-bottom:3px;
  color:var(--primary2);
  font-size:.68rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:0;
}
.offer-required-card header strong{
  display:block;
  color:var(--text);
  font-size:.92rem;
  line-height:1.35;
}
.offer-required-card header em{
  flex:0 0 auto;
  padding:5px 8px;
  border:1px solid color-mix(in srgb,var(--primary) 24%,var(--border));
  border-radius:999px;
  background:color-mix(in srgb,var(--primary) 8%,var(--surface));
  color:var(--primary);
  font-size:.72rem;
  font-style:normal;
  font-weight:900;
  white-space:nowrap;
}
.offer-required-table{
  display:grid;
  grid-template-columns:1fr;
}
.offer-required-table div{
  display:grid;
  grid-template-columns:minmax(108px,.35fr) minmax(0,1fr);
  gap:10px;
  padding:9px 13px;
  border-bottom:1px solid color-mix(in srgb,var(--border) 74%,transparent);
}
.offer-required-table div:last-child{border-bottom:0}
.offer-required-table span{
  color:var(--muted);
  font-size:.68rem;
  font-weight:900;
  text-transform:uppercase;
}
.offer-required-table p{
  margin:0;
  color:var(--text);
  font-size:.81rem;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.offer-required-card footer{
  padding:11px 13px;
  border-top:1px solid var(--border);
  background:color-mix(in srgb,var(--primary2) 5%,var(--surface));
  color:var(--text);
  font-size:.8rem;
  line-height:1.45;
}
.offer-missing-box{display:grid;gap:9px}
.offer-missing-box > div{display:grid;gap:8px}
.offer-missing-box section{
  display:grid;
  gap:4px;
  padding:9px 10px;
  border:1px solid color-mix(in srgb,var(--danger) 18%,var(--border));
  border-radius:10px;
  background:var(--surface);
}
.offer-missing-box section span{color:var(--danger);font-weight:900}
.offer-missing-box section p,.offer-missing-box section em{margin:0;color:var(--muted);font-style:normal;font-size:.78rem;line-height:1.4}
.offer-selection-head{align-items:center}
.offer-profile-grid.profiles-list{
  grid-template-columns:repeat(3,minmax(300px,1fr));
  max-height:720px;
  gap:12px;
  padding:2px 8px 2px 2px;
}
.offer-profile-card{
  display:grid;
  gap:10px;
  min-height:0;
  padding:13px;
  border-radius:14px;
  overflow:visible;
}
.offer-profile-card-head{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:start;
}
.offer-profile-title{min-width:0;display:grid;gap:7px}
.profile-card.offer-profile-card .offer-profile-title h4{
  display:block;
  margin:0;
  color:var(--text);
  font-size:.94rem;
  line-height:1.25;
  white-space:normal;
  overflow-wrap:anywhere;
}
.offer-profile-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  min-width:max-content;
}
.offer-profile-actions .profile-view-btn{
  position:static;
  width:32px;
  height:32px;
  min-height:32px;
  padding:0;
  border-radius:9px;
}
.offer-profile-actions .profile-view-btn span{display:none}
.offer-profile-actions input,.profile-card.offer-profile-card input{
  position:static;
  width:18px;
  height:18px;
  margin:0;
  padding:0;
  accent-color:var(--primary);
}
.offer-profile-role{
  display:grid;
  grid-template-columns:18px minmax(0,1fr);
  gap:7px;
  align-items:start;
  padding:9px 10px;
  border:1px solid color-mix(in srgb,var(--primary2) 16%,var(--border));
  border-radius:11px;
  background:color-mix(in srgb,var(--primary2) 6%,var(--surface));
  color:var(--text);
  font-size:.82rem;
  font-weight:850;
  line-height:1.35;
}
.offer-profile-role i{color:var(--primary2)}
.offer-profile-card-body{
  display:grid;
  gap:8px;
}
.offer-profile-row{
  display:grid;
  gap:5px;
  min-width:0;
}
.offer-profile-row > span,.offer-profile-risk > span{
  display:flex;
  align-items:center;
  gap:6px;
  color:var(--muted);
  font-size:.68rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:0;
}
.offer-profile-row strong,.offer-profile-row p,.offer-profile-risk p{
  margin:0;
  color:var(--text);
  font-size:.81rem;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.offer-profile-row p,.offer-profile-risk p{
  display:block;
  overflow:visible;
  -webkit-line-clamp:unset;
  -webkit-box-orient:initial;
}
.offer-profile-risk{
  margin-top:0;
  padding:9px 10px;
  border-radius:11px;
}
.offer-profile-risk p{color:var(--danger);font-weight:800}
.offer-adapt-setup{
  display:grid;
  grid-template-columns:minmax(190px,260px) minmax(0,1fr);
  gap:12px;
  align-items:stretch;
}
.offer-adapt-setup .offer-check{margin:0;align-items:center}
.offer-adapt-prompt{display:grid;gap:7px}
.offer-adapt-panel textarea{min-height:92px}
.offer-form-actions{display:flex;justify-content:flex-end;gap:10px;align-items:center;flex-wrap:wrap}
.offer-form-actions .offer-adapt-submit{width:auto;min-width:260px;flex:1 1 320px}
.offer-history-btn{
  min-width:150px;
  flex:0 0 auto;
  border-color:color-mix(in srgb,var(--primary2) 32%,var(--border));
  background:var(--surface-2);
}
.offer-history-btn i{color:var(--primary2)}
.offer-ocr-required{
  min-height:0;
  grid-template-columns:auto minmax(0,1fr) auto;
  padding:12px;
}
.offer-ocr-required .primary-btn{white-space:nowrap}
.structured-docs-panel{display:grid;gap:12px}
.ops-title-action{display:flex;align-items:center;gap:10px;min-width:0}
.ops-title-action .soft-btn{min-height:34px;padding:7px 10px;font-size:.78rem;white-space:nowrap}
.docs-filter-row{display:grid;grid-template-columns:minmax(0,1fr) 210px;gap:10px;align-items:center}
.adapt-docs-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.adapt-doc-row{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;
  padding:11px;border:1px solid var(--border);border-radius:12px;background:var(--surface)
}
.adapt-doc-row > i{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:var(--soft);color:var(--primary2)}
.adapt-doc-row strong,.adapt-doc-row span{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.adapt-doc-row strong{font-size:.9rem}.adapt-doc-row span{margin-top:3px;color:var(--muted);font-size:.76rem;font-weight:750}
.adapt-doc-history-card{cursor:pointer;transition:border-color .16s ease,background .16s ease,transform .16s ease,box-shadow .16s ease}
.adapt-doc-history-card:hover,.adapt-doc-history-card:focus-visible{
  border-color:color-mix(in srgb,var(--primary2) 46%,var(--border));
  background:color-mix(in srgb,var(--primary2) 5%,var(--surface));
  transform:translateY(-1px);
  box-shadow:0 12px 26px rgba(15,23,42,.08);
  outline:none;
}
.adapt-doc-empty{grid-column:1/-1;padding:18px;border:1px dashed var(--border);border-radius:12px;background:var(--surface);color:var(--muted);text-align:center;font-weight:800}
.offer-history-dialog{width:min(1480px,97vw)}
.offer-history-panel{display:grid;gap:12px}
.offer-history-list{
  display:grid;
  grid-template-columns:repeat(3,minmax(280px,1fr));
  gap:12px;
  min-height:180px;
}
.offer-history-list.is-loading{opacity:.65;pointer-events:none}
.offer-history-card{
  display:grid;
  gap:11px;
  min-width:0;
  padding:13px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface);
  box-shadow:0 8px 18px rgba(15,23,42,.045);
  cursor:pointer;
  transition:border-color .16s ease,background .16s ease,transform .16s ease,box-shadow .16s ease;
}
.offer-history-card:hover,.offer-history-card:focus-visible{
  border-color:color-mix(in srgb,var(--primary2) 46%,var(--border));
  background:color-mix(in srgb,var(--primary2) 5%,var(--surface));
  transform:translateY(-1px);
  box-shadow:0 14px 30px rgba(15,23,42,.09);
  outline:none;
}
.offer-history-card header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.offer-history-card header span{
  display:block;
  color:var(--primary2);
  font-size:.68rem;
  font-weight:900;
  text-transform:uppercase;
}
.offer-history-card h3{
  margin:3px 0 0;
  color:var(--text);
  font-size:.96rem;
  line-height:1.3;
  font-weight:900;
  overflow-wrap:anywhere;
}
.offer-history-delete{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface);
  color:var(--danger);
  cursor:pointer;
}
.offer-history-delete:hover{border-color:var(--danger);background:color-mix(in srgb,var(--danger) 7%,var(--surface))}
.offer-history-card p{
  min-height:52px;
  margin:0;
  color:var(--muted);
  font-size:.8rem;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.offer-history-names{
  display:grid;
  gap:6px;
}
.offer-history-names span{
  display:grid;
  grid-template-columns:18px minmax(0,1fr);
  gap:7px;
  align-items:start;
  min-width:0;
  color:var(--text);
  font-size:.76rem;
  font-weight:800;
  line-height:1.35;
}
.offer-history-names i{color:var(--primary2)}
.offer-history-metrics{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
}
.offer-history-metrics span{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-width:0;
  padding:7px 6px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--soft);
  color:var(--text);
  font-size:.74rem;
  font-weight:850;
  white-space:nowrap;
}
.offer-history-metrics i{color:var(--primary2)}
.offer-history-card footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-top:10px;
  border-top:1px solid var(--border);
  color:var(--muted);
  font-size:.75rem;
}
.offer-history-card footer strong{color:var(--primary2);font-size:.76rem;white-space:nowrap}
.chat-session-history-card.is-active{border-color:color-mix(in srgb,var(--primary) 52%,var(--border));box-shadow:inset 3px 0 0 var(--primary),0 14px 30px rgba(15,23,42,.08)}
.adapt-use-template-btn{width:100%;min-height:34px;border-radius:10px}
.upload-history-panel{display:grid;gap:0}
.upload-history-list{display:grid;gap:8px;max-height:360px;overflow:auto}
.upload-history-empty{
  padding:18px;border:1px dashed var(--border);border-radius:12px;background:var(--surface);
  color:var(--muted);text-align:center;font-weight:800
}
.upload-history-item{
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;
  padding:11px;border:1px solid var(--border);border-radius:12px;background:var(--surface)
}
.upload-history-card{
  min-height:132px;
  align-content:space-between;
  cursor:pointer;
  transition:border-color .16s ease,background .16s ease,transform .16s ease,box-shadow .16s ease;
}
.upload-history-card:hover,.upload-history-card:focus-visible{
  border-color:color-mix(in srgb,var(--primary2) 46%,var(--border));
  background:color-mix(in srgb,var(--primary2) 5%,var(--surface));
  transform:translateY(-1px);
  box-shadow:0 14px 30px rgba(15,23,42,.09);
  outline:none;
}
.upload-history-item strong,.upload-history-item span,.upload-history-item p{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.upload-history-item strong{font-size:.88rem}
.upload-history-item span{margin-top:3px;color:var(--muted);font-size:.74rem;font-weight:750}
.upload-history-item p{margin:4px 0 0;color:var(--muted);font-size:.74rem}
.upload-history-actions{display:flex;gap:6px}
.upload-history-actions .soft-btn{width:32px;height:32px;min-height:32px;padding:0;border-radius:9px}
.upload-loading-panel{align-content:center;gap:10px;color:var(--text)}
.upload-loading-panel strong,.upload-error-panel strong{font-size:1rem}.upload-loading-panel p,.upload-error-panel p{max-width:420px;margin:0;color:var(--muted);line-height:1.6}
.upload-error-panel{gap:8px;color:var(--danger);border-color:color-mix(in srgb,var(--danger) 45%,var(--border))}
.upload-error-panel i{font-size:2rem}
.upload-orbit{position:relative;width:58px;height:58px;margin-bottom:6px}
.upload-orbit span{position:absolute;inset:0;border:3px solid transparent;border-top-color:var(--primary2);border-radius:50%;animation:uploadSpin 1s linear infinite}
.upload-orbit span:nth-child(2){inset:8px;border-top-color:var(--primary);animation-duration:1.35s;animation-direction:reverse}
.upload-orbit span:nth-child(3){inset:17px;border-top-color:var(--muted);animation-duration:.82s}
@keyframes uploadSpin{to{transform:rotate(360deg)}}
.draft-review{display:grid;gap:12px;max-height:650px;overflow:auto;padding-right:4px}
.draft-status{display:flex;align-items:center;gap:9px;padding:11px 12px;border:1px solid color-mix(in srgb,var(--primary) 35%,var(--border));border-radius:13px;background:color-mix(in srgb,var(--primary) 9%,var(--surface));color:var(--text);font-weight:800}
.draft-status i{color:var(--primary)}
.draft-status-error{border-color:color-mix(in srgb,var(--danger) 45%,var(--border));background:color-mix(in srgb,var(--danger) 9%,var(--surface))}
.draft-status-error i{color:var(--danger)}
.draft-filter-tabs{
  position:sticky;top:0;z-index:4;display:flex;gap:7px;overflow:auto;padding:8px;
  border:1px solid var(--border);border-radius:14px;background:color-mix(in srgb,var(--surface) 94%,transparent);
  backdrop-filter:blur(12px);box-shadow:0 8px 18px rgba(15,23,42,.055)
}
.draft-filter-tab{
  display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:7px 10px;border:1px solid var(--border);
  border-radius:10px;background:var(--surface);color:var(--text);font-weight:850;font-size:.78rem;white-space:nowrap;cursor:pointer
}
.draft-filter-tab em{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:var(--soft);color:var(--muted);font-style:normal;font-size:.7rem}
.draft-filter-tab:hover,.draft-filter-tab.is-active{border-color:color-mix(in srgb,var(--primary2) 38%,var(--border));background:var(--soft)}
.draft-filter-tab.is-active em{background:var(--surface);color:var(--primary2)}
.draft-review[data-active-draft-filter="profile"] [data-draft-section-card],
.draft-review[data-active-draft-filter="expertise"] [data-draft-filter-card="profile"],
.draft-review[data-active-draft-filter="competencies"] [data-draft-filter-card="profile"],
.draft-review[data-active-draft-filter="languages"] [data-draft-filter-card="profile"],
.draft-review[data-active-draft-filter="diploms"] [data-draft-filter-card="profile"],
.draft-review[data-active-draft-filter="formations"] [data-draft-filter-card="profile"],
.draft-review[data-active-draft-filter="experiences"] [data-draft-filter-card="profile"],
.draft-review[data-active-draft-filter="projects"] [data-draft-filter-card="profile"]{display:none}
.draft-review[data-active-draft-filter="expertise"] [data-draft-section-card]:not([data-draft-section-card="expertise"]),
.draft-review[data-active-draft-filter="competencies"] [data-draft-section-card]:not([data-draft-section-card="competencies"]),
.draft-review[data-active-draft-filter="languages"] [data-draft-section-card]:not([data-draft-section-card="languages"]),
.draft-review[data-active-draft-filter="diploms"] [data-draft-section-card]:not([data-draft-section-card="diploms"]),
.draft-review[data-active-draft-filter="formations"] [data-draft-section-card]:not([data-draft-section-card="formations"]),
.draft-review[data-active-draft-filter="experiences"] [data-draft-section-card]:not([data-draft-section-card="experiences"]),
.draft-review[data-active-draft-filter="projects"] [data-draft-section-card]:not([data-draft-section-card="projects"]){display:none}
.duplicate-update-panel{
  display:grid;gap:10px;padding:13px;border:1px solid color-mix(in srgb,var(--primary) 30%,var(--border));
  border-radius:15px;background:color-mix(in srgb,var(--primary) 5%,var(--surface))
}
.duplicate-update-panel header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.duplicate-update-panel header span{display:block;color:var(--muted);font-size:.7rem;font-weight:850;text-transform:uppercase;letter-spacing:.04em}
.duplicate-update-panel header h4{margin:2px 0 0;font-size:.94rem;font-weight:900;line-height:1.35}
.duplicate-update-panel p{margin:0;color:var(--muted);font-size:.82rem;line-height:1.55}
.duplicate-update-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.duplicate-choice{
  display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px;align-items:flex-start;
  padding:10px;border:1px solid var(--border);border-radius:12px;background:var(--surface)
}
.duplicate-choice input{width:17px;height:17px;margin-top:2px;padding:0}
.duplicate-choice strong,.duplicate-choice em{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis}
.duplicate-choice strong{font-size:.82rem;line-height:1.3}
.duplicate-choice em{margin-top:4px;color:var(--muted);font-style:normal;font-size:.74rem;line-height:1.35}
.duplicate-choice-section{border-style:dashed}
.duplicate-no-change{padding:11px;border:1px dashed var(--border);border-radius:12px;background:var(--surface);color:var(--muted);font-weight:800;font-size:.82rem}
.draft-summary-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:center;padding:16px;border:1px solid var(--border);border-radius:16px;background:var(--surface-2)}
.draft-summary-card span{color:var(--primary2);font-size:.72rem;font-weight:850;text-transform:uppercase;letter-spacing:.04em}
.draft-summary-card h3{margin:3px 0 5px;font-size:1.35rem;font-weight:900}.draft-summary-card p{margin:0;color:var(--muted);line-height:1.5}
.draft-summary-metric{display:grid;place-items:center;min-width:92px;padding:10px;border-radius:14px;background:var(--surface);border:1px solid var(--border)}
.draft-summary-metric strong{font-size:1.1rem;color:var(--primary2)}.draft-summary-metric span{color:var(--muted);font-size:.68rem}
.draft-section{border:1px solid var(--border);border-radius:15px;background:var(--surface);overflow:hidden}
.draft-section > header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 14px;border-bottom:1px solid var(--border);background:var(--soft)}
.draft-section > header span{color:var(--muted);font-size:.72rem;font-weight:850;text-transform:uppercase}.draft-section > header h4{margin:2px 0 0;font-size:1rem;font-weight:900}
.draft-main-grid,.draft-row-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:14px}
.draft-field{display:grid;gap:6px;margin:0}.draft-field span,.draft-check span{color:var(--muted);font-size:.76rem;font-weight:850;text-transform:uppercase}
.draft-field-wide{grid-column:1/-1}.draft-field textarea{min-height:100px}
.draft-check{display:flex;align-items:center;gap:9px;margin:0;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--soft)}
.draft-check input{width:18px;height:18px;padding:0}
.draft-section-rows{display:grid;gap:10px;padding:14px}.draft-row{border:1px solid var(--border);border-radius:14px;background:var(--soft);overflow:hidden}
.draft-row-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-bottom:1px solid var(--border)}
.draft-row-head strong{font-size:.9rem}.draft-remove-row{min-height:32px;padding:6px 9px;font-size:.75rem}
.draft-empty-line{padding:18px;border:1px dashed var(--border);border-radius:13px;background:var(--surface);color:var(--muted);text-align:center;font-weight:800}
.adapt-profile-panel{
  height:min(72vh,740px);min-height:560px;
  display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:12px;
  background:var(--soft)
}
.panel-subhead{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px;border:1px solid var(--border);border-radius:14px;background:var(--surface)
}
.panel-subhead h3{margin:0;font-size:1rem;font-weight:900}
.panel-subhead p{margin:3px 0 0;color:var(--muted);font-size:.76rem;font-weight:800}
.panel-subhead i{
  width:38px;height:38px;display:grid;place-items:center;border-radius:12px;
  background:color-mix(in srgb,var(--primary2) 10%,var(--surface));color:var(--primary2);font-size:1.1rem
}
.adapt-profile-controls{
  --adapt-filter-height:50px;
  display:grid;grid-template-columns:minmax(300px,1fr) repeat(5,minmax(118px,150px)) minmax(150px,180px);
  gap:10px;align-items:center
}
.adapt-profile-controls .search-row{
  height:var(--adapt-filter-height);grid-template-columns:minmax(0,1fr) 54px;gap:0;
  margin:0;padding:0;border:1px solid var(--border);
  border-radius:13px;background:var(--surface);overflow:hidden;box-shadow:0 6px 14px rgba(15,23,42,.04)
}
.adapt-profile-controls .search-row input,
.adapt-profile-controls .search-row button{
  height:100%;min-height:0;border:0;border-radius:0;background:transparent;box-shadow:none
}
.adapt-profile-controls .search-row input{
  min-width:0;padding:0 14px;background:color-mix(in srgb,var(--primary2) 5%,var(--surface));font-size:.86rem
}
.adapt-profile-controls .search-row button{
  width:54px;padding:0;border-left:1px solid var(--border);color:var(--primary)
}
.filter-chip-control{
  min-width:0;height:var(--adapt-filter-height);display:grid;grid-template-columns:34px minmax(0,1fr);align-items:center;
  border:1px solid var(--border);border-radius:13px;background:var(--surface);overflow:hidden;
  box-shadow:0 6px 14px rgba(15,23,42,.04)
}
.filter-chip-control i{
  width:34px;height:100%;display:grid;place-items:center;color:var(--primary2);
  background:color-mix(in srgb,var(--primary2) 8%,var(--surface));font-size:.92rem
}
.filter-chip-control select,
.filter-chip-control input{
  min-width:0;width:100%;height:100%;min-height:0;border:0;border-radius:0;background:transparent;
  padding:0 8px;color:var(--text);font-size:.78rem;font-weight:850;outline:none
}
.filter-chip-control select{cursor:pointer}
.filter-chip-control input::placeholder{color:var(--muted)}
.filter-chip-control:focus-within{
  border-color:color-mix(in srgb,var(--primary2) 62%,var(--border));
  box-shadow:0 0 0 3px color-mix(in srgb,var(--primary2) 13%,transparent)
}
.profiles-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-height:360px;overflow:auto;padding-right:3px}.profiles-list.tall{max-height:430px}
.adapt-profile-panel .profiles-list{
  grid-template-columns:repeat(4,minmax(0,1fr));
  max-height:none;min-height:0;align-content:start;
  grid-auto-rows:150px;scrollbar-gutter:stable
}
#profileSearchForm{
  margin-bottom:0;padding:8px;border:1px solid var(--border);border-radius:14px;background:var(--surface);
  box-shadow:0 8px 20px rgba(15,23,42,.045)
}
#profileSearch{
  min-height:42px;border-radius:11px;background:var(--soft);border-color:transparent;
}
#profileSearch:focus{
  border-color:color-mix(in srgb,var(--primary2) 55%,var(--border));background:var(--surface);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--primary2) 14%,transparent)
}
.profile-card{
  position:relative;overflow:hidden;text-align:left;width:100%;height:100%;min-height:0;
  display:grid;gap:5px;align-content:start;
  border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);
  padding:11px 42px 11px 12px;cursor:pointer;box-shadow:0 8px 18px rgba(15,23,42,.045);
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease,background .16s ease
}
.profile-card::before{
  content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--primary2);opacity:.18;transition:opacity .16s ease
}
.profile-card:hover,.profile-card:focus-visible{
  border-color:color-mix(in srgb,var(--primary2) 52%,var(--border));
  box-shadow:0 12px 24px rgba(15,23,42,.08);transform:translateY(-1px);outline:none
}
.profile-card:hover::before,.profile-card:focus-visible::before{opacity:.75}
.profile-card.is-selected{
  border-color:color-mix(in srgb,var(--primary) 70%,var(--border));
  background:color-mix(in srgb,var(--primary) 6%,var(--surface));
  box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 18%,transparent),0 12px 24px rgba(15,23,42,.08)
}
.profile-card.is-selected::before{opacity:1}
.profile-card h4{
  position:relative;z-index:1;margin:0;font-size:.9rem;line-height:1.25;font-weight:900;letter-spacing:0;color:var(--text);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
.profile-card p{
  position:relative;z-index:1;margin:0;color:var(--muted);font-size:.76rem;line-height:1.42;
  overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical
}
.profile-card p:first-of-type{
  width:max-content;max-width:100%;padding:3px 7px;border-radius:999px;
  background:color-mix(in srgb,var(--primary2) 8%,var(--surface));color:color-mix(in srgb,var(--primary2) 80%,var(--text));
  border:1px solid color-mix(in srgb,var(--primary2) 16%,var(--border));font-size:.69rem;font-weight:850
}
.profile-card p:nth-of-type(2){font-weight:750;color:color-mix(in srgb,var(--text) 78%,var(--muted))}
.profile-card p:nth-of-type(3){-webkit-line-clamp:2}
.profile-card input{
  position:absolute;top:12px;right:12px;z-index:3;width:16px;height:16px;padding:0;accent-color:var(--primary)
}
.profile-card-actions{
  position:absolute;z-index:2;right:9px;top:9px;display:flex;margin:0;padding:0;border:0
}
.profile-card[data-mode="multi"] .profile-card-actions{right:34px;top:8px}
.profile-view-btn{
  width:28px;min-width:28px;height:28px;min-height:28px;padding:0;border-radius:8px;
  background:color-mix(in srgb,var(--primary2) 7%,var(--surface));color:color-mix(in srgb,var(--primary2) 84%,var(--text));
  border-color:color-mix(in srgb,var(--primary2) 20%,var(--border));font-size:.82rem
}
.profile-view-btn span{display:none}
.profile-view-btn:hover{background:var(--primary2);border-color:var(--primary2);color:#fff}
.profile-card.offer-profile-card h4{display:-webkit-box;white-space:normal}
.profile-card.offer-profile-card p{display:block;overflow:visible;-webkit-line-clamp:unset;-webkit-box-orient:initial}
.profile-card.offer-profile-card p:first-of-type{width:auto;max-width:none;padding:0;border:0;border-radius:0;background:transparent}
.profile-card.offer-profile-card .offer-profile-identity p{
  color:var(--text);font-size:.8rem;font-weight:850;line-height:1.35;
  display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2
}
.profile-card.offer-profile-card .offer-profile-block p{
  margin:0;color:var(--muted);font-size:.8rem;line-height:1.42;
  display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3
}
.profile-card.offer-profile-card .offer-profile-match p{color:var(--text)}
.profile-card.offer-profile-card .offer-profile-risk p{color:var(--danger);font-weight:820;-webkit-line-clamp:2}
.profile-card.offer-profile-card input{position:static;width:18px;height:18px;margin:0}
.profile-card.offer-profile-card{
  min-height:0;
  height:auto;
  padding:13px;
}
.offer-profile-grid.profiles-list{
  grid-template-columns:repeat(3,minmax(300px,1fr));
  max-height:720px;
  gap:12px;
}
.profile-card.offer-profile-card .offer-profile-title h4{
  display:block;
  white-space:normal;
  overflow:visible;
  -webkit-line-clamp:unset;
  -webkit-box-orient:initial;
}
.profile-card.offer-profile-card .offer-profile-row p,
.profile-card.offer-profile-card .offer-profile-risk p{
  display:block;
  overflow:visible;
  -webkit-line-clamp:unset;
  -webkit-box-orient:initial;
}
.profile-card.offer-profile-card .offer-profile-actions .profile-view-btn{
  position:static;
  right:auto;
  top:auto;
}
.profile-card.offer-profile-card{
  border-color:var(--border)!important;
  background:var(--surface)!important;
  box-shadow:0 8px 18px rgba(15,23,42,.035)!important;
}
.profile-card.offer-profile-card::before{display:none}
.profile-card.offer-profile-card:hover,
.profile-card.offer-profile-card:focus-visible{
  border-color:color-mix(in srgb,var(--primary2) 34%,var(--border))!important;
  box-shadow:0 12px 24px rgba(15,23,42,.055)!important;
}
.profile-card.offer-profile-card.is-selected{
  border-color:color-mix(in srgb,var(--primary) 46%,var(--border))!important;
  background:var(--surface-2)!important;
}
.offer-profile-grid.profiles-list{
  grid-template-columns:repeat(auto-fit,minmax(420px,1fr));
  align-items:start;
  max-height:none;
  overflow:visible;
  padding:0;
}
.offer-profile-card-body{
  gap:0;
  border-top:1px solid var(--border);
}
.offer-profile-row{
  padding:8px 0;
  border-bottom:1px solid color-mix(in srgb,var(--border) 70%,transparent);
}
.offer-profile-row:last-child{border-bottom:0}
.offer-profile-role{
  border-color:var(--border);
  background:color-mix(in srgb,var(--soft) 58%,var(--surface));
}
.offer-profile-risk{
  border-color:color-mix(in srgb,var(--danger) 14%,var(--border));
  background:color-mix(in srgb,var(--danger) 4%,var(--surface));
}
.offer-profile-badges{min-height:0}
.profile-badge{
  min-height:22px;
  padding:3px 7px;
  border-color:var(--border);
  background:var(--soft);
  color:var(--muted);
}
.mini-view-btn{width:34px;height:34px;display:grid;place-items:center;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--primary2);cursor:pointer}
.mini-view-btn:hover{border-color:var(--primary2)}
.profile-modal[aria-hidden="true"]{display:none}
.profile-modal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:22px}
.profile-modal-backdrop{position:absolute;inset:0;background:rgba(2,6,23,.62);backdrop-filter:blur(8px)}
.profile-modal-dialog{
  position:relative;z-index:1;display:flex;flex-direction:column;width:min(1500px,96vw);max-height:min(92vh,980px);
  border:1px solid color-mix(in srgb,var(--border) 80%,transparent);border-radius:20px;background:var(--surface);color:var(--text);
  box-shadow:0 30px 90px rgba(2,6,23,.32);overflow:hidden
}
.hub-modal-dialog{width:min(1380px,96vw)}
.profile-modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:18px 22px;border-bottom:1px solid var(--border);background:var(--soft)}
.profile-modal-header h2{margin:4px 0 0;font-size:1.15rem;font-weight:850;line-height:1.25}
.profile-modal-kicker{display:inline-flex;color:var(--primary2);font-size:.72rem;font-weight:850;letter-spacing:.04em;text-transform:uppercase}
.profile-modal-close{width:40px;height:40px;display:grid;place-items:center;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);cursor:pointer}
.profile-modal-body{padding:18px 22px 24px;overflow:auto}
.profile-full-layout{display:grid;grid-template-columns:282px minmax(0,1fr);gap:14px;align-items:start}
.profile-full-sidebar{
  position:sticky;top:0;display:grid;gap:12px;padding:15px;border:1px solid var(--border);
  border-radius:15px;background:var(--soft);box-shadow:0 8px 18px rgba(15,23,42,.045)
}
.profile-full-sidebar h3{margin:0;font-size:1.08rem;line-height:1.25;font-weight:900;word-break:break-word}
.profile-full-contact{display:grid;gap:7px}
.profile-full-contact span{display:grid;grid-template-columns:18px minmax(0,1fr);gap:8px;align-items:start;color:var(--text);font-size:.82rem;line-height:1.35;word-break:break-word}
.profile-full-contact i{color:var(--primary2)}
.profile-full-tags{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}
.profile-full-tags span{padding:6px 9px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text);font-size:.74rem;font-weight:800}
.profile-full-doc{display:grid;gap:8px;align-items:stretch}
.profile-full-doc > .primary-btn,.profile-full-doc > .soft-btn{width:100%;justify-content:center}
.profile-full-actions{display:grid;grid-template-columns:1fr;gap:8px}
.profile-full-content{min-width:0}
.profile-detail-grid{columns:2 300px;column-gap:12px}
.profile-detail-wide{break-inside:avoid}
.profile-detail-card{
  display:inline-block;width:100%;min-width:0;margin:0 0 12px;break-inside:avoid;
  border:1px solid var(--border);border-radius:13px;background:var(--surface);
  box-shadow:0 8px 18px rgba(15,23,42,.045);overflow:hidden
}
.profile-detail-card header{padding:9px 12px;border-bottom:1px solid var(--border);background:var(--soft);font-weight:850;font-size:.84rem}
.profile-kv-grid{display:grid;grid-template-columns:minmax(110px,150px) minmax(0,1fr);gap:6px 9px;padding:11px}
.profile-kv-key{color:var(--muted);font-size:.72rem;font-weight:850;letter-spacing:.04em;text-transform:uppercase}
.profile-kv-value{min-width:0;color:var(--text);line-height:1.6;word-break:break-word}
.profile-kv-value a,.profile-detail-link a{display:inline-flex;align-items:center;gap:7px;color:var(--primary2);font-weight:800;text-decoration:none}
.profile-text-block{padding:11px;line-height:1.55;word-break:break-word;font-size:.84rem}
.profile-detail-list{list-style:none;margin:0;padding:10px;display:grid;gap:8px}
.profile-detail-item{padding:9px;border:1px solid var(--border);border-radius:10px;background:var(--soft)}
.profile-detail-item strong,.profile-detail-item span,.profile-detail-item em{display:block}
.profile-detail-item strong{font-weight:850;line-height:1.4}
.profile-detail-item span{margin-top:3px;color:var(--text);line-height:1.45}
.profile-detail-item em{margin-top:5px;color:var(--muted);font-style:normal;font-size:.84rem;line-height:1.45}
.profile-detail-item p{margin:6px 0 0;color:var(--text);line-height:1.5;word-break:break-word}
.profile-muted{color:var(--muted)}
.profile-modal-loading,.profile-modal-error{display:flex;align-items:center;gap:10px;min-height:220px;justify-content:center;color:var(--muted);font-weight:800}
.profile-modal-error{color:var(--danger)}
body.profile-modal-open{overflow:hidden}
.ai-hub-stop-btn{background:var(--danger)!important;border-color:var(--danger)!important;color:#fff!important}
.ai-hub-stop-btn i{color:#fff!important}
.editor-modal-dialog{width:min(1320px,96vw)}
.editor-modal-dialog-wide{width:min(1640px,97vw)}
.editor-profile-head{
  display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:14px;
  padding:14px;border:1px solid var(--border);border-radius:15px;background:var(--soft)
}
.editor-profile-head span,.editor-form-toolbar span{display:block;color:var(--primary2);font-size:.7rem;font-weight:850;text-transform:uppercase}
.editor-profile-head strong,.editor-form-toolbar strong{display:block;margin-top:3px;font-size:1rem;line-height:1.3}
.editor-profile-head p{margin:4px 0 0;color:var(--muted);font-size:.8rem}
.line-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.line-edit-section{border:1px solid var(--border);border-radius:15px;background:var(--surface);overflow:hidden}
.line-edit-section header{
  display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 12px;border-bottom:1px solid var(--border);background:var(--soft)
}
.line-edit-section header h3{margin:2px 0 0;font-size:.95rem;font-weight:900}
.line-edit-section header span{color:var(--muted);font-size:.7rem;font-weight:850;text-transform:uppercase}
.line-edit-rows{display:grid;gap:8px;padding:11px;max-height:330px;overflow:auto}
.line-edit-row{
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;
  padding:10px;border:1px solid var(--border);border-radius:12px;background:var(--soft)
}
.line-edit-row strong{display:block;font-size:.86rem;line-height:1.3}
.line-edit-row p{margin:4px 0 0;color:var(--muted);font-size:.76rem;line-height:1.4}
.line-edit-form,.full-edit-form{display:grid;gap:12px}
.editor-form-toolbar{
  position:sticky;top:-18px;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:11px 12px;border:1px solid var(--border);border-radius:14px;background:color-mix(in srgb,var(--surface) 94%,transparent);
  backdrop-filter:blur(12px);box-shadow:0 10px 22px rgba(15,23,42,.07)
}
.editor-field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.full-edit-section .draft-section-rows{max-height:none}
.profile-detail-card header{padding:10px 12px;font-size:.86rem}
.profile-kv-grid{grid-template-columns:minmax(120px,165px) minmax(0,1fr);gap:7px 10px;padding:12px}
.profile-kv-value,.profile-text-block,.profile-detail-item p{line-height:1.55;font-size:.84rem}
.profile-detail-list{padding:12px;gap:8px}
.profile-detail-item{padding:10px}
.draft-review{max-height:none}
.draft-summary-card{padding:13px}
.draft-summary-card h3{font-size:1.05rem}
.draft-main-grid,.draft-row-grid{gap:10px;padding:12px}
.draft-section > header{padding:11px 12px}
.draft-section > header h4{font-size:.92rem}
.draft-field span,.draft-check span{font-size:.7rem}
.draft-field textarea{min-height:82px}
.draft-section-rows{padding:12px}
.mt{margin-top:14px}.busy{opacity:.75;pointer-events:none}.adapt-is-loading{position:relative}.adapt-is-loading .work-panel,.adapt-is-loading .profiles-list{filter:saturate(.72);opacity:.68}.error{color:var(--danger)}
#agent-offer.busy{opacity:1;pointer-events:auto}
#agent-offer.busy .offer-adapt-workspace,
#agent-offer.busy .offer-adapt-current,
#agent-offer.busy .adapt-document-frame-wrap{pointer-events:auto}
@media (max-width: 991.98px){
  body{--hub-topbar-height:116px}
  .topbar{grid-template-columns:1fr auto}.back-link{grid-column:1/-1;justify-self:start}.dashboard-head,.module-head{display:block}.dashboard-head .primary-btn{margin-top:12px}.module-head-actions{justify-content:flex-start;margin-top:12px}
  .hub-app{grid-template-columns:1fr}
  .hub-sidebar{position:relative;top:auto;height:auto;max-height:none}
  .agent-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hub-chat-sessions{max-height:360px}
  .stats-grid,.ops-grid,.dashboard-module-grid,.dashboard-insight-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ops-panel:first-child{grid-column:1/-1}.chat-layout,.two-col,.pipeline,.offer-workflow{grid-template-columns:1fr}
  .modal-launch-row{grid-template-columns:1fr;margin-top:0}.modal-launch-btn{flex:1}
  .advanced-ai-chat-scope .ai-hub-session-panel{
    position:relative!important;
    top:auto;
    height:auto!important;
    max-height:320px!important;
  }
  .advanced-ai-chat-scope .ai-hub-session-list{
    max-height:230px;
  }
  .advanced-ai-chat-scope .ai-hub-chat-log{
    min-height:420px!important;
  }
  .advanced-ai-chat-scope .ai-hub-profile-cards{
    grid-template-columns:1fr!important;
  }
  .profiles-list{grid-template-columns:1fr}
  .offer-history-list{grid-template-columns:repeat(2,minmax(0,1fr))}
  .offer-profile-grid.profiles-list,.offer-required-grid{grid-template-columns:1fr}
  .offer-search-row,.offer-search-footer,.offer-adapt-setup{grid-template-columns:1fr}
  .offer-search-submit,.offer-adapt-submit{width:max-content;min-width:220px}
  .offer-selection-head,.offer-adapt-card > header,.offer-adapt-current > header{align-items:stretch;flex-direction:column}
  .offer-adapt-actions{justify-content:flex-start}
  .profile-detail-grid{columns:1}
  .profile-full-layout,.line-edit-grid{grid-template-columns:1fr}
  .profile-full-sidebar{position:relative;top:auto}
  .duplicate-update-grid{grid-template-columns:1fr}
  .draft-main-grid,.draft-row-grid,.editor-field-grid{grid-template-columns:1fr}
  .draft-summary-card{grid-template-columns:1fr}
  .adapt-profile-panel{height:auto;min-height:0}
  .adapt-profile-controls{grid-template-columns:1fr}
  .adapt-profile-panel .profiles-list{grid-template-columns:repeat(2,minmax(0,1fr));max-height:520px;grid-auto-rows:160px}
}
@media (max-width: 575.98px){
  body{--hub-topbar-height:110px}
  .shell{width:min(100% - 18px,1560px);padding-top:calc(var(--hub-topbar-height) + 14px)}.stats-grid,.agent-tabs,.ops-grid,.modal-launch-row,.dashboard-module-grid,.dashboard-insight-grid,.dashboard-metric-grid{grid-template-columns:1fr}.ops-panel:first-child{grid-column:auto}.brand small{display:none}.composer,.search-row{grid-template-columns:1fr}.chat-log{min-height:340px}
  .agent-view{padding:12px;min-height:auto}
  .progress-steps{grid-template-columns:1fr}
  .result-toolbar{align-items:stretch;flex-direction:column}
  .result-actions{justify-content:stretch}.result-actions .soft-btn{flex:1}
  .adapt-result-head{align-items:stretch;flex-direction:column}
  .adapt-result-actions{align-items:stretch;flex-direction:column}.adapt-print-btn{width:100%}
  .adapt-document-frame,.offer-adapt-frame{height:72vh;min-height:520px}
  .offer-selection-actions,.offer-adapt-actions{align-items:stretch;flex-direction:column}.offer-selection-actions .soft-btn,.offer-adapt-actions .soft-btn,.offer-adapt-actions .primary-btn{width:100%}
  .offer-search-submit,.offer-adapt-submit,.offer-form-actions .primary-btn,.offer-form-actions .soft-btn{width:100%;min-width:0}
  .offer-history-list,.offer-history-metrics{grid-template-columns:1fr}
  .offer-ocr-required{grid-template-columns:1fr;text-align:left}
  .docs-filter-row,.adapt-docs-list{grid-template-columns:1fr}
  .adapt-profile-panel .profiles-list{grid-template-columns:1fr}
  .profile-modal{padding:10px}
  .profile-modal-dialog{width:100%;max-height:94vh;border-radius:16px}
  .profile-modal-header,.profile-modal-body{padding:14px}
  .editor-profile-head,.editor-form-toolbar{align-items:stretch;flex-direction:column}
  .profile-kv-grid{grid-template-columns:1fr;gap:4px;padding:13px}
  .profile-kv-value{padding-bottom:6px}
}

/* ===== 2026 advanced hub redesign layer ===== */
:root{
  color-scheme:light;
  --bg:#f7f8f5;
  --surface:#ffffff;
  --soft:#f1f5f2;
  --text:#17201e;
  --muted:#65736f;
  --border:#d8e0dc;
  --primary:#0f766e;
  --primary2:#2563eb;
  --accent:#b7791f;
  --danger:#c2413b;
  --shadow:0 12px 28px rgba(20,30,27,.08);
  --shadow-strong:0 24px 70px rgba(20,30,27,.16);
}
[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0d1110;
  --surface:#151a18;
  --soft:#1b221f;
  --text:#edf4f1;
  --muted:#9baba5;
  --border:#2c3834;
  --primary:#35c6af;
  --primary2:#8bb7ff;
  --accent:#f0b14a;
  --danger:#fb7b72;
  --shadow:0 12px 30px rgba(0,0,0,.30);
  --shadow-strong:0 28px 80px rgba(0,0,0,.48);
}
body{
  background:var(--surface-2);
  color:var(--text);
  font-size:.9rem;
}
[data-theme="dark"] body{
  background:var(--surface-2);
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:none;
  background-size:64px 64px;
  mask-image:none;
}
[data-theme="dark"] body::before{
  background:none;
}
.topbar{
  min-height:70px;
  border-bottom-color:var(--border);
  background:color-mix(in srgb,var(--surface) 88%,transparent);
  box-shadow:0 12px 26px rgba(20,30,27,.06);
}
.brand-mark{
  border-radius:8px;
  background:var(--primary);
  box-shadow:0 10px 22px rgba(15,118,110,.18);
}
.brand strong{
  font-weight:880;
}
.brand small{
  color:var(--muted);
}
.back-link,
.icon-btn,
.soft-btn,
.primary-btn,
.hub-sidebar-toggle,
.profile-modal-close,
.mini-view-btn{
  border-radius:8px;
  border-color:var(--border);
  background:var(--surface);
  color:var(--text);
  box-shadow:0 1px 2px rgba(20,30,27,.05);
  transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.back-link:hover,
.icon-btn:hover,
.soft-btn:hover,
.primary-btn:hover,
.hub-sidebar-toggle:hover,
.profile-modal-close:hover,
.mini-view-btn:hover{
  background:var(--soft);
  border-color:color-mix(in srgb,var(--primary) 38%,var(--border));
  color:var(--text);
  transform:translateY(-1px);
}
.primary-btn{
  border-color:transparent;
  background:var(--primary);
  color:#fff;
  box-shadow:0 12px 24px rgba(15,118,110,.18);
}
.primary-btn i{
  color:#fff;
}
.primary-btn:hover{
  color:#fff;
  box-shadow:0 16px 30px rgba(15,118,110,.24);
}
.primary-btn:disabled{
  opacity:.55;
  transform:none;
  box-shadow:none;
}
.shell{
  width:min(100% - 28px,1840px);
  padding-top:calc(var(--hub-topbar-height) + 18px);
}
.hub-app{
  grid-template-columns:296px minmax(0,1fr);
  gap:16px;
}
.hub-app.is-sidebar-collapsed{
  grid-template-columns:72px minmax(0,1fr);
}
.hub-sidebar,
.agent-view,
.work-panel,
.result-panel,
.tool-panel,
.ops-panel,
.stat-card,
.dashboard-detail-section,
.dashboard-module-card,
.profile-modal-dialog{
  border-radius:8px;
  border-color:var(--border);
  background:color-mix(in srgb,var(--surface) 96%,transparent);
  box-shadow:var(--shadow);
}
.hub-sidebar{
  padding:10px;
}
.hub-sidebar-toggle{
  background:var(--soft);
}
.agent-tabs{
  gap:6px;
}
.agent-tabs button{
  min-height:62px;
  border-radius:8px;
  border-color:transparent;
  padding:10px;
}
.agent-tabs button i{
  border-radius:8px;
}
.agent-tabs button:hover,
.agent-tabs button.is-active{
  border-color:var(--border);
  background:var(--soft);
}
.agent-tabs button.is-active{
  box-shadow:inset 3px 0 0 var(--tab-color,var(--primary2));
}
.modal-launch-btn,
.history-top-btn,
.reset-adapt-btn{
  border-radius:8px;
  background:var(--surface);
  border-color:var(--border);
  box-shadow:none;
}
.history-top-btn i,
.reset-adapt-btn i{
  border-radius:7px;
  background:var(--primary2);
}
.agent-view{
  padding:16px;
  min-height:calc(100vh - 104px);
}
.module-head{
  padding:0 2px 2px;
}
.module-head h2{
  font-size:1.2rem;
  font-weight:880;
}
.module-head p,
.dashboard-head p{
  color:var(--muted);
}
.work-panel,
.result-panel,
.tool-panel{
  background:var(--soft);
  padding:14px;
}
.panel-subhead,
.result-toolbar,
.adapt-result-head,
.offer-analysis-summary,
.offer-adapt-card,
.offer-adapt-current,
.draft-section,
.draft-summary-card,
.duplicate-update-panel,
.template-chip,
.offer-required-card,
.offer-history-card,
.upload-history-item,
.adapt-doc-row,
.profile-detail-card,
.line-edit-section{
  border-radius:8px;
  border-color:var(--border);
  background:var(--surface);
  box-shadow:0 1px 2px rgba(20,30,27,.04);
}
.panel-subhead i,
.stat-card i,
.mini-row i,
.dashboard-module-card > header > i,
.offer-step-title > span,
.offer-ocr-icon,
.profile-full-contact i,
.profile-detail-item,
.profile-view-btn{
  border-radius:8px;
}
.stats-grid{
  gap:12px;
}
.stat-card{
  min-height:110px;
  background:var(--surface-2);
}
.stat-card::after{
  display:none;
}
.stat-card strong{
  color:var(--text);
}
.ops-grid,
.dashboard-module-grid,
.dashboard-insight-grid,
.two-col,
.offer-workflow{
  gap:12px;
}
input,
textarea,
select,
.ai-hub-input,
.ai-hub-textarea{
  border-radius:8px;
  border-color:var(--border);
  background:var(--surface);
  color:var(--text);
}
input:focus,
textarea:focus,
select:focus,
.ai-hub-input:focus,
.ai-hub-textarea:focus{
  border-color:color-mix(in srgb,var(--primary2) 58%,var(--border));
  box-shadow:0 0 0 4px rgba(37,99,235,.18);
}
.dropzone,
.dropzone.compact,
.offer-file-drop,
.offer-template-drop,
.offer-check,
.filter-chip-control,
.adapt-profile-controls .search-row,
.chat-log,
.msg,
.ai-hub-chat-log,
.ai-hub-result-box,
.ai-hub-msg,
.ai-hub-composer,
.ai-hub-upload,
.profile-card,
.offer-profile-card,
.draft-field input,
.draft-field textarea,
.draft-check{
  border-radius:8px!important;
}
.dropzone{
  border-color:color-mix(in srgb,var(--primary2) 24%,var(--border));
  background:var(--surface);
}
.dropzone:hover,
.offer-file-drop.has-file,
.offer-template-drop.has-file{
  border-color:color-mix(in srgb,var(--primary) 55%,var(--border));
  background:color-mix(in srgb,var(--primary) 6%,var(--surface));
  box-shadow:0 0 0 4px rgba(15,118,110,.10);
}
.progress-steps{
  gap:8px;
}
.step{
  border-radius:8px;
  background:var(--surface);
}
.step::after{
  display:none;
}
.profile-card{
  box-shadow:0 8px 18px rgba(20,30,27,.06);
}
.profile-card:hover,
.profile-card:focus-visible,
.offer-history-card:hover,
.offer-history-card:focus-visible,
.upload-history-card:hover,
.upload-history-card:focus-visible,
.adapt-doc-history-card:hover,
.adapt-doc-history-card:focus-visible{
  border-color:color-mix(in srgb,var(--primary2) 38%,var(--border));
  background:color-mix(in srgb,var(--primary2) 5%,var(--surface));
  box-shadow:0 14px 28px rgba(20,30,27,.09);
}
.profile-card.is-selected{
  border-color:color-mix(in srgb,var(--primary) 55%,var(--border));
  background:color-mix(in srgb,var(--primary) 7%,var(--surface));
  box-shadow:inset 3px 0 0 var(--primary),0 12px 24px rgba(20,30,27,.08);
}
.profile-badge,
.chip,
.eyebrow,
.profile-full-tags span,
.offer-required-tags em,
.dashboard-metric,
.offer-history-metrics span{
  border-radius:999px;
  border-color:var(--border);
  background:var(--soft);
}
.offer-profile-grid.profiles-list{
  grid-template-columns:repeat(auto-fit,minmax(380px,1fr));
}
.offer-step-panel{
  border-radius:8px;
  background:var(--soft);
}
.offer-step-title > span{
  background:var(--primary);
}
.offer-analysis-empty,
.offer-empty-result,
.adapt-empty-result,
.upload-result-empty,
.adapt-doc-empty,
.draft-empty-line,
.upload-history-empty{
  border-radius:8px;
  border-color:var(--border);
  background:var(--surface);
}
.profile-modal-backdrop{
  background:rgba(9,13,12,.58);
  backdrop-filter:blur(10px);
}
.profile-modal-dialog{
  box-shadow:var(--shadow-strong);
}
.profile-modal-header{
  background:var(--soft);
  border-bottom-color:var(--border);
}
.profile-modal-kicker,
.offer-required-kicker,
.adapt-result-head span,
.offer-adapt-current header span,
.offer-adapt-card header span,
.editor-profile-head span,
.editor-form-toolbar span{
  color:var(--primary2);
}
.advanced-ai-chat-scope .ai-hub-root{
  --ai-hub-card-bg:var(--surface);
  --ai-hub-card-bg-hover:var(--soft);
  --ai-hub-card-text:var(--text);
  --ai-hub-card-muted:var(--muted);
  --ai-hub-card-border:var(--border);
  --ai-hub-card-border-hover:color-mix(in srgb,var(--primary) 38%,var(--border));
  --ai-hub-log-bg:var(--soft);
  --ai-hub-log-border:var(--border);
  --ai-hub-model-bg:var(--surface);
  --ai-hub-model-text:var(--text);
  --ai-hub-model-border:var(--border);
  --ai-hub-user-bg:var(--primary2);
}
.advanced-ai-chat-scope .ai-hub-btn{
  background:var(--primary)!important;
  border-color:transparent!important;
  color:#fff!important;
}
.advanced-ai-chat-scope .ai-hub-btn i{
  color:#fff;
}
.advanced-ai-chat-scope .ai-hub-chat-log{
  background:var(--soft);
  border-color:var(--border);
}
.advanced-ai-chat-scope .ai-hub-profile-card,
.advanced-ai-chat-scope .ai-hub-summary-table-wrap,
.advanced-ai-chat-scope .ai-hub-profile-summary,
.advanced-ai-chat-scope .ai-hub-profile-info{
  border-radius:8px;
  border-color:var(--border);
}
.editor-form-toolbar,
.draft-filter-tabs{
  border-radius:8px;
  background:color-mix(in srgb,var(--surface) 92%,transparent);
}
.adapt-document-frame-wrap{
  border-radius:8px;
  border-color:var(--border);
}
:is(button,a,input,select,textarea):focus-visible{
  outline:3px solid rgba(37,99,235,.22);
  outline-offset:2px;
  box-shadow:none!important;
}
[data-theme="dark"] :is(button,a,input,select,textarea):focus-visible{
  outline-color:rgba(139,183,255,.26);
}
@media (max-width:991.98px){
  .shell{
    width:min(100% - 20px,1840px);
  }
  .hub-app,
  .hub-app.is-sidebar-collapsed{
    grid-template-columns:1fr;
  }
  .agent-view{
    min-height:auto;
  }
  .offer-profile-grid.profiles-list{
    grid-template-columns:1fr;
  }
}
@media (max-width:575.98px){
  .shell{
    width:min(100% - 16px,1840px);
  }
  .topbar{
    padding-inline:12px;
  }
  .agent-view,
  .work-panel,
  .result-panel{
    padding:12px;
  }
  .module-head-actions,
  .offer-selection-actions,
  .result-actions{
    display:grid;
    grid-template-columns:1fr;
  }
  .module-head-actions .soft-btn,
  .module-head-actions .primary-btn,
  .result-actions .soft-btn{
    width:100%;
  }
  .advanced-ai-chat-scope .ai-hub-chat-toolbar{
    display:grid!important;
    grid-template-columns:1fr;
    justify-items:stretch!important;
  }
  .advanced-ai-chat-scope .ai-hub-chat-toolbar .ai-hub-btn,
  .advanced-ai-chat-scope .ai-hub-chat-toolbar .ai-hub-btn-secondary,
  .advanced-ai-chat-scope .ai-hub-chat-toolbar .btn{
    width:100%;
  }
  .topbar{
    grid-template-columns:minmax(0,1fr) auto;
  }
  .brand{
    min-width:0;
  }
  .brand strong{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
}
