/* portal-v2-poc · Tabler v1 (Bootstrap 5 base) + 业务覆盖
   Tabler 接管: typography / form / button / alert / table / card / badge / nav-tabs / sidebar
   本文件只放 Tabler 没覆盖到的业务行为. */

/* === code 标签视觉强化 (Tabler 默认 code 无背景) === */
code {
  background: rgba(33, 110, 230, 0.08);
  color: var(--tblr-primary, #206bc4);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: "Consolas", "Menlo", monospace;
}
/* sidebar 内的 code 不用蓝色 (跟深色背景冲突) */
.navbar-vertical code { background: rgba(255,255,255,0.08); color: inherit; }

/* === dialog ref-grid: 三栏强制 nowrap 防鬼畜断行 === */
.ref-grid .ref-label {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ref-grid .ref-val {
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  margin-top: 4px;
  color: var(--tblr-body-color, #1f2937);
}

/* === HTMX 自制 dialog: 占位状态独立 wrapper, 不挂 dialog-pane 上
   (HTMX innerHTML swap 不动 dialog-pane class, 否则 empty 状态会污染加载后) === */
.dialog-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  height: 100%;            /* 空态占位也填满卡 (卡 h-100 后), 提示文字居中 */
}
/* 右侧编辑卡 h-100 填满列高 (= 左表卡高); 内容超长时卡内部滚, 卡高不变 */
#dialog-pane { overflow-y: auto; }

/* dialog 标题区固定高度: 品名最多 2 行 + SPU 行 1 行 (超出省略号), 防品名长短把下方卡片顶高顶矮 */
.dialog-head { height: 4.6rem; overflow: hidden; }
.dialog-head-text { min-width: 0; }   /* flex 子项允许内部 clamp 收缩 (默认 min-width:auto 不收缩) */
.dialog-head h3 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.dialog-head-text > .text-secondary {
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === 填写历史片段 (单格改动流水) === */
.min-w-0 { min-width: 0; }   /* Tabler/BS5.0 无此工具类, 自备: 让 flex 子项内 text-truncate 生效 */
.history-item + .history-item { border-top: 1px solid var(--tblr-border-color, #e6e7e9); }

/* === HTMX 保存成功 row 短暂高亮 1.5s 渐隐 === */
tr.row-just-saved {
  background: var(--tblr-success-lt, #d1fae5) !important;
  transition: background 1.5s ease;
}

/* === 列表当前选中行 (右侧 dialog 打开的商品): 加深底 + 左侧主色条, 一眼看出选中谁 === */
#sku-tbody tr.row-active > td { background: var(--tblr-primary-lt, #dbeafe) !important; }
#sku-tbody tr.row-active > td:first-child { box-shadow: inset 4px 0 0 var(--tblr-primary, #206bc4); }
#sku-tbody tr.row-active > td code { background: rgba(255, 255, 255, 0.6); }

/* === 左表独立滚动: 页面整体固定, 只表格区内部滚动 ("下一个未填" 跳转不再整页刷动) === */
@media (min-width: 992px) {
  .sku-table-scroll { max-height: calc(100vh - 23rem); overflow-y: auto; }
  /* 滚动时表头固定可见 */
  .sku-table-scroll thead th {
    position: sticky; top: 0; z-index: 2;
    background: var(--tblr-bg-surface, #fff);
  }
}

/* === 业务方智商 80: page-title 加大加粗便于扫描 === */
.page-title {
  font-size: 1.6rem !important;
  font-weight: 700 !important;
  margin-bottom: 4px;
}
.h2, h2 { font-size: 1.5rem; }
.h3, h3 { font-size: 1.2rem; }

/* === <details>/summary 作 admin 折叠卡片样式: 加 marker rotate === */
details.card summary { list-style: none; position: relative; padding-right: 32px; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after {
  content: "▸";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.2s ease;
  color: var(--tblr-muted, #6c757d);
}
details.card[open] summary::after { transform: translateY(-50%) rotate(90deg); }

/* === sidebar 强制占满视口 + 用户信息区底部对齐 === */
.navbar-vertical {
  min-height: 100vh;
  background: #182433;
  width: 15rem;                 /* 固定舒适宽度 (streamlit 风), 防窄栏把标题+徽标挤爆截断 */
}
.navbar-vertical > .container-fluid {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* !important 压过 Tabler 的 .navbar-expand-lg>.container-fluid padding:0 */
  padding-left: 1rem !important;   /* 左右页边距: 防 brand/用户区贴边裁切 + 给徽标右边留位 */
  padding-right: 1rem !important;
}
.navbar-vertical .user-info-block { margin-top: auto; }

/* sidebar 禁用项 (库存查询 / 看板 / AI 助手) 提对比度: Tabler 默认深底低透明灰太淡看不清 */
.navbar-vertical .nav-link.disabled {
  color: rgba(255, 255, 255, 0.5) !important;
  opacity: 1;
}
.navbar-vertical .nav-link.disabled .nav-link-icon { opacity: 0.85; }

/* "敬请期待" 徽标: 固定不缩 + 小字, 极窄时换行而非被截断 */
/* nav-link 左对齐 (Tabler 默认 justify-content:center 把图标缩到中间, 不像 streamlit 侧栏) */
.navbar-vertical .navbar-nav .nav-link { justify-content: flex-start !important; }
.navbar-vertical .nav-link .badge {
  flex-shrink: 0;               /* 徽标不被标题挤压 */
  align-self: center;           /* 跟标题垂直居中, 不悬右上角 */
  font-size: 10px;
  padding: 2px 6px;
  margin-left: auto;            /* 推到右侧 (容器 padding-right 给了 16px 余量, 不再溢出截断) */
}
.navbar-vertical .nav-link-title { white-space: nowrap; }

/* === 左侧菜单收起/展开 —— 功能走 base.html 的 inline JS (transform/margin/显隐用 inline
   !important, 不依赖本文件, 防 style.css 被浏览器缓存时失效)。这里只补过渡动画 + hover 增强。 === */
.page-wrapper { transition: margin-left .15s ease; }
.sidebar-toggle:hover { color: #fff !important; }
#sidebar-show:hover { background: #22303f !important; }

/* body 背景跟 page-body 区域一致 (Tabler 默认), 避免底部白条 */
body { background: var(--tblr-body-bg, #f5f7fb); }

/* === htmx-indicator 全局 spinner === */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: inline-block; }

/* === 首页 5 入口卡片: 可点卡 hover 微抬 + 禁用卡灰显无交互 === */
/* card-link-pop: 可点入口 (填表中心 / 管理后台) hover 抬升 + 主色描边 */
.card-link-pop {
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.card-link-pop:hover { color: inherit; }
.card-link-pop:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: var(--tblr-primary, #206bc4);
}
/* card-disabled: 敬请期待卡片 灰显 + 禁止 hover 抬升 + not-allowed 光标 */
.card-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--tblr-bg-surface-secondary, #f1f3f5);
}
.card-disabled:hover {
  transform: none;
  box-shadow: var(--tblr-card-box-shadow);
  border-color: var(--tblr-border-color, #e6e7e9);
}

/* === AI assistant chat entry === */
.page-body:has(.ai-shell) {
  height: 100dvh;
  margin: 0;
  overflow: hidden;
}
/* /ai 页视口锁高：百分比高度链在 auto 高的 .page-body 处断裂锚不到视口，
   改从 .page 锚 100dvh 走整条 flex 链——页面本身不滚，只有 .ai-thread 滚、输入区钉底。 */
.page:has(.ai-shell) {
  height: 100dvh;
}
.page:has(.ai-shell) .page-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.page:has(.ai-shell) .page-body {
  margin-top: 0;
  margin-bottom: 0;
  min-height: 0;
}
.page-body:has(.ai-shell) > .container-fluid {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.ai-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}
.ai-chat-card {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: #fff;
  border: 1px solid var(--tblr-border-color, #e6e7e9);
  border-radius: 8px;
  box-shadow: var(--tblr-card-box-shadow);
  overflow: hidden;
}
.ai-chat-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--tblr-border-color, #e6e7e9);
  background: #fbfcfe;
}
.ai-chat-title {
  font-size: 1.05rem;
  line-height: 1.2;
}
.ai-chat-subtitle {
  color: var(--tblr-muted, #667382);
  font-size: .8125rem;
}
.ai-avatar {
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.05rem;
}
.ai-avatar-assistant {
  color: #0f766e;
  background: #ccfbf1;
}
.ai-thread {
  min-height: 0;
  padding: 1.25rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #f7f8fa;
}
.ai-history-search {
  border-bottom: 1px solid var(--tblr-border-color, #e6e7e9);
  background: #fff;
}
.ai-history-search-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .45rem;
  padding: .7rem 1.25rem;
}
.ai-history-search-form > i {
  color: var(--tblr-muted, #667382);
}
.ai-history-search-form .form-control {
  min-height: 2rem;
  padding: .35rem .5rem;
  border: 0;
  box-shadow: none;
  background: #f7f8fa;
}
.ai-history-search-results:not(:empty) {
  max-height: 11rem;
  overflow-y: auto;
  padding: 0 1.25rem .75rem;
}
.ai-search-count,
.ai-search-empty {
  color: var(--tblr-muted, #667382);
  font-size: .8125rem;
}
.ai-search-empty {
  padding: .35rem .55rem;
}
.ai-search-hit {
  border: 1px solid var(--tblr-border-color, #e6e7e9);
  border-radius: 6px;
  background: #fbfcfe;
}
.ai-search-hit + .ai-search-hit,
.ai-search-count + .ai-search-hit {
  margin-top: .4rem;
}
.ai-search-hit summary {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .55rem;
  cursor: pointer;
  list-style: none;
}
.ai-search-hit summary::-webkit-details-marker {
  display: none;
}
.ai-search-role {
  flex: 0 0 auto;
  color: #206bc4;
  font-size: .75rem;
  font-weight: 700;
}
.ai-search-snippet {
  min-width: 0;
  color: #1f2937;
  font-size: .8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-search-full {
  border-top: 1px solid var(--tblr-border-color, #e6e7e9);
  padding: .55rem .65rem .65rem;
  color: #1f2937;
  background: #fff;
  font-size: .875rem;
}
.ai-history-more {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--tblr-muted, #667382);
  font-size: .8125rem;
}
.ai-history-note {
  margin-bottom: 1rem;
  padding: .55rem .75rem;
  border: 1px solid var(--tblr-border-color, #e6e7e9);
  border-radius: 6px;
  color: #4b5563;
  background: #fff;
  font-size: .8125rem;
}
.ai-history-note-warn {
  border-color: #f59f00;
  background: #fff8e6;
}
.ai-history-end {
  padding: .25rem 0;
}
.ai-message {
  display: flex;
  gap: .75rem;
  margin-bottom: 1rem;
}
.ai-message-user {
  justify-content: flex-end;
}
.ai-bubble {
  max-width: min(760px, 84%);
  border-radius: 8px;
  padding: .875rem 1rem;
  overflow-wrap: anywhere;
}
.ai-bubble-assistant {
  color: #1f2937;
  background: #fff;
  border: 1px solid var(--tblr-border-color, #e6e7e9);
}
.ai-bubble-user {
  color: #fff;
  background: #206bc4;
}
.ai-bubble-warn {
  border-color: #f59f00;
  background: #fff8e6;
}
.ai-bubble-danger {
  border-color: #d63939;
  background: #fff5f5;
}
.ai-message-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .5rem;
  color: #4b5563;
  font-size: .8125rem;
  font-weight: 600;
}
.ai-request-id {
  color: var(--tblr-muted, #667382);
  font-size: .72rem;
  font-weight: 400;
}
.ai-answer-text {
  line-height: 1.65;
}
.ai-answer-plain {
  white-space: pre-wrap;
}
.episode-governance-item summary {
  cursor: pointer;
}
.episode-governance-preview {
  max-width: 100%;
}
.episode-governance-content {
  line-height: 1.6;
  white-space: pre-wrap;
}
.ai-answer-text > :first-child {
  margin-top: 0;
}
.ai-answer-text > :last-child {
  margin-bottom: 0;
}
.ai-answer-text p,
.ai-answer-text ul,
.ai-answer-text ol,
.ai-answer-text blockquote,
.ai-answer-text pre,
.ai-answer-text table {
  margin: 0 0 .75rem;
}
.ai-answer-text h1,
.ai-answer-text h2,
.ai-answer-text h3,
.ai-answer-text h4,
.ai-answer-text h5,
.ai-answer-text h6 {
  margin: 1rem 0 .45rem;
  line-height: 1.35;
}
.ai-answer-text h1 { font-size: 1.35rem; }
.ai-answer-text h2 { font-size: 1.2rem; }
.ai-answer-text h3 { font-size: 1.08rem; }
.ai-answer-text h4,
.ai-answer-text h5,
.ai-answer-text h6 { font-size: 1rem; }
.ai-answer-text ul,
.ai-answer-text ol {
  padding-left: 1.5rem;
}
.ai-answer-text blockquote {
  padding: .25rem 0 .25rem .8rem;
  border-left: 3px solid var(--tblr-border-color, #d9dee3);
  color: var(--tblr-muted, #667382);
}
.ai-answer-text code {
  padding: .1rem .3rem;
  border-radius: 4px;
  background: #f1f3f5;
  color: #b42318;
  font-size: .88em;
}
.ai-answer-text pre {
  overflow-x: auto;
  padding: .75rem;
  border-radius: 6px;
  background: #f6f8fa;
}
.ai-answer-text pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}
.ai-answer-text table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}
.ai-answer-text th,
.ai-answer-text td {
  padding: .4rem .6rem;
  border: 1px solid var(--tblr-border-color, #d9dee3);
  text-align: left;
}
.ai-answer-text th {
  background: #f6f7f9;
  font-weight: 600;
}
.ai-answer-text hr {
  margin: 1rem 0;
  border-color: var(--tblr-border-color, #d9dee3);
}
.ai-term-list {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .75rem;
}
.ai-actions {
  margin-top: .85rem;
}
.ai-file-card {
  display: flex;
  align-items: center;
  gap: .5rem;
  max-width: 420px;
  margin-top: .5rem;
  padding: .5rem .75rem;
  border: 1px solid #d7dce3;
  border-radius: .5rem;
  background: #f6f8fa;
  color: #1f2937;
  font-size: .82rem;
  text-decoration: none;
}
.ai-file-card:hover {
  border-color: #9db8e8;
  background: #f0f5ff;
  color: #1f2937;
  text-decoration: none;
}
.ai-file-card > .ti:first-child {
  color: #2563eb;
  font-size: 1.25rem;
}
.ai-file-card-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-file-card-download {
  margin-left: auto;
  color: #6b7280;
}
.ai-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  margin-top: .75rem;
  color: var(--tblr-muted, #667382);
  font-size: .78rem;
}
/* L2 探索级：与 L1 视觉不可混淆（橙色未核验横幅 + 紧凑数据表）。 */
.ai-tier-banner {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .35rem .6rem;
  margin-bottom: .6rem;
  padding: .4rem .6rem;
  border-left: 3px solid #f59f00;
  background: #fff8e6;
  border-radius: 4px;
}
.ai-tier-hint {
  color: #8a6d1f;
  font-size: .78rem;
}
.ai-data-table-wrap {
  margin-top: .75rem;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--tblr-border-color, #e6e7e9);
  border-radius: 6px;
}
.ai-data-table {
  margin-bottom: 0;
  font-size: .82rem;
}
.ai-data-table th {
  position: sticky;
  top: 0;
  background: #f6f7f9;
  white-space: nowrap;
}
.ai-composer-wrap {
  position: relative;
  z-index: 1;
  padding: .9rem 1.25rem 1.1rem;
  border-top: 1px solid var(--tblr-border-color, #e6e7e9);
  background: #fff;
}
.ai-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: end;
  gap: .6rem;
  padding: .45rem;
  border: 1px solid var(--tblr-border-color, #d9dee3);
  border-radius: 8px;
  background: #fff;
}
.ai-attach {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: var(--tblr-muted, #667382);
  background: transparent;
}
.ai-attach:hover {
  color: #206bc4;
  background: #f1f5f9;
}
.ai-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.ai-attachments:not(:empty) {
  margin-bottom: .55rem;
}
.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  max-width: 100%;
  padding: .25rem .55rem;
  border: 1px solid var(--tblr-border-color, #d9dee3);
  border-radius: 999px;
  background: #f7f8fa;
  font-size: .8125rem;
  color: #1f2937;
  overflow-wrap: anywhere;
}
.ai-chip-warn {
  border-color: #f59f00;
  background: #fff8e6;
}
.ai-chip-remove {
  border: 0;
  padding: 0 .15rem;
  background: transparent;
  color: var(--tblr-muted, #667382);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.ai-chip-remove:hover {
  color: #d63939;
}
.ai-dropzone-active {
  outline: 2px dashed #206bc4;
  outline-offset: -6px;
}
.ai-bubble-file {
  margin-top: .3rem;
  font-size: .8125rem;
  opacity: .92;
}
.ai-question {
  min-height: 2.4rem;
  max-height: 8.75rem;
  resize: none;
  border: 0;
  box-shadow: none !important;
  padding: .55rem .6rem;
  background: transparent;
}
.ai-send {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ai-loading.htmx-indicator {
  display: none;
}
.htmx-request .ai-loading.htmx-indicator,
.ai-loading.htmx-request {
  display: inline-flex;
}
.ai-loading {
  width: 2.4rem;
  height: 2.4rem;
  align-items: center;
  justify-content: center;
}
@media (max-width: 575.98px) {
  .page-body:has(.ai-shell) > .container-fluid {
    padding: 0;
  }
  .ai-shell {
    max-width: none;
  }
  .ai-chat-card {
    border-radius: 0;
  }
  .ai-thread,
  .ai-chat-header,
  .ai-composer-wrap,
  .ai-history-search-form {
    padding-left: .85rem;
    padding-right: .85rem;
  }
  .ai-history-search-results:not(:empty) {
    padding-left: .85rem;
    padding-right: .85rem;
  }
  .ai-bubble {
    max-width: 88%;
  }
  .ai-message-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: .25rem;
  }
}

/* === 月更预填建议: 行内"建议 N"提示 (dialog 内建议直接预填进输入框, 无独立卡片);
       low 置信 (线上 C 档新品) 弱化 === */
.prefill-hint { color: var(--tblr-azure, #467fcf); }
.prefill-hint.prefill-low { color: var(--tblr-secondary, #6c757d); opacity: .7; }

/* === 库存查询 表头点击排序: 可点感 (指针 + hover 主色) + 当前列箭头醒目, 其余列灰 ⇅ 暗示可点 === */
.th-sort { cursor: pointer; user-select: none; }
.th-sort:hover { color: var(--tblr-primary, #206bc4); }
.th-sort .th-sort-idle { opacity: .3; font-size: .85em; transition: opacity .12s ease; }
.th-sort:hover .th-sort-idle { opacity: .6; }
.th-sort .th-sort-active { color: var(--tblr-primary, #206bc4); font-size: .9em; }
/* 键盘焦点可见环 (focus-states): span[role=button] 默认无焦点框, 补上 */
.th-sort:focus-visible { outline: 2px solid var(--tblr-primary, #206bc4); outline-offset: 2px; border-radius: 3px; }
/* 数量/日期列等宽数字 (number-tabular): 列内数字右对齐时对齐、排序切换不抖 */
.tnum td, .tnum th { font-variant-numeric: tabular-nums; }
/* 截断提示深琥珀: 对白底 ≥4.5:1 (亮橙 text-warning 仅 3:1 不达标 WCAG AA) */
.inv-trunc-note { color: #b45309; }

/* === 公共切片器 (_macros/slicers.html) === */
details.slicer-dd { position: relative; }
details.slicer-dd > summary { list-style: none; }
details.slicer-dd > summary::-webkit-details-marker { display: none; }
.slicer-dd-menu {
  position: absolute;
  z-index: 1050;
  margin-top: .25rem;
  min-width: 100%;
  max-width: 22rem;
}
.slicer-dd-list { max-height: 16rem; overflow-y: auto; padding: .25rem 0; }
.slicer-dd-item {
  display: block;
  cursor: pointer;
  white-space: nowrap;
  padding: .25rem .75rem .25rem 2.25rem;
}
.slicer-dd-item:hover { background: var(--tblr-active-bg, #f1f5f9); }

/* === 折叠卡 (details 直接当 card 用, summary 当 card-header): 去浏览器默认三角 === */
details.details-card > summary { list-style: none; }
details.details-card > summary::-webkit-details-marker { display: none; }
details.details-card[open] > summary .details-card-chevron { transform: rotate(180deg); }
.details-card-chevron { transition: transform .15s ease; }

/* === 清货库存页 === */
.clearance-summary-card,
.clearance-total-card { height: 100%; }
.clearance-total-card { border-color: rgba(32, 107, 196, .35); background: #fbfdff; }
.clearance-money {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.clearance-table th,
.clearance-table td { white-space: nowrap; }
.clearance-column-trigger {
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
}
.clearance-column-trigger.clearance-column-active { color: var(--tblr-primary, #206bc4); }
.clearance-column-filter-bar { background: var(--tblr-bg-surface-secondary, #f6f8fb); }
.clearance-column-dialog::backdrop { background: rgba(24, 36, 51, .35); }

/* 关着的 <dialog> 必须不可见 (ops #1453)。
   UA 样式表本来就有 dialog:not([open]){display:none}，但那是 UA 层，任何**作者**样式
   都能盖过它——Tabler 的 .card{display:flex} 就盖了：/clearance 的列操作弹窗带着 card 类，
   于是页面一加载、零点击就常驻在正中间压住 KPI 卡片，生产上这样待了从 8c464a4 起的整段时间。
   在作者层把这条标准语义还回来，一条规则覆盖全部 dialog（现有的和以后新加的）。
   特指度 (0,1,1) 高于 .card 的 (0,1,0)，且本文件在 tabler.min.css 之后加载，故无需 !important；
   判据焊在 tests/test_dialog_closed_is_hidden.py，那里直接解 display 的级联胜出者。 */
dialog:not([open]) { display: none; }
.clearance-table .clearance-name {
  min-width: 18rem;
  max-width: 34rem;
  white-space: normal;
}
@media (max-width: 575.98px) {
  .clearance-money { font-size: 1.15rem; }
  .clearance-table .clearance-name { min-width: 15rem; }
}

.meeting-summary {
  line-height: 1.65;
}
.meeting-summary h3 {
  font-size: 1.05rem;
  margin: 0 0 .75rem;
}
.meeting-summary h4 {
  font-size: .95rem;
  margin: 1rem 0 .35rem;
}
.meeting-summary p,
.meeting-summary ul,
.meeting-summary blockquote {
  margin-bottom: .75rem;
}
.meeting-summary ul {
  padding-left: 1.2rem;
}
.meeting-summary blockquote {
  border-left: 3px solid var(--tblr-primary);
  color: var(--tblr-secondary);
  padding: .5rem .75rem;
  background: var(--tblr-bg-surface-secondary);
  border-radius: 4px;
}
.transcript-search-tools {
  max-width: 30rem;
  min-width: min(100%, 22rem);
}
[data-transcript-row] {
  scroll-margin-top: 1rem;
}
.meeting-transcript-row-hit {
  background: #fff9db;
}
.meeting-transcript-row-playing {
  background: var(--tblr-primary-lt, #e9f2ff);
  box-shadow: inset 3px 0 var(--tblr-primary, #206bc4);
}
.transcript-seek {
  min-width: 5.75rem;
  white-space: nowrap;
}
.meeting-transcript-hit {
  background: #ffe58f;
  border-radius: 2px;
  color: inherit;
  padding: 0 .08rem;
}
.meeting-transcript-hit-active {
  background: #f76707;
  color: #fff;
}
@media (max-width: 767.98px) {
  .transcript-search-tools {
    max-width: none;
    width: 100%;
  }
}

/* === 跨页 (hx-boost) 顶部加载条: 点菜单后服务端约 0.5s 渲染期间给"加载中"反馈, 不再像卡死 ===
   仅跨页 boost 导航显示 (JS 在 .navbar-nav boost 请求时挂 .loading); 页内高频小请求不显示。 */
#nav-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 2000; pointer-events: none; overflow: hidden;
  opacity: 0; transition: opacity .15s ease;
}
#nav-progress.loading { opacity: 1; }
#nav-progress::before {
  content: ""; position: absolute; top: 0; height: 100%; width: 35%; left: -35%;
  background: var(--tblr-primary, #206bc4); border-radius: 0 3px 3px 0;
}
#nav-progress.loading::before { animation: nav-progress-slide 1.1s cubic-bezier(.4, 0, .2, 1) infinite; }
@keyframes nav-progress-slide {
  0%   { left: -35%; width: 35%; }
  55%  { left: 55%;  width: 45%; }
  100% { left: 100%; width: 35%; }
}
/* a11y: 减少动效时不滑动, 用静态半透明条表示忙 */
@media (prefers-reduced-motion: reduce) {
  #nav-progress.loading::before { animation: none; left: 0; width: 100%; opacity: .6; }
}

/* === 跨页内容切换淡入淡出 (hx-boost + hx-swap transition:true → htmx 同文档 view-transition) ===
   内容"淡进来"而非"啪一下换"; 仅 boost 导航触发 (页内 swap 不带 transition, 仍即时)。
   减少动效偏好时关掉过渡动画 (a11y)。 */
/* 淡入节奏: 浏览器默认 ~.25s 偏快, 放慢到 .45s 更柔和 (只影响 nav 的 root 过渡) */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .45s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* Keep collapsed product rows compact; quantities live in the expanded detail. */
.bandai-product-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: .75rem;
  align-items: center;
}
.bandai-product-identity { min-width: 0; }
.bandai-product-summary > .badge { justify-self: end; }

.bandai-attainment-summary {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) repeat(3, minmax(90px, .7fr)) minmax(70px, .45fr);
  gap: 1rem;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.bandai-attainment-summary::-webkit-details-marker { display: none; }
.bandai-attainment-person { min-width: 0; }
.bandai-attainment-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.bandai-attainment-metric span { color: var(--tblr-secondary); font-size: .75rem; }
.bandai-attainment-rate { font-size: 1.15rem; font-weight: 700; text-align: right; }

@media (max-width: 991.98px) {
  .bandai-attainment-summary {
    grid-template-columns: minmax(150px, 1fr) repeat(2, minmax(80px, auto));
  }
  .bandai-attainment-rate { grid-column: 3; }
}

@media (max-width: 575.98px) {
  .bandai-attainment-summary { grid-template-columns: minmax(0, 1fr) auto; }
  .bandai-attainment-metric:nth-of-type(3),
  .bandai-attainment-metric:nth-of-type(4) { display: none; }
  .bandai-attainment-rate { grid-column: 2; grid-row: 1; }
}
.metabase-embed-frame {
  width: 100%;
  min-height: 720px;
  height: calc(100vh - 170px);
  border: 0;
  background: #fff;
}

@media (max-width: 767.98px) {
  .metabase-embed-frame {
    min-height: 640px;
    height: calc(100vh - 150px);
  }
}

/* toast 纯状态展示(无按钮,3s 自消),不许挡任何可点元素 (ops #1418:
   手机上底部 toast 盖住弹窗的"保存并下一个") */
#toast-container,
#toast-container .toast { pointer-events: none; }
/* 窄屏 toast 挪顶部: 底部正是弹窗按钮区 */
@media (max-width: 991.98px) {
  #toast-container { bottom: auto !important; top: 0; }
}

/* 原因码单选触控目标加大 (ops #1418: 手机上改完数量软键盘还开着,
   第一下点选项常被键盘收起吃掉——目标越小越容易"以为勾了其实没勾") */
#adjust-reason-fields label {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .75rem; margin: 0;
  border: 1px solid var(--tblr-border-color, #dadfe5);
  border-radius: .5rem; cursor: pointer; user-select: none;
}
#adjust-reason-fields label:has(input:checked) {
  border-color: var(--tblr-primary, #206bc4);
  background: rgba(32, 107, 196, .08);
}
