:root {
    color-scheme: dark;
    --bg: #00134d;
    --bg-soft: #072b70;
    --panel: rgba(255, 255, 255, 0.1);
    --panel-strong: rgba(255, 255, 255, 0.16);
    --ink: #ffffff;
    --muted: #c7d6eb;
    --line: rgba(255, 255, 255, 0.22);
    --action: #2fbf71;
    --action-dark: #159257;
    --warning: #ffd166;
    --danger: #ffb3a9;
    --reward: #9df0c1;
    --field: #ffffff;
    --field-ink: #142033;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, var(--bg), var(--bg-soft));
}

body {
    line-height: 1.45;
}

button,
input {
    font: inherit;
}

.assist-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(0, 19, 77, 0.95);
    backdrop-filter: blur(10px);
}

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

.brand-block img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #ffffff;
    object-fit: contain;
}

.business-heading {
    min-width: 0;
}

.business-heading h1 {
    overflow-wrap: anywhere;
}

.business-heading p {
    margin-bottom: 0;
    color: var(--muted);
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--warning);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1;
}

h2 {
    margin-bottom: 8px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.08;
}

h3 {
    margin-bottom: 8px;
    font-size: 24px;
}

.assist-main {
    width: min(100% - 28px, 1320px);
    margin: 0 auto;
    padding: 22px 0 42px;
}

.setup-panel,
.notification-panel,
.recent-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.setup-panel {
    display: grid;
    gap: 18px;
    max-width: 680px;
    margin: 44px auto;
    padding: 24px;
}

.setup-panel p,
.empty-list span {
    color: var(--muted);
}

.setup-form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

input {
    min-height: 52px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 12px;
    color: var(--field-ink);
    background: var(--field);
}

input:focus {
    border-color: var(--warning);
    outline: 3px solid rgba(255, 209, 102, 0.24);
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    border: 0;
    border-radius: var(--radius);
    padding: 12px 16px;
    color: #ffffff;
    background: var(--action);
    cursor: pointer;
    font-weight: 800;
}

button:hover,
button:focus-visible {
    background: var(--action-dark);
    outline: 3px solid rgba(255, 255, 255, 0.2);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

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

button.secondary:hover,
button.secondary:focus-visible {
    background: var(--panel-strong);
}

.status-pill,
.reward-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 11px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-pill.live {
    border-color: rgba(47, 191, 113, 0.5);
    color: var(--reward);
    background: rgba(47, 191, 113, 0.14);
}

.status-pill.updating {
    border-color: rgba(255, 209, 102, 0.5);
    color: var(--warning);
}

.status-pill.offline {
    border-color: rgba(255, 179, 169, 0.5);
    color: var(--danger);
}

.assist-shell {
    display: grid;
    gap: 16px;
}

.is-hidden {
    display: none !important;
}

.notification-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
}

.notification-panel strong {
    display: block;
    margin-bottom: 2px;
    font-size: 18px;
}

.notification-panel p {
    margin-bottom: 0;
    color: var(--muted);
}

.notification-panel.is-enabled {
    border-color: rgba(47, 191, 113, 0.54);
}

.notification-panel.is-blocked {
    border-color: rgba(255, 179, 169, 0.54);
}

.assist-grid {
    display: grid;
    gap: 16px;
}

.recent-panel {
    min-height: 420px;
    padding: 16px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-heading h2 {
    margin-bottom: 0;
}

.panel-heading span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.recent-list {
    display: grid;
    gap: 10px;
}

.check-in-card {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) auto;
    align-items: center;
    justify-items: start;
    gap: 10px 16px;
    width: 100%;
    border: 1px solid var(--line);
    padding: 14px;
    text-align: left;
    background: rgba(255, 255, 255, 0.08);
}

.check-in-card.needs-attention {
    box-shadow: inset 4px 0 0 var(--warning);
}

.check-in-card.is-new-alert {
    border-color: var(--warning);
    background: rgba(255, 209, 102, 0.18);
    box-shadow:
        inset 4px 0 0 var(--warning),
        0 0 0 3px rgba(255, 209, 102, 0.2);
}

.check-in-time {
    color: var(--warning);
    font-size: 17px;
    font-weight: 900;
}

.check-in-customer {
    display: block;
    overflow-wrap: anywhere;
    font-size: 20px;
    font-weight: 900;
}

.check-in-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.check-in-preference {
    color: var(--muted);
    font-weight: 700;
}

.check-in-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.reward-chip {
    text-transform: none;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.status-chip.saved {
    border-color: rgba(255, 209, 102, 0.7);
    color: var(--warning);
    background: rgba(255, 209, 102, 0.14);
}

.image-button {
    min-height: 34px;
    border: 1px solid rgba(121, 184, 255, 0.7);
    border-radius: 999px;
    padding: 7px 11px;
    color: #cfe7ff;
    background: rgba(121, 184, 255, 0.14);
    font-size: 13px;
    line-height: 1;
}

.image-button:hover,
.image-button:focus-visible {
    background: rgba(121, 184, 255, 0.24);
}

.reward-available {
    border-color: rgba(47, 191, 113, 0.7);
    color: #062411;
    background: var(--reward);
}

.reward-next {
    border-color: rgba(255, 209, 102, 0.7);
    color: #1e1600;
    background: var(--warning);
}

.reward-progress {
    border-color: rgba(121, 184, 255, 0.7);
    color: #cfe7ff;
    background: rgba(121, 184, 255, 0.14);
}

.reward-none {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
}

.message-panel,
.loading-row,
.empty-list {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    background: rgba(255, 255, 255, 0.08);
}

.message-panel.error {
    color: var(--danger);
}

.image-dialog {
    width: min(94vw, 880px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    color: var(--ink);
    background: var(--bg);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.image-dialog::backdrop {
    background: rgba(0, 0, 0, 0.74);
}

.image-dialog-header,
.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.image-dialog-header {
    margin-bottom: 12px;
}

.image-dialog-header h2 {
    margin-bottom: 0;
}

.image-carousel {
    display: grid;
    min-height: 320px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.08);
}

.carousel-frame {
    display: grid;
    gap: 10px;
    width: 100%;
    margin: 0;
}

.carousel-frame img {
    display: block;
    width: 100%;
    max-height: 68vh;
    object-fit: contain;
}

.carousel-caption {
    padding: 0 12px 12px;
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

.carousel-controls {
    margin-top: 12px;
}

.carousel-controls span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

@media (min-width: 860px) {
    .assist-main {
        padding-top: 28px;
    }

    .setup-form {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        align-items: end;
    }

    .recent-panel {
        min-height: calc(100vh - 190px);
    }
}

@media (max-width: 620px) {
    .assist-header,
    .notification-panel {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .notification-panel {
        flex-direction: column;
    }

    .header-actions {
        justify-content: space-between;
    }

    .check-in-card {
        grid-template-columns: 1fr;
    }

    .check-in-status {
        justify-content: flex-start;
    }

    .image-dialog-header,
    .carousel-controls {
        align-items: stretch;
        flex-direction: column;
    }
}
