/* =========================================================
   メモカレ（MemoKare）V3 公開プロトタイプ スタイルシート
   スマホ100dvh全画面PWA対応 ／ PC表示時430pxフレーム＋監視パネル併設
   ========================================================= */

:root {
  --primary: #4a7fd4;
  --primary-dark: #3360ac;
  --primary-soft: #eaf2ff;
  --pass-grad: linear-gradient(135deg, #4a7fd4 0%, #7a5af8 100%);
  --pass-accent: #6949e8;
  --mint: #26966b;
  --mint-soft: #e6f7f0;
  --amber: #cc7a1d;
  --amber-soft: #fff5e6;
  --text-main: #223042;
  --text-sub: #5f6f85;
  --border: #dce5f2;
  --surface: #ffffff;
  --page-bg: #f3f6fb;
  --shadow-sm: 0 2px 8px rgba(30, 45, 70, 0.07);
  --shadow-lg: 0 20px 55px rgba(22, 36, 62, 0.2);
  --r-lg: 18px;
  --r-md: 12px;
  --r-pill: 999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at 20% 15%, #e8f0fc 0%, #dbe5f4 55%, #cfdced 100%);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   レスポンシブステージ（スマホ全画面 ／ PC中央スマホフレーム＋横パネル）
   ========================================================= */
.desktop-stage {
  width: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.phone-shell {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  background: var(--page-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cost-monitor-panel {
  display: none;
}

@media (min-width: 481px) {
  .phone-shell {
    height: min(94dvh, 880px);
    border-radius: 34px;
    border: 6px solid #ffffff;
    box-shadow: var(--shadow-lg), 0 2px 10px rgba(22, 36, 62, 0.08);
  }
}

@media (min-width: 880px) {
  .desktop-stage {
    padding: 0 24px;
  }

  .cost-monitor-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 340px;
    max-height: min(94dvh, 880px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 14px 36px rgba(24, 40, 68, 0.12);
  }
}

/* =========================================================
   6種表情スプライト（expressions_sheet_6.jpg 3列×2行切り出し）
   ========================================================= */
.expr-avatar,
.expr-dot {
  background-image: url("./assets/expressions_sheet_6.jpg");
  background-size: 300% 200%;
  background-repeat: no-repeat;
  border-radius: 50%;
  flex-shrink: 0;
}

.expr-avatar {
  width: 38px;
  height: 38px;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-sm);
}

.expr-avatar.is-lg {
  width: 52px;
  height: 52px;
  border-color: #cfe0fa;
}

.expr-dot {
  width: 22px;
  height: 22px;
  border: 1.5px solid #cfe0fa;
}

[data-expr="normal"] {
  background-position: 0% 5%;
}
[data-expr="happy"] {
  background-position: 50% 5%;
}
[data-expr="listening"] {
  background-position: 100% 5%;
}
[data-expr="worried"],
[data-expr="amazed"] {
  background-position: 0% 95%;
}
[data-expr="sleepy"] {
  background-position: 50% 95%;
}
[data-expr="shy"] {
  background-position: 100% 95%;
}

/* =========================================================
   共通ヘッダー（アプリ名・立場＆性格ラベル・親密度・残会話バッジ）
   ========================================================= */
.app-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 30;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
  border: 1.5px solid #b8d2fb;
  flex-shrink: 0;
}

.header-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.app-title-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.app-brand {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.persona-label {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--primary-soft);
  color: var(--primary-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 138px;
}

.intimacy-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
}

.intimacy-lv {
  font-size: 0.7rem;
  font-weight: 800;
  color: #d95380;
}

.exp-track {
  width: 52px;
  height: 6px;
  background: #edf1f8;
  border-radius: var(--r-pill);
  overflow: hidden;
}

.exp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff8eb0 0%, #eb5c8c 100%);
  border-radius: var(--r-pill);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.exp-text {
  font-size: 0.64rem;
  color: var(--text-sub);
}

.exp-pop {
  position: absolute;
  left: 44px;
  top: -16px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #dc3f76;
  background: #fff0f6;
  border: 1px solid #ffc0d6;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  animation: expFloat 1.4s ease forwards;
  pointer-events: none;
  white-space: nowrap;
}

@keyframes expFloat {
  0% {
    opacity: 0;
    transform: translateY(5px) scale(0.9);
  }
  20% {
    opacity: 1;
    transform: translateY(0) scale(1.05);
  }
  80% {
    opacity: 1;
    transform: translateY(-4px);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* 残会話バッジ */
.quota-badge {
  flex-shrink: 0;
  border: 1px solid #c6dbfb;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 6px 10px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  max-width: 172px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 6px rgba(74, 127, 212, 0.12);
}

.quota-badge.is-pass {
  background: var(--pass-grad);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(105, 73, 232, 0.28);
}

.quota-badge.is-zero-caring {
  background: var(--mint-soft);
  color: var(--mint);
  border-color: #b5e6d2;
}

/* =========================================================
   ロック画面風プッシュ通知バナー ＆ ミニ吹き出しトースト
   ========================================================= */
.lockscreen-banner {
  position: absolute;
  top: 62px;
  left: 10px;
  right: 10px;
  z-index: 65;
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border: 1.5px solid #bdd5fa;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(20, 34, 60, 0.22);
  animation: bannerDrop 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

@keyframes bannerDrop {
  from {
    opacity: 0;
    transform: translateY(-18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lockscreen-banner-tap {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px 10px 12px;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.banner-app-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.banner-content {
  flex: 1;
  min-width: 0;
}

.banner-top-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.banner-app-title {
  font-size: 0.74rem;
  font-weight: 800;
}

.banner-zero-pill {
  font-size: 0.64rem;
  font-weight: 800;
  background: var(--mint-soft);
  color: var(--mint);
  padding: 1px 6px;
  border-radius: var(--r-pill);
}

.banner-tap-hint {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.banner-message {
  margin: 0;
  font-size: 0.79rem;
  line-height: 1.42;
  color: var(--text-main);
}

.banner-close-btn {
  border: none;
  background: transparent;
  color: var(--text-sub);
  padding: 0 11px;
  font-size: 0.88rem;
  cursor: pointer;
}

/* キャラクターミニ吹き出しトースト */
.mini-speech-toast {
  position: absolute;
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  right: 12px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: rgba(30, 42, 62, 0.94);
  color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(18, 28, 46, 0.3);
  animation: toastSlideUp 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mini-speech-text {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.45;
}

/* =========================================================
   タブコンテナ ＆ スクロールページ共通
   ========================================================= */
.tab-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tab-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.scroll-page {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =========================================================
   1. 🏠 マイルーム画面
   ========================================================= */
.room-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.room-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 0.6s ease;
  z-index: 0;
}

.room-bg-day {
  background-image: url("./assets/bg_living_day.jpg");
  opacity: 1;
}

.room-bg-night {
  background-image: url("./assets/bg_living_night.jpg");
  opacity: 0;
}

.room-stage[data-bg="night"] .room-bg-day {
  opacity: 0;
}

.room-stage[data-bg="night"] .room-bg-night {
  opacity: 1;
}

.room-overlay-top {
  position: relative;
  z-index: 15;
  padding: 8px 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.bg-toggle-group {
  display: flex;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  padding: 3px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
}

.glass-chip {
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.73rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
}

.glass-chip.is-selected {
  background: var(--primary);
  color: #ffffff;
}

.timer-trigger-btn {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  color: var(--primary-dark);
  border: 1px solid rgba(74, 127, 212, 0.25);
  box-shadow: var(--shadow-sm);
}

.notif-test-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.notif-test-strip::-webkit-scrollbar {
  display: none;
}

.notif-pill {
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(6px);
  color: var(--text-main);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.notif-pill.is-motion-btn {
  background: rgba(234, 242, 255, 0.9);
  color: var(--primary-dark);
}

/* キャラクター立ち絵＆軽量CSSアニメーション（足元を下端にしっかり接地・浮遊感ゼロ設計） */
.character-viewport {
  position: absolute;
  inset: 46px 0 0 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  overflow: hidden;
  pointer-events: none;
}

.char-breath-layer {
  height: 92%;
  max-height: 680px;
  margin-bottom: -10px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform-origin: 50% 100%;
  animation: idleBreathing 3.2s ease-in-out infinite;
}

@keyframes idleBreathing {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(1.003);
  }
}

.char-motion-layer {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform-origin: 50% 100%;
}

.char-standing-img {
  height: 100%;
  width: auto;
  max-width: 96vw;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 2px 6px rgba(24, 36, 56, 0.12));
  transition: filter 0.5s ease;
  user-select: none;
}

.room-stage[data-bg="night"] .char-standing-img {
  filter: brightness(0.95) sepia(0.08) drop-shadow(0 2px 8px rgba(14, 20, 36, 0.25));
}

/* うなずき（nod：700ms・足元接地維持） */
.char-motion-layer.motion-nod {
  animation: motionNod 0.7s ease-in-out;
}

@keyframes motionNod {
  0% {
    transform: translateY(0) scaleY(1);
  }
  25% {
    transform: translateY(4px) scaleY(0.992);
  }
  50% {
    transform: translateY(0) scaleY(1);
  }
  75% {
    transform: translateY(3px) scaleY(0.995);
  }
  100% {
    transform: translateY(0) scaleY(1);
  }
}

/* 身を乗り出す接近（lean_forward：足元支点で自然に近づく） */
.char-motion-layer.motion-lean_forward {
  animation: motionLeanForward 1.8s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes motionLeanForward {
  0% {
    transform: scale(1);
  }
  22%,
  75% {
    transform: scale(1.07);
  }
  100% {
    transform: scale(1);
  }
}

.char-motion-layer.motion-wave_hand {
  animation: motionWave 0.85s ease-in-out;
}

@keyframes motionWave {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-1deg);
  }
  75% {
    transform: rotate(1deg);
  }
}

.char-motion-layer.motion-tilt_head,
.char-motion-layer.motion-check_watch {
  animation: motionTilt 0.8s ease-in-out;
}

@keyframes motionTilt {
  0%,
  100% {
    transform: rotate(0deg);
  }
  45% {
    transform: rotate(1.4deg);
  }
}

/* マイルーム下部チャットドック */
.room-chat-dock {
  position: relative;
  z-index: 20;
  margin-top: auto;
  padding: 8px 10px 10px;
  background: linear-gradient(180deg, rgba(243, 246, 251, 0) 0%, rgba(243, 246, 251, 0.9) 20%, rgba(255, 255, 255, 0.97) 100%);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dock-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.emotion-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  padding: 3px 9px 3px 5px;
  border-radius: var(--r-pill);
  font-size: 0.69rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.lane-divider {
  color: #c5d2e6;
}

.dock-expand-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-sub);
  font-size: 0.69rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  cursor: pointer;
}

.chat-stream {
  max-height: 152px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 2px 4px;
  transition: max-height 0.26s ease;
}

.room-chat-dock.is-expanded .chat-stream {
  max-height: 300px;
}

.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.msg-row.is-user {
  justify-content: flex-end;
}

.msg-bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 15px;
  font-size: 0.81rem;
  line-height: 1.48;
  box-shadow: 0 3px 10px rgba(24, 38, 62, 0.09);
}

.msg-row.is-partner .msg-bubble {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d9e5f7;
  border-top-left-radius: 4px;
}

.msg-row.is-user .msg-bubble {
  background: var(--primary);
  color: #ffffff;
  border-top-right-radius: 4px;
}

.msg-meta-tag {
  display: block;
  margin-top: 4px;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-sub);
}

/* 買い物一括追加 ワンタップ確認カード */
.confirm-card {
  background: #ffffff;
  border: 2px solid #75a4f0;
  border-radius: 15px;
  padding: 10px 12px;
  box-shadow: 0 6px 18px rgba(51, 96, 172, 0.16);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.confirm-head {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.4;
}

.confirm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.confirm-tag {
  background: var(--primary-soft);
  border: 1px solid #c5dafc;
  color: var(--text-main);
  font-size: 0.77rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
}

.confirm-actions {
  display: flex;
  gap: 8px;
}

.btn-confirm-ok {
  flex: 1;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.btn-confirm-cancel {
  border: 1px solid var(--border);
  background: #f5f7fb;
  color: var(--text-sub);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.confirm-result {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--mint);
}

/* クイックお試しチップ ＆ 入力欄 */
.quick-chips-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.quick-chips-bar::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  border: 1px solid #d0dff6;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  cursor: pointer;
}

.chat-form {
  display: flex;
  gap: 7px;
}

.chat-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #c6d5ec;
  background: #ffffff;
  border-radius: var(--r-pill);
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text-main);
  outline: none;
}

.chat-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 127, 212, 0.15);
}

.chat-send-btn {
  flex-shrink: 0;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 0 18px;
  border-radius: var(--r-pill);
  cursor: pointer;
}

/* =========================================================
   2〜4タブ共通カード・予定・買い物・メモ帳・パス
   ========================================================= */
.zero-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--mint-soft);
  border: 1px solid #bbe6d3;
  color: #1c6b4d;
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 0.76rem;
  line-height: 1.45;
}

.zero-banner p {
  margin: 0;
}

.card-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.card-title-sm {
  margin: 0;
  font-size: 0.87rem;
  font-weight: 800;
}

.card-sub {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--text-sub);
}

.tag-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--primary-soft);
  color: var(--primary-dark);
  white-space: nowrap;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cal-row,
.shop-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  background: #f9fbff;
  border: 1px solid #e1ebf8;
  border-radius: 12px;
}

