:root {
  --canvas: color-mix(in srgb, #E7E7E8 30%, white);
  --surface: #FFFFFF;
  --surface-2: color-mix(in srgb, #B9D9EB 22%, white);
  --ink: #58585A;
  --ink-strong: #17458F;
  --accent: #0067C8;
  --gold: #F7A81B;
  --line: color-mix(in srgb, #BCBDC0 55%, white);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(23, 69, 143, 0.05), 0 8px 24px rgba(23, 69, 143, 0.06);
  --shadow-lift: 0 4px 10px rgba(23, 69, 143, 0.08), 0 14px 28px rgba(23, 69, 143, 0.10);
  --shadow-pop: 0 12px 32px rgba(23, 69, 143, 0.14);
  --speed: 160ms;
  --royal: #17458F;
  --muted: #58585A;
  --brand: #0067C8;
  --bg: var(--canvas);
  --card: var(--surface);
  --panel: var(--surface-2);
  --ok: #009739;
  --bad: #E02927;
  --ok-bg: #FFFFFF;
  --bad-bg: #FFFFFF;
  --title: var(--ink-strong);
  --task-todo: #BCBDC0;
  --task-doing: #0067C8;
  --task-blocked: #FF7600;
  --task-done: #009739;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
}

h1, h2, h3 {
  margin: 0;
  color: var(--ink-strong);
  font-weight: 700;
  line-height: 1.3;
}

h1, #page-title { font-size: 26px; font-weight: 700; color: var(--ink-strong); }
h2 { font-size: 19px; }
h3 { font-size: 17px; }

p, dt, dd, button, a, label, input, select, option, textarea, th, td, li, span {
  font-size: 16px;
}

h1:has(> svg),
h2:has(> svg),
h3:has(> svg) {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

h1 > span:has(> svg),
h2 > span:has(> svg),
h3 > span:has(> svg) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

svg[aria-hidden="true"] {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: block;
}

/* 品牌橫幅 */
.site-chrome {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: #17458F;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  height: 60px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  background: #17458F;
  border-bottom: 0;
}

.site-chrome .site-header {
  position: relative;
  top: auto;
  z-index: 2;
  background: transparent;
}

.site-brand {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  min-width: 0;
}

.header-user {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
}

.user-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: 100%;
  height: 40px;
  min-height: 40px;
  padding: 0 10px 0 4px;
  background: transparent;
  color: #FFFFFF;
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 500;
}

button.user-toggle:hover {
  background: color-mix(in srgb, #FFFFFF 12%, transparent);
  color: #FFFFFF;
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #B9D9EB;
  color: #17458F;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

#user-toggle-name {
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 500;
  color: #FFFFFF;
}

.user-caret {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 22rem;
  max-width: calc(100vw - 1.5rem);
  max-height: calc(100vh - 5rem);
  overflow: auto;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-md);
  padding: 12px;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-pop);
  z-index: 200;
  animation: menu-in var(--speed) ease;
}

.user-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.user-k {
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  font-weight: 500;
  font-size: 15px;
  flex: 0 0 auto;
}

.user-v {
  font-size: 16px;
  text-align: right;
  word-break: break-word;
}

.user-actions { display: grid; gap: 8px; }
.user-actions button,
.user-actions a.btn { width: 100%; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: 1120px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 16px;
  background: transparent;
  border-bottom: 0;
}

.site-nav-main,
.site-nav-favs {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.site-nav-main {
  flex: 1 1 100%;
  align-items: stretch;
  gap: 0;
}

.site-nav-favs {
  flex: 1 1 100%;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.site-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 6px 4px 8px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  transition: background-color var(--speed) ease, box-shadow var(--speed) ease, color var(--speed) ease, border-color var(--speed) ease;
}

.site-nav a:hover { color: #FFFFFF; }

.site-nav a.is-current {
  background: transparent;
  color: #FFFFFF;
  border-bottom-color: var(--gold);
}

.site-nav a svg[aria-hidden="true"] { flex: 0 0 20px; }

.site-nav-favs a {
  flex: 0 1 auto;
  flex-direction: row;
  gap: 6px;
  width: auto;
  max-width: 100%;
  padding: 6px 12px;
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-pill);
}

.site-nav-favs a:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.22);
}

.site-nav-favs a.is-current {
  background: #FFFFFF;
  color: #17458F;
  border-color: #FFFFFF;
  border-bottom-color: #FFFFFF;
}

.site-nav-favs a.is-current:hover {
  background: #FFFFFF;
  color: #17458F;
}

.site-nav-favs a svg[aria-hidden="true"],
.site-nav-favs a.is-current svg[aria-hidden="true"] {
  color: var(--gold);
}

button.fav-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
}

