/* patch.css: targeted overrides for the no-build deliverable */

/* ----------------------------
 * Date picker navigation arrow fix
 * app.css uses rem-based border-width which renders incorrectly;
 * override with px values matching antd.min.css original.
 * ---------------------------- */
.ant-picker-prev-icon,
.ant-picker-next-icon,
.ant-picker-super-prev-icon,
.ant-picker-super-next-icon {
  position: relative;
  display: inline-block;
  width: 7px !important;
  height: 7px !important;
}
.ant-picker-prev-icon::before,
.ant-picker-next-icon::before,
.ant-picker-super-prev-icon::before,
.ant-picker-super-next-icon::before {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-block;
  width: 7px !important;
  height: 7px !important;
  border: 0 solid currentcolor;
  border-width: 1.5px 0 0 1.5px !important;
  content: '';
}
.ant-picker-super-prev-icon::after,
.ant-picker-super-next-icon::after {
  position: absolute;
  top: 4px;
  left: 4px;
  display: inline-block;
  width: 7px !important;
  height: 7px !important;
  border: 0 solid currentcolor;
  border-width: 1.5px 0 0 1.5px !important;
  content: '';
}

/* ----------------------------
 * Global spill fixes (critical)
 * ---------------------------- */
/* app.css 的全局 margin-left 会把搜索表单输入框往右推，限定只在登录页生效 */
.ant-advanced-search-form .ant-form-item-control-input {
  width: 100% !important;
  margin-left: 0 !important;
}
/*
  De-scoped CSS introduced a global rule: .ant-layout-header li{width:...} which breaks dropdowns and
  unrelated header areas. Constrain the width rule to the top horizontal menu only.
*/
.ant-layout-header li{width:auto !important;text-align:initial !important;}
#top .ant-menu-horizontal > .ant-menu-item,
#top .ant-menu-horizontal > .ant-menu-submenu{width:11.25rem !important;text-align:center !important;}

/* ----------------
 * Prototype tokens
 * ----------------
 * Reference: 三期AI社区HTML原型导航页/pc/css/common.css
 */
/* Google Fonts removed - use system fonts fallback */

:root{
  --ui-primary:#8B0012;
  --ui-primary-dark:#6B000E;
  --ui-primary-gradient:linear-gradient(135deg,#8B0012 0%,#6B000E 100%);
  --ui-bg:#f7f8fa;
  --ui-text:#1f2329;
  --ui-border:#e2e6ed;
  --ui-muted:#5b6070;
  --ui-surface:#ffffff;
  --ui-radius:12px;
  --ui-shadow:0 10px 30px rgba(15,23,42,.08);
}

html,body,#app{
  font-family:'Inter','PingFang SC','Microsoft YaHei',sans-serif !important;
  color:var(--ui-text);
}
body{background:var(--ui-bg);}

/* --------------------------
 * Layout alignment (manager)
 * -------------------------- */
.manager-layout{
  background:var(--ui-bg) !important;
  padding:0 !important;
  overflow:auto !important;
}
.manager-layout .proto-content{
  /* prototype-like content container: cards inside, not a single big "white page" */
  width:100% !important;
  max-width:1320px;
  margin:0 auto !important;
  padding:24px 32px 48px;
  box-sizing:border-box;
  overflow-x:hidden;
}
@media (max-width: 768px){
  .manager-layout{padding:0 !important;}
  .manager-layout .proto-content{padding:14px 14px 28px;}
}

/* Some legacy views wrap their own .manager-content inside RouterView; neutralize those fixed-width rules. */
.proto-content .manager-content{
  width:auto !important;
  max-width:none !important;
  margin:0 !important;
  height:auto !important;
  background:transparent !important;
}

/* Sidebar: align to prototype (gradient + white menu text) */
.menu-layout{
  width:260px !important;
  max-width:260px !important;
  min-width:260px !important;
  flex:0 0 260px !important;
  position:sticky !important;
  top:0;
  height:100vh !important;
  max-height:100vh !important;
  align-self:flex-start;
  background:var(--ui-primary-gradient) !important;
  overflow:hidden !important;
  border-right:1px solid rgba(255,255,255,.12);
}
.menu-layout .ant-layout-sider-children{
  background:transparent !important;
  height:100% !important;
  display:flex;
  flex-direction:column;
  overflow:hidden !important;
}
.menu-layout .ant-menu{
  background:transparent !important;
  color:rgba(255,255,255,.88) !important;
  border-right:0 !important;
  flex:1 1 auto;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.42) rgba(255,255,255,.08);
}
.menu-layout .ant-menu::-webkit-scrollbar{
  width:8px;
}
.menu-layout .ant-menu::-webkit-scrollbar-track{
  background:rgba(255,255,255,.08);
  border-radius:999px;
}
.menu-layout .ant-menu::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.36);
  border-radius:999px;
  border:2px solid rgba(255,255,255,0);
  background-clip:padding-box;
}
.menu-layout .ant-menu::-webkit-scrollbar-thumb:hover{
  background:rgba(255,255,255,.56);
}
.menu-layout .ant-menu-item a,
.menu-layout .ant-menu-submenu-title,
.menu-layout .ant-menu-submenu-title a{
  color:rgba(255,255,255,.88) !important;
}
.menu-layout .ant-menu-item,
.menu-layout .ant-menu-submenu-title{
  border-radius:10px;
  margin:4px 12px !important;
  width:calc(100% - 24px) !important;
}
.menu-layout .ant-menu-item:hover,
.menu-layout .ant-menu-submenu-title:hover{
  background:rgba(255,255,255,.12) !important;
}
.menu-layout .ant-menu-item-selected{
  background:rgba(255,255,255,.18) !important;
}
.menu-layout .ant-menu-inline .ant-menu-item::after{border-right:0 !important;}

/* Sidebar menu groups: expandable parent menus */
.menu-layout .ant-menu-inline > .ant-menu-submenu{
  margin-top:8px;
  padding-top:0;
  border-top:0;
}
.menu-layout .ant-menu-inline > .ant-menu-submenu:first-child{
  margin-top:0;
  padding-top:0;
  border-top:0;
}
.menu-layout .ant-menu-submenu > .ant-menu-submenu-title,
.menu-layout .ant-menu-submenu-open > .ant-menu-submenu-title,
.menu-layout .ant-menu-submenu-active > .ant-menu-submenu-title,
.menu-layout .ant-menu-submenu-selected > .ant-menu-submenu-title{
  background:transparent !important;
}
.menu-layout .ant-menu-inline > .ant-menu-submenu > .ant-menu-submenu-title{
  margin:0 !important;
  width:100% !important;
  border-radius:0 !important;
  padding:0 24px !important;
  height:44px !important;
  line-height:44px !important;
}
.menu-layout .ant-menu-inline > .ant-menu-submenu > .ant-menu-submenu-title .ant-menu-title-content{
  font-size:15px;
  font-weight:600;
  letter-spacing:.02em;
  color:rgba(255,255,255,.9) !important;
}
.menu-layout .ant-menu-inline > .ant-menu-submenu > .ant-menu-submenu-title .ant-menu-submenu-arrow{
  display:none !important;
}
.menu-layout .ant-menu-inline > .ant-menu-submenu > .ant-menu-submenu-title::after{
  content:'›';
  position:absolute;
  right:16px;
  top:50%;
  transform:translateY(-50%) rotate(0deg);
  color:rgba(255,255,255,.7);
  font-size:20px;
  line-height:1;
  transition:transform .3s;
}
.menu-layout .ant-menu-inline > .ant-menu-submenu-open > .ant-menu-submenu-title::after{
  transform:translateY(-50%) rotate(90deg);
}
.menu-layout .ant-menu-sub{
  background:transparent !important;
  padding:0 !important;
}
.menu-layout .ant-menu-sub .ant-menu-item{
  margin:0 !important;
  width:100% !important;
}
.menu-layout .ant-menu-item{
  height:auto !important;
  line-height:normal !important;
  margin:0 !important;
  padding:0 !important;
  background:transparent !important;
}
.menu-layout .ant-menu-item .ant-menu-title-content a{
  display:block;
  padding:14px 24px;
  color:rgba(255,255,255,.85) !important;
  text-decoration:none;
  font-size:15px;
  border-left:4px solid transparent;
}
.menu-layout .ant-menu-item:hover .ant-menu-title-content a{
  background:rgba(255,255,255,.12);
  border-left-color:var(--ui-primary);
  color:#fff !important;
}
.menu-layout .ant-menu-item-selected{
  background:transparent !important;
}
.menu-layout .ant-menu-item-selected .ant-menu-title-content a{
  background:rgba(255,255,255,.12);
  border-left-color:var(--ui-primary);
  color:#fff !important;
}

