/* Style of the site. Tokens and table follow the project's HTML documents (docs/build_html.py).
   The first token block is the light theme, the default. The second one is the dark theme. It applies when
   static/js/theme.js sets data-theme="dark" on <html>. The site does not read the colour setting of the
   operating system (Task 19). No external font, no external stylesheet. */
:root{
  --bg:#F3F6F6; --surface:#FFFFFF; --sunk:#E9EFEF; --ink:#132528; --muted:#56676B; --line:#D3DEE0;
  --accent:#0B6A6F; --accent-2:#12A3A6; --accent-soft:#DFEEEE; --navy:#0E3A5B; --navy-soft:#E3EAF1;
  --warn:#A2560F; --warn-soft:#FBEBDD; --bad:#B3261E; --bad-soft:#FBE9E7; --code-bg:#EEF3F3;
  --chart-1:#0B6A6F; --chart-2:#2A5DA8; --chart-3:#A2560F; --chart-4:#6B4A9E; --chart-5:#5B7F1E; --chart-6:#A63D62;
  --shadow-card:0 1px 2px rgba(19,37,40,.06),0 14px 36px -16px rgba(19,37,40,.28);
  --font-body:"Noto Sans TC","Microsoft JhengHei","PingFang TC","Heiti TC",system-ui,sans-serif;
  --font-mono:ui-monospace,"Cascadia Mono","SF Mono",Menlo,Consolas,monospace;
}
:root[data-theme="dark"]{
  --bg:#0D1517; --surface:#142023; --sunk:#0F1A1C; --ink:#E3ECEE; --muted:#97ABAF; --line:#26383C;
  --accent:#5FB9BD; --accent-2:#5FB9BD; --accent-soft:#163538; --navy:#8DB4DA; --navy-soft:#16263A;
  --warn:#F1B65C; --warn-soft:#382912; --bad:#FF8E82; --bad-soft:#3A1A17; --code-bg:#0F1D20;
  --chart-1:#5FB9BD; --chart-2:#8DB4DA; --chart-3:#F1B65C; --chart-4:#B79BE0; --chart-5:#A3C95F; --chart-6:#E38AA9;
  --shadow-card:0 1px 2px rgba(0,0,0,.45),0 16px 40px -18px rgba(0,0,0,.75);
  color-scheme:dark}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.75 var(--font-body);-webkit-text-size-adjust:100%}
.wrap{max-width:1320px;margin:0 auto;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}

/* header and navigation */
header.top{background:var(--surface);border-bottom:1px solid var(--line)}
.top-in{display:flex;flex-wrap:wrap;gap:6px 24px;align-items:center;padding-block:10px}
.top-in h1{font-size:16px;line-height:1.4;margin:0}
nav[aria-label="主要導覽"]{display:flex;flex-wrap:wrap;gap:4px}
nav[aria-label="主要導覽"] a{color:var(--ink);text-decoration:none;padding:3px 12px;border-radius:6px;font-size:14px}
nav[aria-label="主要導覽"] a:hover{background:var(--sunk)}
nav[aria-label="主要導覽"] a[aria-current="page"]{background:var(--accent-soft);color:var(--accent);font-weight:700}
/* theme button (Task 19). The pressed look hangs on the attribute of <html>, which is set before the first paint.
   Without JavaScript nothing sets the attribute, so the button that could do nothing is hidden. */
#theme-toggle{margin-left:auto;font-size:14px;color:var(--ink);background:var(--surface);border:1px solid var(--muted)}
:root[data-theme="dark"] #theme-toggle{color:var(--accent);background:var(--accent-soft);border-color:var(--accent)}
html:not([data-theme]) #theme-toggle{display:none}
/* account and logout (Task 37): after the theme button. Without JavaScript the theme button is hidden, so the account
   form takes over the push to the right. */
.account{display:flex;align-items:center;gap:10px;margin:0;font-size:14px}
html:not([data-theme]) .account{margin-left:auto}
.account form{margin:0}
.account a[aria-current="page"]{font-weight:700}
.account button{font-weight:400;color:var(--accent);background:var(--surface)}
/* the login page (Task 37; layout of Task 41). One raised card with one action; the site name sits on a band of the
   site colour at its top. Beside the card from 900 px, below it on a phone, the panel 「最新更新」 lies flat on the page.
   Fields and button are full width and 44 px high; 16 px text keeps a phone from zooming into a field. */
