/* メインコンテナ */
.main-slider-wrapper {
  width: 100%;
  overflow: hidden;
  position: relative;
  margin-top: 0px; /* 達成数プログレスバーとの間隔を10px拡張 */
}

/* ホーム画面（スライド0）時のみ上部マージンを付与 */
body:not(.is-focus-view):not(.is-in-progress-view) .main-slider-wrapper {
  margin-top: 18px;
}

.main-slides {
  display: flex;
  width: 300%; /* 3画面分 */
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.main-slide-page {
  width: 33.333%;
  padding: 0 16px;
  box-sizing: border-box;
  min-height: calc(100vh - 160px);
}

/* 開始・作業中 共通モードヘッダー帯（上下幅62px固定・ドット除外） */
.tab-mode-header {
  display: none;
  width: 100%;
  height: 62px;
  box-sizing: border-box;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}

/* 開始・作業中タブ表示時はホーム用の通常ヘッダーと緑バーを非表示 */
.header-sticky-wrapper.is-start-view .header,
.header-sticky-wrapper.is-start-view #dailyGoalBarContainer,
.header-sticky-wrapper.is-in-progress-view .header,
.header-sticky-wrapper.is-in-progress-view #dailyGoalBarContainer {
  display: none !important;
}

/* 開始タブ表示時：セーフティーゾーン（親ラッパー）ごとオレンジグラデーション適用 */
.header-sticky-wrapper.is-start-view {
  background: linear-gradient(135deg, #ff7a00 0%, #ff5100 100%) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.header-sticky-wrapper.is-start-view .tab-mode-header {
  display: flex !important;
  background: transparent;
}

/* 作業中タブ表示時：セーフティーゾーン（親ラッパー）ごと紫グラデーション適用 */
.header-sticky-wrapper.is-in-progress-view {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.header-sticky-wrapper.is-in-progress-view .tab-mode-header {
  display: flex !important;
  background: transparent;
}

/* モードタイトル（三本線・ストリークと完全同等の縦中央・白太字） */
.tab-mode-title {
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 進捗ドットコンテナ（タイトル・タイマーと同階層の絶対配置で統一） */
.tab-mode-dots {
  position: absolute;
  top: calc(51% - 270px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: auto;
  height: 24px;
  margin: 0;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 6;
}

/* ドット基本スタイル */
.tab-mode-dot {
  border-radius: 50%;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

/* 1. グレー：まだ手を付けていないアクション (w-2.5 h-2.5 bg-white/20) */
.tab-mode-dot.dot-pending {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  box-shadow: none;
}

/* 2. 白：現在表示中のアクション (w-3 h-3 bg-white ring-2 ring-cyan-300) */
.tab-mode-dot.dot-current {
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: none;
  box-shadow: 0 0 0 2px #67e8f9; /* ring-2 ring-cyan-300 */
}

/* 3. 青：すでに済んでいるアクション (w-2.5 h-2.5 bg-cyan-400 shadow-[0_0_8px_#00e5ff]) */
.tab-mode-dot.dot-completed {
  width: 10px;
  height: 10px;
  background: #22d3ee; /* cyan-400 */
  border: none;
  box-shadow: 0 0 8px #00e5ff; /* shadow-[0_0_8px_#00e5ff] */
}

/* 丸囲み進捗アイコン（先頭▷・末尾✓） */
.tab-mode-dot.dot-icon-circle {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: transparent;
  transition: all 0.2s ease;
}
.tab-mode-dot.dot-icon-circle svg {
  width: 8px;
  height: 8px;
}

/* ✓ チェック（末尾）：紫塗りつぶし・白アイコン */
.tab-mode-dot.dot-icon-circle:last-child {
  background: linear-gradient(135deg, #00e5ff 0%, #0284c7 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 6px rgba(168, 85, 247, 0.6);
}
.tab-mode-dot.dot-icon-circle:last-child svg {
  fill: none;
  stroke: #ffffff;
}

/* 未着手状態（未到達時でも色がわかるよう半透明化） */
.tab-mode-dot.dot-icon-circle.dot-pending {
  opacity: 0.45;
  box-shadow: none;
}


/* 完了状態 */
.tab-mode-dot.dot-icon-circle.dot-completed {
  opacity: 1;
}

/* 実行中表示時：全画面フォーカス（ヘッダーは表示） */
body.is-in-progress-view {
  overflow: hidden !important;
  height: 100vh;
  height: 100dvh;
  touch-action: none;
}

/* 実行中表示時は右下の新規追加ボタン（＋）を非表示 */
body.is-in-progress-view .fab-group {
  display: none !important;
}

/* タブ2：1タスクごとの全画面スナップ区画（上下16pxパディングでカードを固定位置に収める） */
.prog-snap-page {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 16px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* タブ1・タブ2共通：タイトルからボタンまでを囲う伸縮カード枠 */
.focus-task-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: var(--focus-card-height);
  background: var(--ui-bg-surface);
  border-top: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.4) !important;
  border-radius: 20px;
  box-shadow: var(--ui-shadow-panel);
  box-sizing: border-box;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}

/* タスク名：タイマーの上部に一定距離で配置 */
.home-task-title {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #94a3b8;
  margin: 1px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.home-sub-task {
  position: absolute;
  top: calc(51% - 240px);
  left: 16px;
  right: 16px;
  font-family:
    "Noto Sans JP",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-size: min(2.4rem, 6.5cqw);
  font-weight: 700;
  color: #ffffff;
  margin: 3px;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

/* アクション名とタイマーの間の時刻表示（スライド1・スライド2共通） */
.mode-time-display {
  position: absolute;
  top: calc(51% - 190px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  z-index: 5;
  white-space: nowrap;
}

.home-timer-wrapper {
  position: absolute;
  top: 51%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 312px;
  height: 312px;
  margin: 0;
  z-index: 5;
}

.home-timer-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: none; /* JS側の-90度起点と二重回転するのを防ぐ */
  z-index: 2;
}

.home-timer-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 10;
}

.home-timer-progress {
  fill: none;
  stroke: url(#timer-grad);
  stroke-width: 10;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(252, 211, 77, 0.7));
}

/* --- 開始円形ガソリンメーター用ブロック --- */
.home-gauge-block {
  transition: none;
}
.home-gauge-block.active-white {
  fill: #ffffff;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.85));
}
.home-gauge-block.active-red {
  fill: #ff3344;
  filter: drop-shadow(0 0 8px rgba(255, 51, 68, 0.9));
}
.home-gauge-block.off {
  fill: rgba(255, 255, 255, 0.08);
  filter: none;
}
.home-gauge-block.off.is-red-slot {
  fill: rgba(255, 51, 68, 0.12);
}

/* 点滅アニメーション（白・赤で正確なドロップシャドウを反映） */
.home-gauge-block.active-white.blinking {
  animation: homeBlockBlinkWhite 0.8s infinite alternate ease-in-out;
}
.home-gauge-block.active-red.blinking {
  animation: homeBlockBlinkRed 0.8s infinite alternate ease-in-out;
}
.home-gauge-block.active-red.blinking-1-5x {
  animation: homeBlockBlinkRed 0.53s infinite alternate ease-in-out;
}
.home-gauge-block.active-red.blinking-2x {
  animation: homeBlockBlinkRed 0.4s infinite alternate ease-in-out;
}

@keyframes homeBlockBlinkWhite {
  0% {
    opacity: 0.15;
    filter: none;
  }
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.9));
  }
}

@keyframes homeBlockBlinkRed {
  0% {
    opacity: 0.15;
    filter: none;
  }
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 12px rgba(255, 51, 68, 0.95));
  }
}

.home-timer-text-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 3;
  width: 100%;
}