.cal-time-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary-dark);
  background: #e5effe;
  padding: 3px 8px;
  border-radius: 8px;
}

.cal-name {
  flex: 1;
  font-size: 0.84rem;
  font-weight: 600;
}

.inline-form {
  display: flex;
  gap: 6px;
}

.stack-form,
.subview-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-time {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  font-size: 0.82rem;
  background: #ffffff;
}

.input-text,
.input-select {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 0.85rem;
  background: #ffffff;
  color: var(--text-main);
  outline: none;
}

.btn-add {
  flex-shrink: 0;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0 12px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.shop-check {
  width: 20px;
  height: 20px;
  accent-color: var(--mint);
  cursor: pointer;
  flex-shrink: 0;
}

.shop-name {
  flex: 1;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.exp-mini-tag {
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--mint);
  background: var(--mint-soft);
  padding: 2px 7px;
  border-radius: var(--r-pill);
}

.btn-del-x {
  border: none;
  background: transparent;
  color: #96a4b8;
  font-size: 0.85rem;
  cursor: pointer;
}

.is-done-list .shop-row {
  background: #f4f6fa;
  opacity: 0.74;
}

.is-done-list .shop-name {
  text-decoration: line-through;
  color: var(--text-sub);
}

.completed-area {
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.completed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-sub);
}

