/* ================================
 *  AI日記 新UI 共通スタイル
 *  （大人かわいい Dusty Green × Pink テーマ）
 * ================================ */

/* 全体 */
body {
  margin: 0;
  font-family: -apple-system, system-ui, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: #f2f2ec;  /* やわらかいオフホワイト */
}

.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.content-stack {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
/* ================================
 *  ラリー（チャットログ）
 * ================================ */
.chat-log {
  padding: 16px 16px 8px;
  overflow: visible;
  background: #f2f2ec;
}

.chat-log:empty,
.photo-thumbs:empty {
  display: none;
}

/* 1つのメッセージ行
   新： .chat-row.user / .chat-row.bot
   旧： .chat-item.chat-user / .chat-item.chat-ai （互換）
*/
.chat-row,
.chat-item {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 8px 0;
}

.chat-item {
  animation: chatFadeInUp 0.22s ease-out;
}

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

/* ユーザー（右側） */
.chat-row.user,
.chat-item.chat-user {
  justify-content: flex-end;
}

/* チャッティ（左側） */
.chat-row.bot,
.chat-item.chat-ai {
  justify-content: flex-start;
}

/* 時刻表示 */
.chat-time {
  font-size: 11px;
  opacity: 0.7;
  color: #777;
  margin-top: 2px;
}

/* ================================
 *  アバター（アイコン）
 * ================================ */

.chat-avatar,
.chat-item .avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.chat-avatar-img,
.chat-item .avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ================================
 *  吹き出し
 * ================================ */

.chat-bubble,
.chat-item .bubble,
.chat-text {  /* 旧クラス互換用 */
  display: inline-block;
  max-width: 520px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.6;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
  border: 1px solid transparent;
  background: #ffffff;
  color: #333;
  /* ②案：吹き出しだけ少し丸ゴ寄りにする */
  font-family: "Yu Gothic", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

/* あなた（右側）の吹き出し：くすみピンク */
.chat-row.user .chat-bubble,
.chat-item.chat-user .bubble,
.chat-item.chat-user .chat-text {
  background: #e2d5d5;
  border-color: #d2c5c5;
}

/* チャッティ（左側）の吹き出し：くすみブルーグレー */
.chat-row.bot .chat-bubble,
.chat-item.chat-ai .bubble,
.chat-item.chat-ai .chat-text {
  background: #d5e2e2;
  border-color: #c7d4d4;
}

/* ================================
 *  写真機能（＋アイコン）
 * ================================ */

#btn-add {
  display: none !important;
  }

/* ================================
 *  チャット内の写真
 * ================================ */

.chat-photo {
  display: block;
  max-width: 260px;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

/* ================================
 *  入力エリア（下の白カード）
 * ================================ */

.composer {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  background: #ffffff;
  border-top: 1px solid #d4d0c5;
}

.diary-text {
  width: 100%;
  height: 120px;
  border-radius: 14px;
  border: 2px solid #c7c1b5;
  padding: 12px;
  box-sizing: border-box;
  font-size: 16px;
}

/* 文字数カウンター */
.char-counter {
  margin-top: 4px;
  text-align: right;
  font-size: 12px;
  color: #777777;
}

/* ================================
 *  ボタン行
 * ================================ */

.btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

/* 共通ボタン（＋ 合いの手 今日の日記を見る） */
.icon-btn {
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: #e8e0d4;   /* あたたかいベージュ */
  color: #333;
  font-size: 14px;
  /* ②案：ボタンも少し丸ゴ寄りに */
  font-family: "Yu Gothic", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

.icon-btn:active {
  transform: translateY(1px);
  background: #dcc9b5;
}

/* 合いの手残り回数 */
.ai-count-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-count {
  font-size: 22px;
  font-weight: 700;
  color: #637a6b;  /* くすみグリーン */
}

/* ================================
 *  サムネ（下の小さい写真たち）
 * ================================ */

.photo-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.photo-thumbs:empty {
  display: none;
}

.thumb-photo {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  border: 2px solid #c7d4d4;
  object-fit: cover;
}

/* ================================
 *  モーダル（画像プレビュー）
 * ================================ */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(520px, 96vw);
  background: #ffffff;
  border-radius: 18px;
  padding: 14px;
}

/* モーダルの画像 */
.modal-img {
  width: 100%;
  height: auto;
  border-radius: 14px;
}

/* モーダルの一言メモ */
.modal-note {
  margin: 10px 2px 0;
  font-size: 13px;
  opacity: 0.7;
}

/* モーダルのボタン */
.modal-buttons {
  width: 100%;
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

/* ================================
 *  ボタンスタイル（モーダル内）
 * ================================ */

.btn-primary,
.btn-danger,
.btn-ghost {
  border-radius: 14px;
  font-size: 16px;
  padding: 12px;
  border: none;
  /* モーダルのボタンも同じ丸ゴ系で統一 */
  font-family: "Yu Gothic", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

/* メインボタン */
.btn-primary {
  background: #2f7cff;
  color: #ffffff;
}

.btn-primary .btn-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.85;
}

/* 削除ボタン */
.btn-danger {
  background: #ff6b6b;
  color: #ffffff;
}

/* サブボタン */
.btn-ghost {
  background: #e9e9e9;
}

/* ================================
 *  汎用クラス
 * ================================ */

/* 「hidden」クラス */
.hidden {
  display: none;
}

/* ================================
 *  フォントサイズ切り替え用
 * ================================ */

/* 基本値（Mサイズ） */
.app {
  --chat-font-size: 14px;
  --diary-font-size: 16px;
}

/* S / M / L のクラスで上書き */
.app.font-small {
  --chat-font-size: 13px;
  --diary-font-size: 15px;
}

.app.font-medium {
  --chat-font-size: 14px;
  --diary-font-size: 16px;
}

.app.font-large {
  --chat-font-size: 16px;
  --diary-font-size: 18px;
}

/* 既存スタイルのうち、フォントサイズを変えたいところを変数に差し替え */

.chat-bubble,
.chat-item .bubble,
.chat-text {
  /* もともと font-size: 14px; を書いていた場所を差し替え */
  font-size: var(--chat-font-size);
}

.diary-text {
  /* もともと font-size: 16px; を書いていた場所を差し替え */
  font-size: var(--diary-font-size);
}

/* フォントサイズ切り替えボタン */

.font-size-toggle {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.font-size-btn {
  border: none;
  background: transparent;
  padding: 4px 6px;
  font-size: 13px;
  border-radius: 999px;
  color: #555;
}

.font-size-btn.is-active {
  background: #d5e2e2;   /* チャッティ側とおそろいのくすみブルー */
  color: #333;
}

/* フォントサイズボタン共通 */
.font-size-btn {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 6px 8px;
  min-width: 36px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #555;
}

/* 左・真ん中・右で「Aa」の大きさを変える */
.font-size-btn[data-size="small"] {
  font-size: 12px;
}

.font-size-btn[data-size="medium"] {
  font-size: 14px;
}

.font-size-btn[data-size="large"] {
  font-size: 16px;
}

/* 選択中（今のままでもOKだけど、念のため） */
.font-size-btn.is-active {
  background: #dde5e2;
  font-weight: 600;
}

/* ===== ニックネーム設定モーダル用 ===== */

.settings-title {
  font-size: 16px;
  font-weight: 600;
  margin: 4px 2px 8px;
}

.settings-note {
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.8;
  margin: 0 2px 12px;
}

.settings-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #c7c1b5;
  font-size: 14px;
  margin-bottom: 12px;
}

/* ===== 今日の日記ビュー モーダル ===== */
.diary-modal.hidden {
  display: none;
}

.diary-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.diary-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.diary-modal-content {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 8%;
  bottom: 8%;
  background: #fffdf8;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.diary-modal-close {
  align-self: flex-end;
  border: none;
  background: transparent;
  font-size: 20px;
}

/* 日付と心の天気の並び */
.diary-modal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.diary-modal-weather {
  font-size: 22px;
  white-space: nowrap;
}

.diary-modal-date {
  text-align: right;
  color: #777;
  font-size: 12px;
}

.diary-modal-saved-at {
  margin: 4px 0 0;
  font-size: 13px;
  color: #8a8a8a;
  line-height: 1.4;
}

.diary-modal-summary h3,
.diary-modal-chatty h3,
.diary-modal-rally h3 {
  margin: 4px 0;
  font-size: 13px;
}

.diary-modal-summary p,
.diary-modal-chatty p {
  white-space: pre-wrap;
  line-height: 1.6;
}

.diary-modal-rally {
  border-top: 1px dashed #ddd;
  padding-top: 6px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.rally-scroll {
  flex: 1;
  overflow-y: auto;
}

/* モーダル全体：画面が小さいときに縦スクロールできるようにする */
.diary-modal {
  overflow-y: auto;
  padding: 24px 12px;  /* 余白がキツかったらここはお好みで */
}

/* 白いカード自体に「最大高さ」とスクロールを付ける */
.diary-modal-content {
  max-height: 90vh;    /* 画面の高さの 90% まで */
  overflow-y: auto;    /* それ以上はカードの中をスクロール */
}

/* ▼ ボタン共通デザイン */
.diary-btn {
    cursor: pointer;
    /* ふわっと戻る用のアニメーション */
    transition:
        background-color 0.15s ease,
        transform        0.10s ease,
        box-shadow       0.10s ease;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.10); /* ちょっと浮いてる影 */
    transform: translateY(0) scale(1);
}

/* ▼ ホバー時（PC 向け） */
.diary-btn:hover {
    background-color: #f0e5d9;              /* すこーし濃くする */
    transform: translateY(-1px) scale(1.01);/* ふわっと 1px 浮く感じ */
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}

/* ▼ 押している間（スマホのタップでも効く） */
.diary-btn:active {
    background-color: #ecdccf;              /* さらにちょっと濃く */
    transform: translateY(3px) scale(0.96); /* 下にグッと 3px 押しこまれる */
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);/* 影を薄くして“押し込まれた感” */
}

/* ================================
   Calendar Modal (REWRITE)
   ================================ */

/* modal wrapper */
.cal-modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  font-family: inherit;
}
.cal-modal.is-open{ display:block; }

/* backdrop */
.cal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.18);
}

