/* ============================================
   リベシティ管理アプリ - スタイル（v2）
   ミニマル・やさしいUI
   ============================================ */

/* ============================================
   ロック画面
   ============================================ */
.lock-screen {
  position: fixed;
  inset: 0;
  background: var(--bg, #FAF6F2);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-screen.hidden { display: none; }

.lock-card {
  text-align: center;
  padding: 40px 32px;
  max-width: 320px;
  width: 90%;
}

.lock-lion {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 16px;
}

.lock-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #3A3028);
  margin-bottom: 6px;
}

.lock-desc {
  font-size: 13px;
  color: var(--text-light, #9A8E82);
  margin-bottom: 20px;
}

.lock-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border, #F0E8E0);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  text-align: center;
  background: white;
  box-sizing: border-box;
  margin-bottom: 12px;
}

.lock-input:focus {
  outline: none;
  border-color: var(--accent, #F08300);
}

.lock-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  border-radius: 12px;
}

.lock-error {
  color: var(--accent-heart, #E8636E);
  font-size: 13px;
  margin-top: 10px;
  min-height: 20px;
}

/* --- カラーパレット --- */
:root {
  --accent: #F08300;          /* オレンジ */
  --accent-heart: #E8636E;    /* コーラルレッド（ハート） */
  --bg: #FAF6F2;              /* 薄いベージュ背景 */
  --bg-card: #FFFFFF;
  --bg-greeting: #FCEEE8;     /* 挨拶カード背景 */
  --text: #3A3028;            /* 濃い茶グレー */
  --text-mid: #6B5E52;        /* 中間 */
  --text-light: #9A8E82;      /* 薄い */
  --text-on-white: #FFFFFF;
  --border: #F0E8E0;          /* ごく薄い線 */
  --nav-inactive: #B0A89E;
  --shadow: 0 2px 8px rgba(0,0,0,0.04);
  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-btn: 24px;
  --nav-height: 64px;
  --header-height: 52px;
  --side-margin: 16px;
}

/* --- hidden --- */
[hidden] { display: none !important; }

/* --- リセット --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Zen Maru Gothic', 'Hiragino Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ============================================
   ヘッダー
   ============================================ */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.app-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-title i { color: var(--accent-heart); }

/* ============================================
   メインコンテンツ
   ============================================ */
.app-main {
  padding-top: calc(var(--header-height) + 10px);
  padding-bottom: calc(var(--nav-height) + 16px);
  padding-left: var(--side-margin);
  padding-right: var(--side-margin);
  max-width: 640px;
  margin: 0 auto;
}

/* --- ページ切り替え --- */
.page { display: none; }
.page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- ページ見出し --- */
.page-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.page-header-row { margin-bottom: 16px; }
.page-header-row .page-heading { margin-bottom: 12px; }

/* ============================================
   挨拶カード（ライオン + メッセージ一体型）
   ============================================ */
#page-dashboard { display: none; }
#page-dashboard.active { display: block; }

.greeting-card {
  background: var(--bg-greeting);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lion-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  align-self: center;
}

.greeting-text { flex: 1; }

.greeting-body {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.5;
}

.greeting-count {
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
}

/* ============================================
   ダッシュボード セクション
   ============================================ */
.dash-section {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 10px;
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.dash-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-section-title i {
  color: var(--text-light);
  font-size: 15px;
}

.dash-section-more {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
}

/* 予定: 日付突合テーブル */
.schedule-compare { padding: 0 10px 4px; }

.schedule-compare-head {
  display: flex;
  align-items: stretch;
  border-bottom: 2px solid var(--border);
  min-height: 34px;
}
.schedule-compare-col-label {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  justify-content: center;
}
.schedule-compare-vsep {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
  align-self: stretch;
}

/* 日付ラベル行（全幅） */
.schedule-date-label {
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.schedule-compare-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  min-height: 38px;
}
.schedule-compare-row:last-child { border-bottom: none; }

.schedule-compare-cell {
  flex: 1;
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  padding: 0 4px;
}

.schedule-compare-cell-empty {
  color: var(--text-light);
  font-size: 12px;
}

.schedule-compare-sep {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  flex-shrink: 0;
}

.schedule-compare-empty {
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
  padding: 16px 0;
}

/* 区切り: 気になるオフ会ゾーン */
.schedule-zone-divider {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-light);
}
.schedule-zone-divider i { color: var(--accent-heart); font-size: 10px; }

/* 気になるオフ会リスト */
.schedule-interested-list { padding: 0 10px 4px; }

.schedule-interested-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.schedule-interested-item:last-child { border-bottom: none; }

.schedule-interested-date {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-light);
  width: 50px;
  flex-shrink: 0;
}

.schedule-interested-title {
  flex: 1;
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-interested-empty {
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
  padding: 12px 0;
}

.empty-state-inline {
  color: var(--nav-inactive);
  font-size: 12px;
}

/* ============================================
   タイムライン（X/Twitter風）
   ============================================ */
.timeline {
  display: flex;
  flex-direction: column;
}

.tl-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.tl-item:last-child { border-bottom: none; }

.tl-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-greeting);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

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

.tl-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.tl-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.tl-time {
  font-size: 11px;
  color: var(--text-light);
}

.tl-body {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
  word-break: break-word;
}

.tl-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: flex-end;
}

