/* ===== CSS変数 ===== */
:root {
  --primary: #FF6B6B;
  --primary-light: #FFE0E0;
  --secondary: #4ECDC4;
  --secondary-light: #E0F7F5;
  --accent: #FFE66D;
  --bg: #FFF9F0;
  --surface: #FFFFFF;
  --text: #333333;
  --text-light: #777777;
  --border: #E5E5E5;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 8px;
  --tab-h: 64px;

  /* 暖色5段階 */
  --heat0: #F5F5F5;
  --heat1: #FFDDC1;
  --heat2: #FFAA80;
  --heat3: #FF7750;
  --heat4: #FF4422;
  --heat5: #CC2200;
}

/* ===== リセット・ベース ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  overflow: hidden;
}
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ===== アプリコンテナ ===== */
#app {
  max-width: 600px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--surface);
  box-shadow: 0 0 30px rgba(0,0,0,0.1);
}

/* ===== ヘッダー ===== */
#app-header {
  background: var(--primary);
  color: #fff;
  padding: 14px 16px 10px;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  position: relative;
}
#app-header small {
  display: block;
  font-size: 12px;
  font-weight: normal;
  opacity: 0.85;
  margin-top: 2px;
}

/* ===== 復元バナー ===== */
#restore-banner {
  display: none;
  background: #FFF3CD;
  border-bottom: 2px solid #FFD700;
  padding: 10px 16px;
  font-size: 14px;
  text-align: center;
  flex-shrink: 0;
}
#restore-banner.show { display: flex; align-items: center; justify-content: center; gap: 8px; }
#restore-banner button {
  background: var(--primary);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
}

/* ===== メインコンテンツ ===== */
#main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

/* ===== タブ ===== */
#tabs {
  height: var(--tab-h);
  background: var(--surface);
  border-top: 2px solid var(--border);
  display: flex;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  color: var(--text-light);
  transition: color 0.2s;
  padding: 4px 0;
  min-height: 44px;
}
.tab-btn .tab-icon { font-size: 22px; line-height: 1; }
.tab-btn.active { color: var(--primary); font-weight: bold; }

/* ===== ページ ===== */
.page { display: none; padding: 16px; }
.page.active { display: block; }

/* ===== タイマーページ ===== */
#timer-status {
  text-align: center;
  margin-bottom: 16px;
}
#elapsed-display {
  font-size: 72px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
#elapsed-display.paused { color: var(--text-light); }

/* 科目チップ */
#subject-area { margin-bottom: 12px; }
#subject-area label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: var(--text-light);
  margin-bottom: 6px;
}
#subject-chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.subject-chip {
  padding: 8px 6px;
  border-radius: 20px;
  border: 2px solid var(--border);
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
  transition: all 0.15s;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
  word-break: break-word;
}
.subject-chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: bold;
}
#subject-custom {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
#subject-custom:focus { border-color: var(--primary); }
#subject-custom.active-custom { border-color: var(--primary); }

/* タイマーボタン */
#timer-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}
.btn-start {
  background: #22C55E;
  color: #fff;
  border-radius: 20px;
  font-size: 22px;
  font-weight: bold;
  padding: 16px 40px;
  min-height: 64px;
  box-shadow: 0 4px 16px rgba(34,197,94,0.3);
  transition: transform 0.1s, box-shadow 0.1s;
  width: 100%;
}
.btn-start:active { transform: scale(0.97); box-shadow: none; }
.btn-pause {
  background: var(--accent);
  color: #555;
  border-radius: 16px;
  font-size: 18px;
  font-weight: bold;
  padding: 14px 20px;
  min-height: 56px;
  flex: 1;
  box-shadow: 0 2px 8px rgba(255,230,109,0.4);
}
.btn-resume {
  background: #22C55E;
  color: #fff;
  border-radius: 16px;
  font-size: 18px;
  font-weight: bold;
  padding: 14px 20px;
  min-height: 56px;
  flex: 1;
  box-shadow: 0 2px 8px rgba(34,197,94,0.3);
}
.btn-stop {
  background: var(--primary);
  color: #fff;
  border-radius: 16px;
  font-size: 18px;
  font-weight: bold;
  padding: 14px 20px;
  min-height: 56px;
  flex: 1;
  box-shadow: 0 2px 8px rgba(255,107,107,0.3);
}

