:root {
  --ink: #142328;
  --muted: #4a6068;
  --brand: #0a3d45;
  --accent: #c45c26;
  --surface: rgba(255, 252, 248, 0.92);
  --line: rgba(20, 35, 40, 0.12);
  --ok: #1f6b4a;
  --warn: #8a5a12;
  --danger: #8b2e2e;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(10, 40, 48, 0.18);
  --font-ui: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --font-brand: "Outfit", "Noto Sans TC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overscroll-behavior-x: none;
  /* Android Chrome：勿鎖死垂直 overscroll，否則網址列收合要多滑一次 */
  overscroll-behavior-y: contain;
  /* 避免兩指放大後整頁橫向跑位 */
  overflow-x: hidden;
  /* 避免 Android 系統字級放大把首頁字級／間距拉歪 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.is-android,
html.is-android body {
  overscroll-behavior-y: auto;
}

/* Android：系統「字型／顯示大小」常把整頁 rem 撐大，看起來比 iPhone 粗一號。
   只調 html 基準字級（不動各元件個別規則），讓疏密與 iOS 對齊。 */
html.is-android {
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  font-size: 15px;
}

html.page-zoomed,
html.page-zoomed body {
  /* pinchZoomPanAppWide：放大後全站單指可上下左右滑動 */
  overflow-x: auto !important;
  overflow-y: auto !important;
  overscroll-behavior: auto !important;
  touch-action: pan-x pan-y pinch-zoom !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
}

/* 放大後覆寫所有內容區的 pan-y／manipulation（繪圖與燈箱除外） */
html.page-zoomed body *:not(canvas):not(.lightbox-stage):not(.lightbox-root):not(.lightbox-image) {
  touch-action: pan-x pan-y pinch-zoom !important;
}

/* shell 放大後勿再只准 pan-y，否則單指橫向拖不動 */
html.page-zoomed .shell,
html.page-zoomed .shell.view {
  touch-action: pan-x pan-y pinch-zoom !important;
  overflow: visible !important;
}

/* 右滑返回／燈箱開啟時仍鎖手勢 */
html.page-zoomed body.swipe-nav-active,
html.page-zoomed body.swipe-nav-active *,
html.page-zoomed body.lightbox-open,
html.page-zoomed body.lightbox-open * {
  touch-action: none !important;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: #d7e4e2;
  line-height: 1.55;
  /* manipulation 已含 pinch；勿加 pan-x 以免未放大時整頁橫移 */
  touch-action: manipulation;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 10% -10%, #f4e6d4 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 0%, #9fc3c0 0%, transparent 50%),
    linear-gradient(165deg, #e8f0ee 0%, #c5d8d4 48%, #a8c2bf 100%);
}

.pull-refresh {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: calc(2.4rem + env(safe-area-inset-top));
  padding: max(0.45rem, env(safe-area-inset-top)) 1rem 0.4rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-40%);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.pull-refresh.is-visible,
.pull-refresh.is-refreshing {
  opacity: 1;
  transform: translateY(0);
}

.pull-refresh-text {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand);
  background: rgba(255, 252, 248, 0.94);
  border: 1px solid rgba(10, 61, 69, 0.14);
  box-shadow: 0 8px 18px rgba(10, 40, 48, 0.12);
}

.pull-refresh.is-refreshing .pull-refresh-text::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid rgba(10, 61, 69, 0.22);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: pull-spin 0.7s linear infinite;
}

@keyframes pull-spin {
  to {
    transform: rotate(360deg);
  }
}

.shell {
  width: min(100%, 430px);
  margin: 0 auto;
  padding: max(1.1rem, env(safe-area-inset-top)) 1rem max(1.25rem, env(safe-area-inset-bottom));
  /* pinchZoomEnabled：內容區兩指放大 */
  touch-action: pan-y pinch-zoom;
}

/* 首頁整體下移，避開狀態列／瀏海過於貼頂 */
#homeView.shell {
  padding-top: max(2.85rem, calc(env(safe-area-inset-top, 0px) + 1.75rem));
  padding-left: 1.1rem;
  padding-right: 1.1rem;
}

/* Android 網頁版：瀏覽器底欄常不計入 safe-area，額外留空避免底部要連滑兩次才露出。
   PWA（加到主畫面）沒有網址列，勿再套這段，否則首頁會被撐出大片空白、跟 iPhone 差很多。 */
html.is-android.is-web-browser {
  --android-chrome-gap: 4.75rem;
}

html.is-android.is-web-browser .shell {
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom), var(--android-chrome-gap));
}

html.is-android.is-web-browser #homeView.shell,
html.is-android.is-web-browser #notesHubView.shell,
html.is-android.is-web-browser #trashView.shell,
html.is-android.is-web-browser #backupView.shell,
html.is-android.is-web-browser #noteDraftPreviewView.shell,
html.is-android.is-web-browser #alarmEditorView.shell,
html.is-android.is-web-browser #alarmDraftPreviewView.shell,
html.is-android.is-web-browser #guestBoardView.shell,
html.is-android.is-web-browser #systemView.shell {
  padding-bottom: max(1.75rem, env(safe-area-inset-bottom), var(--android-chrome-gap));
}

html.is-android.is-web-browser .trash-entry-wrap {
  margin-bottom: 0.35rem;
  padding-bottom: 0.15rem;
}

#backupView.shell {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

html.is-android.is-web-browser #backupView.shell {
  padding-bottom: max(1.75rem, env(safe-area-inset-bottom), var(--android-chrome-gap));
}

/* Android PWA：與 iPhone 一樣走 safe-area，不再硬加網址列空隙 */
html.is-android.is-pwa .shell {
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
}

html.is-android.is-pwa #homeView.shell {
  padding-top: max(2.85rem, calc(env(safe-area-inset-top, 0px) + 1.75rem));
  padding-bottom: max(1.35rem, env(safe-area-inset-bottom, 0px));
}

.hero {
  margin-bottom: 1.05rem;
  animation: rise 520ms ease-out both;
}

/* 首頁：標題區行距與區塊間距拉開，避免擠成一團 */
#homeView .hero {
  margin-bottom: 2.35rem;
}

.brand {
  margin: 0;
  font-family: var(--font-brand);
  font-size: clamp(2.15rem, 9.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand);
  line-height: 1.12;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.55rem;
}

/* brandBetaLabel：品牌旁小字 BETA 標示 */
.brand-beta {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  color: rgba(196, 92, 38, 0.72);
  vertical-align: baseline;
  position: relative;
  top: -0.15em;
}

/* appReleaseVersion：首頁版本號（測試期 0.x，正式 1.0 起） */
.brand-version {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  color: rgba(10, 61, 69, 0.55);
  vertical-align: baseline;
  position: relative;
  top: -0.15em;
}

.home-greeting {
  margin: 1.15rem 0 0;
  font-size: calc(clamp(1.32rem, 5.4vw, 1.65rem) + 1px);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.home-greeting[hidden] {
  display: none !important;
}

.home-greeting .home-greeting-name {
  color: var(--brand);
}

.headline {
  margin: 0.85rem 0 0;
  font-size: calc(1.05rem + 1px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
}

#homeView .headline {
  margin-top: 1.05rem;
}

.home-web-hint {
  margin: 0.65rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
}

.home-web-hint[hidden] {
  display: none !important;
}

/* 網頁版提示中「完整體驗」醒目標示（橘底白字） */
.web-full-experience-mark {
  display: inline;
  padding: 0.02em 0.2em;
  border-radius: 0.28rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff8f2;
  background: linear-gradient(180deg, #e07a3a 0%, var(--accent) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 1px 3px rgba(196, 92, 38, 0.22);
  white-space: nowrap;
}

.notes-hub-subtitle .web-full-experience-mark {
  vertical-align: baseline;
}

/* 首頁更新預告：小標籤，不搶主視覺 */
.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.85rem;
  overflow: visible;
}

.home-hero-action-wrap {
  position: relative;
  display: inline-flex;
  overflow: visible;
}

.home-hero-action-wrap[hidden] {
  display: none !important;
}

.home-release-notes-card {
  max-width: min(26rem, calc(100vw - 1.5rem));
  max-height: min(78vh, 36rem);
  overflow: auto;
}

.home-release-notes-reviewer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 0.95rem;
}

.home-release-notes-reviewer-bar[hidden] {
  display: none !important;
}