.tl-action-btn {
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-light);
  font-family: inherit;
  transition: all 0.2s;
}

.tl-action-btn:hover {
  background: #FFF8F0;
  color: var(--accent);
}

.tl-action-btn.delete:hover {
  background: #FFF0F0;
  color: #C06060;
}

/* お気に入りボタン */
.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 18px;
  color: var(--nav-inactive);
  border-radius: 8px;
  transition: color 0.2s, transform 0.15s;
  flex-shrink: 0;
  line-height: 1;
}
.fav-btn:hover { color: var(--accent-heart); transform: scale(1.15); }
.fav-btn.active { color: var(--accent-heart); }

/* TODO セクション内の追加ボタン（丸ボタン） */
.dash-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.dash-add-btn:hover { opacity: 0.85; }

/* TODOリスト */
.dash-todo .todo-list { list-style: none; padding: 0 16px; }
.dash-todo .todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid #EFEFED;
}
.dash-todo .todo-item:last-child { border-bottom: none; }
.dash-todo .todo-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
.dash-todo .todo-item .todo-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-todo .todo-item.done .todo-text {
  text-decoration: line-through;
  color: var(--text-light);
}
.dash-todo .todo-item .todo-delete {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.dash-todo .todo-item:hover .todo-delete { opacity: 1; }
.dash-todo .todo-item .todo-delete:hover { color: #C06060; }

/* TODO入力行 */
.todo-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.todo-input-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: var(--bg);
}
.todo-input-row input:focus { border-color: var(--accent); }
.todo-input-row button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ダッシュボード内のタイムライン（コンパクト行） */
.dash-timeline .tl-item {
  padding: 10px 16px;
  gap: 0;
  border-bottom: 1px solid #EFEFED;
}
.dash-timeline .tl-item:last-child { border-bottom: none; }
.dash-timeline .tl-avatar { display: none; }
.dash-timeline .tl-header { margin-bottom: 2px; gap: 6px; flex-wrap: nowrap; }
.dash-timeline .tl-name { font-size: 12px; white-space: nowrap; }
.dash-timeline .tl-time { font-size: 10px; white-space: nowrap; }
.dash-timeline .tl-body {
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dash-timeline .tl-actions { display: none; }

/* ============================================
   汎用カード（各ページ用）
   ============================================ */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.card-meta {
  font-size: 13px;
  color: var(--text-light);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.card-meta i {
  margin-right: 3px;
  color: var(--nav-inactive);
}

.card-memo {
  font-size: 14px;
  color: var(--text-mid);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}

.card-action-btn {
  background: none;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
  font-family: inherit;
}

.card-action-btn:hover {
  background: #FFF8F0;
  color: var(--accent);
}

.card-action-btn.delete:hover {
  background: #FFF0F0;
  color: #C06060;
}

/* ============================================
   バッジ（ステータス）
   ============================================ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
}

.badge-interested { background: #FCEEE8; color: #C06030; }
.badge-planned    { background: #E4F0F8; color: #306898; }
.badge-done       { background: #E4F4E4; color: #308030; }
.badge-skip,
.badge-cancelled  { background: #ECECEC; color: #888; }
.badge-reserved   { background: #E4F0F8; color: #306898; }
.badge-considering{ background: #F4F0DA; color: #807020; }
.badge-unread     { background: #FCEEE8; color: #C06030; }
.badge-reading    { background: #E4F0F8; color: #306898; }
.badge-read       { background: #E4F4E4; color: #308030; }
.badge-hold       { background: #ECECEC; color: #888; }

/* ============================================
   サブタブ
   ============================================ */
.sub-tab-bar {
  display: flex;
  gap: 8px;
}

.sub-tab {
  background: #F0EAE4;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}

.sub-tab.active {
  background: var(--accent);
  color: var(--text-on-white);
}

.subtab-content { display: none; }
.subtab-content.active { display: block; }

/* ============================================
   追加ボタン
   ============================================ */
.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--text-on-white);
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(240, 131, 0, 0.25);
}

.add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(240, 131, 0, 0.35);
}

/* ============================================
   検索バー
   ============================================ */
.search-bar {
  position: relative;
  margin-bottom: 16px;
}

.search-bar i {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--nav-inactive);
  font-size: 14px;
}

