* {
  box-sizing: border-box;
}


html,
body {
  margin: 0;
  min-height: 100%;
}


button,
input,
textarea {
  font: inherit;

  -webkit-tap-highlight-color:
    transparent;
}


body {
  background: #f4f3f0;

  color: #302f2c;

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}



/* =========================
   Shell
   ========================= */

.calendar-shell {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;

  margin: 0 auto;

  padding:
    calc(20px + env(safe-area-inset-top))
    0
    calc(34px + env(safe-area-inset-bottom));
}



/* =========================
   Header
   ========================= */

.calendar-header {
  display: grid;

  grid-template-columns:
    42px 1fr 42px;

  align-items: center;

  gap: 12px;

  padding:
    0 22px;

  margin-bottom:
    18px;
}


.calendar-back,
.calendar-today {
  width: 42px;
  height: 42px;

  border:
    1px solid
    rgba(50, 48, 44, 0.055);

  border-radius: 50%;

  background:
    rgba(255, 255, 255, 0.66);

  color: #66635e;

  cursor: pointer;
}


.calendar-back {
  font-size: 28px;
  font-weight: 300;
}


.calendar-today {
  font-size: 11px;
  font-weight: 600;
}


.calendar-title span {
  display: block;

  margin-bottom: 3px;

  color: #aaa79f;

  font-size: 7px;
  font-weight: 700;

  letter-spacing: 0.18em;
}


.calendar-title h1 {
  margin: 0;

  font-size: 27px;
  font-weight: 600;

  letter-spacing: -0.04em;
}



/* =========================
   Tabs
   ========================= */

.calendar-tabs {
  display: grid;

  grid-template-columns:
    repeat(4, 1fr);

  gap: 4px;

  margin:
    0 22px 16px;

  padding: 4px;

  border-radius: 16px;

  background:
    rgba(80, 77, 70, 0.055);
}


.calendar-tab {
  height: 37px;

  border: 0;
  border-radius: 12px;

  background: transparent;

  color: #96928a;

  font-size: 10px;

  cursor: pointer;
}


.calendar-tab.active {
  background:
    rgba(255, 255, 255, 0.9);

  color: #504e49;

  font-weight: 600;

  box-shadow:
    0 3px 10px
    rgba(30, 30, 30, 0.025);
}



/* =========================
   Horizontal Pages
   ========================= */

.calendar-pages {
  display: flex;

  width: 100%;

  overflow-x: auto;
  overflow-y: hidden;

  scroll-snap-type:
    x mandatory;

  scroll-behavior:
    smooth;

  scrollbar-width:
    none;
}


.calendar-pages::-webkit-scrollbar {
  display: none;
}


.calendar-page {
  flex:
    0 0 100%;

  min-width: 0;

  padding:
    0 22px 30px;

  scroll-snap-align:
    start;

  scroll-snap-stop:
    always;
}



/* =========================
   Month
   ========================= */

.month-card {
  padding:
    18px 14px 16px;

  border:
    1px solid
    rgba(55, 52, 47, 0.06);

  border-radius: 24px;

  background:
    rgba(255, 255, 255, 0.72);

  box-shadow:
    0 8px 26px
    rgba(30, 30, 30, 0.025);
}


.month-heading {
  display: grid;

  grid-template-columns:
    40px 1fr 40px;

  align-items: center;

  margin-bottom:
    15px;
}


.month-heading > div {
  text-align: center;
}


.month-heading span {
  display: block;

  margin-bottom: 3px;

  color: #aaa79f;

  font-size: 7px;
  font-weight: 700;

  letter-spacing: 0.15em;
}


.month-heading strong {
  font-size: 22px;
  font-weight: 600;
}


.month-arrow {
  width: 36px;
  height: 36px;

  border: 0;
  border-radius: 50%;

  background:
    rgba(65, 63, 58, 0.045);

  color: #77746d;

  font-size: 22px;

  cursor: pointer;
}



/* Legend */

.calendar-legend {
  display: flex;
  flex-wrap: wrap;

  gap:
    8px 12px;

  padding:
    0 3px 13px;

  border-bottom:
    1px solid
    rgba(55, 52, 47, 0.055);
}


.calendar-legend span {
  display: flex;
  align-items: center;

  gap: 4px;

  color: #aaa79f;

  font-size: 7px;
}


.legend-dot {
  width: 6px;
  height: 6px;

  border-radius: 50%;
}


.period-dot {
  background:
    #dca7b3;
}


.sex-dot {
  background:
    #a89ac2;
}


.legend-transmission {
  width: 8px;

  color: #77736c;

  font-style: normal;
  font-size: 8px;
  line-height: 1;

  text-align: center;
}


.legend-block {
  width: 9px;
  height: 7px;

  border-radius: 3px;
}


.predicted-period {
  background:
    #f2dde2;
}


.fertile-period {
  background:
    #dde9e1;
}



/* Week */

.month-week {
  display: grid;

  grid-template-columns:
    repeat(7, 1fr);

  padding:
    12px 0 7px;

  color: #aaa79f;

  font-size: 8px;

  text-align: center;
}



/* Grid */

.month-grid {
  display: grid;

  grid-template-columns:
    repeat(7, 1fr);

  gap: 3px;
}


