/* MobileAccess control panel.
   Bootstrap does the heavy lifting; this is the delta -- the opening hours
   calendar and the charts, both of which Bootstrap has no opinion about. */

:root {
    --ma-open: #198754;
    --ma-open-bg: #d1e7dd;
    --ma-self: #0d6efd;
    --ma-self-bg: #cfe2ff;
    --ma-closed: #6c757d;
    --ma-closed-bg: #e9ecef;
    --ma-now: #dc3545;
    --ma-exception: #b35c00;
    --ma-line: rgba(0, 0, 0, .09);
    --ma-line-soft: rgba(0, 0, 0, .035);
}

@media (prefers-color-scheme: dark) {
    :root {
        --ma-open-bg: #14492f;
        --ma-self-bg: #10305c;
        --ma-closed-bg: #343a40;
        --ma-exception: #ffb86b;
        --ma-line: rgba(255, 255, 255, .12);
        --ma-line-soft: rgba(255, 255, 255, .05);
    }
}

body { min-height: 100vh; }

/* ------------------------------------------------------------------ */
/* The calendar on the opening hours page                              */
/*                                                                     */
/* Seven columns, midnight at the top and at the bottom. The column     */
/* background is the shop's default mode; the standard week is painted  */
/* over it, and in a real week the date exceptions over that. So what   */
/* you see is what the door will do. Drawn by assets/js/schedule.js.    */
/* ------------------------------------------------------------------ */

