:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: #09090b;
  background: #fff;
  --A: #c45650;
  --B: #ac7d22;
  --C: #4e8c79;
  --D: #4e8fbd;
  --E: #8978c6;
  --U: #9aa3ad;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 0;
  background: none;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.app {
  max-width: 834px;
  margin: auto;
  min-height: 100dvh;
  padding-bottom: 126px;
  background: #fff;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 18px 10px;
}
.grow {
  flex: 1;
}
.glass,
.cluster {
  background: rgba(248, 248, 250, 0.94);
  border: 1px solid rgba(220, 220, 224, 0.62);
  box-shadow:
    0 11px 28px rgba(60, 60, 67, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}
.glass {
  border-radius: 999px;
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 19px;
  font-weight: 600;
}
.cluster {
  border-radius: 999px;
  display: flex;
  overflow: hidden;
  padding: 0 2px;
}
.icon {
  width: 55px;
  height: 48px;
  display: grid;
  place-items: center;
}
.icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: #111;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.back {
  font-size: 42px;
  line-height: 0;
  font-weight: 300;
  margin-top: -4px;
}
.month-title {
  font-size: 48px;
  line-height: 1.05;
  letter-spacing: -1.8px;
  font-weight: 720;
  padding: 16px 21px 13px;
  margin: 0;
}
.weekdays,
.grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
}
.weekdays {
  font-size: 13px;
  font-weight: 650;
  padding-bottom: 5px;
}
.weekdays span:first-child,
.weekdays span:last-child {
  color: #8e8e93;
}
.grid {
  border-top: 1px solid #d7d7dc;
}
.day {
  min-height: 64px;
  border-bottom: 1px solid #ececef;
  padding: 5px 2px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.day.blank {
  pointer-events: none;
}
.num {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
}
.day.weekend .num {
  color: #8e8e93;
}
.day.selected:not(.today) .num {
  background: #ededf1;
}
.day.today .num {
  background: #ff453a !important;
  color: #fff !important;
  font-weight: 650;
}
.track {
  display: flex;
  width: 72%;
  max-width: 46px;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 5px;
  background: #d5f2f5;
}
.seg {
  height: 100%;
  min-width: 4px;
  flex: 1;
}
.work {
  background: #b7e9ee;
}
.private {
  background: #d868e9;
}
.info {
  background: #9aa9bd;
}
.la {
  background: #d66b74;
}
.lb {
  background: #9cc7e8;
}
.lc {
  background: #8fd4d6;
}
.ld {
  background: #82caa6;
}
.le {
  background: #d868e9;
}
.lu {
  background: #9aa9bd;
}
.list {
  padding: 8px 13px 4px;
}
.event {
  width: 100%;
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) 64px;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 13px 8px;
  border-bottom: 1px solid #e6e6e8;
  min-height: 78px;
}
.stripe {
  height: 52px;
  width: 4px;
  border-radius: 999px;
  background: var(--lev, #95e2e8);
}
.main {
  min-width: 0;
}
.main strong {
  display: block;
  font-size: 19px;
  line-height: 1.28;
  letter-spacing: -0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.main small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.times {
  text-align: right;
}
.times b,
.times small {
  display: block;
  font-size: 16px;
  font-weight: 500;
}
.times small {
  margin-top: 6px;
  color: #9a9aa0;
  font-size: 15px;
}
.bottom {
  position: fixed;
  z-index: 22;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 834px);
  display: flex;
  align-items: center;
  padding: 10px 28px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.99) 55%,
    rgba(255, 255, 255, 0)
  );
  pointer-events: none;
}
.bottom > * {
  pointer-events: auto;
}
.bottom .today {
  min-width: 92px;
  justify-content: center;
  font-size: 18px;
}
.bottom .icon {
  width: 65px;
  height: 52px;
}
.foot {
  font-size: 10px;
  color: #aaa;
  text-align: center;
  padding: 14px 18px 0;
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #f2f2f7;
  overflow: auto;
  display: none;
}
.overlay.open {
  display: block;
}
.sheethead {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: calc(16px + env(safe-area-inset-top)) 18px 12px;
  background: rgba(242, 242, 247, 0.96);
  backdrop-filter: blur(18px);
}
.sheethead strong {
  font-size: 18px;
}
.sheethead .left {
  justify-self: start;
}
.sheethead .right {
  justify-self: end;
}
.pill {
  min-height: 46px;
  border-radius: 999px;
  padding: 0 17px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #e3e3e8;
  box-shadow: 0 8px 22px rgba(60, 60, 67, 0.08);
  font-size: 17px;
}
.body {
  padding: 12px 18px calc(40px + env(safe-area-inset-bottom));
}
.body h1 {
  font-size: 31px;
  line-height: 1.2;
  letter-spacing: -1px;
  margin: 10px 0 16px;
}
.subactions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -5px 0 15px;
}
.blue {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e3e3e8;
  color: #0a84ff;
  font-weight: 600;
}
.date,
.time {
  font-size: 17px;
  margin: 0 0 5px;
}
.mini {
  height: 146px;
  margin: 18px 0 22px;
  border-radius: 22px;
  background: #fff;
  overflow: hidden;
  padding: 10px 14px;
  position: relative;
}
.mini:before {
  content: "";
  position: absolute;
  left: 52px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: #ececf0;
}
.mini .axis {
  position: absolute;
  left: 14px;
  top: 12px;
  color: #9a9aa0;
  font-size: 12px;
  line-height: 44px;
}
.minievent {
  position: absolute;
  left: 66px;
  right: 14px;
  border-left: 4px solid var(--lev, #75d5df);
  border-radius: 6px;
  background: #d6e5e4;
  padding: 4px 7px;
  overflow: hidden;
  font-size: 11px;
}
.minievent.focus {
  background: #a8e6ec;
}
.minievent b,
.minievent small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.minievent small {
  color: #636366;
  font-size: 10px;
}
.group {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  margin: 16px 0;
}
.row {
  min-height: 58px;
  padding: 14px 17px;
  border-bottom: 1px solid #e5e5ea;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  font-size: 16px;
}
.row:last-child {
  border-bottom: 0;
}
.row > span:last-child {
  color: #8e8e93;
  text-align: right;
  max-width: 64%;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 9px;
  padding: 5px 10px;
  background: #f4e8e8;
  color: var(--lev);
  font-weight: 700;
  font-size: 13px;
}
.caldot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
  background: #a9e5ec;
}
.danger {
  width: 100%;
  min-height: 54px;
  border-radius: 20px;
  background: #fff;
  color: #ff453a;
  margin-top: 14px;
  font-size: 17px;
}
.secondary {
  width: 100%;
  min-height: 54px;
  border-radius: 20px;
  background: #fff;
  margin-top: 14px;
  font-size: 17px;
}
.note {
  font-size: 10px;
  color: #9a9aa0;
  text-align: center;
  margin: 20px 0;
}
.calendar-modal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100dvh - 62px);
  z-index: 60;
  background: #f2f2f7;
  border-radius: 38px 38px 0 0;
  overflow: auto;
  display: none;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.1);
}
.calendar-modal.open {
  display: block;
}
.shade {
  position: fixed;
  inset: 0;
  background: rgba(60, 60, 67, 0.22);
  backdrop-filter: blur(10px);
  z-index: 59;
  display: none;
}
.shade.open {
  display: block;
}
.calhead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 18px 10px;
}
.x {
  width: 49px;
  height: 49px;
  border-radius: 50%;
  background: #fff;
  font-size: 34px;
}
.calbody {
  padding: 12px 17px 40px;
}
.calbody h3 {
  font-size: 18px;
  color: #77777d;
  margin: 16px 18px 8px;
}
.card {
  background: #fff;
  border-radius: 25px;
  overflow: hidden;
}
.calrow {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr 36px;
  align-items: center;
  min-height: 66px;
  margin-left: 18px;
  border-bottom: 1px solid #e6e6e8;
  font-size: 19px;
}
.calrow:last-child {
  border: 0;
}
.calrow input {
  position: absolute;
  opacity: 0;
}
.check {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: #a9e5ec;
  font-weight: 800;
}
.calrow.private-row .check {
  background: #d868e9;
}
.calrow.info-row .check {
  background: #63b984;
}
.calrow input:not(:checked) + .check {
  background: #d0d0d5;
  color: transparent;
}
.ci {
  color: #ff453a;
  font-size: 26px;
}
.legend {
  display: grid;
  grid-template-columns: 28px 32px 1fr;
  align-items: center;
  min-height: 54px;
  margin-left: 18px;
  border-bottom: 1px solid #e6e6e8;
}
.legend:last-child {
  border: 0;
}
.ldot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--lev);
}
.muted {
  color: #8e8e93;
}
.calnote {
  font-size: 12px;
  line-height: 1.6;
  color: #8e8e93;
  padding: 12px 18px;
}
.edit .body {
  padding-top: 6px;
}
.edit input,
.edit select,
.edit textarea {
  font-size: 16px;
  border: 0;
  background: #fff;
  color: #111;
}
.edit .field {
  width: 100%;
  padding: 15px 17px;
  border-bottom: 1px solid #e5e5ea;
  outline: none;
}
.edit textarea {
  min-height: 90px;
}
.edit .row select {
  max-width: 55%;
  text-align: right;
}
.edit .row input[type="checkbox"] {
  width: 24px;
  height: 24px;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.box {
  background: #fff;
  border-radius: 18px;
  padding: 12px;
}
.box label {
  font-size: 12px;
  color: #8e8e93;
}
.box input {
  width: 100%;
  padding: 10px;
  background: #f7f7fa;
  border-radius: 11px;
  margin: 6px 0;
}
.timepair {
  display: grid;
  grid-template-columns: 1fr 6px 1fr;
  align-items: center;
  gap: 4px;
}
.timepair select {
  width: 100%;
  padding: 10px 2px;
  background: #f7f7fa;
  border-radius: 11px;
}
.levels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}
.levbtn {
  min-height: 70px;
  border-radius: 15px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e4e4e8;
  color: var(--lev);
}
.levbtn.active {
  box-shadow: inset 0 0 0 2px var(--lev);
  background: #f7eeee;
}
.levbtn b {
  display: block;
  font-size: 23px;
}
.levbtn small {
  font-size: 9px;
}
.save {
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
  background: #0a84ff;
  color: #fff;
  font-weight: 700;
  margin-top: 12px;
}
.search {
  padding: 0 18px;
}
.search input {
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  font-size: 17px;
}
.results {
  padding: 8px 0;
}
.empty {
  padding: 24px;
  color: #8e8e93;
  text-align: center;
}
@media (max-width: 360px) {
  .toolbar {
    padding-left: 12px;
    padding-right: 12px;
  }
  .glass {
    padding: 0 13px;
    font-size: 16px;
  }
  .icon {
    width: 44px;
  }
  .month-title {
    font-size: 40px;
  }
  .day {
    min-height: 58px;
  }
  .num {
    width: 31px;
    height: 31px;
    font-size: 17px;
  }
  .event {
    grid-template-columns: 5px minmax(0, 1fr) 58px;
    gap: 8px;
  }
  .main strong {
    font-size: 16px;
  }
  .times b,
  .times small {
    font-size: 14px;
  }
}
/* v4: responsibility views, stable search border, mobile form bounds. */
[hidden] {
  display: none !important;
}
button {
  cursor: pointer;
}
button:focus-visible {
  outline: 3px solid #80b4ed;
  outline-offset: 2px;
}
body.has-overlay {
  overflow: hidden;
}
.overlay.open {
  overscroll-behavior: contain;
}
.scope-wrap {
  padding: 5px 18px 0;
}
.scope-switch {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 0.65fr;
  gap: 3px;
  padding: 4px;
  background: #efeff3;
  border-radius: 13px;
}
.scope-switch button {
  min-height: 38px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  color: #74747c;
}
.scope-switch button.active {
  background: #fff;
  box-shadow: 0 2px 6px #00000012;
  color: #111;
}
.month-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.month-line .month-title {
  padding-top: 15px;
}
.month-arrows {
  display: flex;
  gap: 8px;
  padding-right: 18px;
}
.month-arrows button {
  width: 40px;
  height: 42px;
  color: #797984;
  font-size: 30px;
}
.day-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 13px 20px 6px;
  font-size: 12px;
  flex-wrap: wrap;
}
.day-summary > b {
  font-size: 13px;
}
.day-summary > span {
  color: #72727b;
}
.day-summary strong {
  color: #24242b;
}
.divider {
  padding: 0 7px;
  color: #b7b7c0;
}
.pending-count {
  display: inline-block;
  margin-left: 7px;
  border-radius: 6px;
  padding: 3px 5px;
  background: #fff0d8;
  color: #865109;
  font-size: 10px;
}
.scope-note {
  color: #85858f;
  font-size: 10px;
  padding: 0 20px;
  margin: 3px 0 0;
  line-height: 1.7;
}
.event {
  grid-template-columns: 6px minmax(0, 1fr) 43px;
  gap: 9px;
  min-height: 90px;
}
.main strong {
  font-size: 17px;
  letter-spacing: -0.5px;
  line-height: 1.4;
}
.start-inline {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
}
.stripe {
  height: calc(100% - 4px);
  min-height: 48px;
}
.event-tags,
.detail-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 5px;
}
.owner-tag,
.state-tag {
  font-size: 10px;
  padding: 2px 6px;
  line-height: 1.5;
  border-radius: 5px;
  background: #edf5f4;
  color: #526f68;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.partner-tag {
  background: #f0eafb;
  color: #765798;
}
.state-tag.confirmed {
  background: #e8f3ec;
  color: #3e7150;
}
.state-tag.requested {
  background: #fff0d8;
  color: #895510;
}
.state-tag.cancelled {
  background: #ededf0;
  color: #797981;
}
.level-small {
  color: var(--lev);
  font-weight: 650 !important;
  font-size: 14px !important;
}
.times small {
  font-size: 12px;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.cancelled-event {
  opacity: 0.58;
}
.cancelled-event .main strong {
  text-decoration: line-through;
}
.detail-tags {
  margin: 15px 0;
}
.detail-tags .owner-tag,
.detail-tags .state-tag {
  font-size: 12px;
}
.assignment-note {
  font-size: 12px;
  line-height: 1.7;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff0d8;
  color: #735320;
  margin-top: 12px;
}
.assignment-note.confirmed {
  background: #e8f3ec;
  color: #456952;
}
.assignment-note.cancelled {
  background: #e7e7ec;
  color: #686870;
}
.memo-value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.row > span {
  overflow-wrap: anywhere;
}
.body {
  max-width: 834px;
  margin: 0 auto;
}
.sheethead {
  gap: 6px;
  grid-template-columns: minmax(70px, 1fr) auto minmax(70px, 1fr);
}
.sheethead strong {
  font-size: 16px;
}
.sheethead .pill {
  padding: 0 13px;
  font-size: 16px;
}
.edit .pair > div {
  min-width: 0;
}
.edit .box input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  height: 47px;
  padding: 6px;
  font-size: 14px;
}
.edit .row select {
  min-width: 0;
  font-size: 14px;
}
.field-label {
  display: block;
  font-size: 12px;
  color: #777781;
  padding: 15px 17px 0;
}
.form-hint {
  font-size: 11px;
  line-height: 1.7;
  padding: 0 17px 12px;
  color: #85858e;
  margin: 9px 0 0;
}
.form-error {
  color: #c43735;
  font-size: 13px;
  line-height: 1.5;
  margin: 14px 0 4px;
}
.form-error:empty {
  display: none;
}
.edit .field:focus {
  outline: 2px solid #80b4ed;
  outline-offset: -2px;
}
.timepair select:disabled {
  color: #aaa;
  opacity: 0.6;
}
.year-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.search-top {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #f2f2f7;
  padding-bottom: 7px;
  isolation: isolate;
}
.search-top .sheethead {
  position: static;
  background: #f2f2f7;
  backdrop-filter: none;
  padding-bottom: 9px;
}
.search {
  padding: 10px 18px 0;
  max-width: 834px;
  margin: auto;
  overflow: visible;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 2px solid #dedee7;
  border-radius: 16px;
  padding: 0 12px;
  min-height: 54px;
  position: relative;
  isolation: isolate;
}
.search-box:focus-within {
  border-color: #80b4ed;
  box-shadow: inset 0 0 0 1px #80b4ed;
}
.search-box > svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  stroke: #858590;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.search .search-box input {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  flex: 1;
  min-width: 0;
  width: 0;
  min-height: 50px;
  padding: 9px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111;
  font-size: 17px;
  outline: none !important;
  box-shadow: none !important;
  scroll-margin-top: 120px;
}
.search-box input::-webkit-search-cancel-button,
.search-box input::-webkit-search-decoration {
  appearance: none;
  -webkit-appearance: none;
}
.clear-search {
  width: 30px;
  height: 38px;
  flex: 0 0 30px;
  color: #8e8e96;
  font-size: 24px;
}
.search .scope-switch {
  margin-top: 12px;
  background: #e6e6ec;
}
.search .scope-switch button {
  min-height: 34px;
  font-size: 13px;
}
.period-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  font-size: 12px;
  color: #7d7d86;
}
.period-row select {
  min-height: 34px;
  max-width: 75%;
  border: 0;
  background: transparent;
  font-size: 14px;
  color: #55555f;
  padding: 4px 0;
}
.search-body {
  max-width: 834px;
  margin: auto;
  padding: 0 18px calc(35px + env(safe-area-inset-bottom));
}
.search-caption {
  font-size: 11px;
  color: #8a8a93;
  line-height: 1.65;
  margin: 9px 4px;
}
.result-count {
  color: #73737e;
  font-size: 12px;
  margin: 5px 4px 0;
}
.results {
  padding-top: 3px;
}
.results .event {
  padding-left: 4px;
  padding-right: 4px;
}
.results .main small {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.5;
  overflow: hidden;
}
.results .result-date {
  font-size: 11px;
  margin-top: 5px;
}
.results .result-note {
  font-size: 11px;
}
.foot {
  line-height: 1.7;
}
.note {
  line-height: 1.7;
}
.calrow input:focus-visible + .check {
  outline: 3px solid #80b4ed;
  outline-offset: 3px;
}
@media (max-width: 360px) {
  .scope-wrap {
    padding-left: 12px;
    padding-right: 12px;
  }
  .scope-switch button {
    font-size: 12px;
  }
  .main strong {
    font-size: 15px;
  }
  .event {
    grid-template-columns: 5px minmax(0, 1fr) 37px;
    gap: 7px;
  }
  .sheethead {
    padding-left: 12px;
    padding-right: 12px;
  }
  .sheethead strong {
    font-size: 14px;
  }
  .sheethead .pill {
    font-size: 14px;
    padding: 0 10px;
    min-height: 42px;
  }
  .search,
  .search-body {
    padding-left: 12px;
    padding-right: 12px;
  }
  .body {
    padding-left: 12px;
    padding-right: 12px;
  }
  .day-summary {
    padding-left: 17px;
    padding-right: 17px;
  }
  .month-title {
    font-size: 40px;
  }
  .owner-tag,
  .state-tag {
    font-size: 9px;
  }
}
/* v5 additions: preserve v4's month layout and search border structure. */
.schedule-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 11px 18px 2px;
}
.display-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: #efeff3;
  border-radius: 10px;
}
.display-switch button {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 13px;
  font-size: 13px;
  color: #777782;
}
.display-switch .active {
  background: #fff;
  color: #16161b;
  box-shadow: 0 1px 4px #00000012;
  font-weight: 650;
}
.check-button {
  min-height: 40px;
  border: 1px solid #d9e5e7;
  border-radius: 12px;
  padding: 0 12px;
  background: #f3fafb;
  color: #407a82;
  font-weight: 650;
  font-size: 13px;
}
.buffer-mini-note {
  color: #7a8990 !important;
  font-size: 10px !important;
}
.buffer-editor {
  margin-top: 20px;
}
.buffer-editor h3 {
  font-size: 17px;
  margin: 0 0 10px;
}
.buffer-editor h3 small {
  font-size: 11px;
  color: #8d8d97;
  font-weight: 400;
  margin-left: 7px;
}
.buffer-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.buffer-field {
  display: block;
  padding: 13px 12px;
  background: #fff;
  border: 1px solid #e6e9ed;
  border-radius: 17px;
  min-width: 0;
}
.buffer-field > b {
  display: block;
  font-size: 14px;
}
.buffer-field > small {
  display: block;
  font-size: 10px;
  color: #8b8b94;
  line-height: 1.7;
  white-space: normal;
  margin-top: 4px;
}
.edit .buffer-field select,
.buffer-field select {
  display: block;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  margin-top: 9px;
  height: 43px;
  border: 0;
  background: #f2f6f7;
  border-radius: 9px;
  padding: 0 7px;
  font-size: 13px;
  color: #2f5861;
}
.custom-margin {
  display: block;
  margin-top: 8px;
}
.edit .custom-margin input {
  width: 100%;
  max-width: 100%;
  border: 1px solid #c7d9df;
  border-radius: 8px;
  min-height: 42px;
  padding: 8px;
  background: #fff;
}
.custom-margin small {
  display: block;
  font-size: 9px;
  color: #777782;
  line-height: 1.7;
  margin-top: 4px;
}
.buffer-live {
  font-size: 12px;
  line-height: 1.7;
  padding: 12px 14px;
  background: #e9f3f4;
  color: #346b73;
  border-radius: 13px;
  margin: 10px 0;
}
.buffer-live.needs-check {
  background: #fff1dc;
  color: #8b6330;
}
.buffer-editor .form-hint {
  padding: 0 3px 0;
  margin-top: 7px;
  font-size: 10px;
}
.buffer-detail {
  background: #fff;
  padding: 14px;
  border-radius: 22px;
  margin: 16px 0;
}
.buffer-detail-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.buffer-detail-title > b {
  font-size: 15px;
}
.buffer-detail-title .blue {
  min-height: 34px;
  font-size: 12px;
}
.buffer-phase {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  font-size: 12px;
  background: #eef5f6;
  border-left: 3px solid #a5cdd1;
  min-height: 40px;
}
.buffer-phase:first-of-type {
  border-radius: 8px 8px 0 0;
}
.buffer-phase.body {
  background: #d9edef;
  border-left-color: var(--lev);
  min-height: 54px;
}
.buffer-phase > b {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.buffer-phase > span {
  min-width: 70px;
}
.buffer-detail .buffer-live {
  margin-bottom: 0;
}
.axis-list {
  padding-top: 9px;
}
.timeline-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: #8a8b94;
  padding: 0 8px 9px;
}
.timeline-scroll {
  position: relative;
  max-height: 445px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #ececf0;
  border-radius: 16px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.timeline-canvas {
  position: relative;
  margin-top: 12px;
}
.hour-line {
  position: absolute;
  left: 48px;
  right: 8px;
  height: 1px;
  background: #e6e6ed;
  pointer-events: none;
}
.hour-line > span {
  position: absolute;
  left: -42px;
  top: -7px;
  font-size: 10px;
  color: #94949e;
  min-width: 33px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.timeline-lanes {
  position: absolute;
  left: 53px;
  right: 8px;
  top: 0;
  bottom: 0;
}
.timeline-event {
  position: absolute;
  overflow: hidden;
  min-height: 0;
  border-left: 3px solid var(--lev);
  border-radius: 5px;
  background: #d9edf0;
  padding: 3px 5px;
  text-align: left;
  z-index: 2;
  line-height: 1.35;
  color: #2e5a63;
}
.timeline-event b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 650;
}
.timeline-event small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  margin-top: 2px;
}
.timeline-event.before,
.timeline-event.after {
  background: repeating-linear-gradient(
    135deg,
    #eef6f8,
    #eef6f8 6px,
    #e5f0f3 6px,
    #e5f0f3 7px
  );
  border-left-color: #a8ced4;
  color: #567d85;
  padding: 0 5px;
  border-radius: 3px;
}
.timeline-event.before b,
.timeline-event.after b {
  font-size: 10px;
  line-height: 14px;
}
.timeline-event.unknown-buffer {
  border-right: 2px dashed #d9a859;
}
.timeline-event.tiny {
  padding-top: 0;
  padding-bottom: 0;
}
.timeline-event.tiny b {
  font-size: 9px;
  line-height: 12px;
}
.timeline-note {
  font-size: 10px;
  line-height: 1.65;
  color: #8d8e98;
  padding: 0 7px;
}
.all-day-items {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  padding: 6px 5px 10px;
}
.all-day-items > small {
  font-size: 10px;
  color: #8d8d97;
  margin-right: 5px;
}
.all-day-items > button {
  font-size: 11px;
  border-radius: 6px;
  background: #f2eef6;
  border-left: 3px solid var(--lev);
  padding: 6px;
  max-width: 85%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.availability h3 {
  font-size: 16px;
}
.test-notice {
  background: #fff;
  border: 1px solid #e0e7e8;
  border-radius: 17px;
  font-size: 12px;
  line-height: 1.8;
  color: #777983;
  padding: 13px 15px;
  margin-top: 4px;
}
.test-notice b {
  color: #425f65;
}
.availability .group {
  margin: 14px 0 9px;
}
.availability .row {
  padding: 13px 12px;
  font-size: 13px;
  gap: 9px;
}
.availability .row select {
  max-width: 65%;
  font-size: 12px;
  min-height: 38px;
}
.availability .form-hint {
  padding-left: 3px;
  padding-right: 3px;
}
.case-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 7px;
}
.case-buttons button {
  font-size: 11px;
  min-height: 37px;
  border-radius: 9px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid #e0e2e9;
  color: #58656c;
}
.case-caption {
  font-size: 10px;
  line-height: 1.65;
  color: #8b8b95;
  margin: 3px 0 17px;
}
.condition-check {
  display: flex;
  align-items: center;
  gap: 11px;
  background: #fff;
  padding: 14px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.7;
  margin-top: 18px;
}
.condition-check input {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  accent-color: #3b8a93;
}
.availability .save {
  background: #458b94;
}
.availability-result {
  margin-top: 22px;
}
.availability-result > .muted {
  font-size: 12px;
  line-height: 1.7;
  padding: 7px;
}
.decision {
  padding: 18px 17px;
  border-radius: 18px;
  border: 1px solid #d6e5e4;
  background: #e8f4ee;
  color: #365e4a;
}
.decision.review {
  background: #fff2df;
  border-color: #edddc3;
  color: #795923;
}
.decision.busy {
  background: #f9e9e8;
  border-color: #e8cfcb;
  color: #8e4d46;
}
.decision > small {
  font-size: 10px;
}
.decision h2 {
  font-size: 22px;
  line-height: 1.4;
  margin: 8px 0;
}
.decision p {
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 0;
}
.admin-reasons {
  margin-top: 20px;
}
.reason {
  background: #fff;
  border-radius: 13px;
  padding: 13px;
  margin: 8px 0;
}
.reason b {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.reason p {
  font-size: 12px;
  line-height: 1.75;
  margin: 5px 0 0;
  color: #737682;
}
.admin-reasons > p {
  font-size: 12px;
  line-height: 1.8;
}
.public-preview {
  margin: 22px 0 10px;
  border: 1px dashed #a4bec5;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}
.public-preview > small {
  font-size: 10px;
  color: #82929a;
}
.public-preview h3 {
  font-size: 17px;
  line-height: 1.5;
  margin: 10px 0;
}
.public-preview p {
  font-size: 12px;
  line-height: 1.7;
}
.public-preview .privacy-note {
  font-size: 10px;
  color: #91919b;
  margin-bottom: 0;
}
.test-rules {
  margin-top: 20px;
  font-size: 12px;
  color: #7b7b87;
  line-height: 1.9;
}
.test-rules summary {
  cursor: pointer;
  min-height: 40px;
}
.test-rules p {
  font-size: 11px;
}
.edit .buffer-field select:disabled {
  opacity: 0.55;
}
.buffer-editor select:focus-visible,
.custom-margin input:focus-visible {
  outline: 2px solid #80b4ed;
  outline-offset: 1px;
}
@media (max-width: 360px) {
  .schedule-controls {
    padding-left: 13px;
    padding-right: 13px;
    gap: 6px;
  }
  .display-switch button {
    padding: 0 10px;
    font-size: 12px;
  }
  .check-button {
    font-size: 12px;
    padding: 0 9px;
  }
  .buffer-field {
    padding: 11px 9px;
  }
  .buffer-field select {
    font-size: 12px !important;
    padding: 0 4px !important;
  }
  .buffer-field > small {
    font-size: 9px;
  }
  .buffer-phase {
    padding-left: 7px;
    padding-right: 7px;
    font-size: 11px;
  }
  .buffer-phase > b {
    font-size: 11px;
  }
  .availability .row {
    font-size: 12px;
  }
  .availability .row select {
    font-size: 11px;
  }
  .decision h2 {
    font-size: 20px;
  }
}

/* v5.1 input validation is separate from an availability/business result. */
.date-link-note {
  margin: 10px 2px 18px;
  line-height: 1.65;
}
[data-check-form] [aria-invalid="true"] {
  border: 2px solid #b94e49;
  outline: 2px solid #b94e4922;
  outline-offset: 1px;
}
.decision.input-error {
  background: #fff3f1;
  border-color: #e1b3ae;
  color: #783e39;
}
.decision.input-error p {
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
[data-check-input-message] {
  margin: 10px 0 18px;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* v6 structured transport-entry form */
.form-section {
  margin: 18px 0 22px;
}
.form-section > h3 {
  font-size: 16px;
  margin: 0 4px 8px;
  color: #55555f;
}
.form-section > h3 small {
  font-size: 11px;
  font-weight: 400;
  margin-left: 6px;
}
.form-section .group {
  margin-top: 0;
}
.work-mini-note {
  font-size: 10px !important;
  color: #8b7a66 !important;
}
.work-detail:empty {
  display: none;
}
.edit [data-work-fields] > .row {
  min-height: 55px;
}
.edit [data-work-fields] select {
  min-height: 38px;
}
.edit input[name="location"][hidden] {
  display: none !important;
}
.edit .field::placeholder {
  color: #a0a0a8;
}
.edit input[name="customerName"],
.edit input[name="facility"],
.edit input[name="origin"],
.edit input[name="destination"] {
  min-height: 52px;
}
.form-section + .buffer-editor {
  margin-top: 6px;
}
.buffer-editor + .form-section {
  margin-top: 22px;
}
@media (max-width: 360px) {
  .form-section {
    margin-top: 15px;
    margin-bottom: 18px;
  }
  .form-section > h3 {
    font-size: 15px;
  }
}

/* Fast entry helpers */
.quick-templates {
  display: flex;
  gap: 7px;
  align-items: center;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}
.quick-templates::-webkit-scrollbar {
  display: none;
}
.quick-templates > span {
  font-size: 11px;
  color: #8e8e93;
  white-space: nowrap;
}
.quick-templates button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dde3e7;
  color: #38626a;
  font-size: 12px;
  font-weight: 600;
}
.quick-templates button:active {
  transform: scale(0.98);
}
.data-tools {
  min-width: 64px;
  justify-content: center;
  margin-left: 8px;
  font-size: 14px;
  padding: 0 13px;
}
.tool-card {
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  margin: 14px 0;
}
.tool-card > b {
  font-size: 17px;
}
.tool-card p {
  font-size: 13px;
  line-height: 1.8;
  color: #74747e;
}
.compact-save {
  min-height: 48px;
  margin-top: 8px;
}
.edit datalist {
  display: none;
}
@media (max-width: 430px) {
  .bottom {
    padding-left: 16px;
    padding-right: 16px;
  }
  .data-tools {
    min-width: 58px;
    font-size: 13px;
  }
  .quick-templates {
    margin-left: -2px;
    margin-right: -2px;
  }
}
.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f5f6f8;
}
.auth-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 26px;
  padding: 28px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.08);
}
.auth-card h1 {
  margin: 8px 0 10px;
}
.auth-card form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}
.auth-card .field {
  width: 100%;
  box-sizing: border-box;
}
.auth-card .save {
  margin-top: 4px;
}

