/* ==========================================================================
 * HyGeoWorks 共用工作臺與單工具著陸頁樣式表（web/assets/studio-shared.css）
 * - 支援全站 78 個四大主力轄區著陸頁（/tw/tools/, /en/tools/, /us/tools/, /ja/tools/）與總覽頁共用快取
 * - 電腦版雙欄／三欄自適應；手機版（390px）嚴格零水平溢出（overflow-x: clip + border-box）
 * - 全部按鈕、下拉選單與輸入框觸控高度 >= 40px；全站一律淺色（不提供深色主題）
 * ========================================================================== */

.hy-shared-studio,
.hy-studio {
  scroll-margin-top: 72px;
  --ink: #1f2933;
  --muted: #607d8b;
  --line: #d7dee6;
  --brand: #1f4e79;
  --brand-soft: #e3edf7;
  --ok: #2e7d32;
  --ok-bg: #e8f5e9;
  --ng: #c62828;
  --ng-bg: #ffebee;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --soft: #f4f7fa;
  --card: #ffffff;
  --bg: #eef2f6;
  --row-line: #eef1f5;
  background: var(--bg);
  padding: 28px 16px;
  font-family: "Microsoft JhengHei UI", "Noto Sans TC", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  transition: background 0.2s, color 0.2s;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  box-sizing: border-box;
  border-radius: 14px;
}

.hy-shared-studio *,
.hy-shared-studio *::before,
.hy-shared-studio *::after {
  box-sizing: border-box;
}

.hss-wrap {
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

.hss-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
  max-width: 100%;
}

.hss-tgroup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.hss-badge-local {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok);
  max-width: 100%;
}

.hss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  max-width: 100%;
}

.hss-sel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  max-width: 100%;
}

.hss-btn:hover,
.hss-sel:hover {
  border-color: var(--brand);
}

.hss-btn.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.hss-btn.pro {
  border-color: #f59e0b;
  background: var(--warn-bg);
  color: var(--warn);
}

/* 單工具著陸頁雙欄網格（左：寬敞參數＋法規切換；右：高解析度示意圖＋檢核＋計算式） */
.hss-grid-single {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(440px, 1.35fr);
  gap: 16px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

/* 全工具總覽三欄網格 */
.hss-grid-full {
  display: grid;
  grid-template-columns: 264px minmax(340px, 1fr) minmax(440px, 1.32fr);
  gap: 16px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

@media (max-width: 1023px) {
  .hss-grid-single,
  .hss-grid-full {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .hy-shared-studio {
    padding: 18px 10px;
  }
}

.hss-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.hss-code-box {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--brand);
  background: var(--brand-soft);
  min-width: 0;
}

.hss-code-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.hss-code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 8px;
  min-width: 0;
}

.hss-code-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  min-width: 0;
}

.hss-code-item.hss-code-wide {
  grid-column: 1 / -1;
}

.hss-code-item label {
  font-weight: 700;
  color: var(--ink);
}

.hss-code-item select,
.hss-code-item input {
  width: 100%;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  background: var(--card);
  color: var(--ink);
  min-width: 0;
}

.hss-fhead {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--row-line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.hss-ftitle {
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
  line-height: 1.35;
  min-width: 0;
}

.hss-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 154px;
  align-items: center;
  gap: 8px;
  margin: 6px 0 3px;
  font-size: 13.5px;
  min-width: 0;
}

@media (max-width: 440px) {
  .hss-field {
    grid-template-columns: minmax(0, 1fr) 130px;
    gap: 6px;
    font-size: 13px;
  }
}

.hss-field > span,
.hss-field > label {
  overflow-wrap: anywhere;
  line-height: 1.35;
  min-width: 0;
}

/* 欄位之錯誤／預設提示列（aria-describedby 所指） */
.hss-fnote {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 6px;
  padding-left: 8px;
  overflow-wrap: anywhere;
}

.hss-fnote.is-err {
  color: var(--ng);
  font-weight: 700;
}

/* 僅供螢幕閱讀器之說明（輸入限制） */
.hss-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hss-btn:disabled,
.hy-pro-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hss-field .u {
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 700;
}

.hss-field input:not([type="checkbox"]),
.hss-field select {
  width: 100%;
  min-height: 40px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  background: var(--card);
  color: var(--ink);
  min-width: 0;
}

.hss-field input:not([type="checkbox"]):focus,
.hss-field select:focus {
  border-color: var(--brand);
}
.hss-field input:not([type="checkbox"]):focus-visible,
.hss-field select:focus-visible {
  outline: 3px solid #0284c7;
  outline-offset: 2px;
}

.hss-field input.err-inp {
  border-color: var(--ng);
}

.hss-chk-wrap {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  min-width: 44px;
  cursor: pointer;
}

.hss-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--brand);
}

.hss-verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--soft);
  min-width: 0;
}

.hss-verdict.ok {
  border-color: var(--ok);
  background: var(--ok-bg);
}

.hss-verdict.ng {
  border-color: var(--ng);
  background: var(--ng-bg);
}

.hss-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.hss-pill.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.hss-pill.ng {
  background: var(--ng-bg);
  color: var(--ng);
}

.hss-pill.info {
  background: var(--brand-soft);
  color: var(--brand);
}

.hss-kpis {
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
  min-width: 0;
  flex: 1 1 170px;
}

.hss-fig-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  overflow: hidden;
  margin-bottom: 12px;
  min-width: 0;
}

.hss-fig svg {
  width: 100%;
  height: auto;
  background: var(--card);
  display: block;
}

.hss-fig-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  border-top: 1px solid var(--row-line);
  background: var(--soft);
  font-size: 11.5px;
  color: var(--muted);
  min-width: 0;
}

.hss-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 10px;
}

.hss-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.hss-table th,
.hss-table td {
  border-bottom: 1px solid var(--row-line);
  padding: 6px 6px;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.hss-table th,
.hss-table td.hss-val-r,
.hss-table td.hss-ok,
.hss-table td.hss-ng {
  white-space: nowrap;
}

.hss-table td.hss-val-r {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding-left: 10px;
}

.hss-ok {
  color: var(--ok);
  font-weight: 700;
}

.hss-ng {
  color: var(--ng);
  font-weight: 700;
}

.hss-acc {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  margin: 8px 0 10px;
  min-width: 0;
  overflow: hidden;
}

.hss-acc-sum {
  list-style: none;
  cursor: pointer;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  user-select: none;
}

.hss-acc-sum::-webkit-details-marker {
  display: none;
}

.hss-pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.55;
  background: var(--soft);
  color: var(--ink);
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  max-height: 340px;
  overflow: auto;
  margin: 0;
  max-width: 100%;
}

.hss-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 6px;
}

.hss-msg {
  font-size: 12.5px;
  color: var(--muted);
  min-height: 18px;
  overflow-wrap: anywhere;
}

.hss-err {
  color: var(--ng);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--ng-bg);
  border: 1px solid var(--ng);
  margin-bottom: 8px;
}

/* ==========================================================================
 * 獨立工具著陸頁（TW / EN / US / JA）手機專屬置頂浮動合格條（Mobile Sticky Verdict Bar）
 * - < 1024px 自動置頂顯示「🟢 PASS / 🔴 NG ＋ 核心計算值 ＋ [圖] 展開斷面圖 ＋ [↓] 跳至檢核表」
 * - >= 1024px 自動隱藏（寬螢幕已有並排雙欄／三欄）
 * ========================================================================== */
.hy-m-sticky-bar {
  display: none;
  position: sticky;
  /* 手機上網站頁首不固定（共用頁首於 1040px 以下為 position: relative），只固定本摘要條 */
  top: 0;
  z-index: 36;
  margin: 0 0 12px;
  padding: 8px 10px;
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid #0284c7;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1023px) {
  .hy-m-sticky-bar {
    display: flex;
  }
}

.hy-m-sticky-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.hy-m-verdict-pill,
.hy-m-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  background: #e0f2fe;
  color: #0369a1;
}

.hy-m-verdict-pill.is-ok,
.hy-m-badge.ok {
  background: #dcfce7;
  color: #15803d;
}

.hy-m-verdict-pill.is-ng,
.hy-m-badge.ng {
  background: #fee2e2;
  color: #b91c1c;
}

