:root{
  --ink:#2b2b2b; --paper:#fff; --sub:#7a7a7a; --line:#ececec;
  --navy:#3a3a4a; --teal:#3fae8f; --cream:#f5e6a8; --orange:#f0a04b; --coral:#e8604c;
  --bg:#f7f5ef;
}
html{ overflow-y:scroll; }
*{box-sizing:border-box;}
::selection{ background:#d0d0d0; color:var(--ink); }
::-moz-selection{ background:#d0d0d0; color:var(--ink); }
.ptr-indicator{
  position:fixed; top:-50px; left:50%; transform:translate(-50%, 0) rotate(0deg);
  width:36px; height:36px; border-radius:50%; background:var(--paper);
  box-shadow:0 2px 8px rgba(0,0,0,0.15); display:flex; align-items:center; justify-content:center;
  color:var(--coral); font-size:15px; z-index:2000; pointer-events:none;
}
.ptr-indicator.ptr-releasing{ transition:top .2s ease; }
.ptr-indicator.ptr-refreshing i{ animation:ptr-spin .8s linear infinite; }
@keyframes ptr-spin{ from{ transform:rotate(0deg); } to{ transform:rotate(360deg); } }
body{
  margin:0; padding:32px 16px 110px; color:var(--ink);
  font-family:"Nunito", sans-serif; font-weight:600;
  min-height:100vh; background:var(--bg);
  display:flex; justify-content:center;
}
.page{ width:100%; max-width:900px; }

.hero{ display:flex; align-items:center; justify-content:center; gap:14px; margin-bottom:8px; }
.hero h1{
  font-family:"Nunito", sans-serif; font-weight:900; font-size:34px; margin:0; letter-spacing:0.5px;
}
.hero h1 .c1{ color:var(--coral); }
.hero h1 .c2{ color:var(--navy); }

.stripe-bar{
  height:10px; border-radius:6px; overflow:hidden; display:flex; margin:0 auto 26px; max-width:420px;
}
.stripe-bar span{ flex:1; }
.stripe-bar .s1{ background:var(--navy); flex-grow:3; }
.stripe-bar .s2{ background:var(--teal); }
.stripe-bar .s3{ background:var(--cream); }
.stripe-bar .s4{ background:var(--orange); }
.stripe-bar .s5{ background:var(--coral); flex-grow:2; }

.sheet{
  background:var(--paper); padding:24px 22px 26px; margin-bottom:15px;
  border-radius:20px; box-shadow:0 8px 24px rgba(0,0,0,0.08);
}

.ad-banner{
  display:flex; align-items:center; gap:12px; text-decoration:none; cursor:pointer;
}
.ad-banner-tag{ flex-shrink:0; cursor:default; }
.ad-banner-text-wrap{
  display:flex; flex-direction:column; justify-content:center;
  width:100%;
}
.ad-banner-text{
  color:var(--ink); font-size:13.5px; font-weight:700; line-height:1.5;
  opacity:1; transform:translateY(0); transition:opacity .35s ease, transform .35s ease;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden;
}
.ad-banner-text.fading{ opacity:0; transform:translateY(4px); }

fieldset{ border:none; margin:0 0 26px; padding:0; }
.row-pair{ display:flex; gap:24px; flex-wrap:wrap; }
.row-pair fieldset{ flex:1 1 200px; }
.field-block{ --accent:#000; }
.section-head{ display:flex; align-items:center; gap:8px; margin-bottom:10px; flex-wrap:wrap; align-content:flex-start; }
#mailDisclaimerSheet .section-head{ margin-bottom:0; }
.section-tag{
  display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; gap:6px;
  height:31px; padding:0 16px; font-size:13px; font-weight:800; border-radius:999px;
  background:var(--accent); color:#fff;
}
.section-btn{
  display:inline-flex; align-items:center; box-sizing:border-box; height:31px;
  font-size:12.5px; padding:0 12px; border:1.5px solid var(--line);
  border-radius:999px; background:var(--paper); color:var(--sub); cursor:pointer; font-weight:700;
  font-family:inherit;
}
.section-btn:hover{ border-color:var(--accent); color:var(--accent); }
.section-btn:disabled{ cursor:not-allowed; opacity:0.5; }
.section-btn:disabled:hover{ border-color:var(--line); color:var(--sub); }
#addFavoriteBtn:not(:disabled){ background:var(--coral); border-color:var(--coral); color:#fff; }
#clearMemoryBtn{ background:var(--navy); border-color:var(--navy); color:#fff; }
.section-btn i{ padding-right:8px; font-size:13px; }
.section-search{
  width:100%; font-size:13px; padding:9px 14px; margin-bottom:10px;
  border:1.5px solid var(--line); border-radius:999px; background:var(--paper);
  font-family:inherit; font-weight:600;
}
.section-search:focus{ outline:none; border-color:var(--accent); }
.search-wrap{ position:relative; margin-bottom:10px; }
.search-wrap .section-search{ padding-left:40px; padding-right:36px; margin-bottom:0; }
.search-wrap .search-icons{
  position:absolute; left:16px; top:0; bottom:0;
  display:flex; align-items:center; justify-content:center;
  color:var(--sub); pointer-events:none; font-size:13px; line-height:1;
}
.search-wrap .search-clear{
  position:absolute; right:10px; top:0; bottom:0;
  display:none; align-items:center; justify-content:center;
  width:22px; color:var(--sub); font-size:15px; line-height:1;
  background:none; border:none; padding:0; cursor:pointer; font-family:inherit;
}
.search-wrap .search-clear.visible{ display:flex; }
.search-wrap .search-clear:hover{ color:var(--ink); }

.pill-grid{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; align-content:flex-start; }
.grid-break{ flex-basis:100%; height:0; }
.pill{ display:inline-block; }
.pill input{ position:absolute; opacity:0; width:0; height:0; }
.pill label{
  display:inline-flex; align-items:center; box-sizing:border-box; height:31px;
  padding:0 14px; border:1.5px solid var(--line); border-radius:999px;
  font-size:12.5px; cursor:pointer; background:var(--paper); font-weight:700;
  color:var(--ink); user-select:none; white-space:nowrap;
  transition:background-color .2s ease, color .2s ease, border-color .2s ease;
}
#dayGrid .pill input:not(:checked) + label:hover,
#timeGrid .pill input:not(:checked) + label:hover,
#branchGrid .pill input:not(:checked) + label:hover,
#roomGrid .pill input:not(:checked) + label:hover,
#courseGrid .pill input:not(:checked) + label:hover,
#teacherGrid .pill input:not(:checked) + label:hover{
  border-style:dashed; border-color:var(--accent); color:var(--accent);
}
.pill input:checked + label{
  background-color:var(--accent); color:#fff; border-color:var(--accent);
  background-image:linear-gradient(45deg, rgba(255,255,255,.25) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.25) 50%, rgba(255,255,255,.25) 75%, transparent 75%, transparent);
  background-size:1.5rem 1.5rem;
  animation:pill-stripes 2s linear infinite;
}
@keyframes pill-stripes{
  from{ background-position:1.5rem 0; }
  to{ background-position:0 0; }
}
.pill-btn{
  display:inline-flex; align-items:center; box-sizing:border-box; height:31px;
  padding:0 14px; border:1.5px dashed var(--line); border-radius:999px;
  font-size:12.5px; cursor:pointer; background:var(--paper); font-weight:700;
  color:var(--ink); user-select:none; white-space:nowrap; font-family:inherit;
  transition:border-color .2s ease, color .2s ease;
}
.pill-btn:hover{ border-color:var(--accent); color:var(--accent); }
.pill input:focus-visible + label{ outline:2px solid var(--accent); outline-offset:2px; }
.pill.hidden{ display:none; }

.empty-hint{ color:var(--sub); font-size:12px; padding:6px 2px; }

.branch-stats-filter-row{ display:flex; gap:8px; margin-bottom:14px; }
.branch-stats-select{ flex:1; min-width:0; }
/* 圖表資料回來前只顯示「讀取中…」文字，載入後 Chart.js 撐開高度，先保留高度避免版面被推開造成 CLS。 */
.branch-stats-wrap{ font-size:12.5px; overflow:hidden; text-align:center; min-height:200px; }

/* 自製下拉選單：外觀跟 .section-btn 一致，但不用原生 <select>（原生下拉的箭頭位置/樣式沒辦法客製）。 */
.custom-select{ position:relative; }
.custom-select-trigger{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  width:100%; height:31px; box-sizing:border-box; font-size:12.5px; padding:0 12px;
  border:1.5px solid var(--line); border-radius:999px; background:var(--paper);
  font-family:inherit; font-weight:700; color:var(--ink);
  cursor:pointer; text-align:left;
}
.custom-select-trigger:hover,
.custom-select.open .custom-select-trigger{ border-style:dashed; border-color:var(--accent); color:var(--accent); }
.custom-select-trigger:focus{ outline:none; border-color:var(--accent); }
.custom-select-label{ flex:1; min-width:0; text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.custom-select-arrow{ flex:none; font-size:11px; color:var(--sub); transition:transform .15s ease; }
.custom-select.open .custom-select-arrow{ transform:rotate(180deg); }
.custom-select-menu{
  display:none; position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:20;
  background:var(--paper); border:1.5px solid var(--line); border-radius:14px;
  box-shadow:0 8px 24px rgba(0,0,0,0.12); padding:6px; max-height:240px; overflow-y:auto;
}
.custom-select.open .custom-select-menu{ display:block; }
.custom-select-option{
  padding:8px 12px; border-radius:10px; font-size:12.5px; font-weight:600; color:var(--ink);
  cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:center;
}
.custom-select-option:hover{ background:rgba(0,0,0,0.05); }
.custom-select-option.selected{ color:var(--accent); background:color-mix(in srgb, var(--accent) 12%, transparent); }
/* 月份選單固定 12 個選項，排成 4 欄 3 列的格狀，不要拉成一條長長的直式列表。 */
#branchStatsMonth.open .custom-select-menu,
#courseStatsMonth.open .custom-select-menu,
#teacherStatsMonth.open .custom-select-menu{
  display:grid; grid-template-columns:repeat(4, 1fr); gap:4px;
  left:auto; right:0; width:max(100%, 260px);
}
#branchStatsMonth .custom-select-option,
#courseStatsMonth .custom-select-option,
#teacherStatsMonth .custom-select-option{
  padding:12px 3px;
}

