/* 禾慕中控台 — 設計系統（Home Decoration 暖色系 + Noto Sans TC / Playfair Display）
   來源：ui-ux-pro-max 設計智庫，配色 = Interior warm grey + gold accent */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Noto+Sans+TC:wght@400;500;700&family=Playfair+Display:wght@500;600;700&display=swap');

/* Token 定義已搬到 static/tokens.css（由 _shell.html 先於本檔載入）。
   要改顏色、間距、圓角、字體 → 改 tokens.css，不要在這裡另開 :root。 */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-zh); font-size: 16px; line-height: 1.6;
}
a { color: inherit; text-decoration: none; }

.brand { display: flex; align-items: baseline; gap: 10px; }
.brand .mark { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--accent-ink); letter-spacing: -.01em; }
.brand .sub { font-size: 13px; color: var(--muted); }
.logout { font-size: 14px; color: var(--muted); padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; min-height: 44px; display: inline-flex; align-items: center; transition: background .2s ease; cursor: pointer; }
.skip-link { position:absolute; left:var(--space-3); top:-64px; z-index:9999; min-height:44px; padding:var(--space-3); background:var(--card); color:var(--ink); border:2px solid var(--focus-ring); border-radius:var(--radius-sm); }
.skip-link:focus { top:var(--space-3); }
.logout:hover { background: var(--bg); }
.logout:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 32px 24px 56px; }
.hero { margin-bottom: 28px; }
.hero-with-help { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 4vw, 38px); margin: 0 0 6px; letter-spacing: -.01em; }
.hero p { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 520px) { .hero-with-help { align-items: flex-start; } }

/* ---- 部門分區 ---- */

/* Tool grid */
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 600px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .grid { grid-template-columns: 1fr 1fr 1fr; } }


.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
  min-height: 168px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; position: relative; overflow: visible;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: #ddd3c6; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.disabled { opacity: .6; cursor: default; }
.card.disabled:hover { transform: none; box-shadow: var(--shadow); }

