/* 表單填寫清單：文字欄填滿，刪除鈕維持窄欄。 */
.list-item:has(> input[data-portal-list-edit]) {
  grid-template-columns: minmax(0, 1fr) 32px !important;
}

.list-item:has(> input[data-portal-list-edit]) > input {
  grid-column: 1 !important;
  width: 100%;
  min-width: 0;
  height: 37px;
  padding: 0 10px;
  border: 0;
  outline: 0;
  font: 12px "Microsoft JhengHei", sans-serif;
}

.list-item:has(> input[data-portal-list-edit]) > button {
  grid-column: 2 !important;
  width: 32px;
  min-width: 32px;
  padding: 0 !important;
}
.home-live-sections{display:grid;gap:18px;margin:18px 0}
.home-data-section{overflow:hidden;border:1px solid #d7e0ea;border-radius:14px;background:#fff;box-shadow:0 6px 22px #17324d0a}
.home-data-section>.portal-section-head{margin:0;padding:16px 18px;border-bottom:1px solid #e1e7ee}
.home-data-section>.portal-section-head h2{margin:0;font-size:19px}
.home-data-section>.portal-section-head p{margin:4px 0 0;color:#6c7b90;font-size:12px}
.home-data-section>.portal-section-head button{align-self:center;border:1px solid #1d5795;border-radius:8px;padding:8px 12px;background:#fff;color:#174b83;font-weight:700;cursor:pointer}
.home-table-wrap{overflow:auto}
.home-table{width:100%;min-width:720px;border-collapse:collapse;table-layout:auto}
.home-table th,.home-table td{padding:10px 12px;border-right:1px solid #dbe3ec;border-bottom:1px solid #dbe3ec;text-align:center;white-space:nowrap}
.home-table thead th{background:#183f68;color:#fff;font-size:12px}
.home-table tbody th{background:#f7f9fc;color:#173f68;text-align:left}
.home-table .bad-count{color:#c5221f;font-weight:800}
.home-failed-list{padding:14px 18px 18px}
.home-failed-list h3{margin:0 0 8px;font-size:15px}
.home-failed-list>button{display:grid;grid-template-columns:130px minmax(180px,1fr) 110px;gap:10px;align-items:center;width:100%;padding:9px 11px;border:0;border-top:1px solid #e4e9ef;background:#fff;text-align:left;cursor:pointer}
.home-failed-list>button:hover{background:#f0f6ff}
.home-failed-list b{color:#c5221f}.home-failed-list span{overflow:hidden;text-overflow:ellipsis}.home-failed-list time{text-align:right;color:#65758b}
.annual-summary .summary-level{font-weight:800;white-space:nowrap}.annual-summary .summary-level.lv3{color:#e00000}.annual-summary .summary-level.lv4{color:#111}
.compact-response-table{table-layout:auto!important;min-width:100%!important;width:max-content!important}
.compact-response-table th,.compact-response-table td{width:1%!important;min-width:0!important;vertical-align:top;white-space:nowrap}
.ir-response-table.compact-response-table th:nth-child(3),.ir-response-table.compact-response-table td:nth-child(3){width:1%!important;min-width:0!important;white-space:nowrap!important}
.compact-response-table th:nth-child(5),.compact-response-table td:nth-child(5){width:100%!important;min-width:210px!important;white-space:normal}
.response-system-line,.response-location-line,.response-points>span{display:block;min-height:24px;padding:3px 0;border-bottom:1px dashed #e1e6ed}
.response-system-line:last-child,.response-location-line:last-child,.response-points>span:last-of-type{border-bottom:0}
.response-points b{display:block;margin-top:4px;padding-top:4px;border-top:1px solid #bdc9d8;color:#174b8c;white-space:nowrap}
.list-manager-shell{align-items:start!important}
.list-category-nav{position:sticky!important;top:94px!important;max-height:calc(100vh - 118px);overflow:auto!important;align-self:start}
.list-item{grid-template-columns:32px minmax(260px,1fr) 62px 32px!important}
.list-item.with-option{grid-template-columns:32px minmax(260px,1fr) minmax(88px,max-content) 62px 32px!important}
.portal-department-row{grid-template-columns:minmax(0,1fr) 76px 34px!important}
.portal-system-row{grid-template-columns:minmax(220px,1fr) minmax(150px,220px) 76px 34px!important}
.portal-simple-row{grid-template-columns:minmax(0,1fr) 62px 34px!important}
.portal-engineer-row{grid-template-columns:minmax(110px,160px) minmax(0,1fr) 76px 34px!important}
.portal-department-row>input,.portal-system-row>input,.portal-system-row>select{min-width:0;height:38px;padding:0 10px;border:0;background:#fff;font:12px "Microsoft JhengHei",sans-serif;outline:0}
.portal-simple-row>input,.portal-engineer-row>input,.portal-engineer-row>select{min-width:0;height:38px;box-sizing:border-box;padding:0 10px;border:0;background:#fff;font:12px "Microsoft JhengHei",sans-serif;outline:0}
.portal-engineer-row>input,.portal-engineer-row>.list-order-actions{border-left:1px solid #e1e5eb}
.portal-system-row>select{border-left:1px solid #e1e5eb}
.portal-department-row>input:focus,.portal-system-row>input:focus,.portal-system-row>select:focus,.portal-simple-row>input:focus,.portal-engineer-row>input:focus,.portal-engineer-row>select:focus{background:#fff8c7}
.unified-list-order{display:grid!important;grid-template-columns:1fr 1fr!important;width:76px!important;min-width:76px!important;visibility:visible!important;opacity:1!important;border-left:1px solid #e1e5eb;background:#f8fafc}
.unified-list-order>button{display:flex!important;align-items:center!important;justify-content:center!important;min-width:0!important;height:38px!important;padding:0!important;border:0!important;background:#f8fafc!important;color:#174b8c!important;font:900 18px/1 Arial,sans-serif!important;visibility:visible!important;cursor:pointer!important}
.unified-list-order>button+button{border-left:1px solid #e1e5eb!important}
.unified-list-order>button:hover:not(:disabled){background:#dceaff!important}
.unified-list-order>button:disabled{color:#c7d0dc!important;cursor:default!important}
.portal-source-order-row{grid-template-columns:minmax(0,1fr) 76px 34px!important}
.portal-source-engineer-row{grid-template-columns:minmax(110px,160px) minmax(0,1fr) 76px 34px!important}
.portal-source-order-row>input,.portal-source-engineer-row>input,.portal-source-engineer-row>select{min-width:0;height:38px;box-sizing:border-box;padding:0 10px;border:0;background:#fff;font:12px "Microsoft JhengHei",sans-serif;outline:0}
.portal-source-engineer-row>input,.portal-source-order{border-left:1px solid #e1e5eb}
.portal-source-order{display:grid!important;grid-template-columns:1fr 1fr!important;width:76px!important;min-width:76px!important;visibility:visible!important}
.portal-source-order>button{display:flex!important;align-items:center!important;justify-content:center!important;height:38px!important;padding:0!important;color:#174b8c!important;font:900 18px/1 Arial,sans-serif!important}
.portal-source-order>button:disabled{color:#c7d0dc!important}
.system-list-add{grid-template-columns:minmax(180px,1fr) minmax(150px,220px) auto!important}
.system-list-add select{height:36px;padding:0 10px;border:1px solid #cad3df;border-radius:6px;background:#fff;font:12px "Microsoft JhengHei",sans-serif}
.list-delete{width:32px!important;min-width:32px!important;padding:0!important}
.portal-list-simple .list-item{grid-template-columns:minmax(300px,1fr) 32px!important}
.portal-list-system .list-item{grid-template-columns:minmax(260px,1fr) minmax(300px,1fr) 32px!important}
.portal-list-engineer .list-item{grid-template-columns:minmax(70px,max-content) minmax(250px,1fr) 32px!important}
.portal-list-engineer .list-add{grid-template-columns:max-content minmax(250px,1fr) auto!important}
.portal-list-engineer .list-add select{width:max-content;min-width:80px}
.record-context-menu{position:fixed;z-index:3000;min-width:125px;padding:5px;border:1px solid #cdd6e1;border-radius:8px;background:#fff;box-shadow:0 12px 32px #17233d30}
.record-context-menu button{width:100%;padding:8px 12px;border:0;border-radius:5px;background:#fff;color:#b42318;text-align:left;cursor:pointer}
.record-context-menu button:hover{background:#fff0f0}
.notion-toolbar{position:relative;gap:7px!important}
.notion-toolbar select,.notion-toolbar input{height:38px;border:1px solid #cbd7e4;border-radius:8px;padding:0 10px;background:#fff}
@media (hover:hover) and (pointer:fine){
  .brand-menu-wrap:hover .brand-hamburger{opacity:1;transform:none}
}
@media(max-width:900px){.home-failed-list>button{grid-template-columns:115px minmax(180px,1fr) 95px}.home-table{min-width:780px}}

/* 系統別與美光工程師清單：左側選擇欄固定寬度，名稱欄填滿。 */
.portal-list-system .list-item,
.list-item:has(> select[data-system-department]) {
  grid-template-columns: 130px minmax(0, 1fr) 32px !important;
}
.portal-list-system .list-item > select,
.list-item:has(> select[data-system-department]) > select {
  grid-column: 1 !important;
  width: 130px;
  min-width: 130px;
}
.portal-list-system .list-item > input,
.list-item:has(> select[data-system-department]) > input {
  grid-column: 2 !important;
  width: 100%;
  min-width: 0;
}
.portal-list-system .list-item > button,
.list-item:has(> select[data-system-department]) > button {
  grid-column: 3 !important;
}
.list-item:has(> select[data-engineer-department]) {
  grid-template-columns: 130px minmax(0, 1fr) 32px !important;
}
.list-item:has(> select[data-engineer-department]) > select {
  grid-column: 1 !important;
  width: 130px;
  min-width: 130px;
}
.list-item:has(> select[data-engineer-department]) > input {
  grid-column: 2 !important;
  width: 100%;
  min-width: 0;
}
.list-item:has(> select[data-engineer-department]) > button {
  grid-column: 3 !important;
}
.portal-list-system .list-add {
  grid-template-columns: 130px minmax(0, 1fr) auto !important;
}
.portal-list-system .list-add select { width:130px; min-width:130px; }


/* 頂端固定模組選單：取消三條線，五個入口平均排列。 */
#appMenuToggle{display:none!important}
.brand-menu-wrap{display:contents}
.app-switch-menu,#appMenu[hidden]{display:flex!important;position:static!important;transform:none!important;min-width:0!important;box-shadow:none!important;border:0!important;background:transparent!important;gap:2px}
.app-switch-menu button{border:0!important;background:transparent!important;color:#dce7f6!important;padding:8px 12px!important;border-radius:7px!important;white-space:nowrap}
.app-switch-menu button.active{background:#ffffff20!important;color:#fff!important}
@media (hover:hover) and (pointer:fine){
  .app-switch-menu button:hover{background:#ffffff20!important;color:#fff!important}
}
.brand-area{min-width:0;flex:1}

/* v47：清單列左側三條線拖曳排序，↑／↓ 固定在刪除 X 左邊。 */
.portal-drag-handle,.list-drag-handle{display:flex!important;align-items:center!important;justify-content:center!important;width:32px!important;min-width:32px!important;height:38px!important;padding:0!important;border:0!important;border-right:1px solid #e1e5eb!important;background:#f8fafc!important;color:#6f8198!important;font:900 17px/1 Arial,sans-serif!important;cursor:grab!important;touch-action:none!important;user-select:none!important}
.portal-drag-handle:active,.list-drag-handle:active{cursor:grabbing!important;background:#e7f0ff!important;color:#174b8c!important}
.list-item.dragging{outline:2px solid #2b6cb0!important;background:#edf4ff!important}
.list-item.drag-over{box-shadow:inset 0 2px 0 #2b6cb0!important}
.portal-source-order-row,.portal-department-row,.portal-simple-row{grid-template-columns:32px minmax(0,1fr) 76px 34px!important}
.portal-source-engineer-row,.portal-engineer-row{grid-template-columns:32px minmax(110px,160px) minmax(0,1fr) 76px 34px!important}
.portal-system-row,.portal-list-system .list-item.portal-system-row,.list-item.portal-system-row:has(> select[data-system-department]){grid-template-columns:32px minmax(220px,1fr) minmax(150px,220px) 76px 34px!important}
.portal-source-order-row>input,.portal-department-row>input,.portal-simple-row>input,.portal-system-row>input,.portal-source-engineer-row>select,.portal-source-engineer-row>input,.portal-engineer-row>select,.portal-engineer-row>input,.list-item.portal-system-row:has(> select[data-system-department])>input,.list-item.portal-system-row:has(> select[data-system-department])>select{grid-column:auto!important;width:100%!important;min-width:0!important}
.portal-system-row>select[data-system-department],.list-item.portal-system-row:has(> select[data-system-department])>select{min-width:150px!important}
.portal-source-order,.portal-source-order-row>.list-order-actions,.portal-department-row>.list-order-actions,.portal-system-row>.list-order-actions,.portal-simple-row>.list-order-actions,.portal-engineer-row>.list-order-actions{grid-column:auto!important;display:grid!important;grid-template-columns:1fr 1fr!important;width:76px!important;min-width:76px!important;border-left:1px solid #e1e5eb!important;background:#f8fafc!important;visibility:visible!important}
.portal-source-order>button,.portal-source-order-row>.list-order-actions>button,.portal-department-row>.list-order-actions>button,.portal-system-row>.list-order-actions>button,.portal-simple-row>.list-order-actions>button,.portal-engineer-row>.list-order-actions>button{display:flex!important;align-items:center!important;justify-content:center!important;height:38px!important;min-width:0!important;padding:0!important;border:0!important;background:#f8fafc!important;color:#174b8c!important;font:900 18px/1 Arial,sans-serif!important;cursor:pointer!important}
.portal-source-order>button+button,.portal-source-order-row>.list-order-actions>button+button,.portal-department-row>.list-order-actions>button+button,.portal-system-row>.list-order-actions>button+button,.portal-simple-row>.list-order-actions>button+button,.portal-engineer-row>.list-order-actions>button+button{border-left:1px solid #e1e5eb!important}
.portal-source-order>button:disabled,.portal-source-order-row>.list-order-actions>button:disabled,.portal-department-row>.list-order-actions>button:disabled,.portal-system-row>.list-order-actions>button:disabled,.portal-simple-row>.list-order-actions>button:disabled,.portal-engineer-row>.list-order-actions>button:disabled{color:#c7d0dc!important;cursor:default!important}
.portal-source-order-row>.list-delete,.portal-department-row>.list-delete,.portal-system-row>.list-delete,.portal-simple-row>.list-delete,.portal-source-engineer-row>.list-delete,.portal-engineer-row>.list-delete,.list-item.portal-system-row:has(> select[data-system-department])>button.list-delete,.list-item.portal-engineer-row:has(> select[data-engineer-department])>button.list-delete{grid-column:auto!important;width:32px!important;min-width:32px!important}
#appTitle{display:none}
#reportListSort{width:100%;margin-top:9px;padding:9px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:#263147;font:13px "Microsoft JhengHei",sans-serif}
.home-live-sections .home-data-section{margin-top:0}
.home-live-sections .home-data-section .portal-section-head{margin-top:0}
@media(max-width:900px){.app-switch-menu button{padding:7px 7px!important;font-size:12px}.environment{display:none}}


/* 避免頂端模組按鈕在窄畫面互相重疊。 */
.topbar{gap:10px;overflow:hidden}
.brand-area{overflow:hidden}
.app-switch-menu,#appMenu[hidden]{
  flex:1 1 auto!important;
  width:auto!important;
  min-width:0!important;
  justify-content:space-evenly!important;
  overflow-x:auto!important;
  scrollbar-width:none;
}
.app-switch-menu::-webkit-scrollbar{display:none}
.app-switch-menu button{
  flex:0 0 auto!important;
  min-width:max-content!important;
  line-height:1.2!important;
}
@media(max-width:700px){
  .topbar{padding:0 8px!important}
  .app-switch-menu,#appMenu[hidden]{justify-content:flex-start!important}
  .app-switch-menu button{padding:8px 9px!important;font-size:12px!important}
  .user-box{margin-left:auto}
}


/* 修復舊下拉選單寬度與頂端自動收合規則。 */
.topbar{
  position:sticky!important;
  top:0!important;
  transform:none!important;
  height:58px!important;
  z-index:500!important;
}
.topbar::after{display:none!important}
.app-switch-menu button{
  display:block!important;
  width:auto!important;
  text-align:center!important;
}


/* 頂端帳號選單不被固定列裁切。 */
.topbar{overflow:visible!important}
.account-menu-wrap{position:relative;z-index:600}
.app-version{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:34px;height:28px;padding:0 6px;border-left:1px solid #ffffff40;color:#cbd6e8;font:700 11px "Microsoft JhengHei",sans-serif;white-space:nowrap}
@media(max-width:650px){.app-version{min-width:30px;padding:0 4px;font-size:10px}}
#accountMenu{z-index:700!important}

/* v121：停用舊版「移入才展開 Header」；該機制會在觸控裝置造成持續 hover 與版面位移。 */
.topbar,
.topbar:focus-within,
.topbar.touch-open{
  position:sticky!important;
  top:0!important;
  left:auto!important;
  right:auto!important;
  height:58px!important;
  transform:none!important;
  transition:box-shadow .18s ease!important;
  overflow:visible!important;
  z-index:1000!important;
}
.topbar::after{display:none!important;content:none!important}
@media (hover:hover) and (pointer:fine){
  .topbar:hover{transform:none!important;box-shadow:0 3px 12px #0b142855!important}
}
.home-report-summary{margin-top:18px!important}
.home-report-summary .home-table th,.home-report-summary .home-table td{text-align:center}
.home-report-summary .home-table th:first-child{text-align:left;white-space:nowrap}

.home-ir-worklog-card{display:flex;align-items:center;gap:28px;margin:18px 0;padding:14px 18px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:0 6px 18px #22304c0d}
.home-ir-worklog-card>div{display:grid;grid-template-columns:auto auto;column-gap:10px;align-items:baseline;min-width:128px}
.home-ir-worklog-card small{grid-column:1/-1;color:var(--muted)}
.home-ir-worklog-card b{font-size:24px}
.home-ir-worklog-card span{color:var(--muted);font-size:13px}
.home-ir-worklog-card p{margin:0 0 0 auto;color:#284369;font-weight:700;white-space:normal}
@media(max-width:700px){.home-ir-worklog-card{gap:12px;flex-wrap:wrap}.home-ir-worklog-card p{width:100%;margin:0}.home-ir-worklog-card>div{min-width:110px}}

.home-worklog-summary{margin-top:18px!important}
.home-worklog-summary .home-table th,.home-worklog-summary .home-table td,.home-report-summary .home-table th,.home-report-summary .home-table td{text-align:center}
.home-worklog-summary .home-table th:first-child,.home-report-summary .home-table th:first-child{text-align:left;white-space:nowrap}
.home-stat-title{margin:0;padding:10px 14px;font-size:18px;font-weight:700;color:var(--ink);background:#fff;border:1px solid var(--line);border-bottom:0;border-radius:12px 12px 0 0}
.home-stat-title+.home-table-wrap{border-radius:0 0 12px 12px}
.home-worklog-summary .home-table,.home-report-summary .home-table{width:100%;table-layout:fixed}
.home-worklog-summary .home-table .home-case-column,.home-report-summary .home-table .home-case-column{width:27%}
.home-worklog-summary .home-table tbody tr:nth-child(odd)>*,.home-report-summary .home-table tbody tr:nth-child(odd)>*{background:#fff!important}
.home-worklog-summary .home-table tbody tr:nth-child(even)>*,.home-report-summary .home-table tbody tr:nth-child(even)>*{background:#edf6ff!important}
.home-worklog-summary .home-table th,.home-worklog-summary .home-table td,.home-report-summary .home-table th,.home-report-summary .home-table td{white-space:normal!important;overflow-wrap:anywhere;word-break:break-word}
.home-job-note{display:block;width:100%;min-width:0;min-height:30px;box-sizing:border-box;border:1px solid transparent;border-radius:5px;background:transparent;padding:5px 7px;font:inherit;line-height:1.45;color:inherit;resize:none;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere}
.home-job-note:not([readonly]):hover,.home-job-note:not([readonly]):focus{border-color:#9bbce2;background:#fff;outline:0}
.home-job-note[readonly]{border:0;cursor:default}
.record:not(.summary-record){grid-template-columns:31px minmax(0,1fr) auto!important;grid-template-rows:auto auto!important;align-items:center!important}
.record .record-location{grid-column:2;grid-row:1;min-width:0;margin:0!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.record .record-status{grid-column:3;grid-row:1;min-width:36px;text-align:center;justify-self:end}
.record .record-equipment{grid-column:1/-1;grid-row:2;display:block;min-width:0;padding:5px 7px;border:0!important;border-radius:0!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#17233d!important}
.record .record-equipment.good{background:#e2f6ed!important}
.record .record-equipment.bad{background:#fde8e9!important}
.record .record-equipment.wait{background:#fff1d9!important}
/* 出工回覆：完成點數與美光工程師放在同一列。 */
.detail-completion-engineer-row{display:grid;grid-template-columns:minmax(140px,1fr) minmax(0,3fr);align-items:stretch;border-bottom:1px solid #e7ebf0}
.detail-completion-engineer-row>.detail-points-field{justify-content:center;padding:14px;border-right:1px solid #e7ebf0}
.detail-engineer-fields{min-width:0;padding:10px 14px}
.detail-engineer-fields>h3{margin:0 0 7px;color:#35445b;font-size:13px}
.detail-engineer-selectors{display:grid;grid-template-columns:minmax(105px,1fr) minmax(0,3fr);gap:9px;align-items:start}
.detail-engineer-selectors>.single-choice-field{min-width:0;padding:0;border:0}
.detail-engineer-selectors .ir-choice-control,.detail-engineer-selectors .ir-choice-control>input{min-width:0;width:100%}
@media(max-width:680px){.detail-completion-engineer-row{grid-template-columns:1fr}.detail-completion-engineer-row>.detail-points-field{border-right:0;border-bottom:1px solid #e7ebf0}.detail-engineer-selectors{grid-template-columns:minmax(90px,1fr) minmax(0,2fr)}}
/* IR Team 出工：外層可縮放，表格本身仍保留橫向捲動。 */
.worklog-shell,.worklog-content,.worklog-dashboard,.worklog-list-card{min-width:0}
.worklog-list-card .worklog-card-head{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,auto);align-items:center;gap:12px}
.worklog-list-card .worklog-card-head>div:first-child{min-width:0}
.worklog-list-card .worklog-card-head>div:first-child h2{white-space:nowrap}
.worklog-list-card .worklog-card-head>div:last-child{display:flex;min-width:0;align-items:center;justify-content:flex-end;gap:7px}
.worklog-list-card .worklog-card-head #worklogSearch{width:clamp(110px,22vw,220px);min-width:0}
.worklog-list-card .worklog-card-head #addWorklogJob{flex:0 0 auto;white-space:nowrap}
@media(max-width:620px){
  .worklog-module{padding:6px!important}
  .worklog-shell{height:calc(100vh - 12px)}
  .worklog-content{padding-left:10px;padding-right:10px}
  .worklog-page-head{margin-left:-10px;margin-right:-10px;padding-left:10px;padding-right:10px}
  .worklog-list-card .worklog-card-head{grid-template-columns:minmax(92px,1fr) minmax(0,1.8fr);padding:9px 10px;gap:7px}
  .worklog-list-card .worklog-card-head>div:first-child h2{font-size:15px}
  .worklog-list-card .worklog-card-head>div:first-child p{display:none}
  .worklog-list-card .worklog-card-head #worklogSearch{flex:1 1 auto;width:auto;min-width:70px}
  .worklog-list-card .worklog-card-head #addWorklogJob{padding:0 8px;font-size:11px}
}


.detail-summary,.response-points>span{display:block;min-height:24px;line-height:24px;padding:3px 0;border-bottom:1px dashed #e1e6ed}
.detail-summary:last-child,.response-points>span:last-child{border-bottom:0}
.ir-response-table td.response-points{vertical-align:top;font-weight:800;color:#174b8c}

/* v48：課別、系統別、美光工程師統一為「拖曳｜選項｜↑｜↓｜X」橫向排列。 */
#worklogContent .list-item.portal-source-order-row,#worklogContent .list-item.portal-department-row,#worklogContent .list-item.portal-simple-row{display:grid!important;grid-template-columns:32px minmax(0,1fr) 76px 34px!important;grid-template-rows:38px!important;min-height:38px!important;align-items:stretch!important}
#worklogContent .list-item.portal-source-engineer-row,#worklogContent .list-item.portal-engineer-row{display:grid!important;grid-template-columns:32px minmax(110px,160px) minmax(0,1fr) 76px 34px!important;grid-template-rows:38px!important;min-height:38px!important;align-items:stretch!important}
#worklogContent .list-item.portal-system-row{display:grid!important;grid-template-columns:32px minmax(180px,1fr) minmax(150px,220px) 76px 34px!important;grid-template-rows:38px!important;min-height:38px!important;align-items:stretch!important}
#worklogContent .list-item.portal-source-order-row>.portal-drag-handle,#worklogContent .list-item.portal-department-row>.portal-drag-handle,#worklogContent .list-item.portal-simple-row>.list-drag-handle,#worklogContent .list-item.portal-source-engineer-row>.portal-drag-handle,#worklogContent .list-item.portal-engineer-row>.list-drag-handle,#worklogContent .list-item.portal-system-row>.portal-drag-handle,#worklogContent .list-item.portal-system-row>.list-drag-handle{grid-column:1!important;grid-row:1!important}
#worklogContent .list-item.portal-source-order-row>input,#worklogContent .list-item.portal-department-row>input,#worklogContent .list-item.portal-simple-row>input,#worklogContent .list-item.portal-system-row>input{grid-column:2!important;grid-row:1!important;width:100%!important;min-width:0!important;height:38px!important;box-sizing:border-box!important}
#worklogContent .list-item.portal-source-engineer-row>select,#worklogContent .list-item.portal-engineer-row>select{grid-column:2!important;grid-row:1!important;width:100%!important;min-width:0!important;height:38px!important;box-sizing:border-box!important}
#worklogContent .list-item.portal-source-engineer-row>input,#worklogContent .list-item.portal-engineer-row>input{grid-column:3!important;grid-row:1!important;width:100%!important;min-width:0!important;height:38px!important;box-sizing:border-box!important}
#worklogContent .list-item.portal-system-row>select,#worklogContent .list-item.portal-system-row>.abnormal-choice-row{grid-column:3!important;grid-row:1!important;width:100%!important;min-width:0!important;height:38px!important;box-sizing:border-box!important;overflow:auto!important}
#worklogContent .list-item.portal-source-order-row>.list-order-actions,#worklogContent .list-item.portal-department-row>.list-order-actions,#worklogContent .list-item.portal-simple-row>.list-order-actions{grid-column:3!important;grid-row:1!important}
#worklogContent .list-item.portal-source-engineer-row>.list-order-actions,#worklogContent .list-item.portal-engineer-row>.list-order-actions,#worklogContent .list-item.portal-system-row>.list-order-actions{grid-column:4!important;grid-row:1!important}
#worklogContent .list-item.portal-source-order-row>.list-delete,#worklogContent .list-item.portal-department-row>.list-delete,#worklogContent .list-item.portal-simple-row>.list-delete{grid-column:4!important;grid-row:1!important}
#worklogContent .list-item.portal-source-engineer-row>.list-delete,#worklogContent .list-item.portal-engineer-row>.list-delete,#worklogContent .list-item.portal-system-row>.list-delete,#worklogContent .list-item.portal-system-row>[data-sx]{grid-column:5!important;grid-row:1!important}
#worklogContent .list-item>.list-order-actions{display:grid!important;grid-template-columns:1fr 1fr!important;width:76px!important;min-width:76px!important;height:38px!important}
#worklogContent .list-item>.list-order-actions>button{display:flex!important;align-items:center!important;justify-content:center!important;width:38px!important;min-width:38px!important;height:38px!important;padding:0!important}

/* v49：首頁右側出工回覆快捷鍵。 */
.portal-hero-actions{z-index:2;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.portal-hero .home-worklog-shortcut{display:inline-flex;align-items:center;justify-content:center;min-width:148px;min-height:48px;padding:0 22px!important;border-color:#fff!important;background:#fff!important;color:#174b8c!important;box-shadow:0 8px 22px #10243e2e;font-size:16px!important;font-weight:900!important;white-space:nowrap}
.portal-hero .home-worklog-shortcut:hover{transform:translateY(-1px);background:#edf5ff!important;box-shadow:0 11px 26px #10243e3d}
.portal-hero .home-worklog-shortcut:active{transform:translateY(0)}

/* v50：排序控制拆成三個獨立欄位；最右側依序為 X、↓、↑，選項使用剩餘寬度。 */
#worklogContent .list-item{grid-template-columns:32px minmax(0,1fr) 46px 46px 46px!important;grid-template-rows:38px!important;min-height:38px!important;align-items:stretch!important}
#worklogContent .list-item.with-option{grid-template-columns:32px minmax(0,1fr) minmax(88px,max-content) 46px 46px 46px!important}
#worklogContent .list-item.portal-source-order-row,#worklogContent .list-item.portal-department-row,#worklogContent .list-item.portal-simple-row{grid-template-columns:32px minmax(0,1fr) 46px 46px 46px!important}
#worklogContent .list-item.portal-source-engineer-row,#worklogContent .list-item.portal-engineer-row{grid-template-columns:32px minmax(110px,160px) minmax(0,1fr) 46px 46px 46px!important}
#worklogContent .list-item.portal-system-row{grid-template-columns:32px minmax(180px,1fr) minmax(150px,220px) 46px 46px 46px!important}
#worklogContent .list-item>.list-order-actions{display:contents!important;width:auto!important;min-width:0!important;height:auto!important;border:0!important;background:transparent!important}
#worklogContent .list-item>.list-order-actions>button{grid-row:1!important;display:flex!important;align-items:center!important;justify-content:center!important;width:46px!important;min-width:46px!important;height:38px!important;padding:0!important;border:0!important;border-left:1px solid #e1e5eb!important;background:#f8fafc!important;color:#174b8c!important}
#worklogContent .list-item>.list-order-actions>button:first-child{grid-column:-4/-3!important}
#worklogContent .list-item>.list-order-actions>button:last-child{grid-column:-3/-2!important}
#worklogContent .list-item>.list-delete,#worklogContent .list-item>[data-sx]{grid-column:-2/-1!important;grid-row:1!important;width:46px!important;min-width:46px!important;height:38px!important;padding:0!important;border-left:1px solid #e1e5eb!important}
#worklogContent .list-item.portal-source-order-row>.list-delete,#worklogContent .list-item.portal-department-row>.list-delete,#worklogContent .list-item.portal-simple-row>.list-delete,#worklogContent .list-item.portal-source-engineer-row>.list-delete,#worklogContent .list-item.portal-engineer-row>.list-delete,#worklogContent .list-item.portal-system-row>.list-delete,#worklogContent .list-item.portal-system-row>[data-sx]{grid-column:-2/-1!important;grid-row:1!important}

/* v51：特殊清單的三條線與樓層共用整列拖曳視覺。 */
#worklogContent .list-item.dragging{opacity:.38!important;outline:2px solid #2b6cb0!important;background:#edf4ff!important;cursor:grabbing!important}
#worklogContent .list-item.drag-over{border-color:#2b6cb0!important;box-shadow:inset 0 3px 0 #2b6cb0!important}

/* v53：系統別右側課別下拉選單。 */
#worklogContent .list-item.portal-system-row>select[data-portal-system-department]{grid-column:3!important;grid-row:1!important;width:100%!important;min-width:150px!important;height:38px!important;box-sizing:border-box!important;padding:0 28px 0 10px!important;border:0!important;border-left:1px solid #e1e5eb!important;background:#fff!important;color:#26364b!important;font:12px "Microsoft JhengHei",sans-serif!important;outline:0!important}
#worklogContent .list-item.portal-system-row>select[data-portal-system-department]:focus{background:#fff8c7!important}

.case-stats-card{overflow:visible;margin:0 0 13px;border:1px solid #d7e0eb;border-radius:12px;background:#fff;box-shadow:0 1px 2px #17345d0a}
.case-stats-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 14px;border-bottom:1px solid #d7e0eb}
.case-stats-head h2{margin:0;color:#172c49;font-size:16px}
.case-stats-head p{margin:3px 0 0;color:#6b7b91;font-size:11px}
.case-stats-head>button{height:32px;padding:0 13px;border:1px solid #b9c9dc;border-radius:6px;background:#fff;color:#174b8c;font:800 12px "Microsoft JhengHei",sans-serif;cursor:pointer}
.case-stats-head>button:hover{background:#edf4ff}
.case-stats-table-wrap{overflow:auto}
.case-stats-table{width:100%;min-width:720px;border-collapse:collapse;table-layout:fixed}
.case-stats-table th,.case-stats-table td{height:42px;padding:0;border-right:1px solid #cbd5e1;border-bottom:1px solid #cbd5e1;text-align:center}
.case-stats-table th:last-child,.case-stats-table td:last-child{border-right:0}
.case-stats-table tbody tr:last-child td{border-bottom:0}
.case-stats-table th{background:#19466f;color:#fff}
.case-stats-table th input,.case-stats-table td input{display:block;width:100%;height:100%;box-sizing:border-box;border:0;padding:6px 9px;background:transparent;color:inherit;font:inherit;text-align:center;outline:0}
.case-stats-table th input{color:#fff;font-weight:800}
.case-stats-table td input{background:#fff;color:#172c49}
.case-stats-table td input::placeholder{color:#77869a;opacity:1}
.case-stats-table th input::placeholder{color:#dce8f4;opacity:1}
.case-stats-table td input:hover{background:#f7faff}
.case-stats-table td input:focus,.case-stats-table th input:focus{background:#fff8c7;color:#172c49;box-shadow:inset 0 0 0 2px #4f83bd}
.case-stats-context-menu{position:fixed;z-index:5000;display:grid;min-width:190px;padding:6px;border:1px solid #c8d3e0;border-radius:9px;background:#fff;box-shadow:0 14px 36px #14233d35}
.case-stats-context-menu[hidden]{display:none}
.case-stats-context-menu button{display:block;width:100%;padding:8px 10px;border:0;border-radius:6px;background:#fff;color:#223750;font:700 12px "Microsoft JhengHei",sans-serif;text-align:left;cursor:pointer}
.case-stats-context-menu button:hover{background:#edf4ff}
.case-stats-context-menu button.danger{color:#b42318}
.case-stats-context-menu button.danger:hover{background:#fff0f0}
.case-stats-context-menu hr{width:100%;margin:5px 0;border:0;border-top:1px solid #e1e6ed}
.case-stats-table td input.case-stats-system-input{padding-right:28px;background-color:#f4f8ff;color:#174b8c;font-weight:800;cursor:text}
.case-stats-table td input.case-stats-system-input:focus{background-color:#fff8c7}
.case-stats-core-header{display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:6px 9px;box-sizing:border-box;color:#fff;font-weight:800}
.case-stats-context-menu button:disabled{background:#f4f5f7;color:#a8b0bc;cursor:not-allowed}
.case-stats-context-menu button.danger:disabled:hover{background:#f4f5f7;color:#a8b0bc}
.case-stats-table td.case-stats-merged-cell{vertical-align:middle}
.case-stats-table td.case-stats-merged-cell>input{min-height:42px}
.case-stats-table td.case-stats-merged-department>input{background:#fff8df;font-weight:800}
.case-stats-table td.case-stats-merged-system>input{background:#f4f8ff}
.case-stats-readonly-badge{display:inline-flex;align-items:center;justify-content:center;min-width:46px;height:26px;padding:0 10px;border-radius:999px;background:#eef2f6;color:#64748b;font:800 12px "Microsoft JhengHei",sans-serif}
.case-stats-readonly-value{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:42px;box-sizing:border-box;padding:6px 9px;color:#334155;background:#f8fafc}
.case-stats-readonly .case-stats-merged-department .case-stats-readonly-value{background:#fff8df;font-weight:800}
.case-stats-readonly .case-stats-merged-system .case-stats-readonly-value{background:#f4f8ff;color:#174b8c;font-weight:800}
.case-stats-readonly .case-stats-table{cursor:default}
.case-stats-calculated-value{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:42px;box-sizing:border-box;padding:6px 9px;background:#f4f7fb;color:#174b8c;font-weight:900}
.ir-response-table.job-response-table{width:100%!important;min-width:1180px!important;table-layout:auto!important}
.ir-response-table.job-response-table th,.ir-response-table.job-response-table td{box-sizing:border-box;text-align:center!important;vertical-align:middle!important}
.ir-response-table.job-response-table .response-tight-column{width:1%!important;min-width:0!important;white-space:nowrap!important}
.ir-response-table.job-response-table .response-location-column{width:auto!important;min-width:260px!important;white-space:normal!important;text-align:center!important}
.ir-response-table.job-response-table .response-system-line,.ir-response-table.job-response-table .response-location-line,.ir-response-table.job-response-table .response-points>span{display:block;min-height:24px;line-height:24px;padding:3px 6px;text-align:center!important}
.ir-response-table.job-response-table .response-row-actions{align-items:center;justify-content:center;white-space:nowrap}
.ir-response-table.aligned-response-table tr.response-detail-row>td{height:36px;min-height:36px;padding-top:6px;padding-bottom:6px}
.ir-response-table.aligned-response-table tr.response-detail-row:not(.response-detail-row-last)>td.response-detail-cell{border-bottom:1px dashed #cfd8e3!important}
.ir-response-table.aligned-response-table tr.response-detail-row-last>td.response-detail-cell{border-bottom:1px solid #e6eaf0!important}
.ir-response-table.aligned-response-table td.response-common-cell{vertical-align:middle!important;text-align:center!important}
.ir-response-table.aligned-response-table td.response-engineer-cell{color:#174b8c;font-weight:800}
.handoff-dialog{width:min(780px,calc(100vw - 30px))}
.handoff-copy{white-space:pre-wrap;padding:16px;border:1px solid #cad4e1;border-radius:8px;background:#f8fafc;color:#23354f;font:13px/1.8 "Microsoft JhengHei",sans-serif}
.handoff-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:12px}.handoff-fields label{display:flex;flex-direction:column;gap:5px;font-size:11px;font-weight:800}.handoff-fields input,.handoff-fields select{height:37px;padding:0 9px;border:1px solid #c7d1de;border-radius:6px}
.daily-report-wrap{overflow:auto}.daily-report{width:100%;min-width:1250px;border-collapse:collapse}.daily-report th,.daily-report td{padding:8px;border:1px solid #bfcbd8;text-align:center;font-size:11px}.daily-report th{background:#ec7d23;color:#fff}.daily-report .daily-total td{background:#fff4df;font-weight:800}

/* v83：出工回覆全域搜尋、欄頭篩選與圖號子列對齊。 */
.response-table-module{position:relative;min-width:0}
.response-table-tools{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid #dbe3ec;background:#fff}
.response-search-controls{display:flex;align-items:center;gap:8px;min-width:0;flex:1}
.response-global-search{display:grid;grid-template-columns:34px minmax(0,1fr);align-items:center;width:min(560px,100%);min-width:220px;height:38px;border:1px solid #c8d3e0;border-radius:8px;background:#fff;box-shadow:inset 0 1px 2px #17233d08}
.response-global-search:focus-within{border-color:#4f83bd;box-shadow:0 0 0 3px #4f83bd1f}
.response-global-search>span{display:flex;align-items:center;justify-content:center;color:#64748b;font-size:20px}
.response-global-search>input{width:100%;min-width:0;height:36px;border:0;background:transparent;color:#1f334d;font:13px "Microsoft JhengHei",sans-serif;outline:0}
.response-global-search>input::-webkit-search-cancel-button{cursor:pointer}
.response-filter-result{margin-left:auto;color:#64748b;font-size:12px;white-space:nowrap}
.response-cancel-search,.response-clear-header-filters{display:inline-flex;align-items:center;justify-content:center;height:36px;padding:0 12px;border-radius:7px;font:800 12px "Microsoft JhengHei",sans-serif;cursor:pointer;white-space:nowrap;transition:background .15s,border-color .15s,color .15s}
.response-cancel-search{border:1px solid #e0a6a6;background:#fffafa;color:#a33b3b}
.response-cancel-search:hover{border-color:#cf7777;background:#fff0f0;color:#8f2424}
.response-clear-header-filters{border:1px solid #9dbce0;background:#eef6ff;color:#174b8c}
.response-clear-header-filters:hover{border-color:#6e9bd0;background:#dfeeff;color:#103e70}
.response-cancel-search[hidden],.response-clear-header-filters[hidden]{display:none!important}
.response-cancel-search:disabled,.response-clear-header-filters:disabled{cursor:default;opacity:.5}
.filterable-response-table thead th{padding:0!important;overflow:visible}
.response-filter-trigger{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-width:max-content;height:100%;min-height:38px;padding:7px 9px;border:0;background:transparent;color:inherit;font:inherit;font-weight:800;cursor:pointer;white-space:nowrap}
.response-filter-trigger>b{font-size:11px;opacity:.75}
.response-filter-trigger:hover,.response-filter-trigger.active{background:#2b5f8f}
.response-filter-trigger.active>b{color:#ffdb66;opacity:1}
.response-filter-menu{position:fixed;z-index:7000;box-sizing:border-box;max-height:420px;padding:10px;border:1px solid #c8d3e0;border-radius:10px;background:#fff;box-shadow:0 18px 46px #17233d38;color:#223750;text-align:left}
.response-filter-menu[hidden]{display:none}
.response-filter-menu-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.response-filter-menu-head>b{font-size:13px}
.response-filter-menu-head>button{width:28px;height:28px;padding:0;border:0;border-radius:6px;background:transparent;color:#64748b;font-size:18px;cursor:pointer}
.response-filter-menu-head>button:hover{background:#eef3f8}
.response-filter-menu>input{width:100%;height:36px;box-sizing:border-box;padding:0 9px;border:1px solid #c8d3e0;border-radius:7px;font:12px "Microsoft JhengHei",sans-serif;outline:0}
.response-filter-menu>input:focus{border-color:#4f83bd;box-shadow:0 0 0 3px #4f83bd1c}
.response-filter-options{display:grid;gap:2px;max-height:245px;margin:8px 0;overflow:auto}
.response-filter-options>label{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:center;gap:7px;padding:7px 8px;border-radius:6px;cursor:pointer}
.response-filter-options>label:hover{background:#edf4ff}
.response-filter-options input{width:15px;height:15px;margin:0;accent-color:#174b8c}
.response-filter-options span{overflow:hidden;color:#334155;font-size:12px;text-overflow:ellipsis;white-space:nowrap}
.response-filter-options>p{margin:0;padding:12px 8px;color:#7a8796;font-size:12px;text-align:center}
.response-filter-menu-actions{display:flex;justify-content:space-between;gap:8px;padding-top:8px;border-top:1px solid #e4e9ef}
.response-filter-menu-actions>button{height:32px;padding:0 10px;border:1px solid #c8d3e0;border-radius:6px;background:#fff;color:#35557a;font:800 12px "Microsoft JhengHei",sans-serif;cursor:pointer}
.response-filter-menu-actions>button:last-child{border-color:#174b8c;background:#174b8c;color:#fff}
.filterable-response-table tbody[hidden]{display:none}
.filterable-response-table td.response-drawing-cell{color:#5b3f8c;font-weight:800}
.filterable-response-table tr.response-detail-row:not(.response-detail-row-last)>td.response-detail-cell{border-bottom:1px dashed #cfd8e3!important}
.filterable-response-table td.response-location-column{min-width:280px!important}
.filterable-response-table th,.filterable-response-table td{text-align:center!important;vertical-align:middle!important}
@media(max-width:820px){.response-table-tools{align-items:flex-start;flex-direction:column}.response-search-controls{width:100%;flex-wrap:wrap}.response-global-search{width:100%;flex-basis:100%}.response-filter-result{margin-left:0}}


/* v115：表單回應卡片採流體寬度；寬表格只在卡片內水平捲動。 */
.response-table-module{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box;
}
.worklog-dashboard:has(.response-table-module),
.worklog-list-card:has(>.response-table-module){
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin-left:auto!important;
  margin-right:auto!important;
  box-sizing:border-box;
}
.response-table-module .response-table-tools,
.response-table-module .response-search-controls{
  width:100%;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
}
.response-table-module .response-table-scroll{
  display:block;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;
}
.response-table-module .filterable-response-table{
  min-width:1100px;
  max-width:none!important;
}
@media(max-width:1100px){
  .worklog-module:has(.response-table-module){
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    padding-left:clamp(6px,2vw,18px)!important;
    padding-right:clamp(6px,2vw,18px)!important;
  }
  .worklog-shell:has(.response-table-module),
  .worklog-content:has(.response-table-module){
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  .worklog-content:has(.response-table-module){
    padding-left:clamp(8px,4vw,24px)!important;
    padding-right:clamp(8px,4vw,24px)!important;
  }
}

/* v116：表單回應以資料列右鍵選單取代固定操作欄，並顯示逐欄修改差異。 */
.filterable-response-table tr[data-response-row]{cursor:context-menu}
.custom-context-menu{
  position:fixed!important;
  z-index:99999!important;
  max-width:calc(100vw - 16px);
  margin:0!important;
  box-sizing:border-box;
  /* 浮動節點直屬 body，不參與表格寬高與列排列計算。 */
}
.custom-context-menu[hidden]{display:none!important}
.response-row-context-menu{
  position:fixed;
  z-index:7800;
  display:grid;
  gap:3px;
  width:220px;
  padding:7px;
  border:1px solid #c5d0dc;
  border-radius:10px;
  background:#fff;
  box-shadow:0 18px 46px #17233d3d;
}
.response-row-context-menu[hidden]{display:none!important}
.response-row-context-menu button{
  display:flex;
  align-items:center;
  width:100%;
  min-height:38px;
  padding:7px 10px;
  border:0;
  border-radius:7px;
  background:#fff;
  color:#263b55;
  font:800 12px "Microsoft JhengHei",sans-serif;
  text-align:left;
  cursor:pointer;
}
.response-row-context-menu button:hover{background:#edf4ff;color:#174b8c}
.response-row-context-menu button.danger{color:#b42318}
.response-row-context-menu button.danger:hover{background:#fff0f0}
.response-row-context-menu button[data-context-copy]{color:#175c78}
.response-row-context-menu button[data-context-copy]:hover{background:#e8f7fb}
.response-row-context-menu button:disabled{opacity:.4;cursor:not-allowed;background:#f5f6f8;color:#7c8795}
.response-audit-dialog{width:min(820px,calc(100vw - 24px));max-height:min(84vh,760px);overflow:auto}
.response-audit-list{display:grid;gap:10px;max-height:none;padding:14px;background:#f4f7fb}
.response-audit-entry{display:block!important;padding:13px!important;border:1px solid #d6e0ea!important;border-radius:9px;background:#fff}
.response-audit-entry>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:9px;border-bottom:1px solid #e3e8ee}
.response-audit-entry>header div{display:flex;align-items:center;gap:8px}
.response-audit-entry>header b{color:#173e6b;font-size:13px}
.response-audit-entry>header span{padding:3px 7px;border-radius:999px;background:#eaf2fc;color:#315e8c;font-size:10px;font-weight:800}
.response-audit-entry>header time{color:#6f7d8f;font-size:11px;white-space:nowrap}
.response-audit-diff{display:grid;gap:7px;padding-top:9px}
.response-audit-diff>p{margin:0;color:#7b8796;font-size:12px}
.response-audit-change{display:grid;grid-template-columns:110px minmax(0,1fr) 24px minmax(0,1fr);align-items:start;gap:7px;font-size:11px}
.response-audit-change>b{padding-top:7px;color:#344861}
.response-audit-change>span{min-height:31px;padding:7px 8px;border-radius:6px;white-space:pre-wrap;overflow-wrap:anywhere}
.response-audit-change>i{padding-top:7px;color:#7d8ca0;font-style:normal;text-align:center}
.response-audit-before{background:#fff0f0;color:#8c3434;text-decoration:line-through}
.response-audit-after{background:#eaf8ef;color:#17613a;font-weight:700}
@media(max-width:650px){
  .response-row-context-menu button{min-height:44px}
  .response-audit-change{grid-template-columns:1fr}
  .response-audit-change>b{padding-top:2px}
  .response-audit-change>i{padding:0;transform:rotate(90deg)}
  .response-audit-entry>header{align-items:flex-start;flex-direction:column}
}

/* v118：觸控裝置長按資料列開啟操作選單；維持原生上下／左右滑動。 */
@media (hover:none) and (pointer:coarse){
  .filterable-response-table tr[data-response-row]{
    -webkit-touch-callout:none;
    touch-action:pan-x pan-y;
  }
  .response-row-context-menu{
    padding:8px;
    border-radius:12px;
  }
  .response-row-context-menu button{
    min-height:48px;
    font-size:13px;
  }
}

/* v125：表單回應 Inline 編輯、同頁 Overlay Modal 與案號課別快速切換。 */
.response-table-module .filterable-response-table{
  width:max-content!important;
  min-width:100%!important;
  table-layout:auto!important;
}
.response-table-module .filterable-response-table .response-location-column{
  width:100%!important;
  min-width:360px!important;
  max-width:none!important;
  white-space:normal!important;
}
.response-table-module .filterable-response-table .response-tight-column{
  width:1%!important;
  white-space:nowrap!important;
}
.response-inline-input{
  display:block;
  width:100%;
  min-width:76px;
  height:32px;
  box-sizing:border-box;
  margin:0;
  padding:5px 7px;
  border:1px solid transparent;
  border-radius:6px;
  background:transparent;
  color:#253b55;
  font:inherit;
  text-align:center;
  outline:0;
  transition:border-color .15s,background-color .15s,box-shadow .15s;
}
.response-location-column .response-inline-input{min-width:340px;text-align:left}
.response-note-cell{min-width:220px!important}
.response-remark-input{min-width:200px;text-align:left}
@media (hover:hover){
  .response-inline-input:hover{border-color:#c7d2df;background:#fff}
}
.response-inline-input:focus{
  border-color:#2f6dcc;
  background:#fff;
  box-shadow:0 0 0 3px #2f6dcc20;
}
.response-inline-input.is-saving{background:#fff8d8;color:#6f5b14}
.response-inline-input:disabled{cursor:wait;opacity:.72}
.response-department-tabs{
  display:flex;
  flex:0 0 auto;
  align-items:center;
  gap:3px;
  max-width:100%;
  overflow-x:auto;
  padding:4px;
  border-radius:8px;
  background:#edf1f5;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
.response-department-tabs::-webkit-scrollbar{display:none}
.response-department-tabs button{
  flex-shrink:0;
  min-height:34px;
  padding:0 13px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:#5d6b7d;
  font:800 11px "Microsoft JhengHei",sans-serif;
  cursor:pointer;
  white-space:nowrap;
}
.response-department-tabs button.active{
  background:#fff;
  color:#174b8c;
  box-shadow:0 1px 4px #17233d1f;
}
.response-edit-overlay{
  position:fixed;
  z-index:11000;
  inset:0;
  display:grid;
  place-items:center;
  box-sizing:border-box;
  padding:18px;
  background:#091e427d;
}
.response-edit-dialog{
  display:flex;
  flex-direction:column;
  width:min(940px,calc(100vw - 28px));
  max-height:calc(100vh - 28px);
  overflow:hidden;
  border:1px solid #d4dde8;
  border-radius:13px;
  background:#fff;
  box-shadow:0 28px 90px #091e4266;
}
.response-edit-header{
  position:sticky;
  z-index:3;
  top:0;
  display:flex;
  flex:0 0 auto;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  min-height:68px;
  box-sizing:border-box;
  padding:12px 16px;
  border-bottom:1px solid #dce3ec;
  background:#fff;
}
.response-edit-header h2{margin:0;color:#172b4d;font-size:19px}
.response-edit-header p{margin:4px 0 0;color:#6b788a;font-size:11px}
.response-edit-header>button{
  display:grid;
  place-items:center;
  flex:0 0 44px;
  width:44px;
  height:44px;
  padding:0;
  border:0;
  border-radius:50%;
  background:#eef2f6;
  color:#475569;
  font-size:24px;
  cursor:pointer;
}
.response-edit-dialog form{display:flex;min-height:0;flex:1;flex-direction:column}
.response-edit-body{min-height:0;overflow:auto;padding:16px;background:#f5f7fa}
.response-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.response-edit-grid label{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:5px;
  color:#526176;
  font-size:11px;
  font-weight:800;
}
.response-edit-grid label.wide{grid-column:1/-1}
.response-edit-grid input,.response-edit-grid textarea{
  width:100%;
  min-height:39px;
  box-sizing:border-box;
  padding:8px 10px;
  border:1px solid #c7d1df;
  border-radius:7px;
  background:#fff;
  color:#23364f;
  font:13px "Microsoft JhengHei",sans-serif;
  outline:0;
}
.response-edit-grid textarea{resize:vertical}
.response-edit-grid input:focus,.response-edit-grid textarea:focus{border-color:#2f6dcc;box-shadow:0 0 0 3px #2f6dcc1c}
.response-edit-details{display:grid;gap:12px;margin-top:14px}
.response-edit-detail{min-width:0;margin:0;padding:14px;border:1px solid #d7e0ea;border-radius:9px;background:#fff}
.response-edit-detail legend{padding:0 7px;color:#174b8c;font-size:12px;font-weight:900}
.response-edit-footer{
  display:flex;
  flex:0 0 auto;
  justify-content:flex-end;
  gap:8px;
  padding:12px 16px;
  border-top:1px solid #dce3ec;
  background:#fff;
}
.response-edit-footer button{min-height:38px;padding:0 14px;border:1px solid #c3cedb;border-radius:7px;background:#fff;color:#344861;font-weight:800;cursor:pointer}
.response-edit-footer .primary-button{border-color:#174b8c;background:#174b8c;color:#fff}
@media(max-width:820px){
  .response-table-tools{gap:8px}
  .response-department-tabs{width:100%}
  .response-table-module .filterable-response-table .response-location-column{min-width:280px!important}
  .response-edit-overlay{padding:7px}
  .response-edit-dialog{width:calc(100vw - 14px);max-height:calc(100vh - 14px)}
  .response-edit-grid{grid-template-columns:1fr}
  .response-edit-grid label.wide{grid-column:auto}
  .response-edit-header{min-height:64px;padding:10px 12px}
  .response-edit-body{padding:12px}
}