.hy-m-kpi-text,
.hy-m-kpi {
  font-size: 12.5px;
  font-weight: 700;
  flex: 1 1 150px;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
/* 手機判定列之說明（結果或核心之結論句）：最多兩行，避免置頂列過高 */
.hy-m-kpi {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hy-m-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.hy-m-btn {
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.hy-m-minifig {
  display: none;
  border-top: 1px solid #cbd5e1;
  padding-top: 6px;
  width: 100%;
  min-width: 0;
}

.hy-m-minifig.is-open,
.hy-m-minifig.open {
  display: block;
}

.hy-m-minifig svg {
  width: 100%;
  max-height: 220px;
  height: auto;
  display: block;
  border-radius: 6px;
}

/* ==========================================================================
 * 四大專區（TW / EN / US / JA）統一設計系統（一律淺色）
 * ========================================================================== */
.tw-trust-strip,
.en-topbar,
.sec-banner,
.hy-sec-bar {
  background: #064e3b !important;
  color: #ecfdf5 !important;
  border-bottom: 1px solid #047857 !important;
}
.tw-trust-strip a,
.en-topbar a,
.sec-banner a,
.hy-sec-bar a {
  color: #a7f3d0 !important;
  font-weight: 700;
}
.tw-topbar,
.en-nav,
header.topbar,
.hy-header {
  background: linear-gradient(90deg, #0f2942 0%, #1f4e79 100%) !important;
  color: #ffffff !important;
  border-bottom: 1px solid #2a5683 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
}
.en-nav .en-brand,
.hy-header .hy-brand,
header.topbar .brand,
.tw-topbar .tw-brand {
  color: #ffffff !important;
}
.en-nav .en-brand span {
  background: rgba(56, 189, 248, 0.2) !important;
  color: #bae6fd !important;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.en-nav-links a:not(.en-cta-top),
.hy-header .hy-nav a,
header.topbar .nav-links a:not(.btn-primary):not(.active) {
  color: #e0f2fe !important;
}
.en-nav-links a.en-cta-top {
  background: #10b981 !important;
  color: #ffffff !important;
}


/* ==========================================================================
 * 四專區所有表單控制項基礎字級一律 16px ＋ < 1024px 強制 16px !important 雙重保險
 * 徹底根除 iPhone Safari 點擊小字輸入框自動放大畫面（#80 & #81-2 硬指標）
 * ========================================================================== */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  font-size: 16px;
}

@media (max-width: 1024px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ==========================================================================
 * #82 四大工程師實戰生產力與口碑傳播神器共用樣式
 * 1. 自動記憶還原輕量提示徽章 (.hy-autosave-pill)
 * 2. 選填三欄工程檢核單抬頭列 (.hy-pro-meta-bar)
 * 3. 實戰動作按鈕群 (.hy-pro-actions-bar)
 * 4. 方案甲 vs. 方案乙 即時差值對照面板 (.hy-baseline-panel)
 * 5. 乾淨一頁式工程檢核單列印專用頁首／品牌口碑頁尾與 @media print 樣式
 * ========================================================================== */
.hy-autosave-pill {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #6ee7b7;
  white-space: nowrap;
}
.hy-autosave-pill.is-on {
  display: inline-flex;
}

.hy-pro-meta-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
  padding: 9px 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 767px) {
  .hy-pro-meta-bar {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}
.hy-pro-meta-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.hy-pro-meta-field label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.hy-pro-meta-field input {
  width: 100%;
  min-height: 38px;
  padding: 5px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 16px;
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
}

.hy-pro-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}
.hy-pro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #7dd3fc;
  background: #ffffff;
  color: #0369a1;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
  max-width: 100%;
}
.hy-pro-btn:hover {
  background: #e0f2fe;
  border-color: #0284c7;
}
.hy-pro-btn.is-primary {
  background: #0f4c81;
  color: #ffffff;
  border-color: #0f4c81;
}
.hy-pro-btn.is-primary:hover {
  background: #0c3b66;
}
.hy-pro-btn.is-pinned {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
}
.hy-pro-btn.is-subtle {
  background: transparent;
  color: #64748b;
  border-color: #cbd5e1;
}
.hy-pro-toast {
  font-size: 12.5px;
  font-weight: 700;
  color: #047857;
  flex: 1 1 180px;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* 方案甲 vs. 方案乙 即時差值對照面板 */
.hy-baseline-panel {
  display: none;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #f59e0b;
  background: #fffbeb;
  color: #1e293b;
  width: 100%;
  box-sizing: border-box;
}
.hy-baseline-panel.is-open {
  display: block;
}
.hy-baseline-hd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #b45309;
}
.hy-baseline-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.hy-baseline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.hy-baseline-table th,
.hy-baseline-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(217, 119, 6, 0.22);
  text-align: left;
  vertical-align: middle;
}
.hy-baseline-table th {
  font-weight: 800;
  white-space: nowrap;
}
.hy-delta-up {
  color: #0369a1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hy-delta-down {
  color: #7c2d12;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hy-delta-same {
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.hy-delta-pass {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-weight: 800;
}
.hy-delta-fail {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 800;
}

/* 列印專用工程檢核表頭、頁尾與跨頁滿版防偽浮水印（螢幕隱藏、列印顯示） */
.hy-print-sheet-header,
.hy-print-sheet-footer,
.hy-print-watermark {
  display: none;
}

/* 工程七：核心公式法規依據摘要 ＋ 轉入桌面授權版導購引導卡片 */
.hss-upsell-box {
  margin: 10px 0 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #78350f;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.hss-upsell-basis {
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.hss-upsell-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  width: 100%;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid #d97706;
  background: #0f4c81;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  line-height: 1.35;
  transition: background 0.15s, transform 0.08s;
}
.hss-upsell-cta:hover {
  background: #0c3b66;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 11mm;
  }
  html,
  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 11px !important;
    line-height: 1.38 !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  /* 凡頁面啟動精準列印標記時，非工作臺祖先、非保留區與非跨頁浮水印一律隱藏 */
  body[data-hy-print-ready="1"] *:not([data-hy-print-ancestor="1"]):not([data-hy-print-keep="1"]):not([data-hy-print-keep="1"] *):not(.hy-print-watermark):not(.hy-print-watermark *) {
    display: none !important;
  }
  /* 跨頁滿版半透明斜向試算預覽浮水印（工程七：封堵免費網頁版無浮水印列印互噬） */
  .hy-print-watermark {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-evenly !important;
    align-items: center !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    pointer-events: none !important;
    z-index: 9999 !important;
    overflow: hidden !important;
    background: transparent !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .hy-print-watermark .hy-pwm-row {
    display: block !important;
    white-space: nowrap !important;
    transform: rotate(-26deg) !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    letter-spacing: 0.03em !important;
    color: rgba(185, 28, 28, 0.16) !important;
    text-align: center !important;
    line-height: 1.6 !important;
    user-select: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  /* 隱藏站台外圍導覽、橫幅、Hero、預設按鈕、動作列、導購框、技術長文、FAQ、價格卡、頁尾與手機浮動條 */
  .tw-trust-strip,
  .tw-topbar,
  .tw-hero,
  .tw-footer,
  .en-topbar,
  .en-nav,
  .en-footer,
  #all-calculators,
  .sec-banner,
  header.topbar,
  .preset-bar,
  .action-bar,
  .hy-sec-bar,
  .hy-header,
  .hy-hero,
  .hy-footer,
  .hy-m-sticky-bar,
  #hy-mobile-verdict-bar,
  .hss-tb-actions,
  .hss-tb-ctl,
  .hss-tabs,
  .hss-more,
  .hss-form-foot,
  .hss-upsell-box,
  .hy-desktop-upsell-note,
  .hss-btns,
  .hss-msg,
  .hs-btns,
  .hs-msg,
  .hy-pro-meta-bar,
  .hy-pro-actions-bar,
  .hy-autosave-pill,
  #hs-reset,
  #hy-btn-reset,
  .hss-fhead button,
  .hs-reset-btn {
    display: none !important;
  }
  [data-hy-print-ancestor="1"],
  [data-hy-print-keep="1"] {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #0f172a !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .hy-print-sheet-header {
    display: block !important;
    margin: 0 0 8px !important;
    padding: 0 0 6px !important;
    border-bottom: 2px solid #0f2942 !important;
    color: #0f172a !important;
  }
  .hy-print-title-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    gap: 8px !important;
    margin-bottom: 4px !important;
  }
  .hy-print-title-row h2 {
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #0f2942 !important;
  }
  .hy-print-title-row span {
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #334155 !important;
  }
  .hy-print-meta-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 4px 10px !important;
    font-size: 10.5px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    padding: 5px 8px !important;
  }
  .hy-print-sheet-footer {
    display: block !important;
    margin-top: 8px !important;
    padding-top: 5px !important;
    border-top: 1px solid #94a3b8 !important;
    font-size: 9.5px !important;
    color: #334155 !important;
    line-height: 1.4 !important;
  }
  /* 雙欄並列緊湊一頁排版 */
  .hss-grid-single,
  .en-studio-grid,
  .studio-grid {
    display: grid !important;
    grid-template-columns: 0.92fr 1.28fr !important;
    gap: 10px !important;
    align-items: start !important;
  }
  .hss-card,
  .hs-card,
  .studio-panel {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 8px !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  .hss-field,
  .field-row {
    margin: 2px 0 !important;
    padding: 1px 0 !important;
    font-size: 10.5px !important;
    grid-template-columns: minmax(0, 1fr) 115px !important;
  }
  input,
  select {
    min-height: 22px !important;
    height: 22px !important;
    padding: 1px 5px !important;
    font-size: 10.5px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
  }
  .hss-fig svg,
  #hs-fig svg,
  #hy-live-svg svg {
    max-height: 185px !important;
    width: 100% !important;
    background: #ffffff !important;
  }
  table {
    font-size: 10px !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }
  table th,
  table td {
    padding: 3px 4px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    background: transparent !important;
  }
  pre,
  .hss-pre,
  #hy-live-steps {
    max-height: none !important;
    font-size: 9.5px !important;
    line-height: 1.35 !important;
    padding: 5px 7px !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    white-space: pre-wrap !important;
  }
  .hy-submittal-wm-overlay {
    display: flex !important;
    opacity: 0.24 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .hy-submittal-cta-bar {
    display: none !important;
  }
}

/* 第七章：倒金字塔定論句與帶防互噬斜向預覽浮水印之法定送審檢核附表 */
.hy-lead-pyramid {
  margin: 0.45rem 0 0.95rem 0;
  padding: 0.65rem 0.9rem;
  border-left: 4px solid #0284c7;
  background: rgba(2, 132, 199, 0.07);
  color: inherit;
  font-size: 0.94rem;
  line-height: 1.62;
  border-radius: 0 6px 6px 0;
}

.hy-submittal-preview {
  margin: 1.75rem 0;
  padding: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 12px;
  background: var(--hy-card, rgba(255, 255, 255, 0.96));
  color: var(--hy-ink, #0f172a);
}

/* 檢核彙整表預覽：與工作臺之檢核分頁同源，預設收合（內容仍在頁面 HTML 內） */
.hy-submittal-collapse > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}
.hy-submittal-collapse > summary::-webkit-details-marker {
  display: none;
}
.hy-submittal-collapse > summary h2 {
  margin: 0;
  font-size: 1.05rem;
}
.hy-submittal-collapse-hint {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: #1f4e79;
}
.hy-submittal-collapse-hint::after {
  content: " \25BE";
}
.hy-submittal-collapse[open] .hy-submittal-collapse-hint::after {
  content: " \25B4";
}
.hy-submittal-collapse[open] > summary {
  margin-bottom: 12px;
}

.hy-submittal-sheet {
  position: relative;
  overflow: hidden;
  border: 1.5px solid #64748b;
  border-radius: 8px;
  padding: 1rem;
  background: rgba(248, 250, 252, 0.95);
  color: #0f172a;
}

.hy-submittal-wm-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  user-select: none;
}

.hy-submittal-wm-overlay span {
  display: block;
  transform: rotate(-16deg);
  font-size: clamp(0.95rem, 2.1vw, 1.45rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(185, 28, 28, 0.16);
  text-align: center;
  white-space: nowrap;
}

.hy-submittal-sheet-head {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 0.65rem;
  margin-bottom: 0.65rem;
  border-bottom: 2px solid #334155;
}

.hy-submittal-sheet-head strong {
  font-size: 1rem;
}

.hy-submittal-sheet-head span {
  font-size: 0.82rem;
  opacity: 0.82;
}

.hy-submittal-table-wrap {
  position: relative;
  z-index: 2;
  overflow-x: auto;
}

.hy-submittal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.hy-submittal-table th,
.hy-submittal-table td {
  padding: 0.48rem 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
  text-align: left;
}

.hy-submittal-badge,
.hy-sub-badge {
  display: inline-block;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.hy-sub-pass {
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
}

.hy-sub-fail {
  background: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
}

.hy-sub-info {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}

/* 檢核三態之「未判定」：計算核心之 status = undetermined（不作合格判定；原因另列） */
.hy-sub-und {
  background: rgba(223, 160, 62, 0.2);
  color: #8a5a10;
}
.hy-sub-reason,
.hss-reason {
  margin-top: 0.2rem;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.45;
  color: #5d4037;
}
td.hss-und,
.hss-verdict.und,
.hy-m-badge.und,
.hy-delta-und { color: #8a5a10; font-weight: 700; }

.hy-submittal-locked-fold {
  position: relative;
  z-index: 2;
  margin-top: 0.8rem;
  padding: 0.6rem 0.8rem;
  border: 1px dashed #64748b;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.1);
  font-size: 0.85rem;
}

.hy-submittal-locked-fold summary {
  cursor: pointer;
  font-weight: 700;
}

.hy-submittal-locked-body {
  margin-top: 0.5rem;
  line-height: 1.6;
}

.hy-statutory-alert {
  margin-top: 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(217, 119, 6, 0.45);
  background: rgba(245, 158, 11, 0.1);
  font-size: 0.84rem;
  line-height: 1.58;
}

.hy-submittal-cta-bar {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.hy-submittal-toml-btn {
  cursor: pointer;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: none;
  background: #0284c7;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
}

.hy-submittal-toml-btn:hover {
  background: #0369a1;
}

.hy-submittal-dl-link,
.hy-submittal-verify-link {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  border: 1px solid #0284c7;
  color: #0284c7;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

/* 頁面設定之常用預設晶片、美制換算對照（核心摘要全文之下另列） */
.hss-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
}

.hss-presets-head {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.hss-btn.hss-preset {
  font-size: 12.5px;
  padding: 5px 9px;
  min-height: 32px;
}

.hss-pre.hss-pre-us {
  border-top: 1px dashed var(--line);
}

/* ==========================================================================
 * 計算器體驗改版（工具頁與首頁同一套）：欄位分組、進階項、欄位說明、參考值速查、軟性提醒、
 * 結果區段（注意事項、計算表）、首頁外框（標題、工具導覽、.toml 匯入、說明視窗）
 * ========================================================================== */
.hss-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 12px 10px;
  margin: 10px 0 0;
  min-width: 0;
}
.hss-legend {
  padding: 0 6px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--brand);
}
.hss-adv {
  margin: 8px 0 0;
  border-top: 1px dashed var(--line);
  padding-top: 6px;
}
.hss-adv-sum {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.hss-adv-mod {
  font-size: 12px;
  font-weight: 700;
  color: #8a5a10;
  background: rgba(223, 160, 62, 0.18);
  border-radius: 999px;
  padding: 1px 8px;
}
.hss-flab {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.hss-flab > label {
  overflow-wrap: anywhere;
  line-height: 1.35;
  min-width: 0;
}
.hss-help-btn {
  flex: 0 0 auto;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 8px;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand);
  cursor: pointer;
}
.hss-help-btn[aria-expanded="true"] {
  background: var(--brand-soft);
  border-color: var(--brand);
}
.hss-fhelp {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 8px;
  padding: 6px 10px;
  border-left: 3px solid var(--brand);
  background: var(--soft);
  border-radius: 0 8px 8px 0;
  overflow-wrap: anywhere;
}
.hss-inp-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.hss-inp-wrap > input {
  flex: 1 1 auto;
}
.hss-qbtn {
  flex: 0 0 auto;
  min-width: 34px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
  font-size: 15px;
}
.hss-qpop {
  margin: 4px 0 8px;
  padding: 8px;
  border: 1px solid var(--brand);
  border-radius: 10px;
  background: var(--soft);
}
.hss-qpop-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
}
.hss-qitem {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 13px;
  padding: 7px 9px;
  margin: 3px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.hss-qitem:hover,
.hss-qitem:focus-visible {
  border-color: var(--brand);
}
.hss-qsrc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.hss-warn {
  display: none;
  font-size: 12.5px;
  line-height: 1.45;
  color: #8a5a10;
  background: rgba(223, 160, 62, 0.14);
  border-radius: 8px;
  padding: 5px 9px;
  margin: 0 0 6px;
}
.hss-warn.on {
  display: block;
}
.hss-field input.warn-inp {
  border-color: #dfa03e;
}
.hss-draft {
  font-size: 12.5px;
  color: var(--muted);
  margin: -4px 0 8px;
}
.hss-fsum {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}
.hss-sec-h {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin: 14px 0 6px;
}
.hss-cbasis {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}
.hss-notes ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.6;
}
.hss-tbl {
  margin: 6px 0;
}
.hss-tbl-sum {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  min-height: 32px;
  display: flex;
  align-items: center;
}
.hss-toml-note {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 6px 0 0;
}
.hss-toml-note .hss-upsell-basis {
  margin-top: 2px;
  overflow-wrap: anywhere;
}

/* 首頁外框 */
.hss-home-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
}
.hss-home-head h2 {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
  color: var(--ink);
  line-height: 1.25;
}
.hss-home-titles {
  min-width: 0;
}
.hss-home-sub {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.hss-home-sub #hs-count {
  font-weight: 700;
  margin-right: 6px;
}
.hss-home-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hss-home-badges span {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}
.hss-drop-hint {
  font-size: 12.5px;
  color: var(--muted);
}
.hss-home.hss-dragover .hss-wrap {
  outline: 3px dashed var(--brand);
  outline-offset: 4px;
}
.hss-imported {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--brand);
  border-radius: 10px;
  background: var(--brand-soft);
  font-size: 13px;
}
.hss-imported.on {
  display: flex;
}
.hss-imported button {
  font: inherit;
  font-size: 13px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.hss-imported button.on {
  border-color: var(--brand);
  font-weight: 700;
}
.hss-nav-card {
  padding: 10px;
}
.hss-nav-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  min-height: 40px;
}
.hss-nav-cur {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hss-nav-chev {
  flex: 0 0 auto;
  font-size: 12.5px;
  color: var(--muted);
}
.hss-search-wrap {
  position: relative;
  margin: 8px 0;
}
.hss-search-inp {
  width: 100%;
  min-height: 40px;
  padding: 6px 34px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  background: var(--card);
  color: var(--ink);
  box-sizing: border-box;
}
.hss-search-clr {
  display: none;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  min-width: 32px;
  min-height: 32px;
  cursor: pointer;
}
.hss-search-clr.on {
  display: block;
}
.hss-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.hss-cats button {
  font: inherit;
  font-size: 12.5px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.hss-cats button.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}
.hss-tools {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 68vh;
  overflow-y: auto;
}
.hss-cat-hd {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin: 8px 2px 2px;
}
.hss-tools button {
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.35;
}
.hss-tools button:hover {
  background: var(--soft);
}
.hss-tools button.on {
  background: var(--brand-soft);
  border-color: var(--brand);
  font-weight: 700;
}
.hss-note {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 10px 2px 0;
}
.hss-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.hss-modal[hidden] {
  display: none;
}
.hss-modal-box {
  max-width: 520px;
  width: 100%;
  background: var(--card);
  color: var(--ink);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.hss-modal-box h4 {
  margin: 0 0 8px;
  font-size: 17px;
}
.hss-modal-body {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 12px;
}

/* 計算表：窄欄不逐字斷行（表格外層可水平捲動） */
.hss-table.hss-data td,
.hss-table.hss-data th {
  min-width: 4.5em;
}

/* 欄位名稱與「說明」鈕同一段文字流（說明鈕接在名稱之後），名稱用滿整欄寬，手機上不因按鈕而多折行 */
.hss-flab {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.hss-flab > label {
  display: inline;
}
.hss-flab > .hss-help-btn {
  display: inline-block;
  margin-left: 6px;
  vertical-align: 1px;
  padding: 3px 8px;
  min-height: 24px;
}

/* ==========================================================================
 * 結果區於手機之版面（tools/calc_layout_check.mjs 以 360／390／1280 px 實測）
 * ========================================================================== */
/* 檢核表：計算值與門檻之數值一律不從中折斷（「129.96 / 3」之類）；短字串不折行，長字串只在空白處折行；判定徽章 */
.hss-table.hss-checks td.hss-c-val,
.hss-table.hss-checks td.hss-c-crit {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.hss-table.hss-checks td.hss-c-val.is-long,
.hss-table.hss-checks td.hss-c-crit.is-long,
.hss-table.hss-checks td[data-us-converted] {
  white-space: normal;
  word-break: keep-all;
  min-width: 7.5em;
}
.hss-q {
  white-space: nowrap;
}
.hss-q-si {
  color: var(--muted);
  font-weight: 500;
}
.hss-citem-t {
  font-weight: 600;
}
.hss-st-badge {
  display: inline-block;
  white-space: nowrap;
  font-weight: 800;
}
.hss-table.hss-checks td.hss-c-st {
  white-space: normal;
}

/* 計算表：指定之橫向捲動容器，首欄固定，可捲動時有邊緣陰影與捲動提示 */
.hss-scroll-x {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--card) 30%, rgba(255, 255, 255, 0)) left center / 28px 100% no-repeat local,
    linear-gradient(to left, var(--card) 30%, rgba(255, 255, 255, 0)) right center / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(15, 23, 42, 0.22), rgba(15, 23, 42, 0)) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(15, 23, 42, 0.22), rgba(15, 23, 42, 0)) right center / 12px 100% no-repeat scroll;
}
.hss-scroll-x:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.hss-scroll-x .hss-data th,
.hss-scroll-x .hss-data td {
  white-space: nowrap;
}
.hss-scroll-x .hss-data th:first-child,
.hss-scroll-x .hss-data td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
  white-space: normal;
  min-width: 4.5em;
  max-width: 9em;
  box-shadow: 1px 0 0 var(--line);
}
.hss-scroll-hint {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  text-align: center;
  margin: 2px 0 4px;
}
.hss-pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  /* 檢核表改為逐項卡片：第一行判定徽章＋項目名，其下依據小字、計算值、門檻，未判定原因全寬 */
  .hss-table.hss-checks thead {
    display: none;
  }
  .hss-table.hss-checks,
  .hss-table.hss-checks tbody {
    display: block;
    width: 100%;
  }
  .hss-table.hss-checks tr.hss-crow {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas:
      "st item"
      "basis basis"
      "val val"
      "crit crit"
      "reason reason";
    column-gap: 8px;
    row-gap: 3px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--row-line);
  }
  .hss-table.hss-checks td.hss-c-item,
  .hss-table.hss-checks td.hss-c-st {
    display: contents;
  }
  .hss-table.hss-checks .hss-citem-t {
    grid-area: item;
    align-self: center;
    overflow-wrap: anywhere;
  }
  .hss-table.hss-checks .hss-cbasis {
    grid-area: basis;
    overflow-wrap: anywhere;
  }
  .hss-table.hss-checks .hss-st-badge {
    grid-area: st;
    align-self: start;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12.5px;
  }
  .hss-table.hss-checks td.hss-ok .hss-st-badge {
    color: var(--ok);
    background: var(--ok-bg);
  }
  .hss-table.hss-checks td.hss-ng .hss-st-badge {
    color: var(--ng);
    background: var(--ng-bg);
  }
  .hss-table.hss-checks td.hss-und .hss-st-badge {
    color: #8a5a10;
    background: rgba(223, 160, 62, 0.2);
  }
  .hss-table.hss-checks .hss-reason {
    grid-area: reason;
    overflow-wrap: anywhere;
  }
  .hss-table.hss-checks td.hss-c-val,
  .hss-table.hss-checks td.hss-c-crit {
    display: block;
    border: 0;
    padding: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: normal;
    word-break: keep-all;
    font-weight: 400;
    min-width: 0;
  }
  .hss-table.hss-checks td.hss-c-val {
    grid-area: val;
    font-weight: 700;
  }
  .hss-table.hss-checks td.hss-c-crit {
    grid-area: crit;
  }
  .hss-table.hss-checks td.hss-c-val::before,
  .hss-table.hss-checks td.hss-c-crit::before {
    content: attr(data-label);
    font-weight: 400;
    font-size: 12px;
    color: var(--muted);
  }
  /* 欄位：手機仍為屬性表式（名稱在左、輸入在右），名稱過長者自行折行 */
  .hss-group {
    padding: 4px 8px 8px;
  }
}
@media (max-width: 600px) {
  /* 判定摘要膠囊可折行（三態摘要句較長） */
  .hss-verdict .hss-pill {
    white-space: normal;
    max-width: 100%;
  }
}