.home-timer-label {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 4px;
}

.home-timer-time {
  font-size: 3.4rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 16px rgba(6, 182, 212, 0.4);
  letter-spacing: -1px;
}

/* 分・秒の単位を小さくするための専用クラス */
.time-unit {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 4px 0 2px;
  opacity: 0.9;
  letter-spacing: normal;
}

/* タブ1用：特大開始ボタン（中央オレンジ） */
.home-start-btn {
  position: absolute;
  top: calc(51% + 190px);
  left: 50%;
  transform: translateX(-50%);
  width: 74px;
  height: 65px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7a00 0%, #ff5100 100%);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 6px 0 #b33900;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease;
  z-index: 10;
}

.home-start-btn:active {
  transform: translateX(-50%) translateY(6px);
  box-shadow:
    0 0 0 #b33900;
}

.home-start-btn svg {
  width: 80px;
  height: 80px;
  color: #ffffff;
  margin-left: 2px;
}

/* タイマー中央の終了時刻設定タップエリア（透明ピッカー内包） */
.prog-time-trigger-box {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.prog-time-trigger-box input[type="time"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
  border: none;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}
.prog-time-trigger-box input[type="time"]::-webkit-calendar-picker-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* チェックリスト カルーセル（開始画面の .home-sub-task と全く同じ位置・サイズ） */
.prog-carousel-container {
  position: absolute;
  top: calc(51% - 240px);
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 8;
}

.prog-carousel-arrow {
  background: none;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f8fafc;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition:
    transform 0.08s ease,
    opacity 0.15s ease,
    background 0.15s ease;
  z-index: 10;
}

.prog-carousel-arrow svg {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
  stroke-width: 2.5;
  display: block;
  pointer-events: none;
}

.prog-carousel-arrow:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.2);
}

