html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', 'Roboto', 'Hiragino Sans', 'Meiryo', sans-serif;
  /* background: #f6f8fa; */
  color: #222;
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  
  /* ▼▼▼ ここから追加 ▼▼▼ */
  background-image: url('img/background.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  /* ▲▲▲ ここまで追加 ▲▲▲ */
}

/* スマホ向け余白 */
main, .container {
  max-width: 500px;
  margin: 0 auto;
  padding: 0.5em 0.5em 0.5em 0.5em;
  /* ▼▼▼ 背景が少し透けるように変更 ▼▼▼ */
  background: rgba(255, 255, 255, 0.7); 
  border-radius: 18px;
  box-shadow: 0 2px 12px #0001;
}

/* 見出し */
h1, h2, h3 {
  font-weight: 700;
  margin: 1.2em 0 0.5em 0;
  color: #1848a0;
  letter-spacing: 0.02em;
}
h1 {
  font-size: 1.45em;
  text-align: center;
  margin-top: 1em;
}

/* テキスト入力やセレクト */
input[type="text"], input[type="email"], input[type="password"], input[type="month"], input[type="number"], textarea, select {
  width: 100%;
  font-size: 0.7em;
  padding: 0.8em;
  border: 1px solid #d3d7e3;
  border-radius: 10px;
  background: #fafbfc;
  margin-bottom: 1em;
  transition: border 0.2s;
  box-sizing: border-box;
}
input:focus, textarea:focus, select:focus {
  border: 1.5px solid #a6bbe5;
  outline: none;
}

/* ボタン */
button, input[type="submit"] {
  display: inline-block;
  font-size: 1em;
  padding: 0.3em 0.8em;
/*  background: linear-gradient(90deg, rgb(1, 135, 212),rgb(1, 135, 212)); */
  background: linear-gradient(90deg, rgb(28, 115, 222),rgb(28, 115, 222));
  color: rgb(255, 255, 255);
  /*font-weight: bold;*/
 /* border: none; */
  border-radius: 100px;  /* 角のまるみ*/
  border-color: rgba(223, 209, 190, 0.884);
  /*box-shadow: 0 1px 5px #0002;*/
  margin: 0.5em 0;
  transition: background 0.18s, box-shadow 0.18s;
  cursor: pointer;
  letter-spacing: 0.03em;
}

button:active, input[type="submit"]:active {
  background: #8aa2cd;
  box-shadow: none;
}

/* リストやカード */
.notice, .card, .list-item {
  background: #f6f8fa;
  border-radius: 12px;
  margin: 1.2em 0;
  padding: 1.2em;
  box-shadow: 0 2px 6px #0001;
  transition: box-shadow 0.18s;
}
.notice:hover, .card:hover, .list-item:hover {
  box-shadow: 0 3px 16px #3079ed20;
}
.notice strong {
  color: #1848a0;
  font-size: 1.05em;
}

/* ラベルや説明 */
label {
  font-weight: 500;
  margin-bottom: 0.3em;
  display: block;
  color: #204090;
}

/* チェックボックス */
input[type="checkbox"], input[type="radio"] {
  accent-color: #3079ed;
  width: 1.15em;
  height: 1.15em;
  margin-right: 0.4em;
  vertical-align: middle;
}

/* テーブル */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0 1.7em 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px #0001;
}
th, td {
  padding: 0.95em 0.6em;
  text-align: left;
  border-bottom: 1px solid #f0f2f7;
}
th {
  background: #f3f7fa;
  color: #1848a0;
  font-weight: 600;
  letter-spacing: 0.03em;
}
tr:last-child td {
  border-bottom: none;
}

/* グラフキャンバス */
canvas {
  max-width: 100%;
  margin: 1.2em 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 8px #0001;
}