button.fav-star:hover {
  background: var(--surface-2);
  color: var(--ink);
}

button.fav-star.is-on { color: var(--gold); }

button.fav-star.is-on:hover {
  background: var(--surface-2);
  color: var(--gold);
}

/* 版面 */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

main.narrow { max-width: 28rem; }

.page-head,
.section-head,
.row-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.page-head {
  align-items: flex-start;
  margin: 0 0 24px;
}

.page-head-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.page-kicker {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 500;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
}

.page-head h1,
.section-head h1,
.section-head h2 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.page-head h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-head h1::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex: 0 0 auto;
}

.title-note {
  font-size: 15px;
  font-weight: 500;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  white-space: normal;
  font-variant-numeric: tabular-nums;
}

.page-head-tools,
.form-actions,
.btn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.form-actions { align-items: stretch; }
.form-actions input { flex: 1 1 8rem; width: auto; min-width: 0; }

.inline-label {
  display: inline-flex;
  align-items: center;
  margin: 0;
  font-weight: 500;
  font-size: 15px;
}

#banner {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 16px;
}

#banner.ok {
  background: color-mix(in srgb, #009739 8%, white);
  color: var(--ink-strong);
  border: 1.5px solid #009739;
}

#banner.bad {
  background: color-mix(in srgb, #E02927 8%, white);
  color: #E02927;
  border: 1.5px solid #E02927;
}

#status {
  margin: 0 0 16px;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  font-size: 16px;
}

.card {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 0 0 16px;
  min-width: 0;
  box-shadow: var(--shadow-card);
}

.form-panel {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 24px;
  min-width: 0;
  box-shadow: var(--shadow-card);
}

.card .form-panel,
.main-pane .form-panel,
.committee-card .form-panel,
.side-panel .form-panel,
.task-list .form-panel,
#task-pane > .form-panel {
  box-shadow: none;
  border: 1.5px solid var(--line);
}

.stack { display: grid; gap: 12px; }
.fields { display: grid; gap: 12px; }

@media (min-width: 40rem) {
  .fields.two { grid-template-columns: 1fr 1fr; }
}

.hint {
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  font-size: 16px;
  margin: 0;
}

label {
  display: block;
  font-weight: 500;
  margin: 0 0 6px;
  font-size: 15px;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
}

/* 按鈕 */
button, a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  height: 40px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 500;
  font-size: 16px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
  transition: background-color var(--speed) ease, box-shadow var(--speed) ease, color var(--speed) ease, border-color var(--speed) ease;
}

button:hover, a.btn:hover { background: #17458F; }

button.secondary, a.btn.secondary {
  background: #FFFFFF;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

button.secondary:hover, a.btn.secondary:hover {
  background: var(--surface-2);
  color: var(--accent);
}

button.small {
  display: inline-flex;
  width: auto;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  font-size: 16px;
  flex: 0 0 auto;
}

button.ghost, a.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 0;
  font-weight: 500;
}

button.ghost:hover, a.btn.ghost:hover {
  background: var(--surface-2);
  color: var(--accent);
}

button.ghost.danger, a.btn.ghost.danger {
  background: transparent;
  color: #E02927;
  border: 0;
}

button.danger {
  background: #FFFFFF;
  color: #E02927;
  border: 1.5px solid #E02927;
}

button.danger:hover {
  background: color-mix(in srgb, #E02927 8%, white);
  color: #E02927;
}

button.btn-block, a.btn.btn-block { display: flex; width: 100%; }
button:disabled { opacity: 0.6; cursor: wait; }

/* 表單控制項 */
input[type="search"],
input[type="text"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 16px;
  color: var(--ink);
  background: #FFFFFF;
  font-family: inherit;
  box-sizing: border-box;
  transition: background-color var(--speed) ease, box-shadow var(--speed) ease, color var(--speed) ease, border-color var(--speed) ease;
}

textarea {
  height: auto;
  min-height: 5.5rem;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.7;
}

input[type="date"],
.task-due,
.count-badge,
.title-note {
  font-variant-numeric: tabular-nums;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 103, 200, 0.15);
}

select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 表格 */
.table-wrap { overflow-x: auto; overflow-y: visible; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 16px;
  white-space: nowrap;
}

th {
  background: #FFFFFF;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
}

tbody tr {
  min-height: 48px;
}

tbody tr:hover td {
  background: var(--surface-2);
}

.col-more { width: 3rem; text-align: right; }
.col-roles { white-space: normal; min-width: 0; max-width: 22rem; }
td.col-roles .role-tags { margin-top: 0; max-width: 22rem; }

#action-form-row td {
  padding: 8px 10px 14px;
  white-space: normal;
  vertical-align: top;
}