.ma-sched-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
}
.ma-sched-nav { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.ma-sched-title {
    min-width: 12.5rem;
    text-align: center;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.ma-sched-jump { width: auto; }

.ma-sched[data-view="calendar"] [data-only="standard"],
.ma-sched[data-view="standard"] [data-only="calendar"] { display: none !important; }

.ma-cal {
    --ma-cal-h: 38rem;
    display: grid;
    grid-template-columns: 2.6rem repeat(7, minmax(0, 1fr));
    column-gap: .35rem;
    user-select: none;
    -webkit-user-select: none;
}

.ma-cal-day {
    border: 0;
    background: none;
    padding: 0 0 .45rem;
    text-align: center;
    font-size: .8rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
    border-radius: .35rem;
    line-height: 1.2;
}
.ma-cal-day:hover { color: var(--bs-body-color); }
.ma-cal-day small { display: block; font-size: .7rem; font-weight: 400; }
.ma-cal-day.is-today { color: var(--bs-primary); font-weight: 700; }
.ma-cal-day.has-exception small::after {
    content: '';
    display: inline-block;
    width: .4rem;
    height: .4rem;
    margin-left: .25rem;
    border-radius: 50%;
    background: var(--ma-exception);
    vertical-align: middle;
}

.ma-cal-axis { position: relative; height: var(--ma-cal-h); }
.ma-cal-axis span {
    position: absolute;
    right: .45rem;
    transform: translateY(-50%);
    font-size: .68rem;
    font-variant-numeric: tabular-nums;
    color: var(--bs-secondary-color);
}

.ma-cal-col {
    position: relative;
    height: var(--ma-cal-h);
    border-radius: .5rem;
    box-shadow: inset 0 0 0 1px var(--ma-line);
    cursor: crosshair;
    touch-action: pan-y;
}
.ma-cal-col.is-today { box-shadow: inset 0 0 0 2px rgba(13, 110, 253, .35); }
.ma-cal-col.is-past::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: .5rem;
    background: var(--bs-body-bg);
    opacity: .35;
    pointer-events: none;
    z-index: 4;
}

.ma-cal-grid {
    position: absolute;
    inset: 0;
    border-radius: .5rem;
    background-image:
        repeating-linear-gradient(to bottom,
            transparent 0, transparent calc(100% / 24 - 1px),
            var(--ma-line-soft) calc(100% / 24 - 1px), var(--ma-line-soft) calc(100% / 24)),
        repeating-linear-gradient(to bottom,
            transparent 0, transparent calc(100% / 8 - 1px),
            var(--ma-line) calc(100% / 8 - 1px), var(--ma-line) calc(100% / 8));
    pointer-events: none;
}

.ma-cal-block {
    position: absolute;
    left: 3px;
    right: 3px;
    border-radius: .35rem;
    padding: 3px 6px;
    overflow: hidden;
    font-size: .7rem;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    box-shadow: inset 0 0 0 1px currentColor;
    cursor: pointer;
    z-index: 1;
    touch-action: none;
}
.ma-cal-block b { display: block; font-weight: 600; }
.ma-cal-block em { display: block; font-style: normal; opacity: .85; }
.ma-cal-block q {
    display: block;
    quotes: none;
    font-style: italic;
    opacity: .85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ma-cal-block.is-short { padding-top: 0; padding-bottom: 0; }
.ma-cal-block.is-short em, .ma-cal-block.is-short q { display: none; }
.ma-cal-block.is-tiny b { display: none; }
.ma-cal-block.is-cut-top { border-top-left-radius: 0; border-top-right-radius: 0; }
.ma-cal-block.is-cut-bottom { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.ma-cal-block.is-editable { cursor: grab; }
.ma-cal-block:hover { filter: brightness(.95); }

/* In a real week the standard week sits underneath, quieter. */
.ma-cal-block.is-standard.is-under { box-shadow: none; opacity: .75; cursor: pointer; }
.ma-cal-block.is-exception {
    z-index: 2;
    box-shadow: inset 0 0 0 2px var(--ma-exception), 0 1px 3px rgba(0, 0, 0, .12);
    background-image: linear-gradient(135deg,
        transparent 0 45%, rgba(255, 255, 255, .28) 45% 55%, transparent 55% 100%);
    background-size: 10px 10px;
}
.ma-cal-block.is-lifted { opacity: .25; }

.ma-cal-handle {
    position: absolute;
    left: 0;
    right: 0;
    height: 8px;
    cursor: ns-resize;
    z-index: 3;
}
.ma-cal-handle::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 1.4rem;
    height: 3px;
    margin-left: -.7rem;
    border-radius: 2px;
    background: currentColor;
    opacity: 0;
    transition: opacity .12s;
}
.ma-cal-handle.is-top { top: 0; }
.ma-cal-handle.is-top::after { top: 2px; }
.ma-cal-handle.is-bottom { bottom: 0; }
.ma-cal-handle.is-bottom::after { bottom: 2px; }
.ma-cal-block:hover .ma-cal-handle::after { opacity: .6; }

.ma-cal-ghost {
    position: absolute;
    left: 3px;
    right: 3px;
    border-radius: .35rem;
    z-index: 5;
    pointer-events: none;
    border: 2px dashed var(--bs-primary);
    background: rgba(13, 110, 253, .12);
    font-size: .72rem;
    font-weight: 600;
    padding: 2px 6px;
    color: var(--bs-primary);
    font-variant-numeric: tabular-nums;
}
.ma-cal-ghost.is-conflict {
    border-color: var(--ma-now);
    background: rgba(220, 53, 69, .12);
    color: var(--ma-now);
}
.ma-cal.is-dragging, .ma-cal.is-dragging * { cursor: grabbing !important; }

.ma-cal-now {
    position: absolute;
    left: -2px;
    right: -2px;
    height: 0;
    border-top: 2px solid var(--ma-now);
    z-index: 6;
    pointer-events: none;
}
.ma-cal-now::before {
    content: '';
    position: absolute;
    left: 0;
    top: -4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ma-now);
}

.ma-legend { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.ma-legend span { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; }
.ma-swatch {
    flex: none;
    width: .85rem;
    height: .85rem;
    border-radius: .25rem;
    box-shadow: inset 0 0 0 1px var(--ma-line);
}
.ma-swatch-exception { box-shadow: inset 0 0 0 2px var(--ma-exception); }

.ma-mode-open         { background: var(--ma-open-bg);   color: var(--ma-open); }
.ma-mode-self_service { background: var(--ma-self-bg);   color: var(--ma-self); }
.ma-mode-closed       { background: var(--ma-closed-bg); color: var(--ma-closed); }

@media (prefers-color-scheme: dark) {
    .ma-mode-open         { color: #75b798; }
    .ma-mode-self_service { color: #9ec5fe; }
    .ma-mode-closed       { color: #adb5bd; }
}

/* The three modes as choices in the dialogs */
.ma-mode-choice { display: grid; gap: .4rem; }
.ma-mode-option {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    padding: .5rem .7rem;
    border-radius: .5rem;
    box-shadow: inset 0 0 0 1px var(--bs-border-color);
    cursor: pointer;
}
.ma-mode-option .ma-swatch { margin-top: .2rem; }
.ma-mode-option b { display: block; font-weight: 600; font-size: .9rem; }
.ma-mode-option small { display: block; color: var(--bs-secondary-color); }
.btn-check:checked + .ma-mode-option {
    box-shadow: inset 0 0 0 2px var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}
.btn-check:focus-visible + .ma-mode-option { outline: 2px solid var(--bs-primary); outline-offset: 2px; }

/* The two lists under the calendar */
.ma-week-list { display: grid; }
.ma-week-row {
    display: grid;
    grid-template-columns: 5.5rem 1fr auto;
    gap: .5rem;
    align-items: center;
    padding: .45rem 1rem;
    border-top: 1px solid var(--bs-border-color-translucent);
}
.ma-week-row:first-child { border-top: 0; }
.ma-week-row > b { font-weight: 500; font-size: .9rem; }
.ma-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.ma-chip {
    border: 0;
    border-radius: 1rem;
    padding: .15rem .6rem;
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
    box-shadow: inset 0 0 0 1px currentColor;
}
.ma-chip:hover { filter: brightness(.95); }
.ma-chip-add {
    border: 0;
    background: none;
    color: var(--bs-secondary-color);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 .25rem;
}
.ma-chip-add:hover { color: var(--bs-primary); }

.ma-exception-item {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .6rem 1rem;
    border-top: 1px solid var(--bs-border-color-translucent);
}
.ma-exception-item:first-child { border-top: 0; }
.ma-exception-item .ma-swatch { margin-top: .3rem; }
.ma-exception-item .ma-when { font-weight: 500; font-size: .9rem; }
.ma-exception-item .ma-what { font-size: .82rem; color: var(--bs-secondary-color); }

/* The small menu on a standard period in a real week */
.ma-pop {
    position: absolute;
    z-index: 1060;
    width: 17rem;
    padding: .75rem;
    border-radius: .6rem;
    background: var(--bs-body-bg);
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .18), 0 0 0 1px var(--ma-line);
}
.ma-pop .ma-pop-title { font-weight: 600; font-size: .9rem; }
.ma-pop .ma-pop-sub { font-size: .8rem; color: var(--bs-secondary-color); margin-bottom: .6rem; }
.ma-pop .btn { width: 100%; text-align: left; margin-top: .3rem; }

.ma-toasts {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    z-index: 1080;
    display: grid;
    gap: .5rem;
    width: min(26rem, calc(100vw - 2rem));
}
.ma-toast {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .9rem;
    border-radius: .6rem;
    background: #212529;
    color: #fff;
    font-size: .88rem;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .25);
}
.ma-toast.is-error { background: #b02a37; }
.ma-toast.is-info { background: #0a58ca; }
.ma-toast button {
    margin-left: auto;
    border: 0;
    background: none;
    color: #9ec5fe;
    font-weight: 600;
    padding: 0;
}

@media (max-width: 575px) {
    .ma-cal { --ma-cal-h: 30rem; grid-template-columns: 1.9rem repeat(7, minmax(0, 1fr)); column-gap: .15rem; }
    .ma-cal-block { font-size: 0; padding: 0; }
    .ma-cal-day small { font-size: .62rem; }
    .ma-sched-title { min-width: 0; }
    .ma-week-row { grid-template-columns: 4.2rem 1fr auto; padding: .45rem .75rem; }
}

/* ------------------------------------------------------------------ */
/* Numbers and charts                                                  */
/* ------------------------------------------------------------------ */

.ma-tile {
    border: 0;
    border-radius: .6rem;
    background: var(--bs-body-bg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06), inset 0 0 0 1px var(--ma-line);
    height: 100%;
    padding: 1rem 1.1rem;
    position: relative;
    overflow: hidden;
}
.ma-tile::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--bs-secondary-color);
    opacity: .5;
}
.ma-tile-in::before      { background: var(--ma-self); opacity: 1; }
.ma-tile-people::before  { background: var(--ma-open); opacity: 1; }
.ma-tile-denied::before  { background: var(--ma-now);  opacity: 1; }

.ma-tile-value {
    font-size: 2rem;
    font-weight: 650;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.ma-tile-label { font-size: .82rem; color: var(--bs-secondary-color); }
.ma-tile-note  { font-size: .72rem; color: var(--bs-secondary-color); opacity: .85; margin-top: .2rem; }

.ma-chart { margin: 0; position: relative; }
.ma-chart-plot {
    position: relative;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent calc(25% - 1px),
        var(--ma-line) calc(25% - 1px),
        var(--ma-line) 25%
    );
    border-bottom: 1px solid var(--ma-line);
    border-radius: .35rem .35rem 0 0;
}
.ma-chart svg { width: 100%; display: block; }
.ma-chart-tall svg  { height: 11rem; }
.ma-chart-short svg { height: 7rem; }

.ma-chart figcaption {
    display: flex;
    justify-content: space-between;
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
    color: var(--bs-secondary-color);
    padding-top: .35rem;
}
.ma-chart-empty { padding: 2.5rem 0; text-align: center; color: var(--bs-secondary-color); }

.ma-chart-peak {
    position: absolute;
    top: -.2rem;
    right: .2rem;
    font-size: .7rem;
    color: var(--bs-secondary-color);
    background: var(--bs-body-bg);
    padding: 0 .25rem;
}

.ma-bar-granted { fill: var(--ma-self); }
.ma-bar-denied  { fill: var(--ma-now); }
.ma-bar-none    { fill: var(--bs-secondary-color); opacity: .3; }
.ma-bar:hover   { filter: brightness(1.15); }

@media (prefers-color-scheme: dark) {
    .ma-bar-granted { fill: #6ea8fe; }
    .ma-bar-denied  { fill: #ea868f; }
}

/* Refusal breakdown: the half production has never been able to see. */
.ma-reason { padding: .6rem 0; border-top: 1px solid var(--ma-line); }
.ma-reason:first-child { border-top: 0; }
.ma-reason-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.ma-reason-count { font-variant-numeric: tabular-nums; font-weight: 600; }
.ma-reason-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--ma-closed-bg);
    margin-top: .35rem;
    overflow: hidden;
}
.ma-reason-bar div { height: 100%; border-radius: 3px; background: var(--ma-now); }

/* ------------------------------------------------------------------ */
/* The shop overview (panel/overview.php)                              */
/*                                                                     */
/* The one page in the panel meant to be looked at rather than worked  */
/* in, so it is allowed a little more care than Bootstrap's defaults:   */
/* soft cards, one colour per mode, and the answer to "is everything    */
/* all right" before anything else.                                     */
/* ------------------------------------------------------------------ */

.ov {
    --ov-radius: 1.1rem;
    --ov-card: var(--bs-body-bg);
    --ov-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
    --ov-ok: #12a150;
    --ov-ok-bg: #e7f7ee;
    --ov-bad: #d92d20;
    --ov-bad-bg: #fdecea;
    --ov-warn: #b54708;
    --ov-warn-bg: #fef4e6;
}
/* The panel is drawn in Bootstrap's light theme whatever the system says
   (nothing sets data-bs-theme), so the dark values the calendar picks up
   under prefers-color-scheme would put dark swatches on a white page here.
   The overview pins the light ones. */
.ov {
    --ma-open-bg: #d1e7dd;
    --ma-self-bg: #cfe2ff;
    --ma-closed-bg: #e9ecef;
    --ma-line: rgba(0, 0, 0, .09);
    --ma-line-soft: rgba(0, 0, 0, .035);
}
.ov .ma-mode-open         { color: var(--ma-open); }
.ov .ma-mode-self_service { color: var(--ma-self); }
.ov .ma-mode-closed       { color: var(--ma-closed); }

.ov-card {
    background: var(--ov-card);
    border: 1px solid var(--ma-line);
    border-radius: var(--ov-radius);
    box-shadow: var(--ov-shadow);
    padding: 1.35rem 1.4rem;
    display: flex;
    flex-direction: column;
}
.ov-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}
.ov-card-head h2 { font-size: 1.05rem; font-weight: 650; margin: 0; }
.ov-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .85rem;
    font-weight: 500;
    text-decoration: none;
}
.ov-link:hover { text-decoration: underline; }
.ov-label {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    margin-bottom: .5rem;
}
.ov-fine { font-size: .78rem; color: var(--bs-secondary-color); text-align: center; margin-top: .5rem; }
.ov-note { font-size: .88rem; color: var(--bs-secondary-color); margin-bottom: 1rem; }
.ov-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font-weight: 550; border-radius: .7rem; }
.ov-flash { border-radius: var(--ov-radius); }

