/* 手機殼層：html.sw-mobile-ui — 全屏工作台、底欄、學生/教練列表優化 */

.sw-mobile-nav {
  display: none;
}

.sw-mobile-desktop-link {
  display: none !important;
}

html.sw-mobile-ui .sw-mobile-desktop-link {
  display: inline-flex !important;
  align-items: center;
  font-size: 12px !important;
  padding: 8px 12px !important;
  border-radius: 999px;
}

html.sw-mobile-ui .main-nav-mobile,
html.sw-mobile-ui nav.tabs {
  display: none !important;
}

/* --- 全屏感：減少外圈漸層佔用、內容區加寬 --- */
html.sw-mobile-ui {
  -webkit-text-size-adjust: 100%;
  --sw-mobile-vv-bottom-gap: 0px;
}

html.sw-mobile-ui body {
  padding: max(0px, env(safe-area-inset-top)) max(0px, env(safe-area-inset-right)) max(0px, env(safe-area-inset-bottom)) max(0px, env(safe-area-inset-left));
  background: var(--sw-bg-mobile);
  min-height: 100svh;
}

html.sw-mobile-ui .wrap {
  max-width: 100%;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 100svh;
  background: var(--sw-surface-mobile);
}

/* 顶栏 compact（覆寫 responsive 窄螢的直向堆疊，殼層維持橫向以便省高） */
html.sw-mobile-ui .hdr {
  position: relative;
  z-index: 230;
  border-radius: 0;
  padding: 10px 12px;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

html.sw-mobile-ui .hdr > div:first-child {
  text-align: left;
}

html.sw-mobile-ui .hdr h1 {
  font-size: 1rem;
  line-height: 1.25;
}

html.sw-mobile-ui .hdr-tagline {
  display: none;
}

html.sw-mobile-ui .logo-icon svg {
  width: 40px;
  height: 40px;
}

html.sw-mobile-ui .hdr-btns {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 52%;
}

html.sw-mobile-ui .hdr-btn--quick-cmd {
  font-size: 12px;
  padding: 6px 10px;
}

/* 主內容：可捲；為底部快速列預留空間，避免被遮住或只顯示一半 */
html.sw-mobile-ui .body {
  padding: var(--sw-mobile-pane-pad) var(--sw-mobile-pane-pad) var(--sw-mobile-body-bottom) var(--sw-mobile-pane-pad);
  max-height: none;
  overflow: visible;
  background: var(--sw-surface-mobile);
  border-radius: 0;
}

/* 預約頁內容最長；略增底距避免底欄遮擋 */
html.sw-mobile-ui.sw-mobile-pane-booking .body {
  padding-bottom: calc(var(--sw-mobile-nav-h) + env(safe-area-inset-bottom, 0px) + var(--sw-mobile-vv-bottom-gap, 0px) + 20px);
}

html.sw-mobile-ui .pane h2,
html.sw-mobile-ui .students-page__title,
html.sw-mobile-ui .booking-page__title,
html.sw-mobile-ui .coaches-page__title,
html.sw-mobile-ui .students-progress__title {
  font-size: var(--sw-font-2xl);
  letter-spacing: 0.02em;
  margin-bottom: var(--sw-space-2);
}

/* 手機：隱藏冗長頁面說明，保留財務結算月等操作型文字 */
html.sw-mobile-ui .pane-page__lead,
html.sw-mobile-ui .students-page__lead:not(.finance-lead--billing),
html.sw-mobile-ui .booking-page__lead,
html.sw-mobile-ui .coaches-page__lead,
html.sw-mobile-ui .dashboard-lcsd__lead,
html.sw-mobile-ui .sysmgmt-page__lead,
html.sw-mobile-ui .student-list-container__hint:not(.attend-list__hint--keep) {
  display: none;
}

html.sw-mobile-ui .finance-lead--billing {
  font-size: var(--sw-font-sm);
  line-height: 1.4;
  margin-bottom: var(--sw-space-2);
}

/* 篩選面板：手機上更扁、更貼邊 */
html.sw-mobile-ui .student-control-panel,
html.sw-mobile-ui .coaches-page__filters-wrap {
  padding: 14px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
}

/* 學生 / 教練列表外殼 */
html.sw-mobile-ui .student-list-container,
html.sw-mobile-ui .coach-list-container {
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  background: #fff;
}

html.sw-mobile-ui .student-list-container__head,
html.sw-mobile-ui .coach-list-container__head {
  padding: 10px 12px;
  background: #f8fafc;
}

html.sw-mobile-ui .student-list-container__title,
html.sw-mobile-ui .coach-list-container__title {
  font-size: 15px;
}

/* 財務／會計：標題與按鈕已改為上下兩行（見 panes.css）；此處僅略縮窄螢按鈕內距 */
html.sw-mobile-ui .fin-acct-toolbar .fin-acct-act-btn {
  padding: 8px 6px;
  font-size: 12px;
}

/* 表格捲動區：圓角、內陰影提示 */
html.sw-mobile-ui .student-list-container .tbl-wrap,
html.sw-mobile-ui .coach-list-container .tbl-wrap {
  margin-left: 0;
  margin-right: 0;
  padding: 0 8px 8px 8px;
  border-radius: 0 0 12px 12px;
}

html.sw-mobile-ui .student-table .student-td,
html.sw-mobile-ui .coach-table .coach-td {
  padding: 10px 8px;
  font-size: 13px;
}

html.sw-mobile-ui .student-avatar,
html.sw-mobile-ui .coach-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  font-size: 16px;
}

html.sw-mobile-ui .student-name-block__title,
html.sw-mobile-ui .coach-name-block__title {
  font-size: 15px;
}

/* 不顯示內部 ID（雙重保險，即使舊快取） */
html.sw-mobile-ui .student-name-block__id,
html.sw-mobile-ui .coach-name-block__id {
  display: none !important;
}

/* 操作欄：允許换行、按鈕易點 */
html.sw-mobile-ui .student-td--center,
html.sw-mobile-ui .coach-td--center {
  min-width: 0 !important;
  padding: 8px 6px;
}

