:root {
  --bg:#fff9ec;--surface:#FFFFFF;--surface2:#f3ecd8;--border:#e0d6ba;
  --navy:#1c2340;--navy2:#14182f;--navy-light:#2c3560;
  --yellow:#f2d98a;--yellow2:#e0b030;--yellow-light:#fff6c8;
  --text:#1c2340;--text2:#5c5546;--text3:#8a7f66;
  --on-navy:#fff3d6;--on-navy-dim:rgba(255,243,214,.55);--on-navy-track:rgba(255,243,214,.14);
  --danger:#C0392B;--red:#c0392b;
  --tan:#b3a582;--tan-dark:#cbbd97;--paper-border:#eee2c8;
  --tape-pink:rgba(243,207,226,.75);--tape-blue:rgba(143,216,234,.55);
  --font:"Noto Sans JP",sans-serif;--maru:"Zen Maru Gothic","Noto Sans JP",sans-serif;--mono:"DM Mono",monospace;
  --radius:16px;--radius-sm:10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  /* 自前の「引っ張って更新」と、ブラウザ標準の引っ張って更新が二重に効かないようにする */
  overscroll-behavior-y: contain;
}

/* ── 引っ張って更新のインジケータ ── */
.ptr {
  position: fixed; top: 6px; left: 50%; z-index: 150;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--navy);
  box-shadow: 0 3px 12px rgba(26,27,48,.28);
  transform: translate(-50%, 0); opacity: 0; pointer-events: none;
}
.ptr.snapback { transition: transform .25s ease, opacity .25s ease; }
.ptr-arrow { font-size: 16px; line-height: 1; transition: transform .18s ease; }
.ptr.ready .ptr-arrow { transform: rotate(180deg); }
/* 更新中も丸は白のまま。ヒーローが濃紺なので、濃い色にすると背景に溶けて見えなくなる */
.ptr.spinning .ptr-arrow {
  transform: none;
  animation: ptr-spin .7s linear infinite;
}
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ── ログイン ── */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(160deg, var(--navy2) 0%, var(--navy) 55%, var(--navy-light) 100%);
}
.login-box {
  background: var(--surface);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  width: 280px;
  text-align: center;
}
.login-box h1 { font-size: 22px; margin: 0 0 4px; color: var(--navy); letter-spacing: .08em; font-weight: 700; }
.brand-lockup { display: inline-block; text-align: center; }
.brand-ruby { display: block; font-size: .5em; font-weight: 400; letter-spacing: .25em; opacity: .6; margin-bottom: 2px; }
.login-sub { font-size: 12px; color: var(--text3); margin: 0 0 18px; }
.login-box input {
  width: 100%; padding: 11px 14px; margin-bottom: 10px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px;
  font-family: var(--font); background: var(--bg); color: var(--text); outline: none;
}
.login-box input:focus { border-color: var(--navy); background: var(--surface); }
.login-box button {
  width: 100%; padding: 12px; border: none; border-radius: var(--radius-sm);
  background: var(--navy); color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer; margin-top: 4px; letter-spacing: .04em; transition: all .2s;
}
.login-box button:hover { background: var(--navy2); }
.login-error { color: var(--danger); font-size: 12px; margin-top: 8px; min-height: 14px; }
.login-box .login-mode-toggle {
  width: auto; padding: 4px 8px; margin-top: 14px;
  background: none; color: var(--navy); font-size: 12px; font-weight: 400;
  text-decoration: underline; letter-spacing: normal;
}
.login-box .login-mode-toggle:hover { background: none; color: var(--navy2); }

/* ── アプリ全体 ── */
.app { max-width: 480px; margin: 0 auto; padding-bottom: 60px; }
.app-shell { display: flex; }
.main { flex: 1; min-width: 0; }

/* ── サイドバー（PC幅で常時表示。モバイルでは非表示） ── */
.sidebar { display: none; }

/* ── ヒーロー（紺の地に円グラフ） ── */
.hero {
  background: linear-gradient(165deg, var(--navy2) 0%, var(--navy) 65%, var(--navy-light) 100%);
  padding-bottom: 32px;
}
.header {
  padding: 16px 20px 4px;
  display: flex; justify-content: space-between; align-items: center;
}
.header h1 { font-size: 15px; margin: 0; color: var(--on-navy-dim); letter-spacing: .12em; font-weight: 700; }
.header-spacer { width: 28px; flex: none; }
.hamburger {
  background: none; border: none; color: var(--on-navy); font-size: 20px;
  cursor: pointer; padding: 4px 6px; line-height: 1; flex: none; width: 28px;
}

/* ── ドロワー（モバイル用の引き出しナビ） ── */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(26,27,48,.45);
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; height: 100%; width: 240px;
  background: linear-gradient(165deg, var(--navy2) 0%, var(--navy) 70%, var(--navy-light) 100%);
  z-index: 201; transform: translateX(-100%); transition: transform .25s ease;
  display: flex; flex-direction: column; box-shadow: 4px 0 24px rgba(0,0,0,.25);
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.drawer-logo { font-size: 16px; font-weight: 700; letter-spacing: .08em; color: var(--yellow); }
.drawer-close { background: none; border: none; color: var(--on-navy-dim); font-size: 16px; cursor: pointer; }
.drawer-nav { display: flex; flex-direction: column; padding: 10px; gap: 2px; }

/* ── ナビ項目（ドロワー／サイドバー共通） ── */
.nav-item {
  background: none; border: none; color: rgba(255,255,255,.8); padding: 13px 14px;
  border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font);
  font-size: 14px; text-align: left; font-weight: 500; transition: background .15s;
}
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.active { background: rgba(255,255,255,.14); color: var(--yellow); font-weight: 700; }
.nav-item.nav-logout-btn { color: #ff9b8a; margin-top: 12px; }

.pie-wrap { position: relative; display: flex; justify-content: center; padding: 8px 20px 0; }
#pie-chart { width: 100%; max-width: 300px; height: auto; display: block; }
.pie-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; max-width: 160px; pointer-events: none;
}
.pie-center-label {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--yellow); letter-spacing: .04em;
}
.rec-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--yellow); animation: rec-pulse 1.6s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.7); }
}
.pie-center-title {
  font-size: 21px; font-weight: 800; color: var(--on-navy); margin-top: 4px;
  line-height: 1.3; word-break: break-word;
}
.pie-center-elapsed {
  font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--on-navy);
  margin-top: 8px; letter-spacing: .02em;
}

/* ── 走るハムスター（現在時刻マーカー） ── */
.hamster {
  position: absolute; width: 36px; height: 19px; left: 50%; top: 0;
  pointer-events: none; animation: hamster-hop .32s ease-in-out infinite;
}
/* 画像は顔が左向きなので、進行方向の回転計算(app.js)の基準に合わせて反転させておく。
   走る足取りのごく小さな上下動＋伸縮だけを付ける（大きくすると跳ねてるように見えるので控えめに）。 */
.hamster-img {
  width: 100%; height: 100%; display: block; object-fit: contain;
  transform-origin: 50% 85%;
  animation: hamster-squash .32s ease-in-out infinite;
}
@keyframes hamster-hop {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -2px; }
}
@keyframes hamster-squash {
  0%, 100% { transform: scaleX(-1.03) scaleY(.97); }
  50% { transform: scaleX(-.98) scaleY(1.03); }
}