.login-layout{display:grid;grid-template-columns:minmax(0,26rem);justify-content:center;gap:36px;padding-top:clamp(4px,4vh,48px)}
.login-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:hidden;
  box-shadow:var(--shadow-card)}
.login-brand{background:var(--accent);color:var(--surface);padding:22px 28px 20px}
:root[data-theme="dark"] .login-brand{background:var(--accent-soft);color:var(--ink);border-bottom:1px solid var(--line)}
.login-site{margin:0;font-size:21px;line-height:1.4;font-weight:700;letter-spacing:.03em}
.login-purpose{margin:4px 0 0;font-size:14px;line-height:1.6;opacity:.9}
.login-box{padding:22px 28px 26px}
.login-box h2{font-size:18px;margin:0 0 16px}
.login-field{margin:0 0 16px}
.login-box label{display:block;font-size:14px;font-weight:600;margin-bottom:6px}
.login-box input[type="text"],.login-box input[type="password"]{display:block;width:100%;min-height:44px;font:inherit;
  font-size:16px;color:var(--ink);background:var(--surface);border:1px solid var(--muted);border-radius:8px;padding:8px 12px}
.login-box input:focus-visible{border-color:var(--accent);outline:2px solid var(--accent-2);outline-offset:1px}
.login-box button[type="submit"]{display:block;width:100%;min-height:44px;margin-top:24px;font-size:16px;border-radius:8px}
.login-alert{margin:0 0 16px;padding:10px 14px;color:var(--bad);background:var(--bad-soft);border:1px solid var(--bad);
  border-left-width:4px;border-radius:8px;font-weight:600}
.login-rule{margin:16px 0 0;font-size:13px;line-height:1.6;color:var(--muted)}
.login-updates h2{font-size:18px;margin:2px 0 16px}
.updates-more{margin:2px 0 0 29px;font-size:14px}
@media (min-width:900px){
  .login-layout{grid-template-columns:minmax(0,26rem) minmax(0,28rem);gap:64px;align-items:start}
}
/* the versions of config/changelog.py (Task 41): the panel 「最新更新」 and the page 版本紀錄. A line with one dot per
   version, newest on top with a filled dot. The kind of an entry is a small label in the colour of its kind. */
ol.versions{list-style:none;margin:0;padding:0}
ol.versions > li{position:relative;margin-left:6px;padding:0 0 20px 22px;border-left:2px solid var(--line)}
ol.versions > li:last-child{border-left-color:transparent;padding-bottom:6px}
ol.versions > li::before{content:"";position:absolute;left:-8px;top:5px;width:14px;height:14px;box-sizing:border-box;
  border-radius:50%;background:var(--bg);border:2px solid var(--accent)}
ol.versions > li:first-child::before{background:var(--accent)}
h3.version-name{margin:0 0 6px;font-size:15px;line-height:1.6;font-variant-numeric:tabular-nums;letter-spacing:.02em}
ul.entries{list-style:none;margin:0;padding:0}
ul.entries li{display:flex;gap:8px;align-items:baseline;margin:0 0 4px;font-size:14px;line-height:1.7}
.kind{flex:none;font-size:12px;line-height:1.6;font-weight:600;padding:0 6px;border-radius:4px;color:var(--accent);
  background:var(--accent-soft)}
.kind[data-kind="修正"]{color:var(--warn);background:var(--warn-soft)}
.kind[data-kind="調整"]{color:var(--navy);background:var(--navy-soft)}
.changelog{max-width:46rem;margin-top:18px}
/* the footer of every page (Task 41): the version that runs and the link to the page 版本紀錄 */
.site-foot{border-top:1px solid var(--line);color:var(--muted);font-size:13px}
.site-foot .wrap{display:flex;flex-wrap:wrap;gap:2px 16px;padding-block:12px 18px}
.site-foot p{margin:0}
.site-version{font-variant-numeric:tabular-nums}
/* the account pages (Task 38): the sentence of a change that worked, the forms, the actions of a row */
.notice{margin:0 0 14px;padding:10px 14px;background:var(--accent-soft);border:1px solid var(--accent);border-radius:10px}
.account-form{max-width:28rem}
.account-form label{display:block;font-weight:600;margin-bottom:4px}
.account-form input,.account-form select{box-sizing:border-box;width:100%}
.account-form .help,.account-form .help ul{font-size:13px;color:var(--muted);margin:4px 0 0}
.account-form .errorlist{color:var(--bad);margin:4px 0 0;padding-left:1.2em}
td.actions form{display:inline-flex;gap:6px;align-items:center;margin:0 8px 0 0}
main{padding-block:20px 60px}
h2{font-size:21px;line-height:1.4;margin:0 0 12px}
h3{font-size:17px;line-height:1.4;margin:22px 0 6px}
h4{font-size:15px;line-height:1.4;margin:16px 0 4px}
a{color:var(--accent)}
:focus-visible{outline:2px solid var(--accent-2);outline-offset:2px}