/* panel */
.cal-panel{
  position: absolute;
  left: 50%;
  top: 11%;
  transform: translateX(-50%);
  width: min(92vw, 460px);

  background: #fbfaf6;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  border: 1px solid rgba(0,0,0,0.06);

  padding: 18px 18px 14px;
  box-sizing: border-box;

  /* これがはみ出しの最後の砦 */
  overflow: hidden;
}

/* close button */
.cal-close{
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;

  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.6);
  font-size: 20px;
  line-height: 1;
}

/* header */
.cal-header{
  position: relative;
  /* ×と同じ段に寄せる（notchも考慮） */
  padding-top: calc(12px + env(safe-area-inset-top));
}

/* title row: 1段目=年月 / 2段目=ナビ左右 */
.cal-title{
  width: 100%;
  box-sizing: border-box;

  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "center center"
    "left   right";
  align-items: center;

  row-gap: 8px;
  column-gap: 10px;

  /* 端末右の安全域 + ちょい余白 */
  padding-left: 12px;
  padding-right: calc(12px + env(safe-area-inset-right));
}

/* 2段目の左右配置 */
.cal-nav-left  { grid-area: left;  justify-content: flex-start; }
.cal-nav-right { grid-area: right; justify-content: flex-end; }

/* 1段目の中央配置 */
.cal-title-center{
  grid-area: center;
  justify-self: center;
}

/* nav containers */
.cal-nav-left,
.cal-nav-right{
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}
.cal-nav-left{ justify-content: flex-start; }
.cal-nav-right{ justify-content: flex-end; }

/* nav buttons */
.cal-nav{
  width: 34px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.6);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  line-height: 1;
  flex: 0 0 auto; /* 伸びない */
}
.cal-nav:active{ transform: translateY(1px); }

/* center title */
.cal-title-center{
  justify-self: center;
  display: flex;
  align-items: baseline;
  gap: 8px;

  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.12em;
  font-weight: 600;
  max-width: 100%;          /* ★ 追加：1fr内で収まる */
  padding: 0 6px;           /* ★ 追加：左右に少し余白 */
}

/* month/year */
.cal-month{
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.78;
}
.cal-year{
  font-size: 22px;
  font-weight: 700;
  opacity: 0.35;
}

/* week header */
.cal-week{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 8px 2px 6px;
  font-size: 12px;
  opacity: 0.55;
  text-align: center;
}

/* days grid */
.cal-grid{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 8px 2px 10px;
}

