/*!
 * ui-template · theme-soft.css (bundled)
 * version: 1.0.0 · built: 2026-08-16
 * 內含:tokens/soft.css + css/ui.css + css/utilities.css
 * 來源:C:\Users\ryan.yeh\git\ui-template(vendored 快照,更新請重新複製)
 */
/* ============================================================
   ui-template · Theme: Soft
   友善圓潤:大圓角、暖色、寬鬆密度、柔和陰影。
   Token 契約見 tokens/corporate.css。
   ============================================================ */

:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

:root {
  --font-body: "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-heading: var(--font-body);
  --font-mono: "Cascadia Code", Consolas, "Microsoft JhengHei", monospace;

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 21px;
  --fs-2xl: 28px;
  --leading: 1.65;
  --heading-weight: 700;
  --heading-transform: none;
  --heading-tracking: -0.015em;

  --space-1: 5px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 20px;
  --space-5: 28px;
  --space-6: 40px;
  --space-7: 56px;
  --space-8: 72px;
  --panel-pad: 22px;

  --control-h: 40px;
  --control-pad-x: 18px;
  --control-fs: var(--fs-md);
  --control-radius: var(--radius-full);   /* 藥丸型按鈕/輸入框 */

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --border-w: 1px;

  --body-bg: var(--surface-0);
  --surface-0: light-dark(#faf6f1, #201b17);
  --surface-1: light-dark(#fffdfa, #2a2420);
  --surface-2: light-dark(#f6efe7, #332c27);
  --surface-3: light-dark(#efe6db, #3c342d);
  --text-1: light-dark(#3d332c, #f0e9e2);
  --text-2: light-dark(#6f6259, #c0b3a8);
  --text-3: light-dark(#a3958a, #8a7d72);
  --border-1: light-dark(#eadfd3, #463c34);
  --border-2: light-dark(#d9cbbc, #57493f);

  --color-primary: light-dark(#d96f4e, #e88a6b);
  --color-primary-hover: light-dark(#c65f40, #ee9d82);
  --color-on-primary: light-dark(#ffffff, #33160c);
  --color-primary-soft: light-dark(#fbe9e2, #43291f);
  --color-primary-soft-text: light-dark(#b85636, #f0a98f);

  --color-success: light-dark(#5f9e6e, #83bd92);
  --color-success-soft: light-dark(#e9f3ec, #26352a);
  --color-success-soft-text: light-dark(#448053, #a4d4b1);

  --color-warning: light-dark(#c98f2b, #dcab52);
  --color-warning-soft: light-dark(#faf1de, #3d331e);
  --color-warning-soft-text: light-dark(#a1701c, #e7c07a);

  --color-danger: light-dark(#cf4f3f, #e07566);
  --color-danger-hover: light-dark(#b8422f, #e78d80);
  --color-on-danger: light-dark(#ffffff, #360e08);
  --color-danger-soft: light-dark(#fae7e4, #43231e);
  --color-danger-soft-text: light-dark(#ad3d2e, #efa094);

  --color-info: light-dark(#5b87b0, #82a9cc);
  --color-info-soft: light-dark(#e8f0f7, #253039);
  --color-info-soft-text: light-dark(#446e96, #a3c4e0);

  --color-neutral-soft: light-dark(#f1e9df, #3a322b);
  --color-neutral-soft-text: light-dark(#6f6259, #c0b3a8);

  --focus-ring: light-dark(#d96f4e, #e88a6b);

  --sidebar-bg: var(--surface-1);
  --sidebar-text: var(--text-2);
  --sidebar-text-active: light-dark(#b85636, #f0a98f);
  --sidebar-item-hover: light-dark(#f6efe7, #332c27);
  --sidebar-item-active: light-dark(#fbe9e2, #43291f);
  --sidebar-border: var(--border-1);
  --topbar-bg: var(--surface-1);

  --shadow-1: 0 2px 6px light-dark(rgb(61 51 44 / .07), rgb(0 0 0 / .4));
  --shadow-2: 0 8px 20px light-dark(rgb(61 51 44 / .10), rgb(0 0 0 / .5));
  --shadow-3: 0 20px 48px light-dark(rgb(61 51 44 / .16), rgb(0 0 0 / .6));
  --surface-blur: none;
  --backdrop: light-dark(rgb(61 51 44 / .4), rgb(0 0 0 / .55));
  --transition: 180ms ease;
}

/* ============================================================
   ui-template · ui.css(元件樣式,主題無關)
   只讀取 tokens/<theme>.css 定義的語意變數,不含任何主題色值。
   命名:.block__element / .block--modifier
   瀏覽器基線:Evergreen(2024+)
   ============================================================ */

/* ------------------------------------------------------------
   1. Reset & Base
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}

body {
  margin: 0;
  background: var(--body-bg);
  background-attachment: fixed;
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  text-transform: var(--heading-transform);
  line-height: 1.25;
  color: var(--text-1);
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4, h5, h6 { font-size: var(--fs-md); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

hr { border: none; border-top: var(--border-w) solid var(--border-1); margin: var(--space-4) 0; }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

kbd {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  background: var(--surface-2);
  border: var(--border-w) solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  padding: 1px 6px;
}

small { font-size: var(--fs-sm); color: var(--text-3); }

img { max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

::selection { background: var(--color-primary); color: var(--color-on-primary); }

:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------
   2. App Shell(layout recipe:頁面本身永不出現捲軸)
   結構:.app-shell > .sidebar + .topbar + .main
   唯一捲動區是 .main(或其中明確標記的容器)
   ------------------------------------------------------------ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w, 248px) 1fr;
  grid-template-rows: auto 1fr;
  height: 100dvh;
  overflow: hidden;
}

.app-shell[data-sidebar="collapsed"] {
  grid-template-columns: var(--sidebar-w-collapsed, 64px) 1fr;
}

.main {
  grid-column: 2;
  overflow: auto;
  padding: var(--space-5);
}

/* Topbar */
.topbar {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 56px;
  padding-inline: var(--space-4);
  background: var(--topbar-bg);
  border-bottom: var(--border-w) solid var(--border-1);
  backdrop-filter: var(--surface-blur);
  z-index: 10;
}
.topbar__title { font-weight: 600; font-size: var(--fs-lg); }

/* Sidebar */
.sidebar {
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: var(--border-w) solid var(--sidebar-border);
  backdrop-filter: var(--surface-blur);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 var(--space-4);
  flex-shrink: 0;
  font-weight: 700;
  font-size: var(--fs-lg);
  color: var(--sidebar-text-active);
  border-bottom: var(--border-w) solid var(--sidebar-border);
  white-space: nowrap;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__group {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--sidebar-text) 65%, transparent);
  padding: var(--space-3) 10px 4px;
  white-space: nowrap;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.sidebar__item:hover {
  background: var(--sidebar-item-hover);
  color: var(--sidebar-text-active);
  text-decoration: none;
}
.sidebar__item.is-active {
  background: var(--sidebar-item-active);
  color: var(--sidebar-text-active);
  font-weight: 600;
}

.sidebar__icon { width: 20px; text-align: center; flex-shrink: 0; }
.sidebar__label { overflow: hidden; text-overflow: ellipsis; }

.sidebar__footer {
  padding: var(--space-3);
  border-top: var(--border-w) solid var(--sidebar-border);
  flex-shrink: 0;
  white-space: nowrap;
}

/* 收合狀態:只留 icon */
.app-shell[data-sidebar="collapsed"] .sidebar__label,
.app-shell[data-sidebar="collapsed"] .sidebar__group { display: none; }
.app-shell[data-sidebar="collapsed"] .sidebar__item { justify-content: center; padding: 8px; }
.app-shell[data-sidebar="collapsed"] .sidebar__brand { justify-content: center; padding: 0; }
.app-shell[data-sidebar="collapsed"] .sidebar__footer { text-align: center; }

/* 頁面容器與頁首 */
.container {
  width: 100%;
  max-width: var(--container-max, 1160px);
  margin-inline: auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.page-header h1, .page-header h2 { margin: 0; }
.page-header__sub { color: var(--text-3); font-size: var(--fs-sm); margin-top: 4px; }

/* ------------------------------------------------------------
   3. Button
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-h);
  padding-inline: var(--control-pad-x);
  border: var(--border-w) solid var(--border-2);
  border-radius: var(--control-radius);
  background: var(--surface-1);
  color: var(--text-1);
  font-size: var(--control-fs);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

.btn--primary {
  background: var(--color-primary);
  border-color: transparent;
  color: var(--color-on-primary);
}
.btn--primary:hover { background: var(--color-primary-hover); }

.btn--danger {
  background: var(--color-danger);
  border-color: transparent;
  color: var(--color-on-danger);
}
.btn--danger:hover { background: var(--color-danger-hover); }

.btn--outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn--outline:hover { background: var(--color-primary-soft); }

.btn--soft {
  background: var(--color-primary-soft);
  border-color: transparent;
  color: var(--color-primary-soft-text);
}
.btn--soft:hover { background: color-mix(in srgb, var(--color-primary-soft) 80%, var(--color-primary)); }

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--text-1); }

.btn--sm {
  height: calc(var(--control-h) - 6px);
  padding-inline: calc(var(--control-pad-x) - 4px);
  font-size: var(--fs-sm);
}
.btn--lg {
  height: calc(var(--control-h) + 8px);
  padding-inline: calc(var(--control-pad-x) + 6px);
  font-size: var(--fs-lg);
}

.btn--icon { width: var(--control-h); padding: 0; flex-shrink: 0; }
.btn--sm.btn--icon { width: calc(var(--control-h) - 6px); }

/* 載入中:<button class="btn btn--primary" aria-busy="true"> */
.btn[aria-busy="true"] {
  pointer-events: none;
  position: relative;
  color: transparent;
}
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 1em;
  height: 1em;
  border: 2px solid color-mix(in srgb, currentColor 30%, var(--text-3));
  border-top-color: var(--text-1);
  border-radius: 50%;
  animation: ui-spin 0.7s linear infinite;
}
.btn--primary[aria-busy="true"]::after,
.btn--danger[aria-busy="true"]::after {
  border-color: color-mix(in srgb, var(--color-on-primary) 35%, transparent);
  border-top-color: var(--color-on-primary);
}

/* ------------------------------------------------------------
   4. Card
   ------------------------------------------------------------ */
.card {
  background: var(--surface-1);
  border: var(--border-w) solid var(--border-1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  backdrop-filter: var(--surface-blur);
}

.card--flat { box-shadow: none; }

.card--hover { transition: box-shadow var(--transition), transform var(--transition); }
.card--hover:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: calc(var(--panel-pad) * 0.75) var(--panel-pad);
  border-bottom: var(--border-w) solid var(--border-1);
  font-weight: 600;
}
.card__body { padding: var(--panel-pad); }
.card__footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: calc(var(--panel-pad) * 0.75) var(--panel-pad);
  border-top: var(--border-w) solid var(--border-1);
}

/* ------------------------------------------------------------
   5. Table
   標準用法:<div class="table-wrap"><table class="table">…</table></div>
   高度自適應 recipe:父層 .col.fill 鏈 + .table-wrap.fill,
   或 style="--table-max-h: 60dvh" 指定上限。
   ------------------------------------------------------------ */
.table-wrap {
  overflow: auto;
  background: var(--surface-1);
  border: var(--border-w) solid var(--border-1);
  border-radius: var(--radius-md);
  max-height: var(--table-max-h, none);
  backdrop-filter: var(--surface-blur);
}

.table {
  width: 100%;
  border-collapse: separate; /* sticky header 的邊框需要 separate */
  border-spacing: 0;
  font-size: var(--fs-md);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  backdrop-filter: var(--surface-blur);
  text-align: left;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--border-w) solid var(--border-2);
  white-space: nowrap;
}

.table td {
  padding: var(--space-2) var(--space-3);
  border-top: var(--border-w) solid var(--border-1);
  vertical-align: middle;
}
.table tbody tr:first-child td { border-top: none; }

.table tr[aria-selected="true"] td { background: var(--color-primary-soft); }

.table--striped tbody tr:nth-child(even) td { background: var(--surface-2); }
.table--hover tbody tr:hover td { background: var(--surface-3); }
.table--compact thead th, .table--compact td { padding: var(--space-1) var(--space-2); }

/* ------------------------------------------------------------
   6. Forms
   標準結構:
   <div class="field">
     <label class="label" for="x">名稱 <span class="req">*</span></label>
     <input class="input" id="x" aria-invalid="true" aria-describedby="x-err">
     <p class="hint">說明文字</p>
     <p class="error" id="x-err">錯誤訊息</p>
   </div>
   ------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field--inline { flex-direction: row; align-items: center; gap: var(--space-3); }

.label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-1); }
.label .req { color: var(--color-danger); }

.input, .select, .textarea {
  width: 100%;
  height: var(--control-h);
  padding-inline: var(--control-pad-x);
  background: var(--surface-1);
  color: var(--text-1);
  border: var(--border-w) solid var(--border-2);
  border-radius: var(--control-radius);
  font-size: var(--control-fs);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.textarea { height: auto; min-height: calc(var(--control-h) * 2.2); padding-block: var(--space-2); resize: vertical; line-height: var(--leading); }

.input::placeholder, .textarea::placeholder { color: var(--text-3); }

.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: -1px;
  border-color: transparent;
}

.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--color-danger);
}
.input[aria-invalid="true"]:focus, .select[aria-invalid="true"]:focus, .textarea[aria-invalid="true"]:focus {
  outline-color: var(--color-danger);
}

.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--surface-2);
  color: var(--text-3);
  cursor: not-allowed;
}

.select {
  appearance: none;
  padding-right: calc(var(--control-pad-x) + 20px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23888888' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right calc(var(--control-pad-x) - 2px) center;
}

.hint { margin: 0; font-size: var(--fs-xs); color: var(--text-3); }
.error { margin: 0; font-size: var(--fs-xs); color: var(--color-danger); font-weight: 500; }

/* Checkbox / Radio:<label class="choice"><input type="checkbox"> 標籤</label> */
.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: var(--fs-md);
}
.choice input[type="checkbox"], .choice input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* Switch:<label class="choice"><input type="checkbox" class="switch"> 標籤</label> */
input[type="checkbox"].switch {
  appearance: none;
  width: 40px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--border-2);
  border: none;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
input[type="checkbox"].switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--surface-1);
  box-shadow: var(--shadow-1);
  transition: translate var(--transition);
}
input[type="checkbox"].switch:checked { background: var(--color-primary); }
input[type="checkbox"].switch:checked::before { translate: 18px 0; }

/* Input group:<div class="input-group"><span class="input-group__addon">…</span><input class="input">…</div> */
.input-group { display: flex; width: 100%; }
.input-group > * { border-radius: 0; }
.input-group > *:not(:first-child) { margin-left: calc(var(--border-w) * -1); }
.input-group > *:first-child { border-start-start-radius: var(--control-radius); border-end-start-radius: var(--control-radius); }
.input-group > *:last-child { border-start-end-radius: var(--control-radius); border-end-end-radius: var(--control-radius); }
.input-group .input:focus, .input-group .select:focus { position: relative; z-index: 1; }
.input-group__addon {
  display: inline-flex;
  align-items: center;
  height: var(--control-h);
  padding-inline: var(--space-3);
  background: var(--surface-2);
  border: var(--border-w) solid var(--border-2);
  color: var(--text-3);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.fieldset {
  border: var(--border-w) solid var(--border-1);
  border-radius: var(--radius-md);
  padding: var(--panel-pad);
  margin: 0;
  min-width: 0;
}
.fieldset legend {
  padding-inline: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}
.form-grid .span-2 { grid-column: span 2; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-4);
}

/* ------------------------------------------------------------
   7. Badge
   ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--color-neutral-soft);
  color: var(--color-neutral-soft-text);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.badge--primary { background: var(--color-primary-soft); color: var(--color-primary-soft-text); }
.badge--success { background: var(--color-success-soft); color: var(--color-success-soft-text); }
.badge--warning { background: var(--color-warning-soft); color: var(--color-warning-soft-text); }
.badge--danger  { background: var(--color-danger-soft);  color: var(--color-danger-soft-text); }
.badge--info    { background: var(--color-info-soft);    color: var(--color-info-soft-text); }
.badge--dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   8. Stat / KPI(通常放在 .card__body 內)
   ------------------------------------------------------------ */
.stat__label { font-size: var(--fs-sm); color: var(--text-3); margin-bottom: 4px; }
.stat__value {
  font-size: var(--fs-2xl);
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: var(--heading-tracking);
  line-height: 1.15;
}
.stat__delta { font-size: var(--fs-sm); font-weight: 600; margin-top: 4px; }
.stat__delta--up { color: var(--color-success); }
.stat__delta--up::before { content: "▲ "; font-size: 0.75em; }
.stat__delta--down { color: var(--color-danger); }
.stat__delta--down::before { content: "▼ "; font-size: 0.75em; }

/* ------------------------------------------------------------
   9. Empty state
   ------------------------------------------------------------ */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-2);
  padding: var(--space-7) var(--space-5);
  color: var(--text-3);
}
.empty__icon { font-size: 40px; line-height: 1; opacity: 0.65; margin-bottom: var(--space-2); }
.empty__title { margin: 0; font-size: var(--fs-lg); color: var(--text-2); }
.empty__desc { margin: 0; max-width: 44ch; font-size: var(--fs-sm); }
.empty .btn { margin-top: var(--space-3); }

/* ------------------------------------------------------------
   10. Pagination
   ------------------------------------------------------------ */
.pagination { display: flex; align-items: center; gap: 4px; }
.pagination__btn {
  min-width: calc(var(--control-h) - 4px);
  height: calc(var(--control-h) - 4px);
  padding-inline: var(--space-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--border-w) solid transparent;
  border-radius: var(--control-radius);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-sm);
  transition: background var(--transition), color var(--transition);
}
.pagination__btn:hover { background: var(--surface-2); color: var(--text-1); }
.pagination__btn[aria-current="page"] {
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 600;
}
.pagination__btn:disabled { opacity: 0.4; pointer-events: none; }
.pagination__ellipsis { color: var(--text-3); padding-inline: 4px; }

/* ------------------------------------------------------------
   11. Modal / Drawer(原生 <dialog>)
   開關:data-modal-open="id" / data-modal-close,或 UI.modal.open(id)
   Drawer = <dialog class="modal modal--drawer">
   ------------------------------------------------------------ */
dialog.modal {
  border: none;
  padding: 0;
  margin: auto;
  background: var(--surface-1);
  color: var(--text-1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  width: min(560px, calc(100vw - 32px));
  max-height: min(85dvh, 720px);
  display: flex;
  flex-direction: column;
  backdrop-filter: var(--surface-blur);
}
dialog.modal:not([open]) { display: none; }
dialog.modal::backdrop { background: var(--backdrop, rgb(0 0 0 / 0.45)); }

.modal--sm { width: min(400px, calc(100vw - 32px)); }
.modal--lg { width: min(760px, calc(100vw - 32px)); }

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: calc(var(--panel-pad) * 0.75) var(--panel-pad);
  border-bottom: var(--border-w) solid var(--border-1);
  flex-shrink: 0;
}
.modal__header h2, .modal__header h3 { margin: 0; font-size: var(--fs-lg); }

.modal__body { padding: var(--panel-pad); overflow-y: auto; }

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: calc(var(--panel-pad) * 0.75) var(--panel-pad);
  border-top: var(--border-w) solid var(--border-1);
  flex-shrink: 0;
}

/* Drawer(右側滑出;--drawer-left 左側) */
dialog.modal--drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  height: 100dvh;
  max-height: 100dvh;
  width: min(420px, 92vw);
  border-radius: 0;
}
dialog.modal--drawer-left { inset: 0 auto 0 0; }

/* 開啟動畫 */
dialog.modal[open] {
  opacity: 1;
  transition: opacity var(--transition), translate var(--transition);
}
@starting-style {
  dialog.modal[open] { opacity: 0; translate: 0 8px; }
  dialog.modal--drawer[open] { opacity: 0; translate: 24px 0; }
  dialog.modal--drawer-left[open] { opacity: 0; translate: -24px 0; }
}

/* ------------------------------------------------------------
   12. Toast(由 ui.js 建立;容器 .toast-region 自動生成)
   ------------------------------------------------------------ */
.toast-region {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  display: grid;
  gap: var(--space-2);
  z-index: 60;
  width: min(340px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--surface-1);
  color: var(--text-1);
  border: var(--border-w) solid var(--border-1);
  border-left: 3px solid var(--color-info);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  backdrop-filter: var(--surface-blur);
  animation: ui-toast-in 200ms ease;
}
.toast--success { border-left-color: var(--color-success); }
.toast--warning { border-left-color: var(--color-warning); }
.toast--danger  { border-left-color: var(--color-danger); }

.toast__content { flex: 1; min-width: 0; }
.toast__title { font-weight: 600; font-size: var(--fs-sm); }
.toast__msg { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }
.toast__close {
  border: none;
  background: transparent;
  color: var(--text-3);
  padding: 0 2px;
  font-size: var(--fs-md);
  line-height: 1;
}
.toast__close:hover { color: var(--text-1); }

@keyframes ui-toast-in {
  from { opacity: 0; translate: 12px 0; }
  to   { opacity: 1; translate: 0 0; }
}

/* ------------------------------------------------------------
   13. Loading:Spinner / Skeleton
   ------------------------------------------------------------ */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: ui-spin 0.7s linear infinite;
  vertical-align: -3px;
}
.spinner--lg { width: 28px; height: 28px; border-width: 3px; }

@keyframes ui-spin { to { transform: rotate(360deg); } }

.skeleton {
  display: block;
  min-height: 1em;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: ui-shimmer 1.4s ease infinite;
  color: transparent;
  user-select: none;
}
.skeleton--text { height: 0.9em; margin-block: 0.25em; }
.skeleton--circle { border-radius: 50%; aspect-ratio: 1; min-height: 0; }

@keyframes ui-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ------------------------------------------------------------
   14. Alert / Banner
   ------------------------------------------------------------ */
.alert {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-info-soft);
  color: var(--color-info-soft-text);
  border: var(--border-w) solid color-mix(in srgb, currentColor 25%, transparent);
  font-size: var(--fs-sm);
}
.alert--success { background: var(--color-success-soft); color: var(--color-success-soft-text); }
.alert--warning { background: var(--color-warning-soft); color: var(--color-warning-soft-text); }
.alert--danger  { background: var(--color-danger-soft);  color: var(--color-danger-soft-text); }

.alert__icon { flex-shrink: 0; line-height: var(--leading); }
.alert__content { flex: 1; min-width: 0; }
.alert__title { display: block; font-weight: 700; margin-bottom: 2px; }
.alert__close {
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  padding: 0 2px;
  line-height: 1;
  font-size: var(--fs-md);
}
.alert__close:hover { opacity: 1; }

/* ------------------------------------------------------------
   15. Tooltip(純 CSS:<button data-tip="說明文字">)
   位置變化:.tip-bottom / .tip-left / .tip-right
   ------------------------------------------------------------ */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  translate: -50% 0;
  width: max-content;
  max-width: 240px;
  padding: 5px 10px;
  background: var(--text-1);
  color: var(--surface-0);
  font-size: var(--fs-xs);
  font-weight: 400;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: normal;
  white-space: pre-line;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 50;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; }

.tip-bottom::after { bottom: auto; top: calc(100% + 8px); }
.tip-right::after { bottom: auto; left: calc(100% + 8px); top: 50%; translate: 0 -50%; }
.tip-left::after { bottom: auto; left: auto; right: calc(100% + 8px); top: 50%; translate: 0 -50%; }

/* ------------------------------------------------------------
   16. Progress(原生 <progress class="progress" max value>)
   ------------------------------------------------------------ */
.progress {
  appearance: none;
  width: 100%;
  height: 8px;
  border: none;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--surface-3);
}
.progress::-webkit-progress-bar { background: var(--surface-3); }
.progress::-webkit-progress-value {
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition);
}
.progress::-moz-progress-bar { background: var(--color-primary); border-radius: var(--radius-full); }

.progress--sm { height: 4px; }
.progress--lg { height: 12px; }
.progress--success::-webkit-progress-value { background: var(--color-success); }
.progress--success::-moz-progress-bar { background: var(--color-success); }
.progress--warning::-webkit-progress-value { background: var(--color-warning); }
.progress--warning::-moz-progress-bar { background: var(--color-warning); }
.progress--danger::-webkit-progress-value { background: var(--color-danger); }
.progress--danger::-moz-progress-bar { background: var(--color-danger); }

/* ------------------------------------------------------------
   17. Tabs(ui.js 負責切換與鍵盤操作)
   ------------------------------------------------------------ */
.tabs__list {
  display: flex;
  gap: 4px;
  border-bottom: var(--border-w) solid var(--border-1);
  overflow-x: auto;
}
.tabs__tab {
  padding: 10px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: calc(var(--border-w) * -1);
  background: transparent;
  color: var(--text-2);
  font-weight: 500;
  font-size: var(--fs-md);
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.tabs__tab:hover { color: var(--text-1); }
.tabs__tab[aria-selected="true"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}
.tabs__panel { padding-top: var(--space-4); }

/* 藥丸型:<div class="tabs tabs--pills"> */
.tabs--pills .tabs__list { border-bottom: none; gap: var(--space-2); }
.tabs--pills .tabs__tab {
  border: var(--border-w) solid transparent;
  border-radius: var(--control-radius);
  margin-bottom: 0;
  padding: 8px 14px;
}
.tabs--pills .tabs__tab[aria-selected="true"] {
  background: var(--color-primary-soft);
  color: var(--color-primary-soft-text);
  border-color: transparent;
}

/* ------------------------------------------------------------
   18. Breadcrumbs
   ------------------------------------------------------------ */
.breadcrumbs ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--fs-sm);
}
.breadcrumbs li { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.breadcrumbs li + li::before { content: "›"; color: var(--text-3); }
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs [aria-current="page"] { color: var(--text-1); font-weight: 600; }

/* ------------------------------------------------------------
   19. Dropdown menu(原生 <details>;ui.js 補外點關閉/Esc)
   <details class="dropdown"><summary class="btn">操作</summary>
     <div class="menu">…</div></details>
   ------------------------------------------------------------ */
.dropdown { position: relative; display: inline-block; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::after { content: " ▾"; font-size: 0.8em; opacity: 0.7; }

.menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  padding: 6px;
  display: grid;
  background: var(--surface-1);
  border: var(--border-w) solid var(--border-1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  backdrop-filter: var(--surface-blur);
  z-index: 30;
}
.dropdown--end .menu { left: auto; right: 0; }

.menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-1);
  font-size: var(--fs-sm);
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}
.menu__item:hover { background: var(--surface-2); text-decoration: none; }
.menu__item--danger { color: var(--color-danger); }
.menu__item--danger:hover { background: var(--color-danger-soft); }
.menu__sep { border: none; border-top: var(--border-w) solid var(--border-1); margin: 6px 4px; }

/* ------------------------------------------------------------
   20. Accordion(原生 <details>;同組互斥用 name="…")
   ------------------------------------------------------------ */
.accordion {
  background: var(--surface-1);
  border: var(--border-w) solid var(--border-1);
  border-radius: var(--radius-md);
  backdrop-filter: var(--surface-blur);
}
.accordion__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.accordion__summary::-webkit-details-marker { display: none; }
.accordion__summary::after {
  content: "▾";
  color: var(--text-3);
  transition: rotate var(--transition);
}
.accordion[open] > .accordion__summary::after { rotate: 180deg; }
.accordion__body { padding: 0 var(--space-4) var(--space-4); color: var(--text-2); }

.accordion-group { display: grid; }
.accordion-group .accordion { border-radius: 0; }
.accordion-group .accordion:not(:first-child) { border-top: none; }
.accordion-group .accordion:first-child {
  border-start-start-radius: var(--radius-md);
  border-start-end-radius: var(--radius-md);
}
.accordion-group .accordion:last-child {
  border-end-start-radius: var(--radius-md);
  border-end-end-radius: var(--radius-md);
}

/* ------------------------------------------------------------
   21. Avatar
   ------------------------------------------------------------ */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary-soft);
  color: var(--color-primary-soft-text);
  font-size: var(--fs-sm);
  font-weight: 600;
  object-fit: cover;
  flex-shrink: 0;
  overflow: hidden;
  user-select: none;
}
.avatar--sm { width: 28px; height: 28px; font-size: var(--fs-xs); }
.avatar--lg { width: 48px; height: 48px; font-size: var(--fs-lg); }

.avatar-group { display: inline-flex; }
.avatar-group .avatar {
  border: 2px solid var(--surface-1);
  margin-left: -8px;
}
.avatar-group .avatar:first-child { margin-left: 0; }

/* ------------------------------------------------------------
   22. Code block
   ------------------------------------------------------------ */
.codeblock {
  margin: 0;
  background: var(--surface-1);
  border: var(--border-w) solid var(--border-1);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.codeblock__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 6px 6px 6px var(--space-4);
  background: var(--surface-2);
  border-bottom: var(--border-w) solid var(--border-1);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.codeblock__pre {
  margin: 0;
  padding: var(--space-4);
  overflow: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--text-1);
}
.codeblock__pre code { background: none; border: none; padding: 0; font-size: inherit; }

/* ------------------------------------------------------------
   23. Description list
   ------------------------------------------------------------ */
.dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: var(--space-5);
  row-gap: var(--space-2);
  margin: 0;
}
.dl dt { color: var(--text-3); font-size: var(--fs-sm); padding-block: 2px; }
.dl dd { margin: 0; color: var(--text-1); min-width: 0; }

.dl--bordered { row-gap: 0; }
.dl--bordered dt, .dl--bordered dd {
  border-top: var(--border-w) solid var(--border-1);
  padding-block: var(--space-2);
}
.dl--bordered > *:nth-child(-n+2) { border-top: none; }

/* ------------------------------------------------------------
   24. Kanban(拖拉由 ui.js 處理;.kanban.fill 撐滿剩餘高度)
   ------------------------------------------------------------ */
.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 320px);
  gap: var(--space-3);
  overflow-x: auto;
  align-items: stretch;
  padding-bottom: var(--space-2);
}

.kanban__col {
  display: flex;
  flex-direction: column;
  max-height: 100%;
  min-height: 0;
  background: var(--surface-2);
  border: var(--border-w) solid var(--border-1);
  border-radius: var(--radius-md);
  backdrop-filter: var(--surface-blur);
}

.kanban__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  flex-shrink: 0;
}

.kanban__body {
  flex: 1;
  min-height: 60px;
  overflow-y: auto;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.kanban__body.is-over {
  outline: 2px dashed var(--color-primary);
  outline-offset: -4px;
  background: var(--color-primary-soft);
}

.kanban__card {
  background: var(--surface-1);
  border: var(--border-w) solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  box-shadow: var(--shadow-1);
  cursor: grab;
}
.kanban__card:active { cursor: grabbing; }
.kanban__card.is-dragging { opacity: 0.45; }
.kanban__card-title { font-size: var(--fs-sm); font-weight: 500; }
.kanban__card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* ------------------------------------------------------------
   25. RWD(desktop-first;960px sidebar off-canvas、640px 堆疊)
   ------------------------------------------------------------ */
@media (max-width: 960px) {
  .app-shell,
  .app-shell[data-sidebar="collapsed"] { grid-template-columns: 1fr; }
  .topbar, .main { grid-column: 1; }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 45;
    width: var(--sidebar-w, 248px);
    translate: -100% 0;
    transition: translate 200ms ease;
  }
  .app-shell[data-sidebar="open"] .sidebar { translate: 0 0; box-shadow: var(--shadow-3); }
  .app-shell[data-sidebar="open"]::after {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--backdrop);
    z-index: 44;
  }
  /* 收合規則在行動版不適用 */
  .app-shell[data-sidebar="collapsed"] .sidebar__label,
  .app-shell[data-sidebar="collapsed"] .sidebar__group { display: revert; }
  .app-shell[data-sidebar="collapsed"] .sidebar__item { justify-content: flex-start; padding: 8px 10px; }
}

@media (max-width: 640px) {
  .main { padding: var(--space-3); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .dl { grid-template-columns: 1fr; row-gap: 0; }
  .dl dt { margin-top: var(--space-2); }
  .dl--bordered dd { border-top: none; padding-top: 0; }
  dialog.modal { width: calc(100vw - 24px); }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------------------
   26. Print(報表列印:強制 light、攤平捲動容器、隱藏 chrome)
   ------------------------------------------------------------ */
@media print {
  :root { color-scheme: light; }

  body { background: #fff !important; }

  .sidebar, .topbar, .toast-region, .no-print { display: none !important; }

  .app-shell { display: block; height: auto; overflow: visible; }
  .main { overflow: visible; height: auto; padding: 0; }

  .table-wrap {
    max-height: none !important;
    overflow: visible;
    box-shadow: none;
  }
  .table thead th { position: static; }

  .card, .codeblock, .kanban__col { box-shadow: none !important; backdrop-filter: none !important; }

  a { color: inherit; text-decoration: underline; }

  tr, .card, .kanban__card, .accordion { break-inside: avoid; }

  @page { margin: 14mm; }
}

/* ============================================================
   ui-template · utilities.css(少量排版工具 class)
   原則:元件外觀靠語意 class,排版微調靠這裡。
   間距對應 tokens 的 --space-N,故密度隨主題變化。
   ============================================================ */

/* ---- 垂直/水平排列 ---- */
.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-6); }

.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.col { display: flex; flex-direction: column; }

/* layout recipe 核心:讓子項佔滿剩餘空間並允許內部捲動 */
.fill { flex: 1 1 auto; min-height: 0; min-width: 0; }
.scroll-y { overflow-y: auto; min-height: 0; }
.scroll-x { overflow-x: auto; min-width: 0; }

.grow { flex-grow: 1; }
.shrink-0 { flex-shrink: 0; }
.ml-auto { margin-left: auto; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.flex-nowrap { flex-wrap: nowrap; }

/* ---- Grid ---- */
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---- 間距 ---- */
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); } .gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); } .gap-6 { gap: var(--space-6); }

.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); } .p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); } .p-5 { padding: var(--space-5); }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); } .mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); } .mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); } .mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); } .mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

/* ---- 文字 ---- */
.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-lg { font-size: var(--fs-lg); }
.text-muted { color: var(--text-3); }
.text-secondary { color: var(--text-2); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-mono { font-family: var(--font-mono); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.fw-600 { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-nowrap { white-space: nowrap; }

/* ---- 尺寸與顯示 ---- */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-w-0 { min-width: 0; }
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* .no-print 定義於 ui.css 的 @media print */

/* ---- RWD ---- */
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desktop-only { display: none !important; }
}
@media (min-width: 960.1px) {
  .mobile-only { display: none !important; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