.link-btn {
  border: none;
  background: transparent;
  color: var(--primary-dark);
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
}

/* カレのメモ帳 */
.subtab-bar {
  display: flex;
  background: #e5edf8;
  padding: 4px;
  border-radius: 13px;
  gap: 4px;
}

.subtab-item {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 0.79rem;
  font-weight: 800;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
}

.subtab-item.is-active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.meter-track {
  height: 7px;
  background: #ebf0f8;
  border-radius: var(--r-pill);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: var(--pass-grad);
  transition: width 0.35s ease;
}

.cat-chips-row {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.cat-chips-row::-webkit-scrollbar {
  display: none;
}

.cat-filter-btn {
  border: 1px solid var(--border);
  background: #f8faff;
  color: var(--text-sub);
  font-size: 0.71rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  cursor: pointer;
}

.cat-filter-btn.is-active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.memo-item {
  padding: 10px 12px;
  border: 1px solid #e1ebf8;
  border-radius: 13px;
  background: #fbfdff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.memo-item.is-pinned {
  background: #fffdf6;
  border-color: #f2d191;
}

.memo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.memo-cat {
  font-size: 0.69rem;
  font-weight: 800;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}

.memo-btns {
  display: flex;
  gap: 5px;
}

.btn-memo-act {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-sub);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-memo-act.is-pinned {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: #f1cb82;
}

.btn-memo-act:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.memo-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.48;
}