/* 手入力リンク */
#manual-link {
  text-align: center;
  margin-top: 8px;
}
#manual-link button {
  color: var(--text-light);
  font-size: 14px;
  text-decoration: underline;
  padding: 8px;
}

/* ===== カレンダーページ ===== */
#calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
#calendar-nav button {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 18px;
  font-weight: bold;
  min-height: 44px;
  min-width: 44px;
}
#calendar-month-label {
  font-size: 20px;
  font-weight: bold;
  color: var(--text);
}
#calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.cal-dow {
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: var(--text-light);
  padding: 4px 0;
}
.cal-dow:first-child { color: #E53E3E; }
.cal-dow:last-child { color: #3182CE; }
#calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-day {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s;
  padding: 2px;
  min-height: 44px;
}
.cal-day:active { transform: scale(0.93); }
.cal-day.empty { background: transparent; cursor: default; pointer-events: none; }
.cal-day .cal-date { font-size: 14px; font-weight: bold; line-height: 1.2; }
.cal-day .cal-min { font-size: 9px; color: #fff; line-height: 1.1; margin-top: 1px; max-width: 100%; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.cal-day.today .cal-date { text-decoration: underline; text-decoration-color: var(--primary); }
.cal-day.sun .cal-date { color: #E53E3E; }
.cal-day.sat .cal-date { color: #3182CE; }
.cal-day.heat0 { background: var(--heat0); }
.cal-day.heat1 { background: var(--heat1); }
.cal-day.heat2 { background: var(--heat2); }
.cal-day.heat3 { background: var(--heat3); }
.cal-day.heat4 { background: var(--heat4); }
.cal-day.heat5 { background: var(--heat5); }
.cal-day.heat1 .cal-date, .cal-day.heat2 .cal-date { color: #333; }
.cal-day.heat3 .cal-date, .cal-day.heat4 .cal-date, .cal-day.heat5 .cal-date { color: #fff; }
.cal-day.heat1 .cal-min, .cal-day.heat2 .cal-min { color: #555; }

/* 月合計 */
#calendar-summary {
  margin-top: 12px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  color: var(--primary);
  text-align: center;
  font-weight: bold;
}

/* ===== きろくページ ===== */
#record-date-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
#record-date-bar label { font-size: 13px; color: var(--text-light); white-space: nowrap; }
#record-date-input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 15px;
  outline: none;
}
#record-date-input:focus { border-color: var(--primary); }
#record-list { }
.record-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
}
.record-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.record-card-left { flex: 1; min-width: 0; }
.record-time { font-size: 13px; color: var(--text-light); margin-bottom: 3px; }
.record-subject { font-size: 17px; font-weight: bold; color: var(--text); }
.record-duration {
  font-size: 15px;
  font-weight: bold;
  color: var(--primary);
  white-space: nowrap;
}
.record-memo {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 6px;
  word-break: break-all;
}
.record-pause {
  font-size: 11px;
  color: var(--text-light);
  white-space: nowrap;
}
.record-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.record-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  justify-content: flex-end;
}
.btn-edit {
  background: var(--secondary-light);
  color: var(--secondary);
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 14px;
  min-height: 36px;
}
.btn-delete {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 14px;
  min-height: 36px;
}
#record-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-size: 16px;
}
#record-total {
  font-size: 14px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--primary-light);
  border-radius: 8px;
  text-align: center;
}

/* ===== せっていページ ===== */
.setting-section {
  margin-bottom: 20px;
}
.setting-section h3 {
  font-size: 15px;
  font-weight: bold;
  color: var(--text-light);
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--border);
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.setting-row input[type="text"] {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 15px;
  outline: none;
}
.setting-row input[type="text"]:focus { border-color: var(--primary); }
.btn-add {
  background: var(--secondary);
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 15px;
  min-height: 44px;
  font-weight: bold;
}
#preset-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
.preset-tag {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 16px;
  padding: 6px 6px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.preset-tag button {
  color: var(--primary);
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  padding: 0 2px;
}
.btn-action {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 15px;
  text-align: left;
  color: var(--text);
  margin-bottom: 8px;
  min-height: 50px;
}
.btn-action.danger { border-color: var(--primary); color: var(--primary); }
#storage-info {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 8px;
  padding: 8px;
  background: var(--bg);
  border-radius: 8px;
}
.notice-box {
  background: #FFF3CD;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #856404;
  line-height: 1.6;
}