/* day cell */
.cal-day{
  position: relative;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.55);
  display: grid;
  place-items: center;
  font-size: 16px;
}
.cal-day .num{
  position: relative;
  z-index: 2;
  font-weight: 600;
  opacity: 0.85;
  color: #777;
}
.cal-day.is-empty{
  border: none;
  background: transparent;
}

/* paw */
.cal-day.has-diary .paw{
  position: absolute;
  right: 6px;
  bottom: 5px;
  width: 14px;
  height: 14px;
  z-index: 1;
  opacity: 0.95;

  background-image: url("/static/paw_blue.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* today */
.cal-day.is-today{
  border: 1px solid rgba(255,105,180,0.35);
  background: rgba(255,105,180,0.14);
}

/* note (hide) */
.cal-note{ display:none; }

.cal-week,
.cal-grid{
  box-sizing: border-box;
  padding-left: 12px;
  padding-right: calc(12px + env(safe-area-inset-right));
}

/* =========================
   右上ハンバーガー（見た目だけ）
========================= */
.hamburger{
  position: fixed;
  top: 16px;
  right: 16px;
  width: 46px;
  height: 46px;
  border-radius: 12px;

  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;

  z-index: 60;
  -webkit-tap-highlight-color: transparent;
}

.hamburger__bar{
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
}

/* 押した時の軽い反応（見た目のみ） */
.hamburger:active{
  transform: scale(0.98);
}

/* もし「右上の×」などに被るなら微調整用 */
@media (max-width: 420px){
  .hamburger{
    top: 14px;
    right: 14px;
  }
}

/* 曜日の色（日曜＝ピンク／土曜＝水色） */
.cal-week span:first-child {   /* S = 日曜 */
  color: #ff6fae;              /* 今のピンク系 */
}

.cal-week span:last-child {    /* S = 土曜 */
  color: #5fb7ff;              /* 水色 */
}

/* 日付の数字も色分け（日曜＝ピンク／土曜＝水色） */
.cal-grid .cal-day:nth-child(7n+1) .num {  /* 日曜列 */
  color: #ff6fae;
}

.cal-grid .cal-day:nth-child(7n) .num {    /* 土曜列 */
  color: #5fb7ff;
}

.diary-modal-footer {
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: center; /* 右寄せなら flex-end */
}

.diary-modal-footer-close {
  min-width: 140px;
}

/* 最新日記モーダルのフッター用ボタン */
.diary-modal .diary-modal-footer-close {
  background-color: #6B5A3C;   /* いつものブラウン */
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 32px;
  font-size: 16px;
  font-weight: 600;
  min-width: 140px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

/* 押したとき・ホバー時（ほんの少しだけ暗く） */
.diary-modal .diary-modal-footer-close:hover,
.diary-modal .diary-modal-footer-close:active {
  background-color: #5A4B32;   /* 一段暗いブラウン */
}

/* アクセシビリティ用フォーカス */
.diary-modal .diary-modal-footer-close:focus-visible {
  outline: 2px solid #EBD6A5;  /* ゴールド寄りの淡い色 */
  outline-offset: 2px;
}

/* 最新日記モーダルの「閉じる」ボタン専用スタイル */
#diaryModalFooterClose {
  background-color: #AB8686 !important;  /* #6B5A3C + 透明度 */
  color: #fff !important;
  border: none !important;
  border-radius: 999px;
  padding: 10px 32px;
  font-size: 16px;
  font-weight: 600;
  min-width: 140px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

/* ▼ 最新日記モーダルの「閉じる」ボタン */
button.diary-modal-close-bottom {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 40px;
  border-radius: 999px;
  border: none;
  background-color: #778899; /* 好きなブラウンに変えてOK */
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

button.diary-modal-close-bottom:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.cal-day {
  position: relative;
}

/* 足跡を置く（右下に小さく） */
.cal-day.has-diary::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 18px;
  height: 18px;
  background: url("/static/paw_blue.png") no-repeat center / contain;
  opacity: 0.9;
  pointer-events: none;
}

/* textareaを基準にする箱 */
.diary-box {
  position: relative;
}

/* 猫手ボタン（右下に浮かせる） */
.btn-ai-float {
  position: absolute;
  right: 10px;
  bottom: 10px;

  width: 44px;
  height: 44px;

  border: none;
  background: transparent;
  padding: 0;
  margin: 0;

  cursor: pointer;

  transition: transform 0.12s ease;
}

/* 猫手画像サイズ */
.btn-ai-float img {
  width: 100%;
  height: 100%;
  display: block;
}

/* 押したときに一瞬大きくなる（しいちゃん仕様） */
.btn-ai-float:active {
  transform: scale(1.25);
}

/* 🐾 合いの手：浮遊猫手ボタン */
.btn-ai-float {
    position: absolute;
    right: 10px;
    bottom: 10px;

    background: none;
    border: none;
    padding: 0;
    margin: 0;

    cursor: pointer;

    /* アニメーション準備 */
    transition: transform 0.08s ease;
}

/* 画像サイズ */
.btn-ai-float img {
    width: 42px;
    height: auto;
    display: block;
}

/* 🐾 押した瞬間：ぷにっ */
.btn-ai-float:active {
    transform: scale(1.25);
}

/* iPhoneで反応を良くする */
.btn-ai-float {
    -webkit-tap-highlight-color: transparent;
}

/* 🐾 合いの手：浮遊猫手ボタン */
.btn-ai-float{
    position:absolute;
    right:10px;
    bottom:10px;

    background:none;
    border:none;
    padding:0;
    margin:0;

    cursor:pointer;
    -webkit-tap-highlight-color:transparent;

    /* “押せる感”の基本 */
    filter: drop-shadow(0 6px 10px rgba(0,0,0,.20));
    transform-origin: 85% 90%;
    transition: transform .08s ease, filter .08s ease;
}

.btn-ai-float img{
    width:42px;
    height:auto;
    display:block;
}

/* 押した瞬間：2倍＋明るく＋影変化（押し込み）＋ちょい揺れ */
.btn-ai-float:active{
    transform: scale(2.0) rotate(-6deg);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.18)) brightness(1.35) saturate(1.2);
}

/* “ぷるっ”を足す（押してる間だけ） */
.btn-ai-float:active img{
    animation: paw-jiggle .12s ease-in-out infinite;
}

@keyframes paw-jiggle{
    0%   { transform: translate(0,0) rotate(0deg); }
    50%  { transform: translate(-1px,-1px) rotate(2deg); }
    100% { transform: translate(0,0) rotate(0deg); }
}

.btn-ai-float:active::before{
    content:"";
    position:absolute;
    inset:-18px;
    border-radius:999px;
    background: rgba(255, 220, 120, .35);
    filter: blur(6px);
    z-index:-1;
}

/* =========================
   猫手：ぷにっ＋輪郭発光（B案）
   ========================= */

.btn-ai-float{
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transform-origin: center center;
}

.btn-ai-float img{
    display: block;
    width: 100%;
    height: 100%;
    /* 画像自体の色は変えない */
}

/* 押した瞬間：少し潰れる（ぷにっ） */
.btn-ai-float.is-squish{
    transform: scale(0.92, 0.84);
    filter:
        drop-shadow(0 0 10px rgba(255, 210, 90, 0.85))
        drop-shadow(0 0 18px rgba(255, 210, 90, 0.55));
}

/* つぎ：少し大きく（ぽん） */
.btn-ai-float.is-pop{
    transform: scale(1.25);
    filter:
        drop-shadow(0 0 12px rgba(255, 210, 90, 0.90))
        drop-shadow(0 0 22px rgba(255, 210, 90, 0.60));
}

/* 戻る */
.btn-ai-float.is-back{
    transform: scale(1.0);
    filter: none;
}

.btn-ai-float.is-pop {
  transform: scale(1.25, 0.9);
  filter: drop-shadow(0 0 6px rgba(120, 190, 255, 0.9))
          drop-shadow(0 0 12px rgba(120, 190, 255, 0.6));
  transition: transform 0.12s ease-out, filter 0.12s ease-out;
}

.btn-ai-float.is-pop-back {
  transform: scale(1, 1);
  filter: drop-shadow(0 0 0 rgba(120,190,255,0));
  transition: transform 0.16s ease-out, filter 0.16s ease-out;
}

/* === ai残り回数ボタン：中の手アイコンを小さく === */
.ai-count-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 8px 12px;
}

