/* 規約: 指で使う前提 (的 44px 以上) ・ 高コントラスト ・ 本文 16px 以上 */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* 隠しは何より強く効かせる (display を持つ class に負けない) */
[hidden] { display: none !important; }

body {
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 17px;
  background: #eef3f0;
  color: #14241d;
}

.view {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* 上の帯 */
.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1f6b4f;
  color: #fff;
  padding: max(env(safe-area-inset-top), 10px) 14px 10px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.bar h1 { font-size: 20px; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.btn-bar {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  font-size: 16px;
  font-family: inherit;
  border: 2px solid #fff;
  border-radius: 8px;
  background: transparent;
  color: #fff;
}
.btn-bar:active { background: rgba(255, 255, 255, 0.25); }
.btn-bar.dark { border-color: #1f6b4f; color: #1f6b4f; background: #fff; }
.btn-bar.dark:active { background: #dcebe4; }

/* 画面の中身 */
.pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px calc(20px + env(safe-area-inset-bottom));
}

/* 箱 */
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 1px solid #cfe0d7;
  border-radius: 12px;
}
.card-title { font-size: 17px; color: #1f6b4f; }
.sub { font-size: 15px; line-height: 1.5; color: #3d5a4d; }
.strong { font-weight: bold; color: #14241d; }
.lead { font-size: 15px; color: #3d5a4d; }

/* 主目標 */
.goal-card { border: 2px solid #1f6b4f; }
.goal-name { font-size: 21px; }
.track {
  height: 20px;
  background: #dcebe4;
  border-radius: 10px;
  overflow: hidden;
}
.fill {
  height: 100%;
  min-width: 0;
  background: #1f6b4f;
  border-radius: 10px;
}
.goal-figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; }
.big { font-size: 28px; font-weight: bold; color: #1f6b4f; }
.of { font-size: 16px; color: #3d5a4d; }
.pct { margin-left: auto; font-size: 20px; font-weight: bold; color: #1f6b4f; }
.goal-remain { font-size: 17px; font-weight: bold; }
.judge {
  padding: 10px;
  font-size: 16px;
  line-height: 1.5;
  background: #e6f1ec;
  border-radius: 8px;
}
.empty-card { align-items: flex-start; gap: 12px; }
.empty-card p { font-size: 16px; line-height: 1.6; }

/* 今月の数字 */
.figures { display: flex; gap: 8px; }
.figure { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.figure dt { font-size: 14px; color: #3d5a4d; }
.figure dd { font-size: 18px; font-weight: bold; }
.in { color: #1f6b4f; }
.out { color: #b3261e; }

/* 一覧 */
.list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.row, .row-static {
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-family: inherit;
  font-size: 16px;
  color: inherit;
  background: #fff;
  border: 1px solid #cfe0d7;
  border-radius: 10px;
}
.row:active { background: #dcebe4; }
.row-static { background: #f6faf8; }
.row-day { min-width: 44px; font-size: 14px; font-weight: bold; color: #3d5a4d; }
.row-name { flex: 1; font-size: 16px; line-height: 1.4; }
.row-sub { font-size: 15px; color: #3d5a4d; }
.row-amount { font-size: 17px; font-weight: bold; white-space: nowrap; }
.empty { padding: 32px 0; text-align: center; color: #3d5a4d; }

/* 目標 ・ 固定費の一枚 */
.goal-item { gap: 8px; }
.row-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-tool {
  min-height: 44px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: #1f6b4f;
  background: #fff;
  border: 2px solid #1f6b4f;
  border-radius: 8px;
}
.btn-tool:active { background: #dcebe4; }
.btn-tool.danger { color: #b3261e; border-color: #b3261e; }
.btn-tool.danger:active { background: #fbe9e7; }

/* 月送り */
.month-nav { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.month-name { flex: 1; text-align: center; font-size: 17px; }

/* 入れる欄 */
.field { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.field-col { display: flex; flex-direction: column; gap: 6px; font-size: 16px; }
.field input, .field select {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 17px;
  color: inherit;
  background: #fff;
  border: 2px solid #c3d6cc;
  border-radius: 8px;
}
.field input:focus, .field select:focus, .lines:focus {
  outline: 3px solid #1f6b4f;
  outline-offset: -3px;
}
.lines {
  width: 100%;
  padding: 10px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.6;
  color: inherit;
  background: #fff;
  border: 2px solid #c3d6cc;
  border-radius: 8px;
  resize: vertical;
}
.lines[readonly] { background: #f6faf8; }

/* 支出 / 収入の切り替え */
.seg { display: flex; gap: 0; }
.seg-btn {
  flex: 1;
  min-height: 48px;
  font-family: inherit;
  font-size: 17px;
  color: #1f6b4f;
  background: #fff;
  border: 2px solid #1f6b4f;
}
.seg-btn:first-child { border-radius: 8px 0 0 8px; }
.seg-btn:last-child { border-radius: 0 8px 8px 0; border-left-width: 0; }
.seg-btn[aria-pressed="true"] { background: #1f6b4f; color: #fff; font-weight: bold; }

/* ボタン */
.btn-main {
  min-height: 56px;
  font-size: 20px;
  font-family: inherit;
  font-weight: bold;
  background: #1f6b4f;
  color: #fff;
  border: none;
  border-radius: 8px;
}
.btn-main:active { background: #16513c; }
.btn-sub {
  min-height: 48px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: #14241d;
  border: 2px solid #c3d6cc;
  border-radius: 8px;
}
.btn-sub:active { background: #dcebe4; }
.btn-danger {
  min-height: 48px;
  font-size: 16px;
  font-family: inherit;
  background: transparent;
  color: #b3261e;
  border: 2px solid #b3261e;
  border-radius: 8px;
}
.btn-danger:active { background: #fbe9e7; }

/* 一言 */
.note {
  padding: 8px;
  text-align: center;
  font-weight: bold;
  color: #14402e;
  background: #d8ece1;
  border-radius: 8px;
}

/* 消す前の確かめ */
.confirm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 2px solid #b3261e;
  border-radius: 10px;
}
.confirm p { font-size: 15px; line-height: 1.5; }
