/* 所務看板 — compact layout. Base 12px / 1.25, 4px rhythm, no heavy shadows. */

:root {
  --bg: #eceef2;
  --col-bg: #e1e4ea;
  --line: #d3d8e0;
  --text: #1f2430;
  --muted: #6b7280;
  --faint: #9aa1ad;
  --accent: #2563eb;
  --danger: #b91c1c;
  --col-w: 330px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }
body {
  font: 12px/1.25 system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

button, input, select, textarea { font: inherit; color: inherit; }
button {
  border: 1px solid var(--line);
  background: #f7f8fa;
  border-radius: 3px;
  padding: 2px 8px;
  cursor: pointer;
  line-height: 1.25;
}
button:hover:not(:disabled) { background: #eef1f5; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover:not(:disabled) { background: #1d4ed8; }
button.danger { color: var(--danger); }
button.small { padding: 1px 6px; font-size: 11px; }

input[type="text"], input[type="search"], input[type="password"], input[type="date"], input[type="time"],
input:not([type]), select, textarea {
  border: 1px solid #cdd3dc;
  border-radius: 3px;
  padding: 2px 5px;
  background: #fff;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bfd3fb; outline-offset: 0; border-color: #93b4f5; }
textarea { resize: vertical; line-height: 1.35; }

.muted { color: var(--muted); }
.spacer { flex: 1; }

/* ---------- login ---------- */
.login { height: 100%; display: flex; align-items: center; justify-content: center; }
.login-box {
  display: flex; flex-direction: column; gap: 8px; width: 240px;
  background: #fff; padding: 16px; border: 1px solid var(--line); border-radius: 6px;
}
.login-box h1 { font-size: 16px; margin: 0 0 4px; text-align: center; }
.login-box input, .login-box button { padding: 6px 8px; }
.login-error { color: var(--danger); min-height: 15px; font-size: 11px; text-align: center; }

/* ---------- app shell ---------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

.topbar {
  flex: none; height: 32px; display: flex; align-items: center; gap: 8px;
  padding: 0 8px; background: #fff; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 13px; white-space: nowrap; }
.search { width: 220px; height: 22px; }
.toggle { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; cursor: pointer; color: #374151; }
.toggle input { margin: 0; }
.toggle .short { display: none; }
.status { color: var(--muted); font-size: 11px; white-space: nowrap; }
.tb-btn { height: 22px; padding: 0 7px; }
.arch-open { display: inline-flex; align-items: center; gap: 4px; }
.arch-open:hover:not(:disabled) { color: #ea580c; border-color: #f5b47a; background: #fff7ed; }
.arch-cnt {
  font-size: 10px; line-height: 14px; min-width: 14px; padding: 0 4px; border-radius: 7px;
  background: #e5e7eb; color: #4b5563; text-align: center; font-variant-numeric: tabular-nums;
}
.arch-cnt:empty { display: none; }

/* ---------- board & columns ---------- */
.board {
  flex: 1; min-height: 0;
  display: flex; align-items: stretch; gap: 4px;
  padding: 4px;
  overflow-x: auto; overflow-y: hidden;
}

.col {
  flex: 0 0 var(--col-w); width: var(--col-w);
  display: flex; flex-direction: column; min-height: 0;
  background: var(--col-bg); border-radius: 4px;
}
.col-hd {
  flex: none; display: flex; align-items: center; gap: 5px;
  padding: 4px 4px 3px 7px; font-weight: 600; min-height: 24px;
}
.col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-cnt { color: var(--muted); font-weight: 400; font-size: 11px; }
.col-menu-btn {
  margin-left: auto; border: 0; background: none; color: var(--muted);
  padding: 0 5px; font-size: 14px; line-height: 16px; border-radius: 3px;
}
.col-menu-btn:hover:not(:disabled) { background: rgba(0, 0, 0, .07); color: var(--text); }
.col-rename { flex: 1; font-weight: 600; padding: 1px 4px; }

.col-list {
  flex: 1 1 auto; min-height: 24px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  padding: 0 4px 2px;
  scrollbar-width: thin;
}
.col-ft { flex: none; padding: 2px 4px 4px; }
.add-card {
  width: 100%; text-align: left; border: 0; background: none;
  color: var(--muted); padding: 2px 4px;
}
.add-card:hover:not(:disabled) { background: rgba(0, 0, 0, .06); color: var(--text); }
.add-card-input { width: 100%; display: block; resize: none; padding: 3px 5px; }
.type-seg { display: inline-flex; margin-top: 3px; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.type-opt { border: 0; border-radius: 0; background: #f7f8fa; color: var(--muted); font-size: 10.5px; padding: 1px 8px; }
.type-opt + .type-opt { border-left: 1px solid var(--line); }
.type-opt.on, .type-opt.on:hover:not(:disabled) { background: #2563eb; color: #fff; }

/* Collapsed column = narrow vertical strip */
.col-strip {
  flex: 0 0 26px; width: 26px; align-items: center; gap: 6px;
  padding: 6px 0; cursor: pointer; overflow: hidden;
}
.col-strip:hover { background: #d6dae2; }
.strip-cnt { font-size: 11px; color: var(--muted); }
.strip-name {
  writing-mode: vertical-rl; font-weight: 600; color: #4b5563;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 100%;
}
.col-strip.drop-hot { background: #c9d8f6; }

.add-col-wrap { flex: 0 0 170px; width: 170px; background: transparent; }
.add-col {
  border: 1px dashed #bcc3cf; background: transparent; color: var(--muted);
  text-align: left; padding: 4px 8px;
}
.add-col:hover:not(:disabled) { background: rgba(255, 255, 255, .5); color: var(--text); }
.add-col-input { width: 100%; padding: 3px 6px; }

/* ---------- cards ---------- */
.c-white   { --c-bd: #c3c9d3; --c-bg: #ffffff; }
.c-yellow  { --c-bd: #e2b203; --c-bg: #fff8db; }
.c-red     { --c-bd: #e5484d; --c-bg: #fdecec; }
.c-green   { --c-bd: #3fa34d; --c-bg: #eaf6eb; }
.c-blue    { --c-bd: #3b7ddd; --c-bg: #e8f0fd; }
.c-purple  { --c-bd: #8b5cf6; --c-bg: #f1ebfe; }
.c-orange  { --c-bd: #f08c2e; --c-bg: #fef1e4; }
.c-cyan    { --c-bd: #17a2b8; --c-bg: #e3f6f9; }
.c-brown   { --c-bd: #9a6a46; --c-bg: #f4ece5; }
.c-magenta { --c-bd: #d6338a; --c-bg: #fce8f2; }

.card {
  flex: none;
  background: var(--c-bg, #fff);
  border-left: 4px solid var(--c-bd, #c3c9d3);
  border-radius: 3px;
  padding: 4px 6px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .08);
  cursor: pointer;
  overflow-wrap: anywhere;
}
.card:hover { box-shadow: 0 0 0 1px rgba(15, 23, 42, .14); }
.card.dragging { opacity: .35; }

.card-hd { display: flex; align-items: flex-start; gap: 3px; }
.card-hd .title { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; line-height: 1.25; color: #111827; }
.card-due { margin-top: 2px; line-height: 14px; }
.meta { flex: none; display: inline-flex; align-items: center; gap: 3px; margin-left: 2px; line-height: 17.5px; }
/* [archive] button: inline right after the title text; faint grey, orange on hover */
.arch-btn {
  display: inline-block; vertical-align: 1px; margin-left: 5px;
  border: 1px solid #dde1e7; background: transparent; color: #b4bac4;
  font-size: 10px; font-weight: 400; line-height: 13px; padding: 0 4px; border-radius: 3px;
  white-space: nowrap; letter-spacing: .2px;
}
.arch-btn:hover:not(:disabled), .arch-btn:focus-visible {
  background: #fff1e6; border-color: #f08c2e; color: #ea580c; outline: none;
}
.arch-btn:active { background: #fed7aa; }
.arch-btn + .arch-btn { margin-left: 3px; }
/* 清除子項 deletes permanently: same faint pill, but red (danger) on hover */
.arch-clear:hover:not(:disabled), .arch-clear:focus-visible { background: #fef2f2; border-color: #ef4444; color: #dc2626; }
.arch-clear:active { background: #fecaca; }
button.danger-solid { background: #dc2626; border-color: #dc2626; color: #fff; }
button.danger-solid:hover:not(:disabled) { background: #b91c1c; }
.cf-list {
  margin: 0; padding: 4px 8px 4px 22px; max-height: 30vh; overflow-y: auto;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 4px; color: #7f1d1d;
}
.cf-list li { padding: 1px 0; text-decoration: line-through; text-decoration-color: rgba(127, 29, 29, .4); }
.cf .dlg-title { color: #b91c1c; }
.cnt { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cnt.all { color: #15803d; }

.due {
  font-size: 10.5px; line-height: 14px; padding: 0 3px; border-radius: 2px;
  background: rgba(100, 116, 139, .14); color: #4b5563; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.due.soon { background: #fde6c4; color: #b45309; }
.due.over { background: #fbd3d3; color: #b91c1c; }

.desc {
  margin-top: 1px; color: var(--muted); font-size: 11px; line-height: 1.25;
  white-space: pre-line;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden;
}

.add-st-hd {
  border: 0; background: none; padding: 0 2px; color: var(--faint);
  font-size: 13px; line-height: 14px; opacity: 0;
}
.card:hover .add-st-hd, .add-st-hd:focus { opacity: 1; }
.add-st-hd:hover:not(:disabled) { background: none; color: var(--accent); }

/* On-board subtasks: tight, checkable rows */
.sts { list-style: none; margin: 1px 0 0; padding: 0; cursor: default; }
.st { display: flex; align-items: flex-start; gap: 3px; font-size: 13.5px; line-height: 1.25; padding: 0; margin: 5px 0; color: #374151; }
.st label { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 4px; cursor: pointer; }
.st input[type="checkbox"] {
  flex: none; width: 13px; height: 13px; margin: calc((1.25em - 13px) / 2) 0 0; cursor: pointer; accent-color: var(--accent);
}
.st .nm { min-width: 0; cursor: text; }
.st .nm:hover { text-decoration: underline dotted rgba(55, 65, 81, .45); text-underline-offset: 2px; }
.st-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* optional subtask description: small muted text, 2 lines on the board; long URLs wrap instead of widening the column */
.st-desc {
  margin-top: 1px; font-size: 11px; line-height: 1.3; color: var(--muted); cursor: text;
  white-space: pre-line; overflow-wrap: anywhere; word-break: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.st-desc a { color: #4b6fb5; text-decoration: underline; text-decoration-color: rgba(75, 111, 181, .35); }
.st.done .st-desc { color: var(--faint); }

/* MEMO cards: bulleted items, no checkboxes */
.type-tag {
  display: inline-block; vertical-align: 1px; margin-right: 5px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .4px; line-height: 13px;
  padding: 0 4px; border-radius: 3px; background: #e0e7ff; color: #3730a3;
}
.type-tag.todo-tag { background: #e5e7eb; color: #374151; }
.memo-items .mi { gap: 5px; }
.mi-dot { flex: none; width: 13px; text-align: center; color: #6b7280; font-size: 14px; line-height: 1.25; }
.st.done .nm { color: var(--faint); text-decoration: line-through; }
.st .due { flex: none; font-size: 10.5px; line-height: 14px; margin-top: calc((1.25em - 14px) / 2); }
body.hide-done .st.done { display: none; }

.st-add { line-height: 14px; padding: 0; }
.add-st {
  border: 0; background: none; padding: 0 2px; color: var(--faint);
  font-size: 13px; line-height: 14px; opacity: .6;
}
.card:hover .add-st { opacity: 1; }
.add-st:hover:not(:disabled) { background: none; color: var(--accent); }
.st-new { width: 100%; font-size: 13.5px; padding: 1px 4px; margin: 1px 0; }

.drop-ind { flex: none; height: 2px; margin: -3px 0; background: var(--accent); border-radius: 1px; }

/* ---------- popover menu ---------- */
.menu {
  position: fixed; z-index: 60; min-width: 130px;
  display: flex; flex-direction: column; padding: 3px;
  background: #fff; border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
}
.menu button { border: 0; background: none; text-align: left; padding: 4px 8px; border-radius: 3px; }
.menu button:hover:not(:disabled) { background: #eef2f8; }

/* ---------- modal ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 8px 8px; background: rgba(15, 23, 42, .32);
}
.modal {
  width: min(640px, 100%); max-height: 88vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  background: #fff; border-radius: 6px; padding: 8px 10px 10px;
  border-top: 4px solid var(--c-bd, #c3c9d3);
  box-shadow: 0 6px 24px rgba(15, 23, 42, .18);
}
.m-top { display: flex; gap: 6px; align-items: center; }
.m-title { flex: 1; font-size: 14px; font-weight: 600; padding: 3px 6px; }
.icon-btn { border: 0; background: none; padding: 2px 6px; color: var(--muted); font-size: 13px; }

.m-grid { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; align-items: center; }
.m-lbl { color: var(--muted); font-size: 11px; white-space: nowrap; }
.m-grid select { justify-self: start; max-width: 100%; }
.m-due { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

.swatches { display: flex; gap: 4px; flex-wrap: wrap; }
.sw {
  width: 22px; height: 18px; padding: 0; border-radius: 3px;
  background: var(--c-bg); border: 1px solid var(--c-bd); border-left: 6px solid var(--c-bd);
}
.sw:hover:not(:disabled) { background: var(--c-bg); filter: brightness(.97); }
.sw.on { outline: 2px solid #1f2430; outline-offset: 1px; }

.m-sec { display: flex; flex-direction: column; gap: 4px; }
.m-sec-hd { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 11.5px; color: #374151; }
.desc-view {
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4;
  padding: 4px 6px; border: 1px solid transparent; border-radius: 3px; background: #f8f9fb;
  cursor: text; max-height: 40vh; overflow-y: auto;
}
.desc-view:hover { border-color: var(--line); }
.desc-view a { color: var(--accent); }
#m-desc { width: 100%; min-height: 70px; }

.m-sts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ms { display: flex; align-items: center; gap: 4px; }
.ms input[type="checkbox"] { flex: none; margin: 0; width: 14px; height: 14px; accent-color: var(--accent); }
.ms-name { flex: 1; min-width: 90px; }
.ms.done .ms-name { color: var(--faint); text-decoration: line-through; }
.ms-date { width: 122px; }
.ms-time { width: 84px; }
.ms button { border: 0; background: none; padding: 1px 4px; color: var(--muted); }
.ms button:hover:not(:disabled) { background: #eef1f5; color: var(--text); }
.ms .ms-del:hover:not(:disabled) { color: var(--danger); }
.ms { flex-wrap: wrap; }
.ms-dot { flex: none; width: 14px; text-align: center; color: #6b7280; }
.ms-desc {
  flex: 1 0 100%; margin-left: 18px; max-width: calc(100% - 18px);
  font-size: 11.5px; color: #4b5563; resize: vertical; min-height: 22px; padding: 2px 5px;
}
.m-type { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.m-type .type-tag { margin: 0; }
.m-type-hint { font-size: 11px; }
.convert-btn:hover:not(:disabled) { border-color: #93b4f5; color: var(--accent); }
.sp { width: min(460px, 100%); }
.sp #sp-name { padding: 4px 6px; font-weight: 600; }
.sp #sp-desc { width: 100%; resize: vertical; min-height: 60px; }
.sp .dlg-actions { align-items: center; }
.m-st-add { display: flex; gap: 4px; }
.m-st-add input { flex: 1; }

.m-foot { display: flex; align-items: center; gap: 6px; padding-top: 4px; border-top: 1px solid #eef0f3; }
.m-meta { font-size: 10.5px; }
.m-foot button { padding: 3px 12px; }

.dlg {
  width: min(340px, 100%); display: flex; flex-direction: column; gap: 8px;
  background: #fff; border-radius: 6px; padding: 12px; margin-top: 10vh;
  box-shadow: 0 6px 24px rgba(15, 23, 42, .18);
}
.dlg-title { font-weight: 700; font-size: 13px; }
.dlg-msg { color: #374151; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 70;
  background: #1f2937; color: #fff; padding: 6px 12px; border-radius: 4px;
  max-width: 90vw; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.toast.err { background: #b91c1c; }
.toast { display: flex; align-items: center; gap: 10px; }
.toast-act { flex: none; white-space: nowrap; border: 0; background: none; color: #fdba74; font-weight: 600; padding: 0 2px; }
.toast-act:hover:not(:disabled) { background: none; color: #fed7aa; text-decoration: underline; }

/* ---------- Archive panel ---------- */
.arch-panel {
  width: min(560px, 100%); max-height: 84vh; display: flex; flex-direction: column; gap: 6px;
  background: #fff; border-radius: 6px; padding: 8px 10px 10px;
  border-top: 4px solid #f08c2e; box-shadow: 0 6px 24px rgba(15, 23, 42, .18);
}
.arch-top { display: flex; align-items: center; gap: 8px; }
.arch-title { font-weight: 700; font-size: 14px; }
.arch-title .muted { font-weight: 400; font-size: 11.5px; margin-left: 4px; }
.arch-search { width: 100%; height: 24px; }
.arch-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.arch-item {
  display: flex; flex-direction: column; gap: 3px; padding: 5px 6px;
  background: var(--c-bg, #fff); border: 1px solid #eceef2; border-left: 4px solid var(--c-bd, #c3c9d3); border-radius: 3px;
}
.arch-row { display: flex; align-items: center; gap: 8px; }
.arch-main { flex: 1; min-width: 0; }
.arch-tag {
  margin-left: 6px; padding: 0 5px; border-radius: 3px; font-size: 10px; font-weight: 400; line-height: 14px;
  background: #fff1e6; color: #c2410c; border: 1px solid #fed7aa; vertical-align: 1px;
}
.arch-sts { list-style: none; margin: 0; padding: 2px 0 0 4px; border-top: 1px dashed rgba(15, 23, 42, .1); }
.arch-st { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 12.5px; color: #374151; }
.arch-st-ck { flex: none; width: 12px; text-align: center; color: #15803d; font-size: 11px; }
.arch-st:not(.done) .arch-st-ck { color: var(--faint); }
.arch-st-nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.arch-st.done .arch-st-nm { color: #6b7280; }
.arch-st-at { flex: none; font-size: 10.5px; white-space: nowrap; }
.arch-st-restore { flex: none; }
.arch-name { font-weight: 600; font-size: 13px; color: #111827; overflow-wrap: anywhere; }
.arch-meta { font-size: 11px; margin-top: 2px; }
.arch-col { color: #374151; }
.arch-acts { flex: none; display: flex; gap: 4px; }
.arch-acts button { padding: 2px 9px; }
.arch-restore:hover:not(:disabled) { border-color: #93b4f5; color: var(--accent); }
.arch-empty, .arch-loading { padding: 16px 4px; text-align: center; }

/* ---------- touch / no hover ---------- */
@media (hover: none) {
  .add-st-hd, .add-st { opacity: .7; }
}

/* ---------- mobile ---------- */
@media (max-width: 700px) {
  :root { --col-w: 85vw; }
  .board { scroll-snap-type: x mandatory; padding: 4px 6px; gap: 6px; }
  .col { scroll-snap-align: start; }
  .col-strip, .add-col-wrap { scroll-snap-align: none; }
  .add-col-wrap { scroll-snap-align: start; }
  .add-col-wrap { flex-basis: 60vw; width: 60vw; }

  .topbar { gap: 6px; padding: 0 6px; }
  .brand { display: none; }
  .search { flex: 1; width: auto; }
  .toggle .long { display: none; }
  .toggle .short { display: inline; }

  .card-hd .title { font-size: 15px; }
  .meta { line-height: 18.75px; }
  .st { align-items: center; padding: 0; font-size: 14px; }
  .st label { min-height: 26px; align-items: center; gap: 6px; }
  .st:has(.st-desc) label, .st:has(.st-desc) { align-items: flex-start; }
  .st-desc { font-size: 12px; }
  .mi-dot { font-size: 16px; line-height: 26px; }
  .memo-items .mi { min-height: 26px; align-items: center; }
  .memo-items .mi:has(.st-desc) { align-items: flex-start; }
  .type-opt { font-size: 12px; padding: 4px 12px; }
  .sp .dlg-actions button { min-height: 34px; padding: 4px 14px; }
  .ms-desc { margin-left: 26px; max-width: calc(100% - 26px); font-size: 13px; }
  .st input[type="checkbox"] { width: 18px; height: 18px; margin: 0 2px 0 0; }
  .st .due { margin-top: 0; }
  .st-new { font-size: 14px; }
  .add-st, .add-st-hd { min-width: 28px; min-height: 26px; font-size: 15px; }
  /* bigger hit area without changing the title's line height */
  .arch-btn { font-size: 11px; line-height: 16px; padding: 4px 6px; margin: -4px 0 -4px 4px; border-color: #d9dde3; }
  .arch-btn + .arch-btn { margin-left: 3px; }
  .cf-list li { padding: 3px 0; }
  .cf .dlg-actions button { min-height: 34px; padding: 4px 14px; }
  .topbar .tb-btn { padding: 0 6px; }
  .arch-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .arch-item { padding: 7px 8px; }
  .arch-row { flex-wrap: wrap; }
  .arch-st { flex-wrap: wrap; font-size: 13.5px; padding: 3px 0; }
  .arch-st-at { order: 3; flex-basis: 100%; padding-left: 18px; }
  .arch-st-restore { min-height: 30px; padding: 3px 12px; }
  .arch-acts { margin-left: auto; }
  .arch-acts button { min-height: 32px; padding: 4px 14px; }
  .arch-search { height: 32px; font-size: 14px; }

  .backdrop { padding: 0; }
  .modal { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .m-foot { position: sticky; bottom: -10px; background: #fff; padding-bottom: 8px; }
  .ms { flex-wrap: wrap; padding: 3px 0; border-bottom: 1px solid #f0f2f5; }
  .ms input[type="checkbox"] { width: 20px; height: 20px; }
  .ms-name { flex-basis: calc(100% - 30px); }
  .ms-date { margin-left: 26px; }
}

/* ---------- column indicator (phone only) ---------- */
.col-dots { display: none; }

/* ---------- phone: one column per screen, swipe between columns ---------- */
@media (max-width: 640px) {
  :root { --col-w: calc(100vw - 12px); }
  .board {
    padding: 0 6px 4px; gap: 12px; scroll-padding: 0 6px;
    scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .col, .col-strip, .add-col-wrap {
    flex: 0 0 var(--col-w); width: var(--col-w);
    scroll-snap-align: start; scroll-snap-stop: always;
  }
  .col-hd { position: sticky; top: 0; z-index: 2; background: var(--col-bg); border-radius: 4px 4px 0 0; min-height: 30px; }
  .col-list { overscroll-behavior-y: contain; }
  /* collapsed column becomes a full-width "tap to expand" panel */
  .col-strip { flex-direction: row; justify-content: center; align-items: center; padding: 12px; }
  .col-strip .strip-name { writing-mode: horizontal-tb; font-size: 14px; }
  .col-strip::after { content: "（已摺疊，點一下展開）"; color: var(--muted); font-size: 11px; }
  .add-col-wrap { display: flex; align-items: flex-start; justify-content: center; padding-top: 20px; }

  .col-dots {
    flex: none; display: flex; gap: 4px; align-items: center;
    overflow-x: auto; scrollbar-width: none; padding: 3px 6px;
    background: #fff; border-bottom: 1px solid var(--line);
  }
  .col-dots::-webkit-scrollbar { display: none; }
  .dot {
    flex: none; display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid var(--line); background: #f3f4f6; color: #4b5563;
    border-radius: 999px; padding: 2px 8px; font-size: 11px; line-height: 16px; min-height: 22px;
    white-space: nowrap; max-width: 40vw; overflow: hidden; text-overflow: ellipsis;
  }
  .dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #9ca3af; flex: none; }
  .dot.on { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600; }
  .dot.on, .dot.on:hover:not(:disabled) { background: #2563eb; border-color: #2563eb; color: #fff; }
  .dot:focus { outline: none; }
  .dot:focus-visible { outline: 2px solid #93b4f5; }
  .dot.on::before { background: #fff; }
}