/* モバイル対応 */
@media (max-width: 599px) {
  main, .container {
    max-width: 100vw;
    padding: 0.5em 0.2em 1em 0.2em;
    border-radius: 0;
    box-shadow: none;
  }
  h1 {
    font-size: 1.1em;
  }
}
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: #fff;
  border-top: 1.5px solid #e7eaf3;
  box-shadow: 0 -1px 8px #0001;
  display: flex;
  z-index: 100;
  justify-content: space-around;
}
.nav-btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: #204090;
  font-size: 0.93em;
  padding-top: 7px;
  transition: background 0.17s;
}
.nav-btn:active, .nav-btn.selected {
  background: #e8f0fd;
}
.nav-icon {
  font-size: 1.5em;
  display: block;
  line-height: 1;
}
.nav-label {
  display: block;
  margin-top: 2px;
  font-size: 0.83em;
  letter-spacing: 0.01em;
}

/* メインエリア下部の余白調整（被り防止） */
main, .container {
  padding-bottom: 90px !important;
}


#previewArea img {
  width: 100%;
  max-height: 350px;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 1em;
  box-shadow: 0 2px 12px #0001;
}


.top-bar {
  /* ▼▼▼ ここから変更・追加 ▼▼▼ */
  position: fixed; /* 要素を画面に固定する */
  top: 0;          /* 画面の上端に配置 */
  left: 0;         /* 画面の左端に配置 */
  width: 100%;     /* 幅を画面全体に広げる */
  /* ▲▲▲ ここまで変更・追加 ▲▲▲ */

  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  background: #2c3e50;
  color: #fff;
  padding: 0 1em;
  z-index: 10;
  box-sizing: border-box; /* paddingを含めて幅100%にするため追加 */
}

/* メインコンテンツエリア */
/* ▼▼▼ このセレクタをCSSに追加 ▼▼▼ */
main {
  padding-top: 54px; /* 固定ヘッダーの高さ分だけ上の余白を確保 */
  padding-left: 10px; /* 固定ヘッダーの高さ分だけ上の余白を確保 */
}
/* ▲▲▲ ここまで追加 ▲▲▲ */

.app-title {
  font-size: 1.2em;
  font-weight: bold;
}

/* ハンバーガーメニューのボタン */
.hamburger-btn { /* クラス名を実際のHTMLに合わせて修正 */
  background: none;
  border: 2px solid #3498db; /* 青色の枠線を追加 */
  color: #000000;
  font-size: 0.8em; /* テキストに合わせたフォントサイズ */
  font-weight: bold;
  cursor: pointer;
  outline: none;
  margin-left: auto;
  margin-right: 0.1em;
  padding: 0.4em 0.8em; /* 内側の余白を追加 */
  border-radius: 18px; /* 角を丸くする */
  transition: background-color 0.2s;
}

/* ドロップダウンメニュー */
.dropdown-menu {
  display: none;
  flex-direction: column;
  position: fixed; /* ヘッダーがfixedなので、こちらもfixedにすると安定する */
  top: 54px;
  right: 0;
  text-align: left;
/*  background: #7ca7d2; */
  background: #1C73DE;
  border-radius: 0 0 0.7em 0.7em;
  box-shadow: 0 4px 12px rgba(44, 62, 80, 0.13);
  min-width: 180px;
  overflow: hidden;
  border-top: 2px solid #63a4cf;
  z-index: 9; /* ヘッダーよりは手前、モーダルよりは奥 */
}
.dropdown-menu a {
  padding: 1em;
  text-decoration: none;
  color: white;
  border-bottom: 1px solid #eee;
  font-size: 1em;
  transition: background 0.16s;
  text-align: left;
}
.dropdown-menu a:last-child {
  border-bottom: none;
}
.dropdown-menu a:hover {
  background: #ffffff;
  color: black;
}

@media (max-width: 600px) {
  .dropdown-menu {
    min-width: 120px;
    font-size: 0.96em;
  }
  .top-bar {
    padding: 0 0.5em;
  }
}


/* dialog.css ログアウトで利用*/
.dialog-overlay {
  position: fixed;
  top:40%; left:5%;
/*  width: 100%; height: 100%; */
/*  background-color: rgba(0, 0, 0, 0.5); */
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.dialog-box {
  background-color: #fcf7f7;
  padding: 20px;
  border-radius: 28px; 
  border-color: black;
  width: 300px;
 /* max-width: 100%;*/
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); 
  text-align: center;
}