.calendar-day {
  position: relative;

  min-width: 0;
  min-height: 57px;

  display: flex;

  flex-direction: column;

  align-items: center;

  padding:
    6px 2px 5px;

  border: 0;
  border-radius: 12px;

  background: transparent;

  color: #55524c;

  cursor: pointer;
}


.calendar-day.other-month {
  opacity: 0.3;
}


.calendar-day.today
.day-number {
  background:
    #42413d;

  color: white;
}


.calendar-day.selected {
  outline:
    1px solid
    rgba(70, 68, 62, 0.16);
}


.calendar-day.predicted-period-day {
  background:
    rgba(242, 221, 226, 0.62);
}


.calendar-day.fertile-day {
  background:
    rgba(221, 233, 225, 0.65);
}


.calendar-day.ovulation-day::after {
  content: "";

  position: absolute;

  top: 4px;
  right: 4px;

  width: 5px;
  height: 5px;

  border:
    1px solid
    #c4aa82;

  border-radius: 50%;
}


.day-number {
    order: 1;
  width: 25px;
  height: 25px;

  display: flex;

  align-items: center;
  justify-content: center;

  border-radius: 50%;

  font-size: 10px;
  font-weight: 500;
}


.day-event {
    order: 3;
  width: 100%;

  margin-top: 2px;

  overflow: hidden;

  color: #78756e;

  font-size: 6px;
  line-height: 1.2;

  text-align: center;

  text-overflow:
    ellipsis;

  white-space:
    nowrap;
}


.day-dots {
    order: 2;
  min-height: 7px;

  display: flex;

  align-items: center;
  justify-content: center;

  gap: 3px;

  margin-top: 2px;
}


.day-dots i {
  width: 5px;
  height: 5px;

  border-radius: 50%;
}


.day-dots
.transmission-mark {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  width: 7px;
  height: 7px;

  color: #77736c;

  font-size: 7px;
  line-height: 1;
}



/* =========================
   Common Headings
   ========================= */

.page-section-heading {
  margin:
    7px 3px 14px;
}


.page-section-heading span {
  display: block;

  margin-bottom: 4px;

  color: #aaa79f;

  font-size: 7px;
  font-weight: 700;

  letter-spacing: 0.16em;
}


.page-section-heading strong {
  display: block;

  color: #44423e;

  font-size: 20px;
  font-weight: 600;
}




.schedule-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 14px;
}


.schedule-add-button {
  flex: 0 0 auto;

  padding:
    8px 11px;

  border: 0;
  border-radius: 11px;

  background:
    rgba(70, 68, 62, 0.065);

  color: #706d66;

  font-size: 8px;
  font-weight: 600;

  cursor: pointer;
}

/* =========================
   Schedule
   ========================= */

.schedule-card {
  overflow: hidden;

  border:
    1px solid
    rgba(55, 52, 47, 0.06);

  border-radius: 23px;

  background:
    rgba(255, 255, 255, 0.68);
}


.schedule-date-row {
  display: grid;

  grid-template-columns:
    34px 1fr 34px;

  align-items: center;

  padding:
    12px;

  border-bottom:
    1px solid
    rgba(55, 52, 47, 0.06);
}


.schedule-date-row strong {
  text-align: center;

  font-size: 11px;
  font-weight: 600;
}


.schedule-date-row button {
  width: 30px;
  height: 30px;

  border: 0;
  border-radius: 50%;

  background:
    rgba(70, 68, 62, 0.045);

  color: #77746d;

  cursor: pointer;
}


.schedule-head,
.schedule-row {
  display: grid;

  grid-template-columns:
    44px
    minmax(0, 1fr)
    minmax(0, 1fr)
    44px;
}


.schedule-head {
  padding:
    10px;

  color: #aaa79f;

  font-size: 7px;

  text-align: center;
}


.schedule-head strong {
  color: #6d6962;

  font-size: 8px;
}


.schedule-row {
  min-height: 55px;

  align-items: center;

  padding:
    8px 10px;

  border-top:
    1px solid
    rgba(55, 52, 47, 0.045);
}


.schedule-time {
  color: #aaa79f;

  font-size: 7px;

  text-align: center;
}


.schedule-item {
  min-width: 0;
  min-height: 38px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  gap: 4px;

  padding: 4px 7px;

  color: #55524d;

  font-size: 9px;
  line-height: 1.4;
}

.schedule-event {
  min-width: 0;

  padding: 7px 8px;

  border-radius: 10px;

  background:
    rgba(225, 229, 226, 0.72);

  color: #55524d;

  line-height: 1.4;

  cursor: pointer;

  transition:
    transform 0.12s ease,
    background 0.12s ease;
}


.schedule-event:active {
  transform: scale(0.985);

  background:
    rgba(216, 221, 217, 0.86);
}

.schedule-event-title {
  display: block;

  color: #55524d;

  font-size: 9px;
  font-weight: 600;

  line-height: 1.4;
}


.schedule-event-range {
  display: block;

  margin-top: 3px;

  color: #99958e;

  font-size: 6px;
  font-weight: 400;

  line-height: 1.2;
}

.schedule-item.keshi {
  text-align: right;

  border-right:
    1px solid
    rgba(55, 52, 47, 0.055);
}


.schedule-item.luzhen {
  text-align: left;
}