/* ── 本体（クリーム地、ヒーローに乗り上げる） ── */
.app-body {
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  margin-top: -22px;
  position: relative;
  padding: 22px 18px 18px;
  max-width: 420px; margin-left: auto; margin-right: auto;
}

/* ── 気分メモ ── */
.mood-bar { display: flex; gap: 8px; margin-bottom: 22px; }
.mood-bar input {
  flex: 1; min-width: 0; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 20px;
  font-size: 13px; font-family: var(--font); background: var(--surface); color: var(--text); outline: none;
}
.mood-bar input:focus { border-color: var(--navy); }
.mood-bar button {
  border: none; border-radius: 20px; padding: 0 18px; font-size: 13px; font-weight: 700;
  background: var(--surface2); color: var(--text2); cursor: pointer; font-family: var(--font);
}

/* ── 行動宣言バー ── */
.declare-bar {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px;
}
.declare-bar-title { font-size: 14px; font-weight: 800; color: var(--text); letter-spacing: .02em; }
.declare-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 2px; }
.declare-chip {
  border: none; border-radius: 18px; background: var(--surface2);
  padding: 6px 13px; font-size: 12.5px; font-weight: 700; cursor: pointer;
  font-family: var(--font); color: var(--text2); transition: all .15s;
}
.declare-chip.active { color: #fff; }
.declare-bar input {
  padding: 11px 13px; border: none; border-bottom: 1.5px solid var(--border); border-radius: 0;
  font-size: 13px; font-family: var(--font); background: transparent; color: var(--text); outline: none;
}
.declare-bar input:focus { border-bottom-color: var(--navy); }
.declare-row-desktop { display: flex; flex-direction: column; gap: 10px; }
.declare-actions { display: flex; gap: 8px; margin-top: 6px; }
.link-btn {
  background: none; border: none; color: var(--text3); font-size: 12px;
  font-family: var(--font); cursor: pointer; padding: 10px 4px 2px; align-self: center;
  text-decoration: underline; text-decoration-color: var(--border);
}
.btn-primary, .btn-secondary, .btn-danger {
  border: none; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px;
  font-weight: 700; cursor: pointer; font-family: var(--font); transition: all .2s;
}
.btn-primary { background: var(--navy); color: var(--yellow); flex: 1; letter-spacing: .03em; }
.btn-primary:hover { background: var(--navy2); }
.btn-secondary { background: var(--surface2); color: var(--text2); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: rgba(192,57,43,.1); color: var(--danger); }
.btn-danger:hover { background: rgba(192,57,43,.18); }

/* ── タブ ── */
/* ── タイムライン（コンパクトな一覧） ── */
.view-panel { margin-top: 4px; }
.timeline-list { border-top: 1px solid var(--border); }
.timeline-day-hdr {
  font-size: 11px; color: var(--text3); padding: 12px 2px 6px; font-weight: 700; letter-spacing: .04em;
}
.timeline-day-hdr:first-child { padding-top: 10px; }
.timeline-row {
  display: flex; align-items: flex-start; gap: 9px; padding: 8px 2px;
  border-bottom: 1px solid var(--surface2); cursor: pointer;
}
.timeline-row.has-note { flex-direction: column; align-items: stretch; gap: 3px; }
.timeline-row-main { display: flex; align-items: flex-start; gap: 9px; flex: 1; min-width: 0; width: 100%; }
.timeline-row-time {
  font-family: var(--mono); font-size: 10.5px; color: var(--text3); flex: none; width: 38px; padding-top: 2px;
}
.timeline-row-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-top: 5px; }
.timeline-row-label {
  flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; color: var(--text);
  white-space: normal; overflow-wrap: break-word; word-break: break-word;
}
.timeline-row-dur {
  font-family: var(--mono); font-size: 10.5px; color: var(--text3); flex: none; white-space: nowrap; padding-top: 2px;
}
.timeline-row-note {
  font-size: 11.5px; color: var(--text3); padding-left: 47px; white-space: normal;
}
.timeline-row-blank { opacity: .5; }
.timeline-row-blank .timeline-row-dot { background: var(--border); }
.timeline-row-blank .timeline-row-label { font-size: 12px; font-weight: 400; }

.timeline-row-mood-icon {
  font-family: Georgia, serif; font-size: 16px; color: var(--yellow2); flex: none; line-height: 1;
}
.timeline-row-mood-text { font-style: italic; font-weight: 400; color: var(--text2); }

/* ── カテゴリ設定 ── */
.category-list { display: flex; flex-direction: column; margin-bottom: 16px; border-top: 1px solid var(--border); }
.category-row {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 2px; border-bottom: 1px solid var(--surface2);
}
.category-row input {
  flex: 1; min-width: 0; border: none; border-bottom: 1px solid var(--border); border-radius: 0; padding: 5px 2px;
  font-size: 13px; font-family: var(--font); background: transparent; color: var(--text);
}
.category-row .cat-remove-btn {
  background: none; border: none; color: var(--danger); cursor: pointer; font-size: 12px;
  font-family: var(--font); font-weight: 600; flex: none; white-space: nowrap;
}
.cat-locked-mark { font-size: 13px; flex: none; opacity: .6; }
.cat-rename-input[readonly] { color: var(--text3); cursor: default; }
.cat-color-btn {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  cursor: pointer; padding: 0; flex: none;
}
.cat-reorder-col { display: flex; flex-direction: column; gap: 1px; flex: none; }
.cat-move-btn {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 9px; line-height: 1; padding: 2px 4px; font-family: var(--font);
}
.cat-move-btn:disabled { color: var(--surface2); cursor: default; }
.color-modal-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 12px 0 4px; }
.cat-swatch {
  width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent;
  cursor: pointer; padding: 0; margin: 0 auto;
}
.cat-swatch.selected { border-color: var(--navy); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--navy); }
.category-add-row { display: flex; gap: 8px; margin-top: 12px; }
.category-add-row input {
  flex: 1; padding: 10px 2px; border: none; border-bottom: 1.5px solid var(--border);
  font-family: var(--font); background: transparent; color: var(--text);
}
.category-add-row button {
  background: var(--navy); color: var(--yellow); border: none; border-radius: var(--radius-sm);
  padding: 10px 16px; cursor: pointer; font-family: var(--font); font-weight: 700;
}

/* ── 振り返りビュー ── */
.review-week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.review-nav-btn {
  background: var(--surface2); border: none; border-radius: 50%; width: 30px; height: 30px;
  font-size: 16px; color: var(--text2); cursor: pointer; line-height: 1;
}
.review-week-label { font-size: 12px; color: var(--text3); font-family: var(--mono); }

.review-cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.review-cal-dow-cell { text-align: center; font-size: 11px; color: var(--text3); font-weight: 700; }
.review-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 22px; }
.review-cal-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; padding: 6px 2px; border-radius: var(--radius-sm); transition: background .15s;
}
.review-cal-cell:hover { background: var(--surface2); }
.review-cal-cell.selected { background: var(--surface2); box-shadow: 0 0 0 2px var(--navy) inset; }
.review-cal-cell.outside { opacity: .35; }
.review-cal-daynum { font-size: 11px; color: var(--text3); }
.review-cal-cell.today .review-cal-daynum { color: var(--navy); font-weight: 700; }
.review-cal-cell.selected .review-cal-daynum { color: var(--navy); font-weight: 700; }
.review-cal-donut { width: 34px; height: 34px; }
.review-cal-donut svg { width: 100%; height: 100%; }