.dialog-message {
  margin-bottom: 20px;
  font-size: 16px;
}

.dialog-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.dialog-buttons button {
  padding: 6px 16px;
/*  border: none; */
  border-color: black;
  cursor: pointer;
  border-radius: 24px;
/*  background-color: #1976d2; */
  background:rgb(255, 255, 255);
  color: black;
  font-weight: bold;
}

.sub-buttons button {
  padding: 6px 16px;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  background-color: #1976d2;
  background:white;
  color: rgb(171, 64, 64);
  font-weight: bold;
}


/* ボタンの通常状態を「理想の状態」に設定 */
/* ボタンの通常状態（未確認） */
button#confirmBtn {
  /* ↓↓↓ 余白を調整 ↓↓↓ */
  padding: 2px; /* 内側の余白を8pxから4pxに縮小 */
  border-radius: 6px; /* 角の丸みを8pxから6pxに少し抑える */
  
  border: 1px solid #aaaaaa;
  background-color: #ffffff;
  background: #ffffff;
  cursor: pointer;
  color: #000000; 
  transition: all 0.2s ease-in-out;
}

button#confirmBtn .icon {
  /* ↓↓↓ アイコンサイズを調整 ↓↓↓ */
  width: 50px;  /* アイコンの幅を72pxから60pxに縮小 */
  height: auto;
  vertical-align: middle;
}

/* --- アイコンの表示切り替え部分 --- */
button#confirmBtn .icon-read {
  display: none;
}
button#confirmBtn .icon-unread {
  display: inline-block;
}
button#confirmBtn.is-read .icon-read {
  display: inline-block;
}
button#confirmBtn.is-read .icon-unread {
  display: none;
}

/* --- is-readクラスが付いた状態（確認済み）のスタイル --- */
button#confirmBtn.is-read {
  color: #1e88e5;
  border-color: #90caf9;
}
.button-container {
  display: flex;
  justify-content: flex-end; /* この値を flex-end に変更 */
}

/* --- ローディングオーバーレイ --- */
.loading-overlay {
  display: none; /* ★ 普段は隠しておく */
  position: fixed; /* 画面全体を覆う */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7); /* 半透明の白い背景 */
  backdrop-filter: blur(2px); /* 背景をぼかす (任意) */
  z-index: 9998; /* 他の要素より手前に */
  
  /* 中身を中央揃えにする (Flexbox) */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* くるくる回るスピナー本体 */
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3; /* 薄いグレーの円 */
  border-top: 5px solid #3498db; /* 青色の円弧 */
  border-radius: 50%;
  animation: spin 1s linear infinite; /* 1秒で1回転するアニメーション */
  margin-bottom: 1em;
}

/* 読み込み中テキスト */
.loading-overlay p {
  font-weight: bold;
  color: #333;
}

/* アニメーションの定義 */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- ボトムナビゲーション --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px; /* ボトムナビの高さ */
  background: #ffffff;
  border-top: 1px solid #e0e0e0;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-around;
  z-index: 100;
}

.nav-btn {
  flex: 1; /* 各ボタンの幅を均等に */
  display: flex;
  flex-direction: column; /* アイコンとラベルを縦に並べる */
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #757575; /* デフォルトのアイコンとテキストの色 */
  font-size: 0.8em;
  padding: 5px 0;
  transition: background-color 0.2s;
}

/* アイコン（SVG）のスタイル */
.nav-icon svg {
  width: 24px;  /* アイコンの幅 */
  height: 24px; /* アイコンの高さ */
}

.nav-label {
  display: block;
  margin-top: 2px;
}

/* 選択中のボタンスタイル */
.nav-btn.selected {
  color: #1e88e5; /* 選択中の色 (例: 青) */
}

/* (任意) タップ時のフィードバック */
.nav-btn:active {
  background-color: #f0f0f0;
}

.input-password-mask {
  /* Safari, Chrome (iOS/Mac) で文字を「●」にする */
  -webkit-text-security: disc; 
}