/* 與點名「快速操作」一致：單列橫向捲動，避免換行撐高列高 */
html.sw-mobile-ui .student-actions-row,
html.sw-mobile-ui .coach-actions-row {
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 10px;
  padding: 4px 0 6px;
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

html.sw-mobile-ui .student-actions-row::-webkit-scrollbar,
html.sw-mobile-ui .coach-actions-row::-webkit-scrollbar {
  display: none;
}

html.sw-mobile-ui .student-action-item,
html.sw-mobile-ui .coach-action-item {
  flex-shrink: 0;
  min-width: 52px;
}

html.sw-mobile-ui .student-action-item .btn-student-act,
html.sw-mobile-ui .coach-action-item .btn-coach-act {
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
}

html.sw-mobile-ui .student-action-label,
html.sw-mobile-ui .coach-action-label {
  font-size: 10px;
  max-width: 3.2rem;
  text-align: center;
  line-height: 1.15;
}

/* 小屏統計卡：更緊湊 */
html.sw-mobile-ui .student-stats-row .student-stat-card,
html.sw-mobile-ui .coach-stat-card {
  min-height: 0;
  padding: 10px 8px;
}

/* 統計卡數字／金額：單行顯示，避免窄屏拆字看似「空白」 */
html.sw-mobile-ui .student-stats-row .student-stat-card__val,
html.sw-mobile-ui .coach-stat-card__val {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* --- 快速選頁：固定於底部，單列橫向捲動 --- */
html.sw-mobile-ui .sw-mobile-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  position: fixed !important;
  top: auto;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--sw-mobile-vv-bottom-gap, 0px)) !important;
  z-index: 220;
  width: 100%;
  max-width: 100%;
  min-height: var(--sw-mobile-nav-h);
  box-sizing: border-box;
  margin: 0;
  padding: 6px 8px;
  padding-top: 8px;
  padding-right: max(10px, env(safe-area-inset-right, 0px));
  padding-bottom: 8px;
  padding-left: max(10px, env(safe-area-inset-left, 0px));
  background: var(--sw-gradient-tabs);
  border-top: 1px solid var(--sw-border);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}

html.sw-mobile-ui.sw-mobile-pane-booking .sw-mobile-nav {
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--sw-mobile-vv-bottom-gap, 0px) + 8px) !important;
}

html.sw-mobile-ui .sw-mobile-nav::-webkit-scrollbar {
  display: none;
}

html.sw-mobile-ui .sw-mobile-nav__item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: auto;
  min-width: 4.625rem;
  max-width: 5.75rem;
  min-height: 48px;
  padding: 6px 4px;
  border: none;
  border-radius: 12px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  -webkit-tap-highlight-color: rgba(2, 132, 199, 0.12);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

html.sw-mobile-ui .sw-mobile-nav__item:active:not(:disabled) {
  background: #e2e8f0;
}

html.sw-mobile-ui .sw-mobile-nav__item[aria-selected="true"]:active,
html.sw-mobile-ui .sw-mobile-nav__item--active:active {
  filter: brightness(0.96);
}

html.sw-mobile-ui .sw-mobile-nav__ic {
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.95;
}

html.sw-mobile-ui .sw-mobile-nav__txt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

html.sw-mobile-ui .sw-mobile-nav__item[aria-selected="true"],
html.sw-mobile-ui .sw-mobile-nav__item--active {
  background: #e0f2fe;
  color: var(--sw-primary-deep);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
  border: 1px solid #bae6fd;
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  html.sw-mobile-ui .sw-mobile-nav {
    scroll-snap-type: none;
  }

  html.sw-mobile-ui .sw-mobile-nav__item {
    transition: none;
  }

  html.sw-mobile-ui .sw-mobile-nav__item[aria-selected="true"],
  html.sw-mobile-ui .sw-mobile-nav__item--active {
    transform: none;
  }
}

/* Modal 開啟時底欄置於 Modal 之下（modal 疊加層通常 z-index 更高） */
body.modal-open html.sw-mobile-ui .sw-mobile-nav {
  z-index: 50;
}

/* 寬螢仍用手機殼層時：頂欄維持全寬（不置中浮塊，避免遮內容） */
@media (min-width: 769px) {
  html.sw-mobile-ui .sw-mobile-nav {
    max-width: 100%;
    transform: none;
  }
}

/* 表單：預約等 */
html.sw-mobile-ui .fg input,
html.sw-mobile-ui .fg select,
html.sw-mobile-ui .fg textarea {
  font-size: 16px;
}

html.sw-mobile-ui .btn,
html.sw-mobile-ui .hdr-btn {
  min-height: 46px;
  border-radius: 12px;
}

/* 游泳進度副標：僅手機殼層顯示（卡片名單說明） */
.students-progress__hint--mobile-only {
  display: none;
}

html.sw-mobile-ui .students-progress__hint--mobile-only,
#progress.sw-progress-card-shell .students-progress__hint--mobile-only {
  display: block;
  margin: 0;
  margin-top: -4px;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.45;
}

@media (max-width: 1200px) {
  #progress.sw-progress-card-shell > .students-progress__head .students-progress__hint:not(.students-progress__hint--mobile-only) {
    display: none;
  }
}

/* 游泳進度：工具列直向、星星易點 */
html.sw-mobile-ui .progress-toolbar {
  flex-direction: column;
  align-items: stretch !important;
  gap: 6px;
  margin-bottom: 6px !important;
}

html.sw-mobile-ui .progress-toolbar--compact .progress-toolbar__search,
html.sw-mobile-ui .progress-toolbar--compact .progress-toolbar__level {
  padding: 6px 8px !important;
  font-size: 13px !important;
  min-height: 0;
  line-height: 1.25;
}

html.sw-mobile-ui .progress-toolbar__search,
html.sw-mobile-ui .progress-toolbar__level {
  width: 100%;
  max-width: none;
}

html.sw-mobile-ui .progress-table-wrap.tbl-wrap {
  margin-left: 0;
  margin-right: 0;
  padding: 0 4px 8px;
  border-radius: 12px;
}

html.sw-mobile-ui .progress-table .progress-quick-star {
  min-width: 24px;
  min-height: 28px;
  padding: 1px 2px;
  font-size: 0.85rem;
}

/* 游泳進度：殼層下列表改為卡片（表格區隱藏時由 JS 切換；≤1200px 含 1080 直向） */
html.sw-mobile-ui .progress-card-list,
#progress.sw-progress-card-shell .progress-card-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px 8px;
  max-width: 100%;
}

html.sw-mobile-ui .progress-card-list[hidden],
#progress.sw-progress-card-shell .progress-card-list[hidden] {
  display: none !important;
}

html.sw-mobile-ui .progress-card-list__empty,
#progress.sw-progress-card-shell .progress-card-list__empty {
  margin: 0.75rem 0;
  padding: 0.75rem;
  text-align: center;
  color: #64748b;
  font-size: 0.875rem;
}

/* 進度頁頂部統計：單列五格、每格單行高度 */
html.sw-mobile-ui #progress .students-progress__cards.sw-stats-cards--compact,
#progress.sw-progress-card-shell .students-progress__cards.sw-stats-cards--compact {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 6px;
}

