:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #071d42;
  --muted: #4a617e;
  --line: #d0dceb;
  --line-strong: #98a6bf;
  --primary: #155bd3;
  --primary-dark: #041a38;
  --primary-hover: #0a49c0;
  --secondary: #eaf1ff;
  --inactive: #eef2f7;
  --focus-ring: rgba(21, 91, 211, .22);
  --warn: #9a560f;
  --warn-bg: #fff4df;
  --warn-line: #e4b672;
  --danger: #b42318;
  --danger-bg: #fff1ef;
  --danger-line: #f0b6ae;
  --ok: #155bd3;
  --ok-bg: #eaf1ff;
  --shadow: 0 9px 28px rgba(18, 55, 106, .08);
  --shadow-raised: 0 5px 16px rgba(4, 26, 56, .18);
  --radius-card: 16px;
  --radius-control: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
  font-size: 16px;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.app {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 16px max(48px, env(safe-area-inset-bottom));
}

.app-header {
  padding: 6px 2px 24px;
}

.app-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.app-title-logo {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  object-fit: contain;
}

.app-title-row h1 {
  min-width: 0;
}

@media (min-width: 560px) {
  .app-title-row {
    gap: 12px;
  }

  .app-title-logo {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }
}

h1 {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 700;
  line-height: 36px;
  letter-spacing: 0.01em;
}

h1::after,
h2::after {
  content: "";
  display: block;
  height: 3px;
  margin-top: 8px;
  background: var(--primary);
}

h1::after { width: 72px; }

h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  line-height: 26px;
}

h2::after { width: 42px; }

p {
  margin-top: 0;
}

.lead,
.empty,
.hint,
.section-intro {
  color: var(--muted);
  font-size: 14px;
  line-height: 22px;
}

.lead {
  max-width: 36rem;
  margin: 0;
}

.section-intro {
  margin: -8px 0 20px;
}

.card,
.notice,
.modal-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.card {
  padding: 16px;
  margin-bottom: 24px;
}

.profile-card {
  display: grid;
  gap: 14px;
}

.profile-card h2 {
  display: flex;
  align-items: center;
  margin: 0;
}

.profile-card h2::after { display: none; }

.profile-card h2::before {
  content: "人";
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

.field-list {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

input,
select {
  width: 100%;
  min-height: 52px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

input::placeholder {
  color: #999187;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--radius-control);
  background: var(--secondary);
  color: var(--primary-dark);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:hover {
  filter: brightness(0.98);
}

.btn.primary {
  min-height: 56px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 7px rgba(13, 45, 87, .12);
}

.btn.warn {
  min-height: 52px;
  background: var(--secondary);
  color: var(--primary-dark);
  border: 1px solid #c6d8f4;
}

.btn.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-line);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

.btn.outline {
  border: 1px solid var(--primary);
  background: var(--panel);
  color: var(--primary);
}

.edit-profile {
  justify-self: start;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--primary);
  font-size: 14px;
}

.edit-profile svg {
  width: 17px;
  height: 17px;
  margin-right: 7px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.full {
  width: 100%;
}

.hidden {
  display: none;
}

.notice {
  display: none;
  padding: 16px;
  margin-bottom: 24px;
  border-left: 5px solid var(--primary);
  border-color: #b9d3e6;
  border-left-color: var(--primary);
}

.notice.active {
  display: block;
}

.notice p:last-of-type {
  margin-bottom: 0;
}

.preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.metric {
  min-height: 84px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #fbfcfe;
}

.preview .metric:last-child {
  grid-column: 1 / -1;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  line-height: 28px;
}

.metric.warning {
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn);
}

.actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.clear-action {
  margin-top: 4px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--inactive);
}

.tab {
  min-height: 52px;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--inactive);
  color: var(--text);
  font-weight: 700;
}

.tab:last-child {
  border-right: 0;
}

.tab.active {
  border-bottom: 3px solid #5b8fff;
  background: var(--primary-dark);
  color: #fff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.record {
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.record-head {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

.badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge.ok {
  background: var(--secondary);
  color: var(--primary-dark);
}

.record dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 0;
}

.record dt {
  color: var(--muted);
  font-size: 12px;
}

.record dd {
  margin: 3px 0 0;
  font-weight: 700;
}

.small-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.small-actions .btn {
  min-height: 48px;
  padding: 8px 10px;
  font-size: 14px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.summary .metric {
  min-height: 100px;
}

.empty {
  display: grid;
  min-height: 170px;
  place-items: center;
  margin: 0;
  text-align: center;
}

.empty::before {
  content: "";
  width: 42px;
  height: 50px;
  margin-bottom: -42px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  opacity: 0.55;
}

.pdf-steps {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 20px 0 24px;
  list-style: none;
  counter-reset: pdf-step;
}

.pdf-steps li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  color: var(--text);
  font-size: 14px;
  line-height: 22px;
  counter-increment: pdf-step;
}

.pdf-steps li::before {
  content: counter(pdf-step);
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(4, 26, 56, .52);
}

.modal.active {
  display: grid;
}

.modal-box {
  width: min(460px, 100%);
  padding: 20px 18px;
}

button:disabled,
input:disabled,
select:disabled {
  border-color: #d8e0ea;
  background: #edf1f6;
  box-shadow: none;
  color: #7d8ba0;
  cursor: not-allowed;
}

@media (hover: hover) {
  .btn.primary:hover { background: var(--primary-hover); filter: none; }
}

@media (min-width: 560px) {
  .app { padding-right: 28px; padding-left: 28px; }
  .card { padding: 20px; margin-bottom: 20px; }
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .preview .metric:last-child { grid-column: auto; }
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

.pdf-sheet {
  display: none;
}

@media (min-width: 420px) {
  .modal-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print{body{background:#fff}.app{display:none}.pdf-sheet{display:block;color:#111;font-family:"Yu Gothic",Meiryo,sans-serif}.pdf-head{display:flex;justify-content:space-between;gap:12px;border-bottom:2px solid #111;padding-bottom:10px;margin-bottom:12px}.pdf-title{font-size:22px;font-weight:800}.pdf-meta{font-size:12px;line-height:1.7}.pdf-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:10px 0}.pdf-card{border:1px solid #555;padding:8px}.pdf-card span{display:block;font-size:11px;color:#444}.pdf-card strong{display:block;font-size:15px;margin-top:4px}.pdf-table{width:100%;border-collapse:collapse;font-size:10.5px}.pdf-table th,.pdf-table td{border:1px solid #555;padding:4px;text-align:left}.pdf-table th{background:#eee}.pdf-note{margin-top:10px;font-size:11px;color:#333}@page{size:A4 portrait;margin:10mm}}

.public-info{display:grid;gap:6px;margin:0 0 14px;padding:13px 14px;border:1px solid #b9d3e6;border-left:4px solid var(--primary);border-radius:8px;background:#eef7fc;color:#24455f;line-height:1.55}.public-info strong{color:#174b70}.public-info a{width:fit-content;min-height:44px;display:inline-flex;align-items:center;color:var(--primary);font-weight:800;text-decoration:underline}.site-footer{padding:18px 4px 4px;color:var(--muted);font-size:13px;line-height:1.6;text-align:center}.site-footer>p{margin:10px 0 0}.orca-credit{display:grid;justify-items:center;gap:6px;margin:0 0 10px}.orca-credit-label{margin:0;color:var(--muted);font-size:12px;font-weight:600;line-height:18px;letter-spacing:.04em}.orca-credit-logo{display:block;width:clamp(144px,44vw,190px);height:auto;object-fit:contain}
