:root {
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans JP", sans-serif;
  color: #182d37;
  background: #f5f8f9;
  line-height: 1.75;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #17677b; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 6vw; border-bottom: 1px solid #dce6e9; background: white; }
.brand { color: #17596c; text-decoration: none; font-weight: 800; font-size: 23px; white-space: nowrap; }
.brand span { font-weight: 500; font-size: 15px; margin-left: 16px; }
.badge, .role-badge, .synthetic-badge { display: inline-block; border-radius: 16px; font-size: 12px; font-weight: 600; }
.badge { color: #486574; background: #e9f0f3; padding: 5px 12px; white-space: nowrap; }
.role-badge { color: #17596c; background: #e5f0f2; padding: 7px 16px; white-space: nowrap; }
.synthetic-badge { color: #57643f; background: #f0f2e8; padding: 3px 10px; }
main { max-width: 1040px; margin: 48px auto; padding: 0 28px; }
.eyebrow { font-size: 11px; letter-spacing: 2px; color: #527583; font-weight: 700; }
h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.5; font-weight: 700; letter-spacing: .02em; margin: 12px 0; }
h2 { font-size: 18px; margin: 0 0 18px; }
h3 { font-size: 17px; line-height: 1.6; margin: 0 0 12px; }
p { overflow-wrap: anywhere; }
.lead { color: #546771; font-size: 15px; margin: 0 0 28px; }
.panel { background: white; padding: 30px; border: 1px solid #dce6e9; border-radius: 14px; max-width: 520px; box-shadow: 0 8px 24px #19394206; }
button { background: #17677b; color: white; min-height: 46px; padding: 12px 22px; border: 1px solid transparent; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
button span { margin-left: 36px; }
button:hover { background: #104e60; }
button:disabled { cursor: not-allowed; opacity: .65; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #b57600; outline-offset: 4px; }
.muted { color: #5b707b; font-size: 13px; margin: 12px 0 0; }
aside { margin-top: 32px; padding: 20px 24px; border-left: 3px solid #afbe82; background: #f0f2e8; color: #536146; font-size: 13px; }
aside strong { display: block; margin-bottom: 5px; }
.preview-notice { margin: 0 0 28px; }
.preview-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; font-size: 13px; margin: 0 0 28px; }
.preview-nav span { color: #627782; }
.preview-nav a { padding: 6px 0; text-underline-offset: 4px; }
footer { max-width: 1040px; margin: 32px auto; padding: 0 28px; color: #627782; font-size: 12px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.page-heading > .role-badge { margin-top: 18px; }
.scope { display: flex; justify-content: space-between; gap: 16px 32px; background: #e5f0f2; border: 1px solid #d2e5e8; border-radius: 10px; padding: 16px 20px; font-size: 14px; }
.scope > div { min-width: 0; }
.scope-label { display: block; color: #516975; font-size: 12px; margin-bottom: 2px; }
.scope strong { font-weight: 600; }
.account { overflow-wrap: anywhere; }
.search-panel { margin-top: 26px; padding: 22px 24px; background: white; border: 1px solid #dce6e9; border-radius: 12px; }
.search-panel label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 9px; }
.search-controls { display: flex; gap: 12px; }
.search-controls input { flex: 1; width: 100%; min-width: 0; border: 1px solid #8da5af; border-radius: 8px; background: white; color: #182d37; font: inherit; font-size: 15px; padding: 10px 14px; }
.search-controls input::placeholder { color: #6a7e88; }
.search-controls button { flex: 0 0 auto; }
.search-panel .muted { margin-top: 8px; }
.results-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 24px; margin: 28px 0 14px; }
.results-heading h2 { margin: 0; }
.results-heading > a { font-size: 13px; }
.result-count { margin-left: 12px; color: #17596c; font-size: 22px; font-variant-numeric: tabular-nums; }
.result-count span { font-size: 13px; font-weight: 500; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 18px; }
.employee-card { display: flex; flex-direction: column; min-width: 0; padding: 24px; border: 1px solid #dce6e9; background: white; border-radius: 12px; }
.card-labels { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 18px; }
.employee-id { color: #5b717b; font-size: 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.employee-card h3 { font-size: 22px; margin-bottom: 5px; overflow-wrap: anywhere; }
.card-position { color: #546771; font-size: 14px; margin: 0; }
.card-facts { margin: 20px 0 0; font-size: 13px; }
.card-facts > div { display: flex; gap: 16px; margin-bottom: 4px; }
.card-facts dt { color: #627782; min-width: 4em; }
.card-facts dd { margin: 0; overflow-wrap: anywhere; }
.card-description { color: #627782; font-size: 13px; margin: 16px 0 20px; }
.card-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 44px; margin-top: auto; padding-top: 14px; border-top: 1px solid #e3ebed; text-decoration: none; font-size: 14px; font-weight: 600; }
.card-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.empty-state { grid-column: 1 / -1; padding: 40px 24px; text-align: center; border: 1px dashed #b6c9cf; border-radius: 12px; background: white; }
.empty-state p { font-size: 14px; color: #627782; margin-bottom: 16px; }
.empty-state .text-link { font-size: 14px; }
.profile-panel { margin-top: 26px; padding: 30px; border: 1px solid #dce6e9; border-radius: 12px; background: white; }
.profile-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 26px; }
.profile-heading h2 { font-size: 28px; margin: 12px 0 4px; overflow-wrap: anywhere; }
.profile-heading > .employee-id { margin: 6px 0 0; }
.section-heading { font-size: 15px; margin: 0; padding: 16px 0; border-top: 1px solid #e3ebed; }
.profile-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 0; }
.profile-facts > div { display: grid; grid-template-columns: 6em minmax(0, 1fr); gap: 12px; padding: 16px 0; border-top: 1px solid #e3ebed; font-size: 14px; }
.profile-facts dt { color: #627782; }
.profile-facts dd { margin: 0; overflow-wrap: anywhere; }
.profile-note { padding: 20px; margin-top: 24px; background: #f5f8f9; border-radius: 8px; }
.profile-note h3 { font-size: 15px; margin-bottom: 8px; }
.profile-note p { font-size: 14px; margin: 0; }
.profile-note .muted { font-size: 12px; margin-top: 12px; }
.session-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; padding-top: 24px; border-top: 1px solid #dce6e9; }
.session-actions .muted { margin: 0; max-width: 580px; }
.session-actions form { flex: 0 0 auto; }
.secondary { background: white; color: #1e6375; border: 1px solid #8eaeb8; }
.secondary:hover { background: #e7f0f3; }
.text-link { color: #17677b; text-decoration: underline; text-underline-offset: 4px; font-weight: 600; }
.back-link { display: inline-block; font-size: 13px; margin: 6px 0 8px; }
.skip-link { position: absolute; top: 8px; left: 16px; z-index: 1; padding: 8px 16px; color: white; background: #17596c; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
body.locked #private-content { visibility: hidden; }
@media (max-width: 650px) {
  .site-header { padding: 16px 20px; }
  .brand { font-size: 20px; }
  .brand span { margin-left: 8px; font-size: 12px; }
  .badge { padding: 4px 8px; font-size: 11px; }
  main { margin: 28px auto; padding: 0 20px; }
  .page-heading { gap: 12px; }
  .page-heading > .role-badge { padding: 5px 10px; }
  .scope { flex-direction: column; gap: 12px; }
  .panel, .search-panel, .profile-panel { padding: 22px; }
  .profile-heading { flex-direction: column; gap: 8px; }
  .profile-facts { grid-template-columns: 1fr; }
  .profile-facts > div { padding: 14px 0; }
  .session-actions { align-items: flex-start; flex-direction: column; gap: 16px; }
  aside { padding: 18px 20px; }
  footer { padding: 0 20px; }
}
@media (max-width: 400px) {
  .site-header { gap: 8px; }
  .brand span { display: block; margin-left: 0; font-size: 11px; }
  .page-heading { display: block; }
  .page-heading > .role-badge { margin: 0 0 18px; }
  .search-controls { flex-direction: column; }
  .profile-facts > div { grid-template-columns: 5.5em minmax(0, 1fr); gap: 8px; }
}
/* ---- M2: ledger editing, history, correction requests ---- */
.status-badge { display: inline-block; border-radius: 16px; padding: 3px 10px; font-size: 12px; font-weight: 600; color: #6a4b12; background: #f8efd9; }
.is-inactive { border-color: #d9c9a7; background: #fbf8f1; }
.is-inactive h3, .is-inactive h2 { color: #5b5346; }
.hr-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-top: 22px; }
.button-link { display: inline-block; background: #17677b; color: white; min-height: 46px; padding: 11px 22px; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 600; }
.button-link:hover { background: #104e60; }
.count-pill { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 11px; background: #b57600; color: white; font-size: 12px; text-align: center; line-height: 22px; margin-left: 4px; }
.record-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #e3ebed; }
.record-actions .muted { flex-basis: 100%; margin: 0; }
.inline-form { margin: 0; }
.stacked-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.stacked-form label { font-size: 13px; font-weight: 600; }
.stacked-form input, .stacked-form textarea, .edit-form input, .edit-form textarea { width: 100%; border: 1px solid #8da5af; border-radius: 8px; background: white; color: #182d37; font: inherit; font-size: 15px; padding: 10px 14px; }
.stacked-form button { align-self: flex-start; }
.corrections { margin-top: 28px; padding-top: 20px; border-top: 1px solid #e3ebed; }
.corrections h3 { font-size: 15px; }
.corrections .muted { margin-top: 0; }
.request-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.request-item { padding: 16px 18px; border: 1px solid #dce6e9; border-radius: 10px; background: #f5f8f9; }
.request-item.is-open { border-color: #e6c98a; background: #fffaf0; }
.request-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; }
.request-message { margin: 10px 0 0; font-size: 14px; white-space: pre-wrap; }
.edit-form { margin-top: 26px; padding: 26px 28px; background: white; border: 1px solid #dce6e9; border-radius: 12px; display: grid; gap: 16px; max-width: 640px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field .muted { margin: 0; }
.form-actions { display: flex; align-items: center; gap: 20px; margin-top: 6px; }
.history-list { list-style: none; margin: 20px 0 24px; padding: 0; display: grid; gap: 14px; }
.history-item { padding: 16px 18px; border: 1px solid #dce6e9; border-radius: 10px; background: white; }
.history-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 4px 20px; margin-top: 12px; }
@media (max-width: 650px) { .edit-form { padding: 20px; } .form-actions { flex-wrap: wrap; } }
.overview { width: 100%; border-collapse: collapse; margin: 16px 0 20px; font-size: 14px; background: white; border: 1px solid #dce6e9; border-radius: 10px; overflow: hidden; }
.overview th, .overview td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e3ebed; }
.overview th { color: #516975; font-size: 12px; font-weight: 600; background: #f5f8f9; }
.stacked-form select { width: 100%; border: 1px solid #8da5af; border-radius: 8px; background: white; color: #182d37; font: inherit; font-size: 15px; padding: 10px 14px; }
@media (max-width: 650px) { .overview { display: block; overflow-x: auto; } }
.profile-facts.wide > div { grid-template-columns: 9.5em minmax(0, 1fr); }