/* -- is everything all right ---------------------------------------- */

.ov-health {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .8rem 1.1rem;
    margin-bottom: 1.25rem;
    border-radius: var(--ov-radius);
    background: var(--ov-ok-bg);
    color: var(--bs-body-color);
}
.ov-health > div { flex-grow: 1; min-width: 0; }
.ov-health strong { font-weight: 650; margin-right: .35rem; }
.ov-health span { color: var(--bs-secondary-color); }
.ov-health-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--ov-ok);
    color: #fff !important;
}
.ov-health-time { font-size: .78rem; white-space: nowrap; }
.ov-health-bad  { background: var(--ov-bad-bg); }
.ov-health-bad  .ov-health-icon { background: var(--ov-bad); animation: ov-pulse 2s infinite; }
.ov-health-warn { background: var(--ov-warn-bg); }
.ov-health-warn .ov-health-icon { background: var(--ov-warn); }
@media (max-width: 575.98px) {
    .ov-health { align-items: flex-start; }
    .ov-health-time { display: none; }
}

@keyframes ov-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(217, 45, 32, .45); }
    70%  { box-shadow: 0 0 0 .6rem rgba(217, 45, 32, 0); }
    100% { box-shadow: 0 0 0 0 rgba(217, 45, 32, 0); }
}

