:root {
  --bg: #e7e9ee;
  --ink: #1c1e22;
  --muted: #5e6570;
  --line: #d5d8de;
  --card: #ffffff;
  --dash-ink: var(--ink);
  --purple: #6428f0;
  --purple-deep: #4b16c9;
  --orange: #ff7a18;
  --orange-deep: #e26500;
  --accent: var(--purple);
  --accent-hover: var(--purple-deep);
  --signal: var(--orange);
  --warn: #8a4b12;
  --danger: #8f2d2d;
  --ok: #148a45;
  --shadow: none;
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Avenir Next", "Segoe UI", sans-serif;
  --font-data: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--bg);
}

.shell {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.35rem 0 3.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem 1.25rem;
  align-items: start;
  margin-bottom: 1.5rem;
  padding: 0.15rem 0 1.1rem;
  color: var(--dash-ink);
  background: transparent;
  border-bottom: 2px solid var(--purple);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.icon,
.office-sheet-icon {
  display: block;
  flex: none;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark {
  display: block;
  flex: none;
  width: 8.75rem;
  height: 8.75rem;
  overflow: visible;
  shape-rendering: crispEdges;
}

.px-shadow { fill: #2a2140; }
.px-frame { fill: var(--purple); }
.px-case { fill: #f7f5fb; }
.px-dial { fill: #ffffff; }
.px-ink { fill: #241838; }
.px-orange { fill: var(--orange); }
.px-hot { fill: #ffe0c2; }

a {
  color: var(--accent);
}

a:hover {
  color: var(--orange-deep);
}

.brand {
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--dash-ink);
}

.brand-sub {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.brand-sub a {
  color: inherit;
}

.topbar-side {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.person-menu {
  position: relative;
}

.topbar-icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.person-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}

.person-menu-toggle::-webkit-details-marker {
  display: none;
}

.person-menu-toggle::marker {
  content: "";
}

.person-menu-toggle:hover,
.person-menu[open] > .person-menu-toggle {
  color: var(--ink);
  background: #f3f4f6;
}

.person-menu-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#guide-open {
  white-space: normal;
  text-align: center;
}

.person-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.person-menu:not([open]) > .person-menu-panel {
  display: none;
}

.person-menu[open] > .person-menu-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
}

.person-menu-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(24rem, calc(100vw - 2rem));
  max-height: calc(100vh - 8rem);
  overflow: auto;
  padding: 0.9rem 1rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

@supports (anchor-name: --person-toggle) {
  .person-menu-toggle {
    anchor-name: --person-toggle;
  }

  .person-menu-panel {
    position: fixed;
    position-anchor: --person-toggle;
    top: calc(anchor(bottom) + 0.45rem);
    right: anchor(right);
    left: auto;
    max-height: calc(100vh - anchor(bottom) - 1.25rem);
  }
}

.disclaimer {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.people-select {
  min-width: 0;
  width: 100%;
}

.people-combo {
  position: relative;
}

.people-combo input {
  width: 100%;
}

.people-options {
  position: fixed;
  z-index: 50;
  top: calc(100% + 0.25rem);
  left: 0;
  right: auto;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  max-height: 16rem;
  overflow: auto;
}

.people-options[hidden] {
  display: none;
}

.people-options button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.7rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.people-options button.is-active,
.people-options button:hover {
  background: #f3f4f6;
}

.people-options button.is-add {
  color: var(--accent);
  font-weight: 600;
}

.people-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 1.35rem 1.4rem 1.5rem;
  margin-bottom: 1.25rem;
}

.panel h1,
.panel h2,
.panel-title {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 0.45rem;
}

.panel h1,
.hero-title {
  font-size: 1.4rem;
}

.panel h2 {
  font-size: 1.15rem;
}

.panel-title .icon {
  margin-top: 0.18em;
}

.lead,
.field-hint {
  margin: 0 0 1rem;
  color: var(--muted);
}

.field-hint {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: 0.55rem 0.65rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
  border-color: var(--purple);
}

input[type='time'],
input[type='date'],
.schedule-history .times,
.stat-row strong {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
}

textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--purple);
  border-radius: var(--radius-sm);
  background: var(--purple);
  color: #fff;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  font-weight: 600;
  box-shadow: none;
}

button:hover {
  background: var(--purple-deep);
  border-color: var(--purple-deep);
  color: #fff;
}

button.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.secondary:hover {
  background: #f4eeff;
  border-color: var(--purple);
  color: var(--purple-deep);
}

.topbar-side .secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  padding: 0.42rem 0.65rem;
  font-size: 0.84rem;
}

.topbar-side .secondary:hover {
  background: #f4eeff;
  border-color: var(--purple);
  color: var(--purple-deep);
}

.danger-link,
.route-jump,
.people-options button {
  box-shadow: none;
}

button:disabled,
button:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
}

.danger-link {
  background: transparent;
  color: var(--danger);
  border: 0;
  padding: 0;
  font-weight: 600;
  text-decoration: underline;
}

.danger-link:hover {
  background: transparent;
  color: #6e1c1c;
}

.footer-actions {
  padding: 0.5rem 0 2rem;
}

.run-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.run-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  background: #fff;
}