.prog-carousel-arrow.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden;
}

.prog-carousel-text {
  font-family:
    "Noto Sans JP",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-size: min(2.4rem, 6.5cqw);
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  letter-spacing: -0.02em;
  transition:
    transform 0.18s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.18s ease;
}

/* 作業中：画面左右端25%タップ切り替え領域（ヘッダー最下部〜完了ボタン最上部） */
.prog-edge-nav-zone {
  position: absolute;
  top: 62px; /* モードヘッダー（62px）の最下部から */
  bottom: calc(
    49% - 160px
  ); /* 完了ボタン(top: calc(51% + 190px))の最上部まで */
  width: 25vw;
  z-index: 9;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  cursor: pointer;
}

.prog-edge-nav-left {
  left: 0;
}

.prog-edge-nav-right {
  right: 0;
}

/* スライドアニメーション */
.prog-carousel-text.slide-out-left {
  transform: translateX(-35px);
  opacity: 0;
}
.prog-carousel-text.slide-in-right {
  transform: translateX(35px);
  opacity: 0;
}
.prog-carousel-text.slide-out-right {
  transform: translateX(35px);
  opacity: 0;
}
.prog-carousel-text.slide-in-left {
  transform: translateX(-35px);
  opacity: 0;
}

/* 完了ボタン（シアン基調・4px統一立体仕様） */
.prog-complete-btn {
  position: absolute;
  top: calc(51% + 190px);
  left: 50%;
  transform: translateX(-50%) scale(1);
  width: 74px;
  height: 65px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00e5ff 0%, #0284c7 100%);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 6px 0 #0369a1;
  transition:
    transform 0.2s cubic-bezier(0.25, 1, 0.5, 1),
    box-shadow 0.08s ease,
    opacity 0.2s ease;
  z-index: 10;
}
/* 時間加算ボタン出現時に重なりを防ぐ非表示スタイル */
.prog-complete-btn.is-hidden-by-popup {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.6);
}

.prog-complete-btn:active {
  transform: translateX(-50%) translateY(6px);
  box-shadow:
    0 0 0 #0369a1;
}
.prog-complete-btn svg {
  width: 38px;
  height: 38px;
  stroke: #ffffff;
  stroke-width: 3.5;
}

/* 作業中：タイマータップ時に下からポップアップするクイック加算ボタン群 */
.prog-quick-time-group {
  position: absolute;
  top: calc(51% + 190px);
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 90%;
  max-width: 360px;
  z-index: 20;
  transition:
    transform 0.25s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.25s ease;
}

.prog-quick-time-group.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.prog-quick-btn {
  flex: 1;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, #00e5ff 0%, #0284c7 100%);
  border: none;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #0369a1;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.prog-quick-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #0369a1;
}

/* カード */
.card-swipe-wrapper {
  position: relative;
  margin-bottom: 16px;
  border-radius: 20px;
  z-index: var(--z-base);
  perspective: 1000px;
  transition: transform 0.2s ease;
}
.card-swipe-wrapper.menu-active {
  z-index: var(--z-card-dropdown) !important;
}

.card {
  position: relative;
  border-radius: 20px;
  padding: 12px 12px 1px;
  color: #f8fafc;
  background: #1b212f;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.4) !important;
  box-shadow:
    0 4px 0 #111522;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  overflow: visible;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease;
  touch-action: manipulation;
}