html.sw-mobile-ui #progress .students-progress__cards.sw-stats-cards--compact .card,
#progress.sw-progress-card-shell .students-progress__cards.sw-stats-cards--compact .card {
  padding: 4px 3px;
  text-align: center;
}

html.sw-mobile-ui #progress .students-progress__cards.sw-stats-cards--compact .card h3,
#progress.sw-progress-card-shell .students-progress__cards.sw-stats-cards--compact .card h3 {
  font-size: 0.6rem;
  font-weight: 600;
  margin: 0 0 1px;
  line-height: 1.15;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.sw-mobile-ui #progress .students-progress__cards.sw-stats-cards--compact .card .val,
#progress.sw-progress-card-shell .students-progress__cards.sw-stats-cards--compact .card .val {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

html.sw-mobile-ui .progress-card.progress-card,
#progress.sw-progress-card-shell .progress-card.progress-card--dense {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 2px 10px rgba(15, 23, 42, 0.05);
  border: 1px solid #e2e8f0;
  padding: 8px 10px 9px;
  -webkit-tap-highlight-color: rgba(2, 132, 199, 0.08);
  overflow: visible;
}

html.sw-mobile-ui .progress-card.progress-card,
#progress.sw-progress-card-shell .progress-card.progress-card--dense:active {
  border-color: #cbd5e1;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: nowrap;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__name {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.2;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__name strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__level {
  flex-shrink: 0;
  min-height: 32px;
  min-width: 5.25rem;
  max-width: 42%;
  font-size: 13px;
  border-radius: 6px;
  padding: 2px 4px;
  line-height: 1.2;
}

/* 每列：左固定標籤、右內容單行省略 */
html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__line {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-bottom: 3px;
  font-size: 11px;
  line-height: 1.35;
  min-height: 0;
  min-width: 0;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__line--1 {
  margin-bottom: 3px;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__line--1 .progress-card__v--1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__k {
  flex: 0 0 1.85rem;
  color: #64748b;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.02em;
  line-height: 1.35;
  align-self: flex-start;
  padding-top: 2px;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__v {
  flex: 1;
  min-width: 0;
  color: #334155;
  word-break: break-word;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__v--2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.35;
  word-break: break-word;
  max-height: calc(1.35em * 2 + 2px);
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__v--sen {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.25;
  word-break: break-word;
  font-size: 11px;
}

/* SEN 列：略加闊類名顯示區（第一條內容列為 SEN） */
html.sw-mobile-ui .progress-card > .progress-card__line:first-of-type .progress-card__k,
#progress.sw-progress-card-shell .progress-card > .progress-card__line:first-of-type .progress-card__k {
  flex: 0 0 2.15rem;
}

/* 覆寫 students.css；卡片內單行省略 */
html.sw-mobile-ui .progress-card .progress-suggest-summary.progress-card__v--2,
#progress.sw-progress-card-shell .progress-card .progress-suggest-summary.progress-card__v--2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  max-width: none;
  vertical-align: unset;
  line-height: 1.35;
  max-height: calc(1.35em * 2 + 2px);
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__sen-txt {
  font-weight: 500;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__stars.progress-card__stars--inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 6px;
  margin: 3px 0 3px;
  padding: 4px 0;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}

/* 每泳式一行：縮寫＋星星橫排（單行高度） */
html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__star-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 26px;
  max-height: 26px;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__abbr {
  flex: 0 0 0.95rem;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  text-align: center;
  line-height: 1;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__star-cell .progress-quick-star {
  min-width: 18px;
  min-height: 26px;
  max-height: 26px;
  padding: 0;
  font-size: 0.78rem;
  line-height: 1;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__line--suggest {
  align-items: center;
  margin-bottom: 3px;
  gap: 5px;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__line--suggest .progress-card__v--2 {
  -webkit-line-clamp: 2;
  line-height: 1.35;
  max-height: calc(1.35em * 2 + 2px);
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__detail.progress-suggest-detail-btn {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 7px;
  font-size: 11px;
  border-radius: 6px;
  align-self: center;
  margin-top: 0;
}

/* 操作：單列「操作」展開選單（取代三顆並排鈕） */
html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__ops {
  position: relative;
  z-index: 1;
  margin-top: 2px;
}

html.sw-mobile-ui details.progress-card__,
#progress.sw-progress-card-shell details.progress-card__ops[open] {
  z-index: 40;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__ops-toggle {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-height: 34px;
  padding: 4px 8px;
  margin: 0;
  border-radius: 6px;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  border: 1px solid #e2e8f0;
  font-family: inherit;
  line-height: 1.2;
  box-sizing: border-box;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__ops-toggle-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__ops-toggle-hint {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
  text-align: center;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__ops-toggle::-webkit-details-marker,
html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__ops-toggle::marker {
  display: none;
  content: '';
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__ops-toggle-ic {
  font-size: 10px;
  opacity: 0.75;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__ops-toggle:focus {
  outline: none;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__ops-toggle:focus-visible {
  outline: 2px solid rgba(2, 132, 199, 0.55);
  outline-offset: 2px;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__ops-item:focus {
  outline: none;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__ops-item:focus-visible {
  outline: 2px solid rgba(2, 132, 199, 0.45);
  outline-offset: 0;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__ops-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 3px);
  z-index: 41;
  padding: 4px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__ops-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  margin: 0;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.25;
}

html.sw-mobile-ui .progress-card__,
#progress.sw-progress-card-shell .progress-card__ops-item:active {
  background: #e2e8f0;
}

html.sw-mobile-ui .students-progress-section {
  margin-top: 8px;
}

/* 進度表：橫捲時表頭貼頂；殼層下隱藏「重設排序」（無表頭可點、減少誤觸） */
html.sw-mobile-ui .progress-toolbar__reset-sort,
#progress.sw-progress-card-shell .progress-toolbar__reset-sort {
  display: none;
}

#progress.sw-progress-card-shell .progress-toolbar {
  flex-direction: column;
  align-items: stretch !important;
  gap: 6px;
  margin-bottom: 6px !important;
}

#progress.sw-progress-card-shell .progress-toolbar__search,
#progress.sw-progress-card-shell .progress-toolbar__level {
  width: 100%;
  max-width: none;
}

html.sw-mobile-ui .progress-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 #e2e8f0;
}

/* 儀表板圖表：殼層內略降高度，多留一屏給表格 */
html.sw-mobile-ui #dashboard .dashboard-chart-panel,
html.sw-mobile-ui #dashboard #studentGrowthChart,
html.sw-mobile-ui #dashboard #incomeChart {
  min-height: 200px;
  height: 200px;
}

/* 階段 C：游泳進度寬表 — 略降 min-width、收緩欄內距（仍保橫捲，減少無謂寬度） */
html.sw-mobile-ui .progress-table {
  min-width: 620px;
  font-size: 13px;
}

html.sw-mobile-ui .progress-table th,
html.sw-mobile-ui .progress-table td {
  padding: 4px 4px;
  line-height: 1.2;
  vertical-align: middle;
}

html.sw-mobile-ui .progress-list-container,
html.sw-mobile-ui .students-progress-section .student-list-container {
  border-radius: 12px;
}

/* 階段 A：與 responsive 的 table{min-width:700px} 疊加時，殼層內可略收 */
@media (max-width: 768px) {
  html.sw-mobile-ui table {
    min-width: 0;
  }

  html.sw-mobile-ui .student-table,
  html.sw-mobile-ui .coach-table {
    min-width: 600px;
  }

  /* 學生管理／教練主列表：加寬橫捲，姓名／電話／地點可顯示較完整 */
  html.sw-mobile-ui #students .student-list-container .student-table.attendance-table {
    min-width: 860px;
  }

  html.sw-mobile-ui #coaches .coach-list-container .coach-table.attendance-table {
    min-width: 1220px;
  }

  html.sw-mobile-ui .progress-table {
    min-width: 580px;
  }
}

/* 學生列表手機：隱藏聯絡欄，避免橫捲時在姓名與分類之間露出空白直條 */
html.sw-mobile-ui #students .student-list-container .student-table.attendance-table th:nth-child(2),
html.sw-mobile-ui #students .student-list-container .student-table.attendance-table td:nth-child(2) {
  display: none;
}

/* 殼層任意寬度：列表橫捲時凍結首欄（姓名／識別欄） */
html.sw-mobile-ui .tbl-wrap.student-table-wrap .student-table > thead > tr > th:first-child,
html.sw-mobile-ui .tbl-wrap.student-table-wrap .student-table > tbody > tr > td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: none;
  border-right: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

html.sw-mobile-ui .tbl-wrap.student-table-wrap .student-table > thead > tr > th:first-child {
  z-index: 3;
  background: #f8fafc;
}

html.sw-mobile-ui .tbl-wrap.student-table-wrap .student-table > tbody > tr > td:first-child {
  background: #fff;
}

html.sw-mobile-ui .tbl-wrap.student-table-wrap .student-table > tbody > tr.student-row:hover > td:first-child {
  background: #f8fafc;
}

html.sw-mobile-ui .tbl-wrap.coach-table-wrap .coach-table > thead > tr > th:first-child,
html.sw-mobile-ui .tbl-wrap.coach-table-wrap .coach-table > tbody > tr > td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: none;
  border-right: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* 取消列表橫捲區右側白渐層（Chrome 上易誤顯為直線） */
html.sw-mobile-ui .student-list-container .tbl-wrap::after,
html.sw-mobile-ui .coach-list-container .tbl-wrap::after,
html.sw-mobile-ui .tbl-wrap::after {
  display: none;
  content: none;
}

html.sw-mobile-ui .tbl-wrap.coach-table-wrap .coach-table > thead > tr > th:first-child {
  z-index: 3;
  background: #f8fafc;
}

html.sw-mobile-ui .tbl-wrap.coach-table-wrap .coach-table > tbody > tr > td:first-child {
  background: #fff;
}

html.sw-mobile-ui .tbl-wrap.coach-table-wrap .coach-table > tbody > tr.coach-row:hover > td:first-child {
  background: #f8fafc;
}

/* 階段 B：預約 / 點名課表 / 財務 / 通告 / 儀表板 */
html.sw-mobile-ui #booking .booking-page__head,
html.sw-mobile-ui #attend .students-page__head,
html.sw-mobile-ui #fin .pane-page__head,
html.sw-mobile-ui #notices .pane-page__head,
html.sw-mobile-ui #dashboard .dashboard-page__head {
  margin-bottom: 12px;
}

html.sw-mobile-ui #booking .row2,
html.sw-mobile-ui #booking .booking-student-row {
  gap: 8px;
}

html.sw-mobile-ui #booking #publicEnrollAdminPanel.pe-admin-collapsible,
html.sw-mobile-ui #booking #publicEnrollAdminPanel {
  margin-bottom: 10px !important;
}

/* 公開報名管理：compact 版（桌面 + 手機） */
#publicEnrollAdminPanel.booking-public-enroll-admin--compact {
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

#publicEnrollAdminPanel .pe-compact-title {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

#publicEnrollAdminPanel .pe-compact-help {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

#publicEnrollAdminPanel .pe-compact-create {
  display: grid;
  grid-template-columns: 78px 78px minmax(140px, 1fr) auto;
  gap: 6px;
  align-items: end;
}