.gentle-upsell-box {
  background: #f7f4ff;
  border: 1px solid #dcd3ff;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.76rem;
  line-height: 1.5;
}

.gentle-upsell-box p {
  margin: 0;
}

.locked-diary-box {
  align-items: center;
  text-align: center;
  padding: 20px 16px;
}

.locked-moon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #f2eeff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.locked-text {
  margin: 0;
  font-size: 0.79rem;
  color: var(--text-sub);
  line-height: 1.55;
}

.blurred-sample {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: #f7f9fc;
  border-radius: 12px;
  font-size: 0.76rem;
  filter: blur(2.2px);
  user-select: none;
}

.blurred-sample p {
  margin: 4px 0 0;
}

.diary-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.diary-card {
  background: linear-gradient(180deg, #faf8ff 0%, #ffffff 100%);
  border: 1px solid #e1d9ff;
  border-radius: 13px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.diary-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.73rem;
  font-weight: 800;
  color: var(--pass-accent);
}

.diary-body {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

/* パス・チケット画面 */
.v3-arch-badge {
  font-size: 0.68rem;
  font-weight: 800;
  background: #e4efff;
  color: var(--primary-dark);
  padding: 3px 8px;
  border-radius: var(--r-pill);
}

.lane-badge {
  font-size: 0.69rem;
  font-weight: 800;
  background: var(--mint-soft);
  color: var(--mint);
  padding: 3px 9px;
  border-radius: var(--r-pill);
}

.lane-badge.is-paid {
  background: #f1edff;
  color: var(--pass-accent);
}

.quota-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.q-cell {
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 8px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.q-label {
  font-size: 0.65rem;
  color: var(--text-sub);
  font-weight: 700;
}

.q-val {
  font-size: 0.88rem;
}

.digest-rule {
  margin: 0;
  font-size: 0.71rem;
  color: var(--text-sub);
}

.partner-pass-box {
  border: 2px solid #8a75f5;
  background: linear-gradient(180deg, #faf8ff 0%, #ffffff 100%);
}

.pass-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
}

.popular-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--pass-grad);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  margin-bottom: 4px;
}

.pass-name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
}