/* v10 recovery, audit, and conflict surfaces retain the v9 calendar layout. */
.sr-only {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
.conflict-panel {margin:16px 0;padding:16px;border:1px solid #c58722;border-radius:16px;background:#fff8e9;overflow-wrap:anywhere;}
.audit-card {overflow-wrap:anywhere;}
.audit-card h2,.tool-card h2 {font-size:18px;margin:0 0 10px;}
.audit-card dl,.conflict-panel dl {margin:12px 0;}
.audit-card dt,.conflict-panel dt {font-weight:700;margin-top:12px;font-size:14px;}
.audit-card dd,.conflict-panel dd {margin:4px 0 0;white-space:pre-wrap;font-size:15px;}
[data-tools-status],[data-action-error] {white-space:pre-wrap;overflow-wrap:anywhere;}
[data-backup-form] label {display:block;margin-top:12px;font-size:15px;}
[data-backup-form] input {margin-top:6px;}
form[aria-busy="true"] {opacity:.7;}
button:focus-visible {outline:3px solid #147acc;outline-offset:3px;}

/* Data preservation forms use the same touch targets as the event editor. */
[data-backup-form] label,
[data-verify-backup] label {
  display: block;
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.5;
}
[data-backup-form] .field,
[data-verify-backup] .field {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  background: #fff;
  color: #1c1c1e;
  font: inherit;
  font-size: 16px;
}
[data-verify-backup] input[type="file"] {
  overflow: hidden;
  padding: 8px;
  font-size: 14px;
}
[data-verify-backup] input::file-selector-button {
  min-height: 36px;
  margin-right: 8px;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  color: #007aff;
  background: #f2f2f7;
  font: inherit;
}
[data-verify-backup] .secondary { margin-top: 18px; }
[data-verify-status] { overflow-wrap: anywhere; }