#publicEnrollAdminPanel .pe-compact-field {
  margin: 0;
}

#publicEnrollAdminPanel .pe-compact-field label {
  font-size: 11px;
  margin-bottom: 3px;
}

#publicEnrollAdminPanel .pe-compact-field input {
  min-height: 32px;
}

#publicEnrollAdminPanel .pe-compact-generate {
  white-space: nowrap;
  min-height: 32px;
  padding-top: 6px;
  padding-bottom: 6px;
}

#publicEnrollAdminPanel .pe-compact-link-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#publicEnrollAdminPanel .pe-compact-link-input {
  flex: 1;
  min-width: 220px;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  display: none;
}

#publicEnrollAdminPanel .pe-compact-link-input--ghost {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#publicEnrollAdminPanel .pe-compact-filters {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

#publicEnrollAdminPanel .pe-compact-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 11px;
}

#publicEnrollAdminPanel .pe-compact-table-wrap {
  margin-top: 6px;
  overflow: auto;
  max-height: min(48vh, 420px);
  -webkit-overflow-scrolling: touch;
}

#publicEnrollAdminPanel .pe-token-link-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 240px;
}

#publicEnrollAdminPanel .pe-token-link-input {
  flex: 1;
  min-width: 150px;
  max-width: 360px;
  padding: 5px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
}

#publicEnrollAdminPanel .pe-token-link-cell--missing {
  justify-content: flex-start;
}

#publicEnrollAdminPanel .pe-token-link-missing {
  font-size: 11px;
  color: #94a3b8;
}

html.sw-mobile-ui #booking #publicEnrollAdminPanel .pe-admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

html.sw-mobile-ui #booking #publicEnrollAdminPanel .pe-admin-toggle {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

html.sw-mobile-ui #publicEnrollAdminPanel .pe-compact-create {
  grid-template-columns: 1fr 1fr;
}