.review-day-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.review-day-label { font-size: 14px; font-weight: 800; color: var(--text); }
.review-day-label-group { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.review-day-weather { font-size: 12px; color: var(--text3); }
.review-day-weather-icon { font-size: 16px; vertical-align: middle; }
.review-day-donut-wrap { display: flex; justify-content: center; padding: 4px 0 10px; }
#review-day-donut { width: 240px; height: 240px; }
.review-donut-arc { cursor: pointer; }
.review-donut-arc.blank { cursor: default; }
.review-donut-tick { font-family: var(--mono); font-size: 10px; fill: var(--text3); }
.review-donut-mood { cursor: pointer; }

#review-day-list.timeline-list { margin-top: 14px; }

.review-tooltip {
  position: fixed; z-index: 500; display: none; max-width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 12px; line-height: 1.6; color: var(--text);
  box-shadow: 0 4px 16px rgba(43,48,112,.18); pointer-events: none;
}
.review-tooltip.show { display: block; }
.review-tooltip-time { font-family: var(--mono); font-size: 11px; color: var(--text3); margin-bottom: 2px; }
.review-tooltip-title { font-weight: 700; margin-bottom: 2px; }
.review-tooltip-note { color: var(--text2); white-space: pre-wrap; word-break: break-word; }

.settings-section-title {
  font-size: 13px; font-weight: 700; color: var(--navy); margin: 24px 0 8px;
  letter-spacing: .03em;
}
.settings-section-title:first-child { margin-top: 0; }
.settings-desc { font-size: 12px; color: var(--text3); margin: 0 0 10px; line-height: 1.6; }
.cal-url-row { display: flex; gap: 8px; margin-bottom: 4px; }
.cal-url-row input {
  flex: 1; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 11px; background: var(--surface2); color: var(--text2);
}

/* ── 編集モーダル ── */
.modal {
  position: fixed; inset: 0; background: rgba(26,27,48,.5);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-box {
  background: var(--surface); border-radius: var(--radius); padding: 22px; width: 320px;
  display: flex; flex-direction: column; gap: 6px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.modal-box h2 { font-size: 16px; margin: 0 0 8px; color: var(--navy); }
.modal-box label { font-size: 11px; color: var(--text3); margin-top: 8px; letter-spacing: .03em; }
.modal-box input, .modal-box select {
  padding: 9px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: var(--font); background: var(--bg); color: var(--text);
}
.modal-actions { display: flex; justify-content: space-between; margin-top: 16px; }
.modal-actions-right { display: flex; gap: 8px; }

/* ── 中間幅〜PC幅：浮いたカードとして表示する（隙間なく繋がるよう600pxから適用） ── */
@media (min-width: 600px) {
  body {
    background: var(--navy2); min-height: 100%;
    display: flex; justify-content: center; align-items: flex-start;
    padding: 28px 20px;
  }
  .app {
    max-width: 560px; margin: 0; border-radius: var(--radius); overflow: hidden;
    box-shadow: 0 24px 70px rgba(0,0,0,.35);
  }
  .view-panel { max-width: 480px; margin: 0 auto; }
  .declare-row-desktop { flex-direction: row; align-items: flex-end; min-width: 0; }
  .declare-row-desktop .declare-label-input { flex: 1; min-width: 0; }
  .declare-actions { margin-top: 0; }
}

/* ── PC幅：浮いたカードはやめて、サイドバー＋メインが画面いっぱいに広がる
      ふつうのデスクトップアプリの形にする。サイドバーは画面に張り付く(sticky)。 ── */
@media (min-width: 900px) {
  body {
    background: var(--bg); display: block; padding: 0; align-items: initial;
  }
  .app { max-width: none; border-radius: 0; overflow: visible; box-shadow: none; }
  .app-shell { align-items: flex-start; }
  .sidebar {
    display: flex; flex-direction: column; width: 220px; flex: none;
    background: linear-gradient(165deg, var(--navy2) 0%, var(--navy) 70%, var(--navy-light) 100%);
    padding: 22px 14px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
  }
  .sidebar-logo { font-size: 16px; font-weight: 700; letter-spacing: .08em; color: var(--yellow); padding: 0 10px 22px; }
  .sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
  .sidebar > .nav-logout-btn { margin-top: auto; }
  .hamburger { display: none; }
  .header { justify-content: center; padding: 22px 20px 4px; }
  .header h1 { font-size: 16px; }
  .header-spacer { display: none; }
  .app-body { max-width: none; padding: 28px 40px; }
  .pie-wrap { padding-top: 12px; }
  #pie-chart { max-width: 360px; }
  .view-panel { max-width: 720px; }
}

/* ── 写真タイムライン行（photo_sync.pyが同期した写真。無いユーザーには描画されない）── */
.timeline-row-photo { align-items: flex-start; }
.timeline-photo-thumb {
  height: 72px;
  max-width: 200px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

/* 写真の拡大表示オーバーレイ（PWAでも戻れる形） */
#photo-lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center; flex-direction: column;
  background: rgba(0,0,0,.82);
  cursor: pointer;
}
#photo-lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 12px; }
.photo-lightbox-hint { color: #fff; opacity: .7; margin-top: 10px; font-size: 13px; }


/* 表紙選択の☆ボタン */
.cover-btn {
  margin-left: auto; flex-shrink: 0;
  border: none; background: none; cursor: pointer;
  font-size: 16px; color: #b8a860; opacity: .55; padding: 2px 6px;
}
.cover-btn.active { opacity: 1; color: #e0a800; }
.timeline-row-photo .cover-btn { align-self: center; }
.review-cover-mini {
  height: 22px; width: 22px; object-fit: cover;
  border-radius: 5px; vertical-align: middle; margin-left: 6px;
}
.review-cover-mini-text { font-size: 12px; color: #b8a860; margin-left: 6px; }


/* 思い出プリントへのリンク */
.review-print-link {
  margin-left: 10px; font-size: 12px; text-decoration: none;
  color: var(--text, #333); opacity: .75;
  padding: 4px 10px; border-radius: 8px; border: 1px solid rgba(0,0,0,.15);
  white-space: nowrap;
}
.review-print-link:hover { opacity: 1; }


/* ヘルスケア1行表示（healthlog連携ユーザーのみ） */
.review-day-health {
  display: block; font-size: 12px; color: #7a7458; margin-top: 2px;
}


/* ════════════ スクラップブック風リデザイン（2026-08-24、Claude Designのリオ案を移植） ════════════ */

/* 方眼紙（クラフト紙のドット地）——振り返りの詳細エリア */
.review-day-detail {
  background-image: radial-gradient(rgba(184,164,120,.3) 1px, transparent 1.4px);
  background-size: 16px 16px;
  padding: 18px 4px 8px;
  border-radius: 12px;
}

/* 紙カード＋マステ */
.tt-paper {
  background: #fff; border-radius: 6px;
  box-shadow: 0 10px 24px rgba(28,35,64,.12);
  padding: 30px 16px 18px; position: relative; margin-bottom: 16px;
}
.tt-paper-list { padding-top: 16px; }
.tt-tape {
  position: absolute; top: -9px; left: 50%; width: 110px; height: 24px;
  transform: translateX(-50%) rotate(-2deg);
  box-shadow: 0 2px 4px rgba(28,35,64,.08);
}
.tt-tape-blue { background: var(--tape-blue); }

.tt-paper-head { display: flex; align-items: baseline; gap: 10px; font-family: var(--maru); flex-wrap: wrap; }
.review-day-label { font-family: var(--maru); font-size: 20px; font-weight: 900; color: var(--text); }
.review-day-weather { font-size: 11px; font-weight: 700; color: var(--text3); }
.tt-csv-btn { margin-left: auto; font-size: 10px; opacity: .5; }

/* 体調チップ（点線の枠） */
.tt-health-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.tt-chip { border: 1.5px dashed var(--tan-dark); border-radius: 12px; padding: 7px 2px; text-align: center; }
.tt-chip-label { font-size: 9px; font-weight: 700; color: var(--text3); }
.tt-chip-val { font-size: 13px; font-weight: 900; font-family: var(--maru); color: var(--text); }

/* きょうの表紙（ポラロイド） */
.tt-cover-polaroid {
  width: 76%; max-width: 300px; margin: 20px auto 4px; background: #fff;
  padding: 8px 8px 26px; border: 1px solid var(--paper-border);
  box-shadow: 0 10px 20px rgba(28,35,64,.22);
  transform: rotate(-2deg); position: relative;
}
.tt-cover-polaroid::after {
  content: ''; position: absolute; top: -10px; right: 18px;
  width: 64px; height: 18px; background: var(--tape-pink); transform: rotate(3deg);
}
.tt-cover-img { width: 100%; height: 190px; object-fit: cover; display: block; }
.tt-cover-caption {
  text-align: center; font-family: var(--maru); font-weight: 700;
  font-size: 12px; color: var(--text3); margin-top: 7px;
}
.tt-cover-blockbox {
  min-height: 150px; display: flex; flex-direction: column; gap: 8px;
  align-items: center; justify-content: center; padding: 14px; text-align: center;
}
.tt-cover-chip {
  font-family: var(--maru); font-weight: 900; font-size: 11px; color: #fff;
  border-radius: 999px; padding: 2px 12px;
}
.tt-cover-blockname { font-family: var(--maru); font-weight: 900; font-size: 17px; line-height: 1.5; color: var(--text); }
.tt-cover-blocktime {
  font-family: var(--maru); font-weight: 700; font-size: 11px; color: var(--text2);
  background: rgba(255,255,255,.7); border-radius: 999px; padding: 2px 10px;
}
.tt-cover-memobox {
  min-height: 150px; background: var(--yellow-light);
  display: flex; align-items: center; justify-content: center;
  padding: 18px; position: relative; text-align: center;
}
.tt-cover-memobox::before, .tt-cover-memobox::after {
  font-family: var(--maru); font-weight: 900; font-size: 28px; color: #d97fa0; position: absolute;
}
.tt-cover-memobox::before { content: '「'; top: 2px; left: 8px; }
.tt-cover-memobox::after { content: '」'; bottom: 0; right: 8px; }
.tt-cover-memotext { font-family: var(--maru); font-weight: 900; font-size: 14px; line-height: 1.9; color: var(--text); }
.tt-cover-empty {
  width: 76%; max-width: 300px; margin: 20px auto 4px;
  border: 2px dashed #d8c9a2; border-radius: 10px; padding: 26px 12px;
  text-align: center; font-family: var(--maru); font-size: 12px; font-weight: 700;
  color: #a3947a; line-height: 1.7;
}

/* ドーナツ＋凡例 */
.tt-donut-row { display: flex; align-items: center; gap: 14px; margin: 18px 4px 4px; }
.tt-donut-row #review-day-donut { width: 130px; height: 130px; flex: 0 0 auto; }
.tt-legend { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.tt-legend-row { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--text); }
.tt-legend-sw { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.tt-legend-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-legend-time { color: var(--text3); font-family: var(--maru); }

/* タイムライン（紙カード内） */
.tt-list-title {
  font-family: var(--maru); font-weight: 900; font-size: 13px;
  color: var(--text3); text-align: center; margin-bottom: 12px;
}
.tt-list { display: flex; flex-direction: column; gap: 11px; }
.tt-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.tt-row-time { width: 40px; flex: 0 0 auto; font-family: var(--maru); font-weight: 700; font-size: 11px; color: var(--text3); }
.tt-row-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.tt-row-name { flex: 1; font-size: 13px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-row-dur { font-size: 11px; font-weight: 700; color: var(--tan); flex: 0 0 auto; }
.tt-row-note { margin: -6px 0 0 58px; font-size: 11px; color: var(--text2); }
.tt-row-blank .tt-row-dot { background: none; border: 1.5px dashed var(--tan-dark); }
.tt-row-blank .tt-row-name { color: var(--text3); font-weight: 400; }

/* 気分メモ＝黄色い付箋 */
.tt-memo {
  margin-left: 48px; background: var(--yellow-light); padding: 10px 12px;
  transform: rotate(-1deg); box-shadow: 0 4px 10px rgba(28,35,64,.1);
  display: flex; gap: 8px; align-items: flex-start; position: relative;
}
.tt-memo::before {
  content: ''; position: absolute; top: -7px; left: 22px;
  width: 44px; height: 14px; background: rgba(243,207,226,.7); transform: rotate(-2deg);
}
.tt-memo-text { flex: 1; font-family: var(--maru); font-size: 12px; font-weight: 700; line-height: 1.7; }

/* 写真の束 */
.tt-photos { margin-left: 48px; }
.tt-photos-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 7px;
  font-family: var(--maru); font-size: 11px; font-weight: 700; color: var(--text3);
}
.tt-photos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 6px; }
.tt-polaroid {
  background: #fff; padding: 6px 6px 16px; border: 1px solid var(--paper-border);
  box-shadow: 0 6px 14px rgba(28,35,64,.15); position: relative;
}
.tt-polaroid img { width: 100%; height: 126px; object-fit: cover; display: block; cursor: pointer; }
@media (min-width: 700px) {
  .tt-photos-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .tt-polaroid img { height: 135px; }
}

/* ☆／表紙バッジ */
@keyframes ttpop { 0%{transform:scale(.4) rotate(-18deg);opacity:0} 60%{transform:scale(1.25) rotate(6deg);opacity:1} 100%{transform:scale(1) rotate(-8deg);opacity:1} }
.cover-btn {
  flex: 0 0 auto; width: 28px; height: 28px; background: #fff;
  border: 1.5px dashed var(--tan-dark); border-radius: 50%;
  color: var(--tan); font-size: 13px; margin: 0; padding: 0; opacity: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.cover-btn.active {
  width: 34px; height: 34px; border: 2px solid var(--red); color: var(--red);
  font-family: var(--maru); font-weight: 900; font-size: 10px;
  transform: rotate(-8deg); animation: ttpop .35s ease;
}
.tt-polaroid .cover-btn { position: absolute; top: -9px; right: -9px; box-shadow: 0 3px 8px rgba(28,35,64,.2); z-index: 3; }

/* 思い出プリントボタン（赤・傾き） */
.tt-print-row { display: flex; justify-content: center; margin: 20px 0 8px; }
.tt-print-btn {
  background: var(--red); color: #fff; font-weight: 900; font-size: 14px;
  padding: 11px 24px; border-radius: 10px; transform: rotate(-2deg);
  box-shadow: 0 5px 0 rgba(0,0,0,.18); cursor: pointer;
  font-family: var(--maru); text-decoration: none;
}
.tt-print-btn:hover { color: #fff; filter: brightness(1.08); }

/* 週ストリップの見た目調整 */
.review-week-label { font-family: var(--maru); font-weight: 900; font-size: 13px; color: var(--text); }
.review-cal-cell.selected { background: #fff; box-shadow: 0 0 0 2px var(--navy) inset; border-radius: 12px; }
.review-cal-daynum { font-family: var(--maru); font-weight: 900; }


/* ── 振り返りビューのレイアウト（デザイン2a/2b準拠） ── */
/* 振り返り中は記録用ヒーロー（現在の行動の大円）を出さない */
body.review-active .hero .pie-wrap { display: none; }
body.review-active .hero { padding: 8px 0 34px; min-height: 0; }

/* 週タブ（曜日＋日付＋ミニドーナツ） */
.review-cal-grid { display: flex; gap: 5px; margin-bottom: 18px; }
.review-cal-cell {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 2px; border-radius: 14px; cursor: pointer; background: rgba(28,35,64,.04);
}
.review-cal-cell:hover { background: rgba(28,35,64,.08); }
.review-cal-cell.selected { background: #fff; box-shadow: 0 0 0 2px var(--navy) inset; }
.review-cal-cell.outside { opacity: .4; }
.review-cal-downame { font-size: 9px; font-weight: 700; color: var(--text3); font-family: var(--maru); }
.review-cal-donut { width: 32px; height: 32px; }

/* PC：左＝手帳ページ／右＝タイムラインの見開き */
@media (min-width: 900px) {
  body.review-active #view-review.view-panel { max-width: 1060px; }
  .review-day-detail {
    display: grid; grid-template-columns: 360px minmax(0, 1fr);
    gap: 18px; align-items: start; padding: 18px 12px 8px;
  }
  .tt-paper { margin-bottom: 0; }
  .tt-paper-list { min-height: 200px; }
  .tt-print-row { grid-column: 1 / -1; }
  .review-week-nav { max-width: 1060px; }
}


/* ── デザイン2b合わせの調整（2026-08-24 リオの指摘：バランス） ── */
.sidebar-sub { display: block; font-size: 10px; font-weight: 700; opacity: .6; margin-top: 2px; letter-spacing: .05em; }

/* 週タブはコンパクトに（引き伸ばさない） */
.review-cal-grid { display: flex; gap: 6px; margin-bottom: 18px; justify-content: center; flex-wrap: nowrap; }
.review-cal-cell { flex: 0 0 62px; }
.review-cal-donut { width: 34px; height: 34px; }

/* 週ナビ：ラベルは丸文字で大きく、矢印は丸ボタン */
.review-week-nav { display: flex; align-items: center; gap: 14px; justify-content: center; margin-bottom: 12px; }
.review-week-label { font-family: var(--maru); font-weight: 900; font-size: 16px; }
.review-nav-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--border);
  background: #fff; color: var(--text); font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* プリントボタン：PCは右上、モバイルは一番下 */
.tt-print-top { display: none; font-size: 12px; padding: 8px 18px; }
@media (min-width: 900px) {
  .review-week-nav { justify-content: flex-start; }
  .review-week-label { font-size: 18px; }
  .tt-print-top { display: inline-block; margin-left: auto; }
  .tt-print-row { display: none; }
  .review-cal-grid { justify-content: flex-start; }
}


/* ── デザイン2b合わせ・第2ラウンド（並べ比較での指摘分） ── */
/* 週タブ：デザインどおり横幅いっぱいに7枚並べる */
.review-cal-grid { justify-content: stretch; }
.review-cal-cell {
  flex: 1 1 0; max-width: 150px;
  background: #fffdf4; border: 1.5px solid var(--paper-border); border-radius: 12px;
  padding: 12px 4px 10px; gap: 3px;
}
.review-cal-cell.selected { background: #fff; border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy) inset; }
.review-cal-downame { font-size: 10px; }
.review-cal-daynum { font-size: 14px; }

/* 表紙のブロックカード：点線枠のベージュ地 */
.tt-cover-blockbox {
  border: 2px dashed var(--tan-dark); background: #efe8d8; border-radius: 8px;
}

/* CSVは紙カードの右下に小さく */
.tt-paper-head { position: relative; }
.tt-csv-btn { position: absolute; right: 0; bottom: -18px; font-size: 10px; opacity: .4; }

/* PC：写真は横スクロールの帯（デザイン2b準拠）、スマホは2列グリッドのまま */
.tt-photos-scrollhint { display: none; opacity: .7; }
@media (min-width: 900px) {
  .tt-photos-scrollhint { display: inline; }
  .tt-photos-grid {
    display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 10px;
    grid-template-columns: none;
  }
  .tt-photos-grid .tt-polaroid { flex: 0 0 190px; }
  .tt-photos-grid .tt-polaroid img { height: 135px; }

  /* 全体の幅と余白 */
  body.review-active #view-review.view-panel { max-width: 1160px; margin: 0 auto; }
  .review-day-detail { grid-template-columns: 340px minmax(0, 1fr); }
  .review-week-nav { max-width: 1160px; }
}

/* 表紙ポラロイド内の写真：タイムライン用サムネの旧スタイル（max-width:200px・角丸・影）を打ち消して額縁に収める */
.tt-cover-polaroid img.tt-cover-img {
  width: 100%; max-width: none; height: 190px;
  object-fit: cover; display: block;
  border-radius: 0; box-shadow: none; margin: 0;
}


/* ── サイドバー：デザイン2b準拠 ── */
@media (min-width: 900px) {
  .sidebar { background: var(--navy); }
}
.sidebar .nav-item { color: rgba(255,243,214,.6); font-weight: 700; font-size: 13px; border: 1.5px solid transparent; }
.sidebar .nav-item:hover { background: rgba(255,243,214,.07); }
.sidebar .nav-item.active {
  background: rgba(242,217,138,.16); border: 1.5px solid var(--yellow);
  color: var(--yellow); font-weight: 900; border-radius: 10px;
}
.sidebar-month { margin-top: auto; font-size: 10px; font-weight: 700; opacity: .45; padding: 0 10px 8px; color: var(--on-navy); }
.sidebar > .nav-logout-btn { margin-top: 0; }

/* ── サイドバーのロゴ：デザイン2b準拠（ルビ無し・クリーム色・900） ── */
.sidebar-logo { color: var(--on-navy); font-size: 19px; font-weight: 900; letter-spacing: 1px; padding: 0 10px 18px; }
.sidebar-logo .brand-ruby { display: none; }
.sidebar-sub { font-size: 10px; font-weight: 700; opacity: .6; letter-spacing: .05em; margin-top: 2px; }

/* ── サイドバーを画面に固定（stickyが効かずスクロールで下が切れていた・2026-08-24リオの指摘） ── */
@media (min-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; z-index: 50; }
  .main { margin-left: 220px; }
}


/* ── CSVダウンロード：紙カード最下部の点線ピル（2026-08-24 リオの指定位置） ── */
.tt-csv-btn { display: none; }
.tt-csv-row { display: flex; justify-content: center; margin-top: 16px; }
.tt-csv-pill {
  font-family: var(--maru); font-weight: 700; font-size: 11px;
  color: var(--text3); background: none; cursor: pointer;
  border: 1.5px dashed var(--tan-dark); border-radius: 999px; padding: 6px 16px;
}
.tt-csv-pill:hover { color: var(--text); border-color: var(--tan); }
.photo-add-row { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 10px; }
.photo-add-status { font-size: 11px; color: var(--text3); }
#photo-add-btn:disabled { opacity: .5; cursor: wait; }


/* ════════════ 記録画面：デザイン3a/3c準拠（2026-08-24） ════════════ */

/* ヒーロー：回し車（小）＋進行中の行動を横並びに */
.pie-wrap {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 16px; padding: 12px 18px 16px; position: relative;
}
#pie-chart { width: 128px; max-width: 128px; height: 128px; flex: 0 0 auto; }
.pie-center {
  position: static; transform: none; text-align: left;
  display: flex; flex-direction: column; gap: 3px;
}
.pie-center-label { font-size: 11px; font-weight: 700; color: var(--yellow); font-family: var(--maru); justify-content: flex-start; }
.pie-center-title { font-size: 17px; font-weight: 900; font-family: var(--maru); color: var(--on-navy); }
.pie-center-elapsed { font-size: 11px; font-weight: 700; opacity: .7; color: var(--on-navy); font-family: var(--font); }
@media (min-width: 900px) {
  .pie-wrap { gap: 24px; padding: 18px 28px; }
  #pie-chart { width: 150px; max-width: 150px; height: 150px; }
  .pie-center-title { font-size: 22px; }
  .pie-center-label { font-size: 12px; }
  .pie-center-elapsed { font-size: 12px; }
  .header { display: none; }
}

/* 記録ビューの地：方眼ドット */
#view-record {
  background-image: radial-gradient(rgba(184,164,120,.3) 1px, transparent 1.4px);
  background-size: 16px 16px;
  padding: 18px 6px 8px; border-radius: 12px;
}

/* 気分メモ＝黄色い付箋（青マステ・点線下線の入力） */
.mood-bar {
  background: var(--yellow-light); padding: 12px; margin: 6px 2px 16px;
  transform: rotate(-.5deg); box-shadow: 0 6px 14px rgba(28,35,64,.12);
  position: relative; gap: 8px; align-items: center;
}
.mood-bar::before {
  content: ''; position: absolute; top: -8px; left: 24px;
  width: 52px; height: 16px; background: rgba(143,216,234,.6); transform: rotate(-2deg);
}
.mood-bar input {
  background: none; border: none; border-bottom: 1.5px dashed var(--tan-dark);
  border-radius: 0; padding: 6px 2px;
  font-family: var(--maru); font-size: 12px; font-weight: 700; color: var(--text);
}
.mood-bar input::placeholder { color: #a3947a; }
.mood-bar input:focus { border-bottom-color: var(--navy); outline: none; }
.mood-bar button {
  background: var(--navy); color: var(--on-navy); font-weight: 900; font-size: 12px;
  padding: 7px 16px; border-radius: 999px; border: none; cursor: pointer;
  font-family: var(--maru);
}

/* 行動宣言＝白い紙カード */
.declare-bar {
  background: #fff; border-radius: 6px; box-shadow: 0 10px 24px rgba(28,35,64,.12);
  padding: 16px 14px; border: none;
}
.declare-bar-title { font-family: var(--maru); font-weight: 900; font-size: 14px; }
.declare-bar input.declare-label-input {
  border: 1.5px dashed var(--tan-dark); border-radius: 10px; padding: 9px 10px;
  font-family: var(--maru); font-size: 12px; font-weight: 700; background: none;
}
.declare-bar input.declare-label-input::placeholder { color: #a3947a; }
.declare-bar input.declare-label-input:focus { border-color: var(--navy); outline: none; }
.declare-actions { justify-content: center; }
.declare-actions .btn-primary {
  flex: 0 0 auto; background: var(--red); color: #fff; font-weight: 900; font-size: 13px;
  padding: 10px 22px; border-radius: 10px; transform: rotate(-1deg);
  box-shadow: 0 4px 0 rgba(0,0,0,.16); font-family: var(--maru); letter-spacing: 0;
}
.declare-actions .btn-primary:hover { background: var(--red); filter: brightness(1.08); }
.declare-bar .link-btn {
  display: block; margin: 10px auto 0; font-family: var(--maru);
  font-size: 11px; font-weight: 700; color: var(--tan);
}

/* 今日のタイムライン紙カード（既存markupの旧クラスを新デザインに写像） */
.tt-paper-today { margin-top: 16px; }
.tt-paper-today .timeline-list { display: flex; flex-direction: column; gap: 11px; }
.tt-paper-today .timeline-day-hdr { font-family: var(--maru); font-size: 11px; font-weight: 700; color: var(--text3); }
.tt-paper-today .timeline-row {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: none; border: none; padding: 0; box-shadow: none;
}
.tt-paper-today .timeline-row-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.tt-paper-today .timeline-row-time { width: 40px; flex: 0 0 auto; font-family: var(--maru); font-weight: 700; font-size: 11px; color: var(--text3); }
.tt-paper-today .timeline-row-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.tt-paper-today .timeline-row-label { flex: 1; font-size: 13px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-paper-today .timeline-row-dur { font-size: 11px; font-weight: 700; color: var(--tan); flex: 0 0 auto; }
.tt-paper-today .timeline-row-note { margin: 2px 0 0 58px; font-size: 11px; color: var(--text2); }
.tt-paper-today .timeline-row-blank .timeline-row-dot { background: none; border: 1.5px dashed var(--tan-dark); }
.tt-paper-today .timeline-row-blank .timeline-row-label { color: var(--text3); font-weight: 400; }
.tt-paper-today .timeline-row-mood {
  margin-left: 48px; background: var(--yellow-light); padding: 9px 12px;
  transform: rotate(-1deg); box-shadow: 0 4px 10px rgba(28,35,64,.1);
}
.tt-paper-today .timeline-row-mood .timeline-row-time { display: none; }
.tt-paper-today .timeline-row-mood-icon { display: none; }
.tt-paper-today .timeline-row-mood-text { font-family: var(--maru); font-size: 12px; font-weight: 700; line-height: 1.7; }
.tt-paper-today .timeline-row-photo { margin-left: 48px; }
/* （写真の額縁は.tt-polaroid側が持つので、img自体は素のまま——二重枠になるため削除。2026-08-24） */

/* PC：左＝付箋＋宣言／右＝タイムラインの2カラム */
@media (min-width: 900px) {
  body:not(.review-active) #view-record.view-panel { max-width: 1160px; }
  #view-record {
    display: grid; grid-template-columns: 400px minmax(0, 1fr);
    gap: 18px; align-items: start; padding: 18px 12px 8px;
  }
  .record-top { min-width: 0; }
  .tt-paper-today { margin-top: 0; }
}


/* ── 記録画面：デザイン3aとの差分修正（2026-08-24第2ラウンド） ── */
/* チップ：シール風（丸文字・ピル） */
.declare-chip {
  font-family: var(--maru); font-weight: 700; font-size: 12px;
  border-radius: 999px; padding: 6px 14px; cursor: pointer;
}
.declare-chip.active { font-weight: 900; }

/* 行動名は全幅・ボタンはその下で中央（PCでも横に並べない） */
@media (min-width: 600px) {
  .declare-row-desktop { flex-direction: column; align-items: stretch; }
}

/* 今日のタイムライン：振り返りと同じ行スタイルを共用するため .tt-list 相当のギャップ */
.tt-paper-today .timeline-list { gap: 11px; }

/* ポラロイド額縁内のimgは素のまま（旧サムネの影・角丸を打ち消す） */
.tt-polaroid img.timeline-photo-thumb { box-shadow: none; border-radius: 0; max-width: none; }


/* ════════════ カテゴリ設定（3b）＋編集シート（4a/4b） ════════════ */
#view-settings {
  background-image: radial-gradient(rgba(184,164,120,.3) 1px, transparent 1.4px);
  background-size: 16px 16px;
  padding: 18px 6px 8px; border-radius: 12px; max-width: 640px;
}
.tt-settings-card { padding: 16px 14px; }
.tt-card-title { font-family: var(--maru); font-weight: 900; font-size: 14px; margin-bottom: 10px; color: var(--text); }
.tt-card-tape::before {
  content: ''; position: absolute; top: -8px; right: 20px;
  width: 52px; height: 16px; background: var(--tape-pink); transform: rotate(2deg);
}
.tt-settings-card .settings-desc { font-size: 11px; color: var(--text2); line-height: 1.7; margin: 0 0 10px; }

/* カテゴリ行 */
.category-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: 1px dashed #e8dbb8;
  background: none; border-radius: 0; margin: 0;
}
.cat-color-btn { width: 18px; height: 18px; border-radius: 6px; border: none; cursor: pointer; flex: 0 0 auto; }
.cat-rename-input {
  flex: 1; min-width: 0; border: none; background: none;
  font-family: var(--maru); font-size: 13px; font-weight: 700; color: var(--text);
  padding: 2px 4px;
}
.cat-rename-input:focus { outline: none; border-bottom: 1.5px dashed var(--navy); }
.cat-locked-pill {
  font-size: 10px; font-weight: 700; color: var(--tan);
  border: 1.5px dashed var(--tan-dark); border-radius: 999px; padding: 2px 9px;
  font-family: var(--maru); flex: 0 0 auto;
}
.cat-reorder-col { display: flex; flex-direction: column; gap: 1px; }
.cat-move-btn {
  border: none; background: none; color: var(--tan); font-size: 9px; font-weight: 900;
  cursor: pointer; padding: 0 4px; line-height: 1.2;
}
.cat-move-btn:disabled { opacity: .25; cursor: default; }
.category-row .cat-remove-btn {
  width: 26px; height: 26px; border: 1.5px dashed var(--tan-dark); border-radius: 50%;
  color: var(--tan); font-size: 11px; background: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.category-add-row { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.category-add-row input {
  flex: 1; border: 1.5px dashed var(--tan-dark); border-radius: 10px; padding: 9px 10px;
  font-family: var(--maru); font-size: 12px; font-weight: 700; background: none;
}
.category-add-row input::placeholder { color: #a3947a; }
.category-add-row button {
  background: var(--navy); color: var(--on-navy); font-weight: 900; font-size: 12px;
  padding: 9px 18px; border-radius: 999px; border: none; cursor: pointer; font-family: var(--maru);
}

/* 設定画面のボタン類：クリーム地×紺縁のピル */
.tt-settings-card .btn-secondary {
  background: var(--on-navy); border: 1.5px solid var(--navy); color: var(--navy);
  font-weight: 900; font-size: 11px; padding: 7px 14px; border-radius: 999px;
  font-family: var(--maru);
}
.tt-settings-card .cal-url-row input {
  border: 1.5px dashed var(--tan-dark); border-radius: 10px; background: none;
  font-size: 10px; color: #a3947a;
}

/* ── 編集シート ── */
.tt-edit-box { background: var(--bg); border-radius: 16px; padding: 12px; max-width: 420px; }
.tt-edit-paper {
  position: relative; background: #fff; padding: 26px 16px 18px;
  box-shadow: 0 8px 20px rgba(28,35,64,.1);
}
.tt-edit-title { font-family: var(--maru); font-weight: 900; font-size: 16px; text-align: center; margin: 0 0 14px; color: var(--text); }
.tt-edit-label {
  font-size: 10px; font-weight: 900; color: var(--tan); letter-spacing: 1px;
  margin: 14px 0 6px; font-family: var(--maru);
}
.tt-edit-label:first-of-type { margin-top: 0; }
.tt-edit-input {
  width: 100%; border: 1.5px dashed var(--tan-dark); border-radius: 10px; padding: 9px 12px;
  font-family: var(--maru); font-size: 13px; font-weight: 700; background: none; color: var(--text);
}
.tt-edit-input:focus { outline: none; border-color: var(--navy); }
.tt-edit-note-wrap {
  background: var(--yellow-light); padding: 4px 8px; transform: rotate(-.5deg);
  box-shadow: 0 4px 10px rgba(28,35,64,.1); position: relative;
}
.tt-edit-note-wrap::before {
  content: ''; position: absolute; top: -7px; left: 18px;
  width: 40px; height: 13px; background: rgba(243,207,226,.7); transform: rotate(-2deg);
}
.tt-edit-note {
  width: 100%; border: none; background: none;
  font-family: var(--maru); font-size: 12px; font-weight: 700; padding: 6px 4px; color: var(--text);
}
.tt-edit-note:focus { outline: none; }
.tt-edit-times { display: flex; align-items: center; gap: 10px; margin: 16px 0 18px; }
.tt-time-box {
  flex: 1; border: 1.5px dashed var(--tan-dark); border-radius: 12px; padding: 8px 10px; text-align: center;
}
.tt-time-cap { font-size: 9px; font-weight: 700; color: var(--text3); font-family: var(--maru); margin-bottom: 2px; }
.tt-time-box input {
  width: 100%; border: none; background: none; text-align: center;
  font-family: var(--maru); font-size: 14px; font-weight: 900; color: var(--text);
}
.tt-time-box input:focus { outline: none; }
.tt-time-arrow { font-size: 16px; font-weight: 900; color: var(--tan); flex: 0 0 auto; }
.tt-edit-actions { display: flex; align-items: center; gap: 10px; margin-top: 0; }
.tt-flex-spacer { flex: 1; }
.tt-del-link {
  border: none; background: none; font-size: 11px; font-weight: 900; color: var(--red);
  text-decoration: underline; cursor: pointer; font-family: var(--maru); padding: 4px;
}
.tt-pill-outline {
  border: 1.5px solid var(--navy); color: var(--navy); background: #fff;
  font-weight: 900; font-size: 12px; padding: 8px 16px; border-radius: 999px;
  cursor: pointer; font-family: var(--maru);
}
.tt-save-btn {
  background: var(--red); color: #fff; font-weight: 900; font-size: 13px;
  padding: 9px 20px; border-radius: 10px; transform: rotate(-1deg);
  box-shadow: 0 4px 0 rgba(0,0,0,.16); cursor: pointer; border: none; font-family: var(--maru);
}

/* ── 編集シート：旧 .modal-box input ルール（詳細度0,1,1）への上書き（2026-08-24、実測ではみ出し・塗りつぶしを確認して修正） ── */
.modal-box.tt-edit-box { width: min(420px, 92vw); padding: 12px; background: var(--bg); }
.modal-box.tt-edit-box input.tt-edit-input {
  background: none; border: 1.5px dashed var(--tan-dark); border-radius: 10px;
  padding: 9px 12px; width: 100%; box-sizing: border-box;
  font-family: var(--maru); font-size: 13px; font-weight: 700; color: var(--text);
}
.modal-box.tt-edit-box input.tt-edit-note {
  background: none; border: none; width: 100%; box-sizing: border-box;
  font-family: var(--maru); font-size: 12px; font-weight: 700; padding: 6px 4px;
}
.modal-box.tt-edit-box .tt-edit-times { min-width: 0; }
.modal-box.tt-edit-box .tt-time-box { min-width: 0; overflow: hidden; }
.modal-box.tt-edit-box .tt-time-box input {
  background: none; border: none; width: 100%; min-width: 0; box-sizing: border-box;
  text-align: center; font-family: var(--maru); font-size: 13px; font-weight: 900; color: var(--text);
  padding: 2px 0;
}

/* 設定画面はPCで中央寄せ（左に寄って右が間延びしていたのを修正） */
@media (min-width: 900px) {
  #view-settings { margin: 0 auto; }
}

/* カテゴリ名入力の旧下線を消す（通常時は線なし・編集フォーカス時のみ点線） */
.category-row .cat-rename-input { border: none; background: none; }
.category-row .cat-rename-input:focus { border-bottom: 1.5px dashed var(--navy); outline: none; }


/* ── 設定画面PC：左カテゴリ／右に連携・出力系の2カラム（デザイン準拠。2026-08-24リオの指摘で追加） ── */
@media (min-width: 900px) {
  #view-settings {
    max-width: 1000px; margin: 0 auto;
    display: grid; grid-template-columns: 440px minmax(0, 1fr);
    gap: 18px; align-items: start;
  }
  #view-settings .tt-settings-card { margin-bottom: 0; }
  #view-settings .tt-settings-card:nth-of-type(1) { grid-column: 1; grid-row: 1 / span 4; }
  #view-settings .tt-settings-card:nth-of-type(2) { grid-column: 2; }
  #view-settings .tt-settings-card:nth-of-type(3) { grid-column: 2; }
  #view-settings .tt-settings-card:nth-of-type(4) { grid-column: 2; }
  #view-settings .tt-settings-card:nth-of-type(5) { grid-column: 2; }
}
.weatherloc-results { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.weatherloc-results button {
  text-align: left; font-size: 12px; padding: 8px 12px; cursor: pointer;
  background: var(--bg); border: 1.5px dashed var(--tan-dark); border-radius: 10px; color: var(--text);
}
.weatherloc-results button:hover { border-color: var(--navy); }
.weatherloc-results .weatherloc-msg { font-size: 11px; color: var(--text3); }
.weatherloc-hint {
  font-size: 11px; color: var(--text3); background: none; cursor: pointer;
  border: none; text-decoration: underline; padding: 0;
}
.weatherloc-hint:hover { color: var(--text); }
#view-settings .cal-url-row { display: flex; gap: 8px; align-items: center; }
#view-settings .tt-settings-card .cal-url-row + button,
#ai-prompt-copy-btn { display: block; margin: 10px 0 0 auto; }


/* ════════════ スマホ対応（デザイン2a/3a/3b準拠・2026-08-24） ════════════ */

/* 上部バー：TimeTrail＋画面名＋日付（デザインの紺バー） */
.header {
  display: flex; align-items: baseline; gap: 8px;
  padding: 14px 18px 8px; justify-content: flex-start;
}
.header-brand { font-weight: 900; font-size: 16px; letter-spacing: 1px; color: var(--on-navy); }
.header-sub { font-size: 11px; font-weight: 700; opacity: .8; color: var(--on-navy); }
.header-date { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--yellow); }

/* 下部タブバー（モバイルのみ） */
.tabbar {
  display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--navy); align-items: center;
}
.tabbar-item {
  flex: 1; text-align: center; font-size: 11px; font-weight: 700;
  color: var(--on-navy-dim); background: none; border: none; cursor: pointer;
  padding: 14px 0; border-radius: 0; font-family: var(--font);
}
.tabbar-item:hover { background: none; }
.tabbar-item.active { color: var(--yellow); font-weight: 900; background: none; border: none; }
.app { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }

/* 設定・振り返りではヒーロー（回し車）を出さない */
body.settings-active .hero .pie-wrap { display: none; }
body.settings-active .hero { padding-bottom: 34px; min-height: 0; }

/* 設定画面のログアウト */
.tt-settings-logout { display: flex; justify-content: center; padding: 8px 0 4px; }
.tt-logout-link {
  background: none; border: none; color: var(--red); font-size: 12px; font-weight: 700;
  text-decoration: underline; cursor: pointer; font-family: var(--maru); padding: 8px;
}

/* PC：タブバー不要・上部バーはそもそも非表示・ログアウトカードはサイドバーがあるため隠す */
@media (min-width: 900px) {
  .tabbar { display: none; }
  .tt-settings-logout { display: none; }
  .app { padding-bottom: 60px; }
}


/* ── 写真の山（スマホの畳み表示・デザイン2a） ── */
.tt-photopile { position: relative; height: 206px; cursor: pointer; }
.tt-fan-polaroid {
  position: absolute; width: 46%;
  background: #fff; padding: 5px 5px 14px; border: 1px solid var(--paper-border);
  box-shadow: 0 8px 18px rgba(28,35,64,.22);
}
.tt-fan-polaroid img { width: 100%; height: 120px; object-fit: cover; display: block; }
.tt-pile-openbtn {
  position: absolute; right: 4px; bottom: 2px; z-index: 5;
  background: var(--navy); color: var(--on-navy); font-size: 10px; font-weight: 900;
  border-radius: 999px; padding: 4px 10px; font-family: var(--maru);
}
.tt-pile-coverbadge {
  position: absolute; top: -6px; right: 2px; z-index: 6;
  width: 36px; height: 36px; background: #fff; border: 2px solid var(--red);
  border-radius: 50%; color: var(--red); font-weight: 900; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-8deg); font-family: var(--maru);
  box-shadow: 0 3px 8px rgba(28,35,64,.25);
}
.tt-pile-foldbtn {
  margin-left: 8px; font-size: 10px; font-weight: 900; color: var(--navy);
  background: rgba(28,35,64,.07); border-radius: 999px; padding: 3px 10px;
  cursor: pointer; font-family: var(--maru);
}

/* ── 編集：スマホはボトムシート（デザイン4a） ── */
.tt-sheet-grip { display: none; }
.tt-row.editing {
  background: rgba(224,138,77,.16); border-radius: 10px;
  outline: 2px dashed rgba(28,35,64,.3); outline-offset: 2px;
}
@media (max-width: 899px) {
  #edit-modal.modal { align-items: flex-end; padding: 0; }
  .modal-box.tt-edit-box {
    width: 100%; max-width: none; border-radius: 26px 26px 0 0;
    padding: 10px 18px calc(22px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -12px 32px rgba(28,35,64,.3);
    max-height: 88vh; overflow-y: auto;
  }
  .tt-sheet-grip {
    display: block; width: 44px; height: 5px; border-radius: 999px;
    background: #d8c9a2; margin: 0 auto 10px;
  }
}


/* 「きょうへ」ジャンプ（週ナビ内） */
.review-today-btn {
  border: 1.5px dashed var(--tan-dark); background: #fff; color: var(--text2);
  font-family: var(--maru); font-weight: 900; font-size: 11px;
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.review-today-btn:hover { border-color: var(--tan); color: var(--text); }


/* 表紙ブロックカードのひとこと */
.tt-cover-blocknote {
  font-family: var(--maru); font-weight: 700; font-size: 12px; line-height: 1.6;
  color: var(--text2); max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