.schedule-empty {
  padding:
    35px 20px;

  color: #aaa79f;

  font-size: 9px;

  text-align: center;
}


.schedule-hint {
  margin-top: 14px;

  padding:
    15px 16px;

  border-radius: 18px;

  background:
    rgba(255, 255, 255, 0.48);
}


.schedule-hint span {
  color: #77746d;

  font-size: 9px;
  font-weight: 600;
}


.schedule-hint p {
  margin:
    5px 0 0;

  color: #aaa79f;

  font-size: 8px;
  line-height: 1.55;
}



/* =========================
   Timeline Mode
   ========================= */

.timeline-mode-switch {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 4px;

  margin-bottom: 15px;

  padding: 4px;

  border-radius: 15px;

  background:
    rgba(80, 77, 70, 0.055);
}


.timeline-mode-button {
  height: 36px;

  border: 0;
  border-radius: 11px;

  background:
    transparent;

  color: #97938c;

  font-size: 9px;

  cursor: pointer;
}


.timeline-mode-button.active {
  background:
    rgba(255, 255, 255, 0.9);

  color: #55524d;

  font-weight: 600;

  box-shadow:
    0 3px 10px
    rgba(30, 30, 30, 0.025);
}


.timeline-subheading {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin:
    0 3px 10px;
}


.timeline-subheading > span {
  color: #aaa79f;

  font-size: 7px;
  font-weight: 700;

  letter-spacing: 0.16em;
}


#milestoneTimelinePanel[hidden],
#transmissionTimelinePanel[hidden] {
  display: none;
}



/* =========================
   Transmission Filter
   ========================= */

.transmission-filter {
  display: grid;

  grid-template-columns:
    repeat(4, 1fr);

  gap: 5px;

  margin-bottom: 12px;
}


.transmission-filter-button {
  height: 34px;

  border:
    1px solid
    rgba(55, 52, 47, 0.055);

  border-radius: 11px;

  background:
    rgba(255, 255, 255, 0.48);

  color: #99958e;

  font-size: 8px;

  cursor: pointer;
}


.transmission-filter-button.active {
  background:
    #e1e5e2;

  color: #595d58;

  font-weight: 600;
}



/* =========================
   Transmission Timeline
   ========================= */

.transmission-timeline {
  padding:
    18px 17px;

  border:
    1px solid
    rgba(55, 52, 47, 0.06);

  border-radius: 23px;

  background:
    rgba(255, 255, 255, 0.68);
}


.transmission-item {
  position: relative;

  display: grid;

  grid-template-columns:
    17px 1fr;

  min-height: 95px;
}


.transmission-track {
  position: relative;
}


.transmission-track::after {
  content: "";

  position: absolute;

  top: 13px;
  bottom: -7px;
  left: 4px;

  width: 1px;

  background:
    rgba(85, 82, 76, 0.14);
}


.transmission-item:last-child
.transmission-track::after {
  display: none;
}


.transmission-dot {
  position: absolute;

  top: 5px;
  left: 0;

  width: 9px;
  height: 9px;

  border-radius: 50%;

  background:
    #77736c;

  box-shadow:
    0 0 0 4px
    #f8f7f4;
}


.transmission-content {
  min-width: 0;

  padding:
    0 0 20px 6px;
}


.transmission-meta {
  display: flex;

  align-items: center;

  flex-wrap: wrap;

  gap: 5px;

  margin-bottom: 6px;
}


.transmission-date {
  color: #aaa79f;

  font-size: 7px;
}


.transmission-type {
  padding:
    3px 6px;

  border-radius: 7px;

  background:
    rgba(80, 77, 70, 0.06);

  color: #77736d;

  font-size: 6px;
  font-weight: 600;
}


.transmission-content > strong {
  display: block;

  margin-bottom: 5px;

  color: #504d48;

  font-size: 10px;
  font-weight: 600;
}


.transmission-summary {
  margin: 0;

  color: #8f8b84;

  font-size: 8px;
  line-height: 1.6;
}


.transmission-source {
  display: block;

  margin-top: 6px;

  color: #b0aca5;

  font-size: 7px;
}


.transmission-empty {
  padding:
    30px 15px;

  color: #aaa79f;

  font-size: 9px;

  text-align: center;
}



/* =========================
   Timeline · 双人并行
   ========================= */

.timeline-card {
  padding:
    17px 16px 20px;

  border:
    1px solid
    rgba(55, 52, 47, 0.06);

  border-radius: 23px;

  background:
    rgba(255, 255, 255, 0.68);
}


.dual-timeline-head {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 28px;

  padding:
    0 5px 14px;

  border-bottom:
    1px solid
    rgba(55, 52, 47, 0.055);
}


.dual-timeline-head span {
  color: #77736d;

  font-size: 9px;
  font-weight: 600;
}


.dual-timeline-head
span:first-child {
  text-align: left;
}


.dual-timeline-head
span:last-child {
  text-align: right;
}


.dual-timeline-grid {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);

  gap: 28px;

  padding-top: 18px;
}


.timeline-lane {
  position: relative;

  min-width: 0;

  padding-bottom: 8px;
}


.timeline-lane.left::before {
  content: "";

  position: absolute;

  top: 5px;
  bottom: 5px;
  left: 5px;

  width: 1px;

  background:
    rgba(85, 82, 76, 0.16);
}