.pass-price {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.pass-price strong {
  font-size: 1.35rem;
  color: var(--pass-accent);
}

.pass-perks {
  margin: 0;
  padding-left: 18px;
  font-size: 0.78rem;
  line-height: 1.6;
}

.pass-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f4f2ff;
  padding: 9px 11px;
  border-radius: 12px;
}

.toggle-status-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-pass-toggle {
  border: none;
  background: var(--pass-grad);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 9px 13px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-pass-toggle.is-on {
  background: #ffffff;
  color: var(--pass-accent);
  border: 1.5px solid #8a75f5;
}

.ticket-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: #fbfdff;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.83rem;
}

.ticket-row.is-featured {
  background: #f3f8ff;
  border-color: #8eb7f8;
}

.t-plus {
  font-weight: 800;
  color: var(--primary-dark);
  font-size: 0.78rem;
}

.t-bonus {
  font-size: 0.64rem;
  font-weight: 800;
  background: #ffeac7;
  color: #ad5c00;
  padding: 1px 6px;
  border-radius: var(--r-pill);
}

.t-sub {
  font-size: 0.68rem;
  color: var(--text-sub);
  margin-top: 2px;
}

.btn-buy-ticket {
  flex-shrink: 0;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 8px 11px;
  border-radius: 10px;
  cursor: pointer;
}

