/* Live panels (scripts/live-board.js): what the app's own public routes say
   this minute. Cards sit on the public shell's surface with the site's 18px
   card corners; the countdowns use tabular figures so they do not jitter as
   they change. */

.otf-live {
    width: min(100%, var(--otf-canvas-max, 1440px));
    margin-inline: auto;
    padding: 108px var(--otf-inset, 16px);
    border-top: 1px solid var(--otf-public-line);
}

.otf-live-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 24px;
    margin-top: 36px;
}

.otf-live-spots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.otf-live-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    color: var(--otf-public-muted);
    font-size: 13px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

/* Wide enough for "Updated 12:59 PM", so the refresh button stays put. */
[data-live-updated] { min-width: 15ch; text-align: right; }

.otf-live-refresh {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--otf-public-line);
    border-radius: 999px;
    color: var(--otf-public-ivory);
    background: rgba(255, 250, 240, 0.05);
    font: inherit;
    font-size: 13px;
    font-weight: 760;
    cursor: pointer;
    transition: border-color 200ms ease, transform 100ms ease;
}

.otf-live-refresh:hover { border-color: rgba(255, 250, 240, 0.28); }
.otf-live-refresh:active { transform: scale(0.97); }
.otf-live-refresh:focus-visible { outline: 2px solid var(--otf-public-sand); outline-offset: 3px; }
.otf-live-refresh.is-spinning i { animation: otfLiveSpin 900ms linear infinite; }

@keyframes otfLiveSpin { to { transform: rotate(360deg); } }

.otf-live-grid {
    display: grid;
    /* auto-fit: a board of three panels fills the row instead of leaving a
       fourth column empty. */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
    align-items: start;
    gap: 18px;
    margin-top: 24px;
}

.otf-live-grid.is-pair { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }

.otf-live-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 220px;
    padding: 22px;
    border: 1px solid var(--otf-public-line);
    border-radius: 18px;
    background: var(--otf-public-surface);
}

.otf-live-card header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.otf-live-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    color: var(--otf-public-sand);
    background: var(--otf-public-surface-strong);
}

.otf-live-card h3 {
    margin: 0;
    color: var(--otf-public-ivory);
    font-family: var(--otf-heading);
    font-size: 17px;
    font-weight: 760;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.otf-live-body { flex: 1; min-width: 0; }

.otf-live-source {
    margin: 16px 0 0;
    color: var(--otf-public-muted);
    font-size: 12px;
    line-height: 1.4;
}

.otf-live-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.otf-live-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--otf-public-line);
}

.otf-live-row:first-child { border-top: 0; padding-top: 2px; }
.otf-live-row.is-event { grid-template-columns: minmax(84px, auto) minmax(0, 1fr); align-items: start; }

.otf-live-row-main { display: grid; gap: 2px; min-width: 0; }

.otf-live-row-main strong,
.otf-live-note strong {
    overflow-wrap: anywhere;
    color: var(--otf-public-ivory);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.otf-live-row-main small,
.otf-live-row-time small,
.otf-live-note small {
    color: var(--otf-public-muted);
    font-size: 12.5px;
    line-height: 1.35;
}

.otf-live-row-main a,
.otf-live-note a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(255, 250, 240, 0.28);
    text-underline-offset: 3px;
}

.otf-live-row-main a:hover,
.otf-live-note a:hover { text-decoration-color: var(--otf-public-sand); }

.otf-live-row-time {
    display: grid;
    justify-items: end;
    gap: 2px;
    text-align: right;
}

.otf-live-row-time strong {
    color: var(--otf-public-ivory);
    font-size: 16px;
    font-weight: 780;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.otf-live-row-time small.is-live { color: var(--otf-public-live); }

/* A live time carries a dot as well as the word, so the state is not colour alone. */
.otf-live-row-time small.is-live::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    background: currentColor;
    vertical-align: 1px;
}

.otf-live-clock {
    color: var(--otf-public-sand);
    font-size: 13px;
    font-weight: 760;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
}

