/* #region zone:flights.v3-calendar-style — ช่องวันและแถบกะรายวัน */
.f3-calendar {
  margin-inline: -16px;
  padding-inline: 1px;
}
.f3-weekdays,
.f3-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--u-space-2);
}
.f3-weekdays {
  padding-bottom: var(--u-space-2);
  text-align: center;
  color: var(--f3-muted);
  font-size: var(--u-text-xs);
}
.f3-day {
  position: relative;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  display: flex;
  align-items: flex-start;
  color: var(--f3-ink);
}
.f3-day-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: 2px;
  border-radius: 50%;
  font: 400 14px var(--f3-sans);
}
.f3-outside .f3-day-number {
  color: var(--f3-muted);
}
.f3-day[aria-current='date'] .f3-day-number {
  box-shadow: inset 0 0 0 1.5px var(--f3-ink);
  font-weight: 600;
}
.f3-day[aria-pressed='true'] .f3-day-number {
  background: var(--f3-ink);
  color: var(--f3-bg);
  font-weight: 600;
}
.f3-duty {
  position: absolute;
  left: 0;
  right: -8px;
  bottom: calc(3px + var(--lane, 0) * 4px);
  height: 4px;
  background: var(--f3-accent);
  pointer-events: none;
}
.f3-day:nth-child(7n) .f3-duty {
  right: 0;
}
.f3-duty.f3-away,
.f3-swatch.f3-away {
  background: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--f3-accent) 70%, transparent) 0 2px,
    color-mix(in srgb, var(--f3-accent) 22%, transparent) 2px 5px
  );
}
.f3-duty.f3-start {
  left: 6px;
  border-radius: 3px 0 0 3px;
}
.f3-duty.f3-end {
  right: 6px;
  border-radius: 0 3px 3px 0;
}
.f3-duty.f3-start.f3-end {
  border-radius: 3px;
}
.f3-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--u-space-2) var(--u-space-4);
  margin-top: var(--u-space-3);
  font-size: var(--u-text-xs);
  color: var(--f3-muted);
}
.f3-legend > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.f3-swatch {
  width: 16px;
  height: 6px;
  border-radius: 3px;
  background: var(--f3-accent);
}
.f3-swatch.f3-today {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--f3-ink);
}
.f3-roster-calendar .f3-card-head {
  justify-content: space-between;
  gap: var(--u-space-2);
}
.f3-card-head > h2:empty {
  display: none;
}
.f3-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px var(--u-space-3);
  margin: var(--u-space-2) 0 20px;
}
.f3-stats > div {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
}
.f3-stats dt {
  font-size: var(--u-text-sm);
  color: var(--f3-muted);
}
.f3-stats dd {
  margin: 0;
  font-size: var(--u-text-2xl);
}
.f3-weeks {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--u-space-2);
  margin: 10px 0 20px;
}
.f3-week-block {
  display: grid;
  justify-items: center;
  gap: var(--u-space-1);
  color: var(--f3-muted);
  font-size: 11px;
}
.f3-week-block b {
  color: var(--f3-ink);
  font-size: 11px;
}
.f3-week-block small {
  text-align: center;
}
.f3-week-bar {
  width: 100%;
  max-width: 36px;
  height: 44px;
  border-radius: 6px;
  background: var(--f3-card2);
  position: relative;
  overflow: hidden;
}
.f3-week-bar i {
  position: absolute;
  inset: auto 0 0;
  background: var(--f3-ink);
  border-radius: 6px 6px 0 0;
}
.f3-destinations {
  list-style: none;
  padding: 0;
  margin: 10px 0 14px;
  display: grid;
  gap: 10px;
}
.f3-destinations li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 24px;
  align-items: center;
  gap: var(--u-space-3);
}
.f3-destinations li > span:first-of-type {
  height: 6px;
  border-radius: 3px;
  background: var(--f3-card2);
}
.f3-destinations i {
  display: block;
  height: 6px;
  background: var(--f3-ink);
  border-radius: 3px;
}
.f3-trip-list {
  display: grid;
  gap: var(--u-space-2);
}
.f3-trip-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--u-space-1) var(--u-space-3);
  border-radius: 16px;
  padding: var(--u-space-3);
  text-align: left;
  justify-content: stretch;
  white-space: normal;
}
.f3-trip-row b {
  font-size: 15px;
  font-weight: 500;
}
.f3-trip-row > small {
  font-size: var(--u-text-sm);
  overflow-wrap: anywhere;
}
.f3-trip-route {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: var(--u-space-3) !important;
}
@media (max-width: 1099px) {
  .f3-roster-grid > .f3-col {
    display: contents;
  }
  .f3-roster-calendar {
    order: 1;
  }
  .f3-day-panel {
    order: 2;
  }
  .f3-trips {
    order: 3;
  }
  .f3-month-summary {
    order: 4;
  }
}
@media (min-width: 760px) {
  .f3-calendar {
    margin-inline: -24px;
  }
  .f3-day {
    height: 52px;
  }
  .f3-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .f3-calendar {
    margin-inline: 0;
  }
}
@media (min-width: 1100px) {
  .f3-roster-grid {
    grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
    gap: 20px;
  }
  .f3-roster-grid .f3-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* #endregion */

/* #region zone:flights.calendar-subscription-style — สมัคร คัดลอก และจัดการลิงก์ตามชุด UI */
[data-ui='v3'] #calendar-feed-dialog {
  width: min(600px, calc(100vw - 32px));
  padding: var(--u-space-5);
  border-color: var(--u-line);
  border-radius: var(--u-radius-dialog);
  background: var(--u-pop);
  color: var(--u-ink);
}
#calendar-feed-dialog .roster-dialog-body {
  gap: var(--u-space-4);
}
#calendar-feed-dialog .calendar-feed-intro {
  color: var(--u-muted);
  font-size: var(--u-text-sm);
  line-height: 1.6;
}
[data-ui='v3'] .calendar-feed-links {
  display: grid;
  gap: var(--u-space-3);
}
[data-ui='v3'] .calendar-destinations {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--u-space-3);
}
[data-ui='v3'] .calendar-destination {
  justify-content: flex-start;
  gap: var(--u-space-3);
  min-width: 0;
  min-height: 64px;
  padding: var(--u-space-4) var(--u-space-5);
  border-color: var(--u-line-strong);
  border-radius: var(--u-radius-pill);
  background: transparent;
  color: var(--u-ink);
  font-size: var(--u-body);
  white-space: nowrap;
}
.calendar-destination > :is(svg, img) {
  flex: none;
  width: 32px;
  height: 32px;
}
.calendar-tile-face {
  fill: var(--u-surface);
  stroke: var(--u-line-strong);
  stroke-width: 1;
}
.calendar-apple-tile text {
  font-family: var(--f3-sans);
}
.calendar-tile-weekday {
  fill: var(--u-danger);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.calendar-tile-day {
  fill: var(--u-ink);
  font-size: 40px;
  font-weight: 300;
  font-variant-numeric: lining-nums;
}
.calendar-copy-row {
  display: flex;
  align-items: center;
  gap: var(--u-space-2);
  min-width: 0;
}
.calendar-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.calendar-copy-url {
  flex: 1;
  min-width: 0;
  font: var(--u-text-xs)/1.5 var(--f3-mono);
  color: var(--u-muted);
}
.calendar-copy-parts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  white-space: nowrap;
}
.calendar-copy-parts > span:first-child {
  overflow: hidden;
}
#calendar-feed-dialog .calendar-copy-button {
  flex: none;
  padding-inline: var(--u-space-3);
  font-size: var(--u-text-sm);
  white-space: nowrap;
}
#calendar-feed-dialog .calendar-feed-status {
  color: var(--u-muted);
  font-size: var(--u-text-xs);
  line-height: 1.6;
}
.calendar-feed-manage {
  border-block: 1px solid var(--u-line);
}
.calendar-feed-manage > summary {
  min-height: var(--u-tap);
  padding-block: var(--u-space-3);
  box-sizing: border-box;
  cursor: pointer;
  font-size: var(--u-text-sm);
  font-weight: 500;
}
.calendar-feed-manage > summary:focus-visible {
  outline: 2px solid var(--u-focus);
  outline-offset: 2px;
  border-radius: var(--u-radius-inner);
}
#calendar-feed-dialog .calendar-feed-privacy {
  margin-block: var(--u-space-1) var(--u-space-3);
  color: var(--u-muted);
  font-size: var(--u-text-xs);
  line-height: 1.6;
}
[data-ui='v3'] .calendar-feed-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--u-space-2);
  padding-bottom: var(--u-space-4);
}
#calendar-feed-dialog .calendar-feed-actions .u-btn {
  font-size: var(--u-text-sm);
  white-space: nowrap;
}
#calendar-feed-dialog .calendar-revoke {
  color: var(--u-danger);
  border-color: transparent;
}
#calendar-feed-dialog .calendar-feed-info {
  font-size: var(--u-text-xs);
  line-height: 1.6;
  color: var(--u-muted);
}
#calendar-link-confirm footer {
  gap: var(--u-space-2);
}
#calendar-link-confirm footer .u-btn {
  flex: 1;
  padding-inline: var(--u-space-2);
  font-size: var(--u-text-sm);
  white-space: nowrap;
}
@media (hover: hover) {
  [data-ui='v3'] .calendar-destination:hover:not(:disabled) {
    background: var(--u-hover);
  }
}
[data-ui='v3'] .calendar-destination:active:not(:disabled) {
  background: var(--u-press);
}
/* The mobile form helper pins surfaces to the visual viewport's top edge.
   These read-only subscription dialogs remain centred within that same bound. */
@media (max-width: 767px) {
  :is(#calendar-feed-dialog, #calendar-link-confirm).u-viewport-dialog {
    translate: 0
      calc(
        (
            var(--u-viewport-height, 100dvh) - env(safe-area-inset-top, 0px) -
              env(safe-area-inset-bottom, 0px) - 16px - 100%
          ) /
          2
      );
  }
}
@media (min-width: 600px) {
  [data-ui='v3'] .calendar-destinations,
  [data-ui='v3'] .calendar-feed-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  [data-ui='v3'] .calendar-destination {
    justify-content: center;
    padding-inline: var(--u-space-3);
  }
}
/* #endregion */
