:root {
  font-family:-apple-system,BlinkMacSystemFont,"Noto Sans JP","Segoe UI",sans-serif;
  color:#172d3a;
  background:#f0f4f7;
  font-synthesis:none;
  font-size:16px;
  --ink:#143e56;
  --line:#dce4e9;
  --day:#eaf3ed;
  --night:#e7edf9;
  --ake:#e8f5f9;
  --off:#fff0e9
}
* {
  box-sizing:border-box
}
body {
  margin:0
}
button,input,select,textarea {
  font:inherit
}
button {
  cursor:pointer;
  touch-action:manipulation
}
button:disabled {
  cursor:default;
  opacity:.4
}
button:focus-visible,a:focus-visible {
  outline:3px solid #1c809e;
  outline-offset:3px
}
button {
  color:inherit
}
h1,h2,p {
  margin:0
}
h1 {
  font-size:1.1rem;
  font-weight:750;
  letter-spacing:.03em
}
h2 {
  font-size:1.4rem
}
.app {
  max-width:1080px;
  margin:0 auto;
  padding:0 18px 24px;
  background:white;
  min-height:100dvh
}
.topbar {
  height:70px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line)
}
.brand {
  display:flex;
  align-items:center;
  gap:12px
}
.brand-icon {
  background:var(--ink);
  color:white;
  border-radius:10px;
  font-size:26px;
  line-height:36px;
  width:36px;
  text-align:center
}
.quiet,.square {
  border:1px solid var(--line);
  background:white;
  border-radius:9px;
  min-height:44px;
  padding:8px 14px;
  font-size:.9rem;
  font-weight:600
}
.square {
  width:44px;
  font-size:25px;
  padding:0
}
.monthbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:16px 0 12px
}
.eyebrow {
  font-size:.875rem;
  color:#577082;
  line-height:1.5
}
.monthbar h2 {
  font-size:2.3rem;
  letter-spacing:-.04em;
  font-weight:750;
  line-height:1.2
}
.monthnav {
  display:flex;
  gap:8px;
  align-items:center
}
.calendar-wrap {
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden
}
.weekdays,.calendar {
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr))
}
.weekdays {
  background:#f7f9fb;
  border-bottom:1px solid var(--line);
  font-size:.875rem;
  text-align:center;
  padding:10px 0;
  color:#637382
}
.weekdays span.sun {
  color:#b35e45
}
.weekdays span.sat {
  color:#346e9e
}
.cell {
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  text-align:left;
  min-height:132px;
  padding:8px 7px;
  border:0;
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  background:white;
  gap:5px;
  min-width:0
}
.calendar>.last-column {
  border-right:0
}
.calendar>.last-row {
  border-bottom:0
}
.cell.outside {
  background:#f9fafb;
  color:#a0aab1;
  cursor:default
}
.date-line {
  display:flex;
  justify-content:space-between;
  align-items:center;
  height:22px
}
.date-number {
  font-size:.875rem;
  line-height:22px;
  min-width:22px;
  text-align:center;
  font-weight:600
}
.cell.today .date-number {
  background:var(--ink);
  color:white;
  border-radius:50%
}
.cell.selected {
  box-shadow:inset 0 0 0 2px #24647d
}
.cell.is-holiday .date-number {
  color:#b35e45
}
.cell.today.is-holiday .date-number {
  color:white
}
.marker {
  font-size:13px;
  color:#566f7d
}
.duty {
  border-left:3px solid #869e8c;
  background:var(--day);
  padding:4px 5px;
  border-radius:4px;
  display:flex;
  flex-direction:column;
  gap:3px;
  flex:1;
  min-width:0
}
.duty.night {
  background:var(--night);
  border-color:#6a7cad
}
.duty.ake {
  background:var(--ake);
  border-color:#64a5b8
}
.duty.off {
  background:var(--off);
  border-color:#c68e70
}
.duty-code {
  font-size:1rem;
  font-weight:750;
  line-height:1.3
}
.duty-time {
  font-size:.875rem;
  font-variant-numeric:tabular-nums;
  line-height:1.3;
  color:#354f60;
  white-space:nowrap
}
.cell-note {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  overflow:hidden;
  margin-top:auto;
  padding-top:4px;
  border-top:1px solid #78909c38;
  color:#465e6c;
  font-size:.75rem;
  font-weight:500;
  line-height:1.35;
  white-space:pre-wrap;
  overflow-wrap:anywhere
}
.calendar-foot {
  font-size:.8125rem;
  color:#5c7180;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin:8px 0 14px
}
.text-button {
  border:0;
  background:transparent;
  min-height:44px;
  color:#23657b;
  font-size:.875rem;
  padding:6px
}
.summary {
  background:#f4f7f9;
  border-radius:12px;
  padding:16px 18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  border:1px solid #e5ebef
}
.summary-date {
  font-size:.875rem;
  color:#587182;
  margin-bottom:6px
}
.summary-main {
  font-size:1.15rem;
  font-weight:700
}
.summary-note {
  font-size:.875rem;
  color:#587182;
  margin-top:6px;
  white-space:pre-wrap;
  overflow-wrap:anywhere
}
.summary-badge {
  font-size:.875rem;
  color:#4b6779;
  background:white;
  padding:9px 12px;
  border-radius:8px;
  white-space:nowrap
}
footer {
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px;
  font-size:.75rem;
  color:#6c8090;
  padding:18px 0 0;
  line-height:1.6
}
.primary {
  border:0;
  background:var(--ink);
  color:white;
  border-radius:9px;
  min-height:46px;
  padding:10px 20px;
  font-weight:600
}
.warning,.notice {
  background:#fff2d7;
  color:#6f5121;
  border-radius:8px;
  padding:12px;
  font-size:.875rem;
  line-height:1.6
}
.warning {
  margin-top:12px
}
dialog {
  width:min(520px,calc(100vw - 24px));
  max-height:calc(100dvh - 32px);
  overflow:auto;
  border:0;
  border-radius:18px;
  padding:24px;
  color:#172d3a;
  box-shadow:0 20px 80px #153c5333
}
dialog::backdrop {
  background:#142b3c70
}
.dialog-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px
}
.dialog-head h2 {
  font-size:1.3rem
}
.close {
  flex-shrink:0
}
label {
  display:flex;
  flex-direction:column;
  gap:7px;
  font-size:.875rem;
  font-weight:600;
  margin:16px 0 0
}
input,select,textarea {
  width:100%;
  min-width:0;
  color:#183846;
  background:#fff;
  border:1px solid #cbd7df;
  border-radius:8px;
  padding:11px 10px;
  font-size:1rem;
  min-height:46px
}
textarea {
  resize:vertical;
  line-height:1.5
}
.time-fields {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px
}
.time-fields:has([hidden]) {
  grid-template-columns:1fr
}
.hint,.muted {
  color:#5b7282;
  font-size:.875rem;
  line-height:1.6
}
.hint {
  margin:12px 0
}
.notice {
  margin:14px 0
}
.error {
  color:#b33a31;
  font-size:.875rem;
  line-height:1.5;
  margin-top:12px;
  min-height:0
}
.error:empty {
  display:none
}
.dialog-actions {
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:24px;
  flex-wrap:wrap
}
.dialog-actions .quiet {
  margin-right:auto
}
details {
  border-bottom:1px solid var(--line);
  padding:16px 0
}
details summary {
  font-weight:650;
  cursor:pointer;
  min-height:30px;
  line-height:1.6
}
details p {
  font-size:.875rem;
  line-height:1.7;
  margin:10px 0
}
table {
  border-collapse:collapse;
  width:100%;
  font-size:.875rem;
  font-variant-numeric:tabular-nums
}
th,td {
  padding:10px 7px;
  text-align:left;
  border-bottom:1px solid #e5ebef
}
th {
  color:#5b7282;
  font-weight:600;
  background:#f5f8fa;
  position:sticky;
  top:0
}
td button {
  min-height:38px;
  min-width:40px;
  font-weight:650;
  color:#24637e;
  border:0;
  background:#edf4f8;
  border-radius:7px
}
.table-scroll {
  max-height:48dvh;
  overflow:auto
}
fieldset {
  border:1px solid var(--line);
  border-radius:10px;
  margin:18px 0;
  padding:4px 14px 14px
}
legend {
  font-size:.875rem;
  color:#567080
}
.rotation-list {
  font-size:.875rem;
  line-height:1.7;
  overflow-wrap:anywhere
}
.rotation-row {
  padding:8px 0;
  border-top:1px solid #e9eef2
}
.action-row {
  display:flex;
  gap:10px;
  flex-wrap:wrap
}
#toast {
  position:fixed;
  bottom:26px;
  left:50%;
  transform:translateX(-50%);
  z-index:20;
  background:#173b4f;
  color:white;
  border-radius:10px;
  padding:12px 18px;
  font-size:.875rem;
  max-width:90vw;
  box-shadow:0 3px 16px #0002;
  pointer-events:none;
  opacity:0;
  transition:opacity .2s
}
#toast.show {
  opacity:1
}
[hidden] {
  display:none!important
}
a {
  color:#24657f
}
#confirm-dialog p {
  line-height:1.7;
  margin-top:15px
}
@media(max-width:600px) {
  .app {
    padding:0 4px 20px
  }
  .topbar {
    height:62px;
    margin:0 6px
  }
  .brand {
    gap:9px
  }
  .brand-icon {
    width:32px;
    line-height:32px;
    font-size:23px
  }
  .monthbar {
    margin:12px 6px 10px
  }
  .monthbar h2 {
    font-size:2rem
  }
  .monthnav {
    gap:6px
  }
  .cell {
    min-height:116px;
    padding:5px 2px;
    gap:4px
  }
  .duty {
    padding:4px 2px;
    border-left-width:2px
  }
  .duty-code {
    font-size:.875rem
  }
  .duty-time {
    font-size:.875rem;
    letter-spacing:-.025em
  }
  .date-number {
    font-size:.8125rem
  }
  .cell-note {
    -webkit-line-clamp:3;
    font-size:.6875rem
  }
  .summary {
    padding:15px 12px;
    margin-left:6px;
    margin-right:6px
  }
  .summary-main {
    font-size:1rem
  }
  .summary-badge {
    padding:7px 9px
  }
  dialog {
    padding:20px 18px
  }
  .calendar-foot {
    font-size:.75rem;
    margin:6px 6px 8px
  }
  footer {
    padding-left:6px;
    padding-right:6px
  }
  .square {
    width:42px
  }
  .time-fields {
    gap:10px
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    transition:none!important
  }
}
.roster-dialog {
  width:min(1100px,calc(100vw - 16px));
  padding:18px
}
.roster-controls label {
  margin:0;
  max-width:230px
}
.roster-add {
  display:grid;
  grid-template-columns:2fr 1fr 2fr;
  gap:10px;
  align-items:end
}
.roster-add .primary {
  grid-column:1/-1
}
.roster-scroll {
  overflow:auto;
  max-height:62dvh;
  border:1px solid var(--line);
  border-radius:8px
}
.roster-grid {
  width:max-content;
  border-collapse:separate;
  border-spacing:0
}
.roster-grid th,.roster-grid td {
  min-width:88px;
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  vertical-align:top;
  padding:8px
}
.roster-grid thead th {
  position:sticky;
  top:0;
  z-index:2;
  background:#f5f8fa
}
.roster-grid th:first-child {
  position:sticky;
  left:0;
  min-width:130px;
  width:130px;
  max-width:130px;
  background:white;
  z-index:1
}
.roster-grid thead th:first-child {
  z-index:3
}
.roster-grid td>span,.roster-grid td>strong,.roster-grid th>small,.roster-grid th>strong {
  display:block;
  line-height:1.6
}
.roster-grid input {
  margin-top:4px;
  font-size:14px;
  padding:6px;
  min-height:36px
}
.roster-grid .text-button {
  font-size:14px;
  min-height:32px;
  padding:4px 0
}
.roster-grid .roster-sun {
  color:#b13b3b
}
.roster-grid .roster-sat {
  color:#346e9e
}
.roster-caption {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%)
}
:root[data-theme=dark] .roster-grid th {
  background:#202d38;
  color:#e5edf3
}
:root[data-theme=dark] .roster-grid .roster-sun {
  color:#ffaaa4
}
:root[data-theme=dark] .roster-grid .roster-sat {
  color:#94c9fa
}
@media(max-width:600px) {
  .topbar {
    height:auto;
    min-height:62px;
    flex-wrap:wrap;
    gap:8px;
    padding:8px 0
  }
  .header-actions {
    display:flex;
    gap:4px
  }
  .header-actions .quiet {
    padding:8px 10px
  }
  .roster-add {
    grid-template-columns:1fr 1fr
  }
  .roster-add label:last-of-type {
    grid-column:1/-1
  }
}
/* Compact application menu */
.app-menu {
  position:relative;
  border:0;
  padding:0
}
.app-menu>summary {
  list-style:none;
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:9px;
  background:white;
  cursor:pointer;
  font-size:1.55rem;
  line-height:1
}
.app-menu>summary::-webkit-details-marker {
  display:none
}
.menu-items {
  position:absolute;
  right:0;
  top:48px;
  z-index:12;
  min-width:174px;
  padding:6px;
  background:white;
  border:1px solid var(--line);
  border-radius:11px;
  box-shadow:0 12px 36px #153c5330
}
.menu-item {
  display:block;
  width:100%;
  min-height:46px;
  padding:10px 14px;
  border:0;
  border-radius:7px;
  background:white;
  text-align:left;
  font-weight:650
}
.menu-divider {
  height:1px;
  margin:6px 8px;
  background:var(--line)
}
.menu-item:hover,.menu-item:focus-visible {
  background:#edf4f8
}
.monthnav>:is(.quiet,.square),.monthnav .app-menu>summary {
  height:44px;
  min-height:44px
}
:root[data-theme=dark] .app-menu>summary,:root[data-theme=dark] .menu-items,:root[data-theme=dark] .menu-item {
  background:#202d38;
  color:#eef5fa
}
:root[data-theme=dark] .menu-item:hover,:root[data-theme=dark] .menu-item:focus-visible {
  background:#314352
}
@media(max-width:600px) {
  .monthbar {
    margin-top:4px
  }
  .monthnav {
    gap:5px
  }
  .monthnav .quiet {
    padding-left:11px;
    padding-right:11px
  }
}
/* Calendar typography and density: edit these tokens, not individual cells. */
:root  {
  --cell-height: 132px;
  --code-size: 1rem;
  --time-size: .875rem;
  --weekday-size: .875rem;
  --date-size: .875rem;
}
:root[data-cell-height=compact]  {
  --cell-height: 108px;
}
:root[data-cell-height=roomy]  {
  --cell-height: 164px;
}
:root[data-text-size=small]  {
  --code-size: .875rem;
  --time-size: .8125rem;
  --weekday-size: .8125rem;
  --date-size: .75rem;
}
:root[data-text-size=large]  {
  --code-size: 1.125rem;
  --time-size: 1rem;
  --weekday-size: 1rem;
  --date-size: 1rem;
}
@media(max-width:600px)  {
  :root  {
    --cell-height: 116px;
    --code-size: .875rem;
    --weekday-size: .875rem;
    --date-size: .8125rem;
  }
  :root[data-cell-height=compact]  {
    --cell-height: 100px;
  }
  :root[data-cell-height=roomy]  {
    --cell-height: 148px;
  }
}
/* Calendar reading preferences; sizes remain independent of the settings UI. */
.calendar .duty-code {
  font-size:var(--code-size)
}
.calendar .duty-time {
  font-size:var(--time-size);
  white-space:normal;
  overflow-wrap:anywhere
}
.weekdays {
  font-size:var(--weekday-size)
}
.calendar .date-number {
  font-size:var(--date-size)
}
:root[data-memo-lines="0"] .cell-note {
  display:none
}
:root[data-memo-lines="1"] .cell-note {
  -webkit-line-clamp:1
}
:root[data-memo-lines="3"] .cell-note {
  -webkit-line-clamp:3
}
/* One continuous work block across the departure and return dates. */
.night-pair {
  position:relative;
  grid-column:span 2;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  isolation:isolate
}
.night-pair::before {
  content:"";
  position:absolute;
  inset:36px 8px 9px;
  border-left:3px solid #6a7cad;
  border-radius:5px;
  background:var(--pair-bg,var(--night));
  z-index:-1
}
.night-pair>.cell {
  border:0;
  background:transparent
}
.night-pair .duty {
  background:transparent;
  border:0;
  border-radius:0;
  padding-left:8px
}
.night-pair .outside .duty,.night-pair .outside .date-line {
  opacity:.6
}
.night-pair:focus-within {
  z-index:2
}
.night-pair>.cell:focus-visible {
  outline-offset:-3px
}
.night-pair>.cell.selected {
  box-shadow:inset 0 0 0 2px #24647d;
  border-radius:5px
}
.night-resumes .duty {
  background:var(--night);
  border-color:#6a7cad;
  border-left-style:dashed
}
.night-continues .duty {
  border-right:2px dashed #6a7cad;
  border-top-right-radius:0;
  border-bottom-right-radius:0
}
.continuation {
  font-size:.75rem;
  line-height:1.3;
  color:#52688e;
  white-space:nowrap
}
.duty-code {
  overflow-wrap:anywhere
}
@media(max-width:600px) {
  .night-pair::before {
    inset:31px 2px 5px;
    border-left-width:2px
  }
  .night-pair .duty {
    padding-left:4px
  }
  .duty.off .duty-code {
    line-height:1.55
  }
}
.header-actions {
  display:flex;
  gap:7px
}
.leave-card {
  border:1px solid var(--line);
  border-radius:12px;
  margin-top:16px;
  padding:15px
}
.leave-card h3 {
  margin:0 0 8px;
  font-size:1rem
}
.leave-totals {
  font-size:.9rem;
  line-height:1.7
}
.leave-remaining {
  font-size:.875rem;
  color:#24657f;
  line-height:1.7;
  margin-top:5px
}
.leave-fields {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
  gap:0 12px
}
.leave-card .hint {
  margin-bottom:0
}
.leave-day-status {
  font-size:.875rem;
  line-height:1.5;
  margin-top:10px;
  padding:9px 11px;
  border-radius:8px;
  background:#f3f7f5;
  color:#355c50;
  font-weight:650
}
.over-limit {
  color:#b33a31
}
@media(max-width:400px) {
  .header-actions {
    gap:5px
  }
  .header-actions .quiet {
    padding:8px 10px
  }
  .brand h1 {
    font-size:1rem
  }
  .brand {
    gap:6px
  }
}
/* User-selectable calendar appearance. */
.duty {
  color:var(--day-text,#172d3a)
}
.duty.night,.duty.ake {
  color:var(--night-text,#172d3a)
}
.duty>.duty-time,.duty>.continuation {
  color:inherit
}
.duty.public-holiday {
  background:var(--public-bg,#fff0e9);
  color:var(--public-text,#9d4f38)
}
.duty.annual-leave {
  background:var(--annual,#fff6d8);
  color:var(--annual-text,#725a12)
}
.settings-subhead {
  font-size:1rem;
  margin:20px 0 0
}
.color-settings {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px
}
.color-card {
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px
}
.color-card strong {
  display:block;
  font-size:.875rem;
  margin-bottom:6px
}
.color-pickers {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px
}
.color-pickers label {
  margin:0;
  font-size:.75rem
}
.color-pickers input[type=color] {
  height:42px;
  padding:4px;
  cursor:pointer
}
.label-settings {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px 12px
}
.label-row {
  display:grid;
  grid-template-columns:72px 1fr;
  align-items:start;
  gap:8px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px
}
.label-fields {
  display:grid;
  grid-template-columns:1fr;
  gap:8px
}
.night-label .label-fields {
  grid-template-columns:1fr 1fr
}
.label-row label {
  margin:0;
  font-size:.75rem
}
.label-row input {
  min-height:42px;
  padding:8px
}
.label-code {
  font-weight:700;
  padding-top:29px;
  overflow-wrap:anywhere
}
.item-color-toggle {
  grid-column:2;
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:7px
}
.label-row .item-color-toggle input {
  width:18px;
  height:18px;
  min-height:0;
  padding:0
}
.item-color-pickers {
  grid-column:2;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px
}
.item-color-pickers input[type=color] {
  height:38px;
  min-height:38px;
  padding:3px;
  cursor:pointer
}
.item-color-pickers input:disabled {
  opacity:.35
}
@media(max-width:480px) {
  .label-settings {
    grid-template-columns:1fr
  }
  .color-card {
    padding:8px
  }
  .color-pickers {
    gap:5px
  }
}
/* Calendar context and week layout. */
.weekdays span.sun {
  color:#b33f38
}
.weekdays span.sat {
  color:#2867a0
}
.cell.is-sunday .date-number,.cell.is-public-date .date-number {
  color:#b33f38
}
.cell.is-saturday .date-number {
  color:#2867a0
}
.cell.today .date-number {
  color:white
}
.holiday-mark {
  margin-left:auto;
  border-radius:4px;
  background:#f2d7d3;
  color:#9d3833;
  font-size:.6875rem;
  font-weight:700;
  line-height:1.5;
  padding:0 4px
}
.cell.outside {
  background:#f4f5f6;
  color:#929ba1
}
.cell.outside .date-line,.cell.outside .duty {
  filter:grayscale(1);
  opacity:.42
}
.night-pair .outside .duty,.night-pair .outside .date-line {
  opacity:.42
}
.switch-row {
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:10px;
  margin:10px 0 16px;
  padding:11px;
  border:1px solid var(--line);
  border-radius:10px
}
.switch-row input {
  width:22px;
  height:22px;
  min-height:0;
  flex:0 0 auto
}
/* Touch and wheel month navigation. */
.month-heading {
  position:relative;
  display:grid;
  grid-template-columns:auto 20px;
  grid-template-rows:auto auto;
  align-items:center;
  text-align:left;
  border:0;
  background:transparent;
  color:inherit;
  border-radius:9px;
  padding:3px 2px;
  min-width:112px
}
.month-heading .eyebrow {
  grid-column:1
}
.month-title {
  grid-column:1;
  font-size:2.3rem;
  letter-spacing:-.04em;
  font-weight:750;
  line-height:1.2
}
.month-chevron {
  grid-column:2;
  grid-row:1/3;
  align-self:end;
  font-size:1.15rem;
  color:#637382;
  padding-bottom:7px
}
.calendar-wrap {
  touch-action:pan-y;
  user-select:none;
  -webkit-user-select:none;
  -webkit-tap-highlight-color:transparent;
  contain:paint
}
.month-dialog {
  width:min(400px,calc(100vw - 24px))
}
.month-wheels {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px
}
.wheel-label {
  text-align:center;
  color:#5b7282;
  font-size:.8125rem;
  margin-bottom:6px
}
.month-wheel-frame {
  position:relative;
  height:260px;
  overflow:hidden;
  border-block:1px solid var(--line);
  background:linear-gradient(#fff,#f7f9fb 38%,#f7f9fb 62%,#fff)
}
.month-wheel {
  height:260px;
  overflow-y:auto;
  scroll-snap-type:y mandatory;
  overscroll-behavior:contain;
  padding:104px 0;
  scrollbar-width:none
}
.month-wheel::-webkit-scrollbar {
  display:none
}
.wheel-item {
  display:block;
  width:100%;
  height:52px;
  scroll-snap-align:center;
  border:0;
  background:transparent;
  color:#7d8a93;
  font-size:1.15rem;
  font-variant-numeric:tabular-nums
}
.wheel-item.active {
  color:#173b4f;
  font-size:1.35rem;
  font-weight:750
}
.wheel-item.unavailable {
  opacity:.25
}
.wheel-selection {
  position:absolute;
  left:18px;
  right:18px;
  top:104px;
  height:52px;
  border-block:1px solid #aec0cb;
  pointer-events:none
}
@media(max-width:600px) {
  .month-heading .month-title {
    font-size:2rem
  }
}
.change-dot {
  width:8px;
  height:8px;
  border-radius:50%;
  background:#d84236;
  flex:0 0 8px;
  box-shadow:0 0 0 1px #fff
}
.edit-change-status {
  display:grid;
  gap:5px;
  margin-top:10px;
  color:#b33a31;
  font-size:.875rem;
  font-weight:650;
  line-height:1.45
}
.rotation-grid {
  table-layout:fixed;
  width:100%;
  border-collapse:collapse;
  margin:12px 0;
  font-size:.875rem
}
.rotation-grid caption {
  text-align:left;
  font-weight:650;
  padding:0 0 10px;
  color:#526a79
}
.rotation-grid td {
  width:14.2857%;
  height:54px;
  padding:8px 2px;
  text-align:center;
  vertical-align:middle;
  border:1px solid #aebdc7;
  background:white;
  line-height:1.5;
  overflow-wrap:anywhere;
  font-weight:600
}
.rotation-grid .rotation-off {
  background:#fff0e9;
  color:#9d4f38
}
.rotation-grid .rotation-ake {
  background:#eef6fb;
  color:#2867a0
}
.night-pair .duty {
  color:var(--pair-text,var(--night-text,#172d3a))
}
.primary:disabled {
  background:#d9e0e4;
  color:#87949c;
  opacity:1
}
:root {
  --today:#143e56;
  --selection:#1481a4;
  --change:#d84236
}
.cell.today .date-number {
  background:var(--today)
}
.cell.selected,.night-pair>.cell.selected {
  box-shadow:inset 0 0 0 3px var(--selection)
}
.change-dot {
  background:var(--change)
}
.entry-badge {
  align-self:center;
  flex:0 0 auto;
  margin-top:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:6px;
  padding:3px 8px;
  min-height:22px;
  max-width:100%;
  font-size:.75rem;
  font-weight:600;
  line-height:1.4;
  letter-spacing:.06em;
  white-space:nowrap
}
.entry-badge.leave {
  background:#be4259;
  color:#fff
}
.entry-badge.public-work {
  background:#286ab8;
  color:#fff
}
.entry-checks {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  padding:5px 10px 10px
}
.entry-checks .switch-row {
  margin:0;
  padding:9px
}
.entry-checks .switch-row input {
  width:20px;
  height:20px
}
@media(max-width:480px) {
  .entry-checks {
    grid-template-columns:1fr
  }
  .entry-badge {
    font-size:.75rem;
    padding:2px 5px
  }
}
.duty-time {
  color:var(--item-text,#354f60)
}
/* Dark surfaces, with user-selected duty colors left intact. */
:root[data-theme=dark] {
  color-scheme:dark;
  background:#10171e;
  color:#e5edf3;
  --line:#394652;
  --off:#3b2e32;
  --ink:#245c74;
  --today:#276c88;
  --selection:#58bedc
}
:root[data-theme=dark] :is(.app,dialog,.cell,.quiet,.square) {
  background:#151e27;
  color:#e5edf3
}
:root[data-theme=dark] .cell.outside {
  background:#111920
}
:root[data-theme=dark] .night-pair>.cell {
  background:transparent
}
:root[data-theme=dark] :is(input,select,textarea) {
  background:#202d38;
  color:#e5edf3;
  border-color:#4b5c69
}
:root[data-theme=dark] :is(.weekdays,th) {
  background:#202d38;
  color:#bacbd8
}
:root[data-theme=dark] :is(.eyebrow,.muted,.hint,.wheel-label,.month-chevron,legend,th,.leave-brief,.leave-help summary,.other-leave-group>h3,.rotation-grid caption) {
  color:#b0c2ce
}
:root[data-theme=dark] .cell-note {
  color:inherit;
  border-color:currentColor
}
:root[data-theme=dark] .duty.off:not(.public-holiday):not(.annual-leave) {
  color:#f1dfe4
}
:root[data-theme=dark] :is(.weekdays .sun,.cell.is-sunday .date-number,.cell.is-public-date .date-number) {
  color:#ffaca4
}
:root[data-theme=dark] :is(.weekdays .sat,.cell.is-saturday .date-number) {
  color:#91c8ff
}
:root[data-theme=dark] .cell.today .date-number {
  color:#fff
}
:root[data-theme=dark] .holiday-mark {
  background:#5a3235;
  color:#ffd6d0
}
:root[data-theme=dark] .change-dot {
  box-shadow:0 0 0 1px #151e27
}
:root[data-theme=dark] :is(.error,.edit-change-status,.over-limit) {
  color:#ffaca4
}
:root[data-theme=dark] :is(.leave-remaining,a,.text-button) {
  color:#8fd4ef
}
:root[data-theme=dark] :is(.warning,.notice) {
  background:#423720;
  color:#ffe4ad
}
:root[data-theme=dark] .leave-day-status {
  background:#233c31;
  color:#d5f1e1
}
:root[data-theme=dark] .month-wheel-frame {
  background:linear-gradient(#151e27,#263441 38%,#263441 62%,#151e27)
}
:root[data-theme=dark] .wheel-item {
  color:#a3b5c3
}
:root[data-theme=dark] .wheel-item.active {
  color:#f1f7fc
}
:root[data-theme=dark] .rotation-grid td {
  background:#202d38;
  color:#e5edf3;
  border-color:#4b5c69
}
:root[data-theme=dark] .rotation-grid .rotation-off {
  background:#492e32;
  color:#ffd5ce
}
:root[data-theme=dark] .rotation-grid .rotation-ake {
  background:#283650;
  color:#e5edff
}
:root[data-theme=dark] td button {
  background:#2b4253;
  color:#b9e6ff
}
:root[data-theme=dark] .primary:disabled {
  background:#34424d;
  color:#95a6b3
}
:root[data-theme=dark] #leave-dialog .dialog-head,:root[data-theme=dark] #settings-dialog>.dialog-head,:root[data-theme=dark] #leave-form>.dialog-actions {
  background:#151e27
}
/* Compact, progressive disclosure for leave and settings. */
#label-settings {
  display:block
}
.appearance-group {
  padding:12px 0
}
.item-list {
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  margin-top:10px
}
.label-row {
  display:block;
  padding:0 12px
}
.label-row>.label-code {
  display:list-item;
  padding:12px 0;
  font-size:1rem
}
.label-row>.label-fields {
  margin:0 0 12px
}
.label-row>.item-color-toggle {
  margin:12px 0
}
.label-row>.item-color-pickers {
  margin-bottom:12px
}
.label-row label,.color-pickers label {
  font-size:.875rem
}
.leave-card {
  padding:0 12px;
  margin-top:8px
}
.leave-summary {
  padding:12px 0
}
.leave-name {
  display:inline;
  font-size:1rem
}
.leave-brief {
  display:block;
  font-size:.875rem;
  color:#526a79;
  font-weight:400;
  margin-top:3px
}
.leave-card>.hint {
  margin-bottom:12px
}
.other-leave-group>h3 {
  font-size:.875rem;
  color:#526a79;
  margin:20px 0 8px
}
.unused-leave {
  margin-top:8px;
  padding:10px 0
}
.leave-help {
  padding:10px 0
}
.leave-help summary {
  font-size:.875rem;
  color:#526a79
}
#settings-dialog details details {
  margin-left:6px
}
#settings-dialog form>details,#settings-dialog>details {
  padding:14px 0
}
#leave-dialog .dialog-head,#settings-dialog>.dialog-head {
  position:sticky;
  top:-20px;
  background:white;
  z-index:3;
  padding:8px 0 12px
}
#leave-form>.dialog-actions {
  position:sticky;
  bottom:-20px;
  background:white;
  padding:12px 0;
  margin-top:12px;
  border-top:1px solid var(--line)
}
.profile-periods {
  display:grid;
  gap:8px;
  margin:4px 0 18px
}
.profile-period {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px
}
.profile-period span {
  font-size:.9rem;
  line-height:1.45
}
.profile-period small {
  display:block;
  color:var(--muted);
  margin-top:2px
}
.profile-period .quiet {
  flex:0 0 auto;
  padding:7px 10px
}
.rotation-editor-dialog{width:min(94vw,720px)}
.rotation-editor-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:16px 0}
.rotation-editor-grid label{min-width:0;font-size:.75rem;text-align:center;gap:3px}
.rotation-editor-grid input{width:100%;min-width:0;padding:10px 0;text-align:center;font-size:1rem;border-radius:6px}
.rotation-editor-actions,.rotation-anchor-fields{display:flex;gap:10px;margin:12px 0}
.rotation-anchor-fields>*{flex:1;min-width:0}
.rotation-editor-dialog fieldset{min-width:0;margin:20px 0;padding:12px;border:1px solid var(--line,#ccd5da);border-radius:12px}
.rotation-editor-grid select{width:100%;min-width:0;padding:10px 0;text-align:center;font-size:.9rem;border-radius:6px;background-image:none}
.timetable-editor-dialog{width:min(94vw,720px)}
.timetable-editor-dialog fieldset{min-width:0;border:1px solid var(--line,#ccd5da);border-radius:10px;padding:12px;margin:14px 0}
.timetable-duty{border-bottom:1px solid var(--line,#ccd5da);padding:12px 0}
.timetable-duty summary{font-weight:700;padding:8px 0}
.timetable-duty input[type=time]{min-width:0;width:100%}
#tt-edit{border:0;padding:0}
#tt-rows{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin:16px 0}
.timetable-duty{min-width:0;padding:12px;border:1px solid var(--line,#ccd5da);border-radius:12px}
.timetable-duty h3{font-size:1rem;margin:0 0 8px}
.timetable-duty .rotation-anchor-fields{margin:8px 0;gap:8px}
.timetable-duty label{font-size:.875rem}
.timetable-duty input,.timetable-duty select{font-size:1rem;min-height:44px}
.timetable-duty fieldset{margin:8px 0;padding:8px}
.timetable-duty .quiet{padding:8px 12px;min-height:44px}
.timetable-editor-dialog .rotation-editor-actions{flex-wrap:wrap}
@media(min-width:720px){#tt-rows{grid-template-columns:repeat(2,minmax(0,1fr))}}

.app-version {
  margin:1.25rem 0 0;
  text-align:center;
  font-size:0.8125rem;
  font-weight:400;
  letter-spacing:0.06em;
  font-variant-numeric:tabular-nums;
}

.app-version{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap}
.app-version img{width:24px;height:24px;border-radius:6px;flex-shrink:0}
.app-version-name{font-size:.875rem;font-weight:600;letter-spacing:normal}
/* Use the reclaimed header space without squeezing notes or badges. */
.calendar {
  grid-auto-rows:minmax(var(--fit-row,calc((100svh - 140px) / 6)),auto)
}
.calendar .cell,:root[data-text-size=large] .calendar .cell {
  min-height:0
}
:root[data-cell-height=compact] .calendar {
  grid-auto-rows:minmax(min(100px,var(--fit-row,100px)),auto)
}
:root[data-cell-height=roomy] .calendar {
  grid-auto-rows:minmax(max(var(--cell-height),var(--fit-row,0px)),auto)
}
.calendar .cell {
  padding-top:4px;
  padding-bottom:4px;
  gap:2px
}
.calendar .duty {
  gap:1px;
  padding-top:3px;
  padding-bottom:3px
}
.night-pair::before {
  top:28px;
  bottom:4px
}
.calendar .date-line {
  flex:0 0 22px
}
.calendar .duty-code,.calendar .duty-time {
  flex-shrink:0
}
.calendar .duty-footer {
  display:flex;
  flex-direction:column;
  gap:2px;
  margin-top:auto;
  min-width:0;
  padding-top:2px;
  flex-shrink:0
}
.calendar .duty-footer:empty {
  display:none
}
.calendar .cell-note {
  margin:0;
  font-size:.75rem;
  line-height:1.4;
  max-height:calc(3 * 1.4em + 5px);
  flex-shrink:0
}
:root[data-memo-lines="1"] .calendar .cell-note {
  display:block;
  white-space:nowrap;
  text-overflow:ellipsis;
  max-height:calc(1.4em + 5px)
}
.calendar .entry-badge {
  margin-top:0;
  align-self:center
}
.monthbar {
  gap:8px
}
.monthnav {
  flex-shrink:0
}
.month-heading {
  min-width:0
}
@media(max-width:360px) {
  .monthnav {
    gap:3px
  }
  .monthnav .square,.monthnav .app-menu>summary {
    width:38px
  }
  .monthnav .quiet {
    padding-inline:8px
  }
  .month-heading .month-title {
    font-size:1.8rem
  }
}
.rotation-cell{min-width:0;display:grid;gap:4px;text-align:center}
.rotation-cell>span{font-size:.75rem;color:var(--muted)}
.rotation-cell-button{width:100%;min-height:48px;padding:6px 2px;overflow-wrap:anywhere;font-weight:700}
.rotation-cell-button small{display:block;font-size:.75rem}
.rotation-picker{width:min(480px,calc(100% - 24px));max-height:85dvh;overflow:auto;padding:18px}
.rotation-picker h3{font-size:1rem;margin:18px 0 10px}
.rotation-choice-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.rotation-choice{min-height:52px;padding:8px 3px;overflow-wrap:anywhere}
.rotation-choice small{display:block;font-size:.75rem;font-weight:400}
.rotation-choice:disabled{opacity:.45}
.rotation-choice[aria-pressed=true]{outline:2px solid var(--primary,#143e56);outline-offset:1px;font-weight:700}
.tt-tabs{display:flex;gap:6px;margin:12px 0;position:sticky;top:0;z-index:1;background:var(--surface,#fff);padding:8px 0}
.tt-tabs button{flex:1;padding:10px 4px;font-size:.9rem}
.tt-tabs button[aria-pressed=true]{background:#143e56;color:white}
.timetable-editor-dialog #tt-rows{display:block}
.timetable-editor-dialog .timetable-duty{padding:10px 0;border:0;border-bottom:1px solid var(--line,#ccd5da);border-radius:0}
.timetable-editor-dialog .timetable-duty[hidden]{display:none}
.timetable-editor-dialog[data-view=register] .timetable-duty fieldset,.timetable-editor-dialog[data-view=register] .timetable-duty h3{display:none}
.timetable-editor-dialog:not([data-view=register]) .timetable-duty>.rotation-anchor-fields,.timetable-editor-dialog:not([data-view=register]) .timetable-duty>.item-color-toggle,.timetable-editor-dialog:not([data-view=register]) .timetable-duty>button{display:none}
.timetable-editor-dialog .timetable-duty fieldset{padding:4px 0;border:0;margin:4px 0;display:grid;grid-template-columns:48px minmax(0,1fr);align-items:center}
.timetable-editor-dialog .timetable-duty fieldset[hidden]{display:none}
.timetable-editor-dialog .timetable-duty legend{float:left;font-size:.8rem;padding:0}
.timetable-editor-dialog .timetable-duty input[type=time]{min-width:0;width:100%;padding:6px;font-size:1rem}
.timetable-editor-dialog .timetable-duty label{font-size:.8rem}
.timetable-editor-dialog .timetable-duty>button{padding:4px 10px;min-height:32px;font-size:.8rem}
.qr-dialog{width:min(560px,calc(100% - 24px));max-height:90dvh;overflow:auto}
.qr-dialog section{margin:16px 0}
.qr-dialog label{display:block;margin:12px 0}
.qr-dialog select{width:100%}
#qr-output{text-align:center}
#qr-canvas{display:block;width:100%;height:auto;max-width:480px;margin:12px auto;background:white;image-rendering:pixelated}
#qr-video{width:100%;max-height:45dvh;object-fit:contain;background:black;margin-top:12px}
#qr-summary{white-space:pre-line;overflow-wrap:anywhere}
#qr-message{overflow-wrap:anywhere}
.qr-dialog .action-row{flex-wrap:wrap;gap:8px}
.qr-dialog [hidden]{display:none!important}

#qr-download{min-width:8em}
#qr-download.save-feedback{background:#e6f3ed;color:#216347}
.save-feedback{animation:qr-save-pop .25s ease-out}
@keyframes qr-save-pop{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
.qr-preview-section{margin:12px 0;padding:12px;border:1px solid #a0aeb544;border-radius:12px}
.qr-times{width:100%;table-layout:fixed;border-collapse:collapse;font-size:.8125rem}
.qr-times th,.qr-times td{padding:10px 3px;border-bottom:1px solid #a0aeb533;text-align:center;overflow-wrap:anywhere}
.qr-times th:first-child{width:24%}
.qr-times small{display:block;font-weight:400;font-size:.75rem}
.qr-rotation{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));padding:0;list-style:none;border-top:1px solid #a0aeb566;border-left:1px solid #a0aeb566}
.qr-rotation li{min-width:0;padding:8px 1px;text-align:center;border-right:1px solid #a0aeb566;border-bottom:1px solid #a0aeb566;overflow-wrap:anywhere}
.qr-rotation small{display:block;font-size:.75rem;font-weight:400}
.qr-rotation strong{display:block;font-size:.8125rem;margin-top:4px}
:root[data-theme=dark] #qr-download.save-feedback{background:#173e32;color:#bbebd5}
@media(prefers-reduced-motion:reduce){.save-feedback{animation:none}}

.app-url-qr{display:block;width:100%;max-width:320px;height:auto;margin:20px auto;background:#fff;image-rendering:pixelated}
.app-share-link{text-align:center;overflow-wrap:anywhere;font-size:.875rem}