.otf-live-line {
    display: inline-grid;
    place-items: center;
    min-width: 46px;
    height: 28px;
    padding: 0 8px;
    border-radius: 8px;
    color: var(--otf-public-ivory);
    background: var(--otf-public-surface-strong);
    box-shadow: inset 0 0 0 1px var(--otf-public-line);
    font-size: 12.5px;
    font-weight: 820;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.otf-live-line.has-colour {
    color: var(--otf-line-ink);
    background: var(--otf-line);
    box-shadow: none;
}

.otf-live-lede {
    margin: 0 0 8px;
    color: var(--otf-public-muted);
    font-size: 14px;
}

.otf-live-lede strong { color: var(--otf-public-ivory); font-variant-numeric: tabular-nums; }

.otf-live-sub {
    margin: 14px 0 6px;
    color: var(--otf-public-muted);
    font-size: 13px;
    font-weight: 650;
}

.otf-live-note {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-top: 1px solid var(--otf-public-line);
}

.otf-live-note:first-child { border-top: 0; padding-top: 2px; }

.otf-live-note > a {
    justify-self: start;
    margin-top: 2px;
    color: var(--otf-public-sand);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.otf-live-note.is-warning small { color: #f0b46a; }

.otf-live-row.is-event .otf-live-row-main strong,
.otf-live-rows.is-notes strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.otf-live-empty {
    margin: 0;
    color: rgba(255, 250, 240, 0.78);
    font-size: 15px;
    line-height: 1.55;
}

.otf-live-retry {
    margin-top: 14px;
    min-height: 40px;
    padding: 8px 18px;
    border: 0;
    border-radius: 999px;
    color: var(--otf-public-action-ink);
    background: var(--otf-public-action);
    font: inherit;
    font-size: 14px;
    font-weight: 760;
    cursor: pointer;
}

.otf-live-retry:active { transform: scale(0.97); }
.otf-live-retry:focus-visible { outline: 2px solid var(--otf-public-sand); outline-offset: 3px; }

.otf-live-status {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 12px;
}

.otf-live-status p {
    margin: 0;
    color: var(--otf-public-ivory);
    font-size: 15px;
    line-height: 1.45;
}

.otf-live-status small { color: var(--otf-public-muted); font-weight: 600; }

.otf-live-status-dot {
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--otf-public-muted);
}

.otf-live-status.is-normal .otf-live-status-dot { background: var(--otf-public-live); box-shadow: 0 0 0 4px rgba(148, 231, 177, 0.2); }
.otf-live-status.is-advisory .otf-live-status-dot { background: #f0b46a; box-shadow: 0 0 0 4px rgba(240, 180, 106, 0.18); }
/* A red dot would disappear on Sprout's red: an emergency is the bright one. */
.otf-live-status.is-emergency .otf-live-status-dot { background: #fffaf0; box-shadow: 0 0 0 4px rgba(255, 250, 240, 0.35); }

.otf-live-inline-link,
.otf-live-attribution {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: var(--otf-public-sand);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.otf-live-inline-link:hover,
.otf-live-attribution:hover { text-decoration: underline; text-underline-offset: 3px; }

.otf-live-weather {
    display: flex;
    align-items: center;
    gap: 18px;
}

.otf-live-weather > span:last-child { display: grid; gap: 2px; }
.otf-live-weather strong { color: var(--otf-public-ivory); font-size: 18px; font-weight: 760; }
.otf-live-weather small { color: var(--otf-public-muted); font-size: 13px; }

.otf-live-temp {
    color: var(--otf-public-ivory);
    font-family: var(--otf-heading);
    font-size: 58px;
    font-weight: 760;
    letter-spacing: -0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.otf-live-temp small {
    margin-left: 2px;
    color: var(--otf-public-muted);
    font-size: 18px;
    letter-spacing: 0;
    vertical-align: top;
}

.otf-live-skeleton { display: grid; gap: 14px; padding-top: 4px; }

.otf-live-skeleton span {
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(255, 250, 240, 0.05) 0%, rgba(255, 250, 240, 0.11) 50%, rgba(255, 250, 240, 0.05) 100%);
    background-size: 200% 100%;
    animation: otfLiveShimmer 1.4s ease-in-out infinite;
}

.otf-live-skeleton span:nth-child(2) { width: 86%; }
.otf-live-skeleton span:nth-child(3) { width: 64%; }

@keyframes otfLiveShimmer {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

.otf-live-card:not(.is-loading) .otf-live-skeleton { display: none; }

@media (max-width: 767px) {
    .otf-live { padding-top: 76px; padding-bottom: 76px; }
    .otf-live-meta { margin-left: 0; width: 100%; justify-content: space-between; }
    .otf-live-card { min-height: 0; padding: 18px; }
}

/* On a phone the spots scroll sideways instead of wrapping into rows. */
@media (max-width: 640px) {
    .otf-live-spots {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-inline: calc(var(--otf-inset, 16px) * -1);
        padding-inline: var(--otf-inset, 16px);
        scrollbar-width: none;
        overscroll-behavior-x: contain;
    }
    .otf-live-spots::-webkit-scrollbar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .otf-live-skeleton span,
    .otf-live-refresh.is-spinning i { animation: none; }
    .otf-live-refresh:active,
    .otf-live-retry:active { transform: none; }
}

/* An open place: a green dot, with the word "Open" beside its distance. */
.otf-live-open-dot {
    width: 10px;
    height: 10px;
    margin-inline: 4px;
    border-radius: 50%;
    background: var(--otf-public-live);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--otf-public-live) 22%, transparent);
}

/* Groups: a round picture (or initials), the name with its badge, what kind
   of group it is, how many are in it and since when, and two lines about it. */
.otf-live-row.is-group { grid-template-columns: auto minmax(0, 1fr); align-items: start; }

.otf-live-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    color: var(--otf-public-ivory);
    background: var(--otf-public-raised);
    box-shadow: inset 0 0 0 1px var(--otf-public-line);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.otf-live-avatar img { width: 100%; height: 100%; object-fit: cover; }

.otf-live-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    color: var(--otf-public-canvas);
    background: var(--otf-public-sand);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    vertical-align: 2px;
}

.otf-live-group-about {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    color: var(--otf-public-muted);
    font-size: 13px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
