:root{
    --paper:#F5F7FA;
    --card:#FFFFFF;
    --ink:#0F172A;
    --ink-soft:#475467;
    --ink-faint:#94A3B8;
    --violet:#2563EB;
    --indigo:#1D4ED8;
    --line:#E2E8F0;
    --line-strong:#CBD5E1;
    --risk-low:#15803D;
    --risk-low-bg:#E7F5EC;
    --risk-mid:#B45309;
    --risk-mid-bg:#FCF1E1;
    --risk-high:#B91C1C;
    --risk-high-bg:#FBEAEA;
    --radius-lg:20px;
    --radius-md:14px;
    --shadow:0 1px 2px rgba(15,23,42,0.04), 0 12px 32px -16px rgba(15,23,42,0.14);
    --gm:linear-gradient(135deg,var(--violet),var(--indigo));
  }

  *{box-sizing:border-box;}
  html{scroll-behavior:smooth;}
  body{
    margin:0;
    background:var(--paper);
    color:var(--ink);
    font-family:"Noto Sans TC","Space Grotesk",sans-serif;
    -webkit-font-smoothing:antialiased;
    padding-top:76px;
    padding-bottom:76px;
  }
  @media (max-width:420px){
    body{ padding-top:66px; }
  }
  h1,h2,h3{
    font-family:"Noto Sans TC","Space Grotesk",sans-serif;
    font-weight:700;
    margin:0;
    letter-spacing:0.01em;
  }
  .num,.eyebrow,.tag,.stat b,.risk,button,.brand-en,.console-status span,.meta span{
    font-family:"Space Grotesk","Noto Sans TC",sans-serif;
  }
  p{margin:0;}
  a{color:inherit;}
  :focus-visible{outline:2px solid var(--violet); outline-offset:3px; border-radius:4px;}

  /* ---------- Header ---------- */
  .site-header{
    position:fixed; top:0; left:0; right:0; z-index:50;
    height:76px;
    display:flex; align-items:center; gap:12px;
    padding:0 20px;
    background:rgba(245,247,250,0.9);
    backdrop-filter:blur(10px) saturate(1.1);
    border-bottom:1px solid var(--line);
  }
  @media (max-width:420px){
    .site-header{ height:66px; }
  }
  .site-header img{
    height:54px; width:54px; object-fit:contain; flex-shrink:0;
  }
  @media (max-width:420px){
    .site-header img{ height:42px; width:42px; }
  }
  .brand{display:flex; flex-direction:column; line-height:1.15;}
  .brand-name{font-family:"Noto Serif TC",serif; font-weight:700; font-size:16px; letter-spacing:0.02em;}
  .brand-en{font-size:9.5px; letter-spacing:0.18em; color:var(--ink-faint); text-transform:uppercase;}
  .header-meta{
    margin-left:auto; text-align:right;
    font-size:12px; color:var(--ink-soft);
    display:none;
  }
  .header-meta b{color:var(--ink); font-weight:600;}

  /* ---------- Layout shells ---------- */
  main{max-width:1160px; margin:0 auto; padding:0 20px;}
  .eyebrow{
    font-size:11px; font-weight:600; letter-spacing:0.16em; text-transform:uppercase;
    color:var(--violet); display:inline-flex; align-items:center; gap:8px; margin-bottom:14px;
  }
  .eyebrow::before{content:""; width:14px; height:1px; background:var(--violet); display:inline-block;}

  /* ---------- Chairman Workspace (V8) ---------- */
  .ws-head h1{
    font-size:clamp(22px,3.6vw,28px);
    line-height:1.3;
    color:var(--ink);
    margin-top:2px;
  }
  @keyframes blink{0%,100%{opacity:1;}50%{opacity:.35;}}

  /* ---------- V42: 部門即時狀態縮小成快速燈號列（尺寸看齊 .quick-nav）---------- */
  .ws-block-lights .ws-block-title{margin-bottom:8px;}
  .ws-block-lights .ws-block-note a{color:var(--violet); font-weight:600; text-decoration:none; border-bottom:1px solid transparent;}
  .ws-block-lights .ws-block-note a:hover{border-bottom-color:var(--violet);}
  .lights-grid{
    display:flex; flex-wrap:wrap; gap:6px;
  }
  .light-pill{
    display:inline-flex; align-items:center; gap:4px; flex-shrink:0;
    font-size:11.5px; font-weight:600; color:var(--ink-soft);
    background:var(--card); border:1px solid var(--line-strong); border-radius:999px;
    padding:6px 11px; text-decoration:none; white-space:nowrap;
    transition:border-color .15s ease, color .15s ease, transform .15s ease;
  }
  .light-pill:hover{border-color:var(--violet); color:var(--violet); transform:translateY(-1px);}
  .light-pill .stat-dot{margin-right:0;}
  .light-pill-label{white-space:nowrap;}

  .console{
    background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg);
    box-shadow:var(--shadow); overflow:hidden;
  }
  .console-head{
    display:flex; align-items:center; gap:8px;
    padding:14px 18px; border-bottom:1px solid var(--line);
    font-size:13px; font-weight:600;
  }
  .console-head .dot{width:7px; height:7px; border-radius:50%; background:var(--risk-low); box-shadow:0 0 0 3px var(--risk-low-bg);}
  .console-head span.role-en{margin-left:auto; font-size:10.5px; color:var(--ink-faint); font-weight:500; letter-spacing:0.06em;}
  /* V75：跟總經理下指令——手動清除幾天前的舊對話 */
  .console-clear-group{margin-left:auto; display:flex; align-items:center; gap:6px; flex-shrink:0;}
  .console-clear-select{
    font-size:11px; font-weight:600; color:var(--ink-soft); background:var(--paper);
    border:1px solid var(--line-strong); border-radius:8px; padding:5px 6px; cursor:pointer;
  }
  .console-clear-btn{
    font-size:11px; font-weight:600; color:var(--ink-soft); background:var(--card);
    border:1px solid var(--line-strong); border-radius:8px; padding:5px 10px; cursor:pointer;
    white-space:nowrap; transition:border-color .15s ease, color .15s ease;
  }
  .console-clear-btn:hover{border-color:var(--risk-high); color:var(--risk-high);}
  .console-clear-btn:disabled{opacity:.5; cursor:wait;}

  .console-log{padding:18px; display:flex; flex-direction:column; gap:14px; max-height:340px; overflow-y:auto;}

  .briefing-card{
    background:linear-gradient(180deg, var(--risk-mid-bg), var(--card) 70%);
    border:1px solid var(--line-strong); border-radius:14px; padding:14px 16px;
  }
  .briefing-top{display:flex; align-items:center; gap:10px;}
  .briefing-title{font-family:"Noto Serif TC",serif; font-weight:700; font-size:13px;}
  .briefing-sub{font-size:11px; color:var(--ink-faint); margin-top:1px;}
  .briefing-list{margin:11px 0 0; padding-left:18px; display:flex; flex-direction:column; gap:6px;}
  .briefing-list li{font-size:12px; line-height:1.6; color:var(--ink-soft);}
  .briefing-list b{color:var(--ink); font-weight:700;}
  .msg{max-width:88%; display:flex; flex-direction:column; gap:4px;}
  .msg-role{font-size:10.5px; font-weight:600; letter-spacing:0.06em; color:var(--ink-faint);}
  .msg p{font-size:13.5px; line-height:1.75; padding:11px 14px; border-radius:14px;}
  .msg-user{align-self:flex-end; align-items:flex-end;}
  .msg-user p{background:var(--ink); color:#fff; border-bottom-right-radius:4px;}
  .msg-gm{align-self:flex-start;}
  .msg-gm p{background:var(--paper); border:1px solid var(--line); border-bottom-left-radius:4px;}
  .risk{
    display:inline-flex; align-items:center; padding:1.5px 8px; border-radius:999px;
    font-size:11px; font-weight:600; letter-spacing:0.03em; font-style:normal;
  }
  .risk-low{color:var(--risk-low); background:var(--risk-low-bg);}
  .risk-mid{color:var(--risk-mid); background:var(--risk-mid-bg);}
  .risk-high{color:var(--risk-high); background:var(--risk-high-bg);}
  .msg-gm p.gm-risk-reason{
    margin-top:6px; font-size:11.5px; color:var(--ink-faint); line-height:1.6;
    background:none; border:none; padding:0;
  }
  .msg-gm p.gm-attach-note{
    margin-top:6px; font-size:11.5px; color:var(--ink-faint); line-height:1.6;
    background:none; border:none; padding:0; font-style:italic;
  }

  /* ---------- V22: 部門子任務執行結果卡片 ---------- */
  .subtask-card{
    align-self:flex-start; max-width:88%;
    background:var(--card); border:1px solid var(--line); border-left:3px solid var(--violet);
    border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; gap:7px;
  }
  .subtask-top{display:flex; align-items:center; gap:9px;}
  .subtask-role{font-size:12.5px; font-weight:700; color:var(--ink);}
  .subtask-nick{font-size:11px; font-weight:600; color:var(--violet); margin-left:5px;}
  .subtask-dept{font-size:10.5px; color:var(--ink-faint); margin-top:1px;}
  .subtask-task{font-size:11.5px; color:var(--ink-soft); line-height:1.6;}
  .subtask-result{
    font-size:13px; line-height:1.75; color:var(--ink); background:var(--paper);
    border-radius:9px; padding:9px 11px; margin:0;
  }

  /* ---------- V32: 對話框裡的「已建立正式任務」提示卡片 ---------- */
  .task-created-notice{
    align-self:flex-start; max-width:88%; display:flex; gap:10px; align-items:flex-start;
    background:var(--card); border:1px solid var(--line); border-left:3px solid var(--gm);
    border-radius:12px; padding:12px 14px;
  }
  .task-created-icon{font-size:18px; flex-shrink:0; margin-top:1px;}
  .task-created-title{font-size:12.5px; font-weight:700; color:var(--ink);}
  .task-created-sub{font-size:11.5px; color:var(--ink-soft); line-height:1.6; margin-top:3px;}
  .task-created-sub a{color:var(--violet); font-weight:600; text-decoration:none;}
  .task-created-sub a:hover{text-decoration:underline;}

  .console-input{display:flex; gap:8px; padding:14px 18px; border-top:1px solid var(--line); align-items:flex-end;}
  .console-input textarea{
    flex:1; border:1px solid var(--line-strong); border-radius:10px; padding:11px 13px;
    font-size:13.5px; font-family:inherit; background:var(--paper); color:var(--ink);
    resize:none; line-height:1.45; max-height:160px; overflow-y:hidden;
  }
  .console-input textarea::placeholder{color:var(--ink-faint);}
  .console-input > button{
    border:none; border-radius:10px; padding:0 18px; min-height:41px; color:#fff; font-size:13px; font-weight:600;
    background:var(--gm); cursor:pointer; letter-spacing:0.02em; white-space:nowrap;
    transition:opacity .15s ease, transform .15s ease;
  }
  .console-input > button:hover{opacity:0.9;}
  .console-input > button:active{transform:scale(0.97);}

  @media (min-width:860px){
    .header-meta{display:block;}
  }

  /* ---------- Org section ---------- */
  .org{padding:24px 0 60px;}
  .org-head{margin-bottom:28px;}
  .org-head h2{font-size:clamp(22px,3.4vw,30px);}
  .risk-legend{margin-top:14px; font-size:12px; color:var(--ink-soft); display:flex; align-items:center; gap:8px; flex-wrap:wrap;}

  .org-toggle{
    margin-top:18px; display:inline-flex; align-items:center; gap:8px;
    border:1px solid var(--line-strong); background:var(--card); color:var(--violet);
    font-family:inherit; font-size:12.5px; font-weight:600; border-radius:10px; padding:9px 15px;
    cursor:pointer; transition:border-color .15s ease, background .15s ease;
  }
  .org-toggle:hover{border-color:var(--violet); background:var(--paper);}
  .org-toggle .chevron{width:15px; height:15px; transition:transform .25s ease;}
  .org-toggle[aria-expanded="true"] .chevron{transform:rotate(180deg);}

  .org-grid{
    position:relative;
    max-width:760px;
    padding-left:30px;
  }
  .org-grid::before{
    content:""; position:absolute; left:9px; top:6px; bottom:6px; width:2px;
    background:linear-gradient(180deg,var(--violet),var(--indigo));
    transform-origin:top; transform:scaleY(0); transition:transform 1.1s cubic-bezier(.2,.7,.2,1);
  }
  .org-grid.in-view::before{transform:scaleY(1);}

  details.dept{
    position:relative;
    border-bottom:1px solid var(--line);
    padding:20px 0;
    opacity:0; transform:translateY(8px);
    transition:opacity .5s ease, transform .5s ease;
  }
  .org-grid.in-view details.dept{opacity:1; transform:translateY(0);}
  details.dept:first-of-type{padding-top:4px;}

  details.dept::after{
    content:""; position:absolute; left:-30px; top:26px;
    width:9px; height:9px; border-radius:50%;
    background:var(--paper); border:2px solid var(--violet);
  }
  details.dept[open]::after{background:var(--gm); border-color:transparent;}

  details.dept summary{
    list-style:none; cursor:pointer; display:flex; align-items:flex-start; gap:14px;
  }
  details.dept summary::-webkit-details-marker{display:none;}

  .dept-head{flex:1; min-width:0;}
  .dept-top{display:flex; align-items:baseline; gap:9px; flex-wrap:wrap;}
  .dept-num{font-size:11px; color:var(--ink-faint); font-weight:600; letter-spacing:0.06em;}
  .dept-name{font-family:"Noto Serif TC",serif; font-weight:700; font-size:16.5px;}
  .dept-name-en{font-size:10px; color:var(--ink-faint); letter-spacing:0.08em; text-transform:uppercase;}
  .dept-desc{margin-top:5px; font-size:13px; color:var(--ink-soft); line-height:1.7; max-width:56ch; display:none;}
  details.dept[open] .dept-desc{display:block;}

  .chevron{
    flex-shrink:0; width:20px; height:20px; margin-top:4px; color:var(--ink-faint);
    transition:transform .25s ease;
  }
  details.dept[open] .chevron{transform:rotate(180deg); color:var(--violet);}

  .roles{
    margin:16px 0 2px 52px; display:flex; flex-direction:column; gap:11px;
  }
  .role{
    display:flex; gap:10px; padding:11px 14px; background:var(--paper);
    border:1px solid var(--line); border-radius:12px;
  }
  .role-mark{
    flex-shrink:0; width:5px; border-radius:3px; background:var(--gm); margin-top:2px;
  }
  .role-name{font-size:13.5px; font-weight:600;}
  .role-name-en{font-size:10px; color:var(--ink-faint); margin-left:6px; font-weight:500; letter-spacing:0.02em;}
  .role-fn{font-size:12.5px; color:var(--ink-soft); line-height:1.7; margin-top:3px;}

  @media (min-width:640px){
    .org-grid{max-width:none;}
    .roles{margin-left:52px;}
  }

  /* ---------- Footer ---------- */
  .site-footer{
    position:fixed; bottom:0; left:0; right:0; z-index:50;
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:12px 20px; height:52px;
    background:rgba(245,247,250,0.92);
    backdrop-filter:blur(10px) saturate(1.1);
    border-top:1px solid var(--line);
    font-size:11px; color:var(--ink-faint);
  }
  .site-footer .plate{color:var(--ink-soft); font-weight:600; letter-spacing:0.01em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  @media (max-width:420px){
    .site-footer .plate{font-size:10px;}
  }
  .site-footer .plate span{color:var(--ink-faint); font-weight:400;}
  .site-footer .meta{display:flex; gap:12px; align-items:center;}
  .site-footer .meta span{padding:3px 9px; border:1px solid var(--line-strong); border-radius:999px;}

  @media (prefers-reduced-motion:reduce){
    *{animation:none !important; transition:none !important;}
    .org-grid::before{transform:scaleY(1);}
    details.dept{opacity:1; transform:none;}
  }

  /* ---------- V2: head link ---------- */
  .head-link{
    margin-left:10px; font-size:11px; font-weight:600; color:var(--violet);
    text-decoration:none; border-bottom:1px solid transparent;
  }
  .head-link:hover{border-bottom-color:var(--violet);}

  /* ---------- V2: attachments (LINE-style) ---------- */
  .attach-wrap{position:relative; flex-shrink:0;}
  .attach-btn{
    flex-shrink:0; width:40px; height:40px; border-radius:10px;
    border:1px solid #C7D7FB; background:#EFF4FF; color:var(--violet);
    display:flex; align-items:center; justify-content:center; cursor:pointer;
    transition:background .15s ease, border-color .15s ease, transform .15s ease;
  }
  .attach-btn:hover{background:#E0EAFE; border-color:var(--violet);}
  .attach-btn:active{transform:scale(0.92);}
  .attach-btn svg{width:19px; height:19px; stroke:var(--violet);}
  .attach-btn.is-open{background:var(--violet); border-color:var(--violet); color:#fff;}
  .attach-btn.is-open svg{stroke:#fff;}

  .attach-menu{
    position:absolute; bottom:calc(100% + 10px); left:0; z-index:5;
    background:var(--card); border:1px solid var(--line-strong); border-radius:12px;
    box-shadow:0 10px 28px rgba(15,23,42,.18); padding:6px; display:flex; flex-direction:column; gap:2px;
    min-width:132px;
  }
  .attach-menu[hidden]{display:none;}
  .attach-menu button{
    display:flex; align-items:center; gap:9px; border:none; background:none; cursor:pointer;
    padding:8px 9px; border-radius:8px; font-size:12.5px; font-weight:600; color:var(--ink-soft);
    font-family:inherit; text-align:left; white-space:nowrap;
  }
  .attach-menu button:hover{background:var(--paper); color:var(--violet);}
  .attach-menu-icon{
    flex-shrink:0; width:26px; height:26px; border-radius:7px; background:var(--paper);
    display:flex; align-items:center; justify-content:center;
  }
  .attach-menu-icon svg{width:14px; height:14px;}

  .attach-preview{
    display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:0 18px 12px;
  }
  .attach-preview[hidden]{display:none;}
  .attach-preview.show{display:flex;}
  .attach-preview .chip{
    display:flex; align-items:center; gap:8px; background:var(--paper);
    border:1px solid var(--line-strong); border-radius:10px; padding:5px 9px 5px 5px;
    font-size:11.5px; color:var(--ink-soft);
  }
  .attach-preview .chip img,.attach-preview .chip video{
    width:34px; height:34px; object-fit:cover; border-radius:7px; display:block;
  }
  .attach-preview .chip button{
    border:none; background:none; color:var(--ink-faint); cursor:pointer; font-size:14px;
    line-height:1; padding:2px; font-family:inherit;
  }
  .attach-preview .chip button:hover{color:var(--risk-high);}
  .attach-preview-count{font-size:11px; color:var(--ink-faint); flex-basis:100%;}

  .msg-media-wrap{display:flex; flex-direction:column; gap:6px; align-items:flex-end;}
  .msg-gm .msg-media-wrap{align-items:flex-start;}
  .msg-media{
    max-width:220px; max-height:220px; border-radius:14px; display:block;
    border:1px solid var(--line);
  }
  video.msg-media{background:#000;}

  /* ---------- V2: Department live board ---------- */
  .board{padding:24px 0 8px;}
  .board-legend{
    margin-top:14px; font-size:12px; color:var(--ink-soft); display:flex; align-items:center;
    gap:14px; flex-wrap:wrap;
  }
  .stat-dot{
    display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:5px;
    vertical-align:middle; position:relative; top:-1px;
  }
  .stat-dot.s-working{background:var(--risk-low); box-shadow:0 0 0 3px var(--risk-low-bg);}
  .stat-dot.s-meeting{background:var(--risk-mid); box-shadow:0 0 0 3px var(--risk-mid-bg);}
  .stat-dot.s-idle{background:var(--ink-faint); box-shadow:0 0 0 3px var(--line);}
  .stat-dot.s-off{background:transparent; border:1.5px solid var(--line-strong);}
  .stat-dot.s-await{background:var(--violet); box-shadow:0 0 0 3px rgba(37,99,235,.18);}
  .stat-dot.s-blocked{background:var(--risk-high); box-shadow:0 0 0 3px var(--risk-high-bg);}

  .board-grid{
    margin-top:24px; display:grid; gap:14px; grid-template-columns:1fr;
  }
  @media (min-width:720px){ .board-grid{grid-template-columns:1fr 1fr;} }

  details.board-card{
    background:var(--card); border:1px solid var(--line); border-radius:var(--radius-md);
    box-shadow:var(--shadow); padding:16px 18px; transition:border-color .15s ease;
  }
  details.board-card[open]{border-color:var(--line-strong);}
  @keyframes bcFlash{0%{box-shadow:0 0 0 3px rgba(59,109,255,.55);} 100%{box-shadow:0 0 0 0 rgba(59,109,255,0);}}
  details.board-card.bc-flash{animation:bcFlash 1.6s ease-out;}
  details.dept.bc-flash{animation:bcFlash 1.6s ease-out; border-radius:12px;}

  /* ---------- Operations overview (chairman dashboard) ---------- */
  .overview{padding:34px 0 6px;}
  .overview-sync-status{margin-top:8px; font-size:11.5px; color:var(--ink-faint);}
  .overview-sync-status.is-error{color:var(--risk-high);}
  .overview-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(148px,1fr)); gap:12px; margin-top:16px;}
  .overview-card{
    background:#fff; border:1px solid var(--line); border-radius:14px; padding:16px 16px 14px;
  }
  .overview-label{font-size:11.5px; color:var(--ink-faint); font-weight:600; letter-spacing:0.02em;}
  .overview-num{font-family:"Noto Serif TC",serif; font-weight:700; font-size:22px; margin-top:4px; color:var(--ink);}
  .overview-num.is-up{color:#16A34A;}
  .overview-num.is-warn{color:#C1443F;}
  .overview-sub{font-size:11px; color:var(--ink-faint); margin-top:3px;}

  /* ---------- V76 追加：System Health Dashboard ---------- */
  .health-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(160px,1fr)); gap:12px; margin-top:16px;}
  .health-card{
    background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px 16px;
    display:flex; align-items:flex-start; gap:10px;
  }
  .health-card.is-down{border-color:var(--risk-high); background:var(--risk-high-bg);}
  .health-card.is-warn{border-color:var(--risk-mid); background:var(--risk-mid-bg);}
  .health-dot{
    width:11px; height:11px; border-radius:50%; margin-top:3px; flex-shrink:0;
    background:var(--risk-low);
  }
  .health-card.is-down .health-dot{background:var(--risk-high);}
  .health-card.is-warn .health-dot{background:var(--risk-mid);}
  .health-card-body{flex:1; min-width:0;}
  .health-card-name{font-weight:700; font-size:13px; color:var(--ink);}
  .health-card-status{font-size:11px; color:var(--ink-faint); margin-top:2px;}
  .health-card.is-down .health-card-status{color:var(--risk-high);}
  .health-card.is-warn .health-card-status{color:var(--risk-mid);}
  .health-extra{display:grid; grid-template-columns:repeat(auto-fit, minmax(220px,1fr)); gap:12px; margin-top:12px;}
  .health-extra-card{
    background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px 16px;
  }
  .health-extra-card.is-down{border-color:var(--risk-high); background:var(--risk-high-bg);}
  .health-extra-card.is-warn{border-color:var(--risk-mid); background:var(--risk-mid-bg);}

  details.board-card summary{list-style:none; cursor:pointer;}
  details.board-card summary::-webkit-details-marker{display:none;}

  .bc-top{display:flex; align-items:center; gap:10px;}
  .bc-name{font-family:"Noto Serif TC",serif; font-weight:700; font-size:14.5px;}
  .bc-status{
    margin-left:auto; display:flex; align-items:center; font-size:11px; color:var(--ink-soft);
    white-space:nowrap; flex-shrink:0;
  }
  .bc-chevron{width:16px; height:16px; margin-left:6px; color:var(--ink-faint); flex-shrink:0; transition:transform .2s ease;}
  details.board-card[open] .bc-chevron{transform:rotate(180deg); color:var(--violet);}

  .bc-task{font-size:12.5px; color:var(--ink-soft); margin-top:10px; line-height:1.65;}
  .bc-task b{color:var(--ink); font-weight:600;}
  .bc-meta{display:flex; justify-content:space-between; font-size:10.5px; color:var(--ink-faint); margin-top:9px;}
  .bc-bar{height:5px; border-radius:99px; background:var(--paper); border:1px solid var(--line); margin-top:6px; overflow:hidden;}
  .bc-bar-fill{height:100%; background:var(--gm); border-radius:99px;}

  .bc-log{margin-top:14px; padding-top:14px; border-top:1px dashed var(--line); display:flex; flex-direction:column; gap:9px;}
  .bc-log-item{display:flex; gap:8px; font-size:12px; line-height:1.65;}
  .bc-log-item .who{flex-shrink:0; font-weight:600; color:var(--violet); white-space:nowrap;}
  .bc-log-item .txt{color:var(--ink-soft);}
  .bc-log-item .t{flex-shrink:0; font-size:10px; color:var(--ink-faint); margin-left:auto; white-space:nowrap; padding-left:8px;}

  /* ---------- V32：AI 任務管理系統（Task Center） ---------- */
  .task-center{padding:24px 0 8px;}
  .task-sync-status{margin-top:10px; font-size:11.5px; color:var(--ink-faint);}
  .task-sync-status.is-error{color:var(--risk-high);}
  .task-empty{margin-top:18px; font-size:12.5px; color:var(--ink-faint); line-height:1.7;}

  /* V34：任務中心整區移到跟總經理下指令下方後，這裡加一行彙總數字，
     不用展開每張卡片也能一眼看到「現在還有幾件在動、平均做到幾%了」 */
  .task-summary-bar{
    margin-top:12px; display:flex; gap:16px; flex-wrap:wrap; font-size:12px; color:var(--ink-soft);
    background:var(--paper); border:1px solid var(--line); border-radius:9px; padding:9px 14px;
  }
  .task-summary-bar b{color:var(--ink); font-weight:700;}

  .task-grid{margin-top:20px; display:flex; flex-direction:column; gap:14px;}

  details.task-card{
    background:var(--card); border:1px solid var(--line); border-radius:var(--radius-md);
    box-shadow:var(--shadow); padding:16px 18px; transition:border-color .15s ease;
  }
  details.task-card[open]{border-color:var(--line-strong);}
  details.task-card[data-status="awaiting_approval"]{border-color:var(--violet);}
  details.task-card[data-status="blocked"]{border-color:var(--risk-high);}
  details.task-card summary{list-style:none; cursor:pointer;}
  details.task-card summary::-webkit-details-marker{display:none;}

  .tc-top{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
  .tc-id{
    font-size:10.5px; font-weight:700; color:var(--ink-faint); letter-spacing:.02em;
    background:var(--paper); border:1px solid var(--line); border-radius:6px; padding:2px 7px;
  }
  .tc-name{font-family:"Noto Serif TC",serif; font-weight:700; font-size:14.5px;}
  .tc-status{
    margin-left:auto; display:flex; align-items:center; font-size:11px; color:var(--ink-soft);
    white-space:nowrap; flex-shrink:0;
  }
  .tc-chevron{width:16px; height:16px; margin-left:6px; color:var(--ink-faint); flex-shrink:0; transition:transform .2s ease;}
  details.task-card[open] .tc-chevron{transform:rotate(180deg); color:var(--violet);}
  .tc-desc{font-size:12.5px; color:var(--ink-soft); margin-top:8px; line-height:1.6;}
  .tc-last-error{
    margin:10px 20px 0; padding:9px 12px; border-radius:10px; font-size:12px; line-height:1.6;
    background:#FDF1F0; color:var(--risk-high); border:1px solid #F3D3D0;
    /* V92：後端錯誤訊息現在是多行組成（白話原因／金鑰池狀態／切換結果／
       建議動作／原始技術訊息，用 \n 分隔），沒有這行的話瀏覽器會把換行
       字元當空白吃掉、擠成一長串不好讀——跟 V84 修過的對話訊息換行問題
       是同一類状況，這裡補上同樣的處理方式。 */
    white-space: pre-wrap;
  }
  .tc-bar-row{display:flex; align-items:center; gap:8px; margin-top:10px;}
  .tc-bar{flex:1; height:5px; border-radius:99px; background:var(--paper); border:1px solid var(--line); overflow:hidden;}
  .tc-bar-fill{height:100%; background:var(--gm); border-radius:99px; transition:width .25s ease;}
  .tc-pct{font-size:11px; font-weight:700; color:var(--ink-soft); flex-shrink:0; width:34px; text-align:right;}
  .tc-meta{display:flex; justify-content:space-between; font-size:10.5px; color:var(--ink-faint); margin-top:7px; flex-wrap:wrap; gap:6px;}

  .tc-steps{margin-top:14px; padding-top:14px; border-top:1px dashed var(--line); display:flex; flex-direction:column; gap:10px;}
  .tc-step{display:flex; gap:10px; align-items:flex-start;}
  .tc-step-icon{
    flex-shrink:0; width:20px; height:20px; border-radius:50%; display:inline-flex; align-items:center;
    justify-content:center; font-size:11px; font-weight:700; margin-top:1px;
    border:1.5px solid var(--line-strong); color:var(--ink-faint);
  }
  .tc-step-done .tc-step-icon{background:var(--risk-low); border-color:var(--risk-low); color:#fff;}
  .tc-step-pending .tc-step-icon{background:var(--paper);}
  .tc-step-awaiting_approval .tc-step-icon{background:var(--violet); border-color:var(--violet); color:#fff;}
  .tc-step-rejected .tc-step-icon{background:var(--risk-high); border-color:var(--risk-high); color:#fff;}
  .tc-step-awaiting_approval{background:rgba(37,99,235,.06); border-radius:9px; padding:8px 9px; margin:-8px -9px;}
  .tc-step-body{flex:1; min-width:0;}
  .tc-step-title{font-size:12.5px; font-weight:600; color:var(--ink); display:flex; align-items:center; gap:6px; flex-wrap:wrap;}
  .tc-step-dept-status{display:inline-flex; align-items:center; gap:4px; font-size:10.5px; font-weight:500; color:var(--ink-faint);}
  .tc-step-desc{font-size:12px; color:var(--ink-soft); margin-top:2px; line-height:1.6;}
  .tc-step-note{font-size:11.5px; color:var(--violet); margin-top:5px; font-weight:600;}
  .tc-step-note.is-rejected{color:var(--risk-high);}
  /* V98：executingInBackground 的視覺提示——沿用本檔案既有的 blink keyframe，
     顏色跟「等您裁示」（tc-step-note 預設的 violet）區分開來，讓董事長一眼
     看出「這是還在跑」而不是「這是卡住等你裁示」。*/
  .tc-step-note.is-executing{color:#b8860b; animation:blink 1.6s ease-in-out infinite;}
  .tc-step-result{
    font-size:12px; color:var(--ink-soft); margin-top:5px; padding:8px 10px; line-height:1.6;
    background:var(--paper); border:1px solid var(--line); border-radius:9px;
  }
  .tc-step-result::before{content:"→ "; color:var(--violet); font-weight:700;}

  .tc-actions{display:flex; gap:8px; margin-top:14px; flex-wrap:wrap;}
  .tc-actions button{
    font-family:inherit; font-size:12px; font-weight:600; border-radius:999px; padding:7px 16px;
    cursor:pointer; border:1px solid var(--line-strong); background:var(--card); color:var(--ink-soft);
    transition:opacity .15s ease;
  }
  .tc-actions button.tc-advance{background:var(--gm); color:#fff; border-color:var(--gm);}
  .tc-actions button.tc-cancel:hover{border-color:var(--risk-high); color:var(--risk-high);}
  .tc-actions button:disabled{opacity:.5; cursor:not-allowed;}
  .tc-actions .tc-action-status{font-size:11.5px; color:var(--ink-faint); align-self:center;}
  .tc-actions .tc-action-status.is-error{color:var(--risk-high);}
  .tc-actions .tc-action-hint{font-size:11.5px; color:var(--violet); align-self:center; font-weight:600;}

  /* ---------- V47：Workflow Editor（手動編輯任務步驟）---------- */
  .tc-actions button.tc-edit-workflow:hover{border-color:var(--violet); color:var(--violet);}
  .tc-workflow-editor{margin-top:10px;}
  .wf-editor-inner{
    padding:14px 16px; border-radius:12px; border:1px dashed var(--line-strong); background:var(--paper);
  }
  .wf-locked-group{margin-bottom:14px; padding-bottom:12px; border-bottom:1px dashed var(--line-strong);}
  .wf-locked-title, .wf-editable-title{font-size:12px; font-weight:700; color:var(--ink-soft); margin:0 0 8px;}
  .wf-locked-step{
    font-size:12px; color:var(--ink-faint); padding:6px 10px; border-radius:8px; background:var(--card);
    margin-bottom:5px; opacity:.75;
  }
  .wf-rows{display:flex; flex-direction:column; gap:10px;}
  .wf-row{
    display:grid; grid-template-columns:1fr 1fr; gap:6px 8px; padding:10px; border-radius:10px;
    background:var(--card); border:1px solid var(--line);
  }
  .wf-row .wf-desc{grid-column:1 / -1;}
  .wf-row .wf-approval-toggle{grid-column:1 / -1; font-size:11.5px; color:var(--ink-soft); display:flex; align-items:center; gap:6px;}
  .wf-row .wf-approval-reason{grid-column:1 / -1;}
  .wf-row .wf-remove-row{grid-column:1 / -1; justify-self:end;}
  .wf-row select, .wf-row input[type="text"], .wf-row textarea{
    font-family:inherit; font-size:12.5px; padding:6px 9px; border-radius:8px;
    border:1px solid var(--line-strong); color:var(--ink); background:var(--paper); resize:vertical;
  }
  .wf-row .wf-remove-row{
    font-family:inherit; font-size:11.5px; font-weight:600; border-radius:999px; padding:5px 12px;
    cursor:pointer; border:1px solid var(--line-strong); background:var(--card); color:var(--risk-high);
  }
  .wf-add-row{
    margin-top:10px; font-family:inherit; font-size:12px; font-weight:600; border-radius:999px; padding:7px 16px;
    cursor:pointer; border:1px dashed var(--line-strong); background:var(--card); color:var(--violet);
  }
  .wf-editor-actions{display:flex; gap:8px; margin-top:14px; align-items:center; flex-wrap:wrap;}
  .wf-save{
    font-family:inherit; font-size:12px; font-weight:600; border-radius:999px; padding:7px 16px;
    cursor:pointer; border:1px solid var(--gm); background:var(--gm); color:#fff;
  }
  .wf-cancel{
    font-family:inherit; font-size:12px; font-weight:600; border-radius:999px; padding:7px 16px;
    cursor:pointer; border:1px solid var(--line-strong); background:var(--card); color:var(--ink-soft);
  }
  .wf-save:disabled{opacity:.5; cursor:not-allowed;}
  .wf-editor-status{font-size:11.5px; color:var(--ink-faint);}
  .wf-editor-status.is-error{color:var(--risk-high);}

  /* ---------- V42: 任務中心・已完成／已取消任務淡化收合區 ---------- */
  .task-all-done-note{font-size:12.5px; color:var(--ink-faint); padding:10px 0;}
  .task-done-section{margin-top:16px; padding-top:14px; border-top:1px dashed var(--line);}
  .task-done-title{font-size:11.5px; color:var(--ink-faint); font-weight:600; margin:0 0 8px;}
  .task-done-list{display:flex; flex-direction:column; gap:6px; opacity:.65;}
  .task-done-list.is-expanded{max-height:360px; overflow-y:auto; padding-right:6px;}
  .task-done-item{
    display:flex; align-items:center; gap:8px; padding:6px 10px;
    border:1px dashed var(--line); border-radius:8px; font-size:11.5px;
  }
  .task-done-id{font-family:monospace; font-size:10px; color:var(--ink-faint); flex-shrink:0;}
  .task-done-item-title{
    flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis;
    white-space:nowrap; color:var(--ink-soft);
  }
  .task-done-meta{font-size:10.5px; color:var(--ink-faint); flex-shrink:0; white-space:nowrap;}
  .task-done-toggle{
    margin-top:10px; font-size:12px; font-weight:700; color:var(--violet);
    background:none; border:none; padding:0; cursor:pointer; font-family:inherit;
  }
  .task-done-toggle:hover{text-decoration:underline;}

  /* ---------- V33: 成本中心（月度財報員／API 成本會計） ---------- */
  .cost-center{padding:24px 0 8px;}
  .cost-grid{margin-top:20px; display:grid; grid-template-columns:1fr 1fr; gap:14px;}
  @media (max-width:640px){ .cost-grid{grid-template-columns:1fr;} }
  .cost-card{
    background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg);
    padding:16px 18px; box-shadow:var(--shadow);
  }
  .cost-card-title{font-size:11.5px; color:var(--ink-faint); font-weight:600;}
  .cost-amount{font-size:26px; font-weight:700; color:var(--ink); margin-top:4px; font-variant-numeric:tabular-nums;}
  .cost-sub{font-size:11.5px; color:var(--ink-soft); margin-top:4px;}
  .cost-bar{height:7px; border-radius:99px; background:var(--paper); border:1px solid var(--line); margin-top:10px; overflow:hidden;}
  .cost-bar-fill{height:100%; background:var(--gm); border-radius:99px; transition:width .25s ease;}
  .cost-card.is-stopped .cost-bar-fill{background:var(--risk-high);}
  .cost-card.is-stopped .cost-amount{color:var(--risk-high);}
  .cost-limit-label{font-size:10.5px; color:var(--ink-faint); margin-top:6px;}
  .cost-admin{margin-top:16px; border-top:1px dashed var(--line); padding-top:12px;}
  .cost-admin summary{font-size:12px; color:var(--ink-faint); cursor:pointer; font-weight:600;}
  .cost-limit-form{display:flex; gap:10px; margin-top:10px; flex-wrap:wrap; align-items:flex-end;}
  .cost-limit-form label{
    display:flex; flex-direction:column; gap:4px; font-size:11px; color:var(--ink-soft); font-weight:600;
  }
  .cost-limit-form input{
    font-size:12.5px; padding:7px 9px; border-radius:8px; border:1px solid var(--line-strong);
    font-family:inherit; background:var(--paper); width:140px;
  }
  .cost-limit-form button{
    font-size:12px; font-weight:600; padding:8px 14px; border-radius:8px; border:none;
    background:var(--gm); color:#fff; cursor:pointer; white-space:nowrap;
  }
  .cost-admin-hint{font-size:10.5px; color:var(--ink-faint); margin-top:8px; line-height:1.6;}
  .cost-admin-msg{font-size:11.5px; margin-top:6px; min-height:14px;}
  .cost-admin-msg.is-ok{color:var(--risk-low);}
  .cost-admin-msg.is-error{color:var(--risk-high);}

  /* ---------- V76 追加：Cost Analytics（按模型分類） ---------- */
  .cost-analytics{margin-top:18px; border-top:1px dashed var(--line); padding-top:14px;}
  .cost-analytics-title{font-family:"Noto Serif TC",serif; font-weight:700; font-size:13.5px; color:var(--ink);}
  .cost-analytics-note{font-size:11px; color:var(--ink-faint); margin-top:4px;}
  .cost-analytics-note.is-error{color:var(--risk-high);}
  .cost-analytics-bars{display:flex; flex-direction:column; gap:8px; margin-top:12px;}
  .ca-bar-row{display:grid; grid-template-columns:84px 1fr 96px; align-items:center; gap:10px;}
  .ca-bar-label{font-size:11.5px; font-weight:600; color:var(--ink-soft);}
  .ca-bar-track{height:10px; border-radius:99px; background:var(--paper); border:1px solid var(--line); overflow:hidden;}
  .ca-bar-fill{height:100%; border-radius:99px; transition:width .25s ease;}
  .ca-bar-fill.cat-gemini{background:#3B6DFF;}
  .ca-bar-fill.cat-claude{background:#B45309;}
  .ca-bar-fill.cat-image{background:#8B5CF6;}
  .ca-bar-fill.cat-other{background:var(--ink-faint);}
  .ca-bar-amount{font-size:11.5px; font-weight:700; text-align:right; color:var(--ink); font-variant-numeric:tabular-nums;}
  .cost-analytics-table{margin-top:14px; display:flex; flex-direction:column; gap:4px;}
  .ca-table-row{
    display:grid; grid-template-columns:1fr 74px 96px; gap:8px; align-items:baseline;
    font-size:11px; padding:5px 0; border-bottom:1px solid var(--line);
  }
  .ca-table-row.is-header{color:var(--ink-faint); font-weight:600; border-bottom:1px solid var(--line-strong);}
  .ca-table-model{color:var(--ink-soft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .ca-table-count{color:var(--ink-faint); text-align:right; font-variant-numeric:tabular-nums;}
  .ca-table-amount{color:var(--ink); font-weight:600; text-align:right; font-variant-numeric:tabular-nums;}

  /* ---------- V5: Avatar system (代表頭像 + 人性化暱稱) ---------- */
  .ava{
    --ava-size:38px;
    position:relative; flex-shrink:0;
    width:var(--ava-size); height:var(--ava-size); border-radius:50%;
    display:inline-flex; align-items:center; justify-content:center;
    box-shadow:0 2px 7px rgba(15,23,42,0.22), inset 0 0 0 1px rgba(255,255,255,0.18);
    transition:transform .2s ease;
  }
  .ava-glyph{
    font-family:"Noto Serif TC",serif; font-weight:700; color:#fff;
    font-size:calc(var(--ava-size) * 0.42); line-height:1; user-select:none;
    text-shadow:0 1px 2px rgba(0,0,0,0.18);
  }
  .ava-sm{--ava-size:26px;}
  .ava-lg{--ava-size:46px;}
  .ava-dot{
    position:absolute; right:-2px; bottom:-2px; width:11px; height:11px; border-radius:50%;
    border:2px solid var(--card); background:var(--ink-faint);
  }
  .ava-sm .ava-dot{width:9px; height:9px; right:-1px; bottom:-1px; border-width:1.5px;}
  .ava-dot.s-working{background:var(--risk-low);}
  .ava-dot.s-meeting{background:var(--risk-mid);}
  .ava-dot.s-idle{background:var(--ink-faint);}
  .ava-dot.s-off{background:var(--line-strong);}
  .ava::before{
    content:""; position:absolute; inset:-4px; border-radius:50%;
    border:1.5px solid currentColor; opacity:0; pointer-events:none;
  }
  .ava.is-active::before{color:var(--risk-low); animation:ring 2.6s ease-out infinite;}
  .ava.is-meeting::before{color:var(--risk-mid); animation:ring 2.6s ease-out infinite;}
  @keyframes ring{
    0%{opacity:.5; transform:scale(0.6);}
    80%{opacity:0; transform:scale(1.6);}
    100%{opacity:0; transform:scale(1.6);}
  }

  /* per-department gradient palette — cool spectrum, stays inside the corporate blue family */
  .ava-gm{background:linear-gradient(135deg,#4F46E5,#3730A3);}
  .ava-meeting{background:linear-gradient(135deg,#6366F1,#4338CA);}
  .ava-eng{background:linear-gradient(135deg,#2563EB,#1D4ED8);}
  .ava-product{background:linear-gradient(135deg,#0EA5E9,#0369A1);}
  .ava-design{background:linear-gradient(135deg,#14B8A6,#0F766E);}
  .ava-acct{background:linear-gradient(135deg,#64748B,#334155);}
  .ava-growth{background:linear-gradient(135deg,#22D3EE,#0891B2);}
  .ava-sales{background:linear-gradient(135deg,#10B981,#047857);}
  .ava-strategy{background:linear-gradient(135deg,#475569,#1E293B);}
  .ava-qa{background:linear-gradient(135deg,#8B5CF6,#6D28D9);}
  .ava-chairman{background:linear-gradient(135deg,#0F172A,#334155);}

  /* V24：原本這裡有 .tb-eng／.tb-design／.tb-product／.tb-growth 四個專門給交付
     中心縮圖用的背景色，內容其實跟上面 .ava-eng 等部門漸層一模一樣，只是多存一份。
     renderDelivery() 改成直接把部門自己的 avaClass 套在縮圖上，同一個顏色只在一個
     地方維護，這四個 class 已經沒有任何地方在用，直接拿掉。 */

  /* department nickname badges next to name */
  .bc-nick,.dept-nick-org,.light-nick{
    font-size:11px; font-weight:600; color:var(--violet); margin-left:5px;
  }
  .role-nick{
    font-size:11.5px; font-weight:600; color:var(--violet); margin:0 6px; white-space:nowrap;
  }

  /* board card top: avatar replaces old icon box, add breathing scale when working */
  .bc-top .ava{--ava-size:34px;}
  details.board-card[data-status="working"] .bc-top .ava,
  details.board-card[data-status="meeting"] .bc-top .ava{
    animation:avaBreathe 3.2s ease-in-out infinite;
  }
  @keyframes avaBreathe{0%,100%{transform:scale(1);}50%{transform:scale(1.045);}}

  /* org accordion: avatar replaces old icon box */
  details.dept summary > .ava{--ava-size:40px;}
  details.dept:hover .ava{transform:translateY(-1px);}

  /* ---------- V5: console header + chat avatars ---------- */
  .console-head{gap:11px;}
  .quick-nav{
    display:flex; flex-wrap:wrap; gap:8px; padding:10px 14px;
    background:var(--paper); border-bottom:1px solid var(--line);
    border-radius:var(--radius-lg) var(--radius-lg) 0 0;
  }
  .quick-nav a{
    flex:1 1 auto; display:inline-flex; align-items:center; justify-content:center; gap:4px;
    font-size:11.5px; font-weight:600; color:var(--ink-soft);
    background:var(--card); border:1px solid var(--line-strong); border-radius:999px;
    padding:6px 12px; text-decoration:none; white-space:nowrap;
    transition:border-color .15s ease, color .15s ease, transform .15s ease;
  }
  /* V78.3: 12 個項目在較寬螢幕固定排成兩行（每行 6 個），不再需要左右捲動。
     V79: 新增「🧹 儲存空間清理」變成 13 個項目，改成每行 7 個（13 = 7+6，
     仍是兩行、不會多出第三行的孤兒項目）；比例只是按目前項目數重新抓，
     之後項目數再變動一樣需要重新檢查這個比例，跟 V78.3 當時說明的取捨
     原則一致。 */
  @media (min-width:640px){
    .quick-nav a{flex:1 1 calc(14.2857% - 8px);}
  }
  @media (max-width:639px){
    .quick-nav a{flex:1 1 calc(33.333% - 8px);}
  }
  .quick-nav a:hover{border-color:var(--violet); color:var(--violet); transform:translateY(-1px);}
  .quick-nav a b{color:var(--violet); font-weight:700;}
  .console-head .head-title{display:flex; flex-direction:column; line-height:1.25;}
  .console-head .head-title b{font-size:13.5px; font-weight:700;}
  .console-head .head-sub{font-size:10.5px; font-weight:500; color:var(--ink-faint);}
  .console-head .dot{display:none;}

  .msg{display:flex; flex-direction:row; align-items:flex-start; gap:9px; max-width:92%;}
  .msg-user{flex-direction:row-reverse; align-items:flex-start;}
  .msg-body{display:flex; flex-direction:column; gap:4px; min-width:0;}
  .msg-user .msg-body{align-items:flex-end;}
  /* V84：董事長貼上多行文字時，訊息氣泡裡也要看得到原本的換行——單靠
     textarea 保留 \n 字元還不夠，瀏覽器預設會把 <p> 裡的換行字元當空白處理，
     要靠 white-space: pre-wrap 才會真的顯示成一行一行，同時仍然自動換行、
     不會因為一行很長而把版面撐爆。 */
  .msg-body p{white-space:pre-wrap; word-break:break-word;}
  .msg .ava{--ava-size:28px; margin-top:2px;}

  .typing-bubble{
    display:inline-flex; align-items:center; gap:4px; padding:12px 15px;
    background:var(--paper); border:1px solid var(--line); border-radius:14px; border-bottom-left-radius:4px;
    width:fit-content;
  }
  .typing-dot{width:6px; height:6px; border-radius:50%; background:var(--ink-faint); animation:typingBounce 1.2s infinite ease-in-out;}
  .typing-dot:nth-child(2){animation-delay:.15s;}
  .typing-dot:nth-child(3){animation-delay:.3s;}
  @keyframes typingBounce{0%,60%,100%{transform:translateY(0); opacity:.45;}30%{transform:translateY(-4px); opacity:1;}}

  /* ---------- V8: Chairman Workspace layout — everything chairman needs to act on, together ---------- */
  .workspace{padding:32px 0 44px; display:flex; flex-direction:column; gap:0;}
  .ws-block{margin-top:26px;}
  .ws-block-title{
    font-family:"Noto Serif TC",serif; font-weight:700; font-size:15px; color:var(--ink);
    margin-bottom:12px; display:flex; align-items:baseline; gap:10px; flex-wrap:wrap;
  }
  .ws-block-note{font-family:"Noto Sans TC",sans-serif; font-weight:500; font-size:11.5px; color:var(--ink-faint);}
  /* V75: 平時不常用的區塊（Connector 權限中心、交付品質規則）改成可收合，預設收合狀態，減少工作區預設要滑過的高度 */
  .ws-block-collapsible{border:1px solid var(--line); border-radius:var(--radius-lg); padding:16px 18px; background:var(--card);}
  .ws-block-collapsible > summary.ws-block-title{
    cursor:pointer; list-style:none; margin-bottom:0; user-select:none;
    padding-right:22px; position:relative;
  }
  .ws-block-collapsible > summary.ws-block-title::-webkit-details-marker{display:none;}
  .ws-block-collapsible > summary.ws-block-title::after{
    content:"▸"; position:absolute; right:0; top:1px; font-size:13px; color:var(--ink-faint);
    transition:transform .15s ease;
  }
  .ws-block-collapsible[open] > summary.ws-block-title::after{transform:rotate(90deg);}
  .ws-block-collapsible[open] > summary.ws-block-title{margin-bottom:12px;}
  .ws-block-collapsible > summary.ws-block-title:hover::after{color:var(--ink);}
  .workspace > .quick-nav{margin-top:22px; border-radius:var(--radius-lg); border:1px solid var(--line); box-shadow:var(--shadow);}
  @media (min-width:860px){
    .workspace{padding:52px 0 60px;}
  }

  @media (prefers-reduced-motion:reduce){
    .ava.is-active::before,.ava.is-meeting::before,
    details.board-card[data-status="working"] .bc-top .ava,
    details.board-card[data-status="meeting"] .bc-top .ava,
    .typing-dot{animation:none !important;}
  }

  /* ---------- V6: 待審批公文夾 Approval Inbox ---------- */
  .approval{padding:8px 0 6px;}
  .approval-list{margin-top:20px; display:flex; flex-direction:column; gap:14px;}
  .approval-card{
    background:var(--card); border:1px solid var(--line); border-radius:var(--radius-md);
    box-shadow:var(--shadow); padding:18px 18px 16px; border-left:3px solid var(--risk-mid);
    transition:opacity .35s ease, transform .35s ease;
  }
  .approval-card[data-risk="low"]{border-left-color:var(--risk-low);}
  .approval-card[data-risk="high"]{border-left-color:var(--risk-high);}
  .approval-card.is-resolved{opacity:.55;}
  .approval-top{display:flex; align-items:flex-start; gap:10px; flex-wrap:wrap;}
  .approval-case{font-family:"Noto Serif TC",serif; font-weight:700; font-size:15px;}
  .approval-tag{font-size:10.5px; color:var(--ink-faint); margin-top:2px;}
  .approval-summary{font-size:13px; color:var(--ink-soft); line-height:1.75; margin-top:11px;}
  .approval-summary b{color:var(--ink); font-weight:600;}
  .approval-who{display:flex; align-items:center; gap:8px; margin-top:12px; flex-wrap:wrap;}
  .approval-who .ava{--ava-size:24px;}
  .approval-who span{font-size:11.5px; color:var(--ink-faint);}
  .approval-actions{display:flex; gap:8px; margin-top:14px; flex-wrap:wrap;}
  .approval-actions button{
    border-radius:9px; padding:8px 14px; font-size:12.5px; font-weight:600; cursor:pointer;
    font-family:inherit; transition:opacity .15s ease, transform .15s ease;
  }
  .approval-actions button:active{transform:scale(0.96);}
  .btn-approve{border:none; background:var(--gm); color:#fff;}
  .btn-approve:hover{opacity:.9;}
  .btn-reject{border:1px solid var(--line-strong); background:var(--card); color:var(--ink-soft);}
  .btn-reject:hover{border-color:var(--risk-high); color:var(--risk-high);}
  .btn-ask{border:1px solid var(--line-strong); background:var(--card); color:var(--ink-soft);}
  .btn-ask:hover{border-color:var(--violet); color:var(--violet);}
  .approval-resolved-note{
    display:none; align-items:center; gap:7px; margin-top:14px; font-size:12.5px; font-weight:600;
  }
  .approval-resolved-note.show{display:flex;}
  .approval-resolved-note.ok{color:var(--risk-low);}
  .approval-resolved-note.no{color:var(--risk-high);}
  .approval-empty{
    display:none; text-align:center; padding:30px 10px; color:var(--ink-faint); font-size:13px;
  }
  .approval-empty.show{display:block;}

  /* V41：待審批清單是空的時候，用最近 3 筆歷史批示的淡化預覽取代原本的示範
     卡片——整塊用降低的透明度＋略小字級呈現「僅供參考」的感覺，不會被誤認成
     還需要處理的待辦事項；.show 由 renderApprovalRecentFaded() 依有沒有真實
     待審批項目來切換顯示 */
  .approval-recent-faded{display:none; margin-top:4px; opacity:.62;}
  .approval-recent-faded.show{display:block;}
  .approval-recent-faded-title{font-size:11px; color:var(--ink-faint); margin:0 0 6px; text-align:center;}
  .approval-recent-faded-item{
    display:flex; align-items:center; gap:8px; padding:7px 10px; border:1px dashed var(--line);
    border-radius:var(--radius-sm, 8px); margin-bottom:6px; font-size:12px;
  }
  .approval-recent-faded-badge{font-size:10.5px; font-weight:600; padding:1px 6px; border-radius:999px; flex-shrink:0;}
  .approval-recent-faded-item.act-approve .approval-recent-faded-badge{background:rgba(45,140,90,.14); color:var(--risk-low);}
  .approval-recent-faded-item.act-reject .approval-recent-faded-badge{background:rgba(200,60,60,.14); color:var(--risk-high);}
  .approval-recent-faded-item.act-ask .approval-recent-faded-badge{background:rgba(120,120,130,.14); color:var(--ink-faint);}
  .approval-recent-faded-case{flex:1 1 auto; min-width:0; color:var(--ink-faint); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .approval-recent-faded-time{font-size:10.5px; color:var(--ink-faint); flex-shrink:0;}

  /* V34：有真實待審批項目時，藏起 3 張示範卡片；動態產生的真實卡片複用同一套
     .approval-card 樣式，外觀完全一致，只是資料來源不同
     V41：3 張示範卡片改成永久帶 hidden 屬性（見 index.html），這個 class 保留
     著沒有刪除，純粹是避免有殘留引用時出錯，實際上已經不會被觸發 */
  .approval-card-demo.is-hidden-by-real{display:none;}
  .approval-sync-status{margin-top:8px; font-size:11px; color:var(--ink-faint);}
  .approval-sync-status.is-error{color:var(--risk-high);}
  .approval-card .approval-tag.is-task-linked{color:var(--violet);}

  /* V59：成果待審（deliverable_review）卡片的預覽區塊——HTML 用 iframe、
     圖片用 <img>、其他類型退回成一個可點開的檔案連結。跟一般卡片共用
     .approval-card 外框，只有卡片內容中段（原本純文字 .approval-summary
     的位置）換成這裡的預覽區塊。 */
  .approval-preview{margin-top:11px; display:flex; flex-direction:column; gap:10px;}
  .approval-preview-block{border:1px solid var(--line); border-radius:var(--radius-sm, 8px); overflow:hidden;}
  .approval-preview-label{
    font-size:11.5px; color:var(--ink-faint); padding:7px 10px; margin:0;
    background:var(--bg-soft, rgba(0,0,0,.02)); border-bottom:1px solid var(--line);
  }
  .approval-preview-frame{width:100%; height:280px; border:none; display:block; background:#fff;}
  .approval-preview-image{width:100%; max-height:280px; object-fit:contain; display:block; background:var(--bg-soft, rgba(0,0,0,.02));}
  .approval-preview-file-link{
    display:flex; align-items:center; gap:6px; padding:12px 14px; font-size:13px;
    color:var(--ink-soft); text-decoration:none; font-weight:600;
  }
  .approval-preview-file-link:hover{color:var(--gm);}
  .approval-ask-history{
    font-size:11.5px; color:var(--ink-faint); margin-top:8px; padding:7px 10px;
    background:var(--paper); border:1px solid var(--line); border-radius:8px;
  }

  /* ---------- V20: 待審批歷史批示紀錄（接上 Cloudflare KV 後端）---------- */
  .approval-history{margin-top:26px; padding-top:20px; border-top:1px dashed var(--line-strong);}
  .approval-history-title{font-family:"Noto Serif TC",serif; font-weight:700; font-size:14px; display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
  /* V85：歷史批示紀錄跟其他「記錄類」面板一樣改成可收合、預設收合狀態，
     收合圖示樣式比照 .ws-block-collapsible，讓整體視覺一致 */
  .approval-history-collapsible > summary.approval-history-title{
    cursor:pointer; list-style:none; user-select:none; padding-right:22px; position:relative;
  }
  .approval-history-collapsible > summary.approval-history-title::-webkit-details-marker{display:none;}
  .approval-history-collapsible > summary.approval-history-title::after{
    content:"▸"; position:absolute; right:0; top:1px; font-size:13px; color:var(--ink-faint);
    transition:transform .15s ease;
  }
  .approval-history-collapsible[open] > summary.approval-history-title::after{transform:rotate(90deg);}
  .approval-history-collapsible > summary.approval-history-title:hover::after{color:var(--ink);}
  .approval-history-list{display:flex; flex-direction:column; gap:8px; margin-top:12px;}
  /* V21：展開後限制最大高度、超出用內部捲動，紀錄再多也不會把整個頁面撐長 */
  .approval-history-list.is-expanded{max-height:440px; overflow-y:auto; padding-right:6px;}
  .approval-history-toggle{
    margin-top:10px; font-size:12px; font-weight:700; color:var(--violet);
    background:none; border:none; padding:0; cursor:pointer; font-family:inherit;
  }
  .approval-history-toggle:hover{text-decoration:underline;}
  .approval-history-item{
    display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border-radius:9px;
    background:var(--bg-soft, #f6f7fb); border:1px solid var(--line); font-size:12px; line-height:1.6;
  }
  .approval-history-item .hist-badge{
    flex:0 0 auto; font-weight:700; padding:2px 8px; border-radius:999px; font-size:11px;
  }
  .approval-history-item.act-approve .hist-badge{background:rgba(45,140,90,.14); color:var(--risk-low);}
  .approval-history-item.act-reject .hist-badge{background:rgba(200,60,60,.14); color:var(--risk-high);}
  .approval-history-item.act-ask .hist-badge{background:rgba(120,120,130,.14); color:var(--ink-faint);}
  .approval-history-item .hist-body{flex:1 1 auto; min-width:0;}
  .approval-history-item .hist-case{font-weight:600; color:var(--ink);}
  .approval-history-item .hist-meta{color:var(--ink-faint); font-size:11px; margin-top:2px;}
  .approval-history-status{margin-top:10px; font-size:11.5px; color:var(--ink-faint);}
  .approval-history-status.is-error{color:var(--risk-high);}

  /* ---------- V47：治理稽核紀錄 Audit Log ---------- */
  .audit-log-list{display:flex; flex-direction:column; gap:8px; margin-top:12px;}
  .audit-log-list.is-expanded{max-height:440px; overflow-y:auto; padding-right:6px;}
  .audit-log-toggle{
    margin-top:10px; font-size:12px; font-weight:700; color:var(--violet);
    background:none; border:none; padding:0; cursor:pointer; font-family:inherit;
  }
  .audit-log-toggle:hover{text-decoration:underline;}
  .audit-log-item{
    display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border-radius:9px;
    background:var(--bg-soft, #f6f7fb); border:1px solid var(--line); font-size:12px; line-height:1.6;
  }
  .audit-log-item .audit-badge{
    flex:0 0 auto; font-weight:700; padding:2px 8px; border-radius:999px; font-size:11px;
    background:rgba(90,90,220,.12); color:var(--violet); white-space:nowrap;
  }
  .audit-log-item .audit-body{flex:1 1 auto; min-width:0;}
  .audit-log-item .audit-target{font-weight:600; color:var(--ink); margin:0;}
  .audit-log-item .audit-meta{color:var(--ink-faint); font-size:11px; margin:2px 0 0;}
  .audit-log-status{margin-top:10px; font-size:11.5px; color:var(--ink-faint);}
  .audit-log-status.is-error{color:var(--risk-high);}

  /* ---------- V71：Connector 權限中心 Connector Permission Center ---------- */
  .connperm-risk-legend{display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 14px;}
  .connperm-risk-chip{
    display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px;
    font-size:11px; font-weight:600; border:1px solid var(--line); background:var(--bg-soft, #f6f7fb);
    color:var(--ink-faint);
  }
  .connperm-risk-chip .dot{width:8px; height:8px; border-radius:999px; flex:0 0 auto;}
  .connperm-risk-chip.risk-high .dot{background:var(--risk-high);}
  .connperm-risk-chip.risk-medium .dot{background:#c98a2b;}
  .connperm-risk-chip.risk-low .dot{background:var(--risk-low);}
  .connperm-table-wrap{overflow-x:auto; border:1px solid var(--line); border-radius:12px;}
  .connperm-table{width:100%; border-collapse:collapse; font-size:12px; min-width:640px;}
  .connperm-table th, .connperm-table td{
    padding:10px 12px; text-align:center; border-bottom:1px solid var(--line); white-space:nowrap;
  }
  .connperm-table th{
    background:var(--bg-soft, #f6f7fb); font-weight:700; color:var(--ink); font-size:11.5px;
  }
  .connperm-table th.connperm-dept-col, .connperm-table td.connperm-dept-col{
    text-align:left; font-weight:600; color:var(--ink); position:sticky; left:0; background:#fff;
  }
  .connperm-table th .risk-dot{width:7px; height:7px; border-radius:999px; display:inline-block; margin-right:5px; vertical-align:middle;}
  .connperm-table th.risk-high .risk-dot{background:var(--risk-high);}
  .connperm-table th.risk-medium .risk-dot{background:#c98a2b;}
  .connperm-table th.risk-low .risk-dot{background:var(--risk-low);}
  .connperm-table tr:last-child td{border-bottom:none;}
  .connperm-cell-toggle{
    width:34px; height:20px; border-radius:999px; border:1px solid var(--line); background:#e6e6ee;
    cursor:pointer; position:relative; transition:background .15s ease; padding:0;
  }
  .connperm-cell-toggle::after{
    content:''; position:absolute; top:1px; left:1px; width:16px; height:16px; border-radius:999px;
    background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.25); transition:transform .15s ease;
  }
  .connperm-cell-toggle.is-on{background:var(--risk-low);}
  .connperm-cell-toggle.is-on::after{transform:translateX(14px);}
  .connperm-cell-toggle:disabled{opacity:.5; cursor:wait;}
  .connperm-cell-source{display:block; font-size:9.5px; color:var(--ink-faint); margin-top:3px;}
  .connperm-status{margin-top:10px; font-size:11.5px; color:var(--ink-faint);}
  .connperm-status.is-error{color:var(--risk-high);}
  .connperm-status.is-saving{color:var(--violet);}

  /* ---------- V89：進站登入關卡（未登入時蓋滿全螢幕，只有帳密欄位） ---------- */
  .auth-gate{
    position:fixed; inset:0; z-index:9999; display:flex; align-items:center; justify-content:center;
    background:var(--paper); padding:24px;
  }
  /* V92 修正：.auth-gate 的 class selector 用 display:flex 顯示卡片，但這條
     規則的優先權蓋過了瀏覽器對 [hidden] 屬性的內建樣式，導致 JS 設定
     gate.hidden = true 之後，畫面上這個閘門依然顯示（DOM 屬性有 hidden，
     但實際計算出來的 display 還是 flex，登入成功、app.js 都已經在背景
     執行了，畫面卻卡在「請先登入」不會消失）。這裡明確補上 [hidden] 的
     例外規則，讓它蓋過上面的 display:flex，兩者都要留著才不會互相打架。*/
  .auth-gate[hidden]{
    display:none;
  }
  .auth-gate-box{
    width:100%; max-width:340px; background:var(--card); border:1px solid var(--line);
    border-radius:var(--radius-lg); box-shadow:var(--shadow); padding:28px 26px;
  }
  .auth-gate-eyebrow{font-size:11px; font-weight:600; letter-spacing:0.08em; color:var(--ink-faint); margin:0 0 6px;}
  .auth-gate-title{font-size:19px; font-weight:700; color:var(--ink); margin:0 0 18px;}
  .auth-gate-box .auth-field{max-width:none;}
  .auth-gate-box .auth-field input{width:100%; font-size:14px; padding:9px 11px;}
  #gateLoginBtn{
    width:100%; margin-top:6px; padding:10px 14px; border:none; border-radius:8px;
    background:var(--gm); color:#fff; font-weight:700; font-size:13.5px; cursor:pointer;
  }
  #gateLoginBtn:disabled{opacity:0.6; cursor:default;}
  .auth-gate-status{min-height:16px; font-size:12px; color:var(--risk-high); margin:10px 0 0;}
  .auth-gate-hint{font-size:10.5px; color:var(--ink-faint); margin:14px 0 0; line-height:1.6;}
  .auth-gate-hint code{background:var(--paper); padding:1px 4px; border-radius:4px;}
  /* V91：config.js 的 ADMIN_KEY 未清空時的安全警示——沿用既有
     --risk-high／--risk-high-bg 警示色系，跟其他面板的高風險標示
     視覺語言一致，不是另外做一套不搭調的顏色。預設 hidden，只有
     JS 偵測到風險時才會顯示（見 index.html 底部 initGate）。*/
  .auth-gate-warning{
    margin-top:14px; padding:10px 12px; border-radius:8px;
    background:var(--risk-high-bg); color:var(--risk-high);
    font-size:10.5px; line-height:1.6; text-align:left;
  }
  .auth-gate-warning code{background:rgba(255,255,255,0.6); padding:1px 4px; border-radius:4px;}

  /* ---------- V82：User Identity 使用者帳號管理 ---------- */
  .auth-panel{margin-bottom:16px; padding-bottom:14px; border-bottom:1px solid var(--line);}
  .auth-status{font-size:12px; color:var(--ink-faint); margin:0 0 10px;}
  .auth-field{
    display:flex; flex-direction:column; gap:4px; font-size:11.5px; color:var(--ink-faint);
    margin-bottom:8px; max-width:260px;
  }
  .auth-field input{
    padding:7px 9px; border:1px solid var(--line); border-radius:8px; font-size:13px; color:var(--ink);
  }
  .auth-login-form button, .auth-logged-in-box button, .user-account-create button{
    padding:7px 14px; border:1px solid var(--line); border-radius:8px; background:var(--violet, #6a5acd);
    color:#fff; font-weight:600; font-size:12.5px; cursor:pointer; margin-top:2px;
  }
  .auth-logged-in-box button{background:#fff; color:var(--risk-high); border-color:var(--risk-high);}
  .auth-hint{font-size:10.5px; color:var(--ink-faint); margin:6px 0 0;}
  .auth-hint code{background:var(--bg-soft, #f6f7fb); padding:1px 4px; border-radius:4px;}
  .user-account-panel{margin-top:4px;}
  .user-account-title{font-size:12.5px; font-weight:700; color:var(--ink); margin:0 0 8px;}
  .user-account-table-wrap{overflow-x:auto; border:1px solid var(--line); border-radius:12px;}
  .user-account-table{width:100%; border-collapse:collapse; font-size:12px; min-width:480px;}
  .user-account-table th, .user-account-table td{
    padding:9px 12px; text-align:left; border-bottom:1px solid var(--line); white-space:nowrap;
  }
  .user-account-table th{
    background:var(--bg-soft, #f6f7fb); font-weight:700; color:var(--ink); font-size:11.5px;
  }
  .user-account-table tr:last-child td{border-bottom:none;}
  .user-account-badge{
    display:inline-block; font-size:9.5px; padding:1px 6px; border-radius:999px;
    background:var(--violet, #6a5acd); color:#fff; margin-left:6px; vertical-align:middle;
  }
  .user-account-reset-btn, .user-account-delete-btn{
    font-size:11px; padding:4px 9px; border-radius:6px; border:1px solid var(--line);
    background:#fff; color:var(--ink); cursor:pointer; margin-right:6px;
  }
  .user-account-delete-btn{color:var(--risk-high); border-color:var(--risk-high);}
  .user-account-status{margin-top:10px; font-size:11.5px; color:var(--ink-faint);}
  .user-account-status.is-error{color:var(--risk-high);}
  .user-account-create{margin-top:14px; padding-top:12px; border-top:1px solid var(--line);}
  .user-account-create-title{font-size:12px; font-weight:700; color:var(--ink); margin:0 0 8px;}

  /* ---------- V81：對象白名單 Connector Target Allowlist ---------- */
  .connperm-target-panel{
    margin-top:16px; padding-top:14px; border-top:1px dashed var(--line);
  }
  .connperm-target-title{font-weight:700; font-size:12.5px; color:var(--ink); margin:0 0 10px;}
  .connperm-target-controls{display:flex; flex-wrap:wrap; gap:12px; margin-bottom:12px;}
  .connperm-target-field{
    display:flex; flex-direction:column; gap:4px; font-size:11px; color:var(--ink-faint); font-weight:600;
  }
  .connperm-target-field select{
    padding:6px 10px; border-radius:8px; border:1px solid var(--line); background:#fff;
    font-size:12px; color:var(--ink); min-width:160px;
  }
  .connperm-target-body{
    border:1px solid var(--line); border-radius:12px; padding:12px 14px; background:var(--bg-soft, #f6f7fb);
  }
  .connperm-target-hint{font-size:11.5px; color:var(--ink-faint); margin:0;}
  .connperm-target-nolimit{font-size:11.5px; color:var(--risk-low); font-weight:600; margin:0 0 8px;}
  .connperm-target-list{display:flex; flex-wrap:wrap; gap:6px; margin:0 0 10px;}
  .connperm-target-chip{
    display:inline-flex; align-items:center; gap:6px; padding:4px 8px 4px 10px; border-radius:999px;
    font-size:11.5px; background:#fff; border:1px solid var(--line); color:var(--ink);
  }
  .connperm-target-chip button{
    border:none; background:transparent; color:var(--ink-faint); cursor:pointer; font-size:13px;
    line-height:1; padding:0 2px;
  }
  .connperm-target-chip button:hover{color:var(--risk-high);}
  .connperm-target-add{display:flex; gap:8px; flex-wrap:wrap;}
  .connperm-target-add input{
    flex:1 1 220px; padding:6px 10px; border-radius:8px; border:1px solid var(--line);
    font-size:12px; min-width:180px;
  }
  .connperm-target-add button{
    padding:6px 14px; border-radius:8px; border:1px solid var(--line); background:var(--violet);
    color:#fff; font-size:12px; font-weight:600; cursor:pointer;
  }
  .connperm-target-add button:disabled{opacity:.5; cursor:wait;}
  .connperm-target-note{font-size:10.5px; color:var(--ink-faint); margin:8px 0 0;}

  /* V65：里程碑（任務卡片內） */
  .tc-milestones{margin-top:14px; padding-top:12px; border-top:1px dashed var(--line);}
  .tc-milestones-title{font-size:12px; font-weight:700; color:var(--ink); margin:0 0 8px;}
  .tc-milestone-list{display:flex; flex-direction:column; gap:6px;}
  .tc-milestone{
    display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:8px;
    background:var(--bg-soft, #f6f7fb); border:1px solid var(--line); font-size:12px;
  }
  .tc-milestone-toggle{
    flex:0 0 auto; width:20px; height:20px; border-radius:50%; border:1.5px solid var(--line-strong);
    background:var(--paper); cursor:pointer; font-size:11px; line-height:1; display:flex;
    align-items:center; justify-content:center; color:var(--ink-faint); padding:0;
  }
  .tc-milestone.is-done .tc-milestone-toggle{background:var(--risk-low); border-color:var(--risk-low); color:#fff;}
  .tc-milestone.is-overdue .tc-milestone-toggle{border-color:var(--risk-high); color:var(--risk-high);}
  .tc-milestone-title{flex:1 1 auto; min-width:0; font-weight:600; color:var(--ink);}
  .tc-milestone-due{flex:0 0 auto; color:var(--ink-faint); font-size:11px;}
  .tc-milestone-state{flex:0 0 auto; font-size:11px; font-weight:600; color:var(--ink-faint);}
  .tc-milestone.is-done .tc-milestone-state{color:var(--risk-low);}
  .tc-milestone.is-overdue .tc-milestone-state{color:var(--risk-high);}

  /* V65：客戶驗收與回饋（任務卡片內） */
  .tc-feedback{margin-top:14px; padding:12px; border-radius:9px; background:var(--bg-soft, #f6f7fb); border:1px solid var(--line);}
  .tc-feedback-title{font-size:12px; font-weight:600; color:var(--ink); margin:0 0 8px; line-height:1.6;}
  .tc-feedback-buttons{display:flex; gap:8px; margin-bottom:8px;}
  .tc-feedback-buttons button{
    flex:1; padding:7px 10px; border-radius:8px; border:1px solid var(--line-strong);
    background:var(--paper); font-size:12.5px; font-weight:600; cursor:pointer; font-family:inherit;
  }
  .tc-feedback-good:hover{border-color:var(--risk-low); color:var(--risk-low);}
  .tc-feedback-bad:hover{border-color:var(--risk-high); color:var(--risk-high);}
  .tc-feedback-comment-input{
    width:100%; box-sizing:border-box; border-radius:8px; border:1px solid var(--line); padding:8px 10px;
    font-size:12px; font-family:inherit; resize:vertical; background:var(--paper); color:var(--ink);
  }
  .tc-feedback-status{display:block; margin-top:6px; font-size:11px; color:var(--ink-faint);}
  .tc-feedback-status.is-error{color:var(--risk-high);}
  .tc-feedback.is-submitted{background:rgba(16,163,74,.06); border-color:rgba(16,163,74,.25);}
  .tc-feedback-comment{font-size:12px; color:var(--ink-soft); margin:0 0 4px; line-height:1.6;}
  .tc-feedback-time{font-size:11px; color:var(--ink-faint); margin:0;}
  .task-done-feedback{
    flex:0 0 auto; font-size:11px; padding:1px 7px; border-radius:999px; border:1px solid var(--line-strong);
    color:var(--ink-faint);
  }
  .task-done-feedback.is-good{border-color:rgba(16,163,74,.35); background:rgba(16,163,74,.08);}
  .task-done-feedback.is-bad{border-color:rgba(220,38,38,.3); background:rgba(220,38,38,.06);}

  /* V72：董事長偏好中心（Chairman Memory）——表單風格延續核准表單／輸入框，
     清單風格延續部門知識庫（.knowledge-item），全公司層級不分部門，所以
     沒有 dept-chips 那一排，直接是表單＋分組清單。 */
  .chairman-memory-form{
    display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px;
  }
  .chairman-memory-category-select{
    flex:0 0 auto; padding:8px 10px; border-radius:8px; border:1px solid var(--line-strong);
    background:var(--paper); font-size:12px; font-family:inherit; color:var(--ink); cursor:pointer;
  }
  .chairman-memory-input{
    flex:1 1 260px; min-width:180px; padding:8px 12px; border-radius:8px; border:1px solid var(--line-strong);
    background:var(--paper); font-size:12.5px; font-family:inherit; color:var(--ink);
  }
  .chairman-memory-input:focus{outline:none; border-color:var(--gm);}
  .chairman-memory-add-btn{
    flex:0 0 auto; padding:8px 16px; border-radius:8px; border:1px solid var(--gm); background:var(--gm);
    color:#fff; font-size:12.5px; font-weight:600; font-family:inherit; cursor:pointer;
  }
  .chairman-memory-add-btn:hover{opacity:.9;}
  .chairman-memory-list{display:flex; flex-direction:column; gap:8px;}
  .chairman-memory-list.is-expanded{max-height:440px; overflow-y:auto; padding-right:6px;}
  .chairman-memory-toggle{
    margin-top:10px; font-size:12px; font-weight:700; color:var(--violet);
    background:none; border:none; padding:0; cursor:pointer; font-family:inherit;
  }
  .chairman-memory-toggle:hover{text-decoration:underline;}
  .chairman-memory-item{
    display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border-radius:9px;
    background:var(--bg-soft, #f6f7fb); border:1px solid var(--line); font-size:12px; line-height:1.6;
    transition:opacity .15s ease;
  }
  .chairman-memory-item.is-deleting{opacity:.4; pointer-events:none;}
  .chairman-memory-badge{
    flex:0 0 auto; font-weight:700; padding:2px 8px; border-radius:999px; font-size:11px;
    background:rgba(90,90,220,.12); color:var(--violet); white-space:nowrap;
  }
  .chairman-memory-body{flex:1 1 auto; min-width:0;}
  .chairman-memory-content{font-weight:500; color:var(--ink); margin:0; line-height:1.6; white-space:pre-wrap;}
  .chairman-memory-meta{color:var(--ink-faint); font-size:11px; margin:3px 0 0;}
  .chairman-memory-delete{
    flex:0 0 auto; background:none; border:none; cursor:pointer; font-size:13px; padding:2px 4px;
    opacity:.5; border-radius:6px;
  }
  .chairman-memory-delete:hover{opacity:1; background:rgba(220,38,38,.08);}
  .chairman-memory-empty{color:var(--ink-faint); font-size:12.5px; padding:6px 2px;}
  .chairman-memory-status{margin-top:10px; font-size:11.5px; color:var(--ink-faint);}
  .chairman-memory-status.is-error{color:var(--risk-high);}
  .chairman-memory-status.is-saving{color:var(--violet);}

  .brand-asset-current{
    display:flex; align-items:center; gap:14px; padding:12px; border-radius:9px;
    background:var(--bg-soft, #f6f7fb); border:1px solid var(--line); font-size:12.5px;
    color:var(--ink-faint); margin-bottom:14px; min-height:56px;
  }
  .brand-asset-preview{width:56px; height:56px; object-fit:contain; border-radius:8px; background:#fff; flex:0 0 auto;}
  .brand-asset-meta p{margin:0; line-height:1.6;}
  .brand-asset-meta-sub{color:var(--ink-faint); font-size:11px; margin-top:3px !important;}
  .brand-asset-form{display:flex; flex-wrap:wrap; gap:8px;}
  .brand-asset-form input[type="file"]{
    flex:0 0 auto; font-size:12px; font-family:inherit; color:var(--ink);
  }
  .brand-asset-desc-input{
    flex:1 1 320px; min-width:220px; padding:8px 12px; border-radius:8px; border:1px solid var(--line-strong);
    background:var(--paper); font-size:12.5px; font-family:inherit; color:var(--ink);
  }
  .brand-asset-desc-input:focus{outline:none; border-color:var(--gm);}
  .brand-asset-upload-btn{
    flex:0 0 auto; padding:8px 16px; border-radius:8px; border:1px solid var(--gm); background:var(--gm);
    color:#fff; font-size:12.5px; font-weight:600; font-family:inherit; cursor:pointer;
  }
  .brand-asset-upload-btn:hover{opacity:.9;}
  .brand-asset-status{margin-top:10px; font-size:11.5px; color:var(--ink-faint);}
  .brand-asset-status.is-error{color:var(--risk-high);}

  /* V74：AI Production Quality——成果待審卡片裡的檔案格式警示區塊，視覺上
     沿用病毒掃描 is-malicious 同一種「紅色系但不至於太刺眼」的警示語言，
     提醒董事長「這裡有疑慮」但不是阻擋核准的錯誤訊息。 */
  .approval-quality-warning{
    margin-top:11px; padding:9px 12px; border-radius:9px;
    background:rgba(220,38,38,.06); border:1px solid rgba(220,38,38,.22);
  }
  .approval-quality-warning-title{
    margin:0; font-size:12.5px; font-weight:600; color:var(--risk-high);
  }
  .approval-quality-warning-list{
    margin:6px 0 0; padding-left:18px; font-size:11.5px; color:var(--ink-soft); line-height:1.6;
  }
  .approval-quality-warning-list li{margin:2px 0;}

  /* V89：品保部（bc-qa）內部稽核報告卡片小標籤——用中性的紫色系（跟既有
     is-task-linked 的 --violet 同色系呼應），刻意不用紅／黃警示色，因為
     這不是在提醒「有問題」，只是標明「這張卡片的性質是內部稽核報告，不是
     等待上架交付中心的專案成品」，語意上是分類標籤而不是警告。 */
  .approval-audit-badge{
    display:inline-block; margin-left:6px; padding:1px 8px; border-radius:99px;
    font-size:10.5px; font-weight:600; color:var(--violet);
    background:rgba(124,58,237,.08); border:1px solid rgba(124,58,237,.22);
    vertical-align:middle;
  }

  /* V73：病毒掃描紀錄（Virus Scan）——純唯讀清單，三種 verdict 用左側色條
     區分（乾淨／惡意／未掃描），視覺語言延續部門知識庫／偏好中心的
     .{module}-item 卡片樣式，只是多了一個 verdict 專屬的邊框顏色。 */
  .virus-scan-config-hint{
    font-size:11.5px; color:var(--ink-faint); margin:0 0 10px;
  }
  .virus-scan-config-hint.is-warning{
    color:var(--risk-high); font-weight:600;
  }
  .virus-scan-list{display:flex; flex-direction:column; gap:8px;}
  .virus-scan-list.is-expanded{max-height:440px; overflow-y:auto; padding-right:6px;}
  .virus-scan-toggle{
    margin-top:10px; font-size:12px; font-weight:700; color:var(--violet);
    background:none; border:none; padding:0; cursor:pointer; font-family:inherit;
  }
  .virus-scan-toggle:hover{text-decoration:underline;}
  .virus-scan-item{
    display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border-radius:9px;
    background:var(--bg-soft, #f6f7fb); border:1px solid var(--line); border-left:3px solid var(--line-strong);
    font-size:12px; line-height:1.6;
  }
  .virus-scan-item.is-clean{border-left-color:rgba(16,163,74,.55);}
  .virus-scan-item.is-malicious{border-left-color:rgba(220,38,38,.6); background:rgba(220,38,38,.05);}
  .virus-scan-item.is-skipped{border-left-color:rgba(160,160,170,.5);}
  .virus-scan-badge{
    flex:0 0 auto; font-weight:700; padding:2px 8px; border-radius:999px; font-size:11px;
    white-space:nowrap; background:rgba(90,90,220,.1); color:var(--ink-soft);
  }
  .virus-scan-item.is-clean .virus-scan-badge{background:rgba(16,163,74,.12); color:#0f7a3d;}
  .virus-scan-item.is-malicious .virus-scan-badge{background:rgba(220,38,38,.14); color:var(--risk-high);}
  .virus-scan-body{flex:1 1 auto; min-width:0;}
  .virus-scan-filename{font-weight:600; color:var(--ink); margin:0; line-height:1.6;}
  .virus-scan-detail{color:var(--ink-soft); font-size:11.5px; margin:3px 0 0; line-height:1.5;}
  .virus-scan-meta{color:var(--ink-faint); font-size:11px; margin:3px 0 0;}
  .virus-scan-empty{color:var(--ink-faint); font-size:12.5px; padding:6px 2px;}
  .virus-scan-status{margin-top:10px; font-size:11.5px; color:var(--ink-faint);}
  .virus-scan-status.is-error{color:var(--risk-high);}

  /* V79：儲存空間清理（Storage Retention）——跟上面病毒掃描紀錄同一套視覺
     語言，差別是這裡只有兩種狀態（執行完成／執行時發生錯誤），不是三種
     verdict，class 名稱借用 is-clean／is-warning 而不是另外發明新的。 */
  .storage-retention-config-hint{
    font-size:11.5px; color:var(--ink-faint); margin:0 0 10px; line-height:1.6;
  }
  .storage-retention-list{display:flex; flex-direction:column; gap:8px;}
  .storage-retention-list.is-expanded{max-height:440px; overflow-y:auto; padding-right:6px;}
  .storage-retention-toggle{
    margin-top:10px; font-size:12px; font-weight:700; color:var(--violet);
    background:none; border:none; padding:0; cursor:pointer; font-family:inherit;
  }
  .storage-retention-toggle:hover{text-decoration:underline;}
  .storage-retention-item{
    display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border-radius:9px;
    background:var(--bg-soft, #f6f7fb); border:1px solid var(--line); border-left:3px solid var(--line-strong);
    font-size:12px; line-height:1.6;
  }
  .storage-retention-item.is-clean{border-left-color:rgba(16,163,74,.55);}
  .storage-retention-item.is-warning{border-left-color:rgba(217,119,6,.6); background:rgba(217,119,6,.05);}
  .storage-retention-badge{
    flex:0 0 auto; font-weight:700; padding:2px 8px; border-radius:999px; font-size:11px;
    white-space:nowrap; background:rgba(90,90,220,.1); color:var(--ink-soft);
  }
  .storage-retention-item.is-clean .storage-retention-badge{background:rgba(16,163,74,.12); color:#0f7a3d;}
  .storage-retention-item.is-warning .storage-retention-badge{background:rgba(217,119,6,.14); color:#a15c07;}
  .storage-retention-body{flex:1 1 auto; min-width:0;}
  .storage-retention-summary{font-weight:600; color:var(--ink); margin:0; line-height:1.6;}
  .storage-retention-detail{color:var(--ink-soft); font-size:11.5px; margin:3px 0 0; line-height:1.5;}
  .storage-retention-meta{color:var(--ink-faint); font-size:11px; margin:3px 0 0;}
  .storage-retention-empty{color:var(--ink-faint); font-size:12.5px; padding:6px 2px;}
  .storage-retention-status{margin-top:10px; font-size:11.5px; color:var(--ink-faint);}
  .storage-retention-status.is-error{color:var(--risk-high);}

  /* V74：交付品質規則（Delivery Quality Rules）——純唯讀清單，視覺語言延續
     病毒掃描／部門知識庫同一套 .{module}-item 卡片樣式。 */
  .delivery-quality-list{display:flex; flex-direction:column; gap:8px;}
  .delivery-quality-item{
    padding:10px 12px; border-radius:9px; border:1px solid var(--line);
    background:var(--bg-soft, rgba(0,0,0,.02));
  }
  .delivery-quality-label{margin:0; font-weight:600; color:var(--ink); font-size:13px;}
  .delivery-quality-rule{margin:4px 0 0; font-size:12px; color:var(--ink-soft); line-height:1.6;}
  .delivery-quality-keywords{margin:3px 0 0; font-size:11px; color:var(--ink-faint);}
  .delivery-quality-status{margin-top:10px; font-size:11.5px; color:var(--ink-faint);}
  .delivery-quality-status.is-error{color:var(--risk-high);}

  /* V65：部門知識庫 */
  .knowledge-dept-chips{display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px;}
  .knowledge-dept-chip{
    padding:6px 12px; border-radius:999px; border:1px solid var(--line-strong); background:var(--paper);
    font-size:12px; font-weight:600; color:var(--ink-soft); cursor:pointer; font-family:inherit;
  }
  .knowledge-dept-chip b{font-weight:700; color:var(--ink-faint); margin-left:2px;}
  .knowledge-dept-chip:hover{border-color:var(--gm); color:var(--gm);}
  .knowledge-dept-chip.is-active{background:var(--gm); border-color:var(--gm); color:#fff;}
  .knowledge-dept-chip.is-active b{color:rgba(255,255,255,.8);}
  .knowledge-list{display:flex; flex-direction:column; gap:8px;}
  .knowledge-list.is-expanded{max-height:440px; overflow-y:auto; padding-right:6px;}
  .knowledge-list-toggle{
    margin-top:10px; font-size:12px; font-weight:700; color:var(--violet);
    background:none; border:none; padding:0; cursor:pointer; font-family:inherit;
  }
  .knowledge-list-toggle:hover{text-decoration:underline;}
  .knowledge-item{
    display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border-radius:9px;
    background:var(--bg-soft, #f6f7fb); border:1px solid var(--line); font-size:12px; line-height:1.6;
  }
  .knowledge-item .knowledge-badge{
    flex:0 0 auto; font-weight:700; padding:2px 8px; border-radius:999px; font-size:11px;
    background:rgba(90,90,220,.12); color:var(--violet); white-space:nowrap;
  }
  .knowledge-item .knowledge-body{flex:1 1 auto; min-width:0;}
  .knowledge-item .knowledge-content{font-weight:500; color:var(--ink); margin:0; line-height:1.6;}
  .knowledge-item .knowledge-meta{color:var(--ink-faint); font-size:11px; margin:3px 0 0;}
  .knowledge-delete{
    flex:0 0 auto; background:none; border:none; cursor:pointer; font-size:13px; padding:2px 4px;
    opacity:.5; border-radius:6px;
  }
  .knowledge-delete:hover{opacity:1; background:rgba(220,38,38,.08);}
  .knowledge-status{margin-top:10px; font-size:11.5px; color:var(--ink-faint);}
  .knowledge-status.is-error{color:var(--risk-high);}
  .board-sync-status{margin-top:8px; font-size:11px; color:var(--ink-faint);}
  .board-sync-status.is-error{color:var(--risk-high);}
  .bc-demo-tag{
    margin-left:6px; font-style:normal; color:var(--ink-faint);
    border:1px solid var(--line-strong); border-radius:999px; padding:1px 7px; font-size:9.5px;
  }

  /* ---------- V6: 交付中心 Delivery Center ---------- */
  .delivery{padding:30px 0 6px;}
  /* V37：原本是大卡片＋96px高的色塊縮圖，董事長反應「版面太大、色塊不知道
     幹嘛用」，改成類似雲端硬碟／共用資料夾的緊湊清單，一列一個項目，
     色塊縮圖換成一個小圖示，大幅降低每筆項目占用的高度。 */
  .delivery-list{
    margin-top:16px; display:flex; flex-direction:column;
    border:1px solid var(--line); border-radius:var(--radius-md); overflow:hidden;
    background:var(--card); box-shadow:var(--shadow);
  }
  .dlist-row{
    display:flex; align-items:center; gap:12px; padding:11px 16px;
    border-bottom:1px solid var(--line); transition:background .12s ease;
  }
  .dlist-row:last-child{border-bottom:none;}
  .dlist-row:hover{background:var(--paper);}
  .dlist-icon{
    flex:none; width:32px; height:32px; border-radius:8px; display:flex;
    align-items:center; justify-content:center; font-size:14px; color:#fff;
  }
  .dlist-main{flex:1 1 auto; min-width:0;}
  .dlist-title{
    font-weight:700; font-size:13px; color:var(--ink);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .dlist-desc{
    font-size:11.5px; color:var(--ink-soft); margin-top:2px;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .dlist-meta{display:flex; align-items:center; gap:6px; flex:none;}
  .dlist-dept-ava{--ava-size:21px;}
  .dlist-time{font-size:10.5px; color:var(--ink-faint); white-space:nowrap;}
  .dlist-actions{display:flex; gap:6px; flex:none;}
  .dlist-btn{
    padding:6px 12px; border-radius:8px; font-size:11.5px; font-weight:600;
    text-decoration:none; cursor:pointer; font-family:inherit; white-space:nowrap;
    border:1px solid var(--line-strong); color:var(--ink-soft); background:var(--paper);
    transition:opacity .15s ease;
  }
  .dlist-btn:hover{border-color:var(--violet); color:var(--violet);}
  .dlist-btn-primary{background:var(--gm); color:#fff; border:none;}
  .dlist-btn-primary:hover{opacity:.9; color:#fff;}
  /* V24：交付中心尚未有真實網址／檔案時的鎖定狀態，跟正常按鈕明顯區隔，
     滑鼠移過去的提示文字會誠實說明原因，不會讓人誤以為連結壞掉 */
  .dlist-btn.is-disabled{cursor:not-allowed; opacity:.6;}
  .dlist-btn.is-disabled:hover{border-color:var(--line-strong); color:var(--ink-faint);}
  /* V41：交付中心真實項目的編輯／刪除按鈕，跟看Demo／下載的按鈕放在同一排，
     用比較低調的顏色跟主要動作（看Demo）區分開來 */
  .dlist-btn-edit{color:var(--ink-faint);}
  .dlist-btn-edit:hover{border-color:var(--gm); color:var(--gm);}
  .dlist-btn-delete{color:var(--risk-high);}
  .dlist-btn-delete:hover{border-color:var(--risk-high); background:var(--risk-high-bg, rgba(220,38,38,.08));}
  .delivery-edit-banner{
    margin:10px 0 4px; padding:8px 12px; border-radius:var(--radius-sm, 8px);
    background:var(--paper); border:1px dashed var(--gm); font-size:12.5px; color:var(--ink);
    display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  }
  .delivery-edit-banner button{
    font-size:11.5px; padding:3px 8px; border-radius:6px; border:1px solid var(--line-strong);
    background:var(--card); cursor:pointer; color:var(--ink-faint);
  }
  .delivery-edit-banner button:hover{border-color:var(--violet); color:var(--violet);}
  @media (max-width:640px){
    .dlist-row{flex-wrap:wrap;}
    .dlist-desc{white-space:normal;}
    .dlist-meta{order:3; flex:1 0 100%; margin-top:4px;}
    .task-done-item{flex-wrap:wrap;}
    .task-done-item-title{flex:1 1 100%; white-space:normal;}
    .task-done-meta{flex:1 0 100%;}
  }

  /* V31：交付中心串接 Cloudflare R2 後新增的畫面元素 */
  .delivery-sync-status{margin-top:10px; font-size:11.5px; color:var(--ink-faint);}
  .delivery-sync-status.is-error{color:var(--risk-high);}
  .delivery-demo-tag{margin-left:6px;}
  .delivery-workspace-tag{margin-left:6px; background:rgba(90,90,220,.12); color:var(--violet); border-color:transparent;}

  /* ---------- V51：Project Workspace 專案卡片（一個專案一張卡片，裡面列出檔案清單）---------- */
  .workspace-projects{display:flex; flex-direction:column; gap:12px; margin-top:16px;}
  .workspace-project-card{
    border:1px solid var(--line); border-radius:var(--radius-md); background:var(--card);
    box-shadow:var(--shadow); overflow:hidden;
  }
  .workspace-project-head{display:flex; align-items:flex-start; gap:10px; padding:12px 16px; flex-wrap:wrap;}
  .workspace-project-icon{font-size:18px; flex:none; margin-top:1px;}
  .workspace-project-main{flex:1 1 260px; min-width:0;}
  .workspace-project-title{font-weight:700; font-size:13.5px; color:var(--ink);}
  .workspace-project-desc{font-size:11.5px; color:var(--ink-soft); margin-top:2px;}
  .workspace-project-meta{
    display:flex; align-items:center; gap:8px; flex:none; font-size:10.5px; color:var(--ink-faint);
    white-space:nowrap;
  }
  .workspace-project-files{border-top:1px dashed var(--line); background:var(--paper);}
  .workspace-file-row{
    display:flex; align-items:center; gap:10px; padding:8px 16px; text-decoration:none;
    border-bottom:1px solid var(--line); transition:background .12s ease;
  }
  .workspace-file-row:last-child{border-bottom:none;}
  .workspace-file-row:hover{background:var(--card);}
  .workspace-file-icon{font-size:13px; flex:none;}
  .workspace-file-name{flex:1 1 auto; min-width:0; font-size:12px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .workspace-file-size{flex:none; font-size:10.5px; color:var(--ink-faint);}
  .workspace-project-empty{padding:10px 16px; font-size:11.5px; color:var(--ink-faint);}
  .workspace-project-delete{
    flex:none; border:1px solid var(--line); background:#fff; border-radius:8px; width:24px; height:24px;
    font-size:12px; cursor:pointer; color:var(--ink-faint); line-height:1; transition:all .12s ease;
  }
  .workspace-project-delete:hover{color:var(--risk-high); border-color:var(--risk-high);}
  .workspace-project-delete:disabled{opacity:.5; cursor:default;}
  .workspace-projects-toggle{
    display:block; width:100%; margin-top:8px; padding:9px; border:1px dashed var(--line); border-radius:10px;
    background:#fff; color:var(--ink-soft); font-size:12px; cursor:pointer; transition:background .12s ease;
  }
  .workspace-projects-toggle:hover{background:var(--card);}
  @media (max-width:640px){
    .workspace-project-head{flex-wrap:wrap;}
    .workspace-project-meta{flex:1 0 100%; margin-top:4px;}
  }

  .delivery-upload-panel{margin-top:18px; border-top:1px dashed var(--line-strong); padding-top:16px;}
  .delivery-upload-panel summary{
    cursor:pointer; font-size:12.5px; font-weight:600; color:var(--violet); list-style:none;
  }
  .delivery-upload-panel summary::-webkit-details-marker{display:none;}
  .delivery-upload-form{
    margin-top:14px; display:flex; flex-direction:column; gap:12px;
    background:var(--paper); border:1px solid var(--line); border-radius:var(--radius-md); padding:16px;
  }
  /* V37：Demo／下載檔案包各自的小節標題，說明「網址或檔案擇一」 */
  .delivery-upload-subhead{
    font-size:11px; font-weight:700; color:var(--ink-faint); margin:4px 0 -2px;
    padding-top:8px; border-top:1px dashed var(--line);
  }
  .delivery-field{display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--ink-soft); font-weight:600;}
  .delivery-field input[type="text"],
  .delivery-field input[type="url"],
  .delivery-field input[type="file"],
  .delivery-field textarea{
    font-family:inherit; font-size:12.5px; color:var(--ink); background:var(--card);
    border:1px solid var(--line-strong); border-radius:9px; padding:8px 10px; resize:vertical;
  }
  .delivery-field input[type="text"]:focus,
  .delivery-field input[type="url"]:focus,
  .delivery-field textarea:focus{outline:none; border-color:var(--violet);}
  .delivery-contrib-list{display:flex; flex-wrap:wrap; gap:8px;}
  .delivery-contrib-chip{
    display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:500;
    color:var(--ink-soft); background:var(--card); border:1px solid var(--line-strong);
    border-radius:999px; padding:4px 10px; cursor:pointer;
  }
  .delivery-contrib-chip input{margin:0;}
  .delivery-check-field{display:flex; align-items:center; gap:8px; font-size:12px; color:var(--ink-soft); cursor:pointer;}
  .delivery-upload-form button[type="submit"]{
    align-self:flex-start; background:var(--gm); color:#fff; border:none; border-radius:9px;
    padding:9px 18px; font-size:12.5px; font-weight:600; cursor:pointer; font-family:inherit;
    transition:opacity .15s ease;
  }
  .delivery-upload-form button[type="submit"]:hover{opacity:.9;}
  .delivery-upload-form button:disabled,
  .delivery-upload-form input:disabled,
  .delivery-upload-form textarea:disabled{opacity:.55; cursor:not-allowed;}
  .delivery-upload-hint{font-size:11px; color:var(--ink-faint); margin:0;}
  .delivery-upload-status{font-size:11.5px; color:var(--risk-low); margin:0;}
  .delivery-upload-status.is-error{color:var(--risk-high);}

  /* ---------- V6: 通用檔案附件（非圖片／影片） ---------- */
  .file-chip{
    display:flex; align-items:center; gap:9px; padding:10px 12px; border-radius:12px;
    background:var(--card); border:1px solid var(--line); max-width:230px;
  }
  .msg-user .file-chip{background:rgba(255,255,255,0.08); border-color:rgba(255,255,255,0.18);}
  .file-chip-icon{
    flex-shrink:0; width:34px; height:34px; border-radius:8px; background:var(--gm);
    display:flex; align-items:center; justify-content:center; color:#fff;
  }
  .file-chip-icon svg{width:17px; height:17px;}
  .file-chip-info{min-width:0; display:flex; flex-direction:column; gap:1px;}
  .file-chip-name{font-size:12px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .msg-user .file-chip-name{color:#fff;}
  .file-chip-size{font-size:10.5px; color:var(--ink-faint);}
  .msg-user .file-chip-size{color:rgba(255,255,255,.65);}
  .attach-preview .chip .file-chip-icon{width:30px; height:30px;}
  .attach-preview .chip .file-chip-icon svg{width:15px; height:15px;}