.timeline-lane.right::before {
  content: "";

  position: absolute;

  top: 5px;
  bottom: 5px;
  right: 5px;

  width: 1px;

  background:
    rgba(85, 82, 76, 0.16);
}


.lane-event {
  position: relative;
  z-index: 1;

  min-height: 68px;

  display: grid;

  align-items: start;
}


.lane-event.left {
  grid-template-columns:
    13px minmax(0, 1fr);
}


.lane-event.right {
  grid-template-columns:
    minmax(0, 1fr) 13px;
}


.lane-dot {
  width: 9px;
  height: 9px;

  margin-top: 3px;

  border-radius: 50%;

  background: #77736c;

  box-shadow:
    0 0 0 4px
    #f8f7f4;
}


.lane-event.left
.lane-dot {
  grid-column: 1;
}


.lane-event.right
.lane-dot {
  grid-column: 2;

  justify-self: end;
}


.lane-content {
  min-width: 0;
}


.lane-event.left
.lane-content {
  grid-column: 2;

  padding-left: 8px;

  text-align: left;
}


.lane-event.right
.lane-content {
  grid-column: 1;
  grid-row: 1;

  padding-right: 8px;

  text-align: right;
}


.lane-content strong {
  display: block;

  margin-bottom: 4px;

  overflow: hidden;

  color: #514e49;

  font-size: 10px;
  font-weight: 600;

  text-overflow: ellipsis;

  white-space: nowrap;
}


.lane-content span {
  display: block;

  color: #aaa79f;

  font-size: 7px;
}


.timeline-lane-empty {
  position: relative;
  z-index: 2;

  padding:
    3px 15px 25px;

  color: #bbb8b1;

  font-size: 8px;
}


.timeline-lane.right
.timeline-lane-empty {
  text-align: right;
}


.timeline-add-button {
  flex:
    0 0 auto;

  padding:
    8px 11px;

  border: 0;
  border-radius: 11px;

  background:
    rgba(70, 68, 62, 0.065);

  color: #706d66;

  font-size: 8px;
  font-weight: 600;

  cursor: pointer;
}


.lane-actions {
  display: flex;

  gap: 5px;

  margin-top: 7px;
}


.lane-event.right
.lane-actions {
  justify-content: flex-end;
}


.lane-actions button,
.transmission-actions button {
  padding:
    4px 7px;

  border: 0;
  border-radius: 7px;

  background:
    rgba(70, 68, 62, 0.05);

  color: #99958d;

  font-size: 6px;

  cursor: pointer;
}


.delete-milestone,
.delete-transmission {
  color: #a57d7d !important;
}


.transmission-actions {
  display: flex;

  gap: 5px;

  margin-top: 8px;
}



/* =========================
   Records
   ========================= */

.record-grid {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 10px;
}


.record-view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 4px;

  margin-bottom: 12px;
  padding: 4px;

  border-radius: 13px;

  background:
    rgba(70, 68, 62, 0.055);
}


.record-view-button {
  height: 34px;

  border: 0;
  border-radius: 10px;

  background: transparent;

  color: #99958e;

  font-size: 9px;

  cursor: pointer;
}


.record-view-button.active {
  background:
    rgba(255, 255, 255, 0.9);

  color: #56534e;

  font-weight: 600;

  box-shadow:
    0 2px 8px
    rgba(30, 30, 30, 0.025);
}


.record-card {
  position: relative;

  min-height: 150px;

  padding: 15px;

  border:
    1px solid
    rgba(55, 52, 47, 0.06);

  border-radius: 20px;

  background:
    rgba(255, 255, 255, 0.68);
}


.record-card-manageable {
  cursor: pointer;
}


.record-card-manageable:active {
  transform: scale(0.995);
}


.record-card-action {
  position: absolute;

  top: 12px;
  right: 12px;

  padding: 5px 7px;

  border: 0;
  border-radius: 8px;

  background:
    rgba(70, 68, 62, 0.055);

  color: #8f8b84;

  font-size: 7px;

  cursor: pointer;
}


.record-symbol {
  width: 31px;
  height: 31px;

  display: flex;

  align-items: center;
  justify-content: center;

  margin-bottom: 14px;

  border-radius: 10px;

  background:
    #e3e5e1;

  color: #73746f;

  font-size: 13px;
}


.record-card > span {
  display: block;

  margin-bottom: 3px;

  color: #aaa79f;

  font-size: 6px;
  font-weight: 700;

  letter-spacing: 0.14em;
}


.record-card > strong {
  display: block;

  color: #56534e;

  font-size: 10px;
}


.record-card p {
  margin:
    8px 0 0;

  color: #96928a;

  font-size: 8px;
  line-height: 1.55;

  white-space: pre-line;
}


.record-note {
  margin-top: 14px;

  padding:
    15px 16px;

  border-radius: 18px;

  background:
    rgba(255, 255, 255, 0.48);
}


.record-note span {
  display: block;

  margin-bottom: 4px;

  color: #aaa79f;

  font-size: 7px;
  font-weight: 700;

  letter-spacing: 0.16em;
}


.record-note strong {
  display: block;

  color: #5d5a54;

  font-size: 11px;
}