.home-release-notes-manage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 2.35rem;
  padding: 0.45rem 1.05rem;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.2;
  color: #fff8f2;
  background: linear-gradient(145deg, #12707c 0%, #0f5560 42%, #0a3d45 100%);
  box-shadow:
    0 8px 18px rgba(10, 61, 69, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.home-release-notes-manage-btn.is-compose {
  background: linear-gradient(145deg, #e08a4f 0%, #c45c26 88%);
  box-shadow:
    0 8px 18px rgba(154, 69, 28, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.home-release-notes-manage-btn:active {
  transform: scale(0.97);
  filter: brightness(0.94);
}

.home-release-notes-compose {
  margin: 0.35rem 0 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.home-release-notes-compose-form {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.home-release-notes-compose-form .app-confirm-ok {
  grid-column: 1 / -1;
}

.home-release-notes-actions.has-cancel {
  grid-template-columns: 1fr 1fr;
}

.home-release-notes-version-block {
  margin: 0 0 1rem;
  padding: 0.75rem 0.8rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(10, 61, 69, 0.14);
  background: rgba(8, 48, 54, 0.035);
}

.home-release-notes-version-block + .home-release-notes-version-block {
  margin-top: 0.85rem;
}

.home-release-notes-version-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 0.65rem;
  margin: 0 0 0.65rem;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--brand);
}

.home-release-notes-version-label {
  min-width: 0;
}

.home-release-notes-version-time {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
}

.home-release-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.home-release-notes-item {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 248, 0.95);
}

.home-release-notes-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink, #1a2a2e);
}

.home-release-notes-empty {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.home-release-notes-pending {
  margin: 0.35rem 0 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.home-release-notes-pending-title {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  color: var(--brand);
}

.home-release-notes-pending-list {
  display: grid;
  gap: 0.65rem;
}

.home-release-notes-pending-row {
  display: grid;
  grid-template-columns: auto 4.6rem minmax(0, 1fr);
  gap: 0.4rem 0.45rem;
  align-items: center;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(10, 61, 69, 0.14);
  background: rgba(255, 252, 248, 0.95);
}

.home-release-notes-version-block .home-release-notes-pending-row {
  margin-bottom: 0.5rem;
}

.home-release-notes-check,
.home-release-notes-check-spacer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
}

.home-release-notes-checkbox {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #0f5560;
}

.home-release-notes-version-input {
  margin: 0;
  min-height: 2.2rem;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  font-weight: 700;
  text-align: center;
}

.home-release-notes-title-input {
  margin: 0;
  min-height: 2.2rem;
  width: 100%;
}

.home-release-notes-pending-row-actions {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.home-release-notes-pending-actions {
  margin-top: 0.75rem;
}

.home-release-notes-status {
  margin: 0.55rem 0 0;
  font-size: 0.86rem;
  color: var(--brand);
}

.home-release-notes-status.is-error {
  color: var(--danger, #a33);
}

.home-roadmap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(10, 61, 69, 0.18);
  background: rgba(255, 252, 248, 0.78);
  color: var(--brand);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 3px 10px rgba(10, 40, 48, 0.06);
}

.home-roadmap-btn:active {
  transform: scale(0.98);
}

.home-roadmap-overlay .home-roadmap-card {
  width: min(100%, 23.5rem);
  padding: 1.2rem 1.15rem 1.05rem;
}

.home-roadmap-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  /* homeRoadmapAccentSoft：橘色只作低調點綴 */
  color: rgba(196, 92, 38, 0.58);
}

.home-roadmap-title {
  margin: 0.35rem 0 0;
  font-family: var(--font-brand);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.3;
}

.home-roadmap-lead {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

.home-roadmap-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.home-roadmap-empty {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

.home-roadmap-item,
.home-roadmap-item-front {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  background: rgba(10, 61, 69, 0.05);
  border: 1px solid rgba(10, 61, 69, 0.1);
  border-left: 2px solid rgba(196, 92, 38, 0.18);
}

.home-roadmap-swipe-row {
  border-radius: 12px;
}

.home-roadmap-item-front {
  /* 前景必須不透明，不可透出左滑綠色底 */
  background: #f7faf9;
  width: 100%;
  box-sizing: border-box;
}

.home-roadmap-item.is-completed,
.home-roadmap-swipe-row.is-completed .home-roadmap-item-front {
  border-color: rgba(26, 107, 72, 0.42);
  border-left-color: #1a6b48;
  border-left-width: 3px;
  background: rgba(214, 240, 224, 0.95);
  box-shadow: inset 0 0 0 1px rgba(26, 107, 72, 0.08);
}

.home-roadmap-item.is-completed .home-roadmap-step,
.home-roadmap-swipe-row.is-completed .home-roadmap-step {
  background: linear-gradient(145deg, #2f9a6a 0%, #1a6b48 100%);
}

.home-roadmap-item-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
}

.home-roadmap-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex: 0 0 auto;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff8f2;
  background: linear-gradient(180deg, #2f9a6a 0%, #1a6b48 100%);
  border: 1px solid rgba(8, 48, 54, 0.28);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 2px 6px rgba(26, 107, 72, 0.28);
  white-space: nowrap;
}

.home-roadmap-done-badge-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  background: rgba(255, 248, 242, 0.22);
  font-size: 0.7rem;
  line-height: 1;
}

.home-roadmap-step {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff8f2;
  /* 三個步驟圓點一律相同品牌綠 */
  background: linear-gradient(145deg, #0f5560 0%, #0a3d45 100%);
}

.home-roadmap-item-body {
  min-width: 0;
  display: grid;
  gap: 0.22rem;
}

.home-roadmap-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.home-roadmap-item-text {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
}

.home-roadmap-actions {
  grid-template-columns: 1fr;
}

.home-guest-board-heading {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}

#guestBoardView .page-title.home-guest-board-title {
  margin: 0;
}

.home-guest-board-beta {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(196, 92, 38, 0.72);
}

.home-guest-board-lead {
  margin-top: 0.35rem;
}

.home-guest-board-channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 0.85rem 0 0.35rem;
  overflow: visible;
}

.home-guest-board-channel-wrap {
  position: relative;
  min-width: 0;
  overflow: visible;
}

.home-guest-board-channel-btn {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.45rem;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(10, 61, 69, 0.16);
  border-radius: 12px;
  background: rgba(255, 252, 248, 0.88);
  color: var(--brand);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(10, 40, 48, 0.06);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.home-guest-board-channel-label {
  display: block;
  max-width: 100%;
  text-align: center;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

/* home-ios-red-dot／channel-ios-red-dot-2x：iPhone 風格未讀紅點，直徑 1.28rem；掛外層勿放進 button */
.home-ios-red-dot,
.home-guest-board-channel-new-badge {
  position: absolute;
  top: -0.28rem;
  right: -0.24rem;
  z-index: 2;
  width: 1.28rem;
  height: 1.28rem;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  background: #ff3b30;
  border: 0.22rem solid #fff8f2;
  box-shadow: 0 0 0 1px rgba(80, 18, 12, 0.12);
  color: transparent;
  font-size: 0;
  line-height: 0;
  pointer-events: none;
}

.home-ios-red-dot[hidden],
.home-guest-board-channel-new-badge[hidden] {
  display: none !important;
}

.home-guest-board-channel-btn:active {
  transform: scale(0.98);
}

.home-guest-board-channel-btn.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(180deg, #1a6b75 0%, #0a3d45 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 16px rgba(10, 61, 69, 0.28);
}

.home-guest-board-channel-note {
  margin: 0.55rem 0 0;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(196, 92, 38, 0.22);
  background: rgba(196, 92, 38, 0.08);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.45;
}

.home-guest-board-composer.is-alarm-channel .home-guest-board-composer-toggle,
.home-guest-board-composer.is-alarm-channel:not(.is-replying) .home-guest-board-form {
  display: none;
}

.home-guest-board-composer.is-alarm-channel.is-replying .home-guest-board-channel-note {
  display: none;
}

.home-guest-board-composer.is-alarm-channel.is-replying .home-guest-board-form {
  display: grid;
}

.home-guest-board-composer {
  margin-top: 0.85rem;
}

.home-guest-board-composer-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.55rem;
  margin: 0;
  padding: 0.5rem 0.85rem;
  border: 1.5px dashed rgba(15, 85, 96, 0.35);
  border-radius: 12px;
  background: rgba(255, 252, 248, 0.72);
  color: var(--brand);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.home-guest-board-composer-toggle:active {
  transform: scale(0.99);
}

.home-guest-board-composer.is-collapsed .home-guest-board-form {
  display: none;
}

.home-guest-board-composer:not(.is-collapsed) .home-guest-board-composer-toggle {
  margin-bottom: 0.55rem;
  border-style: solid;
  background: #fff;
}

.home-guest-board-form {
  margin-top: 0;
  display: grid;
  gap: 0.35rem;
}

.home-guest-board-form .search-label {
  margin: 0.35rem 0 0;
}

.home-guest-board-mode {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--brand);
}

.home-guest-board-message {
  resize: vertical;
  min-height: 9rem;
}

.home-guest-board-status {
  margin: 0.45rem 0 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--muted);
}

.home-guest-board-status.is-error {
  color: #b42318;
}

.home-guest-board-form-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.home-guest-board-form-actions .primary-btn,
.home-guest-board-form-actions .app-confirm-btn {
  flex: 1;
  min-height: 2.65rem;
}

.home-guest-board-feed {
  margin-top: 1.15rem;
}

.home-guest-board-sort {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.home-guest-board-sort-btn {
  flex: 0 0 auto;
  min-height: 1.85rem;
  margin: 0;
  padding: 0.22rem 0.65rem;
  border: 1.5px solid rgba(15, 85, 96, 0.22);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.home-guest-board-sort-btn.is-active {
  border-color: transparent;
  background: linear-gradient(145deg, #0f5560 0%, #0a3d45 100%);
  color: #fff8f2;
  box-shadow: 0 4px 10px rgba(10, 61, 69, 0.18);
}

.home-guest-board-sort-btn:active {
  transform: scale(0.98);
}

.home-guest-board-pinned {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.home-guest-board-pinned[hidden] {
  display: none;
}

.home-guest-board-pinned-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--brand);
}

.home-guest-board-item.is-pinned {
  border-color: rgba(15, 85, 96, 0.28);
  background: rgba(15, 85, 96, 0.06);
}

.home-guest-board-pin-badge {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
  background: #0f5560;
  vertical-align: middle;
}

.home-guest-board-item-meta-end {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.home-guest-board-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff8f2;
  background: linear-gradient(180deg, #2f9a6a 0%, #1a6b48 100%);
  border: 1px solid rgba(8, 48, 54, 0.28);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 2px 6px rgba(26, 107, 72, 0.28);
  white-space: nowrap;
}

.home-guest-board-done-badge-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  background: rgba(255, 248, 242, 0.22);
  font-size: 0.7rem;
  line-height: 1;
}

.home-guest-board-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff8f2;
  background: linear-gradient(180deg, #6a7a82 0%, #44555c 100%);
  border: 1px solid rgba(8, 48, 54, 0.28);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 2px 6px rgba(40, 55, 60, 0.28);
  white-space: nowrap;
}

.home-guest-board-lock-badge-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  background: rgba(255, 248, 242, 0.2);
  font-size: 0.58rem;
  line-height: 1;
}

.home-guest-board-item.is-completed {
  border-color: rgba(26, 107, 72, 0.28);
  background: rgba(232, 246, 238, 0.55);
}

.home-guest-board-item.is-locked {
  border-color: rgba(68, 85, 92, 0.3);
}

.home-guest-board-list {
  display: grid;
  gap: 0.65rem;
}

.home-guest-board-item {
  padding: 0.8rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 252, 248, 0.92);
  border: 1px solid rgba(10, 61, 69, 0.12);
  box-shadow: 0 6px 16px rgba(10, 40, 48, 0.08);
}

.home-guest-board-item.is-reply {
  margin-left: 0.85rem;
  background: rgba(10, 61, 69, 0.04);
  box-shadow: none;
}

.home-guest-board-item-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.28rem;
}

.home-guest-board-item-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand);
}

.home-guest-board-item-time {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: var(--muted);
}

.home-guest-board-item-text {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.home-guest-board-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.guest-board-reaction-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin: 0.45rem 0 0;
  padding: 0.12rem 0.45rem 0.12rem 0.2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 61, 69, 0.06);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  min-height: 1.7rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.guest-board-reaction-icons {
  display: inline-flex;
  align-items: center;
}

.guest-board-reaction-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-left: -0.28rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 252, 248, 0.95);
  font-size: 0.78rem;
  line-height: 1;
}

.guest-board-reaction-icon:first-child {
  margin-left: 0;
}

.guest-board-reaction-count {
  color: var(--ink);
}

.guest-board-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.guest-board-like-emoji {
  font-size: 0.92rem;
  line-height: 1;
}

.guest-board-like-btn.is-reacted.is-like {
  color: #1877f2;
  border-color: rgba(24, 119, 242, 0.28);
  background: rgba(24, 119, 242, 0.1);
}

.guest-board-like-btn.is-reacted.is-love {
  color: #f33e58;
  border-color: rgba(243, 62, 88, 0.28);
  background: rgba(243, 62, 88, 0.1);
}

.guest-board-like-btn.is-reacted.is-haha,
.guest-board-like-btn.is-reacted.is-wow,
.guest-board-like-btn.is-reacted.is-sad {
  color: #c48412;
  border-color: rgba(247, 177, 37, 0.4);
  background: rgba(247, 177, 37, 0.14);
}

.guest-board-reaction-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: block;
  padding: 0;
  background: transparent;
  pointer-events: none;
}

.guest-board-reaction-overlay:not([hidden]) {
  pointer-events: none;
}

.guest-board-reaction-overlay.is-picker {
  overflow: visible;
}

.guest-board-reaction-overlay.is-people:not([hidden]) {
  pointer-events: auto;
}

.guest-board-reaction-scrim {
  position: absolute;
  inset: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.guest-board-reaction-overlay.is-people .guest-board-reaction-scrim {
  background: rgba(10, 30, 36, 0.46);
  pointer-events: auto;
}

.guest-board-reaction-overlay.is-open .guest-board-reaction-scrim {
  opacity: 1;
}

.guest-board-reaction-bar {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 0.12rem;
  padding: 0.38rem 0.42rem 0.32rem;
  overflow: visible;
  border-radius: 999px;
  background: #fffdf9;
  border: 1px solid rgba(10, 61, 69, 0.12);
  box-shadow: 0 14px 32px rgba(10, 40, 48, 0.22);
  transform: translateY(0.55rem) scale(0.72);
  transform-origin: center bottom;
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), opacity 160ms ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.guest-board-reaction-bar.is-below {
  transform: translateY(-0.55rem) scale(0.72);
  transform-origin: center top;
}

.guest-board-reaction-overlay.is-open.is-picker .guest-board-reaction-bar:not([hidden]) {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.guest-board-reaction-pick {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  overflow: visible;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  animation: guest-board-reaction-pop 280ms ease both;
}

.guest-board-reaction-pick:nth-child(1) { animation-delay: 20ms; }
.guest-board-reaction-pick:nth-child(2) { animation-delay: 45ms; }
.guest-board-reaction-pick:nth-child(3) { animation-delay: 70ms; }
.guest-board-reaction-pick:nth-child(4) { animation-delay: 95ms; }
.guest-board-reaction-pick:nth-child(5) { animation-delay: 120ms; }

.guest-board-reaction-pick-emoji {
  display: block;
  font-size: 1.72rem;
  line-height: 1;
  transform: scale(1) translateY(0);
  transform-origin: center bottom;
  transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), filter 140ms ease;
}

.guest-board-reaction-pick-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.15rem);
  transform: translateX(-50%) scale(0.86);
  padding: 0.12rem 0.38rem;
  border-radius: 999px;
  background: rgba(20, 24, 28, 0.92);
  color: #fff8f2;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
}

.guest-board-reaction-pick.is-selected .guest-board-reaction-pick-emoji {
  transform: scale(1.06);
}

.guest-board-reaction-pick.is-hot {
  z-index: 4;
}

.guest-board-reaction-pick.is-hot .guest-board-reaction-pick-emoji,
.guest-board-reaction-pick.is-picking .guest-board-reaction-pick-emoji {
  transform: scale(1.82) translateY(-0.42rem);
  filter: drop-shadow(0 8px 10px rgba(10, 40, 48, 0.28));
}

.guest-board-reaction-pick.is-hot .guest-board-reaction-pick-label {
  opacity: 1;
  transform: translateX(-50%) translateY(-1.85rem) scale(1);
}

.guest-board-reaction-bar:has(.is-hot) .guest-board-reaction-pick:not(.is-hot) .guest-board-reaction-pick-emoji {
  transform: scale(0.9);
}

.guest-board-reaction-pick:active .guest-board-reaction-pick-emoji {
  transform: scale(1.2) translateY(-0.12rem);
}

@keyframes guest-board-reaction-pop {
  from {
    transform: scale(0.35);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

html.is-android .guest-board-reaction-pick {
  width: 2.28rem;
  height: 2.28rem;
}

html.is-android .guest-board-reaction-pick-emoji {
  font-size: 1.55rem;
}

.guest-board-reaction-people-sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 3;
  width: min(100%, 430px);
  max-height: min(70dvh, 28rem);
  display: flex;
  flex-direction: column;
  transform: translate(-50%, 110%);
  border-radius: 18px 18px 0 0;
  background: #fffdf9;
  border: 1px solid rgba(10, 61, 69, 0.12);
  box-shadow: 0 18px 40px rgba(10, 40, 48, 0.28);
  overflow: hidden;
  pointer-events: auto;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.guest-board-reaction-overlay.is-open.is-people .guest-board-reaction-people-sheet:not([hidden]) {
  transform: translate(-50%, 0);
}

.guest-board-reaction-people-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem 0.45rem;
}

.guest-board-reaction-people-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--brand);
}

.guest-board-reaction-people-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
}

.guest-board-reaction-person {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border-bottom: 1px solid rgba(10, 61, 69, 0.08);
  font-size: 0.88rem;
}

.guest-board-reaction-person-emoji {
  width: 1.5rem;
  text-align: center;
  font-size: 1.1rem;
}