html.sw-mobile-ui #publicEnrollAdminPanel .pe-compact-field--grow,
html.sw-mobile-ui #publicEnrollAdminPanel .pe-compact-generate {
  grid-column: 1 / -1;
}

html.sw-mobile-ui #publicEnrollAdminPanel .pe-token-link-cell {
  min-width: 190px;
}

html.sw-mobile-ui #publicEnrollAdminPanel .pe-token-link-input {
  min-width: 120px;
}

html.sw-mobile-ui .sched-filters-grid,
html.sw-mobile-ui .attend-filters-grid {
  gap: 10px 12px;
}

html.sw-mobile-ui .sched-footer-actions,
html.sw-mobile-ui .pane-action-bar,
html.sw-mobile-ui .notice-action-row {
  gap: 8px;
}

html.sw-mobile-ui .dashboard-page__grid {
  gap: 12px;
}

html.sw-mobile-ui .dashboard-page__stats .card {
  padding: 12px 10px;
}

html.sw-mobile-ui .dashboard-page__stats .card .val {
  font-size: 1.35rem;
}

/* ═══ 學生管理／教練／財務：殼層下列表與點名列表同節奏（約兩行、操作列橫捲）═══ */
html.sw-mobile-ui #students .student-list-container .student-table.attendance-table tbody tr.student-row > td,
html.sw-mobile-ui #coaches .coach-list-container .coach-table.attendance-table tbody tr.coach-row > td,
html.sw-mobile-ui #fin .student-list-container .student-table.attendance-table tbody tr.student-row > td {
  padding-top: 11px;
  padding-bottom: 11px;
  line-height: 1.35;
  vertical-align: middle;
}

/* 學生列表：欄最小寬度（橫捲閱讀全名／電話／地點） */
html.sw-mobile-ui #students .student-table.attendance-table th:nth-child(1),
html.sw-mobile-ui #students .student-table.attendance-table td:nth-child(1) {
  min-width: 128px;
  max-width: 168px;
}

html.sw-mobile-ui #students .student-table.attendance-table th:nth-child(5),
html.sw-mobile-ui #students .student-table.attendance-table td:nth-child(5) {
  min-width: 220px;
}

html.sw-mobile-ui #students .student-table.attendance-table .student-name-block__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.35;
}

html.sw-mobile-ui #students .student-table.attendance-table .student-contact-line {
  line-height: 1.35;
  word-break: break-word;
}

html.sw-mobile-ui #students .student-table.attendance-table .student-contact-line--tel {
  word-break: normal;
  white-space: nowrap;
  overflow-wrap: normal;
}

html.sw-mobile-ui #students .student-table.attendance-table .student-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
}

html.sw-mobile-ui #students .student-table.attendance-table .student-metric__val,
html.sw-mobile-ui #coaches .coach-table.attendance-table .coach-metric__val {
  font-size: 13px;
  line-height: 1.15;
}

html.sw-mobile-ui #students .student-table.attendance-table .student-metric__hint,
html.sw-mobile-ui #coaches .coach-table.attendance-table .coach-metric__hint {
  line-height: 1.2;
}

/* 列表「金額／筆數」欄：手機橫捲時仍保持數字連續、不逐字換行 */
html.sw-mobile-ui #students .student-table.attendance-table td.student-td--num,
html.sw-mobile-ui #coaches .coach-table.attendance-table td.coach-td--num,
html.sw-mobile-ui #fin .student-list-container .student-table.attendance-table td.student-td--num,
html.sw-mobile-ui #confirmations .confirmations-table-wrap .student-table.attendance-table td.student-td--num {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

html.sw-mobile-ui #students .student-table.attendance-table td.student-td--num .student-metric__val,
html.sw-mobile-ui #confirmations .confirmations-table-wrap .student-table.attendance-table td.student-td--num .student-metric__val,
html.sw-mobile-ui #coaches .coach-table.attendance-table td.coach-td--num .coach-metric__val {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

html.sw-mobile-ui #confirmations .confirmations-table-wrap .student-table.attendance-table td.student-contact-line--tel {
  word-break: normal;
  white-space: nowrap;
  overflow-wrap: normal;
}

html.sw-mobile-ui #dashboard .dashboard-page__stats .card .val {
  font-size: 1.35rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

html.sw-mobile-ui #coaches .coach-table.attendance-table th:nth-child(1),
html.sw-mobile-ui #coaches .coach-table.attendance-table td:nth-child(1) {
  min-width: 168px;
}

html.sw-mobile-ui #coaches .coach-table.attendance-table th:nth-child(2),
html.sw-mobile-ui #coaches .coach-table.attendance-table td:nth-child(2) {
  min-width: 148px;
}

html.sw-mobile-ui #coaches .coach-table.attendance-table th:nth-child(3),
html.sw-mobile-ui #coaches .coach-table.attendance-table td:nth-child(3) {
  min-width: 120px;
}

html.sw-mobile-ui #coaches .coach-table.attendance-table th:nth-child(5),
html.sw-mobile-ui #coaches .coach-table.attendance-table td:nth-child(5) {
  min-width: 240px;
}

html.sw-mobile-ui #coaches .coach-table.attendance-table th:nth-child(8),
html.sw-mobile-ui #coaches .coach-table.attendance-table td:nth-child(8) {
  min-width: 188px;
}

html.sw-mobile-ui #coaches .coach-table.attendance-table .coach-name-block__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.35;
}

html.sw-mobile-ui #coaches .coach-table.attendance-table .student-contact-line {
  line-height: 1.35;
  word-break: break-word;
}

html.sw-mobile-ui #coaches .coach-table.attendance-table .student-contact-line--tel {
  word-break: normal;
  white-space: nowrap;
  overflow-wrap: normal;
}

html.sw-mobile-ui #coaches .coach-table.attendance-table .coach-td--spec .coach-spec-tags {
  max-height: calc(1.15em * 3 + 14px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

html.sw-mobile-ui #fin .student-table.attendance-table tbody tr.student-row td:first-child strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.35;
}

/* 預約確認、學生月費：加寬橫捲（首欄 sticky 見上／responsive） */
html.sw-mobile-ui #confirmations .confirmations-table-wrap .student-table.attendance-table {
  min-width: 1020px;
}

html.sw-mobile-ui #fin .finance-table-panel .student-table.finance-fees-table,
html.sw-mobile-ui #fin .finance-table-panel .student-table.attendance-table {
  min-width: 1040px;
}