.selector-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selector-title {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-sub);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sel-chip {
  border: 1px solid var(--border);
  background: #f8faff;
  color: var(--text-main);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  cursor: pointer;
}

.sel-chip.is-active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.btn-primary {
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 11px 14px;
  border-radius: 11px;
  cursor: pointer;
}

.btn-primary:disabled {
  background: #b6c5dc;
  cursor: not-allowed;
}

.btn-secondary {
  border: 1px solid var(--border);
  background: #f4f7fb;
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 11px;
  cursor: pointer;
}

.btn-outline-sm {
  border: 1px solid #c6d6ee;
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 9px;
  cursor: pointer;
}

.compliance-footer {
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--text-sub);
  padding: 2px 4px 8px;
}

.compliance-footer p {
  margin: 0 0 4px;
}

/* =========================================================
   下部4タブナビゲーション（safe-area-inset-bottom対応）
   ========================================================= */
.bottom-nav {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 5px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--text-sub);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 2px;
  border-radius: 10px;
  cursor: pointer;
}

.nav-btn.is-active {
  color: var(--primary-dark);
  background: #f0f6ff;
}

.nav-ico-wrap {
  position: relative;
  display: inline-flex;
}

.nav-ico {
  font-size: 1.16rem;
  line-height: 1;
}

.nav-count {
  position: absolute;
  top: -5px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: #e65373;
  color: #ffffff;
  font-size: 0.63rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-txt {
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

/* =========================================================
   モーダル共通（残高内訳 ＆ ⏱️一緒に集中タイマー）
   ========================================================= */
.modal-dialog {
  width: min(90vw, 372px);
  border: none;
  border-radius: 22px;
  padding: 0;
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 18px 48px rgba(18, 30, 52, 0.28);
}

.modal-dialog::backdrop {
  background: rgba(20, 30, 48, 0.46);
  backdrop-filter: blur(3px);
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
}

.modal-close {
  border: none;
  background: #eff3fa;
  color: var(--text-sub);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
}

.modal-banner {
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 9px 11px;
  border-radius: 12px;
  line-height: 1.45;
}

.breakdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.breakdown-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  background: #f8faff;
  border: 1px solid #e2ecfa;
  border-radius: 10px;
  font-size: 0.8rem;
}

.modal-subnote {
  margin: 0;
  font-size: 0.73rem;
  line-height: 1.5;
  background: var(--mint-soft);
  color: #1c6b4d;
  padding: 9px 11px;
  border-radius: 11px;
}

.modal-btns {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* ⏱️ 一緒に集中タイマー固有スタイル */
.timer-partner-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f6f9ff;
  border: 1px solid #e1ecfa;
  padding: 10px 12px;
  border-radius: 14px;
}

.timer-cheer-msg {
  margin: 0;
  font-size: 0.77rem;
  line-height: 1.45;
}

.timer-duration-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.dur-btn {
  border: 1px solid var(--border);
  background: #f8faff;
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 8px 4px;
  border-radius: 10px;
  cursor: pointer;
}

.dur-btn.is-selected {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.dur-btn.is-locked {
  opacity: 0.6;
}

.timer-plan-note {
  margin: -4px 0 0;
  font-size: 0.69rem;
  color: var(--text-sub);
  text-align: center;
}

.timer-clock-display {
  font-size: 2.6rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--primary-dark);
  padding: 6px 0;
}

.timer-ctrl-row {
  display: flex;
  gap: 8px;
}

.timer-ctrl-row .btn-primary {
  flex: 1;
}

.timer-skip-btn {
  align-self: center;
}

/* =========================================================
   PC横パネル：🔍 2系統分離・運営コスト監視ミニパネル
   ========================================================= */
.monitor-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.monitor-badge {
  align-self: flex-start;
  font-size: 0.66rem;
  font-weight: 800;
  background: #e4efff;
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}

.monitor-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
}