.record-note p {
  margin:
    5px 0 0;

  color: #aaa79f;

  font-size: 8px;
  line-height: 1.55;
}



/* =========================
   Selected Day Overview
   ========================= */

.day-overview {
  margin-top: 14px;

  padding:
    18px 16px 8px;

  border:
    1px solid
    rgba(55, 52, 47, 0.06);

  border-radius: 24px;

  background:
    rgba(255, 255, 255, 0.68);

  box-shadow:
    0 8px 26px
    rgba(30, 30, 30, 0.025);
}


.day-overview-header {
  padding:
    1px 2px 13px;

  border-bottom:
    1px solid
    rgba(55, 52, 47, 0.06);
}


.day-overview-header span {
  display: block;

  margin-bottom: 4px;

  color: #aaa79f;

  font-size: 6px;
  font-weight: 700;

  letter-spacing: 0.16em;
}


.day-overview-header strong {
  color: #3f3d39;

  font-size: 17px;
  font-weight: 600;
}



/* =========================
   Day View Switch
   ========================= */

.day-view-switch {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 4px;

  margin:
    14px 0 2px;

  padding: 4px;

  border-radius: 13px;

  background:
    rgba(70, 68, 62, 0.055);
}


.day-view-button {
  height: 34px;

  border: 0;
  border-radius: 10px;

  background:
    transparent;

  color: #99958e;

  font-size: 9px;

  cursor: pointer;
}


.day-view-button.active {
  background:
    rgba(255, 255, 255, 0.9);

  color: #56534e;

  font-weight: 600;

  box-shadow:
    0 2px 8px
    rgba(30, 30, 30, 0.025);
}



/* =========================
   Overview Sections
   ========================= */

.sheet-section {
  padding:
    15px 2px;

  border-bottom:
    1px solid
    rgba(55, 52, 47, 0.055);
}


.sheet-section:last-child {
  border-bottom: 0;
}


.sheet-label {
  margin-bottom: 6px;

  color: #aaa79f;

  font-size: 7px;
  font-weight: 700;

  letter-spacing: 0.12em;
}


.sheet-value {
  color: #56534e;

  font-size: 10px;
  line-height: 1.65;

  white-space: pre-line;
}


.sex-detail {
  line-height: 1.75;
}



/* =========================
   双人身体 / 睡眠
   ========================= */

.sheet-value.dual-person-value {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);

  gap: 9px;

  white-space: normal;
}


.dual-person-card {
  min-width: 0;

  padding: 11px;

  border:
    1px solid
    rgba(55, 52, 47, 0.055);

  border-radius: 13px;

  background:
    rgba(255, 255, 255, 0.55);
}


.dual-person-card strong {
  display: block;

  margin-bottom: 7px;

  color: #66625c;

  font-size: 9px;
  font-weight: 600;
}


.dual-person-card p {
  margin: 0;

  color: #706d66;

  font-size: 9px;
  line-height: 1.65;

  white-space: pre-line;
}



/* =========================
   当天传讯
   ========================= */

.daily-transmission-list {
  padding:
    2px 0 0;
}


.daily-transmission-list
.transmission-item {
  min-height: 78px;
}


.daily-transmission-list
.transmission-content {
  padding-bottom: 14px;
}


.daily-transmission-list
.transmission-item:last-child
.transmission-content {
  padding-bottom: 0;
}


.daily-transmission-list
.transmission-empty {
  padding:
    7px 0 3px;

  text-align: left;
}



/* =========================
   Shared Sheet Handle
   ========================= */

.sheet-handle {
  width: 38px;
  height: 4px;

  margin:
    3px auto 12px;

  border-radius: 999px;

  background:
    #d6d3cd;
}




/* =========================
   Body Editor
   ========================= */

.body-editor-backdrop {
  position: fixed;
  z-index: 1250;

  inset: 0;

  display: flex;
  align-items: flex-end;
  justify-content: center;

  background:
    rgba(35, 34, 31, 0.22);

  backdrop-filter:
    blur(4px);
}


.body-editor-backdrop[hidden] {
  display: none;
}


.body-editor-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;

  overflow-y: auto;

  padding:
    8px
    22px
    calc(28px + env(safe-area-inset-bottom));

  border-radius:
    26px 26px 0 0;

  background:
    #f8f7f4;

  box-shadow:
    0 -16px 50px
    rgba(30, 30, 30, 0.12);
}


.body-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding-bottom: 16px;

  border-bottom:
    1px solid
    rgba(55, 52, 47, 0.06);
}


.body-editor-header span {
  display: block;

  margin-bottom: 3px;

  color: #aaa79f;

  font-size: 6px;
  font-weight: 700;

  letter-spacing: 0.16em;
}


.body-editor-header strong {
  font-size: 17px;
}


.body-editor-header button {
  width: 34px;
  height: 34px;

  border: 0;
  border-radius: 50%;

  background:
    rgba(70, 68, 62, 0.055);

  color: #89857e;

  font-size: 18px;

  cursor: pointer;
}


.body-field {
  display: block;

  padding:
    15px 2px 0;
}


.body-field > span {
  display: block;

  margin-bottom: 7px;

  color: #8f8b84;

  font-size: 8px;
  font-weight: 600;
}


