:root {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  color: #172b39;
  background: #edf2f4;
  color-scheme: light;
  --ink: #172b39;
  --muted: #49606e;
  --line: #cbd8de;
  --deep: #173847;
  --accent: #17625c;
  --panel: #fff;
  --wash: #f2f7f8;
  --sun: #a03939;
  --sat: #255c95;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 2px solid #177d75; outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.masthead {
  min-height: 64px; padding: 10px clamp(15px, 3.5vw, 53px);
  color: white; background: var(--deep); border-bottom: 3px solid #30817b;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.brand, .account { display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 760; letter-spacing: .06em; white-space: nowrap; }
.brand-icon {
  width: 33px; height: 33px; border: 1px solid #8db9b7; border-radius: 7px;
  display: grid; place-items: center; background: #284f5a; flex: none;
}
.brand-icon::before {
  content: ""; width: 17px; height: 16px; border: 1.5px solid #bcebe4; border-radius: 2px;
  background: linear-gradient(#bcebe4, #bcebe4) 0 5px / 100% 1px no-repeat,
              linear-gradient(#bcebe4, #bcebe4) 7px 0 / 1px 100% no-repeat;
}
#account-name { font-size: .875rem; overflow-wrap: anywhere; }
.button, select {
  min-height: 43px; padding: 7px 13px; border: 1px solid #b6c9d0;
  border-radius: 7px; background: var(--panel); font-size: .875rem; font-weight: 700;
}
select { max-width: 100%; padding-right: 30px; appearance: none;
  background: var(--panel) linear-gradient(45deg, transparent 50%, #44616b 50%) right 14px center / 5px 5px no-repeat;
  background-image: conic-gradient(from 45deg, transparent 0 25%, #44616b 0 50%, transparent 0);
  background-size: 8px 8px; background-position: right 12px center; background-repeat: no-repeat;
}
.button:hover:not(:disabled) { background: #e5eef0; }
.button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: #0c4e49; }
.button.light { background: transparent; color: #fff; border-color: #82a6b0; }
.button.light:hover { background: #285464; }
.button[aria-pressed="true"] { background: #dcefeb; color: #0b514e; border-color: #8ab8b2; }
.workspace { max-width: 1740px; padding: 29px clamp(14px, 3.5vw, 48px) 37px; margin: auto; }
.page-heading { display: flex; justify-content: space-between; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 3.5vw, 2.35rem); line-height: 1.2; }
h2 { font-size: 1rem; }
#schedule-title { color: var(--muted); margin-top: 6px; font-size: .875rem; }
.mode-switch, .month-control { display: flex; gap: 6px; align-items: center; }
.toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 15px;
  margin: 18px 0 13px; padding: 10px 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px;
}
.person-control { display: flex; align-items: center; gap: 8px; font-size: .875rem; }
#print { margin-left: auto; }
.grid-scroll {
  background: var(--panel); border: 1px solid #bbcbd1; border-radius: 9px;
  overflow: auto;
}
table { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; min-width: 1260px; font-size: .9rem; }
caption { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
th, td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0; text-align: center; font-variant-numeric: tabular-nums; }
thead { background: #e1ebee; color: #253f4a; }
thead th { padding: 5px 1px; font-weight: 700; }
.staff-column { width: 142px; }
.total-column { width: 68px; }
.name-cell {
  position: sticky; left: 0; z-index: 1; background: #e8f0f2; text-align: left;
  padding: 6px 10px; overflow-wrap: anywhere; box-shadow: 1px 0 var(--line);
}
tbody .name-cell { background: #f4f8f9; }
tbody tr:nth-child(even) .name-cell { background: #eaf2f3; }
.event-cell { padding: 6px 5px; background: #e8f1f3; font-size: .8rem; overflow-wrap: anywhere; }
.event-cell.off, .shift-cell.off { background: #eef2f4; }
.event-cell.special { border-bottom: 2px solid #b45242; }
.date-cell { background: #f2f7f8; }
.date-cell.special { box-shadow: inset 0 2px #b45242; }
.date-cell span { display: block; font-size: .78rem; }
.sun { color: var(--sun); }
.sat { color: var(--sat); }
.shift-cell { height: 39px; }
.shift-button {
  width: 100%; min-height: 39px; border: 0; background: transparent; color: inherit;
  position: relative; padding: 3px 0; font-size: .875rem; font-weight: 750;
}
.shift-button:hover, .shift-button:focus-visible { box-shadow: inset 0 0 0 2px #397875; outline: none; }
.shift-button.has-note::after {
  content: ""; position: absolute; top: 1px; right: 1px; border-top: 5px solid #93701c; border-left: 5px solid transparent;
}
.code-audio { color: #214c75; background: #dfedf8; }
.code-file { color: #544689; background: #eee7f8; }
.code-sup { color: #855020; background: #f9eee0; }
.code-cg { color: #205f48; background: #e1f0e6; }
.code-slow { color: #375685; background: #e5eefc; }
.code-tech { color: #205c62; background: #dff0ef; }
.code-training { color: #824b15; background: #fff0cd; }
.code-rest { color: #5d6d73; background: #e8edf0; }
.code-other { color: #59467a; background: #efecf5; }
.totals { font-weight: 700; background: #f0f6f5; }
tbody tr:last-child > * { border-bottom: 0; }
tr > :last-child { border-right: 0; }
.personal-summary {
  background: var(--panel); padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px;
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
}
.summary-label { color: var(--muted); font-size: .875rem; margin-bottom: 3px; }
#person-name { font-size: 1.25rem; }
.person-totals { display: flex; gap: 18px; margin: 0; }
.person-totals dt { color: var(--muted); font-size: .875rem; }
.person-totals dd { margin: 2px 0 0; font-weight: 750; font-variant-numeric: tabular-nums; }
.list-heading {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin: 15px 0 6px; flex-wrap: wrap;
}
.checkbox-label { display: flex; align-items: center; gap: 5px; min-height: 44px; color: var(--muted); font-size: .875rem; }
.checkbox-label input { width: 19px; height: 19px; accent-color: var(--accent); }
.schedule-list { display: grid; gap: 7px; padding: 0; margin: 0; list-style: none; }
.schedule-card {
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px;
  background: var(--panel); display: grid; grid-template-columns: minmax(66px, auto) minmax(0, 1fr); gap: 10px 12px;
}
.schedule-card time { font-weight: 750; }
.schedule-card p { overflow-wrap: anywhere; }
.card-shift { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.chip { display: inline-block; min-width: 2.2em; padding: 2px 5px; text-align: center; border-radius: 4px; font-weight: 750; font-size: .875rem; }
.card-event, .card-note { color: var(--muted); font-size: .875rem; margin-top: 4px; white-space: pre-wrap; }
.legend { margin-top: 12px; padding: 11px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.legend summary { cursor: pointer; min-height: 25px; font-size: .875rem; font-weight: 700; }
.legend p { margin-top: 10px; color: var(--muted); font-size: .875rem; }
.legend-items { display: flex; flex-wrap: wrap; gap: 8px 13px; margin-top: 7px; font-size: .875rem; }
.legend-item { display: flex; align-items: center; gap: 5px; }
.notice { padding: 8px 0; color: var(--muted); }
.error { color: #a13030; }
.sign-in { max-width: 490px; margin: clamp(32px, 10vh, 120px) auto; padding: 0 16px; }
.sign-card { padding: 23px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; }
.sign-card h1 { font-size: 1.45rem; }
.sign-card p { margin-top: 8px; color: var(--muted); font-size: .875rem; }
.sign-card p.error { color: #a13030; }
#login-form { display: grid; gap: 13px; margin-top: 20px; }
#login-form label { display: grid; gap: 5px; font-size: .875rem; font-weight: 700; }
#login-form input {
  width: 100%; min-height: 46px; padding: 7px 9px; background: white; border: 1px solid #9eb4bd;
  border-radius: 6px; font-size: 1rem;
}
dialog { width: min(92vw, 480px); border: 1px solid var(--line); border-radius: 9px; padding: 19px; color: var(--ink); }
dialog::backdrop { background: #142b3e8c; }
dialog dl { margin: 11px 0; }
dialog dt { color: var(--muted); font-size: .875rem; }
dialog dd { margin: 3px 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 680px) {
  .masthead { min-height: 57px; }
  .account { flex-wrap: wrap; justify-content: flex-end; gap: 4px 6px; }
  .button.light { padding-inline: 7px; }
  .workspace { padding-top: 17px; }
  .page-heading { align-items: start; }
  .toolbar { margin-top: 12px; }
  .month-control { flex: 1 1 100%; }
  #month { flex: 1; font-size: 1rem; }
  #person { max-width: min(57vw, 280px); }
  #account-name { display: none; }
}
@media print {
  @page { size: A4 landscape; margin: 7mm; }
  :root, body { background: #fff; }
  .masthead, .mode-switch, .toolbar, .legend, .notice, .checkbox-label, dialog { display: none !important; }
  .workspace { padding: 0; max-width: none; }
  .page-heading { margin-bottom: 3mm; }
  h1 { font-size: 16pt; }
  .grid-scroll { overflow: visible; border-radius: 0; }
  table { min-width: 0; font-size: 7pt; }
  thead th, .event-cell { font-size: 6pt; padding: 1px; }
  .name-cell { position: static; padding: 1px 3px; }
  .staff-column { width: 82px; }
  .total-column { width: 36px; }
  .shift-cell, .shift-button { height: 17px; min-height: 17px; font-size: 7pt; padding: 0; }
  th, td, button { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .schedule-card { break-inside: avoid; }
}