/* Sidebar header block (title + subtitle) */
.menu-layout .proto-sidebar-header{
  padding:24px 24px 16px;
  color:#fff;
}
.menu-layout .proto-sidebar-title{
  font-size:18px;
  font-weight:600;
  line-height:1.2;
}
.menu-layout .proto-sidebar-subtitle{
  margin-top:8px;
  font-size:13px;
  color:rgba(255,255,255,.85);
  line-height:1.5;
}
.menu-layout .proto-sidebar-user{
  margin-top:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  font-size:12px;
}
.menu-layout .proto-sidebar-user .username{
  color:rgba(255,255,255,.88);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.menu-layout .proto-sidebar-user a{
  color:#fff !important;
  text-decoration:none;
  border:1px solid rgba(255,255,255,.35);
  border-radius:999px;
  padding:2px 10px;
  line-height:1.3;
  flex-shrink:0;
}
.menu-layout .proto-sidebar-user a:hover{
  background:rgba(255,255,255,.14);
  border-color:rgba(255,255,255,.5);
}

/* Topbar (prototype-like) */
.proto-topbar{
  height:64px;
  background:#fff !important;
  border-bottom:1px solid var(--ui-border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 32px !important;
}
.proto-topbar-title{
  font-size:20px;
  font-weight:600;
  color:var(--ui-primary);
}
.proto-topbar-actions .ant-dropdown-link{
  color:var(--ui-text);
}

/* --------------------------
 * Page blocks (prototype-like)
 * -------------------------- */
/* PageTitle.vue renders .title (global class name). Style it only in the main content scope. */
.proto-content > .title{
  margin:0 0 16px !important;
  font-size:20px !important;
  font-weight:600;
  color:var(--ui-primary);
  text-align:left !important;
}

/* Card surface used by typical list pages: search + data-table */
.proto-content .search,
.proto-content .data-table,
.proto-content .list,
.proto-content .data-report,
.proto-content .data-list,
.proto-content .main-content,
.proto-content .content-bg{
  background:var(--ui-surface);
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius);
  box-shadow:0 6px 18px rgba(15,23,42,.06);
}
.proto-content{
  color:var(--ui-text);
  font-size:14px;
  line-height:1.5715;
}
.proto-content h2{
  margin:0 0 16px;
  font-size:18px;
  font-weight:700;
  color:var(--ui-text);
}

.proto-content .search{
  text-align:initial !important;
  margin:0 0 16px !important;
  padding:12px 16px !important;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:wrap;
  gap:12px;
}
.proto-content .search > div:empty{display:none;}
.proto-content .search .ant-form{display:flex;flex-wrap:wrap;gap:12px;}
.proto-content .search .ant-form-item{margin:0 !important;}

.proto-content .data-table{
  margin:0 0 24px !important;
  padding:12px 12px 8px !important;
  overflow-x:auto;
  overflow-y:hidden;
}

/* Make the legacy list fixed-margin rule behave inside the new layout. */
.proto-content .list{
  margin:0 0 24px !important;
  padding:6px 16px !important;
}
.proto-content .list li{
  border-bottom:1px solid var(--ui-border) !important;
}
.proto-content .list li:last-child{border-bottom:0 !important;}
.proto-content .list a{color:var(--ui-primary) !important;}
.proto-content .list a:hover{color:var(--ui-primary-dark) !important;}

/* Tables */
.proto-content .data-table .ant-table-container{
  border-radius:10px;
  overflow:hidden;
}
.proto-content .data-table .ant-table{
  border:0 !important;
}
.proto-content .ant-table-thead > tr > th{
  background:var(--ui-bg) !important;
  color:var(--ui-text);
  font-weight:500;
  font-size:14px;
  padding:12px !important;
  border-bottom:1px solid var(--ui-border) !important;
}
.proto-content .ant-table-tbody > tr > td{
  border-bottom:1px solid rgba(226,230,237,.85) !important;
  color:var(--ui-text);
  font-size:14px;
  padding:12px !important;
}
.proto-content .ant-table-tbody > tr:hover > td{
  background:rgba(139,0,18,.035) !important;
}

/* Forms / inputs */
.proto-content .ant-form-item-label > label{color:var(--ui-muted) !important;font-weight:500;}
.proto-content .ant-input,
.proto-content .ant-input-affix-wrapper,
.proto-content .ant-select-selector,
.proto-content .ant-picker,
.proto-content .ant-input-number{
  border-radius:8px !important;
  font-size:14px !important;
  color:var(--ui-text) !important;
}
.proto-content .ant-input:focus,
.proto-content .ant-input-affix-wrapper-focused,
.proto-content .ant-select-focused .ant-select-selector,
.proto-content .ant-picker-focused{
  border-color:var(--ui-primary) !important;
  box-shadow:0 0 0 2px rgba(139,0,18,.12) !important;
}

/* Buttons: make primary match prototype red */
.ant-btn-primary{
  background:var(--ui-primary) !important;
  border-color:var(--ui-primary) !important;
}
.ant-btn-primary:hover,
.ant-btn-primary:focus{
  background:var(--ui-primary-dark) !important;
  border-color:var(--ui-primary-dark) !important;
}
.ant-btn-link{color:var(--ui-primary) !important;}
.ant-btn-link:hover{color:var(--ui-primary-dark) !important;}
.proto-content .ant-btn:not(.ant-btn-link):not(.ant-btn-text){
  height:36px;
  padding:0 14px;
  border-radius:6px;
  font-size:14px;
  font-weight:400;
}
.proto-content .ant-btn-link{
  font-size:14px;
}

/* Pagination */
.proto-content .ant-pagination-item-active{
  border-color:var(--ui-primary) !important;
}
.proto-content .ant-pagination-item-active a{
  color:var(--ui-primary) !important;
}

/* Preview pages: remove hard-coded margin containers so they don't look "floating" */
.proto-content [style*="margin: 0 80px"]{margin:0 !important;}

/* Chat page root uses .aiagent; keep it as a normal page container. */
.aiagent{
  position:relative !important;
  top:auto !important;
  right:auto !important;
  bottom:auto !important;
  left:auto !important;
  display:flex;
  flex-flow:column nowrap;
  height:100vh;
}

/* Floating AI assistant icon */
.manager-layout > .aiagent-float{
  position:fixed;
  z-index:99999;
  top:auto;
  right:auto;
  bottom:auto;
  left:auto;
  width:60px;
  height:60px;
  cursor:grab;
  touch-action:none;
  user-select:none;
}
.manager-layout > .aiagent-float:active{
  cursor:grabbing;
}
.manager-layout > .aiagent-float .ai-icon{
  display:block;
  width:60px;
  height:60px;
  border-radius:50%;
  box-shadow:0 0 20px rgba(0,0,0,.35);
  pointer-events:none;
}

/* --------------------------
 * List + Form deep alignment
 * -------------------------- */

/* Search row: restore selector border removed by legacy CSS and align control rhythm */
.proto-content #select-cls .ant-select:not(.ant-select-disabled):not(.ant-select-customize-input) .ant-select-selector,
.proto-content .data-report .ant-select:not(.ant-select-disabled):not(.ant-select-customize-input) .ant-select-selector{
  border-color:var(--ui-border) !important;
  box-shadow:none !important;
}
.proto-content .search .ant-input-affix-wrapper,
.proto-content .search .ant-select,
.proto-content .search .ant-picker{
  min-width:220px;
}
.proto-content .search .ant-btn{
  height:36px;
  border-radius:8px;
}

/* List pages */
.proto-content .list ul{
  margin:0;
  padding:0;
}
.proto-content .list li{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:50px;
  line-height:1.45 !important;
  padding:10px 4px;
}
.proto-content .list li:hover{
  background:rgba(15,23,42,.02);
}
.proto-content .list .dian{
  margin-top:0 !important;
  align-self:center;
  background-color:var(--ui-primary) !important;
}
.proto-content .list li > div:last-child{
  color:var(--ui-muted);
  display:flex;
  align-items:center;
  gap:12px;
}

/* Table detail polish */
.proto-content .data-table .ant-table-thead > tr > th{
  padding-top:12px !important;
  padding-bottom:12px !important;
}
.proto-content .data-table .ant-table-tbody > tr > td{
  padding-top:12px !important;
  padding-bottom:12px !important;
}
.proto-content .data-table .ant-btn-link{
  padding:0 6px;
}
.proto-content .data-table .ant-pagination{
  margin:16px 6px 8px;
}
.proto-content .data-table .ant-empty{
  margin:24px 0;
}

/* Select + upload page header card */
.proto-content .select-upload-type{
  margin:0 0 16px !important;
  padding:12px 16px;
  background:var(--ui-surface);
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius);
  box-shadow:0 6px 18px rgba(15,23,42,.05);
  font-weight:500;
  display:flex;
  align-items:center;
  gap:12px;
}
.proto-content .select-upload-type .ant-select{
  min-width:260px;
}

