/* CHANGE-2026-10-06-06: CAS palette and shared components adapted to MRV.
   Reference: C:/cas_dev/public/styles.css. Domain layouts remain in styles.css.
   CHANGE-2026-10-06-07: user-selected warm brown/ivory accents replace teal. */
:root {
  --bg: #f6f4ef; --surface: #ffffff; --ink: #221f1b; --ink-muted: #6b6459;
  --border: #ddd6c8; --sidebar: #1d1a16; --sidebar-ink: #efe9dd;
  --gold: #b6863c; --accent: #6b5431; --amber: #b6863c;
  --red: #8a3b32; --red-bg: #fbecea; --surface-muted: #f7f3ea;
  --border-soft: #ece6da; --accent-soft: #f3ecdf;
  font-family: 'Noto Sans TC', system-ui, -apple-system, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5;
}
.shell { grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); padding: 20px 14px; }
.brand { padding: 4px 10px; font-size: 16px; font-weight: 600; }
.brand small { color: var(--sidebar-ink); }
.nav-group { margin: 10px 10px 2px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.45); font-size: 11px; letter-spacing: .04em; }
.nav-group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.nav button { color: var(--sidebar-ink); font-size: 14px; padding: 10px; border-radius: 6px; }
.nav button:hover { background: rgba(255,255,255,.08); }
.nav button.active { background: rgba(255,255,255,.08); color: var(--sidebar-ink); box-shadow: inset 3px 0 var(--gold); font-weight: 600; }
.main { padding: 24px; }
.topbar { gap: 16px; padding: 14px 24px; margin: -24px -24px 24px; background: var(--surface); border-color: var(--border); }
.topbar h1 { font-size: 20px; }
.actor, .muted { color: var(--ink-muted); }
.grid { gap: 16px; }
.card { background: var(--surface); border-color: var(--border); padding: 20px; border-radius: 10px; box-shadow: none; }
h2 { font-size: 18px; } h3 { font-size: 16px; }
.setup-card h2 { font-size: 16px; }
.setup-card p { color: var(--ink-muted); font-size: 13px; }
.setup-section { margin-top: 24px; }
.setup-section > h2 { margin: 0 0 12px; }
.setup-version { overflow-wrap: anywhere; font-size: 13px; }
.setup-trail { display:flex; justify-content:center; margin:24px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; padding: 8px 16px; border-radius: 6px; border-color: transparent; background: var(--sidebar); color: var(--sidebar-ink); font-weight: 500; transition: background-color .12s ease, border-color .12s ease, color .12s ease; }
.btn:hover:not(:disabled) { background: #33302a; filter: none; }
.btn.secondary { background: var(--surface); border-color: var(--border); color: var(--ink); }
.btn.secondary:hover:not(:disabled) { background: var(--bg); border-color: var(--ink-muted); }
.btn.danger { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.btn.danger:hover:not(:disabled) { background: var(--red); color: white; }
.link { color: var(--ink-muted); } .link:hover { color: var(--ink); }
.danger-link { color: var(--red); }
:where(button,a,input,select,textarea,summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sidebar :focus-visible { outline-color: var(--gold); }
.detail { grid-template-columns: minmax(140px,200px) minmax(0,1fr); border-color: var(--border); border-radius: 10px; box-shadow: 0 1px 2px rgba(34,31,27,.05); }
.detail dt, .detail dd { padding: 11px 16px; border-color: var(--border-soft); line-height: 1.5; }
.detail dt { background: var(--surface-muted); border-right: 1px solid var(--border-soft); color: var(--ink-muted); font-size: 13px; font-weight: 500; }
.detail dd { background: var(--surface); font-size: 15px; overflow-wrap: anywhere; }
table { font-size: 13px; background: var(--surface); }
th { background: var(--bg); color: var(--ink-muted); font-weight: 500; }
th, td { padding: 10px 12px; border-color: var(--border); }
tbody tr:hover { background: #fbf6ea; }
.form { gap: 14px; } .field { gap: 6px; min-width: 0; }
.field label { color: var(--ink-muted); font-size: 13px; font-weight: 500; }
.field input, .field select, .field textarea, .toolbar input, .toolbar select { min-height: 40px; padding: 8px 10px; border-color: var(--border); color: var(--ink); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { min-width: 0; max-width: 100%; }
.field input[type=checkbox], .field input[type=radio] { min-height: 0; accent-color: var(--accent); }
.tag { background: #8a8578; color: white; padding: 2px 10px; font-weight: 500; }
.tag.warning { background: var(--amber); color: white; }
.tag.danger { background: var(--red); color: white; }
.metric { color: var(--accent); }
.audit-filters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.audit-filters label { display:flex; flex-direction:column; gap:6px; color:var(--ink-muted); font-size:13px; min-width:0; }
.audit-filters input,.audit-filters select { padding:8px 10px; min-height:40px; width:100%; min-width:0; border:1px solid var(--border); border-radius:6px; color:var(--ink); background:var(--surface); }
.audit-filters .actions { align-self:end; align-items:center; margin:0; }
.global-audit-table { min-width:900px; } .audit-trace { max-width:180px; overflow-wrap:anywhere; font-size:12px; }
.error-log-table { min-width:900px; table-layout:fixed; }
.error-log-table td { vertical-align:top; overflow-wrap:anywhere; }
.error-log-table th:nth-child(3),.error-log-table th:nth-child(6) { width:18%; }
.error-log-table th:last-child { width:90px; }
.error-code,.error-route { font-size:12px; overflow-wrap:anywhere; margin-top:6px; }
.audit-dialog { width:min(1000px,calc(100vw - 32px)); max-height:85vh; overflow:auto; color:var(--ink); border:1px solid var(--border); }
.audit-dialog::backdrop { background:rgba(34,31,27,.4); } .audit-dialog details { margin:18px 0; } .audit-dialog td { overflow-wrap:anywhere; }
@media(max-width:700px) { .audit-filters { grid-template-columns:minmax(0,1fr); } }
.home-workspace { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.home-workspace > .card { min-width: 0; }
.home-welcome-compact { align-items: center; justify-content: space-between; gap: 20px; }
.home-welcome-compact h2 { margin: 4px 0 8px; }
.home-welcome-compact p { margin: 0; }
.home-welcome .actions { flex-shrink: 0; }
.home-list { list-style: none; margin: 0; padding: 0; }
.home-list li { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.home-item-content { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.home-item-content h3 { margin: 0 0 6px; font-size: 15px; }
.home-item-content p { margin: 8px 0 0; }
.home-project-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:16px 0 12px; padding:14px; background:var(--surface-muted); border-radius:6px; }
.home-project-facts strong { display:block; color:var(--accent); font-size:15px; overflow-wrap:anywhere; margin-top:4px; }
.home-project-facts small { display:block; color:var(--ink-muted); margin-top:4px; }
.home-project-facts .muted,.home-estimate-reference,.home-next-step,.home-estimate-note { font-size:13px; }
.home-project-list .actions { margin:14px 0 0; flex-wrap:wrap; }
@media(max-width:550px) { .home-project-facts { grid-template-columns:minmax(0,1fr); } }
.home-item-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 13px; }
.home-attention { color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 2px 8px; }
.home-list .btn, .home-list .link { flex-shrink: 0; }
.home-activity-list time { font-size: 13px; }
.home-source-error .btn { margin-left: 8px; }
@media(max-width:1000px) { .home-workspace { grid-template-columns: minmax(0, 1fr); } .home-welcome-compact { flex-wrap: wrap; } }
@media(max-width:550px) { .home-list li { flex-wrap: wrap; gap: 10px; } .home-item-content { flex-basis: 100%; } .home-welcome .actions { flex-shrink: 1; } }
.workspace-hero { background: var(--surface); border-left-color: var(--gold); }
.project-tabs button.active { background: var(--bg); }
.mrv-tabs button.active, .mrv-tabs button:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.notice { background: var(--bg); border: 1px solid var(--border); color: var(--ink); padding: 14px 16px; border-radius: 8px; }
.error { background: var(--red-bg); border: 1px solid rgba(138,59,50,.25); color: var(--red); padding: 14px 16px; border-radius: 8px; }
.empty-state, .readonly, .notice-inline { background: var(--surface-muted); }
.trace { background: var(--sidebar); color: var(--sidebar-ink); }
.login { width: calc(100% - 32px); max-width: 420px; margin: 12vh auto; padding: 32px; border-radius: 12px; }
.login h1 { font-size: 20px; overflow-wrap: anywhere; }
.evidence-modal-content { border-radius: 10px; }
.evidence-modal-footer { background: var(--bg); }
.report-preview-panel { background: var(--bg); }
.report-preview-panel iframe { background: var(--bg); }
.display-footer { color: var(--ink-muted); }
.nav-toggle, .nav-close { display: none; }
[hidden] { display: none !important; }
@media(max-width:850px) {
  .shell { display: block; } .main { padding: 18px 16px; }
  .topbar { padding: 14px 16px; margin: -18px -16px 20px; } .topbar h1 { font-size: 18px; }
  .card { padding: 18px; } .detail { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; } .nav-close { display: block; }
  .detail dt { border-right: 0; padding-bottom: 6px; } .detail dd { padding-top: 8px; }
  .nav-close { color: var(--sidebar-ink); border-color: rgba(255,255,255,.3); }
  .nav-backdrop { background: rgba(34,31,27,.4); }
}
@media(max-width:700px) { .login { padding: 24px; } }
@media(prefers-reduced-motion:reduce) { .btn { transition: none; } }
@media print {
  :root { color: #221f1b; background: white; }
  .main { padding: 0; } .topbar { margin: 0; padding: 0; background: white; }
  .card, .detail { box-shadow: none; } .trace { background: white; color: var(--ink); }
}

/* CHANGE-2026-10-07-10: M1 shared mobile content. Desktop and print stay intact. */
.mobile-cell-label { display: none; }
.mobile-cell-content { min-width: 0; }
.mobile-filter > summary { display: none; }
.mobile-filter { border: 0 !important; margin: 0; padding: 0 !important; }
@media screen and (max-width:720px) {
  .main { padding: 16px; }
  .topbar { margin: -16px -16px 16px; gap: 10px; }
  .topbar h1 { min-width: 0; overflow-wrap: anywhere; flex: 1; }
  .card { padding: 16px; }
  .btn,.link,.icon-button,.nav button,.nav-close,.nav-toggle,summary {
    min-height: 44px; min-width: 44px; touch-action: manipulation;
  }
  .link,.icon-button { display: inline-flex; align-items: center; justify-content: center; padding: 8px; }
  .field input:not([type=checkbox]):not([type=radio]),.field select,.field textarea,
  .toolbar input,.toolbar select,.audit-filters input,.audit-filters select { font-size: 16px; min-height: 44px; }
  .form,.audit-filters { grid-template-columns: minmax(0,1fr); }
  .field,.toolbar,.row-actions,.actions,.section-heading { min-width: 0; }
  .toolbar input,.toolbar select { width: 100%; }
  .detail { grid-template-columns: minmax(0,1fr); }
  .detail dt,.detail dd { padding: 10px 12px; overflow-wrap: anywhere; }
  .detail dt { border-right: 0; }
  .project-tabs,.mrv-tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; gap: 6px; padding: 3px 3px 8px; scroll-padding-inline: 3px; }
  .project-tabs button,.mrv-tabs button { flex: 0 0 auto; white-space: nowrap; min-height: 44px; }
  .mobile-filter > summary { display: flex; align-items: center; cursor: pointer; color: var(--ink); gap: 8px; }
  .mobile-filter > summary::before { content: '▸'; }
  .mobile-filter[open] > summary::before { content: '▾'; }
  .mobile-filter[open] > form { margin-top: 14px; }
  .mobile-list,.mobile-diff { display: block; min-width: 0; width: 100%; table-layout: auto; background: transparent; }
  .mobile-list thead,.mobile-diff thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mobile-list tbody,.mobile-diff tbody { display: block; }
  .mobile-list tbody > tr,.mobile-diff tbody > tr { display: block; margin-bottom: 12px; padding: 6px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
  .mobile-list td { display: grid; grid-template-columns: minmax(0,32%) minmax(0,1fr); gap: 10px; width: auto; max-width: none; border: 0; padding: 8px 12px; overflow-wrap: anywhere; }
  .mobile-cell-label { display: block; font-size: 13px; color: var(--ink-muted); }
  .mobile-cell-content { overflow-wrap: anywhere; }
  .mobile-diff td { display: block; border: 0; padding: 10px 12px; }
  .mobile-diff td:first-child { border-bottom: 1px solid var(--border-soft); font-weight: 600; }
  .mobile-diff .mobile-cell-label { margin-bottom: 6px; }
  .mobile-diff .detail { margin: 8px 0; }
  .mobile-diff ul { padding-left: 18px; }
  .mobile-list td.mobile-empty,.mobile-diff td.mobile-empty { display: block; }
  .table-scroll:has(> .mobile-list),.table-scroll:has(> .mobile-diff) { overflow: visible; }
  .audit-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 24px); padding: 14px; margin: auto; }
  .audit-dialog > .section-heading { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .audit-dialog h2 { margin: 0; }
}

/* CHANGE-2026-10-07-11: M2 scoped forms; original desktop grid and save handlers. */
.m2-row-field { display: contents; }
.m2-row-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.m2-group-title { display: none; }
@media screen and (max-width:720px) {
  .m2-input-card,#project-form .plan-row { grid-template-columns: minmax(0,1fr); padding: 14px; gap: 12px; }
  .m2-row-field { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin: 0 !important; min-width: 0; }
  .m2-row-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; color: var(--ink-muted); font-size: 13px; }
  .m2-row-field input,.m2-row-field select { width: 100%; max-width: none; min-width: 0; min-height: 44px; font-size: 16px; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; background: var(--surface); }
  .quadrant:has(.sample-row[data-sample-id]) > label input,[data-quadrant-count] { min-height: 44px; font-size: 16px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; }
  .m2-input-card > .link,.m2-input-card > .icon-button { justify-self: stretch; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
  .m2-group-title { display: block; margin: 16px 0 0; padding: 12px 0 4px; border-top: 1px solid var(--border); color: var(--accent); }
  #project-form h2,.m2-survey-form h2 { padding-top: 12px; border-top: 1px solid var(--border); }
  #project-form h2:first-child,.m2-survey-form h2:first-child { border-top: 0; }
  .mobile-list select[multiple] { width: 100%; min-height: 100px; }
  .mobile-list .check-inline { min-height: 44px; }
}

@media screen and (max-width:720px) { #land-form > h2 { display: none; } }

@media screen and (max-width:720px) {
  .m2-row-label { align-self: flex-start; text-align: left; }
  .m2-input-card > .link { text-decoration: none; }
  [data-land-upload] input,[data-land-upload] select,[data-land-upload] button { min-height: 44px; font-size: 16px; min-width: 0; }
}

/* CHANGE-2026-10-07-12: M3 monitored data remains in original forms and matrices. */
.mobile-matrix-hint { display: none; }
@media screen and (max-width:720px) {
  .m3-workspace .grid,.m3-workspace .two-column { grid-template-columns: minmax(0,1fr); }
  .m3-workspace .card,.m3-workspace .quadrant { min-width: 0; }
  .m3-workspace .attachment-list li { flex-wrap: wrap; gap: 8px; min-width: 0; }
  .m3-workspace .attachment-list li > span { flex-basis: 100%; overflow-wrap: anywhere; min-width: 0; }
  .m3-workspace .attachment-list li > small { flex-basis: 100%; margin: 0; }
  .m3-workspace .attachment-list .link { border: 1px solid var(--border); border-radius: 6px; text-decoration: none; background: var(--surface); }
  .m3-workspace .upload-row { gap: 12px; }
  .m3-workspace .upload-row > .m2-row-field { width: 100%; }
  .m3-workspace select[multiple] { width: 100%; min-height: 132px; }
  .m3-workspace .quadrant > label > input { min-height: 44px; font-size: 16px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; }
  .mobile-matrix-hint { display: block; color: var(--ink-muted); font-size: 13px; margin: 12px 0 6px; }
  .mobile-matrix-scroll { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
  .mobile-matrix-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .mobile-matrix { min-width: 660px; }
  .mobile-matrix tr > :first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 105px; max-width: 140px; overflow-wrap: anywhere; box-shadow: 1px 0 var(--border); }
  .mobile-matrix thead tr > :first-child { background: var(--surface-muted); z-index: 2; }
  .m3-workspace .mobile-list td.mobile-empty .tree-row { margin: 0; }
}

/* CHANGE-2026-10-07-14: M4 review layouts; report content and print unchanged. */
.mobile-report-hint { display: none; }
@media screen and (max-width:720px) {
 .m4-workspace .grid,.m4-workspace .two-column { grid-template-columns: minmax(0,1fr); }
 .m4-workspace .card,.m4-workspace .detail,.m4-workspace .mobile-cell-content { min-width: 0; }
 .m4-workspace .toolbar { flex-direction: column; align-items: stretch; }
 .m4-workspace .toolbar > .m2-row-field { width: 100%; }
 .m4-workspace .mobile-list .link { border: 1px solid var(--border); border-radius: 6px; text-decoration: none; background: var(--surface); }
 .m4-workspace .mobile-list td { overflow-wrap: anywhere; }
 .m4-workspace .mobile-list .detail { margin: 10px 0; }
 .m4-matrix { min-width: 780px; }
 .m4-dual-identity tr > :first-child { width: 105px; min-width: 105px; max-width: 105px; }
 .m4-dual-identity tr > :nth-child(2) { position: sticky; left: 105px; background: var(--surface); z-index: 1; min-width: 84px; box-shadow: 1px 0 var(--border); }
 .m4-dual-identity thead tr > :nth-child(2) { background: var(--surface-muted); z-index: 2; }
 .m4-workspace .report-preview-backdrop { padding: 0; }
 .m4-workspace .report-preview-panel { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; grid-template-rows: auto auto minmax(0,1fr); }
 .m4-workspace .report-preview-panel > header { flex-direction: column; align-items: stretch; padding: 12px 16px; }
 .m4-workspace .report-preview-panel > header .actions { flex-wrap: wrap; gap: 8px; }
 .m4-workspace .report-preview-panel iframe { min-width: 0; min-height: 0; }
 .mobile-report-hint { display: block; margin: 0; padding: 8px 16px; color: var(--ink-muted); font-size: 13px; }
}

/* CHANGE-2026-10-07-16: M5 foundation and shared mobile finish. */
.m5-comparison-hint { display:none; }
.manual-toc-disclosure > summary { font-size:1.17em; font-weight:700; list-style:none; }
.manual-toc-disclosure > summary::-webkit-details-marker { display:none; }
@media screen and (max-width:720px) {
 .m5-workspace .grid,.m5-workspace .two-column,.m5-workspace .home-project-facts,.m5-workspace .manual-card-grid { grid-template-columns:minmax(0,1fr); }
 .m5-workspace .card,.m5-workspace .home-item-content,.m5-workspace .check-list li,.m5-workspace .user-hero > div { min-width:0; overflow-wrap:anywhere; }
 .m5-workspace .home-list li,.m5-workspace .user-hero { flex-direction:column; align-items:stretch; }
 .m5-workspace .toolbar:has(> .m2-row-field) { flex-direction:column; align-items:stretch; }
 .m5-workspace .m2-row-field { width:100%; }
 .m5-workspace .mobile-list .link { border:1px solid var(--border); border-radius:6px; text-decoration:none; background:var(--surface); }
 .policy-table.mobile-list colgroup { display:none; }
 .policy-table.mobile-list .toolbar { flex-direction:column; align-items:stretch; }
 .policy-table.mobile-list select { max-width:100%; }
 .m5-backup-comparison { max-width:100%; }
 #sysbk-comparison { min-width:620px; }
 #sysbk-comparison th:first-child { position:sticky; left:0; min-width:110px; max-width:170px; background:var(--surface-muted); z-index:1; overflow-wrap:anywhere; }
 .m5-comparison-hint { display:block; color:var(--ink-muted); font-size:13px; }
 .manual-toc-disclosure > summary { display:flex; align-items:center; gap:8px; cursor:pointer; }
 .manual-toc-disclosure > summary::before { content:'▸'; }
 .manual-toc-disclosure[open] > summary::before { content:'▾'; }
 .manual-toc-disclosure a { display:flex; align-items:center; min-height:44px; overflow-wrap:anywhere; }
 .manual-chapter-nav { flex-direction:column; align-items:stretch; }
 .manual-chapter-nav .link { border:1px solid var(--border); border-radius:6px; text-decoration:none; white-space:normal; }
 .manual-article { overflow-wrap:anywhere; }
 .manual-table { max-width:100%; }
 .modal-backdrop { padding:8px; }
 .modal-backdrop .modal { max-width:100%; max-height:calc(100dvh - 16px); overflow:auto; overscroll-behavior:contain; }
 #manual-image-dialog { width:calc(100vw - 16px); max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); padding:8px; }
 #manual-image-preview { max-height:calc(100dvh - 88px); }
}

/* CHANGE-2026-10-07-17 (TYPE A): 專案主／子頁籤「色帶主列＋圓點子選單」；申請分類頁籤共用主列樣式。只改呈現，不改路由、名稱、分組或手機單行橫滑。 */
.project-tabs:not(.sub) { gap: 2px; margin: 18px 0 16px; padding: 6px 6px 0; background: var(--accent-soft); border: 1px solid var(--border); border-radius: 10px 10px 0 0; }
.project-tabs:not(.sub):not(:has(+ .project-tabs.sub, + .mrv-tabs)) { border-radius: 10px; }
.project-tabs:not(.sub):has(+ .project-tabs.sub, + .mrv-tabs) { margin-bottom: 0; }
.card > .project-tabs:not(.sub):first-child { margin-top: 0; }
.project-tabs:not(.sub) button { display: inline-flex; align-items: center; gap: 7px; margin-bottom: -1px; padding: 10px 16px 12px; border: 0; border-radius: 8px 8px 0 0; background: transparent; color: var(--ink-muted); font-weight: 650; }
.project-tabs:not(.sub) button:hover { background: rgba(255,255,255,.55); color: var(--ink); }
.project-tabs:not(.sub) button.active { background: var(--surface); color: var(--accent); box-shadow: inset 0 3px 0 var(--gold); }
.project-tabs .tab-icon { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.project-tabs.sub, .mrv-tabs { gap: 4px 20px; margin: 0 0 18px; padding: 10px 18px; background: var(--surface); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 10px 10px; }
.project-tabs.sub button, .mrv-tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 5px 0; border: 0; border-radius: 0; background: transparent; color: var(--ink-muted); font-size: 14px; font-weight: 600; box-shadow: none; }
.project-tabs.sub button::before, .mrv-tabs button::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--border); flex: 0 0 auto; }
.project-tabs.sub button:hover, .mrv-tabs button:hover { background: transparent; border-color: transparent; color: var(--ink); }
.project-tabs.sub button.active, .mrv-tabs button.active { background: transparent; border-color: transparent; color: var(--ink); font-weight: 700; }
.project-tabs.sub button.active::before, .mrv-tabs button.active::before { background: var(--gold); }
@media screen and (max-width:720px) {
  .project-tabs:not(.sub) { padding: 6px 6px 0; gap: 2px; }
  .project-tabs:not(.sub) button { margin-bottom: 0; padding: 10px 14px; }
  .project-tabs.sub, .mrv-tabs { padding: 2px 14px; gap: 18px; }
}

/* CHANGE-2026-10-07-18 (TYPE A): MRV_OVERVIEW_PAGE_SPEC 監控總覽進度呈現。唯讀摘要，不改資料或路由。 */
.ov-year { font-size: 14px; color: var(--ink-muted); }
.ov-year b { color: var(--accent); font-size: 18px; }
.ov-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.ov-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.ov-kpi small { display: block; color: var(--ink-muted); font-size: 13px; }
.ov-kpi b.metric { display: block; margin: 4px 0 6px; font-size: 24px; color: var(--accent); }
.ov-kpi b em, .ov-big em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--ink-muted); margin-left: 4px; }
.ov-bar { display: block; width: 100%; height: 8px; border: 0; border-radius: 99px; background: var(--border-soft); overflow: hidden; -webkit-appearance: none; appearance: none; color: var(--gold); }
.ov-bar::-webkit-progress-bar { background: var(--border-soft); border-radius: 99px; }
.ov-bar::-webkit-progress-value { background: var(--gold); border-radius: 99px; }
.ov-bar::-moz-progress-bar { background: var(--gold); border-radius: 99px; }
.ov-bar.ok { color: #4c7a4f; }
.ov-bar.ok::-webkit-progress-value { background: #4c7a4f; }
.ov-bar.ok::-moz-progress-bar { background: #4c7a4f; }
.ov-cell { display: flex; flex-direction: column; gap: 5px; min-width: 130px; }
.ov-cell-top { display: flex; justify-content: space-between; gap: 8px; }
.ov-table td { vertical-align: middle; }
.ov-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.ov-three .card { margin-bottom: 0; }
.ov-three .section-heading { flex-direction: row; align-items: baseline; gap: 12px; }
.ov-three h2 { font-size: 16px; }
.ov-big { font-size: 22px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.ov-lines { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; }
.ov-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border-soft); }
.ov-attention { list-style: none; padding: 0; margin: 0; }
.ov-attention li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border-soft); font-size: 14px; }
.ov-attention li:first-child { border-top: 0; }
.ov-att-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ov-boundary { font-size: 12.5px; color: var(--ink-muted); border-top: 1px solid var(--border); padding-top: 10px; margin: 4px 0 0; }
@media (max-width: 1000px) { .ov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ov-three { grid-template-columns: minmax(0, 1fr); } }
@media screen and (max-width: 720px) {
  .ov-attention li { flex-wrap: wrap; }
  .ov-cell { min-width: 0; }
}
@media (max-width: 420px) { .ov-kpis { grid-template-columns: minmax(0, 1fr); } }

/* CHANGE-2026-10-07-19 (TYPE A): 統一專案標頭——專案識別＋主分頁＋子分頁合為同一張卡，所有專案內頁位置一致。 */
.project-header { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin: 0 0 18px; overflow: hidden; }
.project-header .ph-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 20px; border-left: 4px solid var(--gold); flex-wrap: wrap; }
.project-header .ph-identity { min-width: 0; }
.project-header .ph-name { margin: 0; font-size: 19px; overflow-wrap: anywhere; }
.project-header .ph-meta { margin-top: 3px; font-size: 13.5px; color: var(--ink-muted); }
.project-header .project-tabs:not(.sub) { margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
.project-header > .project-tabs:not(.sub):first-child { border-top: 0; }
.project-header .project-tabs.sub, .project-header .mrv-tabs { margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
@media screen and (max-width:720px) { .project-header .ph-top { padding: 12px 14px; } .project-header .ph-name { font-size: 17px; } }
@media print { .project-header .ph-top { border-left: 0; padding: 0 0 8px; } .project-header { border: 0; } }

/* CHANGE-2026-10-07-20 (TYPE A): 第 2 層頁面標題列、第 3 層麵包屑。 */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 0 0 16px; flex-wrap: wrap; }
.page-head-text { min-width: 0; flex: 1 1 320px; }
.page-head h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head .muted { margin: 4px 0 0; font-size: 14px; }
.page-head .page-note { margin: 6px 0 0; font-size: 13px; color: var(--ink-muted); padding-left: 10px; border-left: 3px solid var(--gold); }
.page-help { margin-top: 6px; font-size: 13.5px; color: var(--ink-muted); }
.page-help summary { cursor: pointer; color: var(--accent); font-weight: 650; width: fit-content; }
.page-help p { margin: 6px 0 0; max-width: 820px; line-height: 1.65; }
.page-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: -4px 0 14px; font-size: 13.5px; color: var(--ink-muted); }
.crumbs .link { font-size: 13.5px; color: var(--accent); }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }
.crumb-sep { color: var(--border); font-weight: 700; }
@media screen and (max-width:720px) { .page-head-actions { width: 100%; } .page-head-actions .btn { flex: 1 1 auto; } }
@media print { .crumbs, .page-help, .page-head-actions { display: none !important; } }

/* 註冊前確證調查：與共用 720px 手機版表單及比較卡片一致。 */
#validation-survey-form > fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.validation-plot-picker { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.validation-plot-picker label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.validation-plot-picker input { width: 20px; height: 20px; }
.validation-round { padding: 16px 0; border-bottom: 1px solid var(--border); }
.validation-round:last-child { border-bottom: 0; }
.validation-measure { min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin: 12px 0; }
.validation-measure legend { padding: 0 8px; font-weight: 600; }
.validation-save { margin: 16px 0; flex-wrap: wrap; }
.validation-save span { color: var(--ink-muted); }
@media screen and (max-width:720px) {
  .validation-measure.form { grid-template-columns: minmax(0,1fr); padding: 12px; }
  .validation-measure input, .validation-measure select { min-width: 0; width: 100%; }
  .validation-save .btn { width: 100%; }
  .validation-plot-picker { flex-direction: column; gap: 4px; }
}