.run-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.run-card .pair,
.schedule-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 0.85rem 0 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.schedule-history {
  width: 100%;
  border-collapse: collapse;
  min-width: 40rem;
}

.schedule-history th,
.schedule-history td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.schedule-history thead th {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f6f7f9;
  box-shadow: inset 0 -2px 0 var(--orange);
}

.schedule-history tbody th {
  font-weight: 650;
  white-space: nowrap;
  background: transparent;
}

.schedule-history tbody tr:last-child td,
.schedule-history tbody tr:last-child th {
  border-bottom: 0;
}

.schedule-history tr.is-history th,
.schedule-history tr.is-history td {
  background: color-mix(in srgb, var(--tone) 16%, #f7fbfe);
}

.schedule-history tr.is-history th {
  box-shadow: inset 4px 0 0 var(--tone);
}

.schedule-history .times {
  font-family: var(--font-display);
  font-size: 1.05rem;
  white-space: nowrap;
}

.schedule-history td.is-changed .times {
  font-weight: 700;
}

.schedule-history .change-note,
.schedule-history .contracted-detail {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.schedule-history .row-kind {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.schedule-history .contracted-label {
  font-weight: 650;
  display: block;
  min-width: 11rem;
}

.schedule-history .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.schedule-history .row-actions button {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.notification-toasts {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.notification-toasts[hidden] {
  display: none;
}

.notification-toast {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--purple);
  border-radius: var(--radius-sm);
  box-shadow: none;
  padding: 0.95rem 1.1rem;
  display: grid;
  gap: 0.45rem;
}

.notification-toast.is-flashing {
  animation: notification-toast-flash 3s ease-in-out 1;
}

@keyframes notification-toast-flash {
  0%,
  100% {
    background: var(--card);
    box-shadow: var(--shadow);
  }
  20%,
  60% {
    background: #f3f4f6;
    box-shadow: 0 0 0 2px var(--ink);
  }
  40%,
  80% {
    background: var(--card);
    box-shadow: var(--shadow);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notification-toast.is-flashing {
    animation: none;
  }
}

.notification-toast-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.notification-toast-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.notification-toast-text,
.notification-toast-hours {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.notification-toast-times {
  margin: 0.15rem 0 0;
  padding-left: 1.15rem;
  color: var(--ink);
}

.notification-toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.hero {
  border-left: 0;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
  margin: 0 0 0.4rem;
}

.hero-kicker::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--signal);
  flex: none;
}

.hero.outcome-bid .hero-kicker::before {
  background: var(--warn);
}

.hero.outcome-bump .hero-kicker::before {
  background: var(--danger);
}

.hero-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  margin: 0 0 0.5rem;
}

.hero-detail,
.stat-row {
  color: var(--muted);
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.stat-row strong {
  color: var(--ink);
  display: block;
  margin-top: 0.15rem;
  font-size: 1.05rem;
  font-weight: 650;
}

.preview-box,
.status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f6f7f9;
  color: var(--ink);
}

.status.is-error {
  border-color: #e3c0c0;
  background: #f8ecec;
  color: var(--danger);
}

.status.is-ok {
  border-color: #c5d4c9;
  background: #f3f7f4;
}

.edit-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.field-static-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.field-static {
  margin: 0;
  padding: 0.55rem 0;
}

.empty {
  color: var(--muted);
}

.calendar-months {
  display: grid;
  gap: 1.25rem;
}

.history-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.history-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.history-legend li.is-key-note {
  flex: 1 0 16rem;
  align-items: flex-start;
  line-height: 1.35;
}

.history-swatch {
  width: 0.85rem;
  height: 0.85rem;
  flex: none;
  background: var(--tone);
}

.history-swatch.is-bid {
  width: 1.15rem;
  height: 0.72rem;
  background: transparent;
  border: 2px solid #8a4b12;
  border-radius: 2px;
}

.month-block h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
}

.month-grid {
  --cal-gap: 3px;
  --arrow-top: calc(0.35rem + 0.72rem * 1.1 + 0.12rem + 0.21rem - 1.5px);
  --arrow-top-window: calc(0.35rem + 0.72rem * 1.1 + 0.12rem + 0.775rem - 1.5px);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--cal-gap);
}

.dow,
.cal-day {
  font-size: 0.72rem;
  text-align: center;
  padding: 0.35rem 0.15rem;
}

.dow {
  color: var(--muted);
  font-weight: 600;
}

.cal-day {
  position: relative;
  border: 1px solid transparent;
  min-height: 2.4rem;
}

.cal-day.is-school {
  background: #e6e8ed;
  border-color: #d5d8de;
}

.cal-day.is-off {
  background: #f4f5f7;
  color: var(--muted);
}

.cal-day.is-today {
  z-index: 4;
  border: 2px solid #c62828;
  box-shadow: inset 0 0 0 1px #c62828;
}

.cal-day.is-hover-change:hover,
.cal-day.is-hover-change:focus-visible {
  z-index: 8;
}

.cal-hover {
  display: none;
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 16rem;
  margin: 0;
  padding: 0.4rem 0.55rem;
  list-style: none;
  text-align: left;
  background: #1a2c42;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(26, 44, 66, 0.28);
  pointer-events: none;
}

.cal-day.is-tip-start .cal-hover {
  left: 0;
  transform: none;
}

.cal-day.is-tip-end .cal-hover {
  left: auto;
  right: 0;
  transform: none;
}

.cal-hover li {
  display: block;
}

.cal-hover li.is-change {
  font-weight: 700;
}

.cal-day.is-hover-change:hover .cal-hover,
.cal-day.is-hover-change:focus-visible .cal-hover {
  display: block;
}

.cal-hover li.is-detail {
  display: none;
}

.day-dialog {
  width: min(22rem, calc(100% - 1.5rem));
  max-height: min(80vh, 32rem);
  overflow: auto;
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 18px 50px rgba(23, 36, 51, 0.22);
}

.day-dialog::backdrop {
  background: rgba(23, 36, 51, 0.46);
}

.day-dialog-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.day-dialog-list li {
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
  line-height: 1.35;
}

.day-dialog-list li.is-change {
  font-weight: 700;
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) {
  .cal-day.is-hover-change {
    cursor: pointer;
  }

  .cal-day.is-hover-change:hover .cal-hover,
  .cal-day.is-hover-change:focus-visible .cal-hover {
    display: none;
  }
}

.history-pip {
  display: block;
  width: 0.42rem;
  height: 0.42rem;
  margin: 0.12rem auto 0;
  border: 1.5px solid var(--tone);
  background: transparent;
}

.history-pip.is-window,
.history-pip.is-established {
  background: var(--tone);
}

.history-pip.is-window {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 1.55rem;
  height: 1.55rem;
  min-width: 1.55rem;
  max-width: 1.55rem;
  padding: 0;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.history-pip.is-established {
  box-shadow: 0 0 0 1px #fff, 0 0 0 2px var(--tone);
}

.cal-day.is-contracted::after {
  content: "";
  position: absolute;
  inset: 1px;
  border: 2px solid var(--tone);
  border-radius: 2px;
  pointer-events: none;
}

.cal-day.is-bid-arrow {
  z-index: 3;
}

.bid-rect {
  z-index: 2;
  pointer-events: none;
  border: 2px solid #8a4b12;
  border-radius: 3px;
}

.bid-arrow,
.cal-day.is-arrow-origin::after {
  position: absolute;
  z-index: 4;
  top: var(--arrow-top);
  height: 3px;
  background: var(--tone);
  pointer-events: none;
}

.cal-day.is-arrow-from-window .bid-arrow,
.cal-day.is-arrow-origin.is-arrow-from-window::after {
  top: var(--arrow-top-window);
}

.bid-arrow {
  left: -1px;
  right: -1px;
}

.cal-day.is-arrow-origin::after {
  content: "";
  left: 50%;
  right: -1px;
}

.cal-day.is-arrow-origin-bridge::after {
  right: calc(-1 * (var(--cal-gap) + 2px));
}

.cal-day.is-arrow-join .bid-arrow {
  left: calc(-1 * (var(--cal-gap) + 1px));
}

.cal-day.is-arrow-bridge .bid-arrow {
  right: calc(-1 * (var(--cal-gap) + 2px));
}

.bid-arrow.is-head {
  right: 2px;
}

.bid-arrow.is-head::after {
  content: "";
  position: absolute;
  right: -9px;
  top: -3.5px;
  border-left: 8px solid var(--tone);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.cal-day .num {
  display: block;
  font-weight: 700;
  line-height: 1.1;
}

.cal-day .why {
  display: block;
  font-size: 0.58rem;
  line-height: 1.2;
}

.tour-kicker {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.15rem;
}

.contract-cite-link {
  color: var(--accent);
  font-weight: 600;
}

.contract-cite-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  cursor: pointer;
}

.citation {
  width: min(40rem, calc(100% - 2rem));
  max-height: min(90vh, 36rem);
  overflow: auto;
  padding: 1.35rem 1.45rem 1.3rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 18px 50px rgba(23, 36, 51, 0.22);
}

.citation::backdrop {
  background: rgba(23, 36, 51, 0.5);
}

.citation h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  margin: 0 0 0.7rem;
}

.citation-text {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--accent);
  background: #fff;
  color: var(--ink);
  line-height: 1.5;
}