/* Query type selector block in source/query pages */
.proto-content > div > div[style*="width: 300px"]{
  width:320px !important;
  max-width:100%;
  margin:0 0 16px;
}
.proto-content > div > div[style*="width: 300px"] .ant-select{
  width:100%;
}

/* Query forms: card surface + action row alignment */
.proto-content .ant-advanced-search-form{
  margin:0 0 16px !important;
  padding:16px 18px 2px;
  background:var(--ui-surface);
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius);
  box-shadow:0 6px 18px rgba(15,23,42,.05);
}
.proto-content .ant-advanced-search-form .ant-row{
  row-gap:2px;
}
.proto-content .ant-advanced-search-form .ant-form-item{
  margin-bottom:14px;
}
.proto-content .ant-advanced-search-form .ant-select,
.proto-content .ant-advanced-search-form .ant-picker{
  width:100%;
}
.proto-content .ant-advanced-search-form [style*="text-align: right"]{
  display:flex;
  justify-content:flex-end;
  align-items:flex-end;
  gap:8px;
}
.proto-content .ant-advanced-search-form [style*="text-align: right"] .ant-btn{
  margin:0 !important;
  min-width:88px;
}

/* Form pages: all non-inline forms use a card-like surface */
.proto-content > .ant-form,
.proto-content > div > .ant-form,
.proto-content > div[style*="margin:20px auto"] > .ant-form,
.proto-content .main-content > .ant-form,
.proto-content .content > .ant-form{
  background:var(--ui-surface);
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius);
  box-shadow:0 6px 18px rgba(15,23,42,.05);
  padding:20px 22px 8px;
  margin:0 0 24px;
}
.proto-content > div[style*="margin:20px auto"]{
  margin:0 0 24px !important;
}
.proto-content > div[style*="margin:20px auto;width: 600px"]{
  width:100% !important;
  max-width:760px;
}
.proto-content > div[style*="margin:20px auto;width: 600px"] .ant-picker{
  width:100% !important;
}
.proto-content > div[style*="margin:20px auto;width: 600px"] > div[style*="text-align: right"]{
  display:flex;
  justify-content:flex-end;
  gap:8px;
}
.proto-content > div[style*="margin:20px auto;width: 600px"] > div[style*="text-align: right"] .ant-btn{
  margin:0 !important;
}
.proto-content .ant-form:not(.ant-form-inline) .ant-form-item{
  margin-bottom:16px;
  max-width:100%;
}
.proto-content .ant-form:not(.ant-form-inline) .ant-input,
.proto-content .ant-form:not(.ant-form-inline) .ant-input-affix-wrapper,
.proto-content .ant-form:not(.ant-form-inline) .ant-select-selector,
.proto-content .ant-form:not(.ant-form-inline) .ant-picker{
  min-height:38px;
}
.proto-content .ant-form:not(.ant-form-inline) .ant-form-item-control,
.proto-content .ant-form:not(.ant-form-inline) .ant-form-item-control-input,
.proto-content .ant-form:not(.ant-form-inline) .ant-form-item-control-input-content{
  max-width:100%;
}
.proto-content .ant-form:not(.ant-form-inline) .ant-form-item-control-input-content > .ant-input,
.proto-content .ant-form:not(.ant-form-inline) .ant-form-item-control-input-content > .ant-input-affix-wrapper,
.proto-content .ant-form:not(.ant-form-inline) .ant-form-item-control-input-content > .ant-select,
.proto-content .ant-form:not(.ant-form-inline) .ant-form-item-control-input-content > .ant-picker,
.proto-content .ant-form:not(.ant-form-inline) .ant-form-item-control-input-content > .ant-input-number{
  width:100%;
}
.proto-content .ant-form:not(.ant-form-inline) textarea.ant-input{
  min-height:110px;
}

.proto-content .data-table .ant-table-cell{
  white-space:normal;
  word-break:break-word;
}

/* Dialogs and drawers keep same visual language for forms */
.ant-modal .ant-modal-content,
.ant-drawer .ant-drawer-content{
  border-radius:12px;
}
.ant-modal .ant-modal-header,
.ant-drawer .ant-drawer-header{
  border-bottom:1px solid var(--ui-border);
}

@media (max-width: 992px){
  .menu-layout{
    width:140px !important;
    max-width:140px !important;
    min-width:140px !important;
    flex:0 0 140px !important;
  }
  .menu-layout .proto-sidebar-header{
    padding:14px 12px 10px;
  }
  .menu-layout .proto-sidebar-title{
    font-size:14px;
  }
  .menu-layout .proto-sidebar-subtitle{
    display:none;
  }
  .menu-layout .ant-menu-inline > .ant-menu-submenu > .ant-menu-submenu-title{
    padding:0 12px !important;
    height:30px !important;
    line-height:30px !important;
  }
  .menu-layout .ant-menu-inline > .ant-menu-submenu > .ant-menu-submenu-title .ant-menu-title-content{
    font-size:10px;
  }
  .menu-layout .ant-menu-item .ant-menu-title-content a{
    padding:10px 12px;
    font-size:12px;
  }
  .proto-topbar{
    height:56px;
    padding:0 12px !important;
  }
  .proto-topbar-title{
    font-size:16px;
  }
  .proto-content .search .ant-form{
    width:100%;
  }
  .proto-content .search .ant-input-affix-wrapper,
  .proto-content .search .ant-select,
  .proto-content .search .ant-picker,
  .proto-content .search .ant-btn{
    width:100%;
    min-width:0;
  }
  .proto-content .select-upload-type{
    flex-direction:column;
    align-items:flex-start;
  }
  .proto-content .select-upload-type .ant-select{
    width:100%;
    min-width:0;
  }
  .proto-content .ant-advanced-search-form .ant-col{
    flex:0 0 100%;
    max-width:100%;
  }
  .proto-content .ant-advanced-search-form [style*="text-align: right"]{
    justify-content:flex-start;
  }
  .proto-content .ant-form:not(.ant-form-inline) .ant-form-item-label,
  .proto-content .ant-form:not(.ant-form-inline) .ant-form-item-control{
    flex:0 0 100%;
    max-width:100%;
  }
  .proto-content .ant-form:not(.ant-form-inline) .ant-form-item-label{
    text-align:left;
  }
  .proto-content .data-report .ant-col-12{
    flex:0 0 100%;
    max-width:100%;
  }
  .proto-content .data-report .ant-row{
    row-gap:12px;
  }
}