/* filter bar */
.filters{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end;background:var(--sunk);border:1px solid var(--line);border-radius:10px;padding:12px 14px;margin:0 0 6px}
.filters label{display:flex;flex-direction:column;gap:2px;font-size:12.5px;color:var(--muted);line-height:1.4}
.filters input,.filters select{font:inherit;font-size:14px;color:var(--ink);background:var(--surface);border:1px solid var(--muted);border-radius:6px;padding:5px 8px;min-width:130px;max-width:260px}
.filters input[type="search"]{min-width:200px}
.filters .actions{display:flex;gap:12px;align-items:center;padding-bottom:5px}
/* a.button is a link with the face of a button, for example 「下載 Excel」 on the 藥品總表 (Task 25) */
button,a.button{font:inherit;font-size:14px;font-weight:600;color:var(--surface);background:var(--accent);border:1px solid var(--accent);border-radius:6px;padding:5px 16px;cursor:pointer}
a.button{display:inline-block;text-decoration:none}
button:hover,a.button:hover{filter:brightness(1.1)}
/* the secondary face: 「恢復預設」 on 欄位設定 and 「下載 Excel」 on the 藥品總表 */
button.secondary,a.button.secondary{color:var(--accent);background:var(--surface)}

/* count line, results, empty states */
#results{transition:opacity .15s}
#results.htmx-request{opacity:.55}
/* While htmx brings a new table, a link button in it still names the old filters: the pointer cannot press it
   (Task 25 fix round 1, F07). static/js/list.js marks it aria-disabled and stops Enter. */
#results.htmx-request a.button{pointer-events:none}
.count{margin:14px 0 4px;font-weight:700;font-variant-numeric:tabular-nums}
.empty{margin:18px 0;padding:14px 16px;background:var(--surface);border:1px dashed var(--line);border-radius:10px;color:var(--muted)}
.muted{color:var(--muted)}