.guest-board-reaction-person-name {
  flex: 1 1 auto;
  font-weight: 700;
  color: var(--brand);
}

.guest-board-reaction-person-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.guest-board-reaction-person.is-mine .guest-board-reaction-person-name {
  color: #1877f2;
}

.home-guest-board-action-btn {
  border: 1px solid rgba(10, 61, 69, 0.14);
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.95);
  color: var(--brand);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  min-height: 2rem;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 2px 6px rgba(10, 40, 48, 0.06);
}

.home-guest-board-action-btn:active {
  transform: scale(0.97);
  filter: brightness(0.96);
}

.home-guest-board-action-btn.is-danger {
  color: #8b2e2e;
  border-color: rgba(139, 46, 46, 0.22);
  background: rgba(255, 244, 244, 0.95);
}

.home-guest-board-action-btn.guest-board-like-btn {
  touch-action: none;
}

html.is-guest-board-reacting {
  touch-action: none;
}

html.is-guest-board-reacting,
html.is-guest-board-reacting * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none;
}

.home-guest-board-replies {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.45rem;
}

.home-guest-board-empty {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem 0.2rem;
}

.home-guest-board-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.home-guest-board-page-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
}

.hero.has-greeting .headline {
  margin-top: 0.85rem;
}

#homeView .hero.has-greeting .headline {
  margin-top: 1.1rem;
}

#homeView .search-form {
  margin-top: 0;
  padding: 1.25rem 1.15rem 1.35rem;
}

/* 首頁搜尋已無標題列：縮小卡片內距，版面貼齊輸入列 */
#homeView .search-form.search-form-compact {
  padding: 0.75rem 0.85rem;
}

#homeView .search-label {
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.home-history-stack {
  margin: 0.15rem 0 0.75rem;
  display: grid;
  gap: 0;
}

.today-query-panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
  border-top: 1px solid rgba(10, 61, 69, 0.1);
}

.today-query-panel[hidden] {
  display: none !important;
}

.home-history-stack > .today-query-panel:first-child {
  border-top: 0;
}

.today-query-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.62rem 0.1rem;
  cursor: pointer;
  list-style: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.today-query-summary::-webkit-details-marker {
  display: none;
}

.today-query-summary::after {
  content: "›";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 500;
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}

.today-query-panel[open] .today-query-summary::after {
  transform: rotate(-90deg);
}

.today-query-summary-heading {
  flex: 1 1 auto;
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  min-width: 0;
}

.today-query-summary-title {
  flex: 0 0 auto;
}

.today-query-summary-hint {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.today-query-summary-count {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.today-query-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0 0 0.35rem;
  border-top: 0;
}

.today-query-swipe-row {
  /* 與筆記左滑刪除相同：沿用 .note-swipe-row 的綠色底 */
  border-radius: 8px;
  touch-action: pan-y pinch-zoom;
}

.today-query-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
}

.today-query-item:active,
.today-query-item:hover {
  background: rgba(10, 61, 69, 0.06);
}

.note-swipe-front.today-query-item {
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(10, 61, 69, 0.1);
  border-radius: 8px;
  /* 必須不透明，否則滑過／:active 會透出紅刪除底，看起來像多列同時左滑 */
  background: var(--surface);
  box-shadow: none;
}

.note-swipe-front.today-query-item:active,
.note-swipe-front.today-query-item:hover {
  background: #eef5f4;
}

.today-query-item-code {
  font-weight: 700;
  color: #0a3d45;
}

.today-query-item-title {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.35;
  word-break: break-word;
}

.my-feedback-panel {
  margin-top: 0;
}

.my-feedback-item-meta {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
}

#homeView .nav-card {
  margin-top: 1.35rem;
  padding: 1.1rem 1.1rem;
}

#homeView .nav-card + .nav-card {
  margin-top: 1.05rem;
}

#homeView .nav-card-body {
  gap: 0.35rem;
}

#homeView .footnote,
#homeView ~ .footnote {
  margin-top: 1.65rem;
}

.home-name-reminder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0 0 1.1rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid rgba(10, 61, 69, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 252, 248, 0.92);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.home-name-reminder[hidden] {
  display: none !important;
}

.home-name-reminder-body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.home-name-reminder-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand);
}

.home-name-reminder-action {
  flex: 0 0 auto;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--accent);
}

.search-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 0.95rem 1.05rem;
  box-shadow: var(--shadow);
  animation: rise 620ms ease-out both;
}

.search-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
}

#queryInput {
  width: 100%;
  min-height: 3rem;
  border: 1px solid rgba(10, 61, 69, 0.28);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 1.05rem;
  background: #fff;
  color: var(--ink);
  /* 系統字體放大時以省略號收尾，不要把提示字硬切一半 */
  text-overflow: ellipsis;
}

/* 提示字比輸入文字略小，窄螢幕（Android 360px）才放得下整句 */
#queryInput::placeholder {
  font-size: 0.95rem;
}

#queryInput:focus {
  outline: 2px solid rgba(10, 61, 69, 0.45);
  outline-offset: 1px;
}

#searchButton {
  min-width: 4.6rem;
  min-height: 3rem;
  border: 0;
  border-radius: 10px;
  padding: 0 1rem;
  font: inherit;
  font-weight: 700;
  color: #fff8f2;
  background: linear-gradient(145deg, #0f5560 0%, #0a3d45 100%);
  cursor: pointer;
}

#searchButton:active {
  transform: translateY(1px);
}

#searchButton:disabled {
  opacity: 0.65;
  cursor: wait;
}

.status {
  min-height: 1.4rem;
  margin: 0.9rem 0 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.results {
  display: grid;
  gap: 0.85rem;
  animation: rise 420ms ease-out both;
  touch-action: pan-y pinch-zoom;
}

.block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
}

.block-simple {
  border-color: rgba(31, 107, 74, 0.35);
  background: linear-gradient(180deg, rgba(232, 246, 239, 0.96), rgba(255, 252, 248, 0.94));
}

.block-title {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.detail-toolbar .block-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

.detail-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 0 1 auto;
  margin-left: auto;
  max-width: 100%;
}

.detail-toolbar .repair-feedback-fab {
  margin-left: 0;
}

/* 窄屏（iOS／Android 共用）：查修工具列直向，避免雙鈕把「告警查修」擠成換行 */
@media (max-width: 430px) {
  .detail-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .detail-toolbar .block-title {
    flex: none;
    width: 100%;
  }

  .detail-toolbar-actions {
    margin-left: 0;
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }

  .detail-toolbar-actions:has(> :only-child) {
    grid-template-columns: 1fr;
  }

  .detail-toolbar .repair-feedback-fab,
  .detail-toolbar .alarm-content-report-btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }
}

/* 與 .repair-feedback-fab 同族：實心品牌鈕、白字、同圓角／陰影；色階略淺當次要 */
.alarm-content-report-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin: 0;
  min-height: 2.35rem;
  padding: 0.5rem 0.95rem;
  border: 1.5px solid rgba(8, 48, 54, 0.38);
  border-radius: 10px;
  background: linear-gradient(180deg, #2a8f9c 0%, #156570 100%);
  color: #fff8f2;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 2px 0 rgba(8, 48, 54, 0.3),
    0 6px 14px rgba(10, 61, 69, 0.2);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.alarm-content-report-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: rgba(255, 248, 242, 0.18);
  font-size: 0.72rem;
  line-height: 1;
}

.alarm-content-report-btn-label {
  white-space: nowrap;
}

.alarm-content-report-btn:hover {
  background: linear-gradient(180deg, #319aaa 0%, #18707c 100%);
}

.alarm-content-report-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 1px 0 rgba(8, 48, 54, 0.28),
    0 2px 6px rgba(10, 61, 69, 0.16);
}

.alarm-content-report-card {
  max-width: min(26rem, calc(100vw - 1.5rem));
  max-height: none;
  padding: 1.35rem 1.2rem 1.2rem;
  /* 鍵盤開啟時浮層可捲，避免安卓卡在鍵盤後方 */
  flex-shrink: 0;
  margin: 0 auto;
}

/* 回報浮層：對齊 visualViewport（JS 寫 top/height），可捲動，勿垂直置中卡在鍵盤後 */
#alarmContentReportOverlay.app-confirm-overlay {
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  /* 蓋過筆記 fixed 殼，避免點不到 */
  z-index: 140;
}

#alarmContentReportOverlay .alarm-content-report-card {
  width: min(100%, 26rem);
}

body.content-report-open #alarmContentReportOverlay .alarm-content-report-input {
  min-height: 4.5rem;
  max-height: 28vh;
  resize: none;
}

.alarm-content-report-card > .app-confirm-message {
  margin: 0 0 0.45rem;
}

.alarm-content-report-hint {
  margin: 0 0 1.05rem;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.45;
  color: var(--brand);
}

.alarm-content-report-summary {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1.15rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 48, 54, 0.04);
}

.alarm-content-report-summary-row {
  display: grid;
  gap: 0.22rem;
  margin: 0;
}

.alarm-content-report-summary-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
}

.alarm-content-report-summary-value {
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--ink, #1a2a2e);
  word-break: break-word;
}

.alarm-content-report-card > .search-label {
  display: block;
  margin: 0 0 0.4rem;
}

.alarm-content-report-input {
  min-height: 7rem;
  resize: vertical;
  margin: 0 0 0.55rem;
}

.alarm-content-report-card > .app-password-error {
  margin: 0 0 0.35rem;
}

.alarm-content-report-card > .app-confirm-actions {
  margin-top: 1.2rem;
}

.field-row {
  display: grid;
  gap: 0.25rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}

.field-row:first-of-type {
  border-top: 0;
  padding-top: 0.35rem;
}

.field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.repair-feedback-fab {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin: 0;
  min-height: 2.35rem;
  padding: 0.5rem 0.95rem;
  border: 1.5px solid rgba(8, 48, 54, 0.45);
  border-radius: 10px;
  background: linear-gradient(180deg, #14707d 0%, #0a3d45 100%);
  color: #fff8f2;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 2px 0 rgba(8, 48, 54, 0.35),
    0 6px 14px rgba(10, 61, 69, 0.22);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.repair-feedback-fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: rgba(255, 248, 242, 0.18);
  font-size: 0.72rem;
  line-height: 1;
}

.repair-feedback-fab-label {
  white-space: nowrap;
}

.repair-feedback-fab:hover {
  background: linear-gradient(180deg, #178697 0%, #0c4a53 100%);
}

.repair-feedback-fab:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 1px 0 rgba(8, 48, 54, 0.3),
    0 2px 6px rgba(10, 61, 69, 0.18);
}

.field-row-feedback {
  gap: 0.55rem;
  padding-top: 0.95rem;
}

.repair-feedback-zone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.repair-feedback-zone-head .field-label {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--ink);
}

.repair-feedback-zone {
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(10, 61, 69, 0.12);
  border-radius: 12px;
  background: rgba(10, 61, 69, 0.04);
}

.repair-feedback-empty {
  margin: 0;
  padding: 0.35rem 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--muted);
}

.repair-feedback-manage-hint {
  margin: 0.55rem 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.repair-feedback-manage-list {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.repair-feedback-manage-row {
  border-radius: 10px;
}

.repair-feedback-manage-list .note-swipe-actions {
  min-width: 12.5rem;
}

.repair-feedback-manage-list .note-swipe-edit,
.repair-feedback-manage-list .note-swipe-delete {
  min-width: 6.25rem;
}

.note-swipe-edit {
  border: 0;
  min-width: 7.25rem;
  padding: 0 0.75rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: none;
  background: #0f5560;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.88;
  transform: scale(0.97);
  transition: opacity 200ms ease, transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.note-swipe-row:has(.note-swipe-front.is-open) .note-swipe-edit {
  opacity: 1;
  transform: scale(1);
}

.repair-feedback-manage-front {
  display: grid;
  gap: 0.18rem;
  padding: 0.62rem 0.75rem;
  border-radius: 10px;
  background: #fffdf9;
  cursor: default;
}

.repair-feedback-manage-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.repair-feedback-manage-meta {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.3;
}

.repair-feedback-stats {
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: rgba(255, 252, 248, 0.92);
  border: 1px solid rgba(10, 61, 69, 0.08);
}

.repair-feedback-stats-title {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand);
}

.repair-feedback-stats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.repair-feedback-stats-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.85rem;
  font-size: 1.02rem;
  line-height: 1.4;
}

.repair-feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 125;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.repair-feedback-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.repair-feedback-overlay[hidden] {
  display: none !important;
}

.repair-feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 28, 32, 0.45);
}

.repair-feedback-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 26rem);
  max-height: min(88vh, 40rem);
  max-height: min(88dvh, 40rem);
  overflow: hidden;
  padding: 1rem 1rem max(1.1rem, env(safe-area-inset-bottom, 0px));
  border-radius: 16px;
  background: #fffdf9;
  box-shadow: 0 18px 48px rgba(8, 28, 32, 0.28);
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.repair-feedback-card-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.repair-feedback-card.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.repair-feedback-card-head {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.repair-feedback-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand);
}

.repair-feedback-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}

.repair-feedback-alarm {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  color: var(--muted);
  word-break: break-word;
}

.repair-feedback-section {
  margin-bottom: 0.85rem;
}

