:root {
  --navy: #16294f;
  --navy-2: #24427a;
  --accent: #0f766e;
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #172033;
  --muted: #55627a;
  --line: #d8deea;
  --field: #fbfcfe;
  --danger: #b42318;
  --success: #146c43;
  --admin: #6e2a1f;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 56px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: var(--navy);
  color: #fff;
}
body.admin header { background: var(--admin); }
.brand { font-size: 18px; font-weight: 700; letter-spacing: .08em; }
.brand small { margin-left: 8px; font-size: 12px; font-weight: 500; letter-spacing: 0; opacity: .85; }

main {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px 16px calc(40px + env(safe-area-inset-bottom));
}

.card {
  margin-top: 16px;
  padding: 18px 16px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(22, 41, 79, .06), 0 6px 20px rgba(22, 41, 79, .05);
}
.card h2 {
  margin: 0 0 4px;
  padding-left: 10px;
  border-left: 4px solid var(--navy-2);
  font-size: 16px;
  line-height: 1.4;
}

.login { margin-top: 28px; }
.logo { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto 4px; }
.login-card { padding-top: 12px; }

label { display: block; margin-top: 14px; font-size: 14px; font-weight: 700; }
input, select, textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  padding: 11px 12px;
  background: var(--field);
  color: var(--text);
  border: 1px solid #b9c3d6;
  border-radius: 10px;
  font: inherit;
  font-weight: 500;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 3px solid #6ea0ff;
  outline-offset: 1px;
}
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

button {
  display: block;
  width: 100%;
  min-height: 50px;
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--navy);
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s, opacity .2s;
}
button:hover { background: var(--navy-2); }
button:disabled { opacity: .5; cursor: default; }
button.secondary { background: #fff; color: var(--navy); }
button.secondary:hover { background: #eaf0fb; }
button.accent { background: var(--accent); border-color: var(--accent); }
button.accent:hover { background: #0b5d57; }
header button {
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 6px 14px;
  background: transparent;
  border-color: rgba(255, 255, 255, .6);
  font-size: 13px;
}
header button:hover { background: rgba(255, 255, 255, .14); }

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #e2e7f1;
  border-radius: 14px;
}
.tabs button {
  min-height: 44px;
  margin: 0;
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.tabs button:hover { background: #eef1f8; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(22, 41, 79, .16); }

.note { margin-top: 8px; color: var(--muted); font-size: 12px; }
.msg:empty { display: none; }
.msg { margin-top: 14px; padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 700; }
.msg.ok { background: #e6f4ec; color: var(--success); }
.msg.ng { background: #fdeceb; color: var(--danger); }

.rec, .member {
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.rec-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #eef2fa;
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.badge { padding: 0 10px; background: var(--navy); color: #fff; border-radius: 999px; font-size: 12px; line-height: 24px; white-space: nowrap; }
.rec dl { display: grid; grid-template-columns: 7.5em 1fr; gap: 6px 10px; margin: 0; padding: 12px 14px; font-size: 14px; }
.rec dt { color: var(--muted); font-size: 12px; line-height: 22px; }
.rec dd { margin: 0; white-space: pre-wrap; }
.rec > button { width: calc(100% - 28px); margin: 0 14px 14px; }

.member { padding: 12px 14px; font-size: 14px; }
.member div:first-child { font-weight: 700; }
.member div:nth-child(3) { color: var(--muted); font-size: 12px; }
.member .number { font-weight: 700; color: var(--navy); }
.member button.remove { color: var(--danger); border-color: var(--danger); }
#register { margin-top: 16px; text-align: left; }
.member button { display: inline-block; width: auto; min-height: 44px; margin: 10px 8px 0 0; background: #fff; color: var(--navy); font-size: 14px; }
.member button:hover { background: #eaf0fb; }
.member form button { display: block; }

input[type="file"] { font-size: 14px; }
.preview { display: block; max-width: 100%; max-height: 220px; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; }
.preview + button { margin-top: 8px; min-height: 44px; font-size: 14px; }
.rec dd a { display: inline-block; min-height: 32px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 24px; margin-top: 16px; }
.links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: #16294f; }