/* table (same style as the project's documents) */
.tablewrap{overflow-x:auto;margin:6px 0 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
table{border-collapse:collapse;width:100%;font-size:13.5px;line-height:1.6}
th,td{border-bottom:1px solid var(--line);padding:7px 10px;text-align:left;vertical-align:top}
th{background:var(--sunk);font-weight:600;white-space:nowrap}
tr:last-child td{border-bottom:none}
td:first-child{white-space:nowrap}
td.num{font-family:var(--font-mono);font-size:.92em;font-variant-numeric:tabular-nums}
tr.is-key td{background:var(--accent-soft)}
ul.links,ul.forms{list-style:none;margin:0;padding:0}
ul.links li,ul.forms li{margin:0 0 2px}
td.nowrap{white-space:nowrap}
td.class-path span{font-family:var(--font-mono);font-size:.92em;cursor:help;border-bottom:1px dotted var(--muted)}
.tag{display:inline-block;font-size:12px;line-height:1.5;padding:0 8px;border-radius:99px;border:1px solid var(--warn);color:var(--warn);background:var(--warn-soft);white-space:nowrap}
.tag.tag-match{border-style:dashed;border-color:var(--navy);color:var(--navy);background:var(--navy-soft)}
.tag.tag-ok{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}
/* sortable headers (final review E1): the header of the open order is in the accent colour; aria-sort names it */
th a.sort{color:inherit;text-decoration:none}
th a.sort:hover{text-decoration:underline}
th[aria-sort] a.sort{color:var(--accent)}
/* the message that replaces the rows after a failed request (final review D3) */
.empty.error{color:var(--bad);border-color:var(--bad)}

/* detail pages and the data source page */
.back{margin:0 0 6px;font-size:14px}
dl.fields{display:grid;grid-template-columns:max-content 1fr;margin:6px 0 14px;background:var(--surface);border:1px solid var(--line);border-radius:10px;overflow:hidden}
dl.fields dt,dl.fields dd{margin:0;padding:7px 12px;border-bottom:1px solid var(--line)}
dl.fields dt{background:var(--sunk);color:var(--muted);font-size:13.5px;line-height:1.94;font-weight:600;white-space:nowrap}
dl.fields dt:last-of-type,dl.fields dd:last-of-type{border-bottom:none}
code{font-family:var(--font-mono);font-size:.92em;background:var(--code-bg);padding:1px 6px;border-radius:4px}
ol.notes{margin:4px 0 14px;padding-left:1.6em}

/* the 待確認事項 pages (Task 42): the switch of 未結案 and 已結案, the source under the fields, the discussion */
nav.pending-switch{display:flex;gap:14px;margin:0 0 12px;font-size:15px}
nav.pending-switch a[aria-current="page"]{font-weight:700;text-decoration:none}
/* Each 待確認事項 is a framed card, so its actions never look like those of the next item (2026-12-02). */
section.pending{margin:0 0 22px;padding:14px 16px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
section.pending p.source{margin:-6px 0 10px;font-size:13.5px;color:var(--muted)}
details.discussion{margin:0 0 6px;padding:8px 12px;background:var(--surface);border:1px solid var(--line);border-radius:10px}
details.discussion summary{cursor:pointer;font-weight:600}
ol.comments{list-style:none;margin:8px 0 0;padding:0}
li.comment{padding:8px 0;border-top:1px solid var(--line)}
li.comment p{margin:0}
li.comment .comment-head,li.comment time,li.comment .removed{color:var(--muted);font-size:13.5px}
li.comment .comment-body{margin-top:2px;overflow-wrap:anywhere}
/* Task 43: the comment form, 移除, the line of a failed action, the buttons of a 管理者, the form of an item */
li.comment form.remove{margin-top:4px}
form.comment-form{margin:10px 0 0;padding-top:10px;border-top:1px solid var(--line)}
form.comment-form label,form.close-form label{display:block;font-weight:600;font-size:14px;margin-bottom:4px}
form.comment-form textarea{box-sizing:border-box;width:100%;font:inherit}
form.comment-form p{margin:6px 0 0}
.form-error{color:var(--bad);margin:4px 0 0}
p.discussion-result{margin:4px 0 0;color:var(--bad)}
p.discussion-result:empty{display:none}
.item-actions{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:flex-end;margin:12px 0 0;padding:10px 12px;
  border:1px dashed var(--line);border-radius:8px}
.item-actions-title{flex-basis:100%;margin:0;font-size:13.5px;font-weight:600;color:var(--muted)}
.item-actions form{margin:0}
form.close-form input[type="text"]{min-width:18em;font:inherit}
form.new-item{margin:0 0 12px}
.item-form{max-width:40rem}
.item-form label{display:block;font-weight:600;margin-bottom:4px}
.item-form input,.item-form select,.item-form textarea{box-sizing:border-box;width:100%;font:inherit}
.item-form .help{font-size:13px;color:var(--muted);margin:4px 0 0}
/* The 協作機關的關鍵藥品 at the bottom of the 關鍵藥品 page (2026-12-02): a button form in a table cell. */
section.agency{margin-top:28px}
form.inline-form{display:inline;margin-left:6px}
.item-form .errorlist{color:var(--bad);margin:4px 0 0;padding-left:1.2em}
.comment-preview{margin:10px 0 14px;padding:8px 12px;background:var(--surface);border:1px solid var(--line);border-radius:10px}
.comment-preview p{margin:0}
.comment-preview .comment-head{color:var(--muted);font-size:13.5px}
ol.notes li{margin:0 0 6px}

/* the 說明 of the links (Task 23): the last column of both overviews wraps; each link of a detail page has a block */
td.explain{min-width:14em;max-width:26em;white-space:normal}
.no-link p{margin:6px 0}
.no-link > :first-child{margin-top:0}
.no-link > :last-child{margin-bottom:0}
ul.near-names{margin:4px 0 14px;padding-left:1.4em}
ul.near-names li{margin:0 0 2px}

/* 藥品總表 (Task 24). A key or 對應 cell has one line per 對應. Its lines do not wrap, so line n of every such cell
   stays at one height; the short key cells never wrap either, so a one-line cell reads like a two-line one. The table
   scrolls inside its box when the chosen columns are wider. Any column can come first, so the first cell drops the
   site-wide no-wrap rule of td:first-child; the no-wrap list below comes later and keeps its columns on one line
   (fix round 1, F07). 關鍵藥品成分 may wrap on a one-line row, inside a minimum width: on page 1 the longest key
   ingredient of the list otherwise pushes 對應狀態 out of the box at 1280 px (fix round 1, F09). */
.count-line{display:flex;flex-wrap:wrap;gap:2px 16px;align-items:baseline;margin:14px 0 4px}
.count-line .count{margin:0}
ul.lines{list-style:none;margin:0;padding:0}
ul.lines li{margin:0 0 2px;white-space:nowrap}
ul.lines .tag{vertical-align:top}
table.combined td:first-child{white-space:normal}
table.combined td.col-key_code,table.combined td.col-key_section,table.combined td.col-key_tier,
table.combined td.col-key_category,table.combined td.col-key_forms,
table.combined td.col-key_page,table.combined td.col-match,table.combined td.col-status,
table.combined td.col-no,table.combined td.col-form,table.combined td.col-essential_page{white-space:nowrap}
table.combined td.col-key_ingredient{min-width:12em}
table.combined td.col-explanation{min-width:14em;max-width:26em}

/* 欄位設定 (Task 24). Without JavaScript nothing sets data-theme on <html> (static/js/theme.js), so the handles, the
   move buttons and their help, which need static/js/columns.js, are hidden as the theme button is. */
ol.column-list{list-style:none;margin:10px 0 6px;padding:0;max-width:760px;background:var(--surface);border:1px solid var(--line);border-radius:10px}
li.column-line{display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;padding:6px 12px;border-bottom:1px solid var(--line);background:var(--surface)}
li.column-line:last-child{border-bottom:none;border-radius:0 0 10px 10px}
li.column-line:first-child{border-radius:10px 10px 0 0}
li.column-line.is-dragging{background:var(--accent-soft);outline:2px solid var(--accent-2);outline-offset:-2px}
.handle{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;color:var(--muted);font-size:18px;line-height:1;padding:4px 6px;border-radius:6px}
.handle:hover{background:var(--sunk);color:var(--ink)}
label.show{display:flex;gap:4px;align-items:center;font-size:13.5px;color:var(--muted)}
.column-name{font-weight:600;min-width:9em}
.column-source{color:var(--muted);font-size:13px;min-width:7em}
.moves{display:flex;gap:6px;margin-left:auto}
button.move{font-weight:400;font-size:13px;padding:1px 10px;color:var(--accent);background:var(--surface);border-color:var(--line)}
/* Under the pointer an enabled button gets the soft accent face; the site-wide brightness filter would wash its pale
   border out, close to the disabled look (fix round 1, F12). The disabled rule comes later and wins. */
button.move:hover{filter:none;background:var(--accent-soft)}
button.move[aria-disabled="true"]{color:var(--muted);background:var(--sunk);border-style:dashed;opacity:.6;cursor:default;filter:none}
.column-status{min-height:1.75em;margin:0 0 6px;font-size:13.5px;color:var(--muted)}
.column-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
html:not([data-theme]) .handle,html:not([data-theme]) .moves,html:not([data-theme]) .column-help{display:none}

/* pager */
nav.pager{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;font-size:14px;margin:0 0 8px}
nav.pager a{padding:2px 12px;border:1px solid var(--line);border-radius:6px;background:var(--surface);text-decoration:none}
nav.pager a:hover{background:var(--accent-soft)}

/* dashboard: totals, charts and the table under each chart */
.totals{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px;margin:0 0 24px}
.total{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:12px 16px}
.total p{margin:0}
.total-name{font-size:13.5px;color:var(--muted);font-weight:600}
.total-value{font-size:15px}
.total-value .num{font-size:30px;font-weight:700;line-height:1.3;font-variant-numeric:tabular-nums}
.total ul{list-style:none;margin:2px 0 0;padding:0}
.total li{margin:0 0 2px}
.total li .num{font-size:1.15em;font-weight:700}
.figure{margin:0 0 30px}
.figure h3{margin:0 0 8px}
.chart-box{display:none;position:relative;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:8px 12px 4px;margin:0 0 8px}
.chart-box.is-ready{display:block}
.figure .tablewrap{display:inline-block;max-width:100%;vertical-align:top}
.chart-table{width:auto;min-width:260px}
.chart-table th,.chart-table td{padding:4px 10px}
.chart-table th.num,.chart-table td.num{text-align:right}
.chart-table td:first-child{white-space:normal}

/* the source note of the 技術司分類 under figure 1 and on the data source page (Task 18) */
dl.tech-note{display:grid;grid-template-columns:max-content 1fr;gap:2px 14px;margin:10px 0 14px;font-size:13px;line-height:1.7;color:var(--muted)}
dl.tech-note dt{font-weight:600}
dl.tech-note dd{margin:0}
td.tech{white-space:nowrap}

/* the 推定規則提示 page (Task 28): the 4 × 4 table with its diagonal, the amounts, and the line of a detail page.
   Task 29: below that line, the two sentences of the rule (.rule-notice) take a line of their own and wrap there. */
.matrix-wrap{display:inline-block;max-width:100%;vertical-align:top}
table.rule-matrix{width:auto;min-width:360px}
table.rule-matrix th.num,table.rule-matrix td.num{text-align:right}
table.rule-matrix td.same{font-weight:700;background:var(--accent-soft)}
table.rule-items th.num,table.rule-items td.num:not(:first-child){text-align:right}
table.rule-items td.amount{white-space:nowrap}
ol.rule-steps{margin:4px 0 10px;padding-left:1.6em}
ol.rule-steps li{margin:0 0 4px}
.rule-line{display:block}
.rule-notice{display:block;color:var(--muted)}

/* 對應確認 (Task 26): the form 修改人, one block per 關鍵藥品, the action forms, the tag of 已駁回 and the line of the
   result. The line .block-result shows the result at the end of the block where the person pressed: nothing covers
   the page, and no row above it moves (fix round 1, F08). The live region #link-result says the same to a screen
   reader; .visually-hidden keeps it out of sight but in the accessibility tree. On the page 修改紀錄, .old-note is the
   說明 that a note replaced, on its own line (fix round 1, F24). */
section.link-block{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:10px 14px 2px;margin:0 0 14px}
.block-head{display:flex;flex-wrap:wrap;gap:4px 18px;align-items:center}
.block-head h3{flex-basis:100%;margin:0}
dl.block-facts{display:flex;flex-wrap:wrap;gap:2px 18px;margin:0;font-size:13.5px}
dl.block-facts div{display:flex;gap:6px}
dl.block-facts dt{color:var(--muted)}
dl.block-facts dd{margin:0}
form.act{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:center}
label.note{display:flex;gap:4px;align-items:center;font-size:12.5px;color:var(--muted)}
label.note input{font:inherit;font-size:13px;color:var(--ink);background:var(--surface);border:1px solid var(--muted);border-radius:6px;padding:1px 6px;width:9em}
button.small{font-size:13px;padding:1px 10px}
.block-result{margin:-2px 0 10px;font-size:13.5px;font-weight:600;color:var(--accent)}
.block-result:empty{display:none}
section.link-block .tablewrap{margin:8px 0 10px}
section.link-block .empty{margin:8px 0 10px}
table.link-table td.actions{min-width:21em}
.tag.tag-rejected{border-style:dashed;border-color:var(--muted);color:var(--muted);background:var(--sunk)}
.old-note{display:block;color:var(--muted)}
/* 對應確認 (Task 27): below the table, 相近名稱 (one line per 必要藥品) and 加入其他必要藥品 (a number field) */
.link-add{margin:0 0 10px;font-size:13.5px}
.link-add h4{font-size:14px;margin:8px 0 2px}
.link-add p{margin:0 0 4px;color:var(--muted)}
ul.near-names{list-style:none;margin:0 0 6px;padding:0}
ul.near-names li{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;padding:3px 0;border-top:1px solid var(--line)}
ul.near-names li:first-child{border-top:none}
ul.near-names .nowrap{white-space:nowrap}
form.add{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:center}
form.add label{display:flex;gap:4px;align-items:center;color:var(--muted)}
form.add input[name=essential]{font:inherit;font-size:13px;color:var(--ink);background:var(--surface);border:1px solid var(--muted);border-radius:6px;padding:1px 6px;width:7em}
.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}

/* 開發品項 (Task 48): the tab bar of the three channels, the half-year cells of 法科, the case blocks, the notes, and
   the statistics with the numbers that the Excel writes otherwise. The half-year cells are the one strong mark of the
   pages: 已執行 is filled, 規劃中 is a soft cell with a dashed edge, 暫緩 is hatched in the colour of a fault; a year is
   two cells, and a wider gap ends it. A number that differs from the Excel takes the soft warning colour and names the
   Excel's number below it; a note has the same colour on its left edge. */
.programme-head{display:flex;flex-wrap:wrap;gap:4px 18px;align-items:flex-end;border-bottom:1px solid var(--line);margin:0 0 10px}
nav.programme-tabs{display:flex;flex-wrap:wrap;gap:2px}
nav.programme-tabs a{color:var(--ink);text-decoration:none;padding:6px 14px 5px;border-bottom:3px solid transparent;margin-bottom:-1px;font-size:15px}
nav.programme-tabs a:hover{background:var(--sunk)}
nav.programme-tabs a[aria-current="page"]{color:var(--accent);border-bottom-color:var(--accent);font-weight:700}
p.programme-more{display:flex;flex-wrap:wrap;gap:4px 14px;margin:0 0 6px auto;font-size:13.5px}
p.source{margin:0 0 10px;font-size:13.5px;color:var(--muted)}
td.name .item-name{font-weight:600}
tr.is-suspended td{color:var(--muted)}
tr.is-suspended .item-name{text-decoration:line-through}
/* position: the hidden words of each half are absolute; the cell holds them inside the scrolling table on a phone */
td.gantt{position:relative;white-space:nowrap;line-height:1}
th.gantt-head .gantt-years{display:flex;margin-top:2px;font-size:11px;font-weight:400;color:var(--muted)}
th.gantt-head .gantt-years span{width:33px}
.half{display:inline-block;width:14px;height:18px;margin-right:1px;vertical-align:middle;border:1px solid var(--line);
  border-radius:3px;background:var(--sunk)}
.half:nth-child(2n){margin-right:4px}
.half[data-status="已執行"]{background:var(--accent);border-color:var(--accent)}
.half[data-status="規劃中"]{background:var(--accent-soft);border:1px dashed var(--accent)}
.half[data-status="暫緩"]{border-color:var(--bad);
  background:repeating-linear-gradient(45deg,var(--bad) 0 2px,var(--bad-soft) 2px 5px)}
/* The legend of the half-year cells, and the tab 法科進度表 with one column a half year (2026-12-02). */
ul.gantt-legend{list-style:none;display:flex;flex-wrap:wrap;gap:4px 16px;margin:0 0 8px;padding:0;font-size:13.5px;color:var(--muted)}
ul.gantt-legend li{display:flex;align-items:center;gap:6px}
ul.gantt-legend .half,td.half-cell .half{margin-right:0}
th.half-head{white-space:nowrap;text-align:center;font-size:12.5px}
td.half-cell{position:relative;text-align:center;padding-left:3px;padding-right:3px}
/* 本次更新開發月數 with the hidden reason of an empty value (2026-12-02): positioned, as td.half-cell */
td.months{position:relative}
/* The tab 法科 (2026-12-03), with the width types of programmes/law_columns.py. A short value stays on one line. A
   header longer than six characters wraps (head-wrap), at least four characters a line: an empty block of that width
   holds the line, because a table that overflows its box squeezes the width and the min-width of a cell. The block
   holds the header of a long text too: an empty column of long text is one character wide. A long text
   wraps in a box as wide as the text, at most 18 characters (16 for 品項名). 編號 and 品項名 stay on the left while
   the table scrolls sideways; 編號 has a fixed width, so 品項名 knows where to stay. */
table.law-table{--law-no-width:64px}
table.law-table th.head-wrap{white-space:normal}
table.law-table th.head-wrap::before{content:"";display:block;width:4.5em}
table.law-table td.w-short{white-space:nowrap}
table.law-table .text-box{width:max-content;max-width:18em;white-space:normal}
table.law-table td.col-name .text-box{max-width:16em}
table.law-table .col-no{box-sizing:border-box;width:var(--law-no-width);min-width:var(--law-no-width);max-width:var(--law-no-width)}
table.law-table .stick-1,table.law-table .stick-2{position:sticky;z-index:1;background:var(--surface);box-shadow:inset -1px 0 0 var(--line)}
table.law-table th.stick-1,table.law-table th.stick-2{z-index:2;background:var(--sunk)}
table.law-table .stick-1{left:0}
table.law-table .stick-2{left:var(--law-no-width)}
@media (max-width:760px){
  table.law-table .text-box{max-width:12em}
  table.law-table td.col-name .text-box{max-width:9em}
}
ul.programme-links{list-style:none;margin:0;padding:0;display:inline}
ul.programme-links li{margin:0 0 2px}
.flag{display:inline-block;min-width:1.1em;font-weight:700}
.tag.tag-lenient{border-color:var(--navy);color:var(--navy);background:var(--navy-soft)}
.tag.tag-other{border-color:var(--line);color:var(--muted);background:var(--sunk)}
section.programme-case{margin:0 0 22px}
.case-head{display:flex;flex-wrap:wrap;gap:2px 18px;align-items:baseline}
.case-head h3{margin:14px 0 2px}
.case-company{font-weight:400;color:var(--muted);margin-left:6px}
dl.case-facts{display:flex;flex-wrap:wrap;gap:2px 18px;margin:0;font-size:13.5px}
dl.case-facts div{display:flex;gap:6px}
dl.case-facts dt{color:var(--muted)}
dl.case-facts dd{margin:0}
p.note{margin:6px 0 2px;padding:6px 10px;font-size:13.5px;background:var(--warn-soft);border-left:3px solid var(--warn);border-radius:6px}
form.note-remove{margin:0 0 6px}
details.note-add{margin:6px 0;font-size:13.5px}
details.note-add summary{cursor:pointer;color:var(--accent);font-weight:600}
details.note-add form{display:grid;gap:6px;max-width:32rem;margin-top:6px}
details.note-add label{display:flex;flex-direction:column;gap:2px;color:var(--muted)}
details.note-add textarea,details.note-add input{font:inherit;color:var(--ink);background:var(--surface);border:1px solid var(--muted);border-radius:6px;padding:4px 8px}
details.note-add button{justify-self:start}
.programme-statistics{margin-top:30px;padding-top:6px;border-top:2px solid var(--line)}
.statistic-lead{max-width:60rem;color:var(--muted);font-size:14px}
.statistic-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,440px),1fr));gap:14px;margin:10px 0 18px}
section.statistic-block{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:10px 14px 6px;min-width:0}
/* the foot, the case table and the kinds of its groups have eight to ten columns: they take the whole width */
section.statistic-block[data-key$=".foot"],section.statistic-block[data-key$=".cases"],
section.statistic-block[data-key$=".case_kinds"]{grid-column:1/-1}
section.statistic-block h4{margin:0 0 6px}
section.statistic-block .tablewrap{margin:6px 0 8px}
table.statistic-table{font-variant-numeric:tabular-nums}
table.statistic-table th{white-space:normal;font-size:12.5px;line-height:1.4}
/* The column headers and the numbers are centred, so a header stands over its number (2026-12-03); the row headers
   stay on the left. */