.body-field input,
.body-field textarea {
  width: 100%;

  padding:
    11px 12px;

  border:
    1px solid
    rgba(55, 52, 47, 0.07);

  border-radius: 12px;

  outline: 0;

  background:
    rgba(255, 255, 255, 0.76);

  color: #55524d;

  font-size: 10px;
}


.body-field input {
  height: 43px;
}


.body-field textarea {
  min-height: 92px;

  resize: vertical;

  line-height: 1.6;
}


.body-owner-options {
  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 7px;
}


.body-owner {
  height: 41px;

  border:
    1px solid
    rgba(55, 52, 47, 0.06);

  border-radius: 12px;

  background:
    rgba(255, 255, 255, 0.56);

  color: #918e87;

  font-size: 9px;

  cursor: pointer;
}


.body-owner.active {
  background: #e1e5e2;

  color: #565a56;

  font-weight: 600;
}


.body-energy-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);

  gap: 6px;
}


.body-energy-options button {
  height: 39px;

  border:
    1px solid
    rgba(55, 52, 47, 0.06);

  border-radius: 11px;

  background:
    rgba(255, 255, 255, 0.56);

  color: #918e87;

  font-size: 9px;

  cursor: pointer;
}


.body-energy-options button.active {
  background: #e1e5e2;

  color: #565a56;

  font-weight: 600;
}


.body-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 8px;

  margin-top: 22px;
}


.body-editor-actions.editing {
  grid-template-columns: 0.8fr 1fr 1fr;
}


.body-editor-actions button {
  height: 42px;

  border: 0;
  border-radius: 13px;

  background:
    rgba(70, 68, 62, 0.055);

  color: #77736d;

  font-size: 9px;

  cursor: pointer;
}


.body-editor-actions .primary {
  background: #555650;

  color: #ffffff;
}


.body-editor-actions .danger {
  background:
    rgba(165, 125, 125, 0.085);

  color: #a57d7d;
}


.body-editor-actions .danger[hidden] {
  display: none;
}


/* =========================
   Schedule Editor
   ========================= */

.schedule-editor-backdrop {
  position: fixed;

  z-index: 1050;

  inset: 0;

  display: flex;

  align-items: flex-end;
  justify-content: center;

  background:
    rgba(35, 34, 31, 0.22);

  backdrop-filter:
    blur(4px);
}


.schedule-editor-backdrop[hidden] {
  display: none;
}


.schedule-editor-sheet {
  width: 100%;
  max-width: 520px;

  max-height: 88vh;

  overflow-y: auto;

  padding:
    8px
    22px
    calc(28px + env(safe-area-inset-bottom));

  border-radius:
    26px 26px 0 0;

  background:
    #f8f7f4;

  box-shadow:
    0 -16px 50px
    rgba(30, 30, 30, 0.12);
}


.schedule-editor-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  padding-bottom: 16px;

  border-bottom:
    1px solid
    rgba(55, 52, 47, 0.06);
}


.schedule-editor-header span {
  display: block;

  margin-bottom: 3px;

  color: #aaa79f;

  font-size: 6px;
  font-weight: 700;

  letter-spacing: 0.16em;
}


.schedule-editor-header strong {
  font-size: 17px;
}


.schedule-editor-header button {
  width: 34px;
  height: 34px;

  border: 0;
  border-radius: 50%;

  background:
    rgba(70, 68, 62, 0.055);

  color: #89857e;

  font-size: 18px;

  cursor: pointer;
}


.schedule-field {
  display: block;

  padding:
    15px 2px 0;
}


.schedule-field > span {
  display: block;

  margin-bottom: 7px;

  color: #8f8b84;

  font-size: 8px;
  font-weight: 600;
}


.schedule-field input {
  width: 100%;
  height: 43px;

  padding:
    0 12px;

  border:
    1px solid
    rgba(55, 52, 47, 0.07);

  border-radius: 12px;

  outline: 0;

  background:
    rgba(255, 255, 255, 0.76);

  color: #55524d;

  font-size: 10px;
}


.schedule-owner-options {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 7px;
}


.schedule-owner {
  height: 41px;

  border:
    1px solid
    rgba(55, 52, 47, 0.06);

  border-radius: 12px;

  background:
    rgba(255, 255, 255, 0.56);

  color: #918e87;

  font-size: 9px;

  cursor: pointer;
}


.schedule-owner.active {
  background:
    #e1e5e2;

  color: #565a56;

  font-weight: 600;
}


.schedule-time-fields {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 8px;
}


.schedule-editor-actions {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 8px;

  margin-top: 22px;
}


.schedule-editor-actions.editing {
  grid-template-columns:
    0.85fr 1fr 1fr;
}


.schedule-editor-actions button {
  height: 42px;

  border: 0;
  border-radius: 13px;

  background:
    rgba(70, 68, 62, 0.055);

  color: #77736d;

  font-size: 9px;

  cursor: pointer;
}


.schedule-editor-actions .primary {
  background:
    #555650;

  color: #ffffff;
}


.schedule-editor-actions .danger {
  background:
    rgba(165, 125, 125, 0.09);

  color:
    #a57d7d;
}


.schedule-editor-actions .danger[hidden] {
  display: none;
}


/* =========================
   Milestone Editor
   ========================= */