html.sw-mobile-ui #fin .finance-table-panel .student-table.attendance-table th:last-child,
html.sw-mobile-ui #fin .finance-table-panel .student-table.attendance-table td.student-td--center {
  min-width: 120px;
}

html.sw-mobile-ui #fin .finance-table-panel .student-table.finance-fees-table th:last-child,
html.sw-mobile-ui #fin .finance-table-panel .student-table.finance-fees-table td.fin-col-actions {
  min-width: 92px;
}

html.sw-mobile-ui #fin .finance-table-panel .student-table.finance-fees-table th,
html.sw-mobile-ui #fin .finance-table-panel .student-table.finance-fees-table td {
  padding-top: 5px;
  padding-bottom: 5px;
}

html.sw-mobile-ui #fin .finance-table-panel .student-table.finance-fees-table td.fin-col-actions > div {
  flex-wrap: nowrap !important;
}

/* 待處理（調整項）：加寬表與操作／下拉 */
html.sw-mobile-ui .fin-adj-table-wrap .student-table {
  min-width: 960px;
}

html.sw-mobile-ui .fin-adj-table-wrap .student-table th:last-child,
html.sw-mobile-ui .fin-adj-table-wrap .student-table td:last-child {
  min-width: 220px;
  white-space: normal;
  vertical-align: middle;
}

html.sw-mobile-ui .fin-adj-table-wrap .adj-decision-select {
  min-width: 148px;
  max-width: 100%;
  font-size: 13px;
}

html.sw-mobile-ui .fin-adj-table-wrap .student-td--center .bs {
  margin: 2px 4px 2px 0;
  white-space: nowrap;
}

/* 資訊頁：康文署／天文台卡片緊湊化 */
html.sw-mobile-ui .dashboard-lcsd,
html.sw-mobile-ui .dashboard-hko {
  margin-bottom: var(--sw-space-3);
}

html.sw-mobile-ui .dashboard-lcsd__body,
html.sw-mobile-ui .dashboard-hko__body {
  padding: 0 var(--sw-space-3) var(--sw-space-3);
  font-size: var(--sw-font-base);
}

html.sw-mobile-ui .dashboard-lcsd-card {
  padding: var(--sw-space-3);
  margin-bottom: var(--sw-space-2);
  border-radius: var(--sw-radius-md);
}

html.sw-mobile-ui .dashboard-lcsd-card__title {
  font-size: var(--sw-font-lg);
}

html.sw-mobile-ui .dashboard-hko__warn {
  padding: var(--sw-space-3);
}

html.sw-mobile-ui .cards {
  gap: var(--sw-space-2);
  margin-bottom: var(--sw-space-3);
}

html.sw-mobile-ui .card {
  padding: var(--sw-space-3);
  border-radius: var(--sw-radius-md);
}

html.sw-mobile-ui .card h3 {
  font-size: var(--sw-font-sm);
  margin-bottom: var(--sw-space-1);
}

html.sw-mobile-ui .card .val {
  font-size: 1.35rem;
}

/* PWA 加入主畫面提示（階段 D） */
.sw-pwa-hint {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px 0;
  padding: 10px 12px;
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
  border: 1px solid #7dd3fc;
  border-radius: 12px;
  font-size: 13px;
  color: #0c4a6e;
  line-height: 1.4;
}

.sw-pwa-hint.sw-pwa-hint--visible {
  display: flex;
}

.sw-pwa-hint__close {
  flex-shrink: 0;
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: #0369a1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ═══ 手機專業版：通告頁、預約月曆、底部導覽密度重整 ═══ */
html.sw-mobile-ui {
  --sw-mobile-nav-h: 58px;
  --sw-mobile-pane-pad: 8px;
  --sw-mobile-body-bottom: calc(var(--sw-mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 8px);
}

html.sw-mobile-ui .body {
  padding-left: 8px;
  padding-right: 8px;
}

html.sw-mobile-ui .sw-mobile-nav {
  min-height: var(--sw-mobile-nav-h);
  gap: 6px;
  padding-top: 6px;
  padding-bottom: 6px;
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.08);
}

html.sw-mobile-ui .sw-mobile-nav__item {
  min-width: 4rem;
  max-width: 5rem;
  min-height: 44px;
  padding: 4px 5px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.75);
  box-shadow: none;
}

html.sw-mobile-ui .sw-mobile-nav__ic {
  font-size: 1rem;
}

html.sw-mobile-ui .sw-mobile-nav__txt {
  font-size: 10px;
}

html.sw-mobile-ui .sw-mobile-nav__item[aria-selected="true"],
html.sw-mobile-ui .sw-mobile-nav__item--active {
  background: #0ea5e9;
  box-shadow: 0 6px 14px rgba(2, 132, 199, 0.22);
  transform: none;
}

html.sw-mobile-ui #notices .notices-page__head {
  margin-bottom: 14px;
  gap: 10px;
}

html.sw-mobile-ui #notices .notices-page__layout {
  margin-top: 0;
  gap: 0;
}

html.sw-mobile-ui #notices .notices-page__main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 月份與快捷按鈕：獨立白卡片，與下方藍色區塊分離 */
html.sw-mobile-ui #notices .notices-page__notice-month-toolbar.finance-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 14px;
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-lg);
  box-shadow: var(--sw-shadow-card);
}

html.sw-mobile-ui #notices .notices-page__notice-month-toolbar .finance-billing-label {
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  font-size: var(--sw-font-sm);
  color: var(--sw-text);
}

html.sw-mobile-ui #notices .notices-page__notice-month-toolbar .fin-input-month,
html.sw-mobile-ui #notices .notices-page__notice-month-toolbar .fin-filter-select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--sw-border-strong);
  border-radius: var(--sw-radius-md);
  font-size: 15px;
  background: var(--sw-surface-muted);
}

html.sw-mobile-ui #notices .notices-page__notice-month-toolbar > span {
  display: none;
}

html.sw-mobile-ui #notices .notices-page__notice-month-toolbar .btn {
  width: 100% !important;
  margin-top: 0 !important;
  min-height: 44px;
  padding: 10px 8px !important;
  font-size: 12px !important;
  font-weight: 600;
  line-height: 1.25;
  border-radius: var(--sw-radius-md) !important;
  background: var(--sw-surface-muted) !important;
  color: var(--sw-primary-deep) !important;
  border: 1px solid var(--sw-border-strong) !important;
  box-shadow: none !important;
}

html.sw-mobile-ui #notices .notices-toolbar-btn--history,
html.sw-mobile-ui #notices .notices-toolbar-btn--templates {
  background: var(--sw-surface) !important;
  color: var(--sw-primary) !important;
  border: 1px solid var(--sw-border-strong) !important;
  box-shadow: var(--sw-shadow-sm) !important;
}