/* 送審判定條件列（計算核心 checks[].role = condition）：中性色，不用合格綠、不合格紅；文字為核心之 outcome */
td.hss-cond,
.hss-cond { color: #334155; font-weight: 700; }
.hss-table td.hss-cond { white-space: nowrap; }
.hss-verdict.cond { border-color: #94a3b8; background: #f1f5f9; }
.hss-pill.cond { background: #e2e8f0; color: #334155; }
.hy-sub-cond { background: rgba(100, 116, 139, 0.16); color: #334155; }
.hy-m-badge.cond { background: #e2e8f0; color: #334155; }
.hss-table.hss-checks td.hss-cond .hss-st-badge { color: #334155; background: #e2e8f0; }

/* ==========================================================================
 * 線上正式匯出（studio-shared.js 之 FX）：登入與匯出視窗、已登入時之固定登出鈕與登出提示
 * 視窗掛在 body 之下（不在工作臺容器內），故自帶色彩變數；全站淺色；手機寬零水平溢出
 * ========================================================================== */
.hfx-modal,
.hfx-logout-fixed,
.hfx-toast {
  --ink: #1f2933;
  --muted: #607d8b;
  --line: #d7dee6;
  --brand: #1f4e79;
  --brand-soft: #e3edf7;
  --ok: #2e7d32;
  --ok-bg: #e8f5e9;
  --ng: #c62828;
  --ng-bg: #ffebee;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --soft: #f4f7fa;
  --card: #ffffff;
  font-family: "Microsoft JhengHei UI", "Noto Sans TC", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  box-sizing: border-box;
}
.hfx-modal *,
.hfx-modal *::before,
.hfx-modal *::after {
  box-sizing: border-box;
}
.hfx-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.hfx-modal[hidden] {
  display: none;
}
.hfx-box {
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--card);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.hfx-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.hfx-head h4 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.4;
}
.hfx-x {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.hfx-intro {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 12px;
}
.hfx-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hfx-modal .hss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  max-width: 100%;
}
.hfx-modal .hss-btn:hover {
  border-color: var(--brand);
}
.hfx-modal .hss-btn.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.hfx-modal .hss-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.hfx-modal .hfx-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.hfx-modal .hfx-primary:hover {
  background: #173d5f;
}
.hfx-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hfx-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hfx-pane[hidden] {
  display: none;
}
.hfx-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}
.hfx-inp {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
}
.hfx-inp:focus {
  outline: 2px solid var(--brand-soft);
  border-color: var(--brand);
}
.hfx-split .hfx-col-auth {
  min-width: 0;
}
@media (min-width: 680px) {
  .hfx-body.hfx-split, .hfx-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }
  .hfx-split .hfx-nolic {
    margin-top: 0;
  }
}
.hfx-nolic {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #c9dbe6;
  border-radius: 8px;
  background: #f4f9fc;
}
.hfx-nolic-h {
  margin: 0 0 4px;
  font-weight: 800;
  color: #0f3f5c;
}
.hfx-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  overflow-wrap: anywhere;
}
.hfx-who {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--ok-bg);
  border: 1px solid #b7dfbb;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.hfx-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 13px;
  align-items: start;
}
.hfx-grid .hfx-k {
  padding-top: 6px;
}
.hfx-grid .hfx-v#hfx-tool {
  padding-top: 6px;
}
.hfx-k {
  color: var(--muted);
  font-weight: 600;
}
.hfx-v {
  overflow-wrap: anywhere;
}
.hfx-fmts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.hfx-radio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  cursor: pointer;
}
.hfx-row,
.hfx-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hfx-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.hfx-status {
  font-size: 13px;
  line-height: 1.6;
  min-height: 0;
  margin-top: 10px;
  overflow-wrap: anywhere;
}
.hfx-status:empty {
  display: none;
}
.hfx-status.hfx-err {
  color: var(--ng);
  background: var(--ng-bg);
  border: 1px solid var(--ng);
  border-radius: 8px;
  padding: 8px 10px;
}
.hfx-status.hfx-ok {
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid #b7dfbb;
  border-radius: 8px;
  padding: 8px 10px;
}
.hfx-status.hfx-warn {
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid #f5d18a;
  border-radius: 8px;
  padding: 8px 10px;
}
.hfx-status a {
  color: var(--brand);
  font-weight: 700;
}
.hfx-logout-fixed {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1001;
  min-height: 40px;
  max-width: calc(100vw - 20px);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--ng);
  background: #fff;
  color: var(--ng);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  white-space: normal;
  text-align: center;
}
.hfx-logout-fixed:hover {
  background: var(--ng-bg);
}
.hfx-toast {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1001;
  max-width: min(420px, calc(100vw - 20px));
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ok-bg);
  border: 1px solid #b7dfbb;
  color: var(--ok);
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
@media print {
  .hfx-modal,
  .hfx-logout-fixed,
  .hfx-toast {
    display: none !important;
  }
}