.card:active:not(:has(.card-edit-btn:active)) {
  transform: translateY(4px);
  box-shadow:
    0 0 0 #0d1017;
}

/* 吹き出しアクティブ時の親ラッパー：後続のカードより前面へ */
.card-swipe-wrapper.active-tooltip {
  z-index: var(--z-card-tooltip) !important;
}

/* ホームカードタップ時の吹き出しコンテナ */
.card-tooltip-bubble {
  position: absolute;
  left: 10px;
  right: 10px;
  top: calc(100% + 12px);
  background: #161b26;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 16px;
  z-index: var(--z-card-tooltip);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
  animation: popInBubble 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  user-select: none;
  pointer-events: auto; /* 背面カードへのタップ貫通を防止 */
}

/* 吹き出し上部の三角ポインター */
.card-tooltip-bubble::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 8px 8px 8px;
  border-style: solid;
  border-color: transparent transparent #161b26 transparent;
  pointer-events: none;
}

/* 吹き出し内の初動タスク名テキスト（中央揃え） */
.card-tooltip-title {
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 12px;
  text-align: center; /* 初動タスクは中央揃え */
  word-break: break-all;
}

/* 吹き出し内での btn-start-now-edit の表示 */
.card-tooltip-bubble .btn-start-now-edit {
  display: block !important;
  width: 100%;
  margin: 0 auto;
}

/* ホームプログレスバー：立体溝 ＆ 上部光沢仕上げ */
.card-slim-bar-track {
  width: 100%;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  margin-top: 12px;
  margin-bottom: 4px;
}

.card-slim-bar-fill {
  height: 100%;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  transition: width 0.3s ease;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.25);
}

.bar-cyan-fill {
  background: linear-gradient(90deg, #0284c7, var(--bar-cyan));
  box-shadow:
    0 0 12px rgba(0, 229, 255, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.25);
}

.bar-red-fill {
  background: linear-gradient(90deg, #b91c1c, #ff0033);
  box-shadow:
    0 0 12px rgba(255, 0, 51, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.25);
}

.bar-overdue-fill {
  background: #7f1d1d;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.25);
}

/* カード右上の編集ボタン（立体的アフォーダンス） */
.menu-container {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: var(--z-card-dropdown);
}

.card-edit-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.1s ease,
    background 0.15s ease,
    color 0.15s ease;
  padding: 0;
  box-sizing: border-box;
}

.card-edit-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.card-edit-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  display: block;
}
.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: #161b26;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  display: none;
  flex-direction: column;
  z-index: var(--z-card-dropdown);
  min-width: 120px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* 開始（1件フォーカス画面）シームレス・円形UI（ヘッダーは表示） */
body.is-focus-view {
  background: #0b0d13;
  /* フォーカス画面のみスクロールを完全に無効化 */
  overflow: hidden !important;
  height: 100vh;
  height: 100dvh;
  touch-action: none;
}

body.is-focus-view #bg-layer {
  display: none;
}

body.is-focus-view .fab-group {
  display: none !important;
}

/* タブ1：開始待ち（スクロール完全禁止・上下16px余白） */
#scheduleListDetail {
  width: 100%;
  height: calc(
    100dvh - 62px - env(safe-area-inset-top, 0px) - 80px -
      env(safe-area-inset-bottom, 0px)
  );
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden !important;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* タブ2：作業中（縦スナップスクロール可能・各カードが固定位置にスナップ） */
#scheduleListInProgress {
  width: 100%;
  height: calc(
    100dvh - 62px - env(safe-area-inset-top, 0px) - 80px -
      env(safe-area-inset-bottom, 0px)
  );
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  box-sizing: border-box;
}

#scheduleListInProgress::-webkit-scrollbar {
  display: none;
}

#scheduleListOverview .overview-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 0; /* 右端余白をリセット */
  margin-bottom: 2px;
}

/* --- 修正後 (タイトルの右にアイコンを並べる場合) --- */
#scheduleListOverview .card-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

#scheduleListOverview .card-title .card-repeat-icon {
  width: 14px;
  height: 14px;
  stroke: var(--bar-cyan);
  flex-shrink: 0;
}

#scheduleListOverview .card-title:active {
  opacity: 0.7;
}

/* --- 修正後 (SVGアイコンと文字を横並び中央揃えにするスタイルを追加) --- */
#scheduleListOverview .card-start-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

