/* 會內行事曆暨會議室租借系統 — 樣式（計畫書 §9 顯示層）
 *
 * 視覺基準：Google 日曆（Material 3）—— 白底、細格線、實色長條、膠囊按鈕、圓形 icon。
 * 圖示：Bootstrap Icons（已放在 static/vendor/bootstrap-icons，不依賴外部 CDN，
 *       內網 NAS 連不到網際網路時圖示也不會整排消失）。
 */

/* ============================ 設計 token ============================ */
:root {
  --brand: #1a73e8;
  --brand-dark: #174ea6;
  --brand-soft: #e8f0fe;
  --brand-soft-2: #f1f6fe;

  --ink: #202124;
  --ink-2: #3c4043;
  --muted: #70757a;
  --line: #dadce0;
  --line-soft: #eceff1;
  --bg: #ffffff;
  --bg-page: #ffffff;
  --hover: #f1f3f4;
  --sunken: #f8f9fa;

  --ok: #1e8e3e;   --ok-bg: #e6f4ea;   --ok-line: #b7dfc2;
  --warn: #a15c00; --warn-bg: #fef7e0; --warn-line: #f5d98a;
  --danger: #d93025; --danger-bg: #fce8e6; --danger-line: #f4b7b1;

  /* 時段色：柔和版（2026-10-05）---------------------------------------------
     上午藍／下午琥珀／晚上紫羅蘭，三色採「同明度、低飽和」的淡彩底 + 同色系深字，
     並排時不再互相打架（舊版 #1a73e8／#e8710a／#7b4dcc 三個高飽和實色放在一起很刺眼）。
       --xx      底色（淡彩）
       --xx-ink  文字色（同色系深色，對比 ≥ 5.9:1）
       --xx-line 描邊／圓點（中間調）
     ※ 想改回舊版「實色長條」：把下面三行的 --xx 改成 #1a73e8／#e8710a／#7b4dcc，
        並把下方 .ev 的 color 改成 #fff、border 拿掉即可。 */
  --am: #e3ecfb;  --am-ink: #2a4e86;  --am-line: #8fb0e0;
  --pm: #fdf0dd;  --pm-ink: #8a5312;  --pm-line: #e6bf85;
  --nt: #ebe6f8;  --nt-ink: #4b3d8c;  --nt-line: #b0a0dd;
  --room: #0b8043;

  --radius: 10px;
  --sh-1: 0 1px 2px rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
  --sh-2: 0 1px 3px rgba(60, 64, 67, .30), 0 4px 8px 3px rgba(60, 64, 67, .15);
}