/* ===== モーダル ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 16px 32px;
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 16px;
  text-align: center;
}
.modal-field { margin-bottom: 12px; }
.modal-field label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: var(--text-light);
  margin-bottom: 4px;
}
.modal-field input, .modal-field textarea, .modal-field select {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.modal-field input:focus, .modal-field textarea:focus { border-color: var(--primary); }
.modal-row { display: flex; gap: 8px; }
.modal-row .modal-field { flex: 1; }
.modal-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.btn-modal-primary {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border-radius: 14px;
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  min-height: 50px;
}
.btn-modal-secondary {
  flex: 1;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: 14px;
  padding: 14px;
  font-size: 16px;
  min-height: 50px;
}
.modal-error {
  color: var(--primary);
  font-size: 13px;
  margin-top: 4px;
  display: none;
}
.modal-error.show { display: block; }

/* 写真プレビューエリア */
.photo-area {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  margin-bottom: 12px;
}
.photo-area img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 10px;
  margin-bottom: 8px;
  display: block;
  margin: 0 auto 8px;
}
.btn-photo {
  background: var(--secondary-light);
  color: var(--secondary);
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: bold;
  min-height: 44px;
  display: inline-block;
}
#photo-input { display: none; }

/* 拡大モーダル */
#img-modal .modal-box {
  background: #000;
  border-radius: var(--radius);
  padding: 8px;
  text-align: center;
}
#img-modal-img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 10px;
}
#img-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#img-modal .modal-overlay { align-items: center; }

/* 確認モーダル */
#confirm-modal .modal-box {
  padding: 24px 20px 32px;
  border-radius: var(--radius);
}
#confirm-text { font-size: 16px; margin-bottom: 20px; text-align: center; line-height: 1.6; }

/* ===== トースト ===== */
#toast {
  position: fixed;
  bottom: calc(var(--tab-h) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: #fff;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90%;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== エクスポートプレビュー ===== */
#export-preview {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
  padding: 6px;
  background: var(--bg);
  border-radius: 6px;
}

/* ===== スクロールバー ===== */
#main-content::-webkit-scrollbar { width: 4px; }
#main-content::-webkit-scrollbar-track { background: transparent; }
#main-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ===== 共有ボタン（ヘッダー右上） ===== */
#btn-share-header {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
#btn-share-header:active { opacity: 0.7; }

/* ===== 共有モーダル ===== */
.share-qr-wrap {
  text-align: center;
  margin: 8px 0 4px;
}
.share-qr-label {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}
#share-url-field {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 10px;
  box-sizing: border-box;
}
#share-no-native {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 8px;
}
.share-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== 分析セクション ===== */
.analysis-section {
  margin-top: 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.analysis-section h3 {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-light);
  margin-bottom: 10px;
}
.analysis-section canvas {
  display: block;
  width: 100%;
}
#weekly-empty, #trend-empty {
  text-align: center;
  padding: 16px 0;
  font-size: 14px;
  color: var(--text-light);
}

/* ===== 推移グラフ トグル ===== */
.trend-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.trend-toggle button {
  flex: 1;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  font-size: 13px;
  font-weight: bold;
  color: var(--text-light);
  min-height: 36px;
}
.trend-toggle button.active {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}