#scheduleListOverview .card-repeat-icon {
  width: 14px;
  height: 14px;
  stroke: var(--bar-cyan);
  flex-shrink: 0;
}

/* 開始（全カード）画面カード ヘッダー行 */
.overview-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4px 8px 6px;
}

.overview-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #94a3b8;
  margin: 0;
  letter-spacing: 0.03em;
}

/* 表示単位切り替えボタン（表示: 1h / 表示: 12h） */
.btn-toggle-scale {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  cursor: pointer;
  letter-spacing: 0.02em;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.btn-toggle-scale:active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

#scheduleListOverview .card-swipe-wrapper {
  border-radius: 14px;
}

#scheduleListOverview .card-slim-bar-track {
  margin-top: 12px;
  margin-bottom: 2%;
  height: 28px;
  border-radius: 8px;
  position: relative;
}

#scheduleListOverview .card-bar-time-overlay {
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

#scheduleListOverview .card-slim-bar-fill {
  height: 100%;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.25);
}

#scheduleListOverview .menu-container {
  top: 6px;
  right: 8px;
}

.standalone-modal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.modal-menu-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}
.modal-menu-btn:active {
  background: rgba(255, 255, 255, 0.1);
}
.modal-menu-btn.btn-danger-text {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

.dict-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
}

.dict-item:active {
  background: rgba(255, 255, 255, 0.1);
}

.dict-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1rem;
  color: #f8fafc;
}
.dict-tasks {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* 達成時 1行メッセージ */
.mission-complete-toast {
  position: fixed;

  top: 51%;

  left: 50%;

  /* 出現時の初期スケール */
  transform: translate(-50%, -50%) scale(0.6);

  background: linear-gradient(
    135deg,
    rgba(0, 229, 255, 0.95),
    rgba(2, 132, 199, 0.95)
  );

  color: #040810;

  /* 枠の大きさ・余白調整（好みに合わせて変更可能） */
  padding: 24px 32px;

  min-width: 260px;

  max-width: 85vw;

  border-radius: 28px;

  font-size: 1.25rem;

  font-weight: 900;

  line-height: 1.5;

  text-align: center;

  white-space: pre-line; /* 改行文字（\n）を反映 */

  box-shadow:
    0 0 40px rgba(0, 229, 255, 0.8),
    0 16px 36px rgba(0, 0, 0, 0.5);

  border: 3px solid #ffffff;

  z-index: --z-toast;

  opacity: 0;

  pointer-events: none;

  /* アニメーション時間と弾み感のイージング */
  transition:
    transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    opacity 0.3s ease;
}

.mission-complete-toast.show {
  /* 表示完了時のスケール（1.05倍などで少し迫力を出すことも可能） */
  transform: translate(-50%, -50%) scale(1.05);

  opacity: 1;
}

/* 紙吹雪Canvas */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 3999;
}

/* カウントダウン操作ボタン（✕ & もう1回挑戦） */
.btn-urgent-close {
  position: absolute;
  top: max(20px, env(safe-area-inset-top, 20px));
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3100;
  transition:
    background 0.15s,
    transform 0.1s;
}

.btn-urgent-close:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.2);
}

.btn-urgent-retry {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  transition:
    transform 0.1s,
    background 0.15s,
    color 0.15s;
}

.btn-urgent-retry:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}


/* YATTA 3-2-1 segmented fuel-gauge countdown
   Cuts: 12 / 8 / 4 o'clock.
   Disappears counterclockwise: 12→8, 8→4, 4→12 (last segment red). */
.countdown-segment-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.16));
}
.countdown-segment {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: opacity 0.18s ease, filter 0.18s ease;
}
/* CSS conic angles run clockwise from 12 o'clock.
   These sectors are placed so countdown removal reads counterclockwise. */