@media (max-width: 768px){
  .menu-layout{
    width:112px !important;
    max-width:112px !important;
    min-width:112px !important;
    flex:0 0 112px !important;
  }
  .proto-content > div[style*="margin:20px auto;width: 600px"] .ant-form-item .ant-col-4,
  .proto-content > div[style*="margin:20px auto;width: 600px"] .ant-form-item .ant-col-20{
    flex:0 0 100%;
    max-width:100%;
  }
  .proto-content > div[style*="margin:20px auto;width: 600px"] .ant-form-item-label{
    text-align:left;
  }
}

/* -----------------------------
 * Auth Pages (Login / Register)
 * Left-right split layout
 * ----------------------------- */

/* Full-page container */
.auth-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  overflow:hidden;
  background:var(--ui-bg);
}

/* Background decorations */
.auth-bg{
  position:fixed;
  inset:0;
  z-index:0;
}
.auth-bg::before{
  content:'';
  position:absolute;
  top:-30%;
  right:-10%;
  width:700px;
  height:700px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(139,0,18,.08) 0%,transparent 70%);
}
.auth-bg::after{
  content:'';
  position:absolute;
  bottom:-20%;
  left:-5%;
  width:500px;
  height:500px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(139,0,18,.05) 0%,transparent 70%);
}
.auth-grid{
  position:fixed;
  inset:0;
  background-image:
    linear-gradient(rgba(139,0,18,.02) 1px,transparent 1px),
    linear-gradient(90deg,rgba(139,0,18,.02) 1px,transparent 1px);
  background-size:50px 50px;
  z-index:0;
}

/* Main wrapper */
.auth-wrapper{
  position:relative;
  z-index:1;
  display:flex;
  width:960px;
  max-width:95vw;
  min-height:580px;
  background:#fff;
  border-radius:20px;
  box-shadow:0 20px 60px rgba(0,0,0,.08),0 1px 3px rgba(0,0,0,.04);
  overflow:hidden;
}
.auth-wrapper--reg{
  min-height:640px;
}

/* Left brand panel */
.auth-brand{
  width:400px;
  flex-shrink:0;
  background:var(--ui-primary-gradient);
  color:#fff;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:48px 40px;
  position:relative;
  overflow:hidden;
}
.auth-brand::before{
  content:'';
  position:absolute;
  top:-50%;
  right:-40%;
  width:500px;
  height:500px;
  border-radius:50%;
  background:rgba(255,255,255,.04);
}
.auth-brand::after{
  content:'';
  position:absolute;
  bottom:-30%;
  left:-20%;
  width:350px;
  height:350px;
  border-radius:50%;
  background:rgba(255,255,255,.03);
}
.auth-brand-logo{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:40px;
  position:relative;
  z-index:1;
}
.auth-brand-icon{
  width:44px;
  height:44px;
  background:rgba(255,255,255,.15);
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  backdrop-filter:blur(10px);
}
.auth-brand-logo span{
  font-size:22px;
  font-weight:700;
  letter-spacing:-0.02em;
}
.auth-tagline{
  position:relative;
  z-index:1;
}
.auth-tagline h2{
  font-size:28px;
  font-weight:700;
  line-height:1.3;
  margin:0 0 16px;
  border:none;
  padding:0;
  color:#fff;
}
.auth-tagline p{
  font-size:15px;
  color:rgba(255,255,255,.75);
  line-height:1.7;
  margin:0 0 32px;
}