.ai-count-icon{
  width: 22px;
  height: 22px;
  display: block;
}

.ai-count{
  font-size: 18px;
  line-height: 1;
}

/* ================================
 *  ハンバーガーメニュー（menuModal）
 * ================================ */

.menu-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.menu-modal[aria-hidden="false"]{
  display: block;
}

.menu-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.25);
}

.menu-panel{
  position: absolute;
  top: 64px;
  right: 16px;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  min-width: 160px;
}

.menu-panel button{
  width: 100%;
  border: none;
  background: #f3efe8;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 6px 0;
  font-size: 14px;
}

.hamburger{
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
}

/* =========================================
   HOTFIX (menu / nickname / hide buttons)
   add to END of new_ui2.css
========================================= */

/* --- ❶ ハンバーガーが押せない対策：最前面＆クリック保証 --- */
#hamburgerBtn.hamburger {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 99999;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

/* ハンバーガーが何かに覆われている時の保険（透明レイヤーが吸わない） */
.menu-backdrop,
.cal-backdrop,
.diary-modal-backdrop {
  pointer-events: none; /* デフォルトはクリック吸わない */
}

/* ただし開いてる時は吸う（※JSが display/hidden を切替える想定に合わせる） */
#menuModal[aria-hidden="false"] .menu-backdrop,
#calendarModal[aria-hidden="false"] .cal-backdrop,
#diaryModal:not(.hidden) .diary-modal-backdrop {
  pointer-events: auto;
}

/* --- メニューの重なり順を明示（menu > calendar > diary など調整可） --- */
#menuModal { z-index: 90000; }
#calendarModal { z-index: 80000; }
#diaryModal { z-index: 85000; } /* diaryが前に出てほしいなら calendarより上 */

/* メニューパネルが確実に見えるように */
#menuModal .menu-panel {
  position: fixed;
  top: 56px;
  right: 14px;
  z-index: 90001;
}

/* カレンダーパネルも固定（古いCSSでrelativeになってる時の保険） */
#calendarModal .cal-panel {
  position: fixed;
  z-index: 80001;
}

/* --- ❷ ニックネームカードがカード形状にならない対策 --- */
#nicknameCard.nickname-card {
  /* 表示中にカードとして成立させる */
  display: none; /* JSで表示するなら block に切り替える */
  position: fixed;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  width: min(560px, 92vw);

  background: #ffffff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,.14);

  padding: 14px 14px 16px;
  z-index: 95000;            /* hamburgerより前に出す */
}

/* ニックネーム表示中はハンバーガーを隠したい場合（bodyに状態クラス付ける方式推奨）
   いまJS未対応でも、念のためCSSだけ用意しておく */
body.is-nickname-open #hamburgerBtn { display: none !important; }

/* 見た目 */
#nicknameCard .nickname-title {
  margin: 10px 0 6px;
  font-weight: 700;
}
#nicknameCard .nickname-sub {
  margin: 0 0 10px;
  opacity: .85;
}
#nicknameCard input#nicknameInput {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  padding: 10px 12px;
  font-size: 16px;
  outline: none;
}
#nicknameCard .nickname-buttons {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
#nicknameCard .nickname-buttons button {
  flex: 1;
  border-radius: 12px;
  padding: 10px 12px;
}

/* 追加：ニックネームの背面を暗くしたいなら（任意）
   HTMLに backdrop 要素が無いので、必要ならJSで作るか別途div追加が必要 */

/* --- ❸ 「見る」「あいの手」ボタンを非表示 --- */
/* HTMLでのIDが確定しているのでこれが最強 */
#btnViewToday,
#btnAi {
  display: none !important;
}

/* =========================================================
   AINOTE / Nickname UI - CLEAN & STABLE (iPhone対応)
   - iOSの勝手な文字拡大を抑制
   - 画面全体の縮小/ズーム事故を防止
   - ニックネームカードを中央固定
   - 文字/入力/ボタンを押しやすく
   ========================================================= */

/* ---- 基本リセット ---- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

/* ---- iOSの自動文字拡大を抑制（これ重要）---- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px;
}

/* iPhone幅だけ少しだけ基準を上げたい場合（好みで 16 のままでもOK） */
@media (max-width: 430px){
  html { font-size: 17px; }
}

