/* The Time Machine section (time-machine.js). Uses the editor's colours from
   styles.css. */
.tm-workspace { display: grid; gap: 18px; }
.tm-loading { margin: 0; padding: 40px; border: 1px dashed #b9c7c5; border-radius: var(--radius); color: #4d5d64; text-align: center; }
.tm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.tm-status { display: grid; gap: 4px; margin: 0; }
.tm-status p { margin: 0; }
.tm-status span { color: #4d5d64; }
.tm-status .tm-pending strong { color: var(--coral); }
.tm-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-bar-actions a { text-decoration: none; }
.tm-reload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; padding: 12px 16px; border-left: 5px solid #8a6400; border-radius: 12px; background: #f8edca; color: #5c4b18; }

.tm-layout { display: grid; grid-template-columns: minmax(280px, 420px) minmax(0, 1fr) 92px; gap: 18px; align-items: start; }
.tm-timeline { margin: 0; padding: 0; list-style: none; border-left: 3px solid var(--teal-soft); }
.tm-day { position: sticky; top: 76px; z-index: 2; margin: 14px 0 6px -3px; padding: 6px 12px; border-left: 3px solid var(--coral-bright); background: var(--paper); color: var(--coral); font-size: .78rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; scroll-margin-top: 90px; }
.tm-day:first-child { margin-top: 0; }
.tm-item { position: relative; display: grid; gap: 6px; margin: 0 0 8px 14px; }
.tm-item::before { content: ""; position: absolute; top: 20px; left: -21px; width: 11px; height: 11px; border: 2px solid var(--teal); border-radius: 50%; background: var(--card); }
.tm-item.is-chosen::before { background: var(--teal); }
.tm-open { display: grid; gap: 4px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); text-align: left; }
.tm-open:hover { border-color: var(--teal); }
.tm-open:focus-visible, .tm-ruler a:focus-visible { outline: 3px solid var(--coral-bright); outline-offset: 2px; }
.tm-item.is-chosen .tm-open { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal) inset; background: #f3f9f9; }
.tm-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tm-time { color: var(--teal-deep); font-size: 1.05rem; }
.tm-reason, .tm-now { padding: 2px 9px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-deep); font-size: .72rem; font-weight: 900; }
.tm-reason.is-restore { background: #f8edca; color: #5c4b18; }
.tm-reason.is-before-restore, .tm-reason.is-nightly { background: #eceae4; color: #4d5d64; }
.tm-now { background: #dcefe3; color: var(--green); }
.tm-live { padding: 2px 9px; border-radius: 999px; background: var(--teal-deep); color: #fff; font-size: .72rem; font-weight: 900; }
.tm-item.is-live::before { border-color: var(--coral); background: var(--coral-bright); }
.tm-by { color: #4d5d64; font-size: .84rem; }
.tm-changes { margin: 2px 0 0; padding-left: 18px; color: var(--ink); font-size: .9rem; }
.tm-undo { justify-self: start; }

.tm-detail { position: sticky; top: 92px; }
.tm-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.tm-card h2 { margin: 0 0 4px; font-size: 1.3rem; }
.tm-card h3 { margin: 18px 0 6px; font-size: 1rem; }
.tm-help { margin: 0 0 10px; color: #4d5d64; font-size: .9rem; }
.tm-list { margin: 0; padding-left: 20px; }
.tm-areas { display: grid; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.tm-areas label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.tm-areas input { width: 20px; min-height: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--teal); }
.tm-areas strong, .tm-areas small { display: block; }
.tm-areas small { color: #4d5d64; font-size: .86rem; }
.tm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 10px; }
.tm-actions a { text-decoration: none; }

.tm-ruler { position: sticky; top: 92px; display: grid; gap: 4px; max-height: calc(100vh - 120px); overflow-y: auto; padding: 8px 6px; border-radius: 14px; background: var(--teal-deep); }
.tm-ruler a { padding: 5px 6px; border-radius: 8px; color: #c9dde0; font-size: .74rem; font-weight: 800; text-align: right; text-decoration: none; white-space: nowrap; }
.tm-ruler a:hover { background: rgba(255,255,255,.12); color: #fff; }

/* The website helper's panel. */
.tm-helper { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.tm-helper h2 { margin: 0 0 6px; font-size: 1.25rem; }
.tm-helper h3 { margin: 16px 0 6px; font-size: 1rem; }
.tm-helper-on { color: var(--green); font-weight: 800; }
.tm-helper-off { color: #8f3030; font-weight: 800; }
.tm-abilities { display: grid; gap: 6px; margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.tm-abilities legend { padding: 0 4px; color: var(--teal-deep); font-weight: 800; }
.tm-abilities label { display: flex; gap: 8px; align-items: flex-start; }
.tm-abilities input { width: 18px; min-height: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--teal); }
.tm-abilities .button { justify-self: start; margin-top: 6px; }
.tm-helper-address { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tm-helper-address code { padding: 6px 10px; border-radius: 8px; background: var(--teal-soft); color: var(--teal-deep); overflow-wrap: anywhere; }

/* The marker in the top bar, and the Push live dialogs. */
.tm-pill { flex: none; min-height: 38px; border: 0; border-radius: 999px; padding: 6px 14px; background: var(--coral-bright); color: var(--teal-deep); font-size: .84rem; font-weight: 900; white-space: nowrap; }
.tm-pill:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.tm-dialog { width: min(calc(100% - 32px), 620px); }
.tm-dialog-inner { padding: 28px 30px; max-height: calc(100vh - 80px); overflow-y: auto; }
.tm-dialog h2 { margin-bottom: 8px; }
.tm-dialog h3 { margin: 16px 0 6px; font-size: 1rem; }
.tm-dialog-actions { flex-wrap: wrap; }
.tm-dialog-actions a { text-decoration: none; }
.tm-problems { margin: 0; padding-left: 20px; color: #8f3030; }
.tm-problems:empty { display: none; }
.tm-ok { color: var(--green); font-weight: 800; }

@media (max-width: 1100px) {
  .tm-layout { grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); }
  .tm-ruler { display: none; }
}
@media (max-width: 900px) {
  .tm-layout { grid-template-columns: 1fr; }
  .tm-detail { position: static; order: -1; }
  .tm-day { top: 0; }
}