.card .top { display: flex; align-items: center; justify-content: space-between; }
.card-tools { display: inline-flex; align-items: center; gap: 7px; position: relative; }
.icon-badge { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: #f6efe8; color: var(--accent-ink); }
.icon-badge svg { width: 22px; height: 22px; }
.status { font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; }
.status.上線 { color: var(--ok); background: #eaf5ec; }
.status.建置中 { color: var(--muted); background: #f1ede7; }
.help-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; z-index: 12; }
.help-tip > summary {
  min-width: 44px; min-height: 44px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; color: var(--accent-ink); font-size: 13px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  list-style: none;
}
.help-tip > summary::-webkit-details-marker { display: none; }
.help-popover {
  position: absolute; right: 0; top: calc(100% + 9px); width: min(260px, calc(100vw - 48px));
  background: var(--ink); color: #fff; border-radius: 10px; padding: 12px 13px;
  box-shadow: var(--shadow-lift); opacity: 0; visibility: hidden; transform: translateY(-3px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease; pointer-events: auto;
  font-size: 12px; line-height: 1.55; text-align: left;
}
.help-popover::before {
  content: ""; position: absolute; right: 8px; top: -6px; width: 12px; height: 12px;
  background: var(--ink); transform: rotate(45deg);
}
.help-popover b, .help-popover span { display: block; }
.help-popover b { font-size: 13px; margin-bottom: 5px; }
.help-popover strong { color: #f6d7ba; }
.help-tip[open] .help-popover {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.help-tip > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 375px) {
  .help-tip[open] .help-popover { position: fixed; inset: auto 16px 16px 16px; width: auto; }
  .help-tip[open] .help-popover::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .help-popover { transition: none; }
}
.warning-inline { border-left: 4px solid var(--accent); padding: 8px 12px; background: var(--mod-tint, #f6f1ea); }

.card h3 { margin: 4px 0 0; font-size: 18px; font-weight: 700; }
.card p { margin: 0; font-size: 14px; color: var(--warm-grey); line-height: 1.55; }
.card .go { margin-top: auto; font-size: 14px; font-weight: 500; color: var(--accent-ink); display: inline-flex; align-items: center; gap: 4px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.card-actions .action-link { min-height: 36px; padding: 8px 12px; font-size: 12px; }
.card-todo-form {
  display: grid; grid-template-columns: minmax(0, 1fr) 72px 58px; gap: 8px; margin-top: 4px;
}
.card-todo-form input, .card-todo-form select {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #fff;
  color: var(--ink); font-family: inherit; font-size: 13px; min-height: 38px; padding: 8px 10px;
}
.card-todo-form button {
  border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-family: inherit;
  font-size: 13px; font-weight: 700; min-height: 38px; cursor: pointer;
}
.card-todo-form button:hover { background: var(--accent-ink); }
@media (max-width: 520px) { .card-todo-form { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Login */
.login-wrap { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lift); padding: 36px 32px; width: 100%; max-width: 380px; }
.login-card .mark { font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--accent-ink); text-align: center; }
.login-card .tag { text-align: center; color: var(--muted); font-size: 14px; margin: 4px 0 24px; }
.login-card label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; font-size: 16px; font-family: inherit; min-height: 48px; }
.login-card input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.login-card button { width: 100%; margin-top: 16px; background: var(--accent); color: #fff; border: 0; padding: 13px; border-radius: 12px; font-size: 16px; font-weight: 500; min-height: 48px; cursor: pointer; transition: background .2s ease; }
.login-card button:hover { background: var(--accent-ink); }
.login-card button:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.err { color: var(--danger); font-size: 14px; margin-top: 12px; text-align: center; }

/* ---- LINE 登入（員工走這條，不必記密碼）----
   走 LINE 官方按鈕規範的「白底版」而不是綠底版：綠底配白字對比只有 2.6:1，
   連大字的 3:1 都不到；白底深字是 12:1，品牌識別留在 logo 上就夠。 */
.login-alt { width: 100%; max-width: 340px; margin: 18px auto 0; text-align: center; }
.login-or { display: block; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.login-line {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 12px 16px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--ink); font-size: 16px; font-weight: 500; text-decoration: none;
  transition: border-color .2s ease, background .2s ease;
}
.login-line svg { color: #06c755; flex: none; }   /* LINE 品牌綠只用在圖示 */
.login-line:hover { border-color: #06c755; background: var(--bg); }
.login-line:focus-visible { outline: 2px solid #06c755; outline-offset: 2px; }
.login-note { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 10px 0 0; }
@media (prefers-reduced-motion: reduce) { .login-line { transition: none; } }

/* ---- Hoom OS 工作頁 ---- */
.work-surface {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.surface-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.surface-head h2 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.surface-head p { margin: 0; color: var(--muted); font-size: 14px; }
.surface-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.surface-actions form { margin: 0; }
.action-link {
  flex-shrink: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600;
  font-size: 13px; padding: 8px 16px; text-decoration: none;
}
button.action-link { border: 0; cursor: pointer; font-family: inherit; line-height: 1.2; }
.action-link:hover { background: var(--accent-ink); }
.step-row { display: flex; gap: 8px; flex-wrap: wrap; }
.step-row span { background: #f6efe8; color: var(--accent-ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.surface-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .surface-grid { grid-template-columns: 1fr 1fr; } }
.surface-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: #fff; }
.surface-card h3 { margin: 0 0 8px; font-size: 16px; }
.surface-card p { margin: 0 0 6px; font-size: 13px; color: var(--warm-grey); line-height: 1.55; }
.text-link { color: var(--accent-ink); font-size: 13px; font-weight: 600; text-decoration: underline; }
.muted-line { color: var(--muted); font-size: 13px; }
.surface-list { display: grid; gap: 9px; }
.surface-list div { border-left: 3px solid var(--accent); background: #faf7f3; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--ink); }
.task-card-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 880px) { .task-card-grid { grid-template-columns: 1fr 1fr; } }
.task-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: #fff; box-shadow: var(--shadow); }
.task-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
.task-priority, .task-coin { border-radius: 999px; font-size: 12px; font-weight: 700; padding: 3px 10px; }
.task-priority { background: #f1ede7; color: var(--muted); }
.task-coin { background: #eaf5ec; color: var(--ok); }
.task-card h3 { margin: 0 0 4px; font-size: 16px; }
.task-meta { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.task-dl { display: grid; gap: 8px; margin: 0; }
.task-dl div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; border-top: 1px dashed var(--border); padding-top: 8px; }
.task-dl dt { color: var(--accent-ink); font-weight: 700; font-size: 12px; }
.task-dl dd { margin: 0; color: var(--warm-grey); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.task-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.task-actions form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.task-actions button {
  border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-family: inherit;
  font-size: 13px; font-weight: 700; min-height: 38px; padding: 8px 14px; cursor: pointer;
}
.task-actions button:hover { background: var(--accent-ink); }
.contract-pack-nav { position: sticky; top: 78px; z-index: 8; }
.contract-pack-nav .surface-actions { justify-content: flex-start; }
.contract-document { scroll-margin-top: 120px; }
.contract-document h2 { font-family: var(--font-display); font-size: 22px; margin: 0 0 4px; }
.terms-grid, .checklist-grid, .signature-grid {
  display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 14px;
}
@media (min-width: 760px) {
  .terms-grid { grid-template-columns: 1fr 1fr; }
  .checklist-grid { grid-template-columns: repeat(3, 1fr); }
  .signature-grid { grid-template-columns: repeat(3, 1fr); }
}
.term-card, .note-box, .quote-box {
  border: 1px solid var(--border); border-radius: 12px; background: #fffcf8; padding: 16px;
}
.term-card h3 { margin: 0 0 10px; font-size: 17px; }
.term-card p, .note-box, .quote-box { color: var(--warm-grey); font-size: 14px; line-height: 1.7; }
.term-card p { margin: 0 0 8px; }
.term-card p:last-child { margin-bottom: 0; }
.note-box strong, .quote-box strong { color: var(--ink); }
.simple-table {
  width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; overflow-wrap: anywhere;
}
.simple-table th, .simple-table td {
  border-bottom: 1px solid var(--border); padding: 10px 11px; text-align: left; vertical-align: top;
}
.simple-table th { background: #f6efe8; color: var(--accent-ink); font-size: 13px; }
.contract-lines {
  display: grid; gap: 8px; border: 1px solid var(--border); border-radius: 12px;
  background: #fffcf8; padding: 16px; margin-bottom: 16px;
}
.contract-lines p { margin: 0; }
.contract-clauses { margin: 0; padding-left: 22px; display: grid; gap: 11px; }
.contract-clauses li { color: var(--warm-grey); line-height: 1.75; }
.contract-clauses strong { color: var(--ink); }
.signature-grid {
  border-top: 1px dashed var(--border); padding-top: 16px; color: var(--ink); font-weight: 600;
}
.quote-box { margin-bottom: 12px; color: var(--ink); background: #fff; border-left: 4px solid var(--accent); }
@media print {
  .hub-header, .crumb, .contract-pack-nav, .hero .action-link { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .hero { margin-bottom: 12px; }
  .work-surface { box-shadow: none; break-inside: avoid; }
  .contract-document { border: 0; padding: 0; margin-bottom: 22px; }
}
.inline-select-label {
  display: grid; gap: 5px; color: var(--warm-grey); font-size: 12px; font-weight: 700;
}
.inline-select-label select {
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink);
  font-family: inherit; font-size: 13px; min-height: 38px; min-width: min(240px, 100%);
  padding: 8px 10px;
}
/* 快速表單：一列多欄的輸入區。
   align-items:start＝所有標籤齊頭，欄位各自往下長（textarea 比 select 高也不會歪）。
   input / select / textarea 必須共用同一組外觀 —— 少寫任何一個，那種控制項就會
   掉回瀏覽器預設（select 只有 19px 高、沒圓角），整排欄位就錯位。 */
.quick-form, .reward-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px; align-items: start; width: 100%;
}
.surface-actions .quick-form { width: auto; min-width: min(340px, 100%); }
.quick-form label, .reward-form label { display: grid; gap: 6px; color: var(--warm-grey); font-size: 12px; font-weight: 700; }
.quick-form input, .reward-form input,
.quick-form select, .reward-form select,
.quick-form textarea, .reward-form textarea {
  width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--ink); font-family: inherit; font-size: 13px; min-height: 38px; padding: 8px 10px;
}
.quick-form select, .reward-form select {
  /* 拿掉原生外觀後要自己畫箭頭，不然使用者看不出這是下拉 */
  appearance: none; -webkit-appearance: none;
  padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238a8178' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 11px;
}
.quick-form textarea, .reward-form textarea { resize: vertical; line-height: 1.6; }
.quick-form input:focus-visible, .reward-form input:focus-visible,
.quick-form select:focus-visible, .reward-form select:focus-visible,
.quick-form textarea:focus-visible, .reward-form textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
/* 勾選框是橫排的一行，不是上下兩段 —— 不加這條會被上面的 label{display:grid}
   拆成兩列，而且方框本身會吃到 width:100% 撐成整行寬。 */
.quick-form label.check-inline, .quick-form label.kb-check {
  display: flex; align-items: center; gap: 8px;
  min-height: 38px; align-self: end; color: var(--ink); font-weight: 500;
}
.quick-form label.check-inline input[type=checkbox], .quick-form label.kb-check input[type=checkbox] {
  width: 17px; height: 17px; min-height: 0; min-width: 0; flex: none;
  padding: 0; border-radius: 4px; accent-color: var(--accent); cursor: pointer;
}
.quick-form button, .reward-form button {
  align-self: end;   /* 按鈕沉到底，跟同列欄位的底線齊 */
  border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-family: inherit;
  font-size: 13px; font-weight: 800; min-height: 38px; padding: 8px 14px; cursor: pointer;
  transition: background .2s ease;
}
.quick-form button:hover, .reward-form button:hover { background: var(--accent-ink); }
.quick-form button:focus-visible, .reward-form button:focus-visible {
  outline: 2px solid var(--accent-ink); outline-offset: 2px;
}
/* 篩選列：吃 .quick-form 的整套外觀，只把欄位改窄 —— 篩選不需要跟輸入表單一樣寬。 */
.kb-filter {
  grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
  margin: 14px 0 4px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.reward-summary-grid { margin-top: 16px; }
.inline-payable-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-payable-form input {
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink);
  font-family: inherit; font-size: 13px; min-height: 38px; padding: 8px 10px; width: 136px;
}
.finance-upload-form {
  display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border);
}
.finance-upload-form input[type=file] {
  width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--ink); font-family: inherit; font-size: 13px; min-height: 42px; padding: 8px 10px;
}
.receiving-form {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%;
  border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 2px;
}
.receiving-form input {
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink);
  font-family: inherit; font-size: 13px; min-height: 38px; padding: 8px 10px; min-width: 0;
}
.receiving-form button { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .surface-actions, .surface-actions form, .surface-actions .action-link,
  .inline-payable-form, .inline-payable-form input, .task-actions form, .task-actions button,
  .surface-actions .quick-form, .quick-form button, .reward-form button { width: 100%; }
  .receiving-form { grid-template-columns: 1fr; }
}

.employee-form { display: grid; gap: 16px; }
.employee-form-shell {
  display: grid; gap: 0; background: #fffcf8; border: 1px solid var(--border);
  border-radius: 14px; padding: 16px;
}
.employee-form-section {
  display: grid; grid-template-columns: minmax(118px, 152px) minmax(0, 1fr);
  gap: 16px; border-top: 1px solid #efe6db; padding: 16px 0;
}
.employee-form-section:first-child { border-top: 0; padding-top: 0; }
.employee-form-section:last-child { padding-bottom: 0; }
.employee-section-head { min-width: 0; padding-top: 8px; }
.employee-section-head h3 {
  display: flex; align-items: center; gap: 8px; margin: 0 0 5px;
  font-size: 15px; font-weight: 800; color: var(--ink);
}
.employee-section-head h3::before {
  content: ""; width: 4px; height: 16px; border-radius: 999px; background: var(--accent);
  flex: 0 0 auto;
}
.employee-section-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; max-width: 150px; }
.employee-form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 10px; align-items: start;
}
.employee-form label { display: grid; gap: 6px; min-width: 0; color: var(--warm-grey); font-size: 13px; font-weight: 700; }
.employee-field {
  background: #fff; border: 1px solid #eadfd3; border-radius: 12px;
  padding: 9px 10px; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.employee-field:focus-within { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(192, 138, 94, .12); }
.employee-form label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.employee-field span { color: var(--accent-ink); font-size: 12px; letter-spacing: 0; }
.employee-form input, .employee-form select, .employee-form textarea {
  width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--ink); font-family: inherit; font-size: 14px;
  min-height: 40px; padding: 8px 10px;
}
.employee-form textarea { min-height: 78px; resize: vertical; line-height: 1.6; }
.employee-form input:focus-visible, .employee-form select:focus-visible, .employee-form textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.employee-field--wide, .employee-form .span-2 { grid-column: span 2; }
.employee-field--full, .employee-form .span-full { grid-column: 1 / -1; }
.employee-form-actions { position: relative; z-index: 1; display: flex; justify-content: flex-end; border-top: 1px solid var(--border); padding: 12px 0 0; background: var(--card); }
.employee-form-actions button {
  border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-family: inherit;
  font-size: 15px; font-weight: 800; min-height: 44px; min-width: 144px; padding: 10px 18px; cursor: pointer;
}
.employee-form-actions button:hover { background: var(--accent-ink); }
.employee-fix-form {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  border-top: 1px dashed var(--border); margin-top: 12px; padding-top: 12px;
}
.employee-fix-form label { display: grid; gap: 5px; min-width: 0; color: var(--warm-grey); font-size: 12px; font-weight: 700; }
.employee-fix-form label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.employee-fix-form input {
  width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; color: var(--ink); font-family: inherit; font-size: 13px; min-height: 38px; padding: 8px 10px;
}
.employee-fix-form button {
  grid-column: 1 / -1; border: 0; border-radius: 10px; background: var(--accent); color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 800; min-height: 40px; padding: 8px 14px; cursor: pointer;
}
.employee-fix-form button:hover { background: var(--accent-ink); }
@media (max-width: 720px) {
  .employee-form-section { grid-template-columns: 1fr; gap: 10px; }
  .employee-section-head { padding-top: 0; }
  .employee-section-head p { max-width: none; }
}
@media (max-width: 560px) {
  .employee-section-head { display: block; }
  .employee-section-head p { margin-top: 4px; text-align: left; max-width: none; }
  .employee-form-grid { grid-template-columns: 1fr; }
  .employee-field--wide, .employee-field--full, .employee-form .span-2, .employee-form .span-full { grid-column: 1; }
  .employee-form-actions, .employee-form-actions button { width: 100%; }
  .employee-fix-form { grid-template-columns: 1fr; }
}

.contract-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.contract-document {
  color: var(--ink); font-size: 14px; line-height: 1.85; background: #fffcf8;
  border: 1px solid var(--border); border-radius: 12px; padding: 18px;
}
.contract-document p { margin: 0 0 8px; }
.contract-clauses { margin: 0; padding-left: 22px; color: var(--warm-grey); font-size: 14px; line-height: 1.8; }
.contract-signature-line {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; padding-top: 16px;
  border-top: 1px dashed var(--border); color: var(--ink); font-weight: 700;
}
.contract-snapshot-meta { margin-bottom: 12px; }
.contract-snapshot-text {
  margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--border);
  border-radius: 12px; background: #fffcf8; color: var(--warm-grey);
  font-family: var(--font-zh); font-size: 13px; line-height: 1.75; padding: 14px;
}
.signature-form { display: grid; gap: 12px; }
.signature-pad {
  border: 1px solid var(--border); border-radius: 14px; background: #fffcf8;
  padding: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
}
.signature-pad canvas {
  display: block; width: 100%; max-width: 100%; height: 220px; background: #fff;
  border: 1px dashed #d9cec2; border-radius: 10px; touch-action: none;
}
.contract-consent {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: #fffcf8;
  color: var(--ink); line-height: 1.5;
}
.contract-consent input {
  width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto;
}
.signature-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.signature-actions button, .secondary-button {
  border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-family: inherit;
  font-size: 14px; font-weight: 800; min-height: 42px; min-width: 120px; padding: 9px 16px; cursor: pointer;
}
.signature-actions button:hover { background: var(--accent-ink); }
.secondary-button { background: #f1ede7; color: var(--ink); }
.secondary-button:hover { background: #e7ddd1; }
.signature-preview {
  display: grid; gap: 8px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--border);
  border-radius: 12px; background: #fffcf8;
}
.signature-preview img {
  max-width: 360px; width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
.public-contract-page { background: #f4efe8; }
.public-contract-shell {
  width: min(940px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}
.public-contract-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.public-contract-head h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  color: var(--ink);
}
.public-contract-head p { margin: 0; color: var(--warm-grey); line-height: 1.7; max-width: 680px; }
.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}
.public-contract-form { margin-top: 16px; }
.public-contract-form .employee-form-grid { margin-top: 0; }
.public-contract-form select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  min-height: 38px;
  padding: 8px 10px;
}
.public-signature-head { margin-top: 8px; }
.public-contract-success h2 { margin: 0 0 8px; font-size: 22px; }
.public-contract-success p { margin: 0 0 14px; color: var(--warm-grey); line-height: 1.7; }
@media (max-width: 640px) {
  .contract-grid { grid-template-columns: 1fr; }
  .contract-signature-line { grid-template-columns: 1fr; }
  .signature-actions, .signature-actions button, .secondary-button { width: 100%; }
}
@media (max-width: 720px) {
  .public-contract-shell { width: min(100% - 24px, 940px); padding-top: 18px; }
  .public-contract-head { display: grid; }
  .public-contract-head .action-link { width: 100%; justify-content: center; text-align: center; }
  .public-contract-page .surface-head { display: grid; }
  .public-contract-page .task-priority { justify-self: start; }
}
@media print {
  .hub-header, .crumb, .hero, .no-print, .signature-form { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .work-surface { box-shadow: none; border: 0; padding: 0; margin: 0; }
  .contract-print-area { display: block; }
  .contract-document { border: 0; background: #fff; padding: 0; color: #000; }
  .public-contract-head .action-link, .public-contract-form, .public-contract-success { display: none !important; }
  .public-contract-page { background: #fff; }
  .public-contract-shell { width: 100%; padding: 0; }
}

/* ---- 麵包屑 / 返回 ---- */
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 18px; padding: 6px 0; }
.crumb a { color: var(--accent-ink); }
.crumb a:hover { text-decoration: underline; }

/* ---- flash 訊息 ---- */
.flash { border-radius: 12px; padding: 13px 16px; font-size: 14px; margin-bottom: 20px; border: 1px solid; display: flex; align-items: center; gap: 10px; }
.flash.ok { background: #eaf5ec; border-color: #bfe0c6; color: var(--ok); }
.flash.err { background: #fcebea; border-color: #f3c9c6; color: var(--danger); }
.flash a { color: inherit; text-decoration: underline; font-weight: 600; }

/* ---- 表單 ---- */
.form-wrap { max-width: 760px; }
.form-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 26px 30px; box-shadow: var(--shadow); margin-bottom: 18px; }
.form-card h2 { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin: 0 0 4px; }
.form-card .sec-hint { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.fld { margin-bottom: 16px; }
.fld:last-child { margin-bottom: 0; }
.fld label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 7px; }
.fld label .req { color: var(--danger); }
.fld input[type=text], .fld input[type=date], .fld select, .fld textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px;
  font-size: 16px; font-family: inherit; min-height: 46px; background: #fff; color: var(--ink);
}
.fld textarea { min-height: 80px; resize: vertical; line-height: 1.6; }
.fld input:focus-visible, .fld select:focus-visible, .fld textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.fld-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .fld-2 { grid-template-columns: 1fr; } }

/* 評分列 */
.score-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.score-row:last-child { border-bottom: 0; }
.score-row .d-name { font-weight: 600; font-size: 15px; }
.score-row .d-name .gate { font-size: 11px; color: var(--accent-ink); margin-left: 6px; }
.score-row .d-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pills { display: inline-flex; gap: 6px; flex-shrink: 0; }
.pills input { position: absolute; opacity: 0; width: 0; height: 0; }
.pills label { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--border); background: #fff; color: var(--warm-grey); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin: 0; transition: all .12s ease; }
.pills label:hover { border-color: var(--accent); }
.pills input:checked + label { background: var(--accent); border-color: var(--accent); color: #fff; }
.pills input:focus-visible + label { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* 即時總分 */
.live-total { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding: 14px 18px; background: #f6efe8; border-radius: 12px; }
.live-total .lab { font-size: 13px; color: var(--warm-grey); }
.live-total .v { font-family: var(--font-num); font-weight: 700; font-size: 24px; color: var(--ink); }
.live-total .v small { font-size: 14px; color: var(--muted); }
.live-total .verdict { font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; }
.verdict.pass { background: #eaf5ec; color: var(--ok); }
.verdict.warn { background: #fbf2e4; color: var(--accent-ink); }
.verdict.fail { background: #fcebea; color: var(--danger); }

/* 紅旗 / checkbox 群 */
.flag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .flag-grid { grid-template-columns: 1fr; } }
.flag { display: flex; align-items: center; gap: 9px; font-size: 14px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; }
.flag input { width: 18px; height: 18px; accent-color: var(--danger); flex-shrink: 0; }
.flag:has(input:checked) { border-color: #f3c9c6; background: #fdf2f1; color: var(--danger); }

/* 演練觀察（綠色 = 正面觀察） */
.obs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
@media (max-width: 560px) { .obs-grid { grid-template-columns: 1fr; } }
.obs { display: flex; align-items: center; gap: 9px; font-size: 14px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; }
.obs input { width: 18px; height: 18px; accent-color: var(--ok); flex-shrink: 0; }
.obs:has(input:checked) { border-color: #bfe0c6; background: #eef7f0; color: var(--ok); }

/* 送出鈕 */
.btn-primary { background: var(--accent); color: #fff; border: 0; padding: 14px 24px; border-radius: 12px; font-size: 16px; font-weight: 600; min-height: 50px; cursor: pointer; font-family: inherit; transition: background .2s ease; width: 100%; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-primary:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.form-foot { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; }

/* ---- Hoom OS IA v2: cockpit / centers ---- */
.section-title { display: grid; gap: 3px; margin-bottom: 14px; }
.section-title h2 {
  margin: 0; font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: 0;
}
.section-title p { margin: 0; color: var(--muted); font-size: 13px; }

.cockpit-band {
  border: 1px solid #d9e5f5; border-radius: 14px; padding: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%); margin-bottom: 18px;
}
.metric-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px;
}
.metric-card {
  display: grid; gap: 5px; border: 1px solid #d9e5f5; border-radius: 12px;
  background: #fff; padding: 14px; min-height: 118px;
}
.metric-card span { color: #1d4f91; font-size: 12px; font-weight: 800; }
.metric-card strong {
  color: var(--ink); font-family: var(--font-num); font-size: 24px; line-height: 1.1;
  overflow-wrap: anywhere;
}
.metric-card small { color: var(--muted); font-size: 12px; line-height: 1.45; }

.cockpit-grid {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr);
  gap: 16px; margin-bottom: 20px;
}
.cockpit-main, .cockpit-side {
  border: 1px solid var(--border); border-radius: 14px; background: #fff; padding: 18px;
  box-shadow: var(--shadow);
}
.entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.entry-card {
  display: grid; gap: 9px; border: 1px solid #dbe7dd; border-radius: 12px;
  background: #fbfefb; padding: 15px; min-height: 184px;
}
.entry-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.entry-card h3, .dashboard-card h3 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: 0; }
.entry-card p, .dashboard-card p { margin: 0; color: var(--warm-grey); font-size: 13px; line-height: 1.55; }
.entry-card .action-link { justify-self: start; margin-top: auto; }

.alert-list { display: grid; gap: 9px; margin-bottom: 12px; }
.alert-list a {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px;
  border-left: 4px solid #0f766e; background: #f3fbf9; border-radius: 10px;
  padding: 10px 12px; color: var(--ink);
}
.alert-list b { font-size: 14px; }
.alert-list span { color: #0f766e; font-family: var(--font-num); font-weight: 800; }
.alert-list small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.45; }
.cockpit-todo { grid-template-columns: minmax(0, 1fr) 70px 56px; }

.dashboard-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px;
}
.dashboard-card {
  display: grid; gap: 10px; border: 1px solid #d9e5f5; border-radius: 12px;
  padding: 16px; background: #fff; box-shadow: var(--shadow);
}
.visual-list { display: grid; gap: 10px; }
.visual-row {
  display: grid; grid-template-columns: minmax(112px, 170px) minmax(0, 1fr) minmax(112px, 170px);
  align-items: center; gap: 12px; border: 1px solid #d9e5f5; border-radius: 12px;
  padding: 10px 12px; background: #fff;
}
.visual-row span { font-weight: 800; font-size: 14px; }
.visual-row small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.bar {
  height: 10px; border-radius: 999px; background: #e9eef5; overflow: hidden; min-width: 80px;
}
.bar i {
  display: block; height: 100%; width: var(--bar); max-width: 100%;
  border-radius: inherit; background: linear-gradient(90deg, #2563eb, #0f766e);
}
.bar-lg { height: 14px; }
.link-stack { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.compact-map {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.compact-map a {
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 11px;
  background: #fff; color: var(--warm-grey); font-size: 13px; font-weight: 700;
}

@media (max-width: 780px) {
  .cockpit-grid { grid-template-columns: 1fr; }
  .visual-row { grid-template-columns: 1fr; }
  .cockpit-todo { grid-template-columns: 1fr; }
}

/* 專屬簽署連結（offer）管理 */
.preset-offer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 18px;
}
.preset-offer-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 14px; background: #fffdf8;
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
}
.preset-offer-card h3 { margin: 0 0 4px; font-size: 17px; color: var(--ink); }
.preset-offer-card p { margin: 0 0 8px; color: var(--warm-grey); font-size: 13px; line-height: 1.6; }
.preset-offer-card dl { margin: 10px 0 0; display: grid; gap: 6px; }
.preset-offer-card dl div { display: grid; grid-template-columns: 42px 1fr; gap: 8px; }
.preset-offer-card dt { color: var(--muted); font-size: 12px; }
.preset-offer-card dd { margin: 0; color: var(--ink); font-size: 13px; font-weight: 700; }
.preset-offer-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.inline-form { margin: 14px 0 18px; }
.form-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; margin-bottom: 12px;
}
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
.form-grid input, .form-grid select {
  padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
@media (max-width: 780px) {
  .preset-offer-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* 正式契約條文預覽 */
.contract-preview-box { border: 1px solid var(--border); border-radius: 10px; margin: 10px 0; background: #fffdf8; }
.contract-preview-box > summary { cursor: pointer; padding: 12px 16px; font-weight: 700; }
.contract-preview {
  margin: 0; padding: 0 18px 16px; max-height: 460px; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
  font-family: "Microsoft JhengHei", "PingFang TC", monospace; font-size: 13px; line-height: 1.7; color: #333;
}

/* ===================== 四區殼 (app-shell) ===================== */
:root {
  --shell-sidebar-w: 220px;
  --shell-assistant-w: 320px;
  --shell-topbar-h: 56px;
  --z-topbar: 40;
  --z-overlay: 45;
  --z-drawer: 50;
}

body.app-shell { min-height: 100vh; }

/* --- 頂部模組列 --- */
.app-shell .shell-topbar {
  position: sticky; top: 0; z-index: var(--z-topbar);
  display: flex; align-items: center; gap: 16px;
  height: var(--shell-topbar-h); padding: 0 20px;
  background: rgba(250, 245, 242, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.app-shell .shell-topbar .brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; flex: none; }
.app-shell .shell-topbar .brand .mark { font-family: var(--font-display); font-size: 20px; color: var(--ink); }
.app-shell .shell-topbar .brand .sub { font-size: 12px; color: var(--muted); }
.shell-modules { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.shell-modules::-webkit-scrollbar { display: none; }
.shell-module-tab {
  padding: 7px 14px; border-radius: 10px; white-space: nowrap; min-height:44px; display:inline-flex; align-items:center;
  color: var(--warm-grey); text-decoration: none; font-weight: 600; font-size: 14px;
}
.shell-module-tab:hover { background: #f6efe8; color: var(--accent-ink); }
.shell-module-tab.active { background: var(--accent); color: #fff; }
.shell-user { display: flex; align-items: center; gap: 12px; flex: none; }
.shell-username { font-size: 13px; color: var(--warm-grey); }
.shell-menu-btn {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 44px; height: 44px; padding: 8px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--card); cursor: pointer;
}
.shell-menu-btn span { display: block; height: 2px; border-radius: 2px; background: var(--ink); }

/* --- 三欄骨架 --- */
.shell-body {
  display: grid;
  grid-template-columns: var(--shell-sidebar-w) minmax(0, 1fr) auto;
  min-height: calc(100vh - var(--shell-topbar-h));
}
.shell-no-sidebar .shell-body { grid-template-columns: minmax(0, 1fr) auto; }

/* --- 左欄子選單 --- */
.shell-sidebar {
  position: sticky; top: var(--shell-topbar-h);
  height: calc(100vh - var(--shell-topbar-h)); overflow-y: auto;
  padding: 18px 12px 32px; background: #fffcf8; border-right: 1px solid var(--border);
}
.shell-nav-group { margin-bottom: 18px; }
/* 群組標題原本是淡灰小字，跟下面的項目分不開，掃過去看不出分組。
   改成底色色塊 + 左側色條，一眼看得出「這一段是哪一關」。 */
.shell-nav-title {
  padding: 6px 12px; margin-bottom: 6px; font-size: 12px; letter-spacing: .06em;
  color: var(--ink); font-weight: 800;
  background: #efe7dd; border-left: 3px solid var(--warm-grey, #9c8f80);
  border-radius: 6px;
}
.shell-nav-item {
  display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.4;
}
.shell-nav-item:hover { background: #f6efe8; }
.shell-nav-item.active { background: #f6efe8; color: var(--accent-ink); font-weight: 700; }

/* --- 中欄 --- */
.shell-main { min-width: 0; }
.shell-crumb { padding: 14px 24px 0; margin: 0; }
.shell-flash { padding: 12px 24px 0; }
.app-shell .shell-main .wrap { padding: 20px 24px 56px; }

/* --- 右欄 AI 助理 --- */
.shell-assistant {
  position: sticky; top: var(--shell-topbar-h);
  width: var(--shell-assistant-w);
  height: calc(100vh - var(--shell-topbar-h));
  display: flex; flex-direction: column;
  background: #fffcf8; border-left: 1px solid var(--border);
}
.assistant-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border); flex: none;
}
.assistant-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.assistant-toggle {
  width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--warm-grey); cursor: pointer; font-size: 16px; line-height: 1;
}
.assistant-msgs {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.assistant-welcome {
  font-size: 13px; color: var(--muted); background: #f6efe8;
  border-radius: 10px; padding: 10px 12px; line-height: 1.6;
}
.assistant-msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.assistant-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.assistant-msg.ai { align-self: flex-start; background: var(--card); border: 1px solid var(--border); color: var(--ink); border-bottom-left-radius: 4px; }
.assistant-msg.pending { color: var(--muted); font-style: italic; }
.assistant-msg.error { align-self: flex-start; background: #fdf0ef; border: 1px solid #f2c9c4; color: var(--danger); }
.assistant-hint { padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); }
.assistant-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); flex: none; }
.assistant-form textarea {
  flex: 1 1 auto; min-width: 0; resize: none; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-family: var(--font-zh); font-size: 15px; background: var(--card);
}
/* .btn-primary 內建 width:100%，這裡用較高權重壓回自動寬度，不讓送出鈕吃掉整排 */
.assistant-form .assistant-send {
  width: auto; flex: 0 0 auto; min-height: 42px; padding: 8px 16px;
  font-size: 14px; border-radius: 10px;
}
.assistant-form .assistant-send:disabled { opacity: .5; cursor: default; }

/* 桌機收合狀態：右欄縮成直條 */
.shell-assistant.collapsed { width: 48px; cursor: pointer; }
.shell-assistant.collapsed .assistant-msgs,
.shell-assistant.collapsed .assistant-form,
.shell-assistant.collapsed .assistant-hint,
.shell-assistant.collapsed .assistant-title { display: none; }
.shell-assistant.collapsed .assistant-head { border-bottom: none; justify-content: center; padding: 12px 6px; }
.shell-assistant.collapsed .assistant-toggle { transform: rotate(180deg); }

.shell-assistant-fab { display: none; }
.shell-overlay { position: fixed; inset: 0; background: rgba(43, 38, 34, .35); z-index: var(--z-overlay); }

/* --- <1040px：右欄變抽屜 + 浮動鈕 --- */
@media (max-width: 1039px) {
  .shell-body { grid-template-columns: var(--shell-sidebar-w) minmax(0, 1fr); }
  .shell-no-sidebar .shell-body { grid-template-columns: minmax(0, 1fr); }
  .shell-assistant {
    position: fixed; top: 0; right: 0; height: 100vh;
    width: min(90vw, 360px); z-index: var(--z-drawer);
    transform: translateX(100%); transition: transform .22s ease;
    box-shadow: var(--shadow-lift);
  }
  .shell-assistant.open { transform: none; }
  .shell-assistant.collapsed { width: min(90vw, 360px); cursor: auto; }
  .shell-assistant.collapsed .assistant-msgs,
  .shell-assistant.collapsed .assistant-form,
  .shell-assistant.collapsed .assistant-hint,
  .shell-assistant.collapsed .assistant-title { display: flex; }
  .shell-assistant.collapsed .assistant-title { display: inline; }
  .shell-assistant-fab {
    display: flex; align-items: center; justify-content: center;
    position: fixed; right: 16px; bottom: 16px; width: 52px; height: 52px;
    border: none; border-radius: 50%; background: var(--accent); color: #fff;
    font-weight: 700; font-size: 15px; z-index: var(--z-topbar);
    box-shadow: var(--shadow-lift); cursor: pointer;
  }
}

/* --- <780px：左欄變漢堡抽屜 --- */
@media (max-width: 779px) {
  .shell-menu-btn { display: flex; }
  .shell-body { grid-template-columns: minmax(0, 1fr); }
  .shell-sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    width: min(80vw, 280px); z-index: var(--z-drawer);
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow-lift); padding-top: 24px;
  }
  .shell-sidebar.open { transform: none; }
  .shell-username { display: none; }
  .app-shell .shell-topbar { padding: 0 12px; gap: 10px; }
  .shell-crumb { padding: 12px 14px 0; }
  .shell-flash { padding: 10px 14px 0; }
  .app-shell .shell-main .wrap { padding: 16px 14px 48px; }
}

/* ===================== 模組/部門柔和色彩編碼 ===================== */
/* --mod-* / --dept-* 的定義也在 static/tokens.css，這裡只放套用規則。 */
body.app-shell[data-module="hr"]      { --mod-tint: var(--dept-hr-tint);      --mod-ink: var(--dept-hr-ink); }
body.app-shell[data-module="finance"] { --mod-tint: var(--dept-finance-tint); --mod-ink: var(--dept-finance-ink); }
body.app-shell[data-module="tasks"]   { --mod-tint: var(--dept-tasks-tint);   --mod-ink: var(--dept-tasks-ink); }
body.app-shell[data-module="data"]    { --mod-tint: var(--dept-data-tint);    --mod-ink: var(--dept-data-ink); }
body.app-shell[data-module="tools"]   { --mod-tint: var(--dept-tools-tint);   --mod-ink: var(--dept-tools-ink); }
body.app-shell[data-module="admin"]   { --mod-tint: var(--dept-admin-tint);   --mod-ink: var(--dept-admin-ink); }

/* 頂部分頁：平常 = 各自淡底色；當前模組 = 實色 */
.shell-module-tab.tab-hr      { background: var(--dept-hr-tint);      color: var(--dept-hr-ink); }
.shell-module-tab.tab-finance { background: var(--dept-finance-tint); color: var(--dept-finance-ink); }
.shell-module-tab.tab-tasks   { background: var(--dept-tasks-tint);   color: var(--dept-tasks-ink); }
.shell-module-tab.tab-data    { background: var(--dept-data-tint);    color: var(--dept-data-ink); }
.shell-module-tab.tab-tools   { background: var(--dept-tools-tint);   color: var(--dept-tools-ink); }
.shell-module-tab.tab-admin   { background: var(--dept-admin-tint);   color: var(--dept-admin-ink); }
.shell-module-tab.tab-hr.active      { background: var(--dept-hr-ink); color: #fff; }
.shell-module-tab.tab-finance.active { background: var(--dept-finance-ink); color: #fff; }
.shell-module-tab.tab-tasks.active   { background: var(--dept-tasks-ink); color: #fff; }
.shell-module-tab.tab-data.active    { background: var(--dept-data-ink); color: #fff; }
.shell-module-tab.tab-tools.active   { background: var(--dept-tools-ink); color: #fff; }
.shell-module-tab.tab-admin.active   { background: var(--dept-admin-ink); color: #fff; }

/* 左欄與麵包屑跟著模組色走 */
.app-shell .shell-sidebar { border-top: 3px solid var(--mod-ink); }
/* 進到某個模組時，群組標題吃該模組的主題色（人資紫、財會藍…），
   讓「我在哪個模組的哪一關」兩件事同時看得出來 */
.app-shell .shell-nav-title {
  color: var(--mod-ink); background: var(--mod-tint); border-left-color: var(--mod-ink);
}
.app-shell .shell-nav-item.active { background: var(--mod-tint); color: var(--mod-ink); }
.app-shell .shell-nav-item:hover { background: var(--mod-tint); }
.app-shell .shell-crumb a:first-child { color: var(--mod-ink); font-weight: 700; }

/* 大標題：模組色的小色條 + 區塊標題色點，淡淡標記所屬 */
.app-shell .shell-main .hero h1 {
  border-left: 5px solid var(--mod-ink); padding-left: 14px; border-radius: 2px;
}
.app-shell .shell-main .work-surface .surface-head h2::before,
.app-shell .shell-main .section-title h2::before,
.app-shell .shell-main .sec-h::before,
.app-shell .shell-main .freq-h::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--mod-ink); margin-right: 9px; vertical-align: baseline;
}

/* 部門色卡（跨模組通用）：收發中心卡片、瀏覽器分組等按部門淡色左框 */
.dept-財會 { border-left: 4px solid var(--dept-finance-ink) !important; }
.dept-人資 { border-left: 4px solid var(--dept-hr-ink) !important; }
.dept-行銷 { border-left: 4px solid var(--dept-data-ink) !important; }
.dept-倉儲 { border-left: 4px solid var(--dept-tools-ink) !important; }
.dept-採購 { border-left: 4px solid var(--dept-tasks-ink) !important; }
.dept-客服 { border-left: 4px solid var(--dept-cs-ink) !important; }
.dept-營運 { border-left: 4px solid var(--accent) !important; }

/* ===================== 圖表卡片 ===================== */
.chart-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px;
}
.chart-head { margin-bottom: 12px; }
.chart-head h3 { margin: 0 0 3px; font-size: 16px; font-weight: 700; }
.chart-head p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.chart-wrap { position: relative; width: 100%; }
.chart-wrap canvas { width: 100% !important; }
.chart-empty { margin: 0; padding: 28px 0; text-align: center; color: var(--muted); font-size: 13.5px; }
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .chart-grid.two { grid-template-columns: 1.6fr 1fr; } }
.range-tabs { display: inline-flex; gap: 6px; }
.range-tabs a {
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--warm-grey);
}
.range-tabs a.active { background: var(--mod-ink); color: #fff; border-color: var(--mod-ink); }
.muted-note { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

/* 螢幕上看不到、但讀螢幕軟體讀得到。給表格 caption、圖示按鈕的替代文字用。
   不要用 display:none —— 那會讓輔助技術也讀不到，等於沒寫。 */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   通用彈窗表單（jdlg）+ 列表工具列
   建立：2026-08-07 · 依 ui-ux-pro-max §1 無障礙 / §2 觸控 / §8 表單

   為什麼用原生 <dialog>：焦點鎖定、Esc 關閉、::backdrop 遮罩、top-layer 疊層，
   這四件事瀏覽器全部內建。自己用 div 刻的彈窗，這四件事永遠有一件會壞掉。
   欄位一律「由上而下、一行一欄」——後台表單的欄位名稱長度差很多，
   多欄並排會讓每一列的視線落點左右跳，填起來累。
   ========================================================================== */

.jdlg {
  width: min(560px, calc(100vw - var(--space-7)));
  max-height: min(88dvh, 760px);
  padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-lift); overflow: hidden;
}
.jdlg::backdrop { background: rgba(43, 38, 34, .5); }
.jdlg[open] { animation: jdlg-in 180ms ease-out; }
.jdlg[open]::backdrop { animation: jdlg-fade 180ms ease-out; }
@keyframes jdlg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes jdlg-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .jdlg[open], .jdlg[open]::backdrop { animation: none; }
}

.jdlg-form { display: flex; flex-direction: column; max-height: inherit; margin: 0; }

.jdlg-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  background: var(--accent); color: #fff; flex: 0 0 auto;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5);
}
.jdlg-head h2 { margin: 0; font-size: 16px; font-weight: 700; font-family: var(--font-zh); letter-spacing: .01em; }
.jdlg-x {
  width: 44px; height: 44px; flex: 0 0 44px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.jdlg-x:hover { background: rgba(255, 255, 255, .18); }
.jdlg-x:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

.jdlg-body { padding: var(--space-5); overflow-y: auto; flex: 1 1 auto; }
.jdlg-intro { margin: 0 0 var(--space-4); font-size: 13px; color: var(--muted); line-height: 1.6; }

/* 送出擋下來時把錯誤集中列在最上面，每則可點回該欄位（WCAG error-summary） */
.jdlg-errors {
  margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4);
  background: var(--danger-tint); border: 1px solid var(--danger); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--danger);
}
.jdlg-errors b { display: block; margin-bottom: var(--space-1); }
.jdlg-errors ul { margin: 0; padding-left: 18px; }
.jdlg-errors a { text-decoration: underline; color: inherit; }

/* ---- 一行一欄位 ---- */
.jfield { display: grid; gap: var(--space-1) var(--space-4); margin-bottom: var(--space-4); }
.jfield:last-child { margin-bottom: 0; }
@media (min-width: 640px) {
  /* 標籤靠右貼齊輸入框左緣，整排欄位的視線落點才在同一條垂直線上 */
  .jfield { grid-template-columns: 132px minmax(0, 1fr); align-items: center; }
  .jfield > label { text-align: right; }
  .jfield-help, .jfield-err { grid-column: 2; }
}
.jfield > label { font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.jfield > label .req { color: var(--danger); margin-left: 2px; }
.jfield input, .jfield select, .jfield textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink);
  font-family: inherit; font-size: 16px;  /* 低於 16px 時 iOS Safari 會自動放大整頁 */
  transition: border-color .15s ease, box-shadow .15s ease;
}
.jfield textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.jfield input:hover, .jfield select:hover, .jfield textarea:hover { border-color: #ddd3c6; }
.jfield input:focus-visible, .jfield select:focus-visible, .jfield textarea:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(192, 138, 94, .22);
}
.jfield input:disabled, .jfield select:disabled, .jfield textarea:disabled {
  background: var(--bg); color: var(--muted); cursor: not-allowed; opacity: .5;
}
/* 唯讀 ≠ 停用：唯讀是「這格由系統算」，仍要能選取複製，所以不淡化也不擋游標 */
.jfield input[readonly] { background: var(--bg); color: var(--warm-grey); cursor: text; opacity: 1; }
.jfield [aria-invalid="true"] { border-color: var(--danger); background: var(--danger-tint); }
.jfield-help { font-size: 12px; color: var(--muted); line-height: 1.55; }
.jfield-err { font-size: 12.5px; color: var(--danger); font-weight: 500; line-height: 1.5; }
.jfield-err:empty { display: none; }
/* 錯誤不能只靠紅色分辨（色盲／黑白列印），前面固定加一個文字標記 */
.jfield-err::before { content: "！ "; font-weight: 700; }

/* 勾選框自成一列，標籤在右邊（跟其他欄位的左標籤反過來，才符合勾選的閱讀順序） */
.jfield-check { display: flex; align-items: flex-start; gap: var(--space-3); }
@media (min-width: 640px) { .jfield-check { padding-left: calc(132px + var(--space-4)); } }
.jfield-check input[type="checkbox"] {
  width: 20px; height: 20px; min-height: 20px; flex: 0 0 20px; margin: 2px 0 0; accent-color: var(--accent);
}
.jfield-check label { font-size: 14px; font-weight: 400; line-height: 1.5; cursor: pointer; }

.jdlg-foot {
  display: flex; justify-content: flex-end; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border);
  background: var(--card); flex: 0 0 auto;
}
.jdlg-note { margin-right: auto; font-size: 12px; color: var(--muted); }
.jbtn {
  min-height: 44px; padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--warm-grey);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.jbtn:hover { background: var(--bg); color: var(--ink); }
.jbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.jbtn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.jbtn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.jbtn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.jbtn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.jbtn[disabled], .jbtn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.jbtn.is-busy::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: jspin .7s linear infinite;
}
@keyframes jspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .jbtn.is-busy::before { animation-duration: 2.4s; } }

@media (max-width: 520px) {
  /* 手機把彈窗貼底成 sheet：拇指構得到底部按鈕，而不是浮在畫面正中央 */
  .jdlg {
    width: 100vw; max-width: 100vw; max-height: 92dvh;
    margin: auto auto 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: 0;
  }
  .jdlg-foot { padding-bottom: max(var(--space-3), env(safe-area-inset-bottom)); }
  .jdlg-foot .jbtn { flex: 1 1 0; }
  .jdlg-note { display: none; }
}

/* ---- 列表工具列：新增 / 匯出 Excel / 匯入 Excel ---- */
.list-toolbar {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.list-toolbar .spacer { margin-left: auto; }
.list-toolbar .jbtn { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.list-toolbar .count { font-size: 13px; color: var(--muted); }
.list-toolbar form { margin: 0; }
@media (max-width: 520px) {
  .list-toolbar .spacer { margin-left: 0; flex-basis: 100%; height: 0; }
}

/* ---- 匯入預覽表 ---- */
.imp-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.imp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.imp-table th, .imp-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.imp-table th { background: var(--bg); color: var(--warm-grey); font-weight: 600; white-space: nowrap; }
.imp-table td.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--muted); }
.imp-stat { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 12px; border-radius: 999px; white-space: nowrap; }
.imp-stat.新增 { background: var(--ok-tint); color: var(--ok); }
.imp-stat.略過 { background: var(--warn-tint); color: var(--warn); }
.imp-stat.錯誤 { background: var(--danger-tint); color: var(--danger); }
.imp-reason { color: var(--warm-grey); font-size: 12.5px; line-height: 1.5; }
.imp-summary { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; margin-bottom: var(--space-4); }

/* 已停用頁面的警示（快速計薪 2026-08-10 停用：與薪資月結是兩套引擎，金額不同） */
.payroll-retired {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--danger-tint);
  border-left: 3px solid var(--danger);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  max-width: 70ch;
}

/* 薪資草稿過期警示（2026-08-10：鎖定=抄草稿不重算，過期就會發到舊金額） */
.pc-stale {
  flex: 1 1 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--danger-tint);
  border-left: 3px solid var(--danger);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}

/* 明年度級距表尚未建立的提醒（2026-08-10：1 月結薪會被擋，提早整年提醒） */
.pc-nextyear {
  flex: 1 1 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--warn-tint);
  border-left: 3px solid var(--warn);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}
.pc-nextyear code {
  background: var(--card);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* ── HR employee lifecycle: one predictable journey across related pages ── */
.hr-lifecycle-journey {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 720px;
  margin: 0 0 20px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.hr-lifecycle-journey a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--warm-grey);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
  touch-action: manipulation;
}
.hr-lifecycle-journey a::before {
  content: attr(data-step);
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.hr-lifecycle-journey a:hover { background: var(--bg); color: var(--ink); }
.hr-lifecycle-journey a[aria-current="step"] {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(100, 60, 35, .16);
}
.hr-lifecycle-journey a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.lifecycle-center { border-left: 4px solid var(--accent); }
.lifecycle-center__intro { max-width: 64ch; }
.lifecycle-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.lifecycle-lane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}
.lifecycle-lane h3 { margin: 0 0 6px; font-size: 19px; }
.lifecycle-lane p { margin: 0; color: var(--muted); line-height: 1.6; }
.lifecycle-lane ol { margin: 16px 0; padding-left: 22px; color: var(--warm-grey); line-height: 1.75; }
.lifecycle-lane__status {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.lifecycle-lane__primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  touch-action: manipulation;
}
.lifecycle-lane__primary:hover { background: var(--accent-ink); color: #fff; }
.lifecycle-lane__primary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

@media (max-width: 768px) {
  .lifecycle-lanes { grid-template-columns: 1fr; }
}
@media (max-width: 375px) {
  .hr-lifecycle-journey { gap: 4px; padding: 4px; }
  .hr-lifecycle-journey a { gap: 4px; padding: 8px 4px; font-size: 13px; }
  .hr-lifecycle-journey a::before { width: 21px; height: 21px; }
  .lifecycle-lane { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .hr-lifecycle-journey a,
  .lifecycle-lane__primary { transition: none; }
}