/* -- right now ------------------------------------------------------- */

.ov-hero {
    --tone: var(--ma-self);
    --tone-bg: var(--ma-self-bg);
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 100% 0%, var(--tone-bg) 0%, transparent 60%),
        var(--ov-card);
}
.ov-hero[data-mode="open"]   { --tone: var(--ma-open);   --tone-bg: var(--ma-open-bg); }
.ov-hero[data-mode="closed"] { --tone: var(--ma-closed); --tone-bg: var(--ma-closed-bg); }

.ov-eyebrow { font-size: .82rem; color: var(--bs-secondary-color); margin-bottom: .9rem; }
.ov-hero-main { display: flex; align-items: center; gap: 1rem; }
.ov-hero-icon {
    flex-shrink: 0;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 1rem;
    display: grid;
    place-items: center;
    background: var(--tone);
    color: #fff;
    box-shadow: 0 6px 18px -6px var(--tone);
}
.ov-hero-title { font-size: clamp(1.45rem, 3.2vw, 2rem); font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
.ov-hero-sub { margin: .3rem 0 0; color: var(--bs-secondary-color); }

.ov-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0 1.4rem; }
.ov-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .75rem;
    border-radius: 999px;
    font-size: .85rem;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--ma-line);
}
.ov-chip svg { color: var(--bs-secondary-color); }
.ov-chip b { font-weight: 600; background: none; }