.desktop-table { display: none; }

/* ⋯ 選單 */
.more-wrap { position: relative; flex: 0 0 auto; }

.more-btn {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  border: 0;
  font-size: 20px;
  font-weight: 700;
  flex: 0 0 40px;
}

.more-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.more-menu {
  position: fixed;
  min-width: 10rem;
  max-width: calc(100vw - 1rem);
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-md);
  padding: 4px;
  display: grid;
  gap: 0;
  box-shadow: var(--shadow-pop);
  z-index: 150;
  animation: menu-in var(--speed) ease;
}

.more-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  min-height: 40px;
  justify-content: flex-start;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 16px;
  padding: 0 12px;
}

.more-item.danger {
  background: transparent;
  color: #E02927;
  border: 0;
}

.more-item:hover,
.more-item.danger:hover {
  background: var(--surface-2);
}

/* 分頁列 */
.roster-tabs,
.conf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
  border-bottom: 2px solid var(--line);
  min-width: 0;
  max-width: 100%;
}

.roster-tabs button,
.roster-tabs button.small,
.roster-tabs button.secondary,
.roster-tabs button.is-current,
button.conf-tab {
  flex: 1 1 0;
  min-width: 0;
  height: auto;
  min-height: 44px;
  padding: 8px 12px;
  margin-bottom: -2px;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  font-size: 16px;
  font-weight: 500;
  white-space: normal;
  overflow-wrap: anywhere;
}

.roster-tabs button:hover,
button.conf-tab:hover {
  background: transparent;
  color: var(--accent);
}

.roster-tabs button.is-current,
.roster-tabs button.small.is-current,
button.conf-tab.is-active {
  background: transparent;
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* 左欄清單 */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.side-panel {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 16px;
  display: grid;
  gap: 8px;
  min-width: 0;
  box-shadow: var(--shadow-card);
}

.side-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: visible;
}