.citation-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

.citation-links a {
  color: var(--accent);
  font-weight: 600;
}

.guide-dialog {
  width: min(52rem, calc(100% - 1.5rem));
  height: min(92vh, 52rem);
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  overflow: hidden;
  flex-direction: column;
  box-shadow: 0 18px 50px rgba(23, 36, 51, 0.22);
}

.guide-dialog[open] {
  display: flex;
}

.guide-dialog::backdrop {
  background: rgba(23, 36, 51, 0.46);
}

.guide-dialog-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.guide-email-label {
  margin-right: auto;
  font-weight: 600;
}

.guide-dialog-bar select {
  min-width: 12rem;
  max-width: 100%;
}

.guide-email-status {
  margin: 0;
  border-left: 0;
  border-right: 0;
}

.guide-dialog iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #e7eef6;
}

.change-dialog {
  width: min(42rem, calc(100% - 2rem));
  max-height: min(92vh, 48rem);
  overflow: auto;
  padding: 1.35rem 1.45rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 18px 50px rgba(23, 36, 51, 0.22);
}

.change-dialog::backdrop {
  background: rgba(23, 36, 51, 0.46);
}

.change-dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.7rem;
}

.change-dialog-header h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.55rem;
  margin: 0;
}

.rules ol {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.rules li {
  margin: 0.45rem 0;
}

@media (max-width: 720px) {
  .grid,
  .run-card .pair {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-side {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-icons {
    margin-left: auto;
  }

  .month-grid {
    --cal-gap: 2px;
  }
}