.ov-today { margin-top: auto; }
.ov-today-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .5rem;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .5rem;
}
.ov-legend { display: flex; gap: .85rem; font-weight: 400; font-size: .78rem; color: var(--bs-secondary-color); }
.ov-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.ov-legend i { width: .7rem; height: .7rem; border-radius: .2rem; display: inline-block; }

.ov-bar-wrap { position: relative; }
.ov-bar {
    position: relative;
    display: flex;
    height: 1.1rem;
    border-radius: .45rem;
    overflow: hidden;
    background: var(--ma-closed-bg);
}
.ov-bar i { display: block; height: 100%; }
.ov-bar i + i { box-shadow: inset 1px 0 0 var(--ov-card); }
.ov-bar-wrap .ov-bar { height: 1.6rem; border-radius: .6rem; overflow: visible; }
.ov-bar-wrap .ov-bar i:first-of-type { border-radius: .6rem 0 0 .6rem; }
.ov-bar-wrap .ov-bar i:last-of-type  { border-radius: 0 .6rem .6rem 0; }
.ov-bar-wrap .ov-bar i:only-of-type  { border-radius: .6rem; }
.ov-bar-now {
    position: absolute;
    top: -.35rem;
    bottom: -.35rem;
    width: 3px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: var(--ma-now);
    box-shadow: 0 0 0 2px var(--ov-card);
}
.ov-bar-now::before {
    content: 'Nu';
    position: absolute;
    top: -1.25rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: .68rem;
    font-weight: 700;
    color: var(--ma-now);
}
.ov-bar-ticks {
    display: flex;
    justify-content: space-between;
    font-size: .68rem;
    color: var(--bs-secondary-color);
    margin-top: .3rem;
    font-variant-numeric: tabular-nums;
}

/* -- the door -------------------------------------------------------- */

.ov-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--ma-line);
}
.ov-pill-open { background: var(--ov-ok-bg); color: var(--ov-ok); border-color: transparent; }
.ov-pill-bad  { background: var(--ov-bad-bg); color: var(--ov-bad); border-color: transparent; }