.search-bar input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--bg-card);
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input:focus { border-color: var(--accent); }
.search-bar input::placeholder { color: var(--nav-inactive); }

/* ============================================
   下部ナビゲーション
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 100;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--nav-inactive);
  font-family: inherit;
}

.nav-btn i { font-size: 22px; }
.nav-btn span { font-size: 10px; font-weight: 600; }

.nav-btn.active { color: var(--accent); }

/* ============================================
   モーダル
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58, 48, 40, 0.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 85dvh;
  overflow-y: auto;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
}

/* --- フォーム --- */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* --- ボタン --- */
.btn {
  padding: 10px 24px;
  border-radius: var(--radius-btn);
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-on-white);
}
.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  background: #F0EAE4;
  color: var(--text-light);
}
.btn-secondary:hover { background: var(--border); }

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ============================================
   ローディング
   ============================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250, 246, 242, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-mid);
  font-size: 14px;
}

.loading-spinner i {
  font-size: 28px;
  color: var(--accent);
}

/* ============================================
   トースト
   ============================================ */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  font-size: 14px;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
  white-space: nowrap;
}

.toast.error { border-left-color: var(--accent-heart); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* --- 空状態 --- */
.empty-state {
  text-align: center;
  color: var(--nav-inactive);
  font-size: 13px;
  padding: 12px 0;
}
.dash-card-body .empty-state {
  padding: 6px 0;
}

/* --- 確認ダイアログ --- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58, 48, 40, 0.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
  animation: fadeIn 0.2s ease;
}

.confirm-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 300px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.confirm-dialog p {
  margin-bottom: 20px;
  font-size: 15px;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ============================================
   URLから取得ボタン
   ============================================ */
.fetch-url-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fetch-url-row input {
  flex: 1;
}

.fetch-url-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.fetch-url-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fetch-url-status {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  min-height: 16px;
}

/* ============================================
   設定画面
   ============================================ */
.settings-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.settings-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.settings-desc {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 14px;
  line-height: 1.6;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-mid);
}

.settings-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}

.settings-input:focus {
  outline: none;
  border-color: var(--accent);
}

.settings-save-btn,
.settings-test-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
}

.settings-status {
  font-size: 13px;
  min-height: 20px;
}

.settings-status-success { color: #4CAF50; }
.settings-status-error   { color: var(--accent-heart); }
.settings-status-info    { color: var(--text-light); }

.settings-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.mode-local {
  background: #FFF3E0;
  color: #E65100;
}

.mode-gas {
  background: #E8F5E9;
  color: #2E7D32;
}

/* ============================================
   レスポンシブ（タブレット以上）
   ============================================ */
@media (min-width: 640px) {
  .modal {
    border-radius: var(--radius-lg);
    max-height: 80vh;
    margin-bottom: 10vh;
  }
  .modal-overlay { align-items: center; }
}