/* ---- 画面縮小(zoom/transform)事故の予防 ---- */
body {
  zoom: 1;
  transform: none;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: #111;
  background: #fff;
}

/* =========================================================
   HERO（チャッティ画像 + タイトル周り）
   画像がデカすぎて下が押せない事故を防ぐ
   ========================================================= */

/* チャッティ画像：iPhoneでも収まる上限を設定 */
.hero img,
.chatty-image,
.nickname-chatty {
  width: min(72vw, 360px);
  height: auto;
  display: block;
  margin: 0 auto;
}

/* タイトル/説明：読みやすい可変サイズ */
.hero-title,
.nickname-title {
  font-size: clamp(18px, 5vw, 26px);
  line-height: 1.25;
}

.hero-sub,
.nickname-desc,
.nickname-sub {
  font-size: clamp(14px, 4vw, 18px);
  line-height: 1.5;
}

/* =========================================================
   NICKNAME CARD（中央固定で安定）
   ※HTML側に #nicknameCard と .nickname-card がある前提
   ========================================================= */

/* 背景の薄暗幕（存在する場合だけ効く） */
#nicknameOverlay,
.nickname-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.20);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 90000;
}

/* ニックネームカード本体：中央固定 */
#nicknameCard,
#nicknameCard.nickname-card,
.nickname-card {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 92vw);
  max-height: 86dvh;
  overflow: auto;
  padding: 22px 18px 18px;
  border-radius: 24px;
  background: #f8f4ee;
  border: 1px solid #e4dbcf;
  box-shadow: 0 18px 40px rgba(70, 55, 45, 0.18);
  z-index: 95000;
}

/* カード内の余白や整列（クラスが違っても崩れにくく） */
#nicknameCard .nickname-title,
.nickname-card .nickname-title {
  margin: 0 0 8px 0;
  text-align: center;
}

#nicknameCard .nickname-sub,
#nicknameCard .nickname-desc,
.nickname-card .nickname-sub,
.nickname-card .nickname-desc {
  margin: 0 0 14px 0;
  text-align: center;
  opacity: 0.9;
}

/* 入力欄：iOSでズームしないように font-size 16px以上必須 */
#nicknameInput,
#nicknameCard input[type="text"],
.nickname-card input[type="text"] {
  width: 100%;
  height: 58px;
  font-size: 16px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1.5px solid #ddd3c7;
  background: #fffdf9;
  color: #3d322c;
  outline: none;
}

/* 入力フォーカス */
#nicknameInput:focus,
#nicknameCard input[type="text"]:focus,
.nickname-card input[type="text"]:focus {
  outline: none;
  border-color: #c8b19c;
  box-shadow: 0 0 0 4px rgba(200, 177, 156, 0.15);
}

#nicknameCard .nickname-skip-next,
.nickname-card .nickname-skip-next {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 14px;
  color: #6f6158;
}

#nicknameCard .nickname-skip-next input,
.nickname-card .nickname-skip-next input {
  width: 16px;
  height: 16px;
}

/* ボタン群 */
#nicknameCard .nickname-buttons,
.nickname-card .nickname-buttons {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* ボタン：押しやすさ最優先 */
#nicknameCard .nickname-buttons button,
.nickname-card .nickname-buttons button,
#saveNicknameBtn,
#skipNicknameBtn {
  flex: 1;
  min-width: 120px;
  height: 58px;
  padding: 12px 12px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 20px;
  cursor: pointer;
}

/* ニックネームカードのボタン色（AINOTE統一） */
#saveNicknameBtn{
  background: #cbb7b0;
  color: #fff;
  border: 1px solid #cbb7b0;
  box-shadow: 0 8px 18px rgba(110, 85, 75, 0.14);
}

#skipNicknameBtn{
  background: #f4efe8;
  color: #7a6759;
  border: 1px solid #ddd2c4;
}

/* =========================================================
   iPhoneの下バー/キーボードで隠れにくくする保険
   ========================================================= */

/* 画面下に固定の入力UIがある場合だけ効く（無ければ無視される） */
.composer,
.bottom-composer,
#composer {
  padding-bottom: env(safe-area-inset-bottom);
}

/* iOSの“中途半端なタップで拡大”を避ける */
button, input, textarea {
  touch-action: manipulation;
}

#viewDiaryBtn { display: none !important; }


/*  20260310 消す予定		
.auth-modal{
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.35);
  z-index: 9999;
}
.auth-modal.is-open{ display: flex; }
.auth-card{
  width: min(92vw, 420px);
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,.22);
}
.auth-head{ display:flex; align-items:center; justify-content:space-between; }
.auth-close{ font-size: 22px; background: transparent; border: 0; padding: 8px; }
.auth-tabs{ display:flex; gap: 8px; margin: 8px 0 12px; }
.auth-tab{
  flex:1; padding: 10px 12px; border-radius: 12px;
  border: 1px solid #ddd; background:#f7f7f7;
}
.auth-tab.is-active{ background:#fff; border-color:#bbb; font-weight: 700; }
.auth-msg{ min-height: 20px; margin: 6px 0 10px; font-size: 14px; }
.auth-form{ display:flex; flex-direction:column; gap: 10px; }
.auth-form label{ display:flex; flex-direction:column; gap: 6px; font-size: 14px; }
.auth-form input{
  padding: 12px; border-radius: 12px; border: 1px solid #ddd;
}
.auth-submit{
  padding: 12px; border-radius: 12px; border: 0;
  font-weight: 700;
}
.auth-ghost{
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid #ddd; background: transparent;
}
.is-hidden{ display:none !important; }

/* === Auth Modal (login/register) === */


 /*  20260310 消す予定

#authModal.auth-modal{
  position: fixed;
  inset: 0;
  display: none;              /* 初期は非表示 */

 /*  20260310 消す予定
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  z-index: 99999;             /* とにかく最前面 */
}


 /*  20260310 消す予定
#authModal.auth-modal[aria-hidden="false"]{
  display: flex;              /* aria-hidden=false で表示 */
 /*  20260310 消す予定

}

#authModal .auth-card{
  width: min(520px, 92vw);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  opacity: 1;                 /* うっすら対策 */
 /*  20260310 消す予定
  visibility: visible;
  pointer-events: auto;
  position: relative;
}

#authModal .auth-close{
  position:absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
}

 20260310 消す予定*/



.auth-modal,
#authModal.auth-modal{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(60, 52, 46, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 99999;
}