.countdown-segment-3 {
  background: conic-gradient(from 0deg, transparent 0deg 244deg, #ffffff 244deg 356deg, transparent 356deg 360deg);
}
.countdown-segment-2 {
  background: conic-gradient(from 0deg, transparent 0deg 124deg, #ffffff 124deg 236deg, transparent 236deg 360deg);
}
.countdown-segment-1 {
  background: conic-gradient(from 0deg, #ff3048 4deg 116deg, transparent 116deg 360deg);
  filter: drop-shadow(0 0 12px rgba(255, 48, 72, 0.65));
}
.countdown-segment-center {
  position: absolute;
  inset: 32px;
  border-radius: 50%;
  background: #0b0d13;
}
.countdown-segment-ring[data-remaining="2"] .countdown-segment-3,
.countdown-segment-ring[data-remaining="1"] .countdown-segment-3,
.countdown-segment-ring[data-remaining="1"] .countdown-segment-2,
.countdown-segment-ring[data-remaining="0"] .countdown-segment {
  opacity: 0.08;
  filter: none;
}

/* カウントダウンオーバーレイ（下からスライド＆ホーム背景準拠） */
#urgent-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  background: #0b0d13;
  z-index: var(--z-urgent);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

#urgent-overlay.active {
  opacity: 1;
}

.countdown-fullscreen-box {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  overflow: hidden;
  transform: translateY(100vh);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#urgent-overlay.active .countdown-fullscreen-box {
  transform: translateY(0);
}

.countdown-top-wrapper {
  position: absolute;
  top: 51%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 312px;
  height: 312px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.countdown-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 10;
}

.circle-progress {
  fill: none;
  stroke: #ff0033;
  stroke-width: 10;
  stroke-dasharray: 904.78;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.05s linear;
  filter: drop-shadow(0 0 10px rgba(255, 0, 51, 0.6));
}

.countdown-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 88pt;
  font-weight: 900;
  color: #ff4d4d;
  z-index: 2;
  line-height: 1;
  text-shadow: 0 0 30px rgba(255, 77, 77, 0.8);
  user-select: none;
  margin: 0;
  padding: 0;
}

.countdown-action-giant {
  position: absolute;
  top: calc(51% + 170px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.55rem;
  font-weight: 900;
  color: #ffffff;
  text-align: center;
  line-height: 1.35;
  white-space: nowrap;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
  padding: 14px 20px;
  border: 2px solid #ff7a00;
  border-radius: 18px;
  background: rgba(255, 122, 0, 0.12);
  width: 90%;
  max-width: 360px;
  box-sizing: border-box;
  z-index: 10;
}

.countdown-action-giant.highlight-zero {
  border-color: #ff0033 !important;
  background: rgba(255, 0, 51, 0.25) !important;
  color: #ff4d4d !important;
  box-shadow: 0 0 30px rgba(255, 0, 51, 0.6) !important;
}

@keyframes screenFlashTriple {
  0% {
    background-color: rgba(255, 255, 255, 0.95);
  }
  30% {
    background-color: #0b0d13;
  }
  60% {
    background-color: rgba(255, 255, 255, 0.95);
  }
  100% {
    background-color: #0b0d13;
  }
}
.flash-active-triple {
  animation: screenFlashTriple 0.4s ease-out forwards;
}

.countdown-success-actions {
  position: absolute;
  top: calc(51% + 170px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 90%;
  max-width: 360px;
  box-sizing: border-box;
  z-index: 10;
  animation: popInSuccess 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.countdown-success-actions .btn-action-success {
  width: 100%;
  margin: 0 auto;
}

.btn-action-success {
  width: 100%;
  max-width: 360px;
  min-height: 84px;
  height: auto;
  background: linear-gradient(135deg, #ff7a00 0%, #ff5100 100%);
  color: #ffffff;
  border: none;
  border-radius: 16px;
  padding: 14px 18px;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  z-index: 10;
  box-shadow: 0 4px 0 #b33900;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease;
}

.btn-action-success:active {
transform: translateY(4px);
box-shadow: 0 0 0 #b33900;
}

/* カウントダウン完了画面 NEXTボタン内部パーツ */
.countdown-btn-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  flex: 1;
  overflow: hidden;
  padding-right: 12px;
}

.countdown-btn-top-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  text-align: left;
  width: 100%;
  letter-spacing: 0.03em;
  margin: 0;
}

.countdown-btn-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffffff;
  word-break: break-all;
  line-height: 1.3;
  text-align: left;
  margin: 0;
  width: 100%;
}

.countdown-btn-right-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  box-sizing: border-box;
}

.countdown-btn-right-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
}