.ov-durations { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-bottom: .75rem; }
.ov-duration {
    display: grid;
    place-items: center;
    padding: .6rem .25rem;
    border-radius: .65rem;
    border: 1px solid var(--ma-line);
    background: var(--bs-tertiary-bg);
    font-size: .88rem;
    font-weight: 550;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    text-align: center;
}
.ov-duration:hover { border-color: var(--bs-primary); }
.ov-duration-wide { grid-column: 1 / -1; padding: .45rem; font-size: .82rem; }
.btn-check:checked + .ov-duration {
    background: var(--bs-primary-bg-subtle);
    border-color: var(--bs-primary);
    color: var(--bs-primary-text-emphasis);
    box-shadow: inset 0 0 0 1px var(--bs-primary);
}
.btn-check:focus-visible + .ov-duration { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.ov-until { margin-bottom: .75rem; }
.ov-until input { font-size: 1.1rem; text-align: center; }

.ov-held {
    border-radius: .9rem;
    padding: 1rem 1.1rem;
    background: var(--ov-ok-bg);
    margin-bottom: 1rem;
}
.ov-held-time small { display: block; font-size: .8rem; color: var(--bs-secondary-color); }
.ov-held-time b { font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; color: var(--ov-ok); }
.ov-held p { font-size: .85rem; margin: .4rem 0 0; color: var(--bs-secondary-color); }

/* -- numbers --------------------------------------------------------- */

.ov-stat { position: relative; height: 100%; padding: 1.15rem 1.2rem; }
.ov-stat-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .7rem;
    display: grid;
    place-items: center;
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
}
.ov-stat-icon.is-ok  { background: var(--ov-ok-bg);  color: var(--ov-ok); }
.ov-stat-icon.is-bad { background: var(--ov-bad-bg); color: var(--ov-bad); }
.ov-stat-label { font-size: .82rem; color: var(--bs-secondary-color); padding-right: 2.5rem; }
.ov-stat-value {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
    margin-top: .2rem;
    font-variant-numeric: tabular-nums;
}
.ov-stat-word { font-size: 1.3rem; display: flex; align-items: center; gap: .5rem; min-height: 2.4rem; }
.ov-stat-note { font-size: .8rem; color: var(--bs-secondary-color); margin-top: .25rem; }

.ov-dot {
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    background: var(--bs-secondary-color);
    flex-shrink: 0;
    display: inline-block;
}
.ov-dot.is-ok  { background: var(--ov-ok);  box-shadow: 0 0 0 .22rem var(--ov-ok-bg); }
.ov-dot.is-bad { background: var(--ov-bad); animation: ov-pulse 2s infinite; }
.ov-dot-sm { width: .45rem; height: .45rem; box-shadow: none !important; animation: none !important; }