html.sw-mobile-ui #notices .quick-notice-section {
  padding: 16px;
  border-radius: var(--sw-radius-lg);
  margin: 0;
  background: var(--sw-gradient-panel);
  border: var(--sw-toolbar-border);
  box-shadow: var(--sw-toolbar-shadow);
}

html.sw-mobile-ui #notices .notices-section-title {
  margin-bottom: 12px;
  font-size: 1.15rem;
  line-height: 1.25;
}

html.sw-mobile-ui #notices .notice-tab-nav {
  margin-bottom: 14px;
  padding: 4px;
  border-radius: var(--sw-radius-md);
  background: var(--sw-surface-subtle);
  border: 1px solid var(--sw-border);
}

html.sw-mobile-ui #notices .notice-tab-btn {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}

html.sw-mobile-ui #notices .template-selection {
  margin-bottom: 12px;
}

html.sw-mobile-ui #notices .notice-tpl-pick-label,
html.sw-mobile-ui #notices .notices-inline-heading {
  margin-bottom: 8px;
  font-size: 13px;
}

html.sw-mobile-ui #notices .notice-templates-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

html.sw-mobile-ui #notices .notice-template-card.template-item {
  min-height: 0;
  padding: 14px 44px 14px 14px;
  border-radius: var(--sw-radius-md);
  border: 1px solid var(--sw-border);
  background: var(--sw-surface);
  box-shadow: var(--sw-shadow-sm);
}

html.sw-mobile-ui #notices .notice-template-card.template-item::after {
  content: '';
  display: table;
  clear: both;
}

html.sw-mobile-ui #notices .notice-template-card__icon {
  float: left;
  width: 36px;
  height: 36px;
  margin: 0 12px 0 0;
  font-size: 1.15rem;
  line-height: 36px;
  text-align: center;
  border-radius: 10px;
  background: var(--sw-surface-muted);
}

html.sw-mobile-ui #notices .notice-template-card__title {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.25;
}

html.sw-mobile-ui #notices .notice-template-card__desc {
  font-size: 12px;
  line-height: 1.35;
  color: var(--sw-text-subtle);
}

html.sw-mobile-ui #notices .notice-template-card .btn[data-notice-action="edit-template"] {
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  min-height: 32px;
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.28);
}

html.sw-mobile-ui #notices .notice-template-card .btn[data-notice-action="edit-template"]:hover {
  transform: translateY(-50%);
}

html.sw-mobile-ui #notices .notice-custom-panel,
html.sw-mobile-ui #notices .notice-template-editor {
  padding: 12px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.96);
}

html.sw-mobile-ui #notices .notice-fg {
  margin-bottom: 12px;
}

html.sw-mobile-ui #notices .notice-input,
html.sw-mobile-ui #notices .notice-select,
html.sw-mobile-ui #notices .notice-textarea {
  padding: 10px 12px;
  border-width: 1px;
  border-radius: 12px;
  font-size: 15px;
}

html.sw-mobile-ui #notices .notice-textarea {
  min-height: 110px;
  max-height: 180px;
}

html.sw-mobile-ui #notices .notice-recipient-box {
  padding: 8px 10px;
  border-width: 1px;
  border-radius: 12px;
}

html.sw-mobile-ui #notices .notice-recipient-box--lg {
  max-height: 170px;
}

html.sw-mobile-ui #notices .recipient-item {
  padding: 6px 2px;
  margin-bottom: 0;
}

html.sw-mobile-ui #notices .notice-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

html.sw-mobile-ui #notices .notice-action-row--wide {
  margin-top: 14px;
}

html.sw-mobile-ui #notices .notice-action-btn {
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.2;
  box-shadow: none;
}

html.sw-mobile-ui #notices .notice-action-btn--primary {
  grid-column: auto;
}

html.sw-mobile-ui #notices .notice-action-btn--preview {
  background: #0284c7;
}

html.sw-mobile-ui #notices .notice-action-btn--send {
  background: #16a34a;
}

html.sw-mobile-ui #booking .booking-page__head {
  gap: 8px;
  margin-bottom: 8px;
}

html.sw-mobile-ui #booking .booking-page__gcal-btn {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 12px;
}

html.sw-mobile-ui #booking .booking-wizard.wz-shell,
html.sw-mobile-ui #booking .booking-wizard.bk-accordion-shell {
  padding: 12px;
  border-radius: 16px;
  margin-bottom: 12px;
}

html.sw-mobile-ui #booking .bk-accordion-section .bk-main-calendar {
  padding: 12px 12px 14px;
  margin: 0;
  border-radius: 0;
  border: none;
  border-top: 1px solid rgba(14, 165, 233, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: none;
}

html.sw-mobile-ui #booking .cal-hdr {
  margin-bottom: 8px;
}

html.sw-mobile-ui #booking .cal-hdr h3,
html.sw-mobile-ui #booking #calTitle {
  font-size: 1rem;
  line-height: 1.25;
}

html.sw-mobile-ui #booking .cal-hdr button {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

html.sw-mobile-ui #booking .wz-month-bar {
  display: grid;
  grid-template-columns: 1fr 0.9fr 1fr;
  gap: 8px;
  margin: 4px 0 12px;
}

html.sw-mobile-ui #booking .wz-month-bar button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 750;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

html.sw-mobile-ui #booking .wz-month-label {
  margin: 4px 0 10px;
  font-size: 16px;
  font-weight: 800;
  color: #334155;
}

html.sw-mobile-ui #booking .wz-cal-holiday-footnote {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.45;
  background: #fffbeb;
  border-color: #fde68a;
}

html.sw-mobile-ui #booking .wz-cal-holiday-footnote::before {
  content: "提示";
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  font-size: 10px;
  font-weight: 800;
}

html.sw-mobile-ui #booking #dateSelector.date-option-grid {
  gap: 6px;
  align-items: stretch;
}

html.sw-mobile-ui #booking #dateSelector .wz-cal-weekname {
  padding: 6px 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

html.sw-mobile-ui #booking #dateSelector .wz-cal-filler {
  min-height: 60px;
}

html.sw-mobile-ui #booking #dateSelector .date-option.wz-cal-cell {
  min-height: 60px;
  padding: 7px 2px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

html.sw-mobile-ui #booking #dateSelector .date-option.wz-cal-cell.enabled:active {
  transform: scale(0.97);
}

html.sw-mobile-ui #booking #dateSelector .date-option.wz-cal-cell.today:not(.selected):not(.editing) {
  border-color: #7dd3fc;
  background: linear-gradient(180deg, #eff6ff 0%, #e0f2fe 100%);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.12), 0 4px 12px rgba(14, 165, 233, 0.14);
}