/* ============================ 基礎 ============================ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg-page);
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f1f3f4; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.right { text-align: right; }

/* ============================ 頂部列 ============================ */
.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.brand .logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--brand-soft); color: var(--brand); font-size: 18px;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt small { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; text-decoration: none;
  color: var(--ink-2); font-size: 14px; white-space: nowrap;
}
.nav a i { font-size: 15px; }
.nav a:hover { background: var(--hover); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.badge {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: #f1f3f4; color: #3c4043; white-space: nowrap;
}
.badge.role { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.banner {
  background: var(--warn-bg); border-bottom: 1px solid var(--warn-line);
  padding: 8px 16px; font-size: 13px; color: var(--warn);
}
.banner code { background: rgba(255, 255, 255, .7); }
.page { padding: 16px 16px 64px; max-width: 1600px; margin: 0 auto; }

/* ============================ 通用元件 ============================ */
.card {
  background: #fff; border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 16px;
}
.card.dashed { border-style: dashed; border-color: var(--line); }
.card h2 { margin: 0 0 10px; font-size: 17px; }
.card h3 { margin: 18px 0 8px; font-size: 15px; color: var(--brand-dark); }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
label { display: block; font-size: 13px; color: #44515f; margin-bottom: 4px; }
input[type=text], input[type=date], input[type=number], input[type=month], input[type=time], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
input[type=text]:focus, input[type=date]:focus, input[type=number]:focus,
input[type=month]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
input:disabled, select:disabled { background: var(--sunken); color: #9aa0a6; }
textarea { min-height: 64px; }
.field { margin-bottom: 12px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; min-height: 38px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer;
  font-size: 14px; font-family: inherit; color: var(--ink-2); text-decoration: none;
  transition: background .12s ease, box-shadow .12s ease;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #b3261e; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.small { padding: 6px 12px; min-height: 32px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 圓形 icon 按鈕（工具列用） */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-2);
  cursor: pointer; font-size: 16px; font-family: inherit;
  transition: background .12s ease;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn:active { background: #e4e7ea; }
.icon-btn.tiny { width: 28px; height: 28px; font-size: 13px; }

.alert { border-radius: 10px; padding: 10px 14px; margin: 8px 0; font-size: 14px; border: 1px solid transparent; }
.alert.error { background: var(--danger-bg); border-color: var(--danger-line); color: #a50e0e; }
.alert.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.alert.ok { background: var(--ok-bg); border-color: var(--ok-line); color: #0d652d; }
.alert.small { font-size: 13px; padding: 8px 12px; }
.stat { background: #fff; border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 24px; line-height: 1.2; color: var(--brand); font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 12.5px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  background: #f1f3f4; color: #3c4043; white-space: nowrap;
}
.tag { color: var(--brand-dark); font-weight: 700; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }

/* ============================ 表格 ============================ */
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; }
table.data th, table.data td { border: 1px solid var(--line-soft); padding: 8px 10px; text-align: left; vertical-align: top; }
table.data th { background: var(--sunken); font-weight: 600; white-space: nowrap; color: var(--ink-2); }
.scroll { overflow: auto; max-height: 460px; }

/* ============================ 登入 ============================ */
.login-wrap { max-width: 460px; margin: 8vh auto 40px; }
.login-wrap h1 { font-size: 22px; }
.login-wrap .row input[type=text] { flex: 2; }
.login-wrap .row select { flex: 1; }

/* ============================ 月曆工具列 ============================ */
.cal-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb-right { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.cal-title {
  font-size: 19px; font-weight: 500; color: var(--ink);
  margin: 0 0 0 6px; white-space: nowrap;
}
.btn.today-btn { padding: 7px 18px; min-height: 38px; font-size: 13.5px; font-weight: 500; }

.search {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; min-width: 210px; padding: 0 14px;
  background: var(--hover); border-radius: 999px;
}
.search > i { color: var(--muted); font-size: 14px; flex: none; }
.search input[type=text] {
  border: 0; background: transparent; padding: 0; height: 100%;
  width: 100%; min-width: 0; font-size: 13.5px; border-radius: 0;
}
.search input[type=text]:focus { box-shadow: none; border: 0; }
select.filter {
  width: auto; max-width: 150px; height: 38px; padding: 0 30px 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-color: #fff; background-repeat: no-repeat;
  background-position: right 12px center; background-size: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%2370757a' d='M6 8.5 1.6 4h8.8z'/%3E%3C/svg%3E");
}
select.filter:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.seg button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; height: 36px; padding: 0 14px;
  cursor: pointer; font-size: 13px; font-family: inherit; color: var(--ink-2);
  transition: background .12s ease;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--hover); }
.seg button.active { background: var(--brand); color: #fff; }
.seg button i { font-size: 14px; }

/* ============================ 圖例 ============================ */
.legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px;
  font-size: 12.5px; color: var(--muted); margin: 0 0 12px;
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .only-mobile { display: none; }   /* 桌機不需要「請用手機清單檢視」的提示 */
.legend i { display: inline-block; width: 13px; height: 13px; border-radius: 3px; flex: none; }
.legend .lg-ico i { width: auto; height: auto; border-radius: 0; font-size: 13px; }
/* 圖例色塊：淡彩底 + 同色系描邊，跟月曆長條一致 */
.sw-am { background: var(--am); box-shadow: inset 0 0 0 1px var(--am-line); }
.sw-pm { background: var(--pm); box-shadow: inset 0 0 0 1px var(--pm-line); }
.sw-nt { background: var(--nt); box-shadow: inset 0 0 0 1px var(--nt-line); }

/* ============================ 月曆格線（§9） ============================
 * 結構：.cal-grid 是一個直的 flex 容器，內含 1 個 .cal-dow + N 個 .cal-week。
 * 每個 .cal-week 自己是一張 7 欄 CSS Grid，所以跨日活動可以用
 * grid-column「起點 / 跨距」畫成一條長條，而不是一天一張卡。
 * 容器與子格的 1px gap 疊在背景色上，就形成 Google 日曆那種細格線。
 */
.cal-scroll { min-width: 0; }
.cal-grid {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--line);            /* 隙縫＝格線 */
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.cal-dow > div {
  background: #fff; padding: 9px 0; text-align: center;
  font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .06em;
}
.cal-dow > div:first-child { color: #c5221f; }
.cal-dow > div:last-child { color: var(--brand); }

.cal-week {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px; background: var(--line); position: relative;
}
.cal-bg { background: #fff; }
.cal-bg.out { background: var(--sunken); }
.cal-bg.today { background: var(--brand-soft-2); }

.cal-num {
  align-self: start; padding: 5px 8px 0;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  line-height: 1; font-variant-numeric: tabular-nums; z-index: 1;
}
.cal-num.out { color: #b6bcc2; }
.cal-num .pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 23px; height: 23px; padding: 0 6px; margin: -4px 0 0 -5px;
  border-radius: 999px; background: var(--brand); color: #fff; font-weight: 600;
}

/* 活動長條 */
.ev {
  display: flex; align-items: center; gap: 5px;
  align-self: center; height: 20px; margin: 0 2px; padding: 0 7px;
  border-radius: 5px; background: var(--am); color: var(--am-ink);
  box-shadow: inset 0 0 0 1px var(--am-line);
  font-size: 11.5px; line-height: 1; white-space: nowrap; overflow: hidden;
  cursor: pointer; z-index: 2;
  transition: filter .12s ease, box-shadow .12s ease;
}
.ev:hover { filter: brightness(.965); box-shadow: inset 0 0 0 1px var(--am-line), var(--sh-1); z-index: 6; }
.ev:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 1px; }
.ev .t { flex: none; font-weight: 600; opacity: .9; font-variant-numeric: tabular-nums; }
.ev .ttl { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ev .ico { flex: none; opacity: .75; font-size: 11px; }
.ev.am { background: var(--am); color: var(--am-ink); box-shadow: inset 0 0 0 1px var(--am-line); }
.ev.pm { background: var(--pm); color: var(--pm-ink); box-shadow: inset 0 0 0 1px var(--pm-line); }
.ev.nt { background: var(--nt); color: var(--nt-ink); box-shadow: inset 0 0 0 1px var(--nt-line); }
.ev.am:hover { box-shadow: inset 0 0 0 1px var(--am-line), var(--sh-1); }
.ev.pm:hover { box-shadow: inset 0 0 0 1px var(--pm-line), var(--sh-1); }
.ev.nt:hover { box-shadow: inset 0 0 0 1px var(--nt-line), var(--sh-1); }
/* 已預約會議室：外框加粗（淡彩底上要用深色框，白色框會看不見） */
.ev.booked { box-shadow: inset 0 0 0 2px var(--room); }
.ev.booked.am:hover { box-shadow: inset 0 0 0 2px var(--room), var(--sh-1); }
.ev.booked.pm:hover { box-shadow: inset 0 0 0 2px var(--room), var(--sh-1); }
.ev.booked.nt:hover { box-shadow: inset 0 0 0 2px var(--room), var(--sh-1); }
/* 跨越週界的接縫：切掉圓角、貼齊格線，看起來才像「同一條」 */
.ev.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; padding-left: 9px; }
.ev.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; padding-right: 9px; }

.ev-more {
  align-self: center; margin: 0 2px; padding: 0 7px;
  font-size: 11px; font-weight: 600; color: var(--muted);
  border-radius: 5px; cursor: pointer; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ev-more:hover { background: var(--hover); color: var(--ink); }

/* 週曆：同一套 grid，只是把列拉高、字放大，讀起來像週檢視 */
.cal-grid.week-mode .cal-week { grid-template-rows: 34px repeat(4, 42px) 22px !important; }
.cal-grid.week-mode .ev { height: 34px; border-radius: 7px; font-size: 12.5px; padding: 0 10px; }
.cal-grid.week-mode .cal-num { font-size: 13.5px; padding-top: 7px; }
.cal-grid.week-mode .ev-more { font-size: 12px; }

/* ============================ 清單（手機版議程） ============================ */
#cal-list {
  background: #fff; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden;
}
.list-day { padding: 4px 0 10px; border-bottom: 1px solid var(--line-soft); }
.list-day:last-child { border-bottom: 0; }
.list-day h3 {
  display: flex; align-items: center; gap: 10px;
  margin: 0; padding: 12px 16px 8px; font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.d-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; padding: 3px 10px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.d-wd { font-size: 13px; color: var(--muted); font-weight: 500; }
.list-ev {
  display: flex; align-items: center; gap: 9px;
  margin: 0 8px; padding: 9px 10px; border-radius: 8px;
  font-size: 13.5px; cursor: pointer;
}
.list-ev:hover { background: var(--hover); }
.list-ev .t {
  flex: none; min-width: 46px; font-weight: 600; font-size: 12.5px;
  color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.list-ev .ttl { font-weight: 500; }
.list-ev.am .dot { background: var(--am-line); }
.list-ev.pm .dot { background: var(--pm-line); }
.list-ev.nt .dot { background: var(--nt-line); }
.list-ev .meta { color: var(--muted); font-size: 12.5px; }

/* ============================ 彈窗 ============================ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(32, 33, 36, .5);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; padding: 20px 22px;
  max-width: 620px; width: 100%; max-height: 88vh; overflow: auto;
  box-shadow: var(--sh-2);
}
.modal h2 { margin-top: 0; font-size: 19px; }
.kv { display: flex; gap: 10px; font-size: 13.5px; margin: 4px 0; }
.kv b { min-width: 74px; flex: none; color: var(--muted); font-weight: 500; }

/* ============================ 提示 ============================ */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px;
  opacity: 0; transition: .25s; pointer-events: none; z-index: 90;
  font-size: 14px; box-shadow: var(--sh-2); max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #8f2020; }

/* ============================ 列印（§9 列印友善） ============================ */
@media print {
  .topbar, .banner, .cal-toolbar, .legend, .no-print { display: none !important; }
  .page { padding: 0; max-width: none; }
  .cal-grid { page-break-inside: auto; border-radius: 0; }
  .cal-week { break-inside: avoid; }
  .ev { box-shadow: none !important; }
  body { background: #fff; }
}

/* ============================ 平板 ============================ */
@media (max-width: 1100px) {
  .tb-right { margin-left: 0; width: 100%; justify-content: flex-start; }
}

/* ============================ 手機 ============================ */
@media (max-width: 760px) {
  body { font-size: 14px; }
  .page { padding: 12px 10px 72px; }
  .topbar { padding: 8px 12px; gap: 10px; }
  .brand-txt small { display: none; }
  .brand { font-size: 15px; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; padding-bottom: 2px; }
  .nav a { padding: 7px 12px; font-size: 13px; }
  .who { margin-left: auto; }
  .who .email { display: none; }

  /* 工具列：兩排，日期標題獨占一排 */
  .cal-toolbar { gap: 8px; margin-bottom: 10px; position: relative; }
  .tb-left { width: 100%; gap: 6px; }
  .tb-right { width: 100%; margin-left: 0; gap: 6px; }
  .cal-title { font-size: 16px; margin-left: 4px; overflow: hidden; text-overflow: ellipsis; }
  .search { flex: 1 1 150px; min-width: 0; height: 36px; }
  select.filter { max-width: 0; flex: 0 0 auto; padding: 0; border: 0; opacity: 0; pointer-events: none; position: absolute; }
  .seg button { padding: 0 11px; height: 34px; }
  .seg button .lb { display: none; }        /* 只留 icon，省寬度 */
  .icon-btn { width: 36px; height: 36px; }

  /* 月曆：維持 7 欄（欄數一改星期就錯位），改成可橫向捲動 */
  .cal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .cal-grid { min-width: 700px; }
  .cal-scroll::-webkit-scrollbar { height: 6px; }
  .cal-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

  /* 清單：手機主打檢視 */
  .list-ev { flex-wrap: wrap; row-gap: 3px; }
  .list-ev .meta { flex-basis: 100%; }
  .list-ev .t { min-width: 42px; }
  .legend .only-mobile { display: inline-flex; }

  /* 彈窗改成底部面板，貼近手機原生操作 */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal {
    max-width: none; border-radius: 18px 18px 0 0;
    max-height: 90vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }
  /* iOS 對 <16px 的輸入框會自動放大版面，這裡擋掉 */
  input[type=text], input[type=date], input[type=number], input[type=month],
  input[type=time], select, textarea { font-size: 16px; }
  .search input[type=text] { font-size: 14px; }
  .btn { min-height: 40px; }
  .btn.small { min-height: 34px; }
}

@media (max-width: 420px) {
  .seg button { padding: 0 9px; }
  .btn.today-btn { padding: 7px 13px; }
}

/* ---------- 自訂場次（批次登記）：一行一場，日期 + 起訖時間 ---------- */
.sess-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 10px 6px 8px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.sess-row .idx {
  width: 20px; flex: 0 0 20px; text-align: right;
  font-size: 12.5px; color: var(--muted);
}
.sess-row .s-date { width: 152px; flex: 0 0 auto; }
.sess-row select { width: auto; min-width: 104px; flex: 0 0 auto; }
.sess-row .s-dash { color: var(--muted); }
.sess-row .s-del {
  margin-left: auto; padding: 5px 11px; min-height: 34px;
  color: var(--muted);
}
.sess-row .s-del:hover { color: #c5221f; border-color: #f2b8b5; background: #fce8e6; }
@media (max-width: 560px) {
  .sess-row .idx { display: none; }
  .sess-row .s-date { width: 100%; }
}