.auth-modal.is-open,
#authModal.auth-modal[aria-hidden="false"]{
  display: flex;
}

.auth-card,
#authModal .auth-card{
  width: min(92vw, 420px);
  background: #f8f4ee;
  border: 1px solid #e4dbcf;
  border-radius: 24px;
  padding: 22px 18px 18px;
  box-shadow: 0 18px 40px rgba(70, 55, 45, 0.18);
  position: relative;
  color: #3e342d;
}



.auth-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.auth-close,
#authModal .auth-close{
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 1;
  font-size: 22px;
  line-height: 1;
  background: transparent;
  border: 0;
  padding: 8px;
  color: #4da3ff;
}

.auth-tabs{
  display: flex;
  gap: 10px;
  margin: 14px 0 18px;
}

.auth-tab{
  flex: 1;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid #ddd2c4;
  background: #f4efe8;
  color: #7a6759;
  font-weight: 700;
  font-size: 1rem;
  transition: 0.2s ease;
}

.auth-tab.is-active{
  background: #c8b0a3;
  border-color: #c8b0a3;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(120, 90, 60, 0.14);
}

.auth-msg{
  min-height: 20px;
  margin: 4px 0 10px;
  font-size: 14px;
  color: #7a6759;
}

.auth-form{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form label{
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: #40352f;
}

.auth-form input{
  padding: 13px 14px;
  border-radius: 16px;
  border: 1.5px solid #ddd3c7;
  background: #fffdf9;
  color: #3d322c;
  font-size: 16px;
}

.auth-form input:focus{
  outline: none;
  border-color: #c8b19c;
  box-shadow: 0 0 0 4px rgba(200, 177, 156, 0.15);
}

.auth-submit{
  margin-top: 8px;
  padding: 14px 12px;
  border-radius: 18px;
  border: 0;
  background: #cbb7b0;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 8px 18px rgba(110, 85, 75, 0.14);
}

.auth-ghost{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #ddd2c4;
  background: transparent;
  color: #6b5a50;
}

.pw-wrap{
  position: relative;
}

.pw-wrap input{
  width: 100%;
  padding-right: 52px;
}

.pw-toggle{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
}

.pw-toggle img{
  width: 28px;
  height: 28px;
  display: block;
}

.is-hidden{
  display: none !important;
}

/* ===== AINOTE トップ画面 ===== */

.ainote-top-screen{
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: #efefea;
}

.ainote-hero{
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.hero-bg{
  width: 100%;
  height: auto;
  display: block;
}

/* ===== AINOTE 入口ボタン ===== */
.ainote-entry-buttons{
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 18px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-sizing: border-box;
}

.ainote-entry-btn{
  width: 100%;
  min-height: 74px;
  border: 2px solid rgba(255,255,255,0.72);
  border-radius: 999px;
  background: rgba(58, 54, 66, 0.28);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    0 10px 24px rgba(0,0,0,0.16),
    inset 0 1px 0 rgba(255,255,255,0.20);
  text-shadow: 0 1px 2px rgba(0,0,0,0.22);
  transition:
    transform 0.12s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.ainote-entry-btn.primary{
  background: rgba(170, 146, 160, 0.42);
  border-color: rgba(255,255,255,0.78);
}

.ainote-entry-btn.secondary{
  background: rgba(150, 160, 176, 0.38);
  border-color: rgba(255,255,255,0.70);
}

.ainote-entry-btn:active{
  transform: scale(0.985);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.10),
    inset 0 1px 0 rgba(255,255,255,0.18);
}

.ainote-entry-btn:hover{
  border-color: rgba(255,255,255,0.82);
}

.ainote-entry-buttons{
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 18px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-sizing: border-box;
}

.ainote-top-screen.after-login{
  min-height: 0;
}

.ainote-top-screen.after-login .ainote-hero{
  display: none;
}

.ainote-top-screen.after-login .ainote-entry-buttons{
  display: none;
}

/* ===== Auth modal 最前面＆全画面固定 ===== */
#authModal{
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999 !important;
}

#authModal[aria-hidden="false"]{
  display: flex !important;
}

#authModal .auth-card{
  margin: 0 !important;
  position: relative;
  z-index: 2;
}

#authModal::before{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(60, 52, 46, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1;
}

body.auth-open{
  overflow: hidden;
}

.diary-date-label{
  margin: 0 0 10px;
  text-align: left;
  line-height: 1.35;
}

.diary-entry-label{
  font-size: 18px;
  font-weight: 700;
}

.diary-date-text{
  margin-top: 2px;
  font-size: 14px;
  font-weight: 400;
  color: #888;
}

.day-weather-section{
  margin: 0 0 12px;
}

.day-weather-toggle{
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  color: #5f5f5f;
  cursor: pointer;
}

.day-weather-panel{
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid #e6e0d8;
  border-radius: 16px;
  background: rgba(255,255,255,0.65);
}

.day-weather-help{
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.7;
  color: #666;
}

