/* 千里バロック合奏団 会計入力アプリ
   配色は団旗の4色（緑・青・赤・黄）を、温かみのあるクリーム地に合わせています。
   スマートフォンでの片手操作を前提に、タップ領域を大きめに取っています。 */

:root {
  --flag-green: #2f7d5b;
  --flag-blue:  #2a5fa5;
  --flag-red:   #c0463c;
  --flag-yellow:#e2a636;

  --bg:        #f7f1e6;
  --card:      #fffdf8;
  --ink:       #3b3229;
  --ink-soft:  #7a6e60;
  --line:      #e3d8c6;
  --warn-bg:   #fdf3dc;
  --warn-line: var(--flag-yellow);

  --radius: 14px;
  --gap: 18px;
}

* { box-sizing: border-box; }

/* display を指定した要素でも hidden 属性が確実に効くようにします */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 0 48px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
}

/* ヘッダー */
.app-header {
  padding: 20px 20px 16px;
  background: var(--card);
  border-bottom: 4px solid var(--flag-green);
  text-align: center;
}
.app-header h1 { margin: 0; font-size: 22px; letter-spacing: .06em; }
.app-header .sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }

.mock-banner {
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--warn-bg);
  border: 2px dashed var(--warn-line);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #8a6416;
}

main { max-width: 560px; margin: 0 auto; padding: 0 16px; }

.screen { padding-top: 24px; }

.lead { margin: 0 0 20px; color: var(--ink-soft); font-size: 15px; }
.counter { margin: 0 0 12px; font-size: 14px; color: var(--ink-soft); font-weight: 700; }

/* ボタン */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 60px;
  margin-bottom: 14px;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn-icon { font-size: 22px; }

.btn-primary   { background: var(--flag-green); color: #fff; }
.btn-secondary { background: var(--card); color: var(--flag-blue); border: 2px solid var(--flag-blue); }
.btn-quiet     { background: transparent; color: var(--ink-soft); min-height: 48px; font-size: 15px; font-weight: 400; text-decoration: underline; }
.btn[disabled] { opacity: .5; cursor: default; }

/* 進捗 */
.progress-area { margin-top: 24px; }
.progress-bar {
  height: 12px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--flag-blue);
  transition: width .25s ease;
}
.progress-text { margin: 10px 0 0; font-size: 15px; color: var(--ink-soft); text-align: center; }

/* サムネイル */
.thumb-button {
  display: block;
  width: 100%;
  padding: 0;
  margin-bottom: 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  cursor: zoom-in;
}
.thumb-button img {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  background: #efe7d8;
}
.thumb-hint {
  display: block;
  padding: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

.notice {
  margin: 0 0 18px;
  padding: 10px 14px;
  background: var(--warn-bg);
  border-left: 5px solid var(--warn-line);
  border-radius: 8px;
  font-size: 14px;
}

/* フォーム */
.field {
  margin-bottom: var(--gap);
  padding: 14px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}
/* AIの確信度が低い項目は黄色く目立たせます */
.field.uncertain {
  background: var(--warn-bg);
  border-color: var(--warn-line);
}

.field > label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 18px;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--flag-blue);
}

.help { margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); }

.radio-row { display: flex; gap: 10px; margin-bottom: 10px; }
.radio {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.radio input { width: 20px; height: 20px; accent-color: var(--flag-blue); }
.radio:has(input:checked) { border-color: var(--flag-blue); background: #eaf1fa; color: var(--flag-blue); }

.amount-row { display: flex; align-items: center; gap: 10px; }
.yen { font-size: 22px; font-weight: 700; color: var(--ink-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  padding: 8px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}
.chip.active { border-color: var(--flag-green); background: #e9f3ee; color: var(--flag-green); font-weight: 700; }

.error-text {
  margin: 0 0 14px;
  padding: 10px 14px;
  background: #fbeceb;
  border-left: 5px solid var(--flag-red);
  border-radius: 8px;
  color: var(--flag-red);
  font-size: 15px;
  font-weight: 700;
}

/* 完了画面 */
.done-mark {
  width: 76px;
  height: 76px;
  margin: 8px auto 16px;
  border-radius: 50%;
  background: var(--flag-green);
  color: #fff;
  font-size: 42px;
  line-height: 76px;
  text-align: center;
}
#screenDone h2 { margin: 0 0 8px; text-align: center; font-size: 21px; }
#screenDone .lead { text-align: center; }

.recent { margin-top: 32px; }
.recent h3 { margin: 0 0 10px; font-size: 15px; color: var(--ink-soft); }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li {
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--card);
  border: 2px solid var(--line);
  border-left-width: 6px;
  border-radius: 10px;
  font-size: 15px;
}
.recent-list li.income  { border-left-color: var(--flag-blue); }
.recent-list li.expense { border-left-color: var(--flag-red); }
.recent-list .r-main { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.recent-list .r-sub { font-size: 13px; color: var(--ink-soft); }
.recent-list .empty { color: var(--ink-soft); }

/* 拡大表示 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(30, 24, 18, .92);
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  font-size: 20px;
  cursor: pointer;
}