/* 正式匯出視窗之整案（模式 B）：佔位值逐項確認清單 */
.hfx-ph-head {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid #f5d18a;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 0 6px;
}
.hfx-ph-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.hfx-ph-list li + li {
  border-top: 1px solid var(--line);
}
.hfx-ph-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.55;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.hfx-ph-item input {
  margin-top: 3px;
  min-width: 18px;
  min-height: 18px;
}
.hfx-ph-item code {
  font-size: 12.5px;
  background: var(--soft);
  border-radius: 4px;
  padding: 0 4px;
}
.hfx-ph-ack {
  color: var(--muted);
  font-weight: 600;
}

/* ==========================================================================
 * 整案清單（studio-shared.js 之 CART，購物車式組裝）：結果區之「加入整案清單」、右下角清單鈕與右側清單欄
 * 清單欄掛在 body 之下，自帶色彩變數；全站淺色；手機寬改為全寬、零水平溢出
 * ========================================================================== */
.hss-btn-cart {
  border-color: #1f4e79;
  color: #1f4e79;
  background: #e3edf7;
}
.hct-chip,
.hct-drawer {
  --ink: #1f2933;
  --muted: #607d8b;
  --line: #d7dee6;
  --brand: #1f4e79;
  --brand-soft: #e3edf7;
  --ok: #2e7d32;
  --ok-bg: #e8f5e9;
  --ng: #c62828;
  --ng-bg: #ffebee;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --soft: #f4f7fa;
  --card: #ffffff;
  font-family: "Microsoft JhengHei UI", "Noto Sans TC", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  box-sizing: border-box;
}
.hct-drawer *,
.hct-drawer *::before,
.hct-drawer *::after {
  box-sizing: border-box;
}
.hct-chip {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 990;
  min-height: 44px;
  max-width: calc(100vw - 32px);
  padding: 8px 16px;
  border: 1px solid var(--brand);
  border-radius: 22px;
  background: var(--brand);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
}
.hct-chip[hidden],
.hct-drawer[hidden] {
  display: none;
}
.hct-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 995;
  width: 440px;
  max-width: 100vw;
  overflow-y: auto;
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px rgba(15, 23, 42, 0.22);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hct-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.hct-head h4 {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
}
.hct-x {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.hct-intro,
.hct-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
}
.hct-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hct-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}
.hct-field input,
.hct-label {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
  color: var(--ink);
  background: #ffffff;
}
.hct-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hct-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.hct-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: center;
}
.hct-item-top {
  grid-column: 1 / -1;
}
.hct-item-sub {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.hct-item.hct-bad {
  border-color: var(--ng);
  background: var(--ng-bg);
}
.hct-item.hct-editing {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.hct-ops {
  display: flex;
  gap: 4px;
}
.hct-op {
  min-width: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}
.hct-op:disabled {
  opacity: 0.4;
  cursor: default;
}
.hct-status {
  font-size: 13px;
  line-height: 1.6;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.hct-status:empty {
  display: none;
}
.hct-status.hct-ok,
.hct-status.hct-err,
.hct-status.hct-warnbox {
  padding: 8px 10px;
}
.hct-status.hct-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.hct-status.hct-err {
  background: var(--ng-bg);
  color: var(--ng);
}
.hct-status.hct-warnbox {
  background: var(--warn-bg);
  color: var(--warn);
}
.hct-warn {
  margin-top: 4px;
  font-weight: 600;
}
.hct-om-head {
  margin-top: 6px;
  font-weight: 700;
  color: var(--ink);
}
.hct-om {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--ink);
}
.hct-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  /* 清單較長時下載與匯出鈕固定於側欄底部 */
  position: sticky;
  bottom: -16px;
  margin: 0 -16px -16px;
  padding: 10px 16px 16px;
  background: var(--card);
  border-top: 1px solid var(--line);
}
.hct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  max-width: 100%;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.hct-btn.hct-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}
.hct-btn.hct-ghost {
  background: #ffffff;
  color: var(--muted);
}
.hct-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.hct-btn[hidden] {
  display: none;
}
@media (max-width: 520px) {
  .hct-drawer {
    width: 100vw;
    border-left: none;
    padding: 12px 16px;
  }
  .hct-btn {
    flex: 1 1 100%;
  }
}