.side-item,
button.side-item {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 44px;
  min-height: 44px;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: var(--radius-md);
  padding: 0 12px 0 14px;
  font-weight: 500;
  font-size: 16px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.side-item:hover,
button.side-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.side-item.selected,
button.side-item.selected {
  background: var(--surface-2);
  color: var(--ink-strong);
  font-weight: 700;
  border: 0;
}

.side-item.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.main-pane {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  gap: 16px;
  min-width: 0;
  width: 100%;
  box-shadow: var(--shadow-card);
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 8px 0;
}

/* 委員會／指派 */
.committee-card {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 24px;
  min-width: 0;
  box-shadow: var(--shadow-card);
  transition: background-color var(--speed) ease, box-shadow var(--speed) ease, color var(--speed) ease, border-color var(--speed) ease;
}

.committee-card:hover { box-shadow: var(--shadow-lift); }
.committee-card.stack { gap: 16px; }
.committee-body { display: grid; gap: 16px; animation: fade-in var(--speed) ease; }

.committee-body > * + * {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.card-list {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.name-toggle,
button.name-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1 1 auto;
  flex-wrap: wrap;
  min-width: 0;
  width: auto;
  height: auto;
  min-height: 44px;
  padding: 6px 0;
  background: transparent;
  color: var(--ink-strong);
  border: 0;
  font-weight: 700;
  font-size: 17px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.name-toggle:hover,
button.name-toggle:hover {
  background: transparent;
  color: var(--ink-strong);
}

.name-toggle > span:first-child {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-strong);
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

.count-badge.is-empty {
  background: #FFFFFF;
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.count-badge.is-filled {
  background: var(--surface-2);
  color: var(--ink-strong);
  border: 1.5px solid transparent;
}

h2.wg-title, .wg-title {
  font-size: 19px;
  font-weight: 700;
}

.assign-list { display: grid; gap: 0; }

.assign-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 0;
  box-shadow: none;
}

.committee-card .assign-card {
  background: transparent;
  box-shadow: none;
}

.assign-body {
  flex: 1 1 auto;
  min-width: 0;
}

.assign-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 12px;
  background: var(--surface-2);
  color: #17458F;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  border-radius: var(--radius-pill);
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.assign-person {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}

.assign-club {
  font-size: 15px;
  font-weight: 400;
  color: color-mix(in srgb, var(--ink) 75%, transparent);
}

.item-desc {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

ul.item-desc {
  padding-left: 1.35rem;
  display: grid;
  gap: 6px;
}

ul.item-desc li::marker { color: var(--accent); }

.item-desc li {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
}

/* 任務卡 */
.task-list {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.task-card {
  position: relative;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 16px 20px 16px 22px;
  display: grid;
  gap: 8px;
  min-width: 0;
  box-shadow: var(--shadow-card);
}

.task-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 2px;
  background: var(--task-todo);
}

.task-card.status-todo::before { background: var(--task-todo); }
.task-card.status-doing::before { background: var(--task-doing); }
.task-card.status-blocked::before { background: var(--task-blocked); }
.task-card.status-done::before { background: var(--task-done); }

.task-status {
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.task-card.status-todo .task-status { color: var(--ink); }
.task-card.status-doing .task-status { color: var(--task-doing); }
.task-card.status-blocked .task-status { color: var(--ink); }
.task-card.status-done .task-status { color: var(--ink); }

.task-place {
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  font-size: 15px;
  font-weight: 500;
  white-space: normal;
  overflow-wrap: anywhere;
}

.task-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.task-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-strong);
  white-space: normal;
  overflow-wrap: anywhere;
}

.task-people,
.task-due {
  font-size: 16px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.task-due.overdue {
  color: #E02927;
  font-weight: 500;
}

.task-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.task-tools select {
  flex: 1 1 10rem;
  min-width: 0;
  max-width: 100%;
}

.section-block {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0 0 20px;
}

/* 空狀態 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 32px 16px;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.empty-state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  color: #BCBDC0;
}

.empty-state p {
  margin: 0;
  font-size: 16px;
}

.empty-state > button,
.empty-state > a.btn {
  margin-top: 4px;
}

#empty.empty-state {
  display: flex;
}

/* 搜尋結果 */
.search-results,
#results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.search-results button,
#results button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  min-height: 44px;
  box-sizing: border-box;
  text-align: left;
  background: #FFFFFF;
  color: var(--ink);
  border: 1.5px solid var(--line);
  font-weight: 500;
  white-space: normal;
  overflow-wrap: anywhere;
}

.search-results button:hover,
#results button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.search-results .headline { font-size: 16px; }

.search-results .meta,
#results .meta {
  display: block;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  font-size: 15px;
  font-weight: 500;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

#invite-url {
  word-break: break-all;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 0;
  font-size: 16px;
}

/* 入口卡 */
.entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0 0 20px;
  min-width: 0;
}

button.entry-card,
a.entry-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  height: auto;
  min-height: 7.5rem;
  padding: 24px;
  background: var(--surface);
  color: var(--ink);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  text-align: left;
  font-weight: 400;
  font-family: inherit;
  line-height: 1.5;
  cursor: pointer;
}

button.entry-card:hover,
a.entry-card:hover {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
}

.entry-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-strong);
}

.entry-desc {
  font-size: 15px;
  font-weight: 500;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
}

#actions:not(:empty) {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  display: grid;
  gap: 12px;
}

/* 組織挑選 */
.org-filter {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  min-width: 0;
}

.org-filter label {
  font-size: 15px;
  margin: 0;
  font-weight: 500;
}

.org-filter select {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

#app,
#roster-stage,
#org-picker,
#conf-picker,
#conf-stage {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.org-picker-filter {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  min-width: 0;
  max-width: 100%;
}

.org-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 12px 0 0;
  min-width: 0;
  max-width: 100%;
}

.org-zone-heading {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-strong);
}

.org-picker-empty {
  margin: 12px 0 0;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  font-size: 16px;
}

button.org-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--surface);
  color: var(--ink);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

button.org-pick:hover {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
}

button.org-pick .org-code,
button.org-pick .org-full {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

button.org-pick .org-short {
  font-weight: 400;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
}

.conf-pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.conf-pick-row .org-pick {
  flex: 1 1 auto;
  min-width: 0;
}

#fav-current-wrap {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
}

.roster-org-bar,
.conf-org-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
  min-width: 0;
  max-width: 100%;
}

.roster-org-bar h2,
.conf-org-bar h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.task-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 0 0 16px;
  min-width: 0;
}

.task-toolbar .org-filter {
  flex: 1 1 12rem;
  margin: 0;
  min-width: 0;
}

.task-add-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 24px;
  padding: 14px 0 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.show-done,
.future-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.show-done input[type="checkbox"],
.future-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--accent);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 8px 4px 12px;
  background: #FFFFFF;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 15px;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.chip button {
  width: 40px;
  min-height: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  border: 0;
  font-size: 16px;
}

