:root {
  color-scheme: light;
  --ink: #1c3649;
  --sub: #4e6878;
  --blue: #205d83;
  --pale: #e9f5ff;
  --line: #dbe9f1;
  font: 16px/1.6 "Segoe UI", "Yu Gothic UI", sans-serif;
  color: var(--ink);
  background: #f4faff;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.mast { background: #fff; border-bottom: 1px solid var(--line); }
.mast > div, main, nav > div { width: min(100%, 680px); margin: auto; padding-inline: 20px; }
.mast > div { padding-block: 22px; }
h1, h2, p { margin: 0; }
h1 { font: 600 36px/1.1 Georgia, serif; letter-spacing: -1px; }
.mast p, .hint, small, .heading span { color: var(--sub); font-size: .875rem; }
.mast p { margin-top: 4px; }
main { padding-block: 24px 104px; }
h2 { font-size: 1.45rem; margin-bottom: 12px; }
.heading { display: flex; align-items: baseline; justify-content: space-between; }
.month { background: #fff; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 12px; }
summary { cursor: pointer; padding: 14px 16px; font-weight: 650; }
summary small { margin-left: 10px; font-weight: 400; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 12px 14px; }
button { cursor: pointer; }
button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #307cad; outline-offset: 2px; }
.tile { background: #fff; border: 0; text-align: left; padding: 0 0 5px; overflow-wrap: anywhere; }
.tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: var(--pale); }
.tile span, .tile small { display: block; margin: 3px 4px 0; }
.empty, form { background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 18px; }
.primary, .back { border: 0; min-height: 44px; border-radius: 12px; padding: 8px 15px; }
.primary { background: var(--blue); color: #fff; font-weight: 650; margin-top: 14px; }
.primary:disabled { opacity: .62; cursor: default; }
.back { background: var(--pale); color: var(--blue); margin-bottom: 14px; }
form { display: grid; gap: 6px; }
label { font-weight: 650; margin-top: 8px; }
label small { margin-left: 6px; font-weight: 400; }
input, select, textarea { width: 100%; min-height: 44px; background: #fff; border: 1px solid #a9c1d1; border-radius: 9px; padding: 7px 10px; }
textarea { resize: vertical; }
.error { color: #8e2635; background: #fff2f4; border-radius: 9px; padding: 9px; margin: 8px 0; }
.status { margin-top: 10px; color: var(--blue); }
.detail-photos { display: grid; gap: 12px; margin-block: 12px; }
.detail-photos img { width: 100%; max-height: 560px; object-fit: contain; background: #eaf5fc; border-radius: 14px; }
dl { margin: 0; overflow-wrap: anywhere; }
dt { color: var(--sub); font-size: .875rem; margin-top: 10px; }
dd { margin: 0; white-space: pre-wrap; }
nav { position: fixed; inset: auto 0 0; border-top: 1px solid var(--line); background: #fff; padding-bottom: env(safe-area-inset-bottom); }
nav > div { padding-block: 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
nav button { border: 0; border-radius: 10px; background: transparent; min-height: 44px; }
nav button[aria-current] { background: var(--pale); color: var(--blue); font-weight: 650; }

.evaluation-panel { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow-wrap: anywhere; }
.evaluation-panel h3, .evaluation-panel h4 { margin: 0 0 8px; }
.evaluation-panel details { border-top: 1px solid var(--line); margin-top: 10px; }
.evaluation-panel details summary { padding-inline: 0; }
.evaluation-panel label, #growth label { display: block; }
.evaluation-panel .back { margin: 8px 4px 8px 0; }
.evaluation-panel textarea { display: block; margin-top: 5px; }
.evaluation-panel form { padding: 10px; }
.text-link { display: inline-block; padding: 10px 4px; color: var(--blue); }
.focus-card { background: var(--pale); border-radius: 14px; padding: 12px 15px; margin: 0 0 12px; overflow-wrap: anywhere; }
.focus-card h3, .focus-card h4 { margin: 0 0 4px; color: var(--blue); }
.focus-card p + p { margin-top: 8px; }
.focus-card ul { padding-inline-start: 22px; margin: 4px 0 0; }
.score-row { display: grid; grid-template-columns: 1fr 92px; gap: 5px 10px; align-items: center; margin-bottom: 10px; }
.score-row textarea { grid-column: 1 / -1; }
.score-summary { margin-bottom: 8px; }
.score-summary strong { color: var(--blue); font-size: 1.25rem; }
.score-chart { display: block; width: 100%; height: 169px; }
.grade-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-block: 12px; }
.grade-photos figure { margin: 0; }
.grade-photos img { width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--pale); }
.grade-photo-empty { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 10px; background: var(--pale); }
.grade-photos figcaption { margin-top: 5px; }
.grade-table { width: 100%; border-collapse: collapse; font-size: .875rem; margin-bottom: 14px; }
.grade-table th, .grade-table td { text-align: left; padding: 7px 3px; border-bottom: 1px solid var(--line); }
.grade-table td:not(:first-child) { white-space: nowrap; }
.evaluation-original { white-space: pre-wrap; overflow-wrap: anywhere; }
.record-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.record-actions .danger { background: #fff1f3; color: #8e2635; }
#cancel-edit { justify-self: start; margin: 12px 0 0; }
.chart-scroll { overflow-x: auto; margin-block: 12px; }
.history-record { border-top: 1px solid var(--line); padding-block: 12px; }
.history-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.history-heading h4 { margin: 0; }
.history-heading span { font-size: .875rem; color: var(--blue); }
.history-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 125px), 1fr)); gap: 5px 10px; margin-top: 7px; }
.history-scores dt { margin: 0; }
.history-scores dd { font-weight: 600; }
.mast { padding-top: env(safe-area-inset-top); }
.mast > div, main, nav > div {
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
main { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
button, input, select, textarea { -webkit-tap-highlight-color: #e9f5ff; }

#record-form { grid-template-columns: minmax(0, 1fr); }
#record-form input[type="date"] {
  display: block;
  min-inline-size: 0;
  max-inline-size: 100%;
  text-align: start;
}
#record-form input[type="date"]::-webkit-date-and-time-value {
  min-height: 1.5em;
  text-align: start;
}
#record-form input[type="date"]::-webkit-datetime-edit { padding: 0; }