/* ===== 目標パネル（タイマーページ） ===== */
#goal-panel {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
}
#goal-panel h4 {
  font-size: 13px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 8px;
}
.goal-item {
  margin-bottom: 8px;
}
.goal-item:last-child { margin-bottom: 0; }
.goal-label {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
}
.goal-bar {
  height: 12px;
  background: #F0E6D6;
  border-radius: 6px;
  overflow: hidden;
}
.goal-fill {
  height: 100%;
  /* クール系「がんばりちゅう」: mint⇄blue。両端mint一致でシームレス。 */
  background: linear-gradient(90deg, #4ECDC4, #6C8EFF, #4ECDC4, #6C8EFF, #4ECDC4);
  background-size: 200% 100%;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 0;
  /* 色だけが左→右に途切れず流れる(白いシマー等の別演出は付けない) */
  animation: goalFlow 3.5s linear infinite;
}
.goal-item.achieved .goal-fill {
  /* ウォーム系「ゆうやけ/ほのお」: coral→orange→yellow をタイル。 */
  background: linear-gradient(90deg, #FF6B6B, #FF9F68, #FFD93D, #FF6B6B, #FF9F68, #FFD93D, #FF6B6B);
  animation: goalFlow 3.5s linear infinite, goalPulse 0.5s ease-in-out;
  box-shadow: 0 1px 6px rgba(255,159,104,0.35);
}
.goal-item.achieved .goal-label { color: var(--primary); font-weight: bold; }
@keyframes goalFlow {
  0%   { background-position: 200% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes goalPulse {
  0%, 100% { transform: scaleY(1);   opacity: 1;   }
  50%       { transform: scaleY(1.2); opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) {
  .goal-fill          { animation: none; transition: none;
                        background: linear-gradient(90deg, #4ECDC4, #6C8EFF); background-size: 100% 100%; }
  .goal-item.achieved .goal-fill { animation: none;
                        background: linear-gradient(90deg, #FF6B6B, #FF9F68, #FFD93D); background-size: 100% 100%;
                        box-shadow: 0 1px 6px rgba(255,159,104,0.35); }
}

/* ===== 目標設定（せっていページ） ===== */
.goal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.goal-input-row label {
  font-size: 13px;
  color: var(--text-light);
  white-space: nowrap;
  min-width: 52px;
}
.goal-input-row input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 15px;
  outline: none;
}
.goal-input-row input:focus { border-color: var(--primary); }
.goal-input-row span {
  font-size: 13px;
  color: var(--text-light);
  white-space: nowrap;
}
.goal-save-note {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 8px;
}

/* ===== 言語切替セグメント ===== */
.lang-segment {
  display: flex;
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 8px;
}
.lang-segment button {
  flex: 1;
  padding: 10px;
  font-size: 15px;
  font-weight: bold;
  background: var(--bg);
  color: var(--text-light);
  border: none;
  border-radius: 0;
  min-height: 44px;
}
.lang-segment button.active {
  background: var(--primary);
  color: #fff;
}

/* ===== CSP対応: インライン style の外部化 ===== */
.u-hidden{display:none}
.u-subject-label{font-size:16px !important;color:var(--text-light) !important;margin-top:4px !important;min-height:22px !important;}
.u-cal-today{display:block;width:100% !important;background:var(--primary-light) !important;color:var(--primary) !important;border-radius:8px !important;padding:6px !important;font-size:13px !important;font-weight:bold !important;margin-bottom:10px !important;min-height:36px !important;}
.u-share-desc{font-size:13px !important;color:var(--text-light) !important;margin-bottom:8px !important;}
.u-save-preview{background:var(--bg) !important;border-radius:10px !important;padding:12px !important;margin-bottom:12px !important;font-size:14px !important;line-height:1.8 !important;}
.u-photo-remove{color:var(--primary) !important;font-size:13px !important;margin-top:4px !important;}
.u-photo-note{font-size:12px !important;color:var(--text-light) !important;margin-top:6px !important;}
.u-photo-disabled{font-size:12px !important;color:var(--text-light) !important;text-align:center !important;margin-bottom:8px !important;}
.u-manual-or{text-align:center !important;font-size:12px !important;color:var(--text-light) !important;margin-bottom:4px !important;}
.u-req{color:var(--primary) !important;}
.u-mt6{margin-top:6px !important;}
.u-ai-center{align-items:center !important;}
.u-img-box{background:#000 !important;border-radius:16px !important;padding:8px !important;text-align:center !important;max-width:95% !important;}
.u-img-close{display:block;margin:8px auto 0 !important;color:#fff !important;font-size:14px !important;}
.u-confirm-box{border-radius:var(--radius) !important;padding:24px 20px 28px !important;}
.u-bg-primary{background:var(--primary) !important;}
.u-share-modal-desc{font-size:14px !important;color:var(--text-light) !important;text-align:center !important;margin-bottom:8px !important;}
.u-col-end{display:flex;flex-direction:column !important;align-items:flex-end !important;gap:6px !important;}

/* ===== おうちの人とつなぐ(親子連携) ===== */
.sync-badge{background:var(--secondary-light);color:var(--text);border-radius:10px;padding:6px 10px;font-size:12px;margin-bottom:8px;}
.sync-linked-text{font-size:14px;font-weight:bold;color:var(--text);margin-bottom:4px;}
.sync-turnstile{display:flex;justify-content:center;}
.sync-error{color:var(--primary);font-size:12px;}
