/* 外部フォントを使わず、PCやスマートフォンにあるフォントを使います。 */
:root {
  color-scheme: light;
  --text: #314d47;
  --muted: #60756e;
  --green: #28745b;
}

* { box-sizing: border-box; }
/* hiddenが付いた画面は表示しません。 */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: #f7f9f2;
  color: var(--text);
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.6;
}

/* 画面が広いPCでも、スマートフォンに近い読みやすい幅にします。 */
.home { width: min(100%, 520px); margin: 0 auto; padding: 28px 20px 24px; }
.greeting { position: relative; padding: 0 52px 0 2px; margin-bottom: 24px; }
.greeting p { margin: 0 0 3px; color: var(--muted); font-size: 12px; }
.greeting h1 { margin: 0; font-size: 22px; letter-spacing: .03em; }
.app-mark { position: absolute; right: 4px; top: 0; color: #c5831d; font-size: 38px; }

.balance {
  position: relative;
  overflow: hidden;
  padding: 28px 20px;
  border: 1px solid #cfe6d5;
  border-radius: 26px;
  background: #e4f2df;
  text-align: center;
}
.balance h2 { position: relative; margin: 0; font-size: 21px; }
.balance-amount { position: relative; margin: 6px 0; font-size: 64px; font-weight: 700; line-height: 1.3; }
.balance-amount span { margin-left: 8px; font-size: 28px; }
.balance-amount #balance-value { margin-left: 0; font-size: inherit; }
.balance-amount .amount-number { margin-left: 0; font-size: inherit; }
.balance-note { position: relative; margin: 8px 0 0; font-size: 13px; }
.balance-decoration { position: absolute; right: 22px; top: 53px; color: #a9c99d; font-size: 34px; }

.chores { margin-top: 30px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h2 { margin: 0; font-size: 21px; }
.section-heading > span { padding: 3px 10px; border-radius: 20px; background: #e9eee3; color: var(--muted); font-size: 12px; }
.section-description { margin: 8px 0 18px; color: var(--muted); font-size: 12px; }
.chore-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.chore-card { display: flex; align-items: center; gap: 12px; padding: 16px 14px; border: 1px solid #e7ece3; border-radius: 18px; background: #fff; box-shadow: 0 3px 8px #314d4705; }
.chore-icon { display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; border-radius: 15px; font-size: 26px; }
.blue { background: #e9f3fb; }
.peach { background: #fff0e5; }
.lavender { background: #f0ecfa; }
.yellow { background: #fff6d9; }
.green { background: #eaf4e3; }
.chore-details { flex: 1; min-width: 0; }
/* 長い名前は折り返し、申請ボタンと重ならないようにします。 */
.chore-details h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.chore-details p { margin: 2px 0 0; color: var(--green); font-size: 20px; font-weight: 700; line-height: 1.4; }
.chore-details p span { margin-left: 4px; font-size: 12px; }

/* 指で押しやすいように、ボタンの高さを十分に確保します。 */
button { flex-shrink: 0; min-height: 44px; padding: 10px 14px; border: 0; border-radius: 12px; background: var(--green); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
button:hover { background: #205f4a; }
button:active { transform: translateY(1px); }
button:focus-visible { outline: 3px solid #bd831f; outline-offset: 3px; }
/* 申請中のボタンは押せない状態にし、色でも区別します。 */
button:disabled { background: #e9eee3; color: #52675e; cursor: default; transform: none; }
.application-message { margin: 18px 4px 0; color: var(--muted); font-size: 12px; }
footer { margin-top: 28px; color: var(--muted); font-size: 11px; text-align: center; }

.user-list { display: grid; gap: 16px; margin-top: 32px; }
.user-button { display: flex; align-items: center; gap: 20px; width: 100%; min-height: 96px; padding: 20px 24px; border: 1px solid #cfe6d5; border-radius: 22px; background: #e4f2df; color: var(--text); font-size: 26px; text-align: left; }
.user-button span { font-size: 34px; }
.user-button:hover { background: #d4e8ce; }
.adult-button { background: #fff0e5; border-color: #efdece; }
.adult-button:hover { background: #f7e3d3; }
.back-button { margin-bottom: 20px; padding: 10px 18px; background: #e9eee3; color: var(--text); }
.back-button:hover { background: #dce5d5; }
.adult-message { padding: 24px 20px; border: 1px solid #cfe6d5; border-radius: 20px; background: #e4f2df; }
.pending-title { margin: 0 0 18px; font-size: 21px; }
.pending-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.pending-card { padding: 20px; border: 1px solid #e7ece3; border-radius: 18px; background: #fff; }
.pending-child { display: inline-block; margin: 0 0 12px; padding: 4px 14px; border-radius: 20px; background: #e4f2df; font-size: 16px; font-weight: 700; }
.pending-card h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.pending-amount { margin: 4px 0 16px; color: var(--green); font-size: 24px; font-weight: 700; }
.pending-date-label { margin: 0; color: var(--muted); font-size: 12px; }
.pending-date { display: block; color: var(--muted); font-size: 14px; }
.pending-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.approve-button, .reject-button { flex: 1; min-width: 110px; min-height: 48px; font-size: 16px; }
.reject-button { background: #fff0e5; color: #854329; }
.reject-button:hover { background: #f7e3d3; }
#approval-message:empty { display: none; }
#approval-message { margin: 0 0 18px; }
.history-button { width: 100%; margin-top: 18px; min-height: 52px; background: #e9eee3; color: var(--text); font-size: 16px; }
.history-button:hover { background: #dce5d5; }
.history-heading { padding-right: 0; }
.history-date { display: block; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.history-card .pending-amount { margin-bottom: 0; }
.history-summary-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.history-summary-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 16px; border: 1px solid #e7ece3; border-radius: 16px; background: #fff; }
.history-summary-name { flex: 1; min-width: 120px; overflow-wrap: anywhere; font-weight: 700; }
.history-summary-count { color: var(--muted); }
.history-summary-amount { color: var(--green); font-weight: 700; }
.management-open { margin: 0 0 24px; }
#management-message { margin: 0 0 16px; }
#management-message:empty { display: none; }
.chore-form { display: grid; gap: 10px; padding: 20px; border: 1px solid #e7ece3; border-radius: 18px; background: #fff; }
.chore-form label { font-weight: 700; }
.chore-form input { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #a9bdb1; border-radius: 10px; font: inherit; font-size: 16px; }
.chore-form input:focus-visible { outline: 3px solid #bd831f; outline-offset: 2px; }
.form-help { margin: 0; color: var(--muted); font-size: 12px; }
.chore-form .pending-actions { margin-top: 6px; }
.chore-form button { flex: 1; margin-bottom: 0; }
#refresh-month-close-candidates { margin-bottom: 20px; }
#month-close-candidates-message { margin: 0 0 16px; }
#close-month-message { margin: 0 0 20px; white-space: pre-line; }
#close-month-message:empty { display: none; }
.monthly-amount { display: flex; justify-content: space-between; gap: 16px; margin: 12px 0; font-size: 18px; }
.monthly-amount strong { color: var(--green); }
.monthly-date { color: var(--muted); font-size: 12px; }
.cancel-month-button { width: 100%; min-height: 48px; margin-top: 12px; }
.monthly-payment { margin-top: 16px; padding: 14px; border: 1px solid #e7ece3; border-radius: 14px; background: #f7f9f2; }
.monthly-payment .monthly-amount { margin-top: 0; }
.payment-status { margin: 8px 0; color: #854329; font-weight: 700; }
.payment-status.paid { color: var(--green); }
.payment-button { width: 100%; min-height: 48px; margin-top: 8px; }
.chore-form select { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #a9bdb1; border-radius: 10px; background: #fff; color: var(--text); font: inherit; font-size: 16px; }
.chore-form select:focus-visible { outline: 3px solid #bd831f; outline-offset: 2px; }
.request-list-title { margin: 24px 0 12px; font-size: 18px; }
.request-card { background: #fff9e9; border-color: #eadcb6; }
.request-status { margin: 8px 0 0; color: var(--green); font-weight: 700; }
.request-action { width: 100%; min-height: 48px; margin-top: 14px; }
#request-message, #child-request-message { white-space: pre-line; }

/* 小さなスマートフォンでは余白と文字を少し縮めます。 */
@media (max-width: 360px) {
  .home { padding-right: 14px; padding-left: 14px; }
  .chore-card { gap: 9px; padding: 14px 10px; }
  .chore-icon { width: 40px; height: 44px; font-size: 23px; }
  .chore-details h3 { font-size: 14px; }
  button { padding-right: 10px; padding-left: 10px; }
}