/* Brand features (login) */
.auth-features{
  position:relative;
  z-index:1;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.auth-feature{
  display:flex;
  align-items:center;
  gap:12px;
  font-size:14px;
  color:rgba(255,255,255,.85);
}
.auth-feat-icon{
  width:32px;
  height:32px;
  border-radius:8px;
  background:rgba(255,255,255,.1);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}

/* Registration steps (register) */
.auth-steps{
  position:relative;
  z-index:1;
  display:flex;
  flex-direction:column;
  gap:20px;
}
.auth-step{
  display:flex;
  align-items:flex-start;
  gap:14px;
}
.auth-step-num{
  width:32px;
  height:32px;
  border-radius:50%;
  background:rgba(255,255,255,.15);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  font-weight:700;
  flex-shrink:0;
}
.auth-step-num.active{
  background:rgba(255,255,255,.95);
  color:var(--ui-primary);
}
.auth-step-info{
  padding-top:4px;
}
.auth-step-info strong{
  display:block;
  font-size:14px;
  margin-bottom:2px;
}
.auth-step-info span{
  font-size:12px;
  color:rgba(255,255,255,.6);
}

/* Right form area */
.auth-form-area{
  flex:1;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:48px 56px;
  overflow-y:auto;
}

/* Form header */
.auth-form-header{
  margin-bottom:28px;
}
.auth-form-header h3{
  font-size:24px;
  font-weight:700;
  color:var(--ui-text);
  margin:0 0 8px;
}
.auth-form-header p{
  font-size:14px;
  color:#8b95a5;
  margin:0;
}

/* Role selector tabs */
.auth-role-selector{
  display:flex;
  gap:8px;
  margin-bottom:24px;
  background:#f5f6f8;
  border-radius:10px;
  padding:4px;
}
.auth-role-opt{
  flex:1;
  padding:10px 0;
  text-align:center;
  font-size:13px;
  font-weight:500;
  color:#8b95a5;
  border-radius:8px;
  cursor:pointer;
  transition:all .2s;
  border:none;
  background:none;
  font-family:inherit;
}
.auth-role-opt:hover{color:var(--ui-text);}
.auth-role-opt.active{
  background:#fff;
  color:var(--ui-primary);
  box-shadow:0 2px 8px rgba(0,0,0,.06);
  font-weight:600;
}

/* Form items */
.auth-form-area .ant-form{width:100% !important;}
.auth-form-area .ant-form-item{margin-bottom:18px;}
.auth-form-area .ant-form-vertical .ant-form-item-label > label{
  color:var(--ui-text) !important;
  font-weight:600;
  font-size:13px;
}
.auth-form-area .ant-form-item-control-input{width:auto !important;margin-left:0 !important;}
.auth-form-area .ant-form-item-explain-error{padding-left:0 !important;}
.auth-form-area .ant-form-item-control-input-content{width:100%;}

/* Inputs */
.auth-form-area .ant-input,
.auth-form-area .ant-input-affix-wrapper{
  height:44px;
  border:1.5px solid #e2e6ed;
  border-radius:10px !important;
  font-size:14px;
}
/* Inner input inside affix-wrapper (password / captcha) should not duplicate height */
.auth-form-area .ant-input-affix-wrapper .ant-input{
  height:auto !important;
  border:none !important;
  box-shadow:none !important;
}
.auth-form-area .ant-input::placeholder{color:#c0c7d0;}
.auth-form-area .ant-input:hover,
.auth-form-area .ant-input-affix-wrapper:hover{border-color:#c8ced8;}
.auth-form-area .ant-input:focus,
.auth-form-area .ant-input-affix-wrapper-focused{
  border-color:var(--ui-primary) !important;
  box-shadow:0 0 0 3px rgba(139,0,18,.08) !important;
}
.auth-form-area .ant-input-password{
  border:1.5px solid #e2e6ed !important;
  width:100% !important;
  max-width:none !important;
}

/* Captcha row */
.auth-captcha-row{
  display:flex;
  gap:12px;
  align-items:center;
}
.auth-captcha-row .ant-input-affix-wrapper{flex:1;}
.auth-captcha-img{
  width:120px;
  height:44px;
  border-radius:10px;
  border:1.5px solid #e2e6ed;
  background:#f9fafb;
  cursor:pointer;
  overflow:hidden;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:border-color .2s;
}
.auth-captcha-img:hover{border-color:var(--ui-primary);}
.auth-captcha-img img{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* Suffix icon */
.auth-form-area .ant-input-suffix .anticon{color:#8b95a5;}
.auth-form-area .ant-input-suffix .anticon:hover{color:var(--ui-primary);}

/* Form extra (remember/forgot) */
.auth-form-extra{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:24px;
  font-size:13px;
}
.auth-remember{
  display:flex;
  align-items:center;
  gap:6px;
  color:#8b95a5;
  cursor:pointer;
}
.auth-remember input[type="checkbox"]{
  width:16px;
  height:16px;
  accent-color:var(--ui-primary);
  cursor:pointer;
}
.auth-forgot{
  color:var(--ui-primary) !important;
  text-decoration:none;
  font-weight:500;
}
.auth-forgot:hover{text-decoration:underline;}

/* Submit button */
.auth-form-area .ant-btn-primary{
  width:100%;
  height:46px;
  border-radius:10px !important;
  font-size:15px;
  font-weight:600;
  background:var(--ui-primary-gradient) !important;
  border:none !important;
  letter-spacing:.02em;
}
.auth-form-area .ant-btn-primary:hover{
  opacity:.92;
  box-shadow:0 6px 20px rgba(139,0,18,.25);
  transform:translateY(-1px);
}
.auth-form-area .ant-btn-primary:active{transform:translateY(0);}

/* Divider */
.auth-divider{
  display:flex;
  align-items:center;
  gap:16px;
  margin:24px 0;
  font-size:12px;
  color:#c0c7d0;
}
.auth-divider::before,
.auth-divider::after{
  content:'';
  flex:1;
  height:1px;
  background:#e8ecf0;
}

/* Social login */
.auth-social{
  display:flex;
  justify-content:center;
  gap:16px;
}
.auth-social-btn{
  width:44px;
  height:44px;
  border-radius:10px;
  border:1.5px solid #e2e6ed;
  background:#fff;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all .2s;
  color:#8b95a5;
}
.auth-social-btn:hover{
  border-color:var(--ui-primary);
  color:var(--ui-primary);
  background:rgba(139,0,18,.03);
}

/* Footer link */
.auth-form-footer{
  text-align:center;
  margin-top:20px;
  font-size:14px;
  color:#8b95a5;
}
.auth-form-footer a{
  color:var(--ui-primary) !important;
  text-decoration:none;
  font-weight:600;
}
.auth-form-footer a:hover{text-decoration:underline;}

/* Password strength */
.auth-pwd-strength{
  display:flex;
  gap:4px;
  margin-top:8px;
  align-items:center;
}
.auth-str-bar{
  flex:1;
  height:4px;
  border-radius:2px;
  background:#e8ecf0;
  transition:background .3s;
}
.auth-str-bar.weak{background:#f56c6c;}
.auth-str-bar.medium{background:#f5a623;}
.auth-str-bar.strong{background:#2eae59;}
.auth-str-label{
  font-size:11px;
  min-width:32px;
  text-align:right;
}

/* Form row (two columns) */
.auth-form-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0 16px;
}

/* Agreement */
.auth-agreement{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin-bottom:24px;
  font-size:13px;
  color:#8b95a5;
  line-height:1.5;
}
.auth-agreement input[type="checkbox"]{
  width:16px;
  height:16px;
  accent-color:var(--ui-primary);
  cursor:pointer;
  margin-top:2px;
  flex-shrink:0;
}
.auth-agreement a{
  color:var(--ui-primary) !important;
  text-decoration:none;
}
.auth-agreement a:hover{text-decoration:underline;}

/* Responsive */
@media (max-width:768px){
  .auth-brand{display:none;}
  .auth-wrapper{max-width:440px;min-height:auto;}
  .auth-wrapper--reg{min-height:auto;}
  .auth-form-area{padding:36px 28px;}
  .auth-form-row{grid-template-columns:1fr;gap:0;}
}

/* -------------------------
 * Stage-3 prototype pages
 * ------------------------- */
.proto3-page{
  display:flex;
  flex-direction:column;
  min-height:calc(100vh - 72px);
  color:var(--ui-text);
  font-size:14px;
  line-height:1.5715;
}
.proto3-page .header{
  border-radius:0;
}
.proto-content > .proto3-page > .header{
  margin:-24px -32px 0;
  padding:0 32px;
  box-shadow:none;
}
.proto3-page .content{
  overflow:visible;
  background:transparent !important;
  margin-bottom:0 !important;
  padding:24px 0 48px;
}
.proto3-page .card{
  overflow:visible;
}
.proto3-page .card h2{
  margin:0 0 16px;
  font-size:18px;
  font-weight:700;
  color:var(--ui-text);
}
.proto3-page .header .actions{
  display:flex;
  align-items:center;
  gap:10px;
}
.proto3-page button:not(.modal-close-button):not(.mini-program-modal-close-button){
  height:36px;
  padding:0 14px;
  border-radius:6px;
  border:1px solid var(--ui-border);
  background:#fff;
  color:var(--ui-text);
  cursor:pointer;
}
.proto3-page button:not(.modal-close-button):not(.mini-program-modal-close-button):hover{
  border-color:#cfd6e2;
}
.proto3-page button.primary:not(.modal-close-button):not(.mini-program-modal-close-button){
  background:var(--ui-primary);
  border-color:var(--ui-primary);
  color:#fff;
}
.proto3-page button.primary:not(.modal-close-button):not(.mini-program-modal-close-button):hover{
  background:var(--ui-primary-dark);
  border-color:var(--ui-primary-dark);
}
.proto3-page .filter-bar{
  align-items:center;
}
.proto3-page .filter-bar input,
.proto3-page .filter-bar select{
  height:36px;
  min-width:160px;
  font-size:14px;
  color:var(--ui-text);
}
.proto3-page .filter-bar button{
  flex:0 0 auto;
}
.proto3-page .table{
  table-layout:auto;
}
.proto3-page .table th,
.proto3-page .table td{
  vertical-align:middle;
  white-space:normal;
  word-break:break-word;
  font-size:14px;
  color:var(--ui-text);
  padding:12px;
}
.proto3-page .table th{
  font-weight:500;
}
.proto3-page .button-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:58px;
  min-height:34px;
  margin:0 4px 4px 0;
  padding:8px 12px;
  border-radius:6px;
  border:1px solid var(--ui-border);
  color:var(--ui-text);
  text-decoration:none;
  font-size:14px;
  font-weight:400;
  line-height:1.2;
  background:#fff;
}
.proto3-page .button-link.primary{
  border-color:var(--ui-primary);
  background:var(--ui-primary);
  color:#fff;
}
.proto3-page .button-link.primary:hover,
.proto3-page .button-link.primary:focus,
.proto3-page .button-link.primary:visited{
  background:var(--ui-primary-dark);
  border-color:var(--ui-primary-dark);
  color:#fff;
}
.proto3-page .button-link.danger{
  border-color:#f2b8bc;
  color:#cf1322;
}
.proto3-page .button-link.disabled{
  color:#b5b8c2;
  border-color:#e6e8ef;
  pointer-events:none;
}
.proto3-page .button-link:hover{
  border-color:#cfd6e2;
}

/* Proto3 custom modals: align with prototype common.css */
.proto3-page .modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.5);
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  visibility:hidden;
  transition:opacity .3s,visibility .3s;
  z-index:3000;
}
.proto3-page .modal-overlay.visible{
  opacity:1;
  visibility:visible;
}
.proto3-page .modal{
  background:#fff;
  padding:24px;
  border-radius:12px;
  width:90%;
  max-width:500px;
  box-shadow:0 5px 15px rgba(0,0,0,.2);
  transform:translateY(-20px);
  transition:transform .3s;
}
.proto3-page .modal-overlay.visible .modal{
  transform:translateY(0);
}
.proto3-page .modal-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:20px;
}
.proto3-page .modal-header h2{
  margin:0;
  font-size:20px;
  font-weight:600;
  color:var(--ui-text);
}
.proto3-page .modal-close-button{
  width:auto !important;
  min-width:0 !important;
  height:auto !important;
  padding:0 !important;
  border:0 !important;
  background:none !important;
  color:#888 !important;
  font-size:24px !important;
  line-height:1 !important;
  cursor:pointer;
}
.proto3-page .modal-close-button:hover{
  color:#555 !important;
}
.proto3-page .modal-body{
  color:var(--ui-text);
  font-size:14px;
  line-height:1.6;
}
.proto3-page .modal-body .form{
  grid-template-columns:1fr;
}
.proto3-page .modal-body .form label{
  font-size:14px;
  font-weight:500;
  color:var(--ui-muted);
}
.proto3-page .modal-body .form input,
.proto3-page .modal-body .form select,
.proto3-page .modal-body .form textarea{
  width:100%;
  min-height:36px;
  padding:8px 12px;
  border:1px solid var(--ui-border);
  border-radius:8px;
  font-size:14px;
  color:var(--ui-text);
}
.proto3-page .modal-body .form textarea{
  min-height:96px;
  resize:vertical;
}
.proto3-page .modal-body .button-group{
  margin-top:16px;
}
.proto3-page .modal-body .button-group button{
  margin-right:8px;
}
.proto3-page .detail-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(250px,1fr));
  gap:16px;
}
.proto3-page .detail-item{
  padding:8px 0;
}
.proto3-page .detail-item label{
  display:block;
  margin-bottom:4px;
  font-weight:600;
  color:#555;
}
.proto3-page .detail-item span{
  color:#333;
}
.proto3-page .stat-grid{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:16px;
  margin-bottom:24px;
}
.proto3-page .stat-item{
  background-color:#f8f9fa;
  border-radius:8px;
  padding:16px;
  text-align:center;
}
.proto3-page .stat-item .stat-value{
  font-size:28px;
  font-weight:600;
  color:#333;
}
.proto3-page .stat-item .stat-label{
  font-size:14px;
  color:#666;
  margin-top:4px;
}
.proto3-page .analysis-section{
  margin-top:24px;
}
.proto3-page .question-analysis{
  margin-bottom:24px;
  padding-bottom:16px;
  border-bottom:1px solid #eee;
}
.proto3-page .question-analysis:last-child{
  border-bottom:none;
}
.proto3-page .tabs-nav{
  list-style:none;
  padding:0;
  margin:0;
  border-bottom:2px solid #dee2e6;
  display:flex;
}
.proto3-page .tabs-nav li{
  padding:12px 24px;
  cursor:pointer;
  font-weight:500;
  color:#666;
  border-bottom:2px solid transparent;
  margin-bottom:-2px;
  font-size:1.1rem;
}
.proto3-page .tabs-nav li.active{
  color:#333;
  font-weight:700;
  border-color:#4dabf7;
}
.proto3-page .tab-pane{
  display:none;
  padding-top:24px;
}
.proto3-page .tab-pane.active{
  display:block;
}
.proto3-page .option-bar-container{
  display:flex;
  align-items:center;
  margin:8px 0;
}
.proto3-page .option-label{
  width:200px;
  flex-shrink:0;
}
.proto3-page .option-bar{
  flex-grow:1;
  height:20px;
  background-color:#e9ecef;
  border-radius:4px;
  overflow:hidden;
}
.proto3-page .option-bar .bar-fill{
  height:100%;
  background-color:#4dabf7;
  text-align:right;
  padding-right:8px;
  color:#fff;
  font-size:.8rem;
  line-height:20px;
}
.proto3-page .option-details{
  margin-left:16px;
  font-size:.9rem;
  color:#555;
}
@media (max-width: 1200px){
  .proto3-page .stat-grid{
    grid-template-columns:repeat(3,1fr);
  }
}
@media (max-width: 768px){
  .proto-content > .proto3-page > .header{
    margin:-14px -14px 0;
    padding:0 14px;
  }
  .proto3-page .content{
    padding:14px 0 28px;
  }
  .proto3-page .stat-grid{
    grid-template-columns:repeat(2,1fr);
  }
  .proto3-page .tabs-nav li{
    padding:10px 12px;
    font-size:1rem;
  }
  .proto3-page .filter-bar input,
  .proto3-page .filter-bar select,
  .proto3-page .filter-bar button{
    width:100%;
    min-width:0;
  }
}
.proto3-builder{
  border:1px solid var(--ui-border);
  border-radius:12px;
  background:#fff;
  overflow:hidden;
}
.proto3-builder-iframe{
  width:100%;
  min-height:920px;
  border:0;
  display:block;
  background:#fff;
}

/* Global AI modal in manager layout */
.manager-ai-mini-modal{
  width:min(1000px, 92vw) !important;
  max-width:1000px !important;
}
.manager-ai-mini-modal .mini-program-modal-body{
  min-height:min(78vh, 760px) !important;
  height:min(78vh, 760px) !important;
}
.manager-layout .mini-program-modal-overlay{
  display:none !important;
}
.manager-layout .mini-program-modal-overlay.visible{
  display:flex !important;
}

/* Enrollment row selection */
.proto3-page .table tbody tr.selected td{
  background:rgba(139,0,18,.06);
}

/* AI assistant chat-like layout */
.p3-ai-assistant .p3-ai-chat-shell{
  display:flex;
  flex-direction:column;
  gap:14px;
  min-height:calc(100vh - 240px);
}
.p3-ai-assistant .p3-ai-chat-messages{
  flex:1;
  min-height:380px;
  max-height:62vh;
  overflow:auto;
  border:1px solid var(--ui-border);
  border-radius:12px;
  background:#fff;
  padding:16px;
}
.p3-ai-assistant .p3-ai-message{
  display:flex;
  gap:10px;
  margin-bottom:14px;
}
.p3-ai-assistant .p3-ai-message.user{
  flex-direction:row-reverse;
}
.p3-ai-assistant .p3-ai-avatar{
  width:34px;
  height:34px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:600;
  background:#f3f4f6;
  color:#333;
  flex-shrink:0;
}
.p3-ai-assistant .p3-ai-message.ai .p3-ai-avatar{
  background:#8B0012;
  color:#fff;
}
.p3-ai-assistant .p3-ai-bubble{
  max-width:calc(100% - 48px);
  background:#f7f8fa;
  border:1px solid #eceff4;
  border-radius:12px;
  padding:10px 12px;
}
.p3-ai-assistant .p3-ai-message.user .p3-ai-bubble{
  background:#fff6f7;
  border-color:#f5d4d8;
}
.p3-ai-assistant .p3-ai-sender{
  font-size:12px;
  color:#666;
  margin-bottom:4px;
}
.p3-ai-assistant .p3-ai-text{
  white-space:pre-wrap;
  word-break:break-word;
  line-height:1.6;
}
.p3-ai-assistant .p3-ai-prompts{
  border:1px solid var(--ui-border);
  background:#fff;
  border-radius:12px;
  padding:12px;
}
.p3-ai-assistant .p3-ai-prompts p{
  margin:0 0 10px;
  color:#666;
}
.p3-ai-assistant .p3-ai-prompts .prompt-btn{
  margin:0 8px 8px 0;
}
.p3-ai-assistant .p3-ai-input-area{
  display:flex;
  gap:10px;
  align-items:flex-end;
}
.p3-ai-assistant .p3-ai-input-area textarea{
  flex:1;
  min-height:70px;
  border-radius:10px;
}
.p3-ai-assistant .p3-ai-input-actions{
  display:flex;
  gap:8px;
  align-items:center;
}
.p3-ai-assistant .p3-ai-input-actions .ghost{
  border:1px solid #d0d7e2;
  background:#fff;
  color:#2c3e50;
  border-radius:10px;
  min-width:88px;
  height:36px;
  padding:0 12px;
  cursor:pointer;
}
.p3-ai-assistant .p3-ai-input-actions .ghost:disabled{
  opacity:.6;
  cursor:not-allowed;
}
.p3-ai-assistant .p3-ai-voice-tip{
  margin-top:6px;
  color:#4f5f72;
  font-size:12px;
}
.p3-ai-assistant .p3-ai-voice-tip.warn{
  color:#b26b00;
}

.p3-ai-assistant .p3-ai-card{
  margin-top:6px;
  padding:12px;
  border:1px solid #e8ebf2;
  border-radius:10px;
  background:#fff;
}
.p3-ai-assistant .p3-ai-card h4{
  margin:0 0 8px;
  color:#222;
}
.p3-ai-assistant .p3-ai-card p{
  margin:6px 0;
}
.p3-ai-assistant .p3-ai-card pre{
  margin:8px 0;
  padding:10px;
  border-radius:8px;
  background:#f8fafc;
  border:1px solid #eef2f8;
  white-space:pre-wrap;
  font-family:Menlo, Monaco, Consolas, monospace;
  font-size:12px;
}
.p3-ai-assistant .p3-ai-card ul{
  margin:8px 0;
  padding-left:18px;
}
.p3-ai-assistant .p3-ai-card .metric{
  color:#8B0012;
}
.p3-ai-assistant .p3-ai-card .danger{
  color:#d63333;
  font-weight:600;
}
.p3-ai-assistant .p3-ai-card .warn{
  color:#d48a00;
  font-weight:600;
}
.p3-ai-assistant .p3-ai-card .actions{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.p3-ai-assistant .p3-ai-card .actions button{
  border:1px solid #d8deea;
  background:#fff;
  color:#333;
  border-radius:8px;
  padding:6px 10px;
  font-size:12px;
}

.track-map-svg{
  width:100%;
  height:180px;
  display:block;
  margin-bottom:10px;
}

.question-list .question-item{
  cursor:grab;
}
.question-list .question-item:active{
  cursor:grabbing;
}
.question-list .question-item.dragging{
  opacity:.55;
}
.question-list .question-item.dropover{
  outline:2px dashed #8B0012;
  outline-offset:2px;
}

/* Survey builder: align with prototype modal structure, rendered as business page */
.p3-survey-builder-page .survey-creator-header{
  background:#fff;
}
.p3-survey-builder{
  padding:14px 0 26px;
}
.p3-survey-builder .builder-shell{
  display:flex;
  gap:16px;
  align-items:stretch;
}
.p3-survey-builder .fields-library{
  width:300px;
  flex-shrink:0;
  padding:14px;
  margin-bottom:0;
  max-height:calc(100vh - 190px);
  overflow:auto;
}
.p3-survey-builder .fields-library h3{
  margin:0 0 12px;
  font-size:15px;
  font-weight:700;
  color:#2a2f3a;
}
.p3-survey-builder .field-category + .field-category{
  margin-top:12px;
}
.p3-survey-builder .field-category h4{
  margin:0 0 8px;
  font-size:13px;
  color:#596273;
}
.p3-survey-builder .field-item{
  width:100%;
  text-align:left;
  border:1px solid var(--ui-border);
  background:#fff;
  border-radius:8px;
  padding:9px 10px;
  margin-bottom:8px;
  cursor:pointer;
}
.p3-survey-builder .field-item:hover{
  border-color:#b9c1cf;
  background:#fafbfc;
}
.p3-survey-builder .field-item-title{
  display:block;
  color:#2b313d;
  font-size:13px;
  font-weight:600;
}
.p3-survey-builder .field-item-desc{
  display:none !important;
}
.p3-survey-builder .canvas-area{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.p3-survey-builder .survey-main-info{
  margin-bottom:0;
}
.p3-survey-builder .survey-title-input{
  width:100%;
  min-height:42px;
  border:1px solid #d7dce6;
  border-radius:8px;
  padding:10px 12px;
  font-size:20px;
  font-weight:700;
  color:#1f2530;
}
.p3-survey-builder .survey-title-input:focus{
  border-color:#8B0012;
  outline:none;
}
.p3-survey-builder .survey-desc-input{
  margin-top:10px;
  width:100%;
  min-height:72px;
  border:1px solid #d7dce6;
  border-radius:8px;
  padding:10px 12px;
  resize:vertical;
}
.p3-survey-builder .p3-survey-meta-grid{
  margin-top:12px !important;
}
.p3-survey-builder .canvas{
  margin-bottom:0;
  flex:1;
  overflow:auto;
  max-height:calc(100vh - 296px);
  background:#f7f8fa;
}
.p3-survey-builder .canvas-placeholder{
  border:1px dashed #d5dbe7;
  border-radius:8px;
  text-align:center;
  color:#7f8797;
  padding:34px 12px;
}
.p3-survey-builder .canvas-field{
  border:1px solid #d8deea;
  border-radius:8px;
  background:#fff;
  padding:12px;
}
.p3-survey-builder .canvas-field + .canvas-field{
  margin-top:12px;
}
.p3-survey-builder .canvas-field.dragging{
  opacity:.6;
}
.p3-survey-builder .canvas-field.dropover{
  outline:2px dashed #8B0012;
}
.p3-survey-builder .field-toolbar{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.p3-survey-builder .tool-btn{
  height:28px;
  padding:0 10px;
  border-radius:7px;
  border:1px solid #d2d8e4;
  background:#fff;
  color:#4a5261;
  font-size:12px;
}
.p3-survey-builder .tool-btn.active{
  border-color:#8B0012;
  color:#8B0012;
  background:#fff4f5;
}
.p3-survey-builder .tool-btn.danger{
  color:#d43838;
}
.p3-survey-builder .tool-btn:disabled{
  opacity:.45;
  cursor:not-allowed;
}
.p3-survey-builder .field-base-row{
  margin-bottom:10px;
}
.p3-survey-builder .field-base-row label{
  display:block;
  margin-bottom:6px;
  font-size:12px;
  color:#667084;
  font-weight:600;
}
.p3-survey-builder .field-base-row input{
  width:100%;
  min-height:36px;
  border:1px solid #d6dce8;
  border-radius:7px;
  padding:7px 10px;
}
.p3-survey-builder .heading-input{
  width:100%;
  border:1px solid #d6dce8;
  border-radius:7px;
  padding:8px 10px;
  color:#222a35;
}
.p3-survey-builder .heading-input.heading-large{
  font-size:26px;
  font-weight:700;
}
.p3-survey-builder .heading-input.heading-medium{
  font-size:20px;
  font-weight:700;
}
.p3-survey-builder .heading-input.heading-small{
  font-size:16px;
  font-weight:700;
}
.p3-survey-builder .options-editor{
  margin-top:4px;
}
.p3-survey-builder .option-editor-item{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
}
.p3-survey-builder .option-editor-input{
  flex:1;
  min-height:34px;
  border:1px solid #d6dce8;
  border-radius:7px;
  padding:6px 10px;
}
.p3-survey-builder .delete-option-btn{
  width:30px;
  height:30px;
  border:1px solid #d6dce8;
  background:#fff;
  color:#8b95a8;
  border-radius:6px;
  font-size:18px;
  line-height:1;
}
.p3-survey-builder .add-option-btn{
  min-height:30px;
  padding:0 10px;
  border:1px dashed #c9d2e3;
  color:#4d5667;
  background:#fff;
  border-radius:7px;
  font-size:12px;
}
.p3-survey-builder .field-preview{
  margin-top:10px;
  border-top:1px dashed #e2e7f0;
  padding-top:10px;
}
.p3-survey-builder .field-preview label{
  display:block;
  margin-bottom:8px;
  color:#2e3441;
  font-weight:600;
}
.p3-survey-builder .field-preview input[type="text"],
.p3-survey-builder .field-preview input[type="number"],
.p3-survey-builder .field-preview input[type="email"],
.p3-survey-builder .field-preview input[type="tel"],
.p3-survey-builder .field-preview input[type="url"],
.p3-survey-builder .field-preview input[type="date"],
.p3-survey-builder .field-preview input[type="datetime-local"],
.p3-survey-builder .field-preview textarea,
.p3-survey-builder .field-preview select{
  width:100%;
  min-height:34px;
  border:1px solid #dde3ee;
  border-radius:7px;
  padding:6px 10px;
  background:#f8fafc;
}
.p3-survey-builder .field-preview textarea{
  min-height:76px;
}
.p3-survey-builder .preview-options .option-item{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:6px;
}
.p3-survey-builder .required-star{
  color:#d43838;
  font-weight:700;
}
.p3-survey-preview .preview-field{
  margin-bottom:16px;
  padding-bottom:14px;
  border-bottom:1px solid #eef1f6;
}
.p3-survey-preview .preview-field:last-child{
  border-bottom:0;
  margin-bottom:0;
  padding-bottom:0;
}
.p3-survey-preview .preview-field label{
  display:block;
  margin-bottom:8px;
  color:#2d3340;
  font-weight:600;
}
.p3-survey-preview .preview-field input[type="text"],
.p3-survey-preview .preview-field input[type="number"],
.p3-survey-preview .preview-field input[type="email"],
.p3-survey-preview .preview-field input[type="tel"],
.p3-survey-preview .preview-field input[type="url"],
.p3-survey-preview .preview-field input[type="date"],
.p3-survey-preview .preview-field input[type="datetime-local"],
.p3-survey-preview .preview-field textarea,
.p3-survey-preview .preview-field select{
  width:100%;
  min-height:36px;
  border:1px solid #dde3ee;
  border-radius:7px;
  padding:7px 10px;
  background:#fafbfd;
}
.p3-survey-preview .preview-field textarea{
  min-height:86px;
}
.p3-survey-preview .preview-options .option-item{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:6px;
}
@media (max-width: 1200px){
  .p3-survey-builder .builder-shell{
    flex-direction:column;
  }
  .p3-survey-builder .fields-library{
    width:100%;
    max-height:none;
  }
  .p3-survey-builder .canvas{
    max-height:none;
  }
}

/* Survey builder full-page overrides on top of prototype modal css */
.p3-survey-builder-page .p3-survey-builder-content{
  padding:12px 0 24px !important;
}
.p3-survey-builder-page .p3-inline-builder-container{
  width:100% !important;
  max-width:none !important;
  height:calc(100vh - 220px) !important;
  transform:none !important;
  box-shadow:0 2px 10px rgba(15,23,42,.06) !important;
  border:1px solid #e3e8f2 !important;
}
.p3-survey-builder-page .p3-builder-meta{
  margin-top:10px;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  font-size:12px;
  color:#6b7280;
}
.p3-survey-builder-page .p3-label-input{
  width:100% !important;
  min-height:36px !important;
  border:1px solid #d1d5db !important;
  border-radius:4px !important;
  padding:8px 10px !important;
  font-size:14px !important;
}
.p3-survey-builder-page .p3-field-title-text{
  display:block;
  width:100%;
  min-height:36px;
  border:1px dashed transparent;
  border-radius:4px;
  padding:8px 10px;
  line-height:20px;
  color:#1f2937;
  cursor:text;
}
.p3-survey-builder-page .p3-field-title-text:hover{
  border-color:#c8d1e3;
  background:#fafbfd;
}
.p3-survey-builder-page .p3-heading-input{
  width:100% !important;
  border:1px solid #d1d5db !important;
  border-radius:4px !important;
  padding:8px 10px !important;
}
.p3-survey-builder-page .p3-heading-large-text,
.p3-survey-builder-page .p3-heading-medium-text,
.p3-survey-builder-page .p3-heading-small-text{
  margin:0;
  border:1px dashed transparent;
  border-radius:4px;
  padding:8px 10px;
  cursor:text;
}
.p3-survey-builder-page .p3-heading-large-text:hover,
.p3-survey-builder-page .p3-heading-medium-text:hover,
.p3-survey-builder-page .p3-heading-small-text:hover{
  border-color:#c8d1e3;
  background:#fafbfd;
}
.p3-survey-builder-page .p3-heading-large{
  font-size:30px !important;
  font-weight:700 !important;
}
.p3-survey-builder-page .p3-heading-medium{
  font-size:24px !important;
  font-weight:700 !important;
}
.p3-survey-builder-page .p3-heading-small{
  font-size:18px !important;
  font-weight:700 !important;
}
.p3-survey-builder-page .options-group .option-item{
  gap:8px;
}
.p3-survey-builder-page .p3-option-text{
  flex:1;
  min-height:32px;
  display:flex;
  align-items:center;
  border:1px dashed transparent;
  border-radius:4px;
  padding:4px 8px;
  cursor:text;
}
.p3-survey-builder-page .p3-option-text:hover{
  border-color:#c8d1e3;
  background:#fafbfd;
}
.p3-survey-builder-page .options-group .option-item .option-editor-input{
  flex:1 !important;
  width:auto !important;
  margin-right:0 !important;
}
.p3-survey-builder-page .editing-input{
  border-color:#6366f1 !important;
  box-shadow:0 0 0 2px rgba(99,102,241,.16);
}
.p3-survey-builder-page .field-toolbar{
  z-index:8;
}
.p3-survey-builder-page .field-toolbar .required-btn.active{
  color:#22c55e;
}
.p3-survey-builder-page .canvas-field.dragging{
  opacity:.55;
}
.p3-survey-builder-page .canvas-field.dropover{
  outline:2px dashed #8B0012;
  outline-offset:2px;
}
.p3-survey-builder-page .p3-preview-container{
  max-width:960px !important;
  height:88vh !important;
}
.p3-survey-builder-page .p3-preview-content{
  display:block !important;
  padding:24px !important;
  overflow-y:auto !important;
}
@media (max-width: 1200px){
  .p3-survey-builder-page .p3-inline-builder-container{
    height:auto !important;
  }
  .p3-survey-builder-page .modal-content{
    flex-direction:column;
  }
  .p3-survey-builder-page .fields-library{
    width:100% !important;
    max-height:none !important;
    border-right:0 !important;
    border-bottom:1px solid #e0e0e0;
  }
}