.monitor-desc {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.48;
  color: var(--text-sub);
}

.monitor-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mon-subtitle {
  margin: 0 0 2px;
  font-size: 0.8rem;
  font-weight: 800;
}

.mon-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
}

.mon-lane {
  color: var(--mint);
}

.mon-lane.is-paid {
  color: var(--pass-accent);
}

.mon-last-action {
  font-size: 0.71rem;
  color: var(--text-sub);
  text-align: right;
}

.mon-cost {
  color: var(--mint);
}

.mon-row.is-highlight-zero {
  background: var(--mint-soft);
  color: #196b4b;
  padding: 5px 8px;
  border-radius: 8px;
}

.mon-row.is-profit-row {
  border-top: 1px dashed var(--border);
  padding-top: 6px;
  font-size: 0.8rem;
  color: var(--primary-dark);
}

.mon-mini-note {
  margin: 0;
  font-size: 0.71rem;
  color: var(--text-sub);
}

.mon-expr-sheet {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.empty-msg {
  margin: 4px 0;
  padding: 10px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-sub);
}

/* =========================================================
   V4追加：☁️ Web・スマホ連動バッジ ＆ モーダル ＆ 発話演出
   ========================================================= */
.header-right-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.sync-badge-btn {
  border: 1px solid #d2deef;
  background: #f6f9fe;
  color: var(--text-sub);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  max-width: 172px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-badge-btn.is-synced {
  background: #e8f7f1;
  color: var(--mint);
  border-color: #b2e4cf;
}

.header-right-stack .quota-badge {
  padding: 4px 10px;
  font-size: 0.7rem;
}

/* タイプライター文字送り中の微小発話モーション（足元接地固定・浮遊なし） */
.char-standing-img.is-speaking {
  transform-origin: 50% 100%;
  animation: speakingPulse 0.24s ease-in-out infinite;
}

@keyframes speakingPulse {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(1.004);
  }
}

/* パス・チケット画面：Web・スマホ共通アカウント案内カード */
.cross-device-card {
  background: linear-gradient(135deg, #f0f7ff 0%, #f6f3ff 100%);
  border: 1.5px solid #c5dafc;
}

.cross-device-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.cross-device-icon {
  font-size: 1.35rem;
  line-height: 1;
  margin-top: 2px;
}

.cross-device-desc {
  margin: 4px 0 0;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--text-main);
}

.cross-device-btn {
  width: 100%;
  border-color: #9ec0f8;
  color: var(--primary-dark);
}

/* ☁️ Web・スマホ連動設定モーダル */
.sync-explain-text {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.52;
  color: var(--text-sub);
}

.sync-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-google-login {
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 11px 14px;
  border-radius: 11px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(74, 127, 212, 0.22);
}

.sync-user-pill {
  background: var(--mint-soft);
  border: 1px solid #b8e6d3;
  color: #196b4b;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 8px 11px;
  border-radius: 10px;
  text-align: center;
}

.sync-btn-pair {
  display: flex;
  gap: 8px;
}

.sync-btn-pair .btn-primary,
.sync-btn-pair .btn-secondary {
  flex: 1;
}

.supabase-config-details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 11px;
  background: #f9fbff;
  font-size: 0.75rem;
}

.supabase-config-details summary {
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
}

.config-form-inner {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cfg-label {
  font-size: 0.69rem;
  font-weight: 800;
  color: var(--text-sub);
}

.cfg-test-result {
  margin: 2px 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.mon-sync-state {
  font-size: 0.72rem;
  color: var(--primary-dark);
}