/* 重度全案（雲端運算）分頁：資料夾拖放區與預檢結果 */
.hfx-drop {
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 22px 12px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  background: var(--soft);
}
.hfx-drop.on {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.hfx-hissues {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.hfx-hissues .hfx-err {
  color: var(--ng);
}
.hfx-heavy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
 * 應用程式視窗外框（2026-11-21 工作臺改版；配置同桌面版 HydroStudio）
 * 上方深藍工具列（工具名稱、判定、單位、重設；正式匯出、整案清單、分享、更多匯出）、左側參數面板（屬性表）、
 * 右側分頁（示意圖／計算結果／檢核／算式預覽）、底部狀態列（完成時間、判定件數、隱私與預覽說明）。一律淺色。
 * ========================================================================== */
.hy-shared-studio {
  --navy: #1f4e79;
  --navy-2: #1a4469;
  --primary: #1f75b0;
  --primary-hover: #1a649a;
  --okn: #0f766e;
  --okn-bg: #e0f4f1;
  --panel: #f8fafc;
  --grid-line: #edf1f5;
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-size: 13.5px;
}
.hy-shared-studio.hss-home {
  padding: 24px 16px;
}
.hss-app {
  background: var(--card);
  border: 1px solid #c3ced9;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.07);
  min-width: 0;
}

/* ── 工具列 ── */
.hss-app .hss-toolbar {
  display: block;
  margin: 0;
  padding: 0;
  background: var(--navy);
  color: #ffffff;
  border: 0;
  border-radius: 9px 9px 0 0;
}
.hss-tb-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  padding: 8px 12px;
  min-width: 0;
}
.hss-tb-actions {
  background: var(--navy-2);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
}
.hss-tb-titlegrp {
  flex: 1 1 380px;
  flex-wrap: nowrap;
  gap: 12px;
}
.hss-app .hss-tb-title {
  flex: 0 1 auto;
  font-size: 15.5px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
  min-width: 0;
}
.hss-app .hss-toolbar .hss-verdict {
  flex: 1 1 200px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  min-width: 0;
}
.hss-app .hss-toolbar .hss-kpis {
  flex: 1 1 auto;
  color: #d6e3f0;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}
.hss-app .hss-pill {
  border: 1px solid transparent;
  padding: 3px 10px;
  font-size: 12.5px;
  font-weight: 800;
}
.hss-app .hss-pill.ok { background: #e6f4ea; color: #1b6e2f; border-color: #98c19c; }
.hss-app .hss-pill.ng { background: #fde8e8; color: #b42318; border-color: #f3a9a3; }
.hss-app .hss-pill.ok-note { background: var(--okn-bg); color: var(--okn); border-color: #7fcfc3; }
.hss-app .hss-pill.info { background: #e6effa; color: var(--navy); border-color: #b9cfe6; }
.hss-app .hss-pill.und { background: #eef1f4; color: #475569; border-color: #cbd5e1; }
.hss-app .hss-pill.cond { background: #e2e8f0; color: #334155; border-color: #cbd5e1; }
.hss-tb-ctl,
.hss-app .hss-btns,
.hss-tb-pro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-width: 0;
}
.hss-tb-cap {
  font-size: 12px;
  font-weight: 700;
  color: #b9cde0;
  letter-spacing: 0.02em;
  margin-right: 2px;
}
.hss-app .hss-toolbar .hss-btn,
.hss-app .hss-toolbar .hss-sel {
  min-height: 34px;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}
.hss-app .hss-toolbar .hss-sel option {
  color: #1f2933;
  background: #ffffff;
}
.hss-app .hss-toolbar .hss-btn:hover,
.hss-app .hss-toolbar .hss-sel:hover {
  background: rgba(255, 255, 255, 0.17);
  border-color: rgba(255, 255, 255, 0.55);
}
.hss-app .hss-toolbar .hss-btn.active {
  background: #ffffff;
  color: var(--navy);
  border-color: #ffffff;
}
.hss-app .hss-toolbar .hss-btn.hss-btn-primary {
  background: var(--primary);
  border-color: #4c9bd6;
  color: #ffffff;
}
.hss-app .hss-toolbar .hss-btn.hss-btn-primary:hover {
  background: var(--primary-hover);
}
.hss-app .hss-toolbar .hss-btn:disabled,
.hss-app .hss-toolbar .hy-pro-btn:disabled {
  opacity: 0.45;
}
.hss-app .hss-toolbar .hss-btn:focus-visible,
.hss-app .hss-toolbar .hy-pro-btn:focus-visible,
.hss-more-sum:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}
/* 列印、複製表格、釘選基準：工具列右側之次要鈕 */
.hss-tb-pro .hy-pro-actions-bar {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  gap: 6px;
}
.hss-app .hss-tb-pro .hy-pro-btn {
  min-height: 32px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: #d6e3f0;
  font-size: 12.5px;
  font-weight: 700;
}
.hss-app .hss-tb-pro .hy-pro-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.hss-app .hss-tb-pro .hy-pro-btn.is-pinned {
  color: #fde68a;
  border-color: rgba(253, 230, 138, 0.6);
}

/* 「更多匯出」選單 */
.hss-more {
  position: relative;
}
.hss-more > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.hss-more > summary::-webkit-details-marker {
  display: none;
}
.hss-app .hss-toolbar .hss-more[open] > summary {
  background: rgba(255, 255, 255, 0.2);
}
.hss-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 260px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 6px;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.2);
}
.hss-app .hss-toolbar .hss-more-menu .hss-more-item,
.hss-more-menu a.hss-more-item.hy-cta-tier2 {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1f2933 !important;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  text-decoration: none !important;
}
.hss-app .hss-toolbar .hss-more-menu .hss-more-item:hover,
.hss-more-menu a.hss-more-item.hy-cta-tier2:hover {
  background: #eef4fa;
}
.hss-more-note,
.hss-more-menu .hy-cta-micro.hss-more-note {
  display: block;
  padding: 0 10px 6px;
  font-size: 11.5px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--muted);
}

/* 訊息列（工具列之下；空白時不佔高度） */
.hss-app > .hss-msg {
  padding: 6px 14px;
  background: #f0f7ff;
  border-bottom: 1px solid #d7e6f5;
  color: var(--navy);
  font-size: 12.5px;
  min-height: 0;
}
.hss-app > .hss-msg:empty {
  display: none;
}
.hss-app > .hss-imported {
  margin: 8px 12px;
}

/* ── 參數面板與結果區 ── */
.hss-app .hss-grid-single {
  grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1.4fr);
  gap: 0;
}
.hss-app .hss-grid-full {
  grid-template-columns: 236px minmax(290px, 0.92fr) minmax(0, 1.35fr);
  gap: 0;
}
.hss-app .hss-card {
  border: 0;
  border-radius: 0;
  padding: 12px 14px 14px;
  background: var(--card);
}
.hss-app .hss-form-card {
  align-self: stretch;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.hss-app .hss-nav-card {
  align-self: stretch;
  background: #f3f6f9;
  border-right: 1px solid var(--line);
}
@media (min-width: 1024px) {
  /* 結果區固定於視窗內，參數面板捲動時仍看得到結果（頁首高度約 60 px） */
  .hss-app .hss-res-card {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 92px);
    overflow-y: auto;
    align-self: start;
  }
}
.hss-app .hss-fhead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
  margin: 0 0 6px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--line);
}
.hss-fpanel-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.hss-app .hss-draft {
  margin: 0;
  font-size: 11.5px;
}
.hss-app .hss-fsum {
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0 0 8px;
}
.hss-app .hss-presets {
  margin: 0 0 8px;
}
/* 屬性表：名稱在左、輸入在右之緊湊列 */
.hss-app .hss-field {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 47%);
  gap: 8px;
  margin: 0;
  padding: 3px 0;
  min-height: 36px;
  border-bottom: 1px solid var(--grid-line);
  font-size: 13px;
}
.hss-app .hss-field select,
.hss-app .hss-field input:not([type="checkbox"]) {
  min-height: 30px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 13.5px;
}
.hss-app .hss-fnote:not(:empty),
.hss-app .hss-warn.on {
  margin: 2px 0 4px;
}
.hss-app .hss-fnote:empty {
  margin: 0;
}
/* 輸入框與單位標示（同一外框；單位為固定寬之灰底標示，不可選取） */
.hss-inp-box {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
}
.hss-inp-box:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(31, 78, 121, 0.16);
}
.hss-inp-box:has(input.err-inp) {
  border-color: var(--ng);
}
.hss-inp-box:has(input.warn-inp) {
  border-color: #dfa03e;
}
.hss-field .hss-inp-box > input:not([type="checkbox"]) {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
/* 輸入框在單位標示之外框內：焦點環畫在外框上（外框裁切內容，環不可畫在輸入框本身） */
.hss-field .hss-inp-box > input:not([type="checkbox"]):focus-visible {
  outline: 0;
}
.hss-inp-box:has(> input:focus-visible) {
  outline: 3px solid #0284c7;
  outline-offset: 2px;
}
.hss-inp-box > input.err-inp {
  background: #fff5f5;
}
.hss-unit {
  flex: 0 0 auto;
  min-width: 4.6em;
  max-width: 7.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  background: #eef2f6;
  border-left: 1px solid var(--line);
  color: #52606d;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.hss-unit.is-empty {
  background: transparent;
  border-left-color: transparent;
}
.hss-app .hss-inp-wrap {
  gap: 4px;
}
.hss-app .hss-qbtn,
.hss-qslot {
  flex: 0 0 30px;
  width: 30px;
  min-width: 30px;
}
.hss-app .hss-qbtn {
  min-height: 30px;
  padding: 0;
  border-radius: 4px;
  font-size: 13px;
}
/* 分組：可收合之標題列 */
.hss-app .hss-group {
  border: 0;
  border-radius: 0;
  padding: 0 0 4px;
  margin: 8px 0 0;
}
.hss-app .hss-legend {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 2px;
  float: none;
}
.hss-legend-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  background: #e8eef5;
  color: var(--navy);
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.hss-legend-btn::before {
  content: "\25BE";
  font-size: 11px;
  line-height: 1;
  transition: transform 0.15s;
}
.hss-group.is-collapsed .hss-legend-btn::before {
  transform: rotate(-90deg);
}
.hss-legend-btn:hover {
  background: #dfe8f2;
}
.hss-legend-btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
}
.hss-group.is-collapsed > :not(legend) {
  display: none !important;
}
.hss-app .hss-adv {
  margin: 4px 0 0;
  padding-top: 2px;
}
.hss-app .hss-adv-sum {
  min-height: 30px;
  font-size: 12.5px;
}
/* 規範與係數設定：與參數同一屬性表樣式 */
.hss-app .hss-code-box {
  margin: 0 0 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.hss-app .hss-code-title {
  margin: 0 0 2px;
  padding: 5px 8px;
  border-radius: 4px;
  background: #e8eef5;
  color: var(--navy);
  font-size: 12.5px;
}
.hss-app .hss-code-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.hss-app .hss-code-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 47%);
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid var(--grid-line);
  font-size: 13px;
}
.hss-app .hss-code-item.hss-code-wide {
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}
.hss-app .hss-code-item label {
  font-weight: 600;
}
.hss-app .hss-code-item select,
.hss-app .hss-code-item input {
  min-height: 30px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 13.5px;
}
/* 列印抬頭（選填） */
.hss-form-foot:empty {
  display: none;
}
.hy-pro-meta-fold {
  margin: 10px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
.hy-pro-meta-sum {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  min-height: 30px;
  display: flex;
  align-items: center;
}
.hy-pro-meta-fold .hy-pro-meta-bar {
  grid-template-columns: minmax(0, 1fr);
  margin: 6px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}

/* ── 結果區分頁 ── */
.hss-tabs {
  display: flex;
  gap: 2px;
  margin: -4px 0 10px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.hss-tabs::-webkit-scrollbar {
  display: none;
}
.hss-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #52606d;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.hss-tab:hover {
  color: var(--navy);
}
.hss-tab[aria-selected="true"] {
  color: var(--navy);
  border-bottom-color: var(--navy);
}
.hss-tab:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
}
.hss-tab[hidden] {
  display: none;
}
.hss-tab-n {
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef1f4;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}
.hss-tab-n:empty {
  display: none;
}
.hss-tab-n.is-ok { background: #e6f4ea; color: #1b6e2f; }
.hss-tab-n.is-ng { background: #fde8e8; color: #b42318; }
.hss-tab-n.is-ok-note { background: var(--okn-bg); color: var(--okn); }
.hss-tabpanel[hidden] {
  display: none !important;
}
.hss-tabpanel:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
.hss-errhost:empty {
  display: none;
}
.hss-app .hss-fig-box {
  margin: 0;
  border-radius: 6px;
}
/* 分頁標籤已示名稱：各分頁第一個標題只供螢幕閱讀器與列印 */
.hss-sec-h-first {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hss-app .hss-sec-h {
  font-size: 13px;
  margin: 12px 0 4px;
  color: #334155;
}
.hss-app .hss-table th {
  background: #f3f6f9;
  color: #52606d;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 8px;
}
.hss-app .hss-table td {
  padding: 6px 8px;
}
.hss-app .hss-values td:first-child {
  color: #334155;
}
/* 判定：小圓角徽章（符合綠、不符合紅、未判定琥珀、條件列灰） */
.hss-app .hss-table.hss-checks .hss-st-badge {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
}
.hss-app .hss-table.hss-checks td.hss-ok .hss-st-badge { color: #1b6e2f; background: #e6f4ea; border-color: #b7dcbf; }
.hss-app .hss-table.hss-checks td.hss-ng .hss-st-badge { color: #b42318; background: #fde8e8; border-color: #f3c0bb; }
.hss-app .hss-table.hss-checks td.hss-und .hss-st-badge { color: #8a5a10; background: rgba(223, 160, 62, 0.18); border-color: rgba(223, 160, 62, 0.45); }
.hss-app .hss-table.hss-checks td.hss-cond .hss-st-badge { color: #334155; background: #e2e8f0; border-color: #cbd5e1; }
.hss-app .hss-acc {
  margin: 0 0 10px;
}
.hss-app .hss-pre {
  max-height: none;
}
.hss-app .hss-toml-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--grid-line);
}

/* 重算後有變動之結果格與判定：約 350 ms 淡藍底漸退 */
@keyframes hssFlashBg {
  from { background-color: #cfe5fb; }
  to { background-color: transparent; }
}
@keyframes hssFlashRing {
  from { box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.8); }
  to { box-shadow: 0 0 0 3px rgba(96, 165, 250, 0); }
}
.hss-flash {
  animation: hssFlashBg 0.35s ease-out;
}
.hss-pill.hss-flash,
.hss-st-badge.hss-flash {
  animation: hssFlashRing 0.35s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .hss-flash,
  .hss-pill.hss-flash,
  .hss-st-badge.hss-flash {
    animation: none;
  }
}

/* ── 底部狀態列 ── */
.hss-statusbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 9px 9px;
  background: #ffffff;
  color: #52606d;
  font-size: 12px;
  line-height: 1.45;
}
.hss-sb-left,
.hss-sb-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  min-width: 0;
}
.hss-sb-right {
  justify-content: flex-end;
}
.hss-sb-state {
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}
.hss-sb-state::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #94a3b8;
  vertical-align: 1px;
}
.hss-sb-state.is-ok::before { background: #22a06b; }
.hss-sb-state.is-err::before { background: var(--ng); }
.hss-sb-verdict { font-weight: 700; }
.hss-sb-verdict.is-ok { color: #1b6e2f; }
.hss-sb-verdict.is-ng { color: #b42318; }
.hss-sb-verdict.is-ok-note { color: var(--okn); }
.hss-sb-verdict.is-und,
.hss-sb-verdict.is-cond { color: #475569; }
.hss-statusbar .hss-badge-local {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #52606d;
  font-size: 12px;
  font-weight: 600;
}
.hss-statusbar .hss-badge-local::before {
  content: "\1F512\00A0";
}
.hss-sb-note {
  color: #8a5a10;
  font-weight: 600;
}
.hss-statusbar .hy-pro-toast {
  flex: 0 1 auto;
  font-size: 12px;
  color: #047857;
}

/* ── 平板與手機 ── */
@media (max-width: 1023px) {
  .hss-app .hss-grid-single,
  .hss-app .hss-grid-full {
    grid-template-columns: minmax(0, 1fr);
  }
  .hss-app .hss-form-card,
  .hss-app .hss-nav-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .hss-app .hss-toolbar .hss-kpis {
    display: none;
  }
}
@media (max-width: 760px) {
  .hy-shared-studio.hss-home {
    padding: 16px 0;
  }
  .hss-tb-row {
    padding: 8px 10px;
  }
  .hss-tb-titlegrp {
    flex-wrap: wrap;
    flex-basis: 100%;
    gap: 6px 10px;
  }
  .hss-app .hss-tb-title {
    flex-basis: 100%;
  }
  .hss-app .hss-toolbar .hss-verdict .hss-pill {
    white-space: normal;
  }
  .hss-tb-ctl {
    width: 100%;
  }
  .hss-app .hss-toolbar .hss-btn,
  .hss-app .hss-toolbar .hss-sel {
    min-height: 40px;
  }
  .hss-tb-ctl > * {
    flex: 1 1 auto;
  }
  .hss-tb-cap {
    flex-basis: 100%;
  }
  .hss-app .hss-btns > .hss-btn {
    flex: 1 1 auto;
  }
  .hss-more {
    flex: 1 1 auto;
  }
  .hss-more > summary {
    width: 100%;
  }
  .hss-more[open] {
    flex-basis: 100%;
  }
  .hss-more-menu {
    position: static;
    margin-top: 6px;
    min-width: 0;
    max-width: none;
    width: 100%;
    box-shadow: none;
  }
  .hss-tb-pro,
  .hss-tb-pro .hy-pro-actions-bar {
    width: 100%;
  }
  .hss-app .hss-tb-pro .hy-pro-btn {
    flex: 1 1 0;
    min-height: 38px;
    padding: 4px 6px;
    font-size: 12px;
    white-space: nowrap;
  }
  .hss-app .hss-btns > .hss-btn,
  .hss-more > summary {
    padding: 5px 8px;
    font-size: 12.5px;
  }
  .hss-app .hss-card {
    padding: 10px;
  }
  .hss-app .hss-field {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 54%);
    gap: 6px;
    min-height: 46px;
  }
  .hss-app .hss-field select,
  .hss-app .hss-field input:not([type="checkbox"]),
  .hss-app .hss-code-item select,
  .hss-app .hss-code-item input {
    min-height: 40px;
  }
  .hss-app .hss-code-item {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 54%);
  }
  /* 分頁改為分段控制 */
  .hss-tabs {
    margin: 0 0 10px;
    padding: 3px;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef2f6;
    overflow: visible;
  }
  .hss-tab {
    flex: 1 1 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px 4px;
    min-height: 40px;
    margin: 0;
    padding: 5px 4px;
    border: 0;
    border-radius: 6px;
    font-size: 12.5px;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
  }
  .hss-tab[aria-selected="true"] {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.16);
  }
  .hss-statusbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .hss-sb-right {
    justify-content: flex-start;
  }
}

/* 手機判定列：四態之「合格・待核實」 */
.hy-m-badge.ok-note {
  background: #e0f4f1;
  color: #0f766e;
  white-space: normal;
}

/* ── 列印：工具名稱與判定照印；動作列、分頁標籤與收合項不印；各分頁內容全部列出 ── */
@media print {
  .hss-app,
  .hss-app .hss-toolbar {
    border: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }
  .hss-app .hss-tb-title,
  .hss-app .hss-toolbar .hss-kpis {
    color: #0f172a !important;
  }
  .hss-tabpanel[hidden] {
    display: block !important;
  }
  .hss-app .hss-res-card {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .hss-sec-h-first {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 6px 0 2px !important;
    clip: auto !important;
  }
}

/* ── 首次載入骨架（計算核心載入與初始化期間；版面同工作臺） ── */
.hss-skel .hss-tb-head,
.hss-skel .hss-tb-actions {
  min-height: 50px;
}
.hss-skel .hss-tb-actions {
  min-height: 46px;
}
.hss-skel-step {
  flex: 1 1 auto;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
}
.hss-skel-bar {
  display: block;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #e3e9f0 25%, #f2f5f9 37%, #e3e9f0 63%);
  background-size: 400% 100%;
  animation: hssShimmer 1.4s ease-in-out infinite;
}
.hss-skel-bar.on-dark {
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.22) 37%, rgba(255, 255, 255, 0.1) 63%);
  background-size: 400% 100%;
}
.hss-skel-bar.w-ctl { width: 220px; max-width: 40%; }
.hss-skel-bar.w-act { width: 520px; max-width: 64%; }
.hss-skel-bar.w-pro { width: 260px; max-width: 30%; }
.hss-skel-bar.w-30 { width: 30%; }
.hss-skel-bar.w-40 { width: 40%; }
.hss-skel-bar.w-45 { width: 45%; }
.hss-skel-bar.w-60 { width: 60%; }
.hss-skel-bar.w-70 { width: 70%; }
.hss-skel-bar.w-75 { width: 75%; }
.hss-skel-bar.w-tab { width: 82px; height: 14px; }
.hss-skel-bar.h-input { height: 30px; }
.hss-skel-bar.hss-skel-fig { height: 380px; border-radius: 6px; }
.hss-skel-line {
  padding: 8px 0;
}
.hss-skel-grp .hss-skel-bar {
  height: 24px;
}
.hss-skel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 47%);
  gap: 8px;
  align-items: center;
  min-height: 36px;
  border-bottom: 1px solid var(--grid-line, #edf1f5);
}
.hss-skel-tabs {
  display: flex;
  gap: 16px;
  align-items: center;
  min-height: 38px;
  margin: -4px 0 10px;
  border-bottom: 1px solid var(--line, #d7dee6);
}
.hss-skel .hss-statusbar {
  min-height: 31px;
}
@keyframes hssShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@media (max-width: 760px) {
  .hss-skel .hss-tb-head {
    min-height: 120px;
  }
  .hss-skel .hss-tb-actions {
    min-height: 220px;
  }
  .hss-skel-bar.hss-skel-fig {
    height: 260px;
  }
}

/* ── 減少動態效果（工作臺全域）：微光、重算標示、轉場與平滑捲動一律停用 ── */
@media (prefers-reduced-motion: reduce) {
  .hy-shared-studio *,
  .hy-shared-studio *::before,
  .hy-shared-studio *::after,
  .hy-m-sticky-bar,
  .hy-m-sticky-bar *,
  .hfx-modal * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .hy-shared-studio {
    scroll-behavior: auto !important;
  }
}

/* 「不會用於訓練 AI 模型」之說明（狀態列、正式匯出視窗之登入畫面、重度全案上傳區） */
.hss-sb-ai {
  color: #52606d;
  font-weight: 600;
}
.hfx-ai-note {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #1f4e79;
}
.hfx-ai-note[hidden] {
  display: none;
}

/* 規劃書 S1：日文頁字型——共用樣式表之字型以繁中字型優先，日文頁之工作臺、正式匯出視窗、提示與整案清單改以日文字型優先 */
html[lang="ja"] .hy-studio,
html[lang="ja"] .hfx-modal,
html[lang="ja"] .hfx-toast,
html[lang="ja"] .hct-drawer {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, -apple-system, sans-serif;
}

/* ==========================================================================
 * 級距 A（線上工作臺現代化視覺重構規劃書 第 3 章 A1～A5；2026-11-22）
 * A1 克制色票：白底、1 px #e5e7eb 細線；整個工作臺只有「正式匯出 Word」為實心品牌色（#037193）主鈕，其餘動作白底細框深灰字
 * A2 判定膠囊：白底細框之常駐摘要列，8 px 圓點（裝飾，aria-hidden）＋幾何符號＋文字＋件數（WCAG 1.4.1）
 * A3 示意圖：點陣工程底紋（列印時去除）、低飽和色票、右下角縮放膠囊（不攔截裸滾輪）
 * A4 欄位：欄名在上、分組內兩欄格（參數面板窄於 420 px 時單欄）、40 px 控制項、等寬數字、內嵌淡灰單位、微字距分組標
 * A5 結果卡：常駐判定摘要列＋兩個分頁（圖示與檢核｜明細與計算式）；手機為二段式分段控制；列印時全部列出
 * ========================================================================== */
.hy-shared-studio {
  --hy-brand: #037193;
  --hy-brand-hover: #035e7b;
  --hairline: #e5e7eb;
  --ink2: #374151;
  --muted2: #6b7280;
}
.hss-app {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: none;
  background: #ffffff;
}

/* ── A1：工具列與按鈕 ── */
.hss-app .hss-toolbar {
  background: #ffffff;
  color: var(--ink);
  border-bottom: 1px solid var(--hairline);
  border-radius: 12px 12px 0 0;
}
.hss-app .hss-tb-head {
  padding: 10px 14px;
}
.hss-app .hss-tb-actions {
  background: #ffffff;
  border-top: 1px solid #f1f3f5;
  padding: 6px 14px;
}
.hss-app .hss-tb-titlegrp {
  flex: 1 1 260px;
}
.hss-app .hss-tb-title {
  color: #111827;
  font-size: 15.5px;
  font-weight: 800;
}
.hss-app .hss-tb-cap {
  color: var(--muted2);
  font-weight: 600;
}
.hss-app .hss-btn,
.hss-app .hss-toolbar .hss-btn,
.hss-app .hss-toolbar .hss-sel,
.hss-app .hss-tb-pro .hy-pro-btn {
  background: #ffffff;
  border: 1px solid var(--hairline);
  color: var(--ink2);
  border-radius: 8px;
  font-weight: 600;
}
.hss-app .hss-toolbar .hss-btn,
.hss-app .hss-toolbar .hss-sel {
  min-height: 36px;
  padding: 5px 12px;
  font-size: 13px;
}
.hss-app .hss-tb-pro .hy-pro-btn {
  min-height: 32px;
  font-size: 12.5px;
}
.hss-app .hss-btn:hover,
.hss-app .hss-toolbar .hss-btn:hover,
.hss-app .hss-toolbar .hss-sel:hover,
.hss-app .hss-tb-pro .hy-pro-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}
/* 唯一之實心主鈕：正式匯出 Word */
.hss-app .hss-toolbar .hss-btn.hss-btn-primary {
  background: var(--hy-brand);
  border-color: var(--hy-brand);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(3, 113, 147, 0.28);
}
.hss-app .hss-toolbar .hss-btn.hss-btn-primary:hover {
  background: var(--hy-brand-hover);
  border-color: var(--hy-brand-hover);
  color: #ffffff;
}
.hss-app .hss-toolbar .hss-btn.active {
  background: #ffffff;
  color: var(--hy-brand);
  border-color: var(--hy-brand);
}
.hss-app .hss-toolbar .hss-more[open] > summary {
  background: #f3f4f6;
}
.hss-app .hss-tb-pro .hy-pro-btn.is-pinned {
  background: #ffffff;
  color: var(--hy-brand);
  border-color: var(--hy-brand);
}
.hss-app .hss-toolbar .hss-btn:focus-visible,
.hss-app .hss-toolbar .hy-pro-btn:focus-visible,
.hss-app .hss-more-sum:focus-visible,
.hss-zoom-btn:focus-visible,
.hss-tab:focus-visible {
  outline: 3px solid #0284c7;
  outline-offset: 2px;
}
/* 首頁工具導覽：選取中之分類為白底品牌色框（不另用實心色） */
.hss-app .hss-cats button.on {
  background: #ffffff;
  color: var(--hy-brand);
  border-color: var(--hy-brand);
}
.hss-app .hss-tools button.on {
  background: #f0f8fa;
  border-color: #b9dbe5;
}
.hss-app .hss-form-card {
  background: #ffffff;
  border-right: 1px solid var(--hairline);
}
.hss-app .hss-nav-card {
  background: #fafbfc;
  border-right: 1px solid var(--hairline);
}
.hss-app > .hss-msg {
  background: #f0f8fa;
  border-bottom: 1px solid #d5eaf0;
  color: var(--hy-brand-hover);
}

/* ── A2／A5：結果卡頂端之常駐判定摘要列 ── */
.hss-app .hss-res-card .hss-verdict.hss-summary,
.hss-app .hss-res-card .hss-verdict.hss-summary.ok,
.hss-app .hss-res-card .hss-verdict.hss-summary.ng,
.hss-app .hss-res-card .hss-verdict.hss-summary.und,
.hss-app .hss-res-card .hss-verdict.hss-summary.cond {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 9px 12px;
  background: #ffffff;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}
.hss-app .hss-pill,
.hss-app .hss-pill.ok,
.hss-app .hss-pill.ng,
.hss-app .hss-pill.ok-note,
.hss-app .hss-pill.info,
.hss-app .hss-pill.und,
.hss-app .hss-pill.cond {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}
.hss-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.16);
}
.hss-app .hss-pill.ok { color: #15803d; }
.hss-pill.ok .hss-dot { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16); }
.hss-app .hss-pill.ok-note { color: #0f766e; }
.hss-pill.ok-note .hss-dot { background: #0d9488; box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.16); }
.hss-app .hss-pill.ng { color: #b91c1c; }
.hss-pill.ng .hss-dot { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16); }
.hss-app .hss-pill.und { color: #92400e; }
.hss-pill.und .hss-dot { background: #d97706; box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.16); }
.hss-app .hss-pill.cond { color: #334155; }
.hss-app .hss-pill.info { color: var(--hy-brand); }
.hss-pill.info:not(.und) .hss-dot { background: var(--hy-brand); box-shadow: 0 0 0 3px rgba(3, 113, 147, 0.14); }
/* 關鍵結果：可折行（不以省略號截斷，完整數值同時列於「明細與計算式」） */
.hss-app .hss-summary .hss-kpis {
  flex: 1 1 240px;
  min-width: 0;
  color: #4b5563;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}

/* ── A5：分頁（品牌色底線） ── */
.hss-app .hss-tab[aria-selected="true"] {
  color: var(--hy-brand);
  border-bottom-color: var(--hy-brand);
}
.hss-app .hss-tab:hover {
  color: var(--hy-brand);
}

/* ── A3：示意圖之點陣底紋與縮放膠囊 ── */
.hss-app .hss-fig-box {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  margin: 0 0 4px;
}
.hg-dot-grid {
  background-color: #fcfcfd;
  background-image: radial-gradient(#d1d5db 1px, transparent 1px);
  background-size: 18px 18px;
}
.hss-app .hss-fig svg {
  background: transparent;
}
.hss-fig.is-zoomed {
  cursor: grab;
  touch-action: none;
}
.hss-fig.is-zoomed:active {
  cursor: grabbing;
}
.hss-app .hss-fig-foot {
  background: #ffffff;
  border-top: 1px solid var(--hairline);
  align-items: center;
}
.hss-zoom {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 2px;
  background: #ffffff;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.hss-zoom[hidden] {
  display: none;
}
.hss-zoom-btn {
  min-width: 32px;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink2);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.hss-zoom-btn.hss-zoom-fit {
  font-size: 12px;
}
.hss-zoom-btn:hover {
  background: #f3f4f6;
}
.hss-zoom-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.hss-zoom-lv {
  min-width: 3.4em;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted2);
}

/* ── A4：上標欄名、分組內兩欄格（以參數面板寬度判斷） ── */
.hss-app .hss-form-card {
  container-type: inline-size;
  container-name: hssform;
}
.hss-app .hss-group,
.hss-adv-grid,
.hss-app .hss-code-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 12px;
}
.hss-app .hss-group {
  margin: 14px 0 0;
  padding: 0 0 4px;
  border: 0;
}
.hss-adv-grid {
  margin-top: 8px;
}
.hss-app .hss-group > .hss-adv,
.hss-app .hss-field.is-wide,
.hss-app .hss-code-item.hss-code-wide {
  grid-column: 1 / -1;
}
@container hssform (min-width: 360px) {
  .hss-app .hss-group,
  .hss-adv-grid,
  .hss-app .hss-code-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.hss-app .hss-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-bottom: 0;
}
.hss-app .hss-flab {
  font-size: 12.5px;
  line-height: 1.35;
  font-weight: 600;
  color: #4b5563;
}
.hss-app .hss-field select,
.hss-app .hss-field input:not([type="checkbox"]),
.hss-app .hss-code-item select,
.hss-app .hss-code-item input {
  min-height: 40px;
  border-radius: 8px;
  border-color: var(--hairline);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.hss-app .hss-inp-box {
  min-height: 40px;
  border-radius: 8px;
  border-color: var(--hairline);
}
.hss-app .hss-field .hss-inp-box > input:not([type="checkbox"]) {
  min-height: 38px;
  font-variant-numeric: tabular-nums;
}
.hss-app .hss-unit {
  background: #f9fafb;
  border-left: 1px solid #f1f5f9;
  color: var(--muted2);
}
.hss-app .hss-unit.is-empty {
  display: none;
}
.hss-app .hss-qbtn,
.hss-app .hss-qslot {
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
}
.hss-app .hss-qbtn {
  min-height: 40px;
  border-radius: 8px;
  border-color: var(--hairline);
}
.hss-app .hss-chk-wrap {
  min-height: 40px;
}
.hss-app .hss-field .hss-fnote,
.hss-app .hss-field .hss-warn.on,
.hss-app .hss-field .hss-fhelp,
.hss-app .hss-field .hss-qpop {
  margin: 0;
}
/* 分組標：微字距、淡灰小字、細收合箭頭（英文大寫） */
.hss-app .hss-legend-btn {
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid #f1f3f5;
  border-radius: 0;
  background: transparent;
  color: var(--muted2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hss-app .hss-legend-btn:hover {
  background: transparent;
  color: var(--hy-brand);
}
.hss-app .hss-legend-btn::before {
  font-size: 10px;
}
.hss-app .hss-code-title {
  margin: 0 0 6px;
  padding: 4px 0;
  border-radius: 0;
  border-bottom: 1px solid #f1f3f5;
  background: transparent;
  color: var(--muted2);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hss-app .hss-code-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border-bottom: 0;
  text-align: left;
  align-items: stretch;
}
.hss-app .hss-flab,
.hss-app .hss-field {
  text-align: left;
}
/* 上標欄名後，輸入框佔滿所在格（無速查鈕者不保留空位） */
.hss-app .hss-qslot {
  display: none;
}
.hss-app .hss-code-item label {
  font-size: 12.5px;
  font-weight: 600;
  color: #4b5563;
}
.hss-app .hss-fsum {
  color: var(--muted2);
}

/* 載入骨架：版面同級距 A */
.hss-skel .hss-tb-head {
  min-height: 57px;
}
.hss-skel .hss-tb-actions {
  min-height: 45px;
}
.hss-app .hss-skel-step {
  color: #111827;
}
.hss-skel-bar.h-btn {
  height: 34px;
  border-radius: 8px;
}
.hss-skel-bar.w-act { width: 560px; max-width: 62%; }
.hss-skel-bar.w-ctl { width: 220px; max-width: 40%; }
.hss-skel-bar.w-pro { width: 300px; max-width: 40%; }
.hss-skel-bar.w-pill { width: 180px; }
.hss-skel-cells {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 12px;
}
@container hssform (min-width: 360px) {
  .hss-skel-cells {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.hss-skel-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hss-skel-cell .hss-skel-bar:first-child {
  height: 10px;
}
.hss-skel-bar.h-input {
  height: 40px;
  border-radius: 8px;
}
.hss-skel-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  margin: 0 0 10px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
}

/* ── 手機（≤ 760 px） ── */
@media (max-width: 760px) {
  .hss-app .hss-toolbar .hss-btn,
  .hss-app .hss-toolbar .hss-sel,
  .hss-app .hss-tb-pro .hy-pro-btn {
    min-height: 40px;
  }
  .hss-app .hss-btns {
    width: 100%;
  }
  .hss-app .hss-field {
    min-height: 0;
  }
  .hss-app .hss-res-card .hss-verdict.hss-summary {
    position: static;
    flex-wrap: wrap;
  }
  .hss-app .hss-pill {
    white-space: normal;
  }
  .hss-app .hss-summary .hss-kpis {
    flex-basis: 100%;
    text-align: left;
    white-space: normal;
  }
  .hss-zoom-btn {
    min-width: 40px;
    min-height: 40px;
  }
  .hss-skel .hss-tb-head {
    min-height: 202px;
  }
  .hss-skel .hss-tb-actions {
    min-height: 104px;
  }
}

/* ── 列印：點陣底紋與縮放膠囊不印；摘要列不黏附 ── */
@media print {
  .hg-dot-grid {
    background-image: none !important;
    background-color: #ffffff !important;
  }
  .hss-zoom {
    display: none !important;
  }
  .hss-app .hss-res-card .hss-verdict.hss-summary {
    position: static !important;
  }
}

/* 手機置頂判定列：白底細框＋圓點（純裝飾）＋符號文字（與工作臺之判定膠囊一致） */
.hy-m-badge,
.hy-m-badge.ok,
.hy-m-badge.ng,
.hy-m-badge.und,
.hy-m-badge.cond,
.hy-m-badge.ok-note {
  gap: 7px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  white-space: normal;
}
.hy-m-badge::before {
  content: "";
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}
.hy-m-badge.ok { color: #15803d; }
.hy-m-badge.ok::before { background: #16a34a; }
.hy-m-badge.ok-note { color: #0f766e; }
.hy-m-badge.ok-note::before { background: #0d9488; }
.hy-m-badge.ng { color: #b91c1c; }
.hy-m-badge.ng::before { background: #dc2626; }
.hy-m-badge.und { color: #92400e; }
.hy-m-badge.und::before { background: #d97706; }
.hy-m-badge.cond { color: #334155; }
.hy-m-sticky-bar {
  border-color: #e5e7eb;
}

/* ==========================================================================
 * 級距 B（線上工作臺現代化視覺重構規劃書 第 4 章 B1／B2；2026-11-22）
 * B1 三欄工作站：桌機 ≥ 1024 px，覆蓋層填滿瀏覽器視窗（非瀏覽器全螢幕）；48 px 標題列、220 px 元件樹、
 *    中央點陣畫布（≥ 52% 寬）、296 px 右欄兩分頁（屬性設定｜檢核與計算式）；背景頁鎖捲動；列印時回到一般版面
 * B2 欄位聚焦連動高亮：符合之圖元加品牌色光暈、其餘降至 0.62；核心標註分組者加選取外框（四角手柄）
 * ========================================================================== */
.hss-ico {
  display: block;
  flex: 0 0 auto;
}
.hss-app .hss-toolbar .hss-btn.hss-ws-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 1023px) {
  .hss-ws-btn {
    display: none !important;
  }
}

/* 覆蓋層與背景頁鎖捲動 */
html.hy-ws-lock,
body.hy-ws-lock {
  overflow: hidden !important;
}
.hy-shared-studio.is-workspace {
  position: fixed !important;
  inset: 0 !important;
  z-index: 60 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  background: #ffffff !important;
  transform: none !important;
}
@supports (height: 100dvh) {
  .hy-shared-studio.is-workspace {
    height: 100dvh !important;
  }
}
.hy-shared-studio.is-workspace > .hss-wrap {
  max-width: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}
.hy-shared-studio.is-workspace > .hss-wrap > :not(.hss-app) {
  display: none !important;
}
.hy-shared-studio.is-workspace .hss-app {
  display: block;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
.hy-shared-studio.is-workspace .hss-app > :not(.hss-ws):not(.hss-sr) {
  display: none !important;
}
.hss-ws[hidden] {
  display: none !important;
}
.hss-ws {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr) auto;
  height: 100%;
  min-width: 0;
  background: #ffffff;
  color: var(--ink);
}

/* 頂部 48 px 標題列（按鈕沿用工具列樣式） */
.hss-app .hss-toolbar.hss-ws-bar {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 48px;
  min-height: 48px;
  min-width: 0;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: #ffffff;
}
.hss-ws-bl {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.hss-ws-br {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.hss-ws-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--hy-brand);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.hss-ws-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  color: var(--muted2);
  font-size: 13px;
  white-space: nowrap;
  outline: none;
}
.hss-ws-crumb:focus-visible {
  outline: 3px solid #0284c7;
  outline-offset: 2px;
  border-radius: 4px;
}
.hss-ws-crumb-home {
  flex: 0 0 auto;
}
.hss-ws-crumb-sep {
  flex: 0 0 auto;
  color: #cbd5e1;
}
.hss-ws-crumb-tool {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #111827;
  font-weight: 800;
}
.hss-ws-reg-host {
  display: inline-flex;
  flex: 0 1 auto;
  min-width: 0;
}
.hss-ws-reg-host:not(:empty) {
  min-width: 104px;
}
.hss-app .hss-ws-reg-host > .hss-ws-reg,
.hss-app .hss-ws-reg-host > .hss-ws-reg-text {
  width: 100%;
}
.hss-app .hss-ws-reg,
.hss-app .hss-ws-reg-text {
  display: block;
  max-width: 230px;
  min-width: 0;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background-color: #f9fafb;
  color: var(--ink2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 26px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hss-app .hss-ws-reg {
  padding-right: 22px;
  cursor: pointer;
}
.hss-app .hss-ws-reg:focus-visible {
  outline: 3px solid #0284c7;
  outline-offset: 2px;
}
.hss-ws-hist {
  display: inline-flex;
  gap: 2px;
  flex: 0 0 auto;
}
.hss-app .hss-toolbar.hss-ws-bar .hss-btn {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12.5px;
  white-space: nowrap;
}
.hss-app .hss-toolbar.hss-ws-bar .hss-btn.hss-ws-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 0 7px;
}
.hss-app .hss-toolbar.hss-ws-bar .hss-btn.hss-ws-exit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.hss-ws-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted2);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hss-ws-live.is-ok .hss-dot {
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16);
}
.hss-ws-live.is-err .hss-dot {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}
.hss-ws-live .hss-ws-live-s {
  display: none;
}
@media (max-width: 1365px) {
  .hss-ws-live.is-ok .hss-ws-live-t {
    display: none;
  }
  .hss-ws-live .hss-ws-live-s {
    display: inline;
  }
  .hss-app .hss-ws-reg,
  .hss-app .hss-ws-reg-text {
    max-width: 160px;
  }
}
@media (max-width: 1199px) {
  .hss-ws-live .hss-ws-live-t,
  .hss-ws-live .hss-ws-live-s {
    display: none;
  }
  .hss-ws-crumb-home,
  .hss-ws-crumb-sep {
    display: none;
  }
  .hss-app .hss-toolbar.hss-ws-bar .hss-btn.hss-ws-exit > span {
    display: none;
  }
  .hss-app .hss-ws-reg,
  .hss-app .hss-ws-reg-text {
    max-width: 120px;
  }
}

/* 中段三欄 */
.hss-ws-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 296px;
  min-width: 0;
  min-height: 0;
}
.is-workspace.ws-l-off .hss-ws-body {
  grid-template-columns: 0 minmax(0, 1fr) 296px;
}
.is-workspace.ws-r-off .hss-ws-body {
  grid-template-columns: 220px minmax(0, 1fr) 0;
}
.is-workspace.ws-l-off.ws-r-off .hss-ws-body {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}
.is-workspace.ws-l-off .hss-ws-left,
.is-workspace.ws-r-off .hss-ws-right {
  display: none;
}

/* 工作站開啟時：登出鈕與通知移到畫布右上角（不蓋住標題列之主鈕）、整案清單浮鈕移到狀態列之上 */
body.hy-ws-lock .hfx-logout-fixed,
body.hy-ws-lock .hfx-toast {
  top: 58px;
  right: 312px;
}
body.hy-ws-lock .hct-chip {
  bottom: 64px;
}
/* 三欄固定欄位（側欄收合為 display: none 時，中欄仍在第 2 欄） */
.hss-ws-left {
  grid-column: 1;
}
.hss-ws-center {
  grid-column: 2;
}
.hss-ws-right {
  grid-column: 3;
}
/* 左：元件樹 */
.hss-ws-left {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 8px 12px;
  border-right: 1px solid var(--hairline);
  background: #fafbfc;
}
.hss-ws-tree-hd {
  padding: 4px 8px 8px;
  color: var(--muted2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hss-ws-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hss-ws-li {
  margin: 0;
  padding: 0;
}
.hss-ws-node {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  grid-template-areas:
    "sw nm err"
    ". val val"
    ". mod mod";
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #1f2937;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.hss-ws-node:hover {
  background: #f1f5f9;
}
.hss-ws-node.on {
  background: #e8f4f8;
  border-color: #b9dbe5;
}
.hss-ws-node:focus-visible {
  outline: 3px solid #0284c7;
  outline-offset: 1px;
}
.hss-ws-sw {
  grid-area: sw;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #cbd5e1;
}
.hss-ws-sw.is-none {
  background: transparent;
  border: 1px dashed #cbd5e1;
}
.hss-ws-nm {
  grid-area: nm;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}
.hss-ws-node.on .hss-ws-nm {
  color: var(--hy-brand);
}
.hss-ws-val {
  grid-area: val;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted2);
  /* 字型沿用頁面（日文頁之日文字型優先序不被等寬字型之後援字型取代），數字等寬 */
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.hss-ws-err {
  grid-area: err;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #dc2626;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}
.hss-ws-mod {
  grid-area: mod;
  justify-self: start;
  padding: 0 6px;
  border: 1px solid #d5eaf0;
  border-radius: 999px;
  background: #f0f8fa;
  color: var(--hy-brand);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.hss-ws-mod.is-default {
  border-color: var(--hairline);
  background: transparent;
  color: #9ca3af;
  font-weight: 600;
}
.hss-ws-tree-ft {
  margin-top: auto;
  padding: 12px 8px 0;
  color: var(--muted2);
  font-size: 11.5px;
  line-height: 1.5;
}

/* 中：點陣畫布 */
.hss-ws-center {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.hss-ws-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.is-workspace.ws-nogrid .hss-ws-canvas {
  background-image: none;
}
.hss-app .hss-ws-canvas .hss-fig-box {
  position: absolute;
  inset: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.hss-app .hss-ws-canvas .hss-fig,
.hss-app .hss-ws-canvas .hss-fig.hg-dot-grid {
  position: absolute;
  inset: 52px 24px 66px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  background-image: none;
}
.hss-app .hss-ws-canvas .hss-fig svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
}
.hss-app .hss-ws-canvas .hss-fig-foot {
  display: none;
}
.is-workspace.ws-space .hss-ws-canvas .hss-fig {
  cursor: grab;
  touch-action: none;
}
.is-workspace.ws-space .hss-ws-canvas .hss-fig:active {
  cursor: grabbing;
}
.is-workspace.ws-nolabels .hss-ws-canvas svg g[data-hy-label]:not([data-hy-label="title"]):not([data-hy-label="0"]) {
  display: none;
}
.hss-ws-ovl {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  pointer-events: none;
}
.hss-ws-ovl > span {
  flex: 0 0 auto !important;
  max-width: min(78%, 680px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted2);
  font-size: 11.5px;
}
.hss-app .hss-ws-ovl > .hss-ws-sel {
  padding: 2px 10px;
  border: 1px solid #b9dbe5;
  border-radius: 999px;
  background: #ffffff;
  color: var(--hy-brand);
  font-size: 12px;
  font-weight: 700;
}
.hss-ws-sel[hidden] {
  display: none !important;
}
.hss-ws-cap {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: calc(100% - 24px);
  padding: 3px;
  transform: translateX(-50%);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}
.hss-ws-cap > *,
.hss-ws-cap .hss-zoom > * {
  flex: 0 0 auto;
}
.hss-ws-cap .hss-zoom-btn {
  white-space: nowrap;
}
.hss-ws-cap .hss-zoom {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.hss-ws-cap-zoom {
  display: inline-flex;
  padding: 0 4px;
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
}
.hss-ws-cap-zoom[hidden],
.hss-ws-layer[hidden],
.hss-ws-hint[hidden] {
  display: none !important;
}
.hss-zoom-btn.hss-ws-layer {
  font-size: 12px;
  color: var(--muted2);
}
.hss-zoom-btn.hss-ws-layer[aria-pressed="true"] {
  color: var(--hy-brand);
}
.hss-zoom-btn.hss-ws-col {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hss-zoom-btn.hss-ws-col[aria-pressed="true"] {
  background: #f0f8fa;
  color: var(--hy-brand);
}
.hss-ws-hint {
  position: absolute;
  right: 14px;
  bottom: 22px;
  z-index: 1;
  color: #9ca3af;
  font-size: 11px;
}
@media (max-width: 1279px) {
  .hss-ws-hint {
    display: none;
  }
}
.hss-app .hss-ws-center > .hss-msg {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 4;
  max-width: min(560px, 90%);
  margin: 0;
  padding: 6px 12px;
  transform: translateX(-50%);
  border: 1px solid #d5eaf0;
  border-radius: 8px;
  background: #f0f8fa;
  color: var(--hy-brand-hover);
  font-size: 12.5px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.hss-app .hss-ws-center > .hss-msg:empty {
  display: none;
}
.hss-ws-results {
  display: none;
}
.is-workspace.ws-nosketch .hss-ws-canvas {
  display: none;
}
.is-workspace.ws-nosketch .hss-ws-results {
  position: absolute;
  inset: 0;
  display: block;
  overflow: auto;
  padding: 16px 24px 28px;
}

/* 右：判定摘要、分頁、屬性設定／檢核與計算式 */
.hss-ws-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--hairline);
  background: #ffffff;
}
.hss-ws-sum {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 0;
}
.hss-app .hss-ws-sum .hss-verdict.hss-summary,
.hss-app .hss-ws-sum .hss-verdict.hss-summary.ok,
.hss-app .hss-ws-sum .hss-verdict.hss-summary.ng,
.hss-app .hss-ws-sum .hss-verdict.hss-summary.und,
.hss-app .hss-ws-sum .hss-verdict.hss-summary.cond,
.hss-app .hss-ws-sum .hss-verdict.hss-summary.ok-note {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: #ffffff;
}
.hss-app .hss-ws-sum .hss-pill {
  white-space: normal;
}
.hss-app .hss-ws-sum .hss-summary .hss-kpis {
  flex: none;
  width: 100%;
  text-align: left;
  font-size: 12px;
}
.hss-ws-chklink {
  align-self: flex-end;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--hy-brand);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.hss-ws-chklink:focus-visible {
  outline: 3px solid #0284c7;
  outline-offset: 2px;
}
.hss-ws-chklink[hidden],
.hss-ws-tabs[hidden] {
  display: none !important;
}
.hss-app .hss-tabs.hss-ws-tabs {
  display: flex;
  margin: 6px 12px 0;
  border-bottom: 1px solid var(--hairline);
}
.hss-app .hss-ws-tabs .hss-tab {
  /* 依標題長度分配寬度（英文「Checks & calculations」在 296 px 右欄等分時會換成兩行），放不下時才換行 */
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 6px;
  padding-right: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
  text-align: center;
}
.hss-ws-right > :not(.hss-ws-panel) {
  flex: 0 0 auto;
}
.hss-ws-panel {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 12px 72px;
}
.hss-ws-panel[hidden] {
  display: none !important;
}
.hss-ws-mode {
  display: flex;
  margin: 0 0 6px;
  padding: 2px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: #f9fafb;
}
.hss-ws-seg {
  flex: 1 1 0;
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted2);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.hss-ws-seg[aria-pressed="true"] {
  background: #ffffff;
  color: var(--hy-brand);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.hss-ws-seg:focus-visible {
  outline: 3px solid #0284c7;
  outline-offset: 1px;
}
.hss-app .hss-ws-panel .hss-form-card {
  position: static;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.hss-app .hss-ws-panel .hss-res-card,
.hss-app .hss-ws-panel .hss-out {
  position: static;
  max-height: none;
  overflow: visible;
}
.is-workspace .hss-form-body .hss-fsum {
  display: none;
}
/* 工作站右欄之參數：分組內兩欄（上標欄名） */
.is-workspace .hss-app .hss-form-card .hss-group,
.is-workspace .hss-app .hss-form-card .hss-adv-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
/* 有速查鈕（📖）之欄位佔滿整列（兩欄時輸入框過窄、數值被截） */
.is-workspace .hss-app .hss-form-card .hss-field.has-q {
  grid-column: 1 / -1;
}
.hss-ws-single fieldset.hss-group:not(.is-ws-active),
.hss-ws-single .hss-code-box:not(.is-ws-active) {
  display: none !important;
}
.hss-app .hss-btn.hss-ws-next {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 6px;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12.5px;
}
.hss-app .hss-ws > .hss-statusbar {
  margin: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  /* 右側三句（本機試算、AI 訓練、預覽非供簽證）拆為狀態列之直接項目依序換行，文字不截斷；
     英日文在 1024～1440 px 由三行降為兩行（原本右側整塊換到第二列後再自行換行） */
  justify-content: flex-start;
  gap: 2px 16px;
}
.hss-app .hss-ws > .hss-statusbar .hss-sb-right {
  display: contents;
}
.hss-app .hss-ws > .hss-statusbar .hss-sb-note {
  margin-left: auto;
}

/* 右欄之檢核表：欄寬只有 296 px，改為逐項卡片（同手機版面） */
.hss-ws-right .hss-table.hss-checks thead {
  display: none;
}
.hss-ws-right .hss-table.hss-checks,
.hss-ws-right .hss-table.hss-checks tbody {
  display: block;
  width: 100%;
}
.hss-ws-right .hss-table.hss-checks tr.hss-crow {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  grid-template-areas:
    "st item"
    "basis basis"
    "val val"
    "crit crit"
    "reason reason";
  column-gap: 8px;
  row-gap: 3px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--row-line);
}
.hss-ws-right .hss-table.hss-checks td.hss-c-item,
.hss-ws-right .hss-table.hss-checks td.hss-c-st {
  display: contents;
}
.hss-ws-right .hss-table.hss-checks .hss-citem-t {
  grid-area: item;
  align-self: center;
  overflow-wrap: anywhere;
}
.hss-ws-right .hss-table.hss-checks .hss-cbasis {
  grid-area: basis;
  overflow-wrap: anywhere;
}
.hss-ws-right .hss-table.hss-checks .hss-st-badge {
  grid-area: st;
  align-self: start;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12.5px;
}
.hss-ws-right .hss-table.hss-checks td.hss-ok .hss-st-badge {
  color: var(--ok);
  background: var(--ok-bg);
}
.hss-ws-right .hss-table.hss-checks td.hss-ng .hss-st-badge {
  color: var(--ng);
  background: var(--ng-bg);
}
.hss-ws-right .hss-table.hss-checks td.hss-und .hss-st-badge {
  color: #8a5a10;
  background: rgba(223, 160, 62, 0.2);
}
.hss-ws-right .hss-table.hss-checks .hss-reason {
  grid-area: reason;
  overflow-wrap: anywhere;
}
.hss-ws-right .hss-table.hss-checks td.hss-c-val,
.hss-ws-right .hss-table.hss-checks td.hss-c-crit {
  display: block;
  border: 0;
  padding: 0;
  text-align: left;
  white-space: normal;
  overflow-wrap: normal;
  word-break: keep-all;
  font-weight: 400;
  min-width: 0;
}
.hss-ws-right .hss-table.hss-checks td.hss-c-val {
  grid-area: val;
  font-weight: 700;
}
.hss-ws-right .hss-table.hss-checks td.hss-c-crit {
  grid-area: crit;
}
.hss-ws-right .hss-table.hss-checks td.hss-c-val::before,
.hss-ws-right .hss-table.hss-checks td.hss-c-crit::before {
  content: attr(data-label);
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}

/* B2：欄位聚焦連動高亮（浮水印不屬圖元，不受影響） */
.hss-fig svg [data-hy-tone] {
  transition: opacity 0.18s ease;
}
.hss-fig svg .hy-halo,
.hss-fig svg [data-hy-sel] {
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .hss-fig svg [data-hy-tone] {
    transition: none;
  }
}

/* 列印：一律為一般版面（工作站於列印前即退回；以下為樣式之保險） */
@media print {
  .hss-ws-btn {
    display: none !important;
  }
  html.hy-ws-lock,
  body.hy-ws-lock {
    overflow: visible !important;
  }
  .hy-shared-studio.is-workspace {
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
  }
  .hss-ws-bar,
  .hss-ws-left,
  .hss-ws-cap,
  .hss-ws-tabs,
  .hss-ws-mode,
  .hss-ws-hint,
  .hss-ws-next {
    display: none !important;
  }
  .hss-ws-body {
    display: block !important;
  }
  .hss-ws-canvas {
    position: relative !important;
    height: 380px !important;
  }
  .hss-ws-panel[hidden] {
    display: block !important;
  }
}
