:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: #172642;
  background: #f3f5fa;
  --muted: #52617a;
  --line: #dce3ee;
  --navy: #172642;
  --radius: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
body { margin: 0; line-height: 1.5; }
a { color: inherit; }
button, input { font: inherit; }
button, a.button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #527cbd;
  outline-offset: 3px;
}
.wrap { width: min(1040px, calc(100% - 40px)); margin-inline: auto; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner, .hero-top, .section-heading, .panel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header-inner { min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; }
.brand-icon {
  width: 22px;
  height: 20px;
  background: var(--navy);
  border-radius: 5px;
  position: relative;
}
.brand-icon::before {
  content: "";
  position: absolute;
  inset: 6px 4px 4px;
  border-top: 1px solid #acc5ef;
  background: radial-gradient(circle at 4px 5px, #fff 1px, transparent 1.6px),
    radial-gradient(circle at 10px 5px, #fff 1px, transparent 1.6px);
}
.zone, .section-heading > span, footer { color: var(--muted); font-size: .875rem; }
main.wrap { padding-top: 32px; }
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 28px;
  color: #fff;
  background: var(--navy);
  padding: clamp(20px, 4.5vw, 44px);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before { width: 530px; height: 530px; right: -230px; top: -330px; background: #203556; }
.hero::after { width: 394px; height: 394px; right: -164px; top: -250px; border: 1px solid #47618b; }
.hero-top { align-items: end; margin-bottom: 25px; }
.eyebrow { margin: 0 0 5px; color: #c5d6f1; font-size: .875rem; letter-spacing: .12em; }
h1 { margin: 0; font-size: clamp(1.78rem, 5vw, 3.1rem); letter-spacing: .015em; line-height: 1.17; }
h2 { margin: 0; font-size: 1.22rem; }
.share-button, .button, button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 13px;
  min-height: 42px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 700;
  font-size: .875rem;
}
.share-button { color: #fff; border-color: #7790b8; background: #ffffff12; }
.share-button:hover { background: #ffffff28; }
.button { background: #fff; color: var(--navy); }
.button:hover { background: #edf2fa; }
.button.disabled { opacity: .45; cursor: default; }
button { color: #fff; background: var(--navy); border-color: var(--navy); }
button:hover { background: #304a72; }
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.day { --shift-bg: #dce7fa; --shift-ink: #264e8a; }
.afternoon { --shift-bg: #fce4d4; --shift-ink: #8e3e23; }
.night { --shift-bg: #e5e0fa; --shift-ink: #553d91; }
.off { --shift-bg: #deeee0; --shift-ink: #2a6245; }
.shift-panel, .lookup-result { background: var(--shift-bg); color: var(--shift-ink); }
.shift-panel { padding: clamp(14px, 3vw, 26px); border-radius: 17px; display: grid; gap: 9px; }
.panel-label { font-size: .875rem; font-weight: 700; }
.panel-label span { padding: 2px 9px; border-radius: 6px; background: #ffffff8c; }
.panel-label time { font-variant-numeric: tabular-nums; }
.shift-panel strong { font-size: clamp(1.8rem, 5vw, 3.6rem); line-height: 1.14; }
.phase { font-size: .875rem; }
.surface, .snapshot { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.surface { padding: clamp(15px, 3vw, 26px); }
.snapshot { padding: 12px 16px; margin-bottom: 14px; }
.cycle, .tools, .share { margin-top: 18px; }
.cycle-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 13px; }
.cycle-shift { min-width: 0; color: var(--shift-ink); background: var(--shift-bg); border-radius: 11px; padding: 8px; text-align: center; font-size: .875rem; font-weight: 750; }
.cycle-days { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin-top: 6px; }
.cycle-days span { border-radius: 5px; padding-block: 2px; background: #ffffff91; }
.cycle-days .current { background: var(--shift-ink); color: #fff; }
.tools { display: grid; grid-template-columns: minmax(245px, .7fr) minmax(0, 1.3fr); gap: 18px; align-items: start; }
.lookup label, .share label { display: block; font-size: .875rem; font-weight: 700; margin: 14px 0 6px; }
.query { display: flex; align-items: stretch; gap: 8px; }
input { min-width: 0; background: #fff; border: 1px solid #aab8cc; border-radius: 9px; color: var(--navy); padding: 8px; min-height: 42px; }
.query input { flex: 1; }
.input-error { color: #972d28; margin-bottom: 0; }
.lookup-result { display: grid; gap: 3px; padding: 15px; margin: 17px 0 10px; border-radius: 12px; }
.lookup-result strong { font-size: 2rem; line-height: 1.23; }
.lookup-result span, .return { font-size: .875rem; }
.calendar nav { display: flex; gap: 6px; }
.weekdays, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.weekdays { text-align: center; margin: 13px 0 5px; color: var(--muted); font-size: .875rem; }
.cell, .empty {
  min-height: 56px;
  background: #f5f7fb;
  border: 1px solid transparent;
  border-radius: 8px;
}
.empty { background: #f8f9fc; }
.cell {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: .875rem;
}
.cell:hover { background: #eaf0fa; }
.cell.selected { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: #fff; }
.day-number { font-variant-numeric: tabular-nums; position: relative; }
.today-dot { position: absolute; top: 3px; left: calc(100% + 2px); width: 5px; height: 5px; border-radius: 50%; background: #244779; }
.chip, .legend span { color: var(--shift-ink); background: var(--shift-bg); font-weight: 700; border-radius: 5px; padding: 0 5px; }
.legend { display: flex; flex-wrap: wrap; gap: 5px; font-size: .875rem; margin-top: 13px; }
.legend span { padding: 2px 7px; }
.holiday-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.holiday-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding-inline: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .875rem;
  cursor: pointer;
}
.holiday-controls input {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  margin: 0;
  accent-color: var(--navy);
}
.month-grid:has(.holiday-mark:not([hidden])) .cell {
  min-height: 74px;
  justify-content: start;
  padding-top: 5px;
}
.cell-holidays, .holiday-legend, .date-holidays {
  display: flex;
  align-items: center;
}
.cell-holidays { gap: 2px; }
.holiday-legend, .date-holidays {
  flex-wrap: wrap;
  gap: 5px 10px;
  font-size: .875rem;
}
.holiday-legend:has(> :not([hidden])) { margin-top: 8px; }
.date-holidays:has(> :not([hidden])) { margin-bottom: 10px; }
.holiday-mark {
  display: inline-block;
  border-radius: 4px;
  padding: 0 2px;
  background: #f9e1e5;
  color: #872846;
  font-size: .75rem;
  line-height: 1.35;
  font-weight: 750;
}
.holiday-mark.makeup { background: #f9ead0; color: #704b0d; }
.holiday-mark[data-holiday="jp"] { background: #dceef0; color: #15566a; }
.date-holidays .holiday-mark { padding: 4px 7px; font-size: .875rem; }
.holiday-coverage p { font-size: .875rem; margin: 8px 0 0; color: var(--muted); }
.share p { margin: 6px 0 0; color: var(--muted); }
.share input { width: min(100%, 430px); }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
footer { padding: 20px 0 26px; text-align: center; }

@media (max-width: 680px) {
  .wrap { width: calc(100% - 24px); }
  .header-inner { min-height: 53px; }
  main.wrap { padding-top: 16px; }
  .hero { border-radius: 20px; }
  .hero-top { margin-bottom: 16px; }
  .panels { gap: 8px; }
  .shift-panel { border-radius: 12px; }
  .panel-label { align-items: start; flex-direction: column; gap: 4px; }
  .tools { grid-template-columns: 1fr; }
}

@media (max-width: 370px) {
  .hero { padding-inline: 13px; }
  .share-button { padding-inline: 8px; }
  .cycle-track { gap: 4px; }
  .cycle-shift { padding-inline: 4px; }
  .month-grid { gap: 3px; }
  .chip { padding-inline: 2px; }
}