.day-weather-list{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-weather-list-all{
  margin-top: 10px;
}

.day-weather-chip{
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid #ddd6cc;
  border-radius: 999px;
  background: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.day-weather-chip.is-selected{
  border-color: #b8afa2;
  box-shadow: 0 0 0 2px rgba(184, 175, 162, 0.18);
  transform: scale(1.04);
}

.day-weather-more-btn{
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: #6a6a6a;
  text-decoration: underline;
  cursor: pointer;
}

/* =========================
   btn-ai-float 最終上書き
   既存名のまま、見た目だけ調整
   ========================= */

/* ボタン本体を少し大きく */
.btn-ai-float{
  right: 10px;
  bottom: 10px;
  width: 56px;
  height: 56px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;

  filter: drop-shadow(0 4px 8px rgba(0,0,0,.18));
  transform-origin: 85% 90%;
  transition: transform .10s ease, filter .10s ease;
  z-index: 5;
}

/* 猫手画像を1.3倍くらいに */
.btn-ai-float img{
  width: 56px;
  height: auto;
  display: block;
}

/* 押した瞬間：ぷにっ */
.btn-ai-float:active{
  transform: scale(1.18, 0.90);
  filter:
    drop-shadow(0 2px 4px rgba(0,0,0,.16))
    drop-shadow(0 0 8px rgba(120,190,255,.75))
    drop-shadow(0 0 14px rgba(120,190,255,.45));
}

/* 押した瞬間：中身もちょいぷる */
.btn-ai-float:active img{
  animation: paw-jiggle .12s ease-in-out infinite;
}

/* 青い発光リングっぽい感じ */
.btn-ai-float.is-pop{
  transform: scale(1.20, 0.92);
  filter:
    drop-shadow(0 0 6px rgba(120,190,255,0.95))
    drop-shadow(0 0 12px rgba(120,190,255,0.60));
  transition: transform 0.12s ease-out, filter 0.12s ease-out;
}

.btn-ai-float.is-pop-back{
  transform: scale(1, 1);
  filter: drop-shadow(0 0 0 rgba(120,190,255,0));
  transition: transform 0.16s ease-out, filter 0.16s ease-out;
}

/* =========================
   既存 btn-ai-float を壊さず
   横並び + 1.3倍見た目
   ========================= */

.diary-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.diary-text {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

/* 既存の btn-ai-float を右脇ボタン化 */
.btn-ai-float {
  position: static !important;
  flex: 0 0 72px;
  width: 72px;
  height: 112px;

  border: none;
  background: transparent;
  padding: 0 0 6px 0;
  margin: 0;
  cursor: pointer;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;

  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* 猫手画像を1.3倍くらいに */
.btn-ai-float img {
  width: 36px !important;
  height: auto;
  display: block;
}

/* 聞いてラベル */
.btn-ai-float-label {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
  color: #2f2a24;
  font-weight: 700;
}

/* 既存のぷにっと感を少し残す */
.btn-ai-float:active img {
  transform: translateY(3px) scaleX(1.10) scaleY(0.90);
}

/* =========================
   猫手サイズUP + 文字数位置調整
   ========================= */

/* コメント欄まわりを基準にする */
.diary-box {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-bottom: 28px; /* 0/600 を下に入れる余白 */
}

/* テキスト欄 */
.diary-text {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

/* 猫手ボタンを1.3倍くらいに */
.btn-ai-float {
  position: static !important;
  flex: 0 0 72px;
  width: 72px;
  height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0 6px 0;
  margin: 0;
}

/* 猫手画像を大きく */
.btn-ai-float img {
  width: 36px !important;
  height: auto;
  display: block;
}

/* ラベル */
.btn-ai-float-label {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
  color: #2f2a24;
  font-weight: 700;
}

/* 0 / 600 をコメント欄の右下へ */
.char-counter {
  position: relative;
  margin-top: -22px;
  margin-right: 86px;   /* 猫手ぶん左へ逃がす */
  text-align: right;
  z-index: 2;
}

/* 右脇の案内ボタン 最終上書き */
.btn-ai-float {
  position: static !important;
  flex: 0 0 82px !important;
  width: 82px !important;
  height: 124px !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;

  padding: 0 0 6px 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
}

/* 猫手だけ大きくする */
.diary-box .btn-ai-float img {
  width: 46px !important;
  height: auto !important;
  max-width: none !important;
  display: block !important;
}

/* ラベル */
.btn-ai-float-label {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
  color: #2f2a24;
  font-weight: 700;
  text-align: center;
}

.btn-ai-float {
  flex: 0 0 66px !important;
  width: 66px !important;
  height: 104px !important;
}

.diary-box .btn-ai-float img {
  width: 40px !important;
}

.btn-ai-float-label {
  margin-top: 2px;
  line-height: 1.0;
  color: #9aa3ad;
  font-weight: 500;
}

.btn-ai-float {
  margin-bottom: 2px;
}

.day-weather-toggle::after {
  content: " ▼";
  font-size: 11px;
}

.day-weather-toggle[aria-expanded="true"]::after {
  content: " ▲";
}

.day-weather-toggle {
  color: #555;
  font-weight: 500;
}

/* ================================
 *  ユーザーアイコン変更モーダル
 * ================================ */

.user-icon-modal-card{
  width: min(560px, 96vw);
}

.user-icon-modal-title{
  margin: 0 0 12px;
  font-size: 18px;
  text-align: center;
  color: #333;
}

.user-icon-crop-wrap{
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.user-icon-crop-frame{
  width: min(72vw, 280px);
  height: min(72vw, 280px);
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: #f4f4f4;
  border: 2px solid #ddd;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
  touch-action: none;
}

.user-icon-crop-img{
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  max-height: none;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
}

.user-icon-crop-img.is-dragging{
  cursor: grabbing;
}

.user-icon-zoom{
  margin: 10px 0 16px;
}

.user-icon-zoom label{
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #555;
}

.user-icon-zoom input[type="range"]{
  width: 100%;
}

#userIconModal .modal-actions{
  display: grid;
  gap: 10px;
}

#userIconModal #btn-user-icon-choose-again,
#userIconModal #btn-user-icon-cancel{
  background: #f4efe8;
  color: #7a6759;
  border: 1px solid #ddd2c4;
  box-shadow: none;
}

#userIconModal #btn-user-icon-reset{
  background: #e8dfdc;
  color: #8a6f6a;
  border: 1px solid #d8cbc6;
  box-shadow: none;
}

#userIconModal #btn-user-icon-save{
  background: #cbb7b0;
  color: #fff;
  border: 1px solid #cbb7b0;
  box-shadow: 0 8px 18px rgba(110, 85, 75, 0.14);
}

#userIconModal #btn-user-icon-choose-again:active,
#userIconModal #btn-user-icon-cancel:active{
  background: #ebe3da;
}

#userIconModal #btn-user-icon-reset:active{
  background: #ddd1cc;
}

#userIconModal #btn-user-icon-save:active{
  background: #bfa9a1;
}

.topic-highlight {
  color: #d98ca3;
  font-weight: 600;
}

.topic-highlight {
  display: inline-block;
  margin-top: 6px;
}

.title-soft {
  color: #7faec4;
  font-weight: 600;
}

textarea::placeholder {
  color: #9a9a9a;
}

.diary-entry-label {
  margin-bottom: 1px;
}

#btnTodayTopic {
  font-size: 13px;  /* 今より+1くらい */
}

#btnTodayTopic {
  padding: 10px 12px;
  border-radius: 14px;
}

.today-topic-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  padding: 24px;
}

.today-topic-modal-card {
  width: min(92vw, 420px);
  background: #fffdfb;
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  text-align: center;
}

.today-topic-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #7faec4;
  margin-bottom: 14px;
}