.stats-chart-legend{ display:flex; justify-content:center; gap:16px; margin-top:14px; font-size:12px; color:var(--sub); }
.stats-chart-legend-item{ display:flex; align-items:center; gap:6px; }
.stats-chart-legend-swatch{ width:14px; height:5px; border-radius:3px; display:inline-block; }
.fav-empty-hint{ flex:1; min-width:0; font-size:12.5px; }

.notify-hint{ padding:10px 2px; }
.notify-hint-title{ color:var(--ink); font-size:13px; font-weight:700; margin-bottom:6px; }
.notify-hint-tip{ display:flex; align-items:center; gap:6px; color:#d99a1b; font-size:12px; margin-bottom:8px; }
.notify-hint-tip i{ font-size:12px; }
.notify-hint-steps{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.notify-hint-steps li{ display:flex; align-items:center; gap:6px; color:var(--sub); font-size:12px; line-height:1.5; }
.notify-hint-steps i{ color:var(--accent); font-size:12px; }
.notify-hint-num{
  flex:none; width:16px; height:16px; border-radius:50%; background:var(--accent);
  color:#fff; font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center;
}

.collapsible{
  position:relative; max-height:160px; overflow:hidden;
  transition:max-height .3s ease;
}
#courseWrap{ max-height:240px; }
.collapsible.expanded{ max-height:3000px; }
.collapsible .fade-overlay{
  position:absolute; left:0; right:0; bottom:0; height:60px;
  background:linear-gradient(to bottom, rgba(247,245,239,0) 0%, var(--paper) 60%);
  pointer-events:auto; cursor:default; transition:opacity .2s ease;
}
.collapsible.expanded .fade-overlay{ opacity:0; pointer-events:none; }
.more-btn-row{ display:flex; justify-content:center; margin-top:6px; }
.more-btn{
  display:flex; align-items:center; justify-content:center;
  height:31px; padding:0 22px; border:1.5px solid var(--line); border-radius:999px;
  background:var(--paper); color:var(--sub); cursor:pointer;
}
.more-btn:hover{ border-style:dashed; border-color:var(--accent); color:var(--accent); }
.more-btn i{ transition:transform .2s ease; font-size:12px; }
.more-btn.expanded i{ transform:rotate(180deg); }

.zone-toggle {
  display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; height: 31px;
  padding: 0 16px;
  border: 1.5px dashed var(--accent);
  border-radius: 999px;
  background: var(--paper);
  color: var(--accent);
  font-weight: 700; font-size: 12.5px;
  font-family: "Nunito", sans-serif; cursor: pointer;
  transition: background-color 0.2s ease;
}

.zone-toggle i {
  font-size: 11px; transition: transform .2s ease;
}
.zone-toggle.expanded i {
  transform: rotate(180deg);
}
.zone-group{ display:contents; }
.zone-group.collapsed{ display:none; }

.submit-btn-wrap, .back-btn-wrap{
  position:fixed; left:50%; bottom:22px; transform:translateX(-50%); z-index:500;
  display:flex; flex-direction:row; align-items:flex-end; gap:14px;
}
.submit-btn{
  width:60px; height:60px; border-radius:50%;
  font-size:22px; border:none; background:var(--coral); color:#fff; cursor:pointer;
  box-shadow:0 6px 16px rgba(232,96,76,0.45);
  display:flex; align-items:center; justify-content:center;
  transition:background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .1s ease;
}
.submit-btn:disabled{
  background:#ccc; color:#999; cursor:not-allowed; box-shadow:none; pointer-events:none;
}
/* 查詢送出中：跟「沒選篩選條件不能按」的灰色disabled區分開來，維持紅色只是暫時不能再按一次。 */
.submit-btn.busy:disabled{
  background:var(--coral); color:#fff; cursor:wait; box-shadow:0 6px 16px rgba(232,96,76,0.45);
}
#scheduleSubmitBtn, #backBtn, #mailBackBtn, #adminBackBtn, #adminLoginBackBtn{ width:80px; height:80px; font-size:28px; }
.gray-btn{ background:#ccc; color:#999; box-shadow:none; }
.reset-active{ background:#5aa9e6; box-shadow:0 6px 16px rgba(90,169,230,0.45); }
.teal-btn{ background:var(--teal); box-shadow:0 6px 16px rgba(63,174,143,0.45); }
.teal-btn:hover{ background:#359379; }
.teal-btn:active{ box-shadow:0 3px 10px rgba(63,174,143,0.4); }
.orange-btn{ background:var(--orange); box-shadow:0 6px 16px rgba(240,160,75,0.45); }
.blue-btn{ background:#4a90d9; box-shadow:0 6px 16px rgba(74,144,217,0.45); }
.hidden{ display:none; }
#filterForm, #resultView, #mailView{ transition:opacity .2s ease; }
#filterForm.view-fade-in, #resultView.view-fade-in, #mailView.view-fade-in{ opacity:0; }
.tooltip-wrap{ position:relative; display:inline-flex; }
.tooltip-wrap.hidden{ display:none; }
.hint-tooltip, .pill-warn-tooltip{
  background:var(--navy); color:#fff; font-size:12.5px; font-weight:700;
  padding:8px 14px; border-radius:12px; white-space:nowrap; z-index:600;
  box-shadow:0 6px 16px rgba(0,0,0,0.18);
  opacity:0; visibility:hidden; transform:translate(-50%, 6px);
  transition:opacity .15s ease, transform .15s ease, visibility .15s ease;
}
.hint-tooltip{ position:absolute; left:50%; bottom:100%; margin-bottom:10px; }
.hint-tooltip.wrap{ white-space:normal; width:220px; text-align:center; line-height:1.5; }
#privacyTooltip.wrap{ width:300px; text-align:left; }
#privacyTooltip i{ width:1.25em; }
@media (max-width:480px){
  #privacyTooltip.wrap{ width:220px; }
}
.pill-warn-tooltip{ position:fixed; pointer-events:none; }
.hint-tooltip::after, .pill-warn-tooltip::after{
  content:""; position:absolute; top:100%; left:var(--arrow-left, 50%); transform:translateX(-50%);
  border-width:6px 6px 0 6px; border-style:solid; border-color:var(--navy) transparent transparent transparent;
}
.hint-tooltip.visible, .pill-warn-tooltip.visible{ opacity:1; visibility:visible; transform:translate(-50%, 0); }
.pill-warn-tooltip.wrap{ white-space:normal; max-width:240px; text-align:center; line-height:1.4; }

.modal-overlay{
  position:fixed; top:0; left:0; width:100%; height:100%;
  background:rgba(43,43,43,0.45);
  display:flex; align-items:center; justify-content:center; z-index:1000;
  opacity:1; visibility:visible; pointer-events:auto;
  transition:opacity .2s ease, visibility .2s ease;
}
.modal-overlay.hidden{
  display:flex; opacity:0; visibility:hidden; pointer-events:none;
}
.modal-box{
  position:relative; background:var(--paper); padding:24px 22px 24px; border-radius:20px;
  box-shadow:0 8px 24px rgba(0,0,0,0.2); max-width:320px; width:90%; text-align:center;
}
.modal-text{ margin:0 0 18px; font-size:14px; color:var(--ink); font-weight:700; }
.modal-actions{ display:flex; gap:10px; justify-content:center; }
.modal-btn{
  flex:1; height:38px; border-radius:999px; font-weight:800; font-size:13px;
  cursor:pointer; font-family:inherit; border:1.5px solid var(--line); background:var(--paper); color:var(--sub);
  transition:background-color .2s ease, border-color .2s ease, color .2s ease;
}
.modal-btn:hover{ border-color:var(--sub); }
.modal-btn:disabled{ background:#ccc; color:#999; border-color:#ccc; cursor:not-allowed; }
.modal-btn-confirm{ background:var(--coral); color:#fff; border-color:var(--coral); }
.modal-btn-confirm:hover{ background:#d8543f; border-color:#d8543f; }

.fav-modal-box{ position:relative; text-align:left; max-width:340px; }
.modal-close-btn{
  position:absolute; top:10px; right:10px; width:36px; height:36px;
  border:none; background:none; color:var(--sub); cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:17px;
}
.fav-modal-box .modal-close-btn{ top:22px; }
.fav-modal-field{ margin-bottom:16px; }
.fav-name-row{ display:flex; gap:8px; }
.fav-name-row .section-search{ flex:1; min-width:0; margin-bottom:0; }
.fav-name-random-btn{
  flex-shrink:0; padding:0 14px; border:1.5px solid var(--line); border-radius:999px;
  background:var(--paper); color:var(--sub); cursor:pointer; font-size:15px;
  transition:border-color .2s ease, border-style .2s ease, color .2s ease;
}
.fav-name-random-btn:hover, .fav-name-random-btn:focus{
  outline:none; border-style:dashed; border-color:var(--coral); color:var(--coral);
}
.fav-name-input-wrap{ position:relative; flex:1; min-width:0; }
.fav-name-input-wrap .section-search{ padding-right:36px; margin-bottom:0; transition:border-color .2s ease, border-style .2s ease; }
.fav-name-input-wrap .section-search:hover,
.fav-name-input-wrap .section-search:focus{ outline:none; border-style:dashed; border-color:var(--coral); }
.fav-name-input-wrap .search-clear{
  position:absolute; right:10px; top:0; bottom:0;
  display:none; align-items:center; justify-content:center;
  width:22px; color:var(--sub); font-size:15px; line-height:1;
  background:none; border:none; padding:0; cursor:pointer; font-family:inherit;
}
.fav-name-input-wrap .search-clear.visible{ display:flex; }
.fav-name-input-wrap .search-clear:hover{ color:var(--ink); }
.fav-modal-label{ display:block; font-size:12.5px; font-weight:800; color:var(--sub); margin-bottom:8px; }
.fav-icon-options, .fav-color-options{ display:flex; gap:8px; flex-wrap:wrap; justify-content:space-between; }
.fav-icon-options input, .fav-color-options input{ position:absolute; opacity:0; width:0; height:0; }
.fav-icon-options label{
  display:flex; align-items:center; justify-content:center;
  width:32px; height:32px; border-radius:50%; border:1.5px solid transparent;
  background:var(--paper); color:var(--sub); cursor:pointer; font-size:14px;
  transition:border-color .2s ease, color .2s ease, background-color .2s ease, transform .15s ease;
}
.fav-icon-options label:hover{ border-style:dashed; border-color:var(--navy); color:var(--navy); background:var(--bg); }
.fav-icon-options input:checked + label{ border-style:solid; border-color:var(--navy); color:var(--navy); background:var(--bg); transform:scale(1.1); }
.fav-color-options label{
  display:block; width:32px; height:32px; border-radius:50%; cursor:pointer;
  border:1.5px solid transparent; box-shadow:inset 0 0 0 1.5px rgba(0,0,0,0.08);
  transition:border-color .2s ease, transform .15s ease;
}
.fav-color-options label:hover{ border-style:dashed; border-color:var(--ink); }
.fav-color-options input:checked + label{ border-style:solid; border-color:var(--ink); transform:scale(1.1); }
.fav-item{
  display:inline-flex; align-items:center; box-sizing:border-box; height:31px;
  padding:0 14px; border-radius:999px; border:none; cursor:pointer;
  font-size:12.5px; font-weight:800; color:#fff; font-family:inherit;
}
.fav-item i{ padding-right:6px; }

.active-filters{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.active-filter-tag{
  display:inline-flex; align-items:center; height:28px; padding:0 12px;
  border-radius:999px; background:var(--bg); border:1.5px solid var(--line);
  font-size:12px; font-weight:700; color:var(--sub); white-space:nowrap; flex-shrink:0;
}
.active-filter-tag i{ padding-right:7px; font-size:12px; }
.active-filter-tag.has-tooltip{ cursor:pointer; }
.mail-disclaimer{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:12px;
  color:var(--sub); font-size:14px; font-weight:600; line-height:1.6;
}
.mail-disclaimer .section-tag{ flex-shrink:0; cursor:default; font-size:12.5px; }
.mail-disclaimer .section-tag i{ font-size:13px; }
#githubLinkIcon, #adminLinkIcon, #adminLoginBackBtn, #officialSiteLink{ cursor:pointer; text-decoration:none; }
#qrCodeBtn, #copyUrlBtn, #privacyBtn, #notifyInfoBtn{ border:none; font-family:inherit; cursor:pointer; }
#notifyInfoBtn{ background:var(--paper); color:var(--accent); border:1.5px solid var(--line); }
.qr-tooltip{ padding:10px; background:var(--paper); }
.qr-tooltip img{ display:block; width:132px; height:132px; }
.qr-tooltip::after{ border-color:var(--paper) transparent transparent transparent; }
.mail-disclaimer span:last-child:not(.section-tag){ flex:1; min-width:0; }
.result-row{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:8px 14px; border:1.5px solid var(--line); border-radius:14px; margin-bottom:8px;
  font-size:13px; font-weight:700; color:var(--ink); background:var(--paper);
}
.result-row-content{ min-width:0; }
.result-row.flagged{ border-color:var(--line); background:var(--paper); }
.result-flag-icon{ color:#f0b400; padding-right:6px; }
.teacher-link{
  color:#c9922e; cursor:pointer;
}
.teacher-link:hover{ color:#a3741a; }
.teacher-link.busy{ opacity:.5; pointer-events:none; }
.branch-map-link{
  color:#4a90d9; text-decoration:none; cursor:pointer;
}
.branch-map-link:hover{ text-decoration:underline; }

.mail-label{ margin:0 0 12px; font-size:13px; font-weight:700; color:var(--ink); }
.mail-textarea{
  width:100%; min-height:100px; font-size:12.5px; padding:14px; resize:none;
  border:1.5px solid var(--line); border-radius:16px; background:var(--paper);
  font-family:inherit; font-weight:600; color:var(--sub);
}
.mail-textarea:focus{ outline:none; border-style:dashed; border-color:var(--orange); }
.mail-textarea::placeholder{ color:var(--sub); }
.mail-textarea-wrap{ position:relative; }
.mail-sent-overlay{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,0.5); border-radius:16px;
  font-size:12.5px; font-weight:800; color:var(--ink);
}
.mail-sent-overlay.hidden{ display:none; }

#loadingOverlay{
  position:fixed; top:0; left:0; width:100%; height:100%;
  background:var(--paper);
  display:flex; align-items:center; justify-content:center; z-index:9999;
}
#loadingOverlay .loading-box{ display:flex; flex-direction:column; align-items:center; gap:12px; }
#loadingOverlay .blocks{ display:flex; gap:6px; }
#loadingOverlay .blocks span{
  width:12px; height:12px; border-radius:50%; background:var(--orange);
  animation:blink 1s ease-in-out infinite;
}
#loadingOverlay .blocks span:nth-child(2){ background:var(--teal); animation-delay:.15s; }
#loadingOverlay .blocks span:nth-child(3){ background:var(--coral); animation-delay:.3s; }
#loadingOverlay .blocks span:nth-child(4){ background:var(--navy); animation-delay:.45s; }
@keyframes blink{ 0%,49%{ opacity:1; transform:scale(1);} 50%,100%{ opacity:.3; transform:scale(.8);} }

#loadingOverlay.fade-out{ opacity:0; transition:opacity .2s; }

/* 課表通知：查詢結果列的鈴鐺(灰=未登記/黃=已登記)，跟「通知」清單區塊。 */
.bell-icon{
  flex-shrink:0; color:var(--sub); cursor:pointer; transition:color .2s ease, transform .1s ease;
  padding:10px; margin:-10px; box-sizing:content-box;
}
.bell-icon.armed{ color:#f0b400; }
.bell-icon.busy{ opacity:.5; pointer-events:none; }
#reminderView{ transition:opacity .2s ease; }
#reminderView.view-fade-in{ opacity:0; }
.reminder-row{ position:relative; display:flex; align-items:center; justify-content:space-between; gap:8px; transition:opacity .25s ease; }
.reminder-row.fading-out{ opacity:0; }
.reminder-text{ min-width:0; }
.reminder-teacher{ color:var(--ink); }
.reminder-notify-time{ font-size:11px; font-weight:600; color:var(--sub); margin-top:2px; }
.reminder-cancel-bell{ color:#f0b400; cursor:pointer; padding-left:10px; flex-shrink:0; }
.reminder-cancel-bell.busy{ opacity:.5; pointer-events:none; }
.reminder-cancel-overlay{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.88); border-radius:14px;
  font-size:13px; font-weight:800; color:var(--ink);
  opacity:0; transition:opacity .2s ease; pointer-events:none;
}
.reminder-cancel-overlay.visible{ opacity:1; }

.access-log-table-wrap{ overflow-x:auto; }
.access-log-table{ width:100%; border-collapse:collapse; font-size:12.5px; white-space:nowrap; }
.access-log-table th, .access-log-table td{
  padding:7px 10px; border-bottom:1px solid var(--line); text-align:left;
}
.access-log-table th{ color:var(--sub); font-weight:700; }
.access-log-table td.access-log-ua{
  max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:help;
}
.access-log-table tr.access-log-row-flagged td{ background:color-mix(in srgb, var(--coral) 12%, transparent); }
.access-log-table tr.access-log-row-flagged td:first-child{ font-weight:800; color:var(--coral); }
.access-log-table tr.access-log-row-regular td{ background:color-mix(in srgb, var(--orange) 14%, transparent); }
.access-log-table tr.access-log-row-regular td:first-child{ font-weight:800; color:var(--orange); }

@media (max-width:480px){
  body{ padding:20px 10px 100px; }
  .sheet{ padding:18px 14px 20px; border-radius:16px; }
  .hero h1{ font-size:24px; }
}

.visually-hidden{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

.site-about{
  margin-top:24px; padding:14px 16px; text-align:center;
  color:var(--sub); font-size:12px; line-height:1.6;
}
.site-about p{ max-width:520px; margin:0 auto; }