.chip button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* 名冊人物卡與標籤 */
.person-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.person-card {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 16px;
  min-width: 0;
  max-width: 100%;
  box-shadow: var(--shadow-card);
}

.person-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.person-names {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
  overflow: visible;
  flex: 1 1 auto;
}

.person-name,
.person-name-en,
.person-desig-en,
.person-desig-zh {
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
  min-width: 0;
}

.person-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-strong);
  flex: 0 1 auto;
}

.person-name-en {
  font-size: 16px;
  font-weight: 400;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
}

.person-desig-en { font-size: 16px; font-weight: 700; }
.person-desig-zh { font-size: 16px; font-weight: 500; }

.person-meta {
  margin-top: 4px;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  font-size: 15px;
  font-weight: 500;
  white-space: normal;
  overflow-wrap: anywhere;
}

.roster-q-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.search-field {
  position: relative;
  flex: 1 1 12rem;
  min-width: 0;
}

.search-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--ink);
  pointer-events: none;
}

.search-field input[type="search"] {
  height: 48px;
  min-height: 48px;
  padding-left: 44px;
}

.future-role-hint {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  padding: 4px 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

.role-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.role-tag,
button.role-tag {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  width: auto;
  height: auto;
  min-height: 0;
  border-radius: var(--radius-md);
  padding: 4px 8px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}

.role-tag .role-title,
.role-tag .role-title-en,
.role-tag .role-term {
  font-size: 15px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.role-tag-current,
button.role-tag-current {
  background: var(--accent);
  color: #FFFFFF;
  border: 0;
}

.role-tag-current .role-title-en,
button.role-tag-current .role-title-en {
  color: rgba(255, 255, 255, 0.75);
}

.role-tag-future,
button.role-tag-future {
  background: var(--surface-2);
  color: var(--ink);
  border: 0;
}

.role-tag-future .role-title-en,
button.role-tag-future .role-title-en {
  color: color-mix(in srgb, var(--ink) 80%, transparent);
}

.role-tag-designation {
  background: #FFFFFF;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

.role-tag-designation .role-title-en {
  color: color-mix(in srgb, var(--ink) 80%, transparent);
}

button.role-tag-current:hover {
  background: var(--accent);
  color: #FFFFFF;
}

button.role-tag-future:hover {
  background: var(--surface-2);
  color: var(--ink);
}

button.role-tag-designation:hover {
  background: #FFFFFF;
  color: var(--ink);
}

.designation-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  color: var(--ink);
}

.designation-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 0;
}

.form-note {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  font-size: 16px;
}

.date-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.date-pair > div {
  min-width: 0;
  max-width: 100%;
}

.date-pair label { font-size: 15px; }

.date-pair input[type="date"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
}

.date-pair input[type="date"]:disabled {
  background: var(--surface-2);
  color: var(--ink);
  opacity: 1;
}

.group-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-strong);
  background: transparent;
  border-radius: 0;
  padding: 8px 0;
}

.group-row td {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-strong);
  background: transparent;
  padding: 8px 10px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

tbody.group-row:hover td,
.group-row:hover td {
  background: transparent;
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

:focus-visible {
  outline: 3px solid rgba(0, 103, 200, 0.45);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

@media (min-width: 768px) {
  .site-header { padding: 0 24px; }
  main { padding: 32px 24px 56px; }
  #user-toggle-name { max-width: 12rem; }
  .desktop-table { display: block; }
  .person-list { display: none; }
  .org-filter { max-width: 24rem; }
  .split { grid-template-columns: 16rem minmax(0, 1fr); }
  .side-panel {
    position: sticky;
    top: calc(var(--site-chrome-h, 60px) + 12px);
    max-height: calc(100vh - var(--site-chrome-h, 60px) - 24px);
    overflow: auto;
  }
  .entry-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .date-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .site-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 24px;
  }
  .site-nav-main {
    flex: 0 0 auto;
    width: auto;
    flex-wrap: wrap;
    gap: 8px;
  }
  .site-nav-favs {
    flex: 1 1 auto;
    width: auto;
    gap: 8px;
  }
  .site-nav a {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 8px;
    width: auto;
    max-width: 16rem;
    padding: 8px 12px;
    font-size: 16px;
  }
  .site-nav-favs a {
    flex: 0 1 auto;
    max-width: 14rem;
    font-size: 15px;
  }
}

@media (max-width: 767px) {
  .site-header,
  .site-nav,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .card,
  .form-panel,
  .main-pane,
  .committee-card,
  button.entry-card,
  a.entry-card {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