.today-topic-modal-text {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.45;
  color: #d98ca3;
  margin-bottom: 22px;
  word-break: break-word;
}

.today-topic-modal-actions {
  display: grid;
  gap: 12px;
}

.today-topic-btn {
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.today-topic-btn.primary {
  background: #efe7de;
  color: #333;
}

.today-topic-btn.secondary {
  background: #f5f5f5;
  color: #666;
}

/* 今日のお題の下に余白 */
#btnTodayTopic {
  margin-bottom: 20px !important;
}

/* アイコン変更の下に余白 */
#menuUserIconBtn {
  margin-bottom: 20px !important;
}


/* メニューのグループ区切り */
.menu-panel button:nth-child(2) {
  margin-bottom: 14px; /* 今日のお題の下 */
}

.menu-panel button:nth-child(5) {
  margin-bottom: 14px; /* アイコン変更の下 */
}

.diary-modal-rally {
  position: relative;
}

.chatty-watermark {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  opacity: 0.30;
  pointer-events: none;
}

.lang-btn-top{
  padding: 6px 10px;
  font-size: 13px;
  position: absolute;
  top: 28px;
  left: 24px;
  z-index: 20;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
}

.lang-btn-top:active{
  transform: scale(0.96);
}

.hero-copy{
  position: absolute;
  top: 55.5%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  text-align: center;
  color: #f6eeea;
  z-index: 10;
}

.hero-copy p{
  margin: 0 0 12px 0;
  font-size: 16px;
  line-height: 1.95;
  font-weight: 500;
  letter-spacing: 0.05em;
  font-family:
    "Kiwi Maru",
    "Zen Maru Gothic",
    "Hiragino Maru Gothic ProN",
    "Yu Gothic",
    "Meiryo",
    sans-serif;
  text-shadow:
    0 0 3px rgba(255, 200, 210, 0.75),
    0 0 10px rgba(255, 200, 210, 0.35),
    0 0 18px rgba(255, 200, 210, 0.18),
    0 2px 8px rgba(0,0,0,0.18);
}


.hero-copy p{
  color: #fff3f6;
  text-shadow:
    0 0 4px rgba(255, 210, 220, 0.78),
    0 0 12px rgba(255, 190, 205, 0.40),
    0 0 22px rgba(255, 190, 205, 0.18),
    0 2px 8px rgba(0,0,0,0.16);
}

.hero-copy p{
  color: #fff9fb !important;
  text-shadow:
    0.7px 0 rgba(242, 170, 198, 1),
   -0.7px 0 rgba(242, 170, 198, 1),
    0 0.7px rgba(242, 170, 198, 1),
    0 -0.7px rgba(242, 170, 198, 1),
    0 0 8px rgba(242, 170, 198, 0.26),
    0 2px 6px rgba(0,0,0,0.14) !important;
}

.hero-copy .hero-line1{
  font-size: 22px !important;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.hero-copy .hero-line1{
  font-size: 22px !important;
  margin-bottom: 18px !important;
}

.hero-copy .hero-line2{
  margin-bottom: 8px !important;
}

.hero-copy .hero-line3{
  margin-bottom: 0 !important;
}

.hero-copy .hero-line1{
  letter-spacing: 0.085em !important;
}

.hero-copy .hero-line2,
.hero-copy .hero-line3{
  letter-spacing: 0.06em !important;
}

.hero-copy p{
  color: #fdf3f7 !important;
}

.hero-line2{
  white-space: pre-line;
}

.day-weather-help{
  white-space: pre-line;
}

.btn-ai-float-label{
  white-space: pre-line;
}

.btn-ai-float-label{
  white-space: pre-line;
  line-height: 1.35;
}

/* ================================
 *  汎用入力モーダル（AINOTE用）
 * ================================ */

#inputModal{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.32);
  box-sizing: border-box;
}

#inputModal.hidden{
  display: none !important;
}

#inputModal .input-modal-card{
  width: min(92vw, 640px);
  max-width: 640px;
  max-height: 78dvh;
  overflow: auto;
  border-radius: 30px;
  padding: 30px 30px 26px;
  background: #f8f4ee;
  border: 1px solid #e4dbcf;
  box-shadow: 0 18px 40px rgba(70, 55, 45, 0.18); 
  box-sizing: border-box;
}

#inputModalTitle{
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 800;
  color: #2d2a26;
}

#inputModalMessage{
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 700;
  color: #40352f;
  white-space: pre-line;
  word-break: break-word;
}

#inputModal .input-modal-field{
  width: 100%;
  height: 58px;
  border-radius: 16px;
  border: 1.5px solid #ddd3c7;
  background: #fffdf9;
  padding: 0 18px;
  font-size: 16px;
  color: #3d322c;
  box-sizing: border-box;
  margin-bottom: 20px;
}

#inputModal .input-modal-field::placeholder{
  color: #b3ada6;
}

#inputModal .input-modal-field:focus{
  outline: none;
  border-color: #c8b19c;
  box-shadow: 0 0 0 4px rgba(200, 177, 156, 0.15);
}

#inputModal .modal-actions{
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

#inputModalCancel{
  background: #f4efe8;
  color: #7a6759;
  border: 1px solid #ddd2c4;
}

#inputModalOk{
  background: #cbb7b0;
  color: #fff;
  border: 1px solid #cbb7b0;
  box-shadow: 0 8px 18px rgba(110, 85, 75, 0.14);
}

#inputModalCancel:active{
  background: #ebe3da;
}

#inputModalOk:active{
  background: #bfa9a1;
}

#inputModalCancel,
#inputModalOk{
  min-width: 120px;
  height: 58px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 800;
}

@media (max-width: 480px){
  #inputModal{
    align-items: flex-start;
    padding-top: 72px;
  }

  #inputModal .input-modal-card{
    width: calc(100vw - 32px);
    max-height: calc(100dvh - 96px);
    padding: 24px 22px 22px;
    border-radius: 28px;
  }

  #inputModalTitle{
    font-size: 19px;
    margin-bottom: 16px;
  }

  #inputModalMessage{
    font-size: 15px;
    line-height: 1.55;
  }

  #inputModal .modal-actions{
    justify-content: space-between;
    gap: 14px;
  }

  #inputModalCancel,
  #inputModalOk{
    flex: 1 1 0;
    min-width: 0;
    height: 54px;
    border-radius: 20px;
    font-size: 15px;
  }

}