.repair-feedback-label {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.repair-feedback-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.repair-feedback-chip {
  border: 1px solid rgba(10, 61, 69, 0.2);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.repair-feedback-chip.is-selected {
  border-color: transparent;
  background: #0a3d45;
  color: #fff8f2;
  font-weight: 700;
}

.repair-feedback-custom {
  margin-top: 0.55rem;
}

.repair-feedback-status {
  flex-shrink: 0;
  min-height: 1.2em;
  margin: 0.55rem 0 0.45rem;
  font-size: 0.84rem;
}

.repair-feedback-actions {
  flex-shrink: 0;
  display: grid;
  gap: 0.55rem;
}

.repair-feedback-actions .primary-btn.wide {
  margin: 0;
  touch-action: manipulation;
}

.repair-feedback-delete-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  margin: 0;
  padding: 0.72rem 1rem;
  border: 1.5px solid rgba(139, 46, 46, 0.55);
  border-radius: 10px;
  background: #fff8f6;
  color: var(--danger);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.repair-feedback-delete-btn:active {
  background: #f6e6e3;
}

.repair-feedback-delete-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.repair-feedback-delete-btn[hidden] {
  display: none !important;
}

.field-value .text {
  margin: 0;
}

.alarm-copy {
  display: grid;
  gap: 0.65rem;
}

.alarm-copy .text {
  margin: 0;
}

.alarm-copy-en {
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.alarm-copy-zh {
  margin-top: 0.15rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(10, 61, 69, 0.12);
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
}

.choice-btn {
  display: grid;
  gap: 0.45rem;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(10, 61, 69, 0.22);
  border-radius: 12px;
  padding: 0.9rem 0.95rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(10, 40, 48, 0.06);
}

.choice-btn:active {
  transform: translateY(1px);
}

.choice-btn:focus {
  outline: 2px solid rgba(10, 61, 69, 0.4);
  outline-offset: 1px;
}

/* 故障選擇：對齊告警選擇／搜尋欄語彙 */
.fault-choice-block .block-title {
  margin-bottom: 0.35rem;
}

.fault-choice-alarm-head {
  display: grid;
  gap: 0.2rem;
  margin: 0.15rem 0 0.45rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(10, 61, 69, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.fault-choice-alarm-code {
  margin: 0;
  font-family: var(--font-brand);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--brand);
}

.fault-choice-alarm-code .code {
  color: inherit;
}

.fault-choice-id-tag {
  font-family: var(--font-ui, inherit);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: none;
}

.fault-choice-alarm-en {
  margin: 0;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.fault-choice-alarm-zh {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.fault-choice-summary {
  margin: 0.15rem 0 0;
}

.fault-choice-filter-wrap {
  display: block;
  margin: 0.7rem 0 0.35rem;
}

.fault-choice-filter {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid rgba(10, 61, 69, 0.28);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 12px rgba(10, 40, 48, 0.04);
}

.fault-choice-filter::placeholder {
  color: var(--muted);
  font-size: 0.92rem;
}

.fault-choice-filter:focus {
  outline: 2px solid rgba(10, 61, 69, 0.45);
  outline-offset: 1px;
}

.fault-choice-nav {
  display: grid;
  gap: 0.55rem;
  margin: 0.55rem 0 0.2rem;
}

.fault-choice-jump-wrap {
  display: grid;
  gap: 0.3rem;
}

.fault-choice-jump-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.fault-choice-jump-btn {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.55rem;
  margin: 0;
  border: 1px solid rgba(10, 61, 69, 0.28);
  border-radius: 10px;
  padding: 0.55rem 0.75rem 0.55rem 0.85rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
  text-align: left;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 12px rgba(10, 40, 48, 0.04);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fault-choice-jump-btn:active {
  transform: scale(0.99);
}

.fault-choice-jump-btn-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fault-choice-jump-btn-chevron {
  flex: 0 0 auto;
  color: rgba(10, 61, 69, 0.45);
  font-size: 0.85rem;
  line-height: 1;
}

.fault-choice-jump-overlay {
  z-index: 130;
  align-items: flex-end;
  padding: 0;
  background: rgba(10, 30, 36, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.fault-choice-jump-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.fault-choice-jump-sheet {
  width: min(100%, 430px);
  max-height: min(72vh, 34rem);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border-radius: 16px 16px 0 0;
  background: #fffdf9;
  border: 1px solid rgba(10, 61, 69, 0.12);
  border-bottom: 0;
  box-shadow: 0 -12px 36px rgba(10, 40, 48, 0.22);
  padding-bottom: max(0.55rem, env(safe-area-inset-bottom, 0px));
  transform: translateY(18px);
  opacity: 0.5;
  transition: transform 0.22s ease-out, opacity 0.22s ease-out;
}

.fault-choice-jump-overlay.is-open .fault-choice-jump-sheet {
  transform: translateY(0);
  opacity: 1;
}

.fault-choice-jump-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem 0.65rem;
  border-bottom: 1px solid var(--line);
}

.fault-choice-jump-sheet-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: 0.02em;
}

.fault-choice-jump-sheet-close {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 61, 69, 0.08);
  color: var(--brand);
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fault-choice-jump-sheet-list {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0.55rem 0.55rem;
  display: grid;
  gap: 0.2rem;
}

.fault-choice-jump-option {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr);
  align-items: start;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  min-height: 2.35rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease,
    color 0.14s ease;
}

.fault-choice-jump-option:active {
  background: rgba(10, 61, 69, 0.06);
}

.fault-choice-jump-option.is-selected {
  border-color: rgba(10, 61, 69, 0.18);
  background: rgba(8, 48, 54, 0.06);
  color: var(--brand);
  font-weight: 800;
}

.fault-choice-jump-option.is-picking {
  border-color: rgba(10, 61, 69, 0.28);
  background: rgba(8, 48, 54, 0.12);
  color: var(--brand);
  font-weight: 800;
  transform: scale(0.985);
}

.fault-choice-jump-option-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.08rem;
  color: var(--brand);
  font-size: 0.82rem;
  line-height: 1;
  transform: scale(0.7);
  opacity: 0;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.fault-choice-jump-option.is-selected .fault-choice-jump-option-mark,
.fault-choice-jump-option.is-picking .fault-choice-jump-option-mark {
  transform: scale(1);
  opacity: 1;
}

.fault-choice-jump-option-text {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.fault-choice-range {
  margin: 0.2rem 0 0.55rem;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

.fault-choice-list {
  gap: 0.55rem;
}

.fault-choice-btn {
  gap: 0.28rem;
}

.fault-choice-id-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

.fault-choice-btn .fault-choice-id-tag {
  color: var(--brand);
  opacity: 0.72;
}

.fault-choice-code {
  font-family: var(--font-brand);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.fault-choice-list .choice-label-en {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
}

.fault-detail-alarm-name {
  display: block;
  margin-top: 0.25rem;
  font-weight: 600;
  color: var(--ink);
}

.choice-label {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--brand);
  line-height: 1.35;
}

.choice-label-en {
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.choice-label-zh {
  margin-top: 0.1rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(10, 61, 69, 0.12);
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.choice-preview {
  display: grid;
  gap: 0.2rem;
  font-size: 0.84rem;
  color: var(--ink);
  line-height: 1.4;
}

.choice-preview-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.choice-meta {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.cause-list {
  margin: 0.15rem 0 0;
  padding-left: 1.15rem;
}

.cause-list li {
  margin: 0.35rem 0;
  line-height: 1.5;
  font-size: 0.92rem;
}

.cause-grouped > li {
  margin: 0.7rem 0;
  list-style: none;
}

.cause-grouped {
  padding-left: 0;
}

.cause-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
}

.cause-grouped .cause-list {
  margin: 0.25rem 0 0;
  padding-left: 1.15rem;
}

.cause-label {
  font-weight: 700;
  color: var(--ink);
}

.field-value .code {
  display: inline-block;
}

.item + .item {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.code {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand);
}

.name {
  font-weight: 500;
  color: var(--ink);
}

.badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(10, 61, 69, 0.1);
  color: var(--brand);
}

.text {
  margin: 0.25rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.92rem;
  color: var(--ink);
}

.meta {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.steps {
  margin: 0.4rem 0 0;
  padding-left: 1.15rem;
  color: var(--ink);
}

.steps li {
  margin: 0.45rem 0;
  line-height: 1.5;
  color: var(--ink);
  opacity: 1;
}

.field-value .steps {
  color: var(--ink);
  opacity: 1;
}

.rate {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.empty {
  margin: 0;
  color: var(--muted);
}

.choice-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.search-action-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin: 0.85rem 0 1rem;
}

.search-action-bar.has-reselect {
  grid-template-columns: 1.2fr 1fr;
}

.search-action-btn {
  min-height: 2.85rem;
  border-radius: 12px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0 0.85rem;
}

.search-action-primary {
  border: 0;
  color: #fff8f2;
  background: linear-gradient(145deg, #0f5560 0%, #0a3d45 100%);
}

.search-action-secondary {
  border: 1px solid rgba(10, 61, 69, 0.22);
  color: var(--brand);
  background: #fff;
}

.search-action-btn:active {
  transform: translateY(1px);
}

.footnote {
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 0 1rem max(1.4rem, env(safe-area-inset-bottom));
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
  display: grid;
  gap: 0.2rem;
}

.home-app-version-foot {
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(10, 61, 69, 0.5);
}

.footnote[hidden] {
  display: none !important;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 680px) {
  .shell {
    padding-top: 2rem;
  }
}

.view[hidden] {
  display: none !important;
  /* iOS Chrome：僅 hidden 有時仍佔文件高度，一併壓掉 */
  height: 0 !important;
  max-height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.app-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(10, 30, 36, 0.46);
  -webkit-tap-highlight-color: transparent;
}

/* 確認框須蓋過版本更新／預告等其他同層浮層（否則刪除確認會跑到畫面後面） */
#appConfirmOverlay.app-confirm-overlay {
  z-index: 160;
}

.app-confirm-overlay[hidden] {
  display: none !important;
}

.app-confirm-card {
  width: min(100%, 22rem);
  border-radius: 16px;
  padding: 1.15rem 1.1rem 1rem;
  background: #fffdf9;
  box-shadow: 0 18px 40px rgba(10, 40, 48, 0.28);
  border: 1px solid rgba(10, 61, 69, 0.12);
}

.app-confirm-message {
  margin: 0;
  white-space: pre-wrap;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.55;
  font-weight: 600;
}

.app-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 1.05rem;
}

.app-confirm-btn {
  min-height: 2.65rem;
  border-radius: 12px;
  border: 1px solid rgba(10, 61, 69, 0.16);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app-confirm-cancel {
  color: var(--ink);
  background: #eef3f2;
}

.app-confirm-ok {
  color: #fff8f2;
  background: linear-gradient(145deg, #0f5560 0%, #0a3d45 100%);
  border-color: transparent;
}

.app-confirm-ok.is-danger {
  background: linear-gradient(145deg, #a33b3b 0%, #8b2e2e 100%);
}

.app-password-input {
  margin: 0.85rem 0 0.35rem;
}

.app-password-error {
  margin: 0.15rem 0 0;
  color: #b42318;
  font-size: 0.88rem;
  line-height: 1.4;
}

.app-confirm-btn:active {
  transform: scale(0.98);
}

.note-editor-shell[hidden] {
  min-height: 0 !important;
  height: 0 !important;
  max-height: 0 !important;
}

.home-update-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin: 0 0 1rem;
  text-align: left;
  border: 1px solid rgba(180, 90, 20, 0.28);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #fff8ef 0%, #ffe8cc 100%);
  box-shadow: 0 8px 20px rgba(120, 60, 10, 0.12);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.home-update-banner[hidden] {
  display: none !important;
}

.home-update-banner:active {
  transform: scale(0.985);
}

.home-update-banner-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.home-update-banner-title {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.02rem;
  color: #8a3d0a;
}

.home-update-banner-desc {
  font-size: 0.84rem;
  color: rgba(80, 40, 10, 0.78);
  line-height: 1.35;
}

.home-update-banner-action {
  flex-shrink: 0;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  background: #0a3d45;
  color: #fff8f2;
  font-weight: 700;
  font-size: 0.92rem;
}

.home-update-banner.is-updating {
  opacity: 0.72;
  pointer-events: none;
}

.nav-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin-top: 1.1rem;
  text-align: left;
  border: 1px solid rgba(10, 61, 69, 0.16);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  background: #fff;
  box-shadow:
    0 10px 28px rgba(10, 40, 48, 0.14),
    0 2px 8px rgba(10, 40, 48, 0.08);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-card:hover {
  border-color: rgba(10, 61, 69, 0.28);
  box-shadow:
    0 12px 32px rgba(10, 40, 48, 0.16),
    0 3px 10px rgba(10, 40, 48, 0.1);
}

.nav-card:active {
  transform: scale(0.985);
  box-shadow: 0 6px 16px rgba(10, 40, 48, 0.12);
}

.nav-card-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #12707c 0%, #0f5560 42%, #0a3d45 100%);
  color: #fff8f2;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 4px 12px rgba(10, 61, 69, 0.22);
}

/* navCardIconGlyphSize：方塊內線條圖示加大 */
.nav-card-icon svg {
  width: 1.7rem;
  height: 1.7rem;
}

/* 筆記：偏亮橘 */
.nav-card-icon--notes {
  background: linear-gradient(145deg, #f0a05c 0%, #d97832 48%, #b85a1c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 5px 14px rgba(196, 92, 38, 0.28);
}

/* 告警維護／即將推出：品牌綠（與橘系入口區隔） */
.nav-card-icon--accent {
  background: linear-gradient(145deg, #1a7a6a 0%, #0f5560 48%, #0a3d45 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 5px 14px rgba(10, 61, 69, 0.28);
}

/* comingSoonStarFacet：主星暖金漸層＋小火花，避免單調實心白星 */
.nav-card-icon--accent svg,
.nav-card-coming-soon-star {
  width: 2.05rem;
  height: 2.05rem;
  overflow: visible;
}

.nav-card-icon--system {
  background: linear-gradient(145deg, #3d5c64 0%, #2a454c 48%, #1a3238 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 4px 12px rgba(10, 40, 48, 0.2);
}

/* 留言板：偏深橘／琥珀，與筆記亮橘有區別 */
.nav-card-icon--guest {
  background: linear-gradient(145deg, #d9894a 0%, #c45c26 48%, #8f3f16 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 5px 14px rgba(196, 92, 38, 0.34);
}

.nav-card-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.nav-card-title {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand);
}

.nav-card-new-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.2;
  color: #fff8f2;
  background: linear-gradient(180deg, #e08a4f 0%, #c45c26 100%);
  border: 1px solid rgba(154, 69, 28, 0.4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  pointer-events: none;
}

.nav-card-new-badge[hidden] {
  display: none !important;
}

.nav-card-desc {
  font-size: 0.86rem;
  color: var(--muted);
}

.nav-card-chevron {
  flex-shrink: 0;
  font-size: 1.75rem;
  line-height: 1;
  color: rgba(10, 61, 69, 0.42);
  font-weight: 300;
  padding-left: 0.15rem;
}

.nav-card[hidden],
.search-action-bar[hidden] {
  display: none !important;
}

/* 網頁瀏覽器：Coming soon 入口與 App 相同先藏，避免與唯讀網頁版混淆 */
html.is-web-browser #openComingSoonFeature {
  display: none !important;
}

/* 網頁版禁止留言板：僅 PWA 可見／可進 */
html.is-web-browser #openHomeGuestBoardBtn {
  display: none !important;
}

html.is-web-browser #guestBoardView {
  display: none !important;
}

.view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.back-btn {
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.25rem 0;
}

.view-bar-action {
  border: 1.5px solid rgba(15, 85, 96, 0.35);
  border-radius: 999px;
  background: #fff;
  color: #0f5560;
  font: inherit;
  font-weight: 800;
  font-size: 0.84rem;
  cursor: pointer;
  padding: 0.4rem 0.85rem;
  min-height: 2.1rem;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.view-bar-action:active {
  filter: brightness(0.97);
}

.view-bar-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.page-title {
  margin: 0 0 0.55rem;
  font-size: 1.25rem;
  color: var(--brand);
}

.panel-hint {
  margin: 0 0 0.85rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.primary-btn {
  border: 0;
  border-radius: 10px;
  min-height: 2.75rem;
  padding: 0 1rem;
  font: inherit;
  font-weight: 700;
  color: #fff8f2;
  background: linear-gradient(145deg, #0f5560 0%, #0a3d45 100%);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
}

.primary-btn:active,
.primary-btn.is-pressed {
  transform: scale(0.98);
  filter: brightness(0.94);
}

.primary-btn.is-busy,
.primary-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.primary-btn.wide {
  display: block;
  width: 100%;
  margin: 0.35rem 0 0.9rem;
}

.full-input {
  width: 100%;
  min-height: 2.75rem;
  margin-bottom: 0.55rem;
  border: 1px solid rgba(10, 61, 69, 0.28);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.full-input.tall {
  min-height: 7rem;
  resize: vertical;
}

.notes-list {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.note-list-section {
  display: grid;
  gap: 0.45rem;
}

.note-list-section-title {
  margin: 0.15rem 0 0;
  padding: 0 0.1rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--brand);
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.note-list-section-title span {
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

.note-list-section-notion .note-list-section-title {
  color: #3d5a63;
  border-top: 1px solid rgba(10, 61, 69, 0.12);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

.note-list-section-site .note-list-section-title {
  color: #3d5a63;
  border-top: 1px solid rgba(10, 61, 69, 0.12);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

.note-list-section-body {
  display: grid;
  gap: 0.45rem;
}

.note-card-personal {
  border-left: 3px solid #0a3d45;
}

.note-card-notion {
  border-left: 3px solid rgba(90, 120, 130, 0.55);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(20, 35, 40, 0.82);
}

.note-card-site {
  border-left: 3px solid rgba(90, 120, 130, 0.55);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(20, 35, 40, 0.82);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.notes-folder-panel,
.notes-list-panel {
  margin-top: 0;
}

.notes-folder-panel[hidden],
.notes-list-panel[hidden] {
  display: none !important;
  height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.notes-hub-hero {
  margin: 0 0 0.85rem;
}

.notes-hub-hero .page-title {
  margin-bottom: 0.25rem;
}

.notes-hub-subtitle {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
}

.notes-hub-tools {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid rgba(10, 61, 69, 0.12);
  background: rgba(255, 252, 248, 0.78);
}

.notes-hub-tools .search-label {
  margin: 0;
}

.notes-hub-search {
  margin: 0;
}

.notes-hub-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.notes-hub-action-btn {
  border: 1px solid rgba(10, 61, 69, 0.18);
  border-radius: 999px;
  min-height: 2.2rem;
  padding: 0.3rem 0.85rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.notes-hub-action-btn:active {
  filter: brightness(0.97);
}

.notes-hub-action-danger {
  color: #a33b3b;
  border-color: rgba(163, 59, 59, 0.28);
}

.notes-hub-create-btn {
  margin-left: auto;
  min-height: 2.35rem;
  padding: 0 1rem;
  border-radius: 999px;
}

.notes-hub-create-btn[hidden],
.notes-hub-action-btn[hidden],
.notes-hub-actions[hidden] {
  display: none !important;
}

.notes-hub-section {
  margin: 0 0 1rem;
}

.notes-hub-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.55rem;
}

.notes-hub-section-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: none;
}

.notes-hub-section-status {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
}

.notes-hub-drafts {
  margin: 0.85rem 0 0.25rem;
  padding: 0.75rem 0.85rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(168, 120, 18, 0.28);
  background: linear-gradient(180deg, rgba(255, 244, 214, 0.9), rgba(255, 252, 248, 0.92));
}

.notes-hub-drafts .notes-hub-section-title {
  color: #8a5a12;
}

.notes-hub-drafts[hidden] {
  display: none !important;
}

.notes-hub-return-notices {
  margin: 0.85rem 0 0.25rem;
  padding: 0.75rem 0.85rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(15, 85, 96, 0.28);
  background: linear-gradient(180deg, rgba(214, 242, 245, 0.92), rgba(255, 252, 248, 0.94));
}

.notes-hub-return-notices .notes-hub-section-title {
  color: #0f5560;
}

.notes-hub-return-notices[hidden] {
  display: none !important;
}

.note-return-notice-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.note-return-notice-card {
  padding: 0.75rem 0.8rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(15, 85, 96, 0.22);
  background: #fffdf9;
  box-shadow: 0 2px 8px rgba(10, 61, 69, 0.08);
}

.note-return-notice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.note-return-notice-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #2a8f9c 0%, #156570 100%);
  color: #fff8f2;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.note-return-notice-dismiss {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(180deg, #f59e0b, #d97706);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(217, 119, 6, 0.28);
}

.note-return-notice-dismiss:active {
  transform: scale(0.98);
}

.note-return-notice-open {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.65rem;
  border: 0;
  border-radius: 999px;
  min-height: 2.3rem;
  padding: 0.35rem 0.95rem;
  background: linear-gradient(180deg, #1a7a88, #0f5560);
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(15, 85, 96, 0.28);
}

.note-return-notice-open:active {
  transform: scale(0.98);
}

.note-return-notice-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 700;
  color: #143038;
}

.note-return-notice-meta {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.note-return-notice-message {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #1c2c31;
}

.note-return-banner {
  margin: 0.15rem 0 0.75rem;
  padding: 0.75rem 0.8rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(15, 85, 96, 0.28);
  background: linear-gradient(180deg, rgba(214, 242, 245, 0.96), #fffdf9);
  box-shadow: 0 2px 8px rgba(10, 61, 69, 0.1);
}

.note-return-banner[hidden] {
  display: none !important;
}

.trash-entry-wrap {
  margin-top: 0.35rem;
  margin-bottom: 0;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(20, 35, 40, 0.14);
}

.trash-entry-wrap[hidden] {
  display: none !important;
}

.notes-folder-list {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0;
}

.notes-folder-card-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.notes-folder-card-row > .notes-folder-card {
  flex: 1 1 0;
  width: auto;
  max-width: none;
  min-width: 0;
}

.notes-folder-swipe-row {
  flex: 1 1 0;
  min-width: 0;
}

/* 前景必須滿寬蓋住刪除底，否則桌機看起來像破版常駐「刪除分類」 */
.note-swipe-front.notes-folder-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  flex: none;
  width: 100%;
  max-width: 100%;
}

.note-swipe-front.notes-folder-card:active {
  transform: none;
  filter: none;
}

.note-swipe-front.notes-folder-card.is-open:active {
  transform: translateX(-7.25rem);
}

.note-draft-list {
  margin-bottom: 0;
}

.notes-folder-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-sizing: border-box;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  background: var(--surface);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.notes-folder-card-personal {
  border-left: 3px solid #0a3d45;
}

.notes-folder-card.is-empty-folder {
  opacity: 0.88;
}

.notes-folder-card-shared {
  border-left: 3px solid rgba(90, 120, 130, 0.55);
  background: rgba(255, 255, 255, 0.72);
}

.notes-folder-card-site {
  border-left: 3px solid rgba(90, 120, 130, 0.55);
  background: rgba(255, 255, 255, 0.72);
}

.notes-folder-card:active {
  transform: scale(0.99);
  filter: brightness(0.98);
}

.notes-folder-card-main {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.notes-folder-card-title {
  font-weight: 700;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.notes-folder-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.notes-folder-card-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
}

.note-card.note-card-compact,
.note-swipe-front.note-card-compact {
  padding: 0.72rem 0.95rem 0.72rem 0.9rem;
  gap: 0.2rem;
}

.note-card-compact .note-card-title {
  font-size: 0.98rem;
  line-height: 1.35;
}

.note-card-compact .note-card-meta {
  font-size: 0.74rem;
  line-height: 1.45;
}

.note-swipe-row {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0f5560;
  touch-action: pan-y pinch-zoom;
}

.note-swipe-actions {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  min-width: 7.25rem;
  z-index: 0;
  background: #0f5560;
}

.note-swipe-delete {
  border: 0;
  min-width: 7.25rem;
  padding: 0 0.75rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: none;
  background: #0f5560;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.88;
  transform: scale(0.97);
  transition: opacity 200ms ease, transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.note-swipe-delete:disabled {
  color: rgba(255, 255, 255, 0.45);
  text-shadow: none;
}

.note-swipe-front {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 0.95rem;
  background: var(--surface);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  touch-action: pan-y pinch-zoom;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-tap-highlight-color: transparent;
  box-shadow: -2px 0 8px rgba(20, 35, 40, 0.06);
}

.note-swipe-front.is-open {
  transform: translateX(-7.25rem);
}

@media (hover: hover) and (pointer: fine) {
  .note-swipe-front {
    cursor: grab;
  }
  .note-swipe-front.is-mouse-swiping {
    cursor: grabbing;
    user-select: none;
  }
}

.note-swipe-row:has(.note-swipe-front.is-open) .note-swipe-delete {
  opacity: 1;
  transform: scale(1);
}

.note-card-title {
  font-weight: 700;
  font-size: 1.02rem;
}

.note-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.42rem;
  row-gap: 0.18rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}

.note-card-meta-part {
  min-width: 0;
}

.note-card-meta-time {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.note-card-meta-flag {
  color: rgba(20, 35, 40, 0.62);
  white-space: nowrap;
}

.note-card-meta-contributor {
  margin-left: auto;
  max-width: 100%;
  text-align: right;
  white-space: nowrap;
  color: #0a3d45;
  font-weight: 800;
}

/* 相關筆記／搜尋命中：貢獻者與列表卡同一套加深色 */
.related-note-contributor,
.note-hit-contributor {
  color: #0a3d45;
  font-weight: 800;
}

.note-card-meta-sep {
  flex: 0 0 auto;
  color: rgba(20, 35, 40, 0.28);
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.trash-entry-btn {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 0.5rem;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0.9rem 0.95rem;
  text-align: left;
  border: 1px dashed rgba(10, 61, 69, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 252, 248, 0.72);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.trash-entry-btn:active {
  filter: brightness(0.98);
}

.trash-entry-label {
  grid-column: 1;
  grid-row: 1;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--brand);
}

.trash-entry-meta {
  grid-column: 1;
  grid-row: 2;
  font-size: 0.8rem;
  color: var(--muted);
}

.trash-entry-chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 1.4rem;
  color: var(--brand);
  line-height: 1;
  opacity: 0.7;
}

.backup-panel {
  margin: 0 0 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(10, 61, 69, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.backup-panel-desc,
.backup-panel-meta {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
}

.backup-panel-meta {
  margin-top: 0.35rem;
}

.notes-recover-hint {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 0.95rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius);
  border: 1px solid rgba(168, 120, 18, 0.28);
  background: linear-gradient(180deg, rgba(255, 244, 214, 0.95), rgba(255, 252, 248, 0.92));
}

.notes-recover-hint[hidden] {
  display: none !important;
}

.notes-recover-hint-title {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
  font-weight: 800;
  color: #8a5a12;
}

.notes-recover-hint-desc {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
}

.notes-recover-hint-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.notes-recover-hint-btn,
.notes-recover-hint-dismiss {
  min-height: 2.35rem;
  border-radius: 10px;
  padding: 0 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.notes-recover-hint-btn {
  border: 1px solid rgba(138, 90, 18, 0.35);
  background: #fff;
  color: #8a5a12;
}

.notes-recover-hint-dismiss {
  border: 1px solid rgba(20, 35, 40, 0.14);
  background: transparent;
  color: var(--muted);
}

.backup-actions {
  position: relative;
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.backup-action-btn {
  min-height: 2.7rem;
  border: 1px solid rgba(10, 61, 69, 0.22);
  border-radius: 10px;
  padding: 0 0.85rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand);
  background: #fff;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}

.backup-action-btn:active,
.backup-action-btn.is-pressed {
  transform: scale(0.98);
  filter: brightness(0.96);
  background: rgba(10, 61, 69, 0.06);
}

.backup-action-btn.is-busy {
  opacity: 0.72;
  cursor: wait;
  pointer-events: none;
}

.backup-action-secondary {
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.backup-import-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.backup-file-input-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  /* 完全透明在部分手機瀏覽器會點不到 */
  opacity: 0.01;
  cursor: pointer;
  /* 放大可點區域（WebKit／安卓 Chrome） */
  font-size: 100px;
  z-index: 2;
}

.backup-status {
  min-height: 1.2rem;
  margin: 0.65rem 0 0;
}

.section-heading {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand);
}

.alarm-editor-form {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.alarm-editor-form .search-label {
  margin-top: 0.35rem;
}

.alarm-editor-area {
  min-height: 5.5rem;
  max-height: 9.5rem;
  resize: vertical;
  line-height: 1.5;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.alarm-editor-actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.alarm-editor-list-wrap {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.alarm-draft-wrap {
  background: linear-gradient(180deg, rgba(196, 120, 40, 0.08), transparent 70%);
  border-radius: 12px;
  padding: 0.85rem 0.65rem 0.35rem;
  border-top: none;
  border: 1px solid rgba(196, 120, 40, 0.28);
}

.alarm-draft-item {
  width: 100%;
  text-align: left;
  cursor: pointer;
  appearance: none;
  font: inherit;
  color: inherit;
  background: rgba(255, 252, 247, 0.92);
}

.alarm-draft-swipe-row {
  margin-bottom: 0.55rem;
  background: #8b2e2e;
  touch-action: pan-y pinch-zoom;
}

.alarm-draft-swipe-row .note-swipe-actions {
  background: #8b2e2e;
}

.alarm-draft-swipe-row .note-swipe-delete {
  background: #8b2e2e;
}

.note-swipe-front.alarm-draft-item {
  margin: 0;
  background: rgba(255, 252, 247, 0.98);
  touch-action: pan-y pinch-zoom;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.alarm-draft-item-chevron {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand);
}

.alarm-draft-preview-body {
  margin: 0.35rem 0 1rem;
}

.alarm-draft-preview-actions {
  margin-bottom: 0.35rem;
  padding-bottom: 0.15rem;
}

.alarm-editor-list-head {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.alarm-editor-list {
  display: grid;
  gap: 0.55rem;
}

.alarm-editor-mode {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--brand);
}

.alarm-editor-delete-btn {
  color: #8b2e2e !important;
  border-color: rgba(139, 46, 46, 0.35) !important;
}

.alarm-editor-item {
  display: grid;
  gap: 0.35rem;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(10, 61, 69, 0.14);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  background: rgba(255, 255, 255, 0.9);
  color: inherit;
  font: inherit;
}

.detail-edit-btn {
  margin-top: 0.75rem;
  width: 100%;
  border: 1px solid rgba(10, 61, 69, 0.22);
  border-radius: 10px;
  min-height: 2.5rem;
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.alarm-editor-item-code {
  font-family: var(--font-brand);
  font-weight: 700;
  color: var(--brand);
}

.alarm-editor-item-title {
  font-size: 0.92rem;
  font-weight: 700;
}

.alarm-editor-item-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.trash-card {
  display: grid;
  gap: 0.45rem;
  width: 100%;
  border: 1px dashed rgba(20, 35, 40, 0.22);
  border-radius: var(--radius);
  padding: 0.85rem 0.9rem;
  background: rgba(255, 252, 248, 0.72);
}

.trash-select-toggle {
  border: 1.5px solid rgba(15, 85, 96, 0.35);
  border-radius: 999px;
  background: #fff;
  color: #0f5560;
  font: inherit;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.42rem 0.95rem;
  min-height: 2.15rem;
  box-shadow: 0 1px 0 rgba(20, 35, 40, 0.06);
}

.trash-select-toggle.is-active {
  border-color: #0f5560;
  background: #0f5560;
  color: #fff;
  box-shadow: none;
}

.trash-batch-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  padding: 0.65rem;
  border-radius: 12px;
  background: rgba(15, 85, 96, 0.08);
  border: 1px solid rgba(15, 85, 96, 0.18);
}

.trash-batch-bar[hidden] {
  display: none !important;
}

.trash-batch-btn {
  min-height: 2.55rem;
  border: 1px solid rgba(10, 61, 69, 0.22);
  border-radius: 10px;
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.trash-batch-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.trash-batch-danger {
  color: #fff;
  background: #0f5560;
  border-color: #0f5560;
}

.trash-batch-danger:disabled {
  color: #fff;
  background: #0f5560;
}

.trash-status-select {
  color: #0f5560 !important;
  font-weight: 700;
}

.trash-swipe-front {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
  text-align: left;
  cursor: default;
}

.trash-select-wrap {
  display: none;
  padding-top: 0.15rem;
  pointer-events: none;
}

.trash-select-check {
  width: 1.45rem;
  height: 1.45rem;
  margin: 0;
  accent-color: #0f5560;
  pointer-events: auto;
}

.trash-card-main {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.trash-select-mode .trash-select-wrap {
  display: block;
}

.trash-select-mode .trash-swipe-front {
  cursor: pointer;
  grid-template-columns: 1.7rem 1fr;
  gap: 0.7rem;
}

.trash-select-mode .note-swipe-row.is-selected .note-swipe-front {
  border-color: rgba(15, 85, 96, 0.55);
  background: rgba(15, 85, 96, 0.1);
  box-shadow: inset 0 0 0 1.5px rgba(15, 85, 96, 0.35);
}

.trash-select-mode .trash-card-restore,
.trash-select-mode .note-swipe-actions {
  display: none !important;
}

.trash-select-mode .note-swipe-front {
  transform: none !important;
}

.trash-select-mode .note-swipe-row {
  background: transparent;
}

.trash-swipe-front .trash-card-restore {
  margin-top: 0.15rem;
  justify-self: start;
}

.trash-card-restore {
  justify-self: start;
  border: 0;
  border-radius: 8px;
  min-height: 2.2rem;
  padding: 0 0.85rem;
  font: inherit;
  font-weight: 700;
  color: #fff8f2;
  background: linear-gradient(145deg, #0f5560 0%, #0a3d45 100%);
  cursor: pointer;
}

body.note-editor-open {
  background: #000;
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

/* 兩指放大：整頁改回可捲動文件流，避免 fixed shell 像「下方浮框」 */
html.page-zoomed body.note-editor-open {
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  overflow: visible;
}

html.page-zoomed body.note-editor-open .note-editor-shell {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  min-height: 100dvh;
  overflow: visible;
  overscroll-behavior: auto;
  padding: 0 !important;
}

html.page-zoomed body.note-editor-open .note-canvas {
  border-radius: 0;
  overflow: visible;
  flex: none;
  min-height: 70dvh;
  overscroll-behavior: auto;
}

body.note-editor-open .atmosphere {
  display: none;
}

.note-editor-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: 0;
  background: #000;
  color: #f2f2f7;
}

/* 編輯頁對齊 visualViewport（由 JS 設 top/height），格式列才能跟著鍵盤 */
body.note-editor-open .note-editor-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  width: 100%;
  max-width: none;
  margin: 0;
  /* 拿掉 .shell 內距，避免左右／下方露出黑邊像框 */
  padding: 0 !important;
  min-height: 0;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: contain;
}

.note-editor-bar {
  order: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0;
  padding: max(0.35rem, env(safe-area-inset-top)) 0.75rem 0.35rem;
}

.note-sync-status {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

.note-upload-draft-btn {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #ffd60a;
  color: #1c1c1e;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}

.note-upload-draft-btn:active {
  opacity: 0.85;
}

/* 已送審：仍可點以跳出說明，但外觀改為不可再送審 */
.note-upload-draft-btn.is-pending-blocked {
  background: #c7c7cc;
  color: #3a3a3c;
  cursor: default;
}

.note-upload-draft-btn.is-pending-blocked:active {
  opacity: 1;
}

.note-upload-draft-btn[hidden] {
  display: none !important;
}

.note-push-notion-btn {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 61, 69, 0.14);
  color: var(--brand);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}

.note-push-notion-btn:active {
  opacity: 0.85;
}

.note-push-notion-btn[hidden] {
  display: none !important;
}

.note-contributor-edit-btn {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 61, 69, 0.14);
  color: var(--brand);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}

.note-contributor-edit-btn:active {
  opacity: 0.85;
}

.note-contributor-edit-btn[hidden] {
  display: none !important;
}

.note-contributor-line {
  margin: -0.15rem 0 0.55rem;
  padding: 0 0.1rem;
  color: rgba(235, 235, 245, 0.58);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.note-contributor-line[hidden] {
  display: none !important;
}

.note-shared-delete-btn {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 69, 58, 0.18);
  color: #ff6961;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}

.note-shared-delete-btn:active {
  opacity: 0.85;
}

.note-shared-delete-btn[hidden] {
  display: none !important;
}

.note-draft-preview-body {
  margin-top: 0.75rem;
  padding: 0.9rem 0.85rem 1rem;
  border-radius: 0.9rem;
  background: #1c1c1e;
  border: 1px solid rgba(84, 84, 88, 0.45);
}

.note-draft-preview-title {
  margin: 0 0.15rem 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #f2f2f7;
}

.note-draft-preview-meta {
  margin: 0 0.15rem 0.95rem;
  color: #8e8e93;
  font-size: 0.88rem;
}

.note-draft-preview-canvas {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.note-draft-preview-block {
  margin: 0 0.15rem;
  color: #f2f2f7;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.note-draft-preview-body .note-text-readonly {
  color: #f2f2f7;
}

.note-draft-preview-body .note-text-readonly .note-heading,
.note-draft-preview-body .note-text-readonly .note-para,
.note-draft-preview-body .note-text-readonly .note-prose,
.note-draft-preview-body .note-text-readonly .note-path,
.note-draft-preview-body .note-rich-readonly {
  color: #f2f2f7;
}

.note-draft-preview-body .note-text-readonly a,
.note-draft-preview-body .note-rich-readonly a {
  color: #6cb6ff;
}

.note-draft-preview-image-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  border-radius: 0.55rem;
  overflow: hidden;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

.note-draft-preview-image {
  display: block;
  width: 100%;
  max-height: none;
  height: auto;
  object-fit: contain;
  background: #000;
}

.note-canvas {
  order: 1;
}

.note-editor-dock {
  order: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.55rem;
  background: #000;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.note-dock-tray {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 430px;
  min-height: 2.5rem;
  padding: 0.28rem 0.35rem;
  border-radius: 14px;
  background: #2c2c2e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.note-dock-tray::-webkit-scrollbar {
  display: none;
}

/* 格式列與加號都隱藏時才收起底部列 */
.note-editor-dock:not(:has(.note-dock-tray > :not([hidden]))) {
  display: none;
}

.note-dock-tray:not(:has(.note-format-bar:not([hidden]))) {
  justify-content: center;
}

.note-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  min-height: 2.35rem;
  padding: 0.35rem 0.85rem 0.35rem 0.55rem;
  border: 1px solid rgba(255, 248, 242, 0.22);
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  color: #fff8f2;
  background: linear-gradient(145deg, #0f5560 0%, #0a3d45 100%);
  box-shadow:
    0 6px 16px rgba(10, 40, 48, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  -webkit-tap-highlight-color: transparent;
}

.note-back-btn:active {
  transform: scale(0.97);
  filter: brightness(1.08);
}

.note-back-chevron {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
  margin-top: -0.05rem;
}

.note-back-label {
  letter-spacing: 0.04em;
}

.note-bottom-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding: 0.35rem 0 0.75rem;
}

/* 鍵盤或格式列開啟時隱藏底部返回，避免擠在文末 */
body.note-keyboard-open .note-bottom-actions,
body.note-format-open .note-bottom-actions {
  display: none;
}

.note-insert-fab {
  flex-shrink: 0;
  position: static;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-left: 0;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
  color: #fff8f2;
  background: linear-gradient(145deg, #0f5560 0%, #0a3d45 100%);
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform: none;
}

.note-dock-tray:has(.note-format-bar:not([hidden])) .note-insert-fab {
  margin-left: auto;
}

.note-format-bar {
  position: static;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  gap: 0.22rem;
  min-width: 0;
  width: auto;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.note-format-bar[hidden] {
  display: none !important;
}

.note-format-sep {
  flex-shrink: 0;
  width: 1px;
  height: 1.15rem;
  margin: 0 0.12rem;
  background: rgba(255, 255, 255, 0.18);
}

.note-format-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 0.35rem;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  color: #f2f2f7;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.note-format-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

.note-format-swatch {
  width: 1.9rem;
  padding: 0;
  border-radius: 999px;
  background: var(--swatch, #ffd60a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.note-format-swatch-white {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.75),
    0 0 0 1px rgba(0, 0, 0, 0.35);
}

.note-format-clear {
  min-width: 1.9rem;
  padding: 0 0.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: #fff8f2;
  background: rgba(196, 92, 38, 0.35);
}

.note-format-swatch:active {
  filter: brightness(1.08);
}

body:not(.note-editor-open) .note-format-bar,
body.note-readonly .note-format-bar {
  display: none !important;
}

.note-insert-fab[hidden],
body:not(.note-editor-open) .note-insert-fab,
body.note-readonly .note-insert-fab {
  display: none !important;
}

.note-insert-fab:active {
  transform: scale(0.96);
}

.note-back-btn-bottom {
  min-width: 9.5rem;
  justify-content: center;
  padding-left: 1rem;
  padding-right: 1.1rem;
}

.note-sync-status {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-size: 0.78rem;
  color: rgba(235, 235, 245, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 0.35rem;
}

.note-canvas {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #1c1c1e;
  border-radius: 18px 18px 0 0;
  padding: 1rem 1.05rem max(1.5rem, env(safe-area-inset-bottom));
  touch-action: pan-y pinch-zoom;
}

.note-autosave-hint {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.78rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(100, 210, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(100, 210, 255, 0.14), rgba(48, 209, 88, 0.08) 55%, rgba(28, 28, 30, 0.35)),
    rgba(44, 44, 46, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.note-autosave-hint[hidden],
body.note-readonly .note-autosave-hint {
  display: none !important;
}

.note-autosave-hint-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  color: #64d2ff;
  background: rgba(100, 210, 255, 0.16);
}

.note-autosave-hint-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.note-autosave-hint-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(100, 210, 255, 0.88);
}

.note-autosave-hint-text {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  color: #f2f2f7;
}

.note-blocks {
  display: grid;
  gap: 0.75rem;
}

.note-text-block {
  display: block;
  width: 100%;
  min-height: 1.65em;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  resize: none;
  overflow-x: hidden;
  overflow-y: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.65;
  color: #f2f2f7;
  field-sizing: content;
}

.note-text-block[contenteditable="true"] {
  outline: none;
  caret-color: #ffd60a;
  -webkit-user-select: text;
  user-select: text;
}

.note-text-block[contenteditable="true"]:empty:before,
.note-text-block[contenteditable="true"].is-empty:before {
  content: attr(data-placeholder);
  color: rgba(235, 235, 245, 0.35);
  pointer-events: none;
}

.note-rich-readonly {
  white-space: pre-wrap;
  word-break: break-word;
}

.note-rich-readonly b,
.note-rich-readonly strong,
.note-text-block b,
.note-text-block strong {
  font-weight: 700;
}

/* 一般空白文字：收合高度（主內文除外） */
.note-text-block.is-empty:not(:focus):not(.is-insert-slot):not(.is-primary-body) {
  min-height: 0.25em;
  line-height: 1;
}

.note-text-block.is-primary-body.is-empty:not(:focus) {
  min-height: 1.65em;
}

/* 照片旁插入點：加大點擊區，方便在兩張照片中間新增 */
.note-block-text.is-insert-slot-wrap {
  min-height: 2.75rem;
}

.note-text-block.is-insert-slot {
  min-height: 2.75rem;
  padding: 0.55rem 0.15rem;
  border-radius: 10px;
  box-sizing: border-box;
}

.note-text-block.is-insert-slot.is-empty:not(:focus) {
  min-height: 2.75rem;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.note-text-block.is-insert-slot:focus {
  background: transparent;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
}

.note-text-block.is-insert-slot::placeholder {
  color: rgba(235, 235, 245, 0.38);
  font-size: 0.92rem;
}

.add-category-form {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.add-category-form[hidden] {
  display: none !important;
}

.category-create-btn {
  min-height: 2.5rem;
  border: 1px solid rgba(10, 61, 69, 0.22);
  border-radius: 10px;
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.note-category-field {
  margin: 0 0 0.85rem;
}

.note-category-field[hidden] {
  display: none !important;
}

.note-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.4rem;
}

.note-category-label {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(235, 235, 245, 0.42);
}

.note-category-row-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.note-category-row-actions .note-content-report-btn {
  min-height: 2.1rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.note-category-row-actions .note-content-report-btn[hidden] {
  display: none !important;
}

.note-category-add-link {
  border: none;
  background: transparent;
  color: rgba(100, 210, 255, 0.9);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.note-category-delete-link {
  border: none;
  background: transparent;
  color: rgba(255, 105, 97, 0.92);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.note-category-delete-link[hidden] {
  display: none !important;
}

.note-category-select {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(235, 235, 245, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(235, 235, 245, 0.92);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(235, 235, 245, 0.55) 50%),
    linear-gradient(135deg, rgba(235, 235, 245, 0.55) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.note-category-select:focus {
  outline: none;
  border-color: rgba(100, 210, 255, 0.55);
}

.note-category-select option {
  color: #111;
  background: #fff;
}

.note-category-add-form {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.note-category-add-form[hidden] {
  display: none !important;
}

.note-category-name-input {
  flex: 1;
  min-height: 2.2rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(235, 235, 245, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
}

.note-category-add-submit {
  min-width: 4.2rem;
  border: none;
  border-radius: 10px;
  background: rgba(100, 210, 255, 0.22);
  color: #fff;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.note-category-tag {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: rgba(235, 235, 245, 0.45);
}

.note-title-input {
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: clamp(1.22rem, 5.4vw, 1.55rem);
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.note-title-input:focus {
  outline: none;
}

.note-title-input::placeholder {
  color: rgba(235, 235, 245, 0.35);
}

.note-text-block:focus {
  outline: none;
}

.note-text-block::placeholder {
  color: rgba(235, 235, 245, 0.35);
}

.note-text-readonly {
  white-space: normal;
  cursor: default;
  user-select: text;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.note-text-readonly .note-heading {
  margin: 1.15rem 0 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  letter-spacing: 0.01em;
}

.note-text-readonly .note-heading:first-child {
  margin-top: 0.1rem;
}

.note-text-readonly .note-para {
  margin: 0 0 0.85rem;
  line-height: 1.7;
  color: #e8e8ee;
}

.note-text-readonly .note-para:last-child {
  margin-bottom: 0;
}

.note-text-readonly .note-prose {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 0.95rem;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.note-text-readonly .note-prose:last-child {
  margin-bottom: 0;
}

.note-text-readonly .note-sentence {
  display: grid;
  grid-template-columns: 1.35rem 1fr;
  gap: 0.45rem;
  margin: 0;
  align-items: start;
  line-height: 1.65;
  color: #e8e8ee;
}

.note-text-readonly .note-sentence-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  border-radius: 999px;
  background: rgba(125, 211, 199, 0.18);
  color: #9fe0d5;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.note-text-readonly .note-sentence-body {
  min-width: 0;
  overflow-wrap: anywhere;
}

.note-text-readonly .note-ui-term {
  display: inline;
  padding: 0.08em 0.32em;
  border-radius: 0.35em;
  background: rgba(240, 217, 168, 0.16);
  color: #f0d9a8;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.note-text-readonly .note-ui-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2em;
  padding: 0 0.2em;
  border-radius: 0.35em;
  background: rgba(125, 211, 199, 0.2);
  color: #b8ebe1;
  font-weight: 700;
}

/* 工程師提供內容：橘色實心標章＋整塊左邊框，一眼辨識為現場人員資料 */
.note-text-readonly .note-contrib {
  margin: 0 0 0.95rem;
  padding: 0.7rem 0.8rem 0.8rem;
  border-radius: 12px;
  background: rgba(224, 122, 58, 0.12);
  border: 1px solid rgba(224, 122, 58, 0.34);
  border-left: 4px solid #e07a3a;
}

.note-text-readonly .note-contrib:last-child {
  margin-bottom: 0;
}

.note-text-readonly .note-contrib-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.note-text-readonly .note-contrib-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff8f2;
  background: linear-gradient(180deg, #e07a3a 0%, var(--accent) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 2px 6px rgba(196, 92, 38, 0.35);
  white-space: nowrap;
}

.note-text-readonly .note-contrib-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffd2b0;
}

.note-text-readonly .note-contrib .note-prose {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.note-text-readonly .note-contrib .note-para {
  margin: 0;
}

.note-text-readonly .note-contrib .note-sentence-index {
  background: rgba(224, 122, 58, 0.26);
  color: #ffc59e;
}

.note-text-readonly .note-list {
  margin: 0 0 0.95rem;
  padding: 0 0 0 1.15rem;
}

.note-text-readonly .note-list:last-child {
  margin-bottom: 0;
}

.note-text-readonly .note-list li {
  margin: 0 0 0.5rem;
  padding-left: 0.15rem;
  line-height: 1.65;
  color: #e8e8ee;
}

.note-text-readonly .note-list li:last-child {
  margin-bottom: 0;
}

.note-text-readonly .note-path {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(125, 211, 199, 0.08);
  border: 1px solid rgba(125, 211, 199, 0.18);
  font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #b8ebe1;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.note-text-readonly .note-kv {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.note-text-readonly .note-kv-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(235, 235, 245, 0.55);
}

.note-text-readonly .note-kv-value {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #f0d9a8;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: pre-wrap;
}

.note-external-link {
  color: #7dd3c7;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
  word-break: break-word;
  cursor: pointer;
}

.note-external-link:active {
  color: #c45c26;
}

.note-readonly-empty {
  margin: 0.5rem 0 0;
  color: rgba(235, 235, 245, 0.45);
}

body.note-readonly .note-title-input {
  pointer-events: none;
  caret-color: transparent;
  opacity: 1;
  color: #fff;
  -webkit-text-fill-color: #fff;
  user-select: text;
}

body.note-readonly .note-text-readonly {
  -webkit-user-select: text;
  user-select: text;
}


.note-block-image {
  margin: 0.15rem 0;
}

.note-inline-image {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #0f0f10;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.note-inline-image img {
  display: block;
  width: 100%;
  max-height: min(52vh, 400px);
  margin: 0 auto;
  object-fit: contain;
  background: #101012;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* 資料庫筆記唯讀：不再提供底部「+」插入列 */

.sheet-overlay {
  position: fixed;
  /* 鍵盤開啟時 bottom 對齊鍵盤頂部（JS 設 --sheet-keyboard-offset） */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.45);
}

/* 筆記編輯中：插入選單對齊 visualViewport（與筆記殼同一塊可見區）。
   不可再用 bottom=鍵盤高度：安卓 innerHeight 常含鍵盤，會把選單擠到頂端只剩「取消」。 */
body.note-editor-open .sheet-overlay {
  top: var(--note-sheet-top, 0px);
  height: var(--note-sheet-height, 100%);
  max-height: var(--note-sheet-height, 100%);
  bottom: auto;
}

.sheet-overlay[hidden] {
  display: none !important;
}

.insert-menu {
  width: min(100%, 430px);
  display: grid;
  gap: 0.45rem;
  padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
  animation: sheet-up 220ms ease-out;
}

@keyframes sheet-up {
  from {
    transform: translateY(18px);
    opacity: 0.5;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.insert-menu-item,
.insert-menu-cancel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.15rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 14px;
  background: #2c2c2e;
  color: #f2f2f7;
  font: inherit;
  font-size: 1.02rem;
  text-align: left;
  cursor: pointer;
}

.insert-menu-item.is-disabled,
.insert-menu-item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.insert-menu-item.danger {
  color: #ff453a;
}

.insert-menu-icon {
  display: inline-flex;
  color: #ffd60a;
}

.insert-menu-cancel {
  justify-content: center;
  margin-top: 0.2rem;
  font-weight: 700;
  color: #ffd60a;
}

.markup-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: #000;
}

.markup-overlay[hidden] {
  display: none !important;
}

.image-crop-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.55rem 0.7rem;
  touch-action: none;
}

.image-crop-frame {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  touch-action: none;
}

.image-crop-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.image-crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  touch-action: none;
}

.image-crop-handle {
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  margin: -0.58rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(10, 61, 69, 0.28);
  z-index: 2;
}

.image-crop-handle::after {
  content: "";
  position: absolute;
  inset: -0.7rem;
}

.image-crop-handle[data-crop-handle="nw"] { left: 0; top: 0; }
.image-crop-handle[data-crop-handle="n"] {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  margin: -0.58rem 0 0;
}
.image-crop-handle[data-crop-handle="ne"] { right: 0; top: 0; left: auto; }
.image-crop-handle[data-crop-handle="e"] {
  right: 0;
  top: 50%;
  left: auto;
  transform: translateY(-50%);
  margin: 0 -0.58rem 0 0;
}
.image-crop-handle[data-crop-handle="se"] { right: 0; bottom: 0; left: auto; top: auto; }
.image-crop-handle[data-crop-handle="s"] {
  left: 50%;
  bottom: 0;
  top: auto;
  transform: translateX(-50%);
  margin: 0 0 -0.58rem;
}
.image-crop-handle[data-crop-handle="sw"] { left: 0; bottom: 0; top: auto; }
.image-crop-handle[data-crop-handle="w"] {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 0 0 -0.58rem;
}

.image-crop-hint {
  margin: 0;
  padding: 0.35rem 0.85rem max(0.85rem, env(safe-area-inset-bottom));
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
}

.markup-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: max(0.65rem, env(safe-area-inset-top)) 0.85rem 0.55rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}

.markup-bar-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  justify-self: start;
}

.markup-cancel,
.markup-done {
  border: 0;
  background: transparent;
  color: #0a84ff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.15rem 0.2rem;
}

.markup-done {
  justify-self: end;
  font-weight: 600;
}

.markup-title {
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-align: center;
}

.markup-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 0.5rem;
}

.markup-stage canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  touch-action: none;
}

#markupBaseCanvas {
  z-index: 1;
}

#markupDrawCanvas {
  z-index: 2;
  cursor: crosshair;
}

.markup-tools {
  padding: 0.45rem 0.85rem max(0.85rem, env(safe-area-inset-bottom));
  background: transparent;
}

.markup-tray {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: center;
  padding: 0.85rem 1rem 0.9rem;
  border-radius: 1.4rem;
  background: rgba(44, 44, 46, 0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.1),
    0 12px 30px rgba(0, 0, 0, 0.38);
}

.markup-history-row {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.markup-history {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: #0a84ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.markup-history svg {
  width: 1.25rem;
  height: 1.25rem;
}

.markup-history:disabled {
  opacity: 0.28;
  cursor: default;
}

.markup-tool-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1.15rem;
  min-height: 3.6rem;
  width: 100%;
}

.markup-tool {
  position: relative;
  width: 2.7rem;
  height: 3.4rem;
  padding: 0;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 0.18s ease;
}

.markup-tool.active {
  transform: translateY(-0.62rem);
}

.markup-tool-svg {
  width: 1.55rem;
  height: 3.15rem;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
  overflow: visible;
}

.markup-tool[data-tool="highlighter"] .markup-tool-svg {
  width: 1.85rem;
}

.markup-tool[data-tool="eraser"] .markup-tool-svg {
  width: 1.75rem;
}

.markup-ink-fill {
  fill: var(--markup-ink, #ffd60a);
}

.markup-size-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0 0.15rem;
}

.markup-size-icon {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #d1d1d6;
}

.markup-size-icon--sm {
  width: 0.35rem;
  height: 0.35rem;
}

.markup-size-icon--lg {
  width: 0.85rem;
  height: 0.85rem;
}

.markup-size-slider {
  flex: 1 1 auto;
  min-width: 0;
  height: 1.6rem;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  touch-action: none;
}

.markup-size-slider:focus {
  outline: none;
}

.markup-size-slider::-webkit-slider-runnable-track {
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.markup-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: -0.54rem;
  border-radius: 999px;
  border: 0;
  background: #f2f2f7;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.markup-size-slider::-moz-range-track {
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  border: 0;
}

.markup-size-slider::-moz-range-thumb {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 0;
  background: #f2f2f7;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.markup-size-preview {
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--markup-ink, #ffd60a);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.2);
}

.markup-color-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.58rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  width: 100%;
  padding: 0.1rem 0.05rem;
  -webkit-overflow-scrolling: touch;
}

.markup-color {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--swatch);
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.25);
}

.markup-color.active {
  outline: 2.5px solid #fff;
  outline-offset: 2px;
  box-shadow:
    inset 0 0 0 0.5px rgba(0, 0, 0, 0.2),
    0 0 0 0.5px rgba(255, 255, 255, 0.35);
}

.markup-color[data-color="#ffffff"] {
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.35);
}

.note-card {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 0.95rem;
  background: var(--surface);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.note-card-title {
  font-weight: 700;
  font-size: 1.02rem;
}

.note-hit-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.note-hit-card {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  background: rgba(255, 252, 248, 0.88);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.note-hit-card:active {
  transform: scale(0.99);
  filter: brightness(0.98);
}

.note-hit-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.note-hit-meta {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.note-hit-meta .note-hit-contributor {
  color: #0a3d45;
  font-weight: 800;
}

.related-notes-slot {
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(10, 61, 69, 0.14);
}

.related-notes-heading {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.related-notes-meta {
  margin: 0 0 0.55rem;
}

.related-notes-list {
  display: grid;
  gap: 0.5rem;
}

.related-note-btn {
  display: grid;
  gap: 0.18rem;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(10, 61, 69, 0.28);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: linear-gradient(180deg, rgba(232, 246, 239, 0.95), rgba(255, 252, 248, 0.94));
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.related-note-btn.is-local {
  border-color: rgba(100, 210, 255, 0.45);
  background: linear-gradient(180deg, rgba(100, 210, 255, 0.16), rgba(255, 252, 248, 0.96));
}

.related-note-btn.is-shared {
  border-color: rgba(10, 61, 69, 0.22);
}

.related-note-btn:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}

.related-note-btn-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brand);
}

.related-note-title {
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.related-note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.42rem;
  row-gap: 0.18rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

.related-note-meta .note-card-meta-contributor {
  margin-left: auto;
}

.related-note-meta .related-note-contributor {
  color: #0a3d45;
  font-weight: 800;
}

.block-notes-hit + .block,
.block + .block-notes-hit {
  margin-top: 0.55rem;
}

.draft-hit-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.draft-hit-card {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(196, 120, 40, 0.35);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  background: linear-gradient(180deg, rgba(255, 244, 230, 0.95), rgba(255, 252, 248, 0.92));
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.draft-hit-card:active {
  transform: scale(0.99);
  filter: brightness(0.98);
}

.draft-hit-badge {
  justify-self: start;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #8a4b12;
  background: rgba(196, 120, 40, 0.16);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
}

.draft-hit-code {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--brand);
}

.draft-hit-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.draft-hit-meta {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.block-missing-alarm {
  display: grid;
  gap: 0.75rem;
}

.block-missing-alarm .empty {
  margin: 0;
}

.missing-alarm-add-btn {
  margin-top: 0.15rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  background: rgba(8, 20, 24, 0.96);
  padding: 0;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 0.75rem 2.5rem;
  touch-action: none;
  overscroll-behavior: none;
}

.lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 100vw);
  max-height: min(78dvh, 100%);
  object-fit: contain;
  border-radius: 8px;
  transform-origin: center center;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: transform;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: auto;
  touch-action: none;
}

.lightbox-hint {
  margin: 0;
  padding: 0.45rem 0.75rem max(0.65rem, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.55);
}

.lightbox-close {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  right: 0.9rem;
  z-index: 2;
  border: 0;
  background: rgba(0, 0, 0, 0.35);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

body.lightbox-open {
  overflow: hidden;
  touch-action: none;
}

/* iPhone 式右滑返回：跟手過渡 */
body.swipe-nav-active {
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.swipe-scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

.swipe-front {
  z-index: 40 !important;
  box-shadow: -4px 0 18px rgba(0, 0, 0, 0.14);
  will-change: transform;
  transition: none;
}

.shell.view.swipe-front:not(.note-editor-shell),
.shell.view.swipe-under:not(.note-editor-shell) {
  position: fixed !important;
  left: 50%;
  top: 0;
  bottom: 0;
  width: min(100%, 430px);
  margin: 0;
  transform: translateX(-50%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.shell.view.swipe-front:not(.note-editor-shell) {
  background:
    radial-gradient(120% 80% at 10% -10%, #f4e6d4 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 0%, #9fc3c0 0%, transparent 50%),
    linear-gradient(165deg, #e8f0ee 0%, #c5d8d4 48%, #a8c2bf 100%);
}

.note-editor-shell.swipe-front,
.note-editor-shell.swipe-under {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  width: 100%;
  max-width: none;
  margin: 0;
  transform: none;
  overflow: hidden;
  background: #000;
  height: 100dvh;
  max-height: 100dvh;
}

.shell.view.swipe-under:not(.note-editor-shell):not([hidden]),
.note-editor-shell.swipe-under:not([hidden]) {
  display: block !important;
  z-index: 30 !important;
  pointer-events: none;
  will-change: transform;
}

/* 安全網：手勢已結束（body 無 swipe-nav-active）卻殘留 .swipe-under 時，
   不可再用 pointer-events:none 鎖住整個畫面（曾造成「看得到卻點不動」） */
body:not(.swipe-nav-active) .shell.view.swipe-under:not([hidden]),
body:not(.swipe-nav-active) .note-editor-shell.swipe-under:not([hidden]) {
  pointer-events: auto;
}

/* 非右滑狀態：禁止殘留 fixed／滿高，否則短內容頁會出現大片可捲空白 */
.shell.view:not(.swipe-front):not(.swipe-under):not(.note-editor-shell):not([hidden]) {
  position: static !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: min(100%, 430px) !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
  transform: none !important;
  box-shadow: none !important;
}

.swipe-inline-front {
  will-change: transform;
  transition: none;
  position: relative;
  z-index: 5;
  box-shadow: -4px 0 18px rgba(0, 0, 0, 0.14);
  background: transparent;
}

/* 查修頁右滑：整個 #homeView 當前景（與 .swipe-front 同一套陰影／背景／無圓角）。
   舊版只把 .results 釘成 fixed 面板，會出現「上半靜止、下半跟手」，勿再恢復。 */
.results.swipe-search-panel,
.search-action-bar.swipe-search-panel {
  will-change: transform;
}

.sheet-overlay.swipe-front,
.markup-overlay.swipe-front,
.lightbox.swipe-front,
.app-confirm-overlay.swipe-front {
  transition: none;
}

@media (max-width: 640px) {
  body.note-editor-open .note-editor-shell {
    padding: 0 !important;
  }

  .note-canvas {
    padding: 0.9rem 0.8rem max(1.35rem, env(safe-area-inset-bottom));
    min-height: 0;
  }

  .note-blocks {
    gap: 0.75rem;
  }

  .note-text-block {
    font-size: 1.02rem;
    line-height: 1.7;
  }

  .note-text-readonly .note-heading {
    font-size: 1.06rem;
    margin-top: 1rem;
  }

  .note-text-readonly .note-path,
  .note-text-readonly .note-kv-value {
    font-size: 0.74rem;
  }

  .note-inline-image img {
    max-height: min(48vh, 360px);
  }
}

/* 離線告警模式：筆記／維護仍可見但提示需連網 */
body.offline-alarms-mode #openNotesHub .nav-card-desc::after {
  content: "（離線時不可用）";
}

/* 手機橫向：全站只支援直向。iOS 不吃 manifest 的 orientation，也沒有可用的鎖定 API，
   只能蓋提示層擋住橫向操作。限定 pointer: coarse 與矮視窗，避免誤擋桌機與 iPad。 */
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  body::after {
    content: "請將手機轉回直向使用";
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    font-family: var(--font-ui);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--brand);
    background:
      radial-gradient(120% 80% at 10% -10%, #f4e6d4 0%, transparent 55%),
      linear-gradient(165deg, #e8f0ee 0%, #c5d8d4 48%, #a8c2bf 100%);
    /* 遮罩本身不可捲，避免觸控穿透去捲背後頁面 */
    touch-action: none;
  }
}

.word-import-pick-sheet {
  width: min(100%, 430px);
  max-height: min(78vh, 36rem);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: #fffdf9;
  border: 1px solid rgba(10, 61, 69, 0.12);
  box-shadow: 0 -12px 36px rgba(10, 40, 48, 0.22);
  padding: 0.85rem 0.9rem max(0.7rem, env(safe-area-inset-bottom, 0px));
  animation: sheet-up 220ms ease-out;
}

.word-import-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.word-import-pick-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--brand);
}

.word-import-pick-toggle {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  min-height: 2.2rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(10, 61, 69, 0.18);
  border-radius: 999px;
  background: rgba(15, 85, 96, 0.08);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.word-import-pick-toggle:active {
  transform: scale(0.98);
}

.word-import-pick-hint {
  margin: 0.45rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.word-import-category-wrap {
  display: grid;
  gap: 0.28rem;
  margin: 0.1rem 0 0.45rem;
}

.word-import-category-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.word-import-category-create {
  display: grid;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem 0.65rem;
  border-bottom: 1px solid var(--line);
}

.word-import-category-create .full-input {
  min-height: 2.4rem;
}

.word-import-category-create .app-confirm-ok {
  min-height: 2.4rem;
}

.word-import-category-create-status {
  margin: 0;
  color: var(--danger, #b42318);
  font-size: 0.82rem;
  line-height: 1.35;
}

.word-import-pick-list {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  gap: 0.28rem;
  margin: 0.15rem 0 0.7rem;
  min-height: 4rem;
  max-height: min(46vh, 22rem);
}

.word-import-pick-row {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-height: 2.55rem;
  margin: 0;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(10, 61, 69, 0.12);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.word-import-pick-row input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: #0f5560;
}

.word-import-pick-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-import-pick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