html.sw-mobile-ui #booking #dateSelector .date-option.wz-cal-cell.selected:not(.editing) {
  border-color: #22c55e;
  background: linear-gradient(180deg, #ecfdf5 0%, #dcfce7 100%);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.14), 0 5px 12px rgba(22, 163, 74, 0.14);
}

html.sw-mobile-ui #booking #dateSelector .date-option.wz-cal-cell.pending:not(.editing) {
  border-color: #fb923c;
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
}

html.sw-mobile-ui #booking #dateSelector .date-option.wz-cal-cell.wz-cal-holiday:not(.selected):not(.editing) {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 72%);
}

html.sw-mobile-ui #booking .cal-grid {
  gap: 5px;
}

html.sw-mobile-ui #booking .cd {
  border-radius: 12px;
  font-size: 12px;
}

html.sw-mobile-ui #booking .cd.ch {
  min-height: 28px;
  padding: 4px 2px;
  border-color: transparent;
  background: transparent;
  color: var(--sw-text-muted);
  font-size: 12px;
}

html.sw-mobile-ui #booking #calGrid .cd:not(.ch) {
  min-height: 48px;
  padding: 5px 2px;
  gap: 1px;
}

html.sw-mobile-ui #booking #calGrid .cd-dayn {
  font-size: 18px;
  line-height: 1.05;
  font-weight: 750;
}

html.sw-mobile-ui #booking #calGrid .cd .cd-hk-holiday-lbl {
  max-width: 96%;
  font-size: 8px;
  line-height: 1.1;
}

html.sw-mobile-ui #booking #dateSelector .wz-cal-dayname {
  margin: 0 0 2px;
  font-size: 11px;
  line-height: 1;
  color: #64748b;
}

html.sw-mobile-ui #booking #dateSelector .wz-cal-daynum {
  font-size: 22px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -0.04em;
  color: #1f2937;
}

html.sw-mobile-ui #booking #dateSelector .wz-cal-sub {
  display: none;
}

html.sw-mobile-ui #booking #dateSelector .wz-cal-badge,
html.sw-mobile-ui #booking #dateSelector .wz-cal-holname {
  max-width: calc(100% - 4px);
  margin-top: 4px;
  padding: 1px 4px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1.25;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.sw-mobile-ui #booking #dateSelector .wz-cal-badge--today {
  background: #dbeafe;
  color: #0284c7;
}

html.sw-mobile-ui #booking #dateSelector .wz-cal-holname {
  background: #ffedd5;
  color: #c2410c;
}

/* 選中日期：格仔維持原尺寸，僅外框高亮 */
html.sw-mobile-ui #booking #dateSelector .date-option.wz-cal-cell.wz-cal-cell--focused {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.4);
}

html.sw-mobile-ui .wz-cal-zoom__card {
  padding: 16px 14px 14px;
  border-radius: 18px;
}

html.sw-mobile-ui .wz-cal-zoom__num {
  font-size: 42px;
}

html.sw-mobile-ui .wz-cal-zoom .wz-cal-detail {
  font-size: 12px;
}

html.sw-mobile-ui #booking .bk-main-date-count {
  margin-top: 8px;
  font-size: 12px;
}

html.sw-mobile-ui #booking .booking-wizard__date-hint,
html.sw-mobile-ui #booking #bookingDateAccessHint.booking-wizard__date-hint {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.35;
}

/* 手機：全站資訊方格統一兩欄、固定手感與可讀層級 */
html.sw-mobile-ui .cards,
html.sw-mobile-ui .dashboard-page__stats,
html.sw-mobile-ui .attendance-stats-cards,
html.sw-mobile-ui .student-stats-cards,
html.sw-mobile-ui .coach-stats-cards,
html.sw-mobile-ui .sched-stat-cards,
html.sw-mobile-ui .confirmations-stats-compact,
html.sw-mobile-ui .confirmations-stats-strip,
html.sw-mobile-ui .finance-page__stats,
html.sw-mobile-ui .students-progress__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 12px !important;
}

html.sw-mobile-ui .cards .card,
html.sw-mobile-ui .attendance-stat-card,
html.sw-mobile-ui .student-stat-card,
html.sw-mobile-ui .coach-stat-card,
html.sw-mobile-ui .schedule-container .stat-card,
html.sw-mobile-ui .stat-card {
  min-height: 92px !important;
  padding: 13px 13px 12px 15px !important;
  border-radius: 15px !important;
  text-align: left !important;
  justify-content: center !important;
}

html.sw-mobile-ui .cards .card h3,
html.sw-mobile-ui .attendance-stat-card__label,
html.sw-mobile-ui .student-stat-card__label,
html.sw-mobile-ui .coach-stat-card__label,
html.sw-mobile-ui .schedule-container .stat-card h3,
html.sw-mobile-ui .stat-card h3 {
  font-size: 12px !important;
  line-height: 1.25 !important;
  margin-bottom: 5px !important;
}

html.sw-mobile-ui .cards .card .val,
html.sw-mobile-ui .attendance-stat-card__val,
html.sw-mobile-ui .student-stat-card__val,
html.sw-mobile-ui .coach-stat-card__val,
html.sw-mobile-ui .schedule-container .stat-card .val,
html.sw-mobile-ui .stat-card .val {
  font-size: clamp(22px, 7vw, 30px) !important;
  line-height: 1.05 !important;
}

html.sw-mobile-ui .attendance-stat-card__icon,
html.sw-mobile-ui .student-stat-card__icon,
html.sw-mobile-ui .coach-stat-card__icon {
  top: 10px;
  right: 12px;
  font-size: 18px !important;
}

html.sw-mobile-ui .attendance-stat-card__sub,
html.sw-mobile-ui .student-stat-card__sub,
html.sw-mobile-ui .coach-stat-card__sub {
  font-size: 11px !important;
  line-height: 1.3 !important;
}

@media (max-width: 360px) {
  html.sw-mobile-ui .cards,
  html.sw-mobile-ui .dashboard-page__stats,
  html.sw-mobile-ui .attendance-stats-cards,
  html.sw-mobile-ui .student-stats-cards,
  html.sw-mobile-ui .coach-stats-cards,
  html.sw-mobile-ui .sched-stat-cards,
  html.sw-mobile-ui .confirmations-stats-compact,
  html.sw-mobile-ui .confirmations-stats-strip,
  html.sw-mobile-ui .finance-page__stats,
  html.sw-mobile-ui .students-progress__cards {
    grid-template-columns: 1fr !important;
  }
}