.milestone-editor-backdrop {
  position: fixed;

  z-index: 1100;

  inset: 0;

  display: flex;

  align-items: flex-end;
  justify-content: center;

  background:
    rgba(35, 34, 31, 0.22);

  backdrop-filter:
    blur(4px);
}


.milestone-editor-backdrop[hidden] {
  display: none;
}


.milestone-editor-sheet {
  width: 100%;
  max-width: 520px;

  padding:
    8px
    22px
    calc(28px + env(safe-area-inset-bottom));

  border-radius:
    26px 26px 0 0;

  background:
    #f8f7f4;

  box-shadow:
    0 -16px 50px
    rgba(30, 30, 30, 0.12);
}


.milestone-editor-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  padding-bottom: 16px;

  border-bottom:
    1px solid
    rgba(55, 52, 47, 0.06);
}


.milestone-editor-header span {
  display: block;

  margin-bottom: 3px;

  color: #aaa79f;

  font-size: 6px;
  font-weight: 700;

  letter-spacing: 0.16em;
}


.milestone-editor-header strong {
  font-size: 17px;
}


.milestone-editor-header button {
  width: 34px;
  height: 34px;

  border: 0;
  border-radius: 50%;

  background:
    rgba(70, 68, 62, 0.055);

  color: #89857e;

  font-size: 18px;

  cursor: pointer;
}


.milestone-field {
  display: block;

  padding:
    15px 2px 0;
}


.milestone-field > span {
  display: block;

  margin-bottom: 7px;

  color: #8f8b84;

  font-size: 8px;
  font-weight: 600;
}


.milestone-field input {
  width: 100%;
  height: 43px;

  padding:
    0 12px;

  border:
    1px solid
    rgba(55, 52, 47, 0.07);

  border-radius: 12px;

  outline: 0;

  background:
    rgba(255, 255, 255, 0.76);

  color: #55524d;

  font-size: 10px;
}


.milestone-owner-options {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 7px;
}


.milestone-owner {
  height: 41px;

  border:
    1px solid
    rgba(55, 52, 47, 0.06);

  border-radius: 12px;

  background:
    rgba(255, 255, 255, 0.56);

  color: #918e87;

  font-size: 9px;

  cursor: pointer;
}


.milestone-owner.active {
  background:
    #e1e5e2;

  color: #565a56;

  font-weight: 600;
}


.milestone-editor-actions {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 8px;

  margin-top: 22px;
}


.milestone-editor-actions button {
  height: 42px;

  border: 0;
  border-radius: 13px;

  background:
    rgba(70, 68, 62, 0.055);

  color: #77736d;

  font-size: 9px;

  cursor: pointer;
}


.milestone-editor-actions
.primary {
  background:
    #555650;

  color: #ffffff;
}



/* =========================
   Transmission Editor
   ========================= */

.transmission-editor-backdrop {
  position: fixed;

  z-index: 1200;

  inset: 0;

  display: flex;

  align-items: flex-end;
  justify-content: center;

  background:
    rgba(35, 34, 31, 0.22);

  backdrop-filter:
    blur(4px);
}


.transmission-editor-backdrop[hidden] {
  display: none;
}


.transmission-editor-sheet {
  width: 100%;
  max-width: 520px;

  max-height: 88vh;

  overflow-y: auto;

  padding:
    8px
    22px
    calc(28px + env(safe-area-inset-bottom));

  border-radius:
    26px 26px 0 0;

  background:
    #f8f7f4;

  box-shadow:
    0 -16px 50px
    rgba(30, 30, 30, 0.12);
}


.transmission-editor-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  padding-bottom: 16px;

  border-bottom:
    1px solid
    rgba(55, 52, 47, 0.06);
}


.transmission-editor-header span {
  display: block;

  margin-bottom: 3px;

  color: #aaa79f;

  font-size: 6px;
  font-weight: 700;

  letter-spacing: 0.16em;
}


.transmission-editor-header strong {
  font-size: 17px;
}


.transmission-editor-header button {
  width: 34px;
  height: 34px;

  border: 0;
  border-radius: 50%;

  background:
    rgba(70, 68, 62, 0.055);

  color: #89857e;

  font-size: 18px;

  cursor: pointer;
}


.transmission-field {
  display: block;

  padding:
    15px 2px 0;
}


.transmission-field > span {
  display: block;

  margin-bottom: 7px;

  color: #8f8b84;

  font-size: 8px;
  font-weight: 600;
}


.transmission-field input,
.transmission-field textarea {
  width: 100%;

  padding:
    11px 12px;

  border:
    1px solid
    rgba(55, 52, 47, 0.07);

  border-radius: 12px;

  outline: 0;

  background:
    rgba(255, 255, 255, 0.76);

  color: #55524d;

  font-size: 10px;
}


.transmission-field input {
  height: 43px;
}


.transmission-field textarea {
  min-height: 100px;

  resize: vertical;

  line-height: 1.6;
}


.transmission-type-options {
  display: grid;

  grid-template-columns:
    repeat(3, 1fr);

  gap: 7px;
}


.transmission-type-option {
  height: 40px;

  border:
    1px solid
    rgba(55, 52, 47, 0.06);

  border-radius: 12px;

  background:
    rgba(255, 255, 255, 0.56);

  color: #918e87;

  font-size: 9px;

  cursor: pointer;
}