.ov-devices { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .78rem; color: var(--bs-secondary-color); }
.ov-devices li { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.ov-devices small { margin-left: auto; white-space: nowrap; padding-left: .4rem; }

.ov-spark { display: flex; align-items: flex-end; gap: .3rem; height: 2.6rem; margin-top: .45rem; }
.ov-spark span { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.ov-spark i { display: block; width: 100%; max-width: 1.1rem; border-radius: .25rem .25rem .1rem .1rem; background: var(--ma-self-bg); }
.ov-spark span.is-today i { background: var(--ma-self); }
.ov-spark small { font-size: .6rem; color: var(--bs-secondary-color); margin-top: .15rem; line-height: 1; }

/* -- opening hours --------------------------------------------------- */

.ov-periods { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.ov-period {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .75rem;
    border-radius: .7rem;
    background: var(--bs-tertiary-bg);
    font-size: .88rem;
}
.ov-period .ma-swatch { margin: 0; }
.ov-period-time { font-weight: 600; font-variant-numeric: tabular-nums; }

.ov-week { display: grid; gap: .4rem; margin-bottom: 1.25rem; }
.ov-week-row { display: grid; grid-template-columns: 6.2rem 1fr 1rem; align-items: center; gap: .75rem; }
.ov-week-day { line-height: 1.1; }
.ov-week-day b { display: block; font-size: .85rem; font-weight: 550; }
.ov-week-day small { font-size: .72rem; color: var(--bs-secondary-color); }
.ov-week-row.is-today .ov-week-day b { color: var(--bs-primary); }
.ov-week-row .ov-bar { height: .85rem; border-radius: .35rem; }
.ov-week-flag { color: var(--ma-exception); font-size: .85rem; text-align: center; }
.ov-week-ticks .ov-bar-ticks { margin-top: -.1rem; }

.ov-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.ov-actions .btn-light { border: 1px solid var(--ma-line); }

.ov-upcoming { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--ma-line); }
.ov-upcoming-item { display: flex; gap: .65rem; padding: .35rem 0; }
.ov-upcoming-item .ma-swatch { margin-top: .3rem; }
.ov-upcoming-item b { display: block; font-size: .9rem; font-weight: 550; }
.ov-upcoming-item small { font-size: .8rem; color: var(--bs-secondary-color); }

/* -- activity -------------------------------------------------------- */

.ov-feed { list-style: none; margin: 0; padding: 0; }
.ov-feed li {
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    align-items: center;
    gap: .75rem;
    padding: .6rem 0;
    border-top: 1px solid var(--ma-line-soft);
}
.ov-feed li:first-child { border-top: 0; padding-top: 0; }
.ov-feed-icon {
    width: 2rem;
    height: 2rem;
    border-radius: .6rem;
    display: grid;
    place-items: center;
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
}
.ov-feed-in      .ov-feed-icon { background: var(--ma-self-bg); color: var(--ma-self); }
.ov-feed-opened  .ov-feed-icon { background: var(--ov-ok-bg); color: var(--ov-ok); }
.ov-feed-refused .ov-feed-icon,
.ov-feed-error   .ov-feed-icon { background: var(--ov-bad-bg); color: var(--ov-bad); }
.ov-feed-text { min-width: 0; line-height: 1.25; }
.ov-feed-text b { display: block; font-size: .9rem; font-weight: 550; }
.ov-feed-text small { display: block; font-size: .78rem; color: var(--bs-secondary-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-feed time { font-size: .78rem; color: var(--bs-secondary-color); white-space: nowrap; font-variant-numeric: tabular-nums; }

.ov-empty { text-align: center; color: var(--bs-secondary-color); padding: 2rem 1rem; margin: auto 0; }
.ov-empty svg { opacity: .5; margin-bottom: .6rem; }
.ov-empty p { font-size: .9rem; margin: 0; }

/* -- shortcuts ------------------------------------------------------- */

.ov-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem; }
.ov-shortcut {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .95rem 1.1rem;
    border-radius: var(--ov-radius);
    border: 1px dashed var(--ma-line);
    color: inherit;
    text-decoration: none;
    transition: background .12s, border-color .12s;
}
.ov-shortcut:hover { background: var(--ov-card); border-style: solid; border-color: var(--bs-primary); color: inherit; }
.ov-shortcut > svg { color: var(--bs-primary); flex-shrink: 0; }
.ov-shortcut b { display: block; font-size: .9rem; font-weight: 600; }
.ov-shortcut small { display: block; font-size: .8rem; color: var(--bs-secondary-color); }

.ov-modal { border: 0; border-radius: var(--ov-radius, 1.1rem); }

@media (max-width: 575.98px) {
    .ov-card { padding: 1.1rem; }
    .ov-week-row { grid-template-columns: 4.6rem 1fr .8rem; gap: .5rem; }
    .ov-stat-value { font-size: 1.7rem; }
    .ov-stat-word { font-size: 1.05rem; }
    .ov-stat-icon { display: none; }
    .ov-stat-label { padding-right: 0; }
}

/* -- the shop's logo ------------------------------------------------- */

.ma-nav-logo { height: 2rem; width: auto; max-width: 7rem; object-fit: contain; }

.ma-logo-stage {
    display: grid;
    place-items: center;
    min-height: 9rem;
    border-radius: 1rem;
    border: 1px dashed var(--ma-line);
    background:
        conic-gradient(var(--ma-line-soft) 25%, transparent 0 50%, var(--ma-line-soft) 0 75%, transparent 0)
        0 0 / 1.25rem 1.25rem;
    padding: 1.5rem;
}
.ma-logo-stage img { max-height: 7rem; max-width: 100%; object-fit: contain; }

/* A phone-sized sketch of the door page header, so the owner sees the logo
   where the customer will. */
.ma-logo-phone {
    width: 17rem;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 1.6rem;
    border: 6px solid #1d2939;
    background: #fff;
    color: #0e2c4c;
    overflow: hidden;
    box-shadow: 0 12px 32px -12px rgba(16, 24, 40, .35);
}
.ma-logo-phone-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px; border-bottom: 1px solid rgba(0, 0, 0, .08); }
.ma-logo-phone-head img { height: 36px; width: auto; max-width: 120px; object-fit: contain; }
.ma-logo-phone-head b { font-size: 15px; line-height: 1.15; }
.ma-logo-phone-body { padding: 14px; display: grid; gap: 8px; }
.ma-logo-phone-body i { display: block; height: 10px; border-radius: 5px; background: #eef2f6; }
.ma-logo-phone-body i:nth-child(2) { width: 70%; }
.ma-logo-phone-body span {
    display: block;
    margin-top: 8px;
    height: 38px;
    border-radius: 10px;
    background: #0060e6;
}

/* An owner with several shops: one card each on the front page. */
.ov-shop {
    --tone: var(--ma-self);
    display: block;
    height: 100%;
    padding: 1.2rem 1.3rem;
    border-radius: 1.1rem;
    border: 1px solid var(--ma-line);
    border-left: 4px solid var(--tone);
    background: var(--bs-body-bg);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
    transition: transform .12s, box-shadow .12s;
}
.ov-shop:hover { color: inherit; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(16, 24, 40, .09); }
.ov-shop[data-mode="open"]   { --tone: var(--ma-open); }
.ov-shop[data-mode="closed"] { --tone: var(--ma-closed); }
.ov-shop-mode, .ov-shop-door {
    font-size: .82rem;
    font-weight: 550;
    padding: .25rem .65rem;
    border-radius: 999px;
    background: var(--bs-tertiary-bg);
}
.ov-shop-mode { color: var(--tone); }
.ov-shop-door.is-bad { background: #fdecea; color: #d92d20; }

/* ------------------------------------------------------------------ */
/* The drawn door (panel/_door_picture.php)                            */
/*                                                                     */
/* One tone per state, carried by the wrapper: the badge, the title and */
/* the leaf all take it, so the picture reads at a glance before a word */
/* of it is read.                                                       */
/* ------------------------------------------------------------------ */

.dp {
    --dp-tone: #12a150;
    --dp-soft: #e7f7ee;
    --dp-frame: #cfd6de;
    --dp-leaf: #f4f6f8;
    --dp-panel: #e6eaef;
    --dp-ink: #475467;
    display: flex;
    align-items: center;
    gap: 1.1rem;
}
.dp-tone-open { --dp-tone: #0d6efd; --dp-soft: #e5efff; }
.dp-tone-info { --dp-tone: #0d6efd; --dp-soft: #e5efff; }
.dp-tone-warn { --dp-tone: #dc6803; --dp-soft: #fef0e1; }
.dp-tone-bad  { --dp-tone: #d92d20; --dp-soft: #fdecea; }

.dp-art { width: 5.5rem; height: auto; flex-shrink: 0; overflow: visible; }
.dp-large .dp-art { width: 8.5rem; }

.dp-floor { fill: rgba(16, 24, 40, .08); }
.dp-frame { fill: var(--dp-frame); }
.dp-gap   { fill: #344054; }
.dp-leaf  { fill: var(--dp-leaf); stroke: var(--dp-frame); stroke-width: 1; transition: d .3s; }
.dp-panel { fill: none; stroke: var(--dp-panel); stroke-width: 2; }
.dp-handle { fill: var(--dp-ink); }
.dp-handle rect { transform-origin: 84px 86px; transition: transform .25s; }
.dp-handle.is-up rect { transform: rotate(28deg); }
.dp-strike { fill: #98a2b3; }
.dp-bolt { fill: #98a2b3; transition: x .3s; }
.dp-bolt.is-in { fill: var(--dp-ink); }
.dp-tone-warn .dp-bolt { fill: var(--dp-tone); animation: dp-blink 1.2s infinite; }
.dp-glow { fill: none; stroke: var(--dp-tone); stroke-width: 2; opacity: .6; transform-origin: 101px 87px; animation: dp-ring 1.6s infinite; }
.dp-badge > circle { fill: var(--dp-tone); stroke: #fff; stroke-width: 3; }
.dp-badge g { stroke: #fff; }
.dp-tone-open .dp-leaf { fill: var(--dp-soft); }
.dp-tone-bad .dp-leaf, .dp-tone-bad .dp-gap { opacity: .45; }

.dp-body { min-width: 0; flex-grow: 1; }
.dp-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; color: var(--dp-tone); }
.dp-large .dp-title { font-size: 1.6rem; }
.dp-text { font-size: .86rem; color: var(--bs-secondary-color); margin: .2rem 0 0; }
.dp-large .dp-text { font-size: .95rem; max-width: 34rem; }

.dp-signals { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.dp-signal {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .28rem .6rem .28rem .5rem;
    border-radius: 999px;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--ma-line);
    font-size: .78rem;
    line-height: 1.2;
}
.dp-signal span { color: var(--bs-secondary-color); }
.dp-signal b { font-weight: 600; }
.dp-signal i { width: .5rem; height: .5rem; border-radius: 50%; background: #98a2b3; }
.dp-signal.is-on i { background: #12a150; box-shadow: 0 0 0 .18rem #e7f7ee; }
.dp-signal.is-bad { background: #fef0e1; border-color: transparent; }
.dp-signal.is-bad i { background: #dc6803; animation: dp-blink 1.2s infinite; }
.dp-signal.is-unknown { opacity: .65; }
.dp-signal.is-unknown i { background: none; border: 1px dashed #98a2b3; }

@keyframes dp-ring  { 0% { transform: scale(.7); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes dp-blink { 50% { opacity: .35; } }

@media (prefers-reduced-motion: reduce) {
    .dp-glow, .dp-bolt, .dp-signal i { animation: none !important; }
}
@media (max-width: 575.98px) {
    .dp-large { flex-direction: column; text-align: center; }
    .dp-large .dp-signals { justify-content: center; }
}
/* Green is kept for "secured". A released lock or an open door is the door
   working, not the door being safe, so those light up blue. */
.dp-signal-lock.is-on i,
.dp-signal-door_contact.is-on i,
.dp-signal-handle.is-on i { background: #0d6efd; box-shadow: 0 0 0 .18rem #e5efff; }
