/* Experience Center extras (/experience). Widgets use experience-widgets.css, copied from the real dashboard. */
.experience-page {
    --xp-blue: #1a73e8;
    --xp-card: var(--bs-body-bg, #fff);
    --xp-soft: var(--bs-tertiary-bg, #f4f7fb);
    --xp-line: var(--bs-border-color, #dbe3ee);
    --xp-muted: var(--bs-secondary-color, #5f6b7a);
}

.xp-badge {
    border: 1px solid var(--xp-blue);
    color: var(--xp-blue);
    border-radius: 999px;
    padding: .3rem .75rem;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
}

.xp-section-title { font-size: 1.25rem; margin: .5rem 0 1rem; }

/* missions */
.xp-missions { margin: 0 0 1.25rem; }
.xp-progress { height: 8px; border-radius: 999px; background: var(--xp-soft); overflow: hidden; }
.xp-progress-bar { height: 100%; width: 0; background: #2e9e5b; transition: width .4s ease; }
.xp-mission-list {
    list-style: none; padding: 0; margin: .75rem 0 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .5rem;
}
.xp-progress-label { margin-top: .4rem; font-size: .8rem; font-weight: 600; color: var(--xp-muted); }
.xp-mission-list li {
    border: 1px solid var(--xp-line); border-radius: 10px;
    background: var(--xp-card); font-size: .88rem; color: var(--xp-muted);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.xp-mission-list li button {
    display: flex; gap: .55rem; align-items: flex-start; width: 100%; height: 100%;
    padding: .6rem .75rem; border: 0; background: transparent; text-align: left;
    color: inherit; font: inherit; cursor: pointer; border-radius: 10px;
}
.xp-mission-list li button > span { flex: 1; }
.xp-mission-list li button:focus-visible { outline: 2px solid var(--xp-blue); outline-offset: 2px; }
.xp-mission-list li:hover { transform: translateY(-2px); border-color: var(--xp-blue); box-shadow: 0 6px 14px rgba(26, 115, 232, .15); }
.xp-mission-list li .xp-go { margin-top: .25rem; color: var(--xp-blue); opacity: .55; }
.xp-mission-list li:hover .xp-go, .xp-mission-list li.is-active .xp-go { opacity: 1; }
.xp-mission-list li.is-done .xp-go { display: none; }

/* floating "next mission" pill, shown when the mission list has scrolled out of view */
.xp-next {
    position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 1030;
    display: flex; align-items: center; gap: .6rem; max-width: calc(100vw - 2rem);
    padding: .55rem 1rem; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--xp-blue); color: #fff; font-size: .88rem; font-weight: 600;
    box-shadow: 0 8px 24px rgba(8, 40, 90, .35);
}
.xp-next[hidden] { display: none; }
.xp-next-step { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; opacity: .85; white-space: nowrap; }
.xp-next-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* scroll target feedback */
.widget-card { scroll-margin-top: 90px; }
.xp-focus { animation: xp-focus 1.6s ease-out 1; }
@keyframes xp-focus { 0% { box-shadow: 0 0 0 4px rgba(26, 115, 232, .55); } 100% { box-shadow: 0 0 0 4px rgba(26, 115, 232, 0); } }
.xp-mission-list li b { display: block; color: var(--bs-body-color); }
.xp-mission-list li i { margin-top: .2rem; font-size: .8rem; }
.xp-mission-list li.is-active { border-color: var(--xp-blue); box-shadow: 0 0 0 2px rgba(26, 115, 232, .18); }
.xp-mission-list li.is-done { border-color: #2e9e5b; }
.xp-mission-list li.is-done i { color: #2e9e5b; }
.xp-done {
    display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
    margin-top: .75rem; padding: .85rem 1rem; border-radius: 12px;
    background: rgba(46, 158, 91, .12); border: 1px solid #2e9e5b;
}
.xp-done[hidden], #xp-alert[hidden] { display: none !important; }
.xp-done > i { font-size: 1.5rem; color: #d4a017; }
.xp-done > div { flex: 1 1 220px; display: flex; flex-direction: column; }

.xp-muted { font-size: .8rem; color: var(--xp-muted); }

/* forms, lists */
.xp-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; align-items: end; }
.xp-form label { font-size: .78rem; color: var(--xp-muted); display: flex; flex-direction: column; gap: .2rem; }
.xp-list { list-style: none; margin: .75rem 0 .5rem; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.xp-list li { padding: .4rem .6rem; border-radius: 8px; background: var(--xp-soft); font-size: .85rem; display: flex; justify-content: space-between; gap: .5rem; }
.xp-list li.xp-empty { color: var(--xp-muted); }
.xp-log { max-height: 260px; overflow: auto; margin-top: 0; }
.xp-log time { color: var(--xp-muted); font-size: .75rem; white-space: nowrap; }
.xp-log li.is-alert { background: rgba(229, 72, 77, .14); }
.xp-log li.is-ok { background: rgba(46, 158, 91, .14); }

/* voice */
.xp-voice-form { display: flex; gap: .5rem; }
.xp-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.xp-chip {
    border: 1px solid var(--xp-line); background: var(--xp-soft); color: var(--bs-body-color);
    border-radius: 999px; padding: .2rem .65rem; font-size: .8rem; cursor: pointer;
}
.xp-chip:hover { border-color: var(--xp-blue); }
.xp-voice-reply { padding: .6rem .75rem; border-radius: 10px; background: var(--xp-soft); font-size: .9rem; min-height: 2.6rem; margin-bottom: .5rem; }
.xp-voice-confirm { display: flex; gap: .5rem; margin-bottom: .5rem; }
.xp-voice-confirm[hidden] { display: none; }

.xp-pulse { animation: xp-pulse 1.2s ease-out 3; }
@keyframes xp-pulse { 0% { box-shadow: 0 0 0 0 rgba(26, 115, 232, .55); } 100% { box-shadow: 0 0 0 14px rgba(26, 115, 232, 0); } }

.xp-foot { margin-top: 1.5rem; text-align: center; font-size: .82rem; color: var(--xp-muted); }

@media (prefers-reduced-motion: reduce) {
    .xp-progress-bar { transition: none; }
    .xp-pulse, .xp-focus { animation: none; }
    .xp-mission-list li { transition: none; }
}

/* Pump and valve LED tiles inside the control card: fill the card width like the Water Tank group */
.xp-led-group { align-self: stretch; width: 100%; }
.xp-led-group .widget-group-grid { width: 100%; }

/* a little breathing room between the card header and the command buttons */
.widget-card[data-widget-type="multi_button"] .multi-button-container { margin-top: 1.1rem; }

/* the control card is taller than a normal widget body (buttons + status tiles), so lift the 420px cap that clipped the leak button */
.widget-card[data-widget-type="multi_button"] > .card-body { max-height: none; overflow: visible; }

/* count badge on the header buttons */
.xp-count {
    position: absolute; top: -7px; right: -7px;
    min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem;
    border-radius: 999px; background: #e5484d; color: #fff;
    font-size: .7rem; font-weight: 700; line-height: 1.25rem; text-align: center;
    box-shadow: 0 0 0 2px var(--bs-body-bg, #fff);
}
.xp-count[hidden] { display: none; }

/* schedules popup */
.xp-form-wide { grid-column: 1 / -1; }
.xp-sch-what { display: flex; flex-direction: column; min-width: 0; }
.xp-sch-side { display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.xp-sch-del { padding: .1rem .4rem; line-height: 1.2; }
#xp-schedules li { align-items: center; }

/* chat popup */
.xp-chat .xp-chat-body { padding: .75rem; min-height: 240px; max-height: 55vh; }
.xp-chat-log { display: flex; flex-direction: column; gap: .5rem; }
.xp-msg { display: flex; animation: xp-msg-in .2s ease-out; }
.xp-msg-user { justify-content: flex-end; }
.xp-bubble {
    max-width: 85%; padding: .5rem .75rem; border-radius: 14px;
    font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere;
}
.xp-msg-drops .xp-bubble { background: var(--xp-soft); border: 1px solid var(--xp-line); border-bottom-left-radius: 4px; }
.xp-msg-user .xp-bubble { background: var(--xp-blue); color: #fff; border-bottom-right-radius: 4px; }
.xp-bubble-title { font-weight: 700; font-size: .75rem; color: var(--xp-blue); margin-bottom: .15rem; }
.xp-msg-actions { display: flex; gap: .4rem; margin-top: .5rem; }
.xp-chat .xp-chips { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 0 .75rem .4rem; margin: .25rem 0 .35rem; }
.xp-chat .xp-chip { flex: 0 0 auto; white-space: nowrap; }
.xp-chat-form,
.modal-dialog-scrollable .modal-content > form.xp-chat-form { display: flex; gap: .5rem; padding: 0 .75rem .5rem; }
@keyframes xp-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .xp-msg { animation: none; } }

/* unread count on the guide mascot */
.xp-mascot-count { top: 2px; right: 2px; }