.transmission-type-option.active {
  background:
    #e1e5e2;

  color: #565a56;

  font-weight: 600;
}


.transmission-editor-actions {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 8px;

  margin-top: 22px;
}


.transmission-editor-actions button {
  height: 42px;

  border: 0;
  border-radius: 13px;

  background:
    rgba(70, 68, 62, 0.055);

  color: #77736d;

  font-size: 9px;

  cursor: pointer;
}


.transmission-editor-actions
.primary {
  background:
    #555650;

  color: #ffffff;
}



/* =========================
   Desktop
   ========================= */

@media (min-width: 700px) {

  .calendar-shell {
    padding-top: 42px;
  }

}


/* =========================
   Mobile · Phase 1
   ========================= */

@media (max-width: 767px) {

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .calendar-shell {
    min-height: 100dvh;
    overflow-x: clip;
  }

  .calendar-header {
    grid-template-columns:
      44px minmax(0, 1fr) 44px;
    gap: 8px;
    padding-right:
      max(16px, env(safe-area-inset-right));
    padding-left:
      max(16px, env(safe-area-inset-left));
  }

  .calendar-back,
  .calendar-today,
  .month-arrow {
    width: 44px;
    height: 44px;
    touch-action: manipulation;
  }

  .calendar-title {
    min-width: 0;
  }

  .calendar-title h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .calendar-tabs {
    grid-template-columns:
      repeat(4, minmax(0, 1fr));
    margin-right:
      max(16px, env(safe-area-inset-right));
    margin-left:
      max(16px, env(safe-area-inset-left));
  }

  .calendar-tab,
  .timeline-mode-button,
  .transmission-filter-button,
  .schedule-add-button,
  .record-view-button,
  .day-view-button,
  .timeline-add-button {
    min-height: 44px;
    touch-action: manipulation;
  }

  .calendar-pages {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
  }

  .calendar-page {
    width: 100%;
    max-width: 100%;
    padding-right:
      max(16px, env(safe-area-inset-right));
    padding-left:
      max(16px, env(safe-area-inset-left));
  }

  .month-card,
  .schedule-card,
  .timeline-card,
  .transmission-timeline,
  .record-card,
  .record-note,
  .day-overview {
    min-width: 0;
    max-width: 100%;
  }

  .month-card {
    padding-right: 10px;
    padding-left: 10px;
  }

  .month-grid,
  .month-week {
    grid-template-columns:
      repeat(7, minmax(0, 1fr));
  }

  .month-grid {
    gap: 2px;
  }

  .calendar-day {
    min-width: 0;
    min-height: 54px;
  }

  .day-event,
  .schedule-event-title,
  .schedule-event-range,
  .transmission-summary,
  .lane-content,
  .record-card,
  .record-note,
  .sheet-value {
    overflow-wrap: anywhere;
  }

  .schedule-head,
  .schedule-row {
    grid-template-columns:
      36px minmax(0, 1fr) minmax(0, 1fr) 36px;
  }

  .schedule-head,
  .schedule-row {
    padding-right: 5px;
    padding-left: 5px;
  }

  .schedule-date-row button {
    width: 44px;
    height: 44px;
  }

  .transmission-filter {
    grid-template-columns:
      repeat(4, minmax(0, 1fr));
  }

  .dual-timeline-head,
  .dual-timeline-grid {
    gap: 14px;
  }

  .body-editor-sheet,
  .schedule-editor-sheet,
  .milestone-editor-sheet,
  .transmission-editor-sheet {
    max-height:
      calc(100dvh - env(safe-area-inset-top));
    padding-right:
      max(16px, env(safe-area-inset-right));
    padding-left:
      max(16px, env(safe-area-inset-left));
    -webkit-overflow-scrolling: touch;
  }

  .body-editor-header button,
  .schedule-editor-header button,
  .milestone-editor-header button,
  .transmission-editor-header button,
  .body-owner,
  .schedule-owner,
  .milestone-owner,
  .transmission-type-option,
  .body-energy-options button,
  .body-editor-actions button,
  .schedule-editor-actions button,
  .milestone-editor-actions button,
  .transmission-editor-actions button {
    min-height: 44px;
    touch-action: manipulation;
  }

  .body-editor-header button,
  .schedule-editor-header button,
  .milestone-editor-header button,
  .transmission-editor-header button {
    width: 44px;
    height: 44px;
  }

  .body-field input,
  .body-field textarea,
  .schedule-field input,
  .milestone-field input,
  .transmission-field input,
  .transmission-field textarea {
    max-width: 100%;
    font-size: 16px;
  }

}


@media (max-width: 374px) {

  .calendar-header,
  .calendar-page {
    padding-right:
      max(12px, env(safe-area-inset-right));
    padding-left:
      max(12px, env(safe-area-inset-left));
  }

  .calendar-tabs {
    margin-right:
      max(12px, env(safe-area-inset-right));
    margin-left:
      max(12px, env(safe-area-inset-left));
  }

  .month-card {
    padding-right: 7px;
    padding-left: 7px;
  }

  .calendar-day {
    min-height: 50px;
    padding-right: 1px;
    padding-left: 1px;
  }

  .schedule-head,
  .schedule-row {
    grid-template-columns:
      32px minmax(0, 1fr) minmax(0, 1fr) 32px;
  }

}