@keyframes popInSuccess {
  0% {
    transform: translateX(-50%) scale(0.6);
    opacity: 0;
  }
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

/* Hotfix: force segmented 3-2-1 ring above legacy countdown layers */
#urgent-overlay .countdown-top-wrapper .countdown-segment-ring {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: 312px !important;
  height: 312px !important;
  z-index: 1 !important;
  opacity: 1 !important;
  overflow: visible !important;
}
#urgent-overlay .countdown-segment-ring .countdown-segment {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  -webkit-mask: radial-gradient(circle, transparent 0 61%, #000 62% 76%, transparent 77%);
  mask: radial-gradient(circle, transparent 0 61%, #000 62% 76%, transparent 77%);
}
#urgent-overlay .countdown-segment-ring .countdown-segment-center {
  display: none !important;
}
#urgent-overlay .countdown-number {
  z-index: 3 !important;
}

@keyframes countdownSegmentPulse {
  0%, 100% { opacity: 1; }
  25% { opacity: 0.42; }
  50% { opacity: 1; }
  75% { opacity: 0.42; }
}
#urgent-overlay .countdown-segment.segment-blink-active {
  animation: countdownSegmentPulse 1000ms linear infinite !important;
}


@keyframes targetTimeInviteGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255,255,255,0.12), 0 0 22px rgba(34,211,238,0.10);
    filter: brightness(0.94);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 18px rgba(255,255,255,0.28), 0 0 38px rgba(34,211,238,0.30);
    filter: brightness(1.16);
    transform: scale(1.025);
  }
}
#urgent-overlay .btn-action-success {
  animation: targetTimeInviteGlow 1.35s ease-in-out infinite;
}
#urgent-overlay .btn-action-success:active {
  animation: none;
  transform: scale(0.98);
}


/* Stronger visible CTA pulse after 3-2-1. */
@keyframes targetTimeInviteGlowStrong {
  0%, 100% {
    background: linear-gradient(135deg, #ff7a00 0%, #ff5100 100%);
    box-shadow: 0 4px 0 #b33900, 0 0 8px rgba(255, 122, 0, 0.20);
    filter: brightness(0.82);
  }
  50% {
    background: linear-gradient(135deg, #ff9d2e 0%, #ff650f 100%);
    box-shadow: 0 4px 0 #b33900, 0 0 22px rgba(255, 122, 0, 0.85), 0 0 48px rgba(255, 81, 0, 0.50);
    filter: brightness(1.28);
  }
}
#urgent-overlay .countdown-success-actions .btn-action-success {
  animation: targetTimeInviteGlowStrong 1.4s ease-in-out infinite !important;
}
#urgent-overlay .countdown-success-actions .btn-action-success:active {
  animation: none !important;
}

/* Experiment: quick-time row owns this area; do not show complete behind it. */
.prog-snap-page:has(.prog-quick-time-group) .prog-complete-btn {
  display: none !important;
}

/* Centered time-edit history controls below the quick-time row. */
.prog-history-controls {
  position: absolute;
  top: calc(51% + 270px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 21;
}
.prog-history-btn {
  width: 54px;
  height: 46px;
  border-radius: 15px;
  border: 1px solid rgba(148,163,184,.30);
  background: #202838;
  color: #dbe7f5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 #111827;
  -webkit-tap-highlight-color: transparent;
}
.prog-history-btn svg {
  width: 25px;
  height: 25px;
}
.prog-history-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #111827;
}
.prog-history-btn:disabled {
  opacity: .28;
}

/* Fix: history controls must be visibly inside the card, directly above quick-time choices. */
.prog-history-controls {
  top: calc(51% + 132px) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 30 !important;
}
.prog-history-btn {
  width: 48px !important;
  height: 42px !important;
  border-radius: 13px !important;
  background: rgba(30, 41, 59, .96) !important;
  color: #e2e8f0 !important;
  box-shadow: 0 3px 0 #0f172a !important;
}

/* Initial quick-time choices are visible; JS removes them after 3.2s inactivity.
   Tapping the timer center recreates and shows them again. */
.prog-snap-page .prog-quick-time-group:not(.show) {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Keep undo/redo below the timer, grouped with quick-time controls. */
.prog-history-controls {
  top: auto !important;
  bottom: 104px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  transition: opacity .28s ease, transform .28s ease !important;
}
.prog-history-controls.is-dismissing {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateX(-50%) translateY(8px) !important;
}

/* Position history controls in the clear gap between timer and quick-time row. */
.prog-history-controls {
  top: calc(51% + 132px) !important;
  bottom: auto !important;
}