table.statistic-table th[scope="col"]{text-align:center}
table.statistic-table th[scope="row"]{white-space:nowrap}
table.statistic-table td{text-align:center;white-space:nowrap}
table.statistic-table td.differs{background:var(--warn-soft)}
table.statistic-table span.excel{display:block;font-size:11.5px;line-height:1.3;color:var(--warn);font-weight:600}
table.statistic-table div.cell-note{max-width:16em;margin:0 auto;text-align:left;white-space:normal}
table.statistic-table div.cell-note p.note{font-size:11.5px;padding:3px 6px;margin:4px 0 2px}
table.statistic-table div.cell-note form.note-remove{margin:0}
p.statistic-note{margin:0 0 6px;font-size:12.5px;color:var(--muted)}
table.differences{min-width:720px}
table.differences td:first-child{white-space:normal;min-width:16em}
table.differences td.num{text-align:right}
details.excel-others{margin:8px 0 14px}
details.excel-others summary{cursor:pointer;color:var(--accent)}
.item-status{margin:-6px 0 10px;color:var(--muted)}
.admin-link{margin:0 0 10px}
details.history-box summary{cursor:pointer;color:var(--accent)}
section.related-pending ul,ul.version-items{margin:4px 0 14px;padding-left:1.4em}
form.pair-form{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0}
form.pair-form select{font:inherit;font-size:14px;color:var(--ink);background:var(--surface);border:1px solid var(--muted);border-radius:6px;padding:3px 6px;max-width:22rem}

@media (max-width:760px){
  .filters label,.filters input,.filters select{width:100%;max-width:none}
  dl.fields{grid-template-columns:1fr}
  dl.fields dt{border-bottom:none;padding-bottom:0}
  dl.tech-note{grid-template-columns:1fr;gap:0}
  dl.tech-note dd{margin:0 0 6px}
}
