/* ==========================================================================
   Design tokens (docs/10, section 7). Bootstrap 5.3 reads its --bs-* variables, so
   setting them here themes every Bootstrap component without a second framework.
   Text colours are at least 4.5:1 on --ia-surface.
   ========================================================================== */
:root {
    --ia-primary: #12283e;
    --ia-primary-hover: #0b1a2a;
    --ia-accent: #1f6feb;
    --ia-bg: #f5f7fa;
    --ia-surface: #ffffff;
    --ia-border: #d9e0e7;
    --ia-text: #1b2733;
    --ia-text-muted: #5b6b7b;
    --ia-success: #1a7f37;
    --ia-warning: #9a6700;
    --ia-danger: #c62828;
    --ia-info: #0b62a4;
    --ia-focus: #1f6feb;

    --ia-space-1: 4px;
    --ia-space-2: 8px;
    --ia-space-3: 12px;
    --ia-space-4: 16px;
    --ia-space-5: 24px;
    --ia-space-6: 32px;
    --ia-radius: 6px;
    --ia-radius-lg: 10px;
    --ia-shadow: 0 1px 2px rgba(18, 40, 62, .06), 0 1px 3px rgba(18, 40, 62, .08);
    --ia-header-height: 56px;
    --ia-sidebar-width: 248px;

    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-size: .9375rem;
    --bs-body-color: var(--ia-text);
    --bs-body-bg: var(--ia-bg);
    --bs-secondary-color: var(--ia-text-muted);
    --bs-border-color: var(--ia-border);
    --bs-border-radius: var(--ia-radius);
    --bs-border-radius-lg: var(--ia-radius-lg);
    --bs-link-color: var(--ia-info);
    --bs-link-color-rgb: 11, 98, 164;
    --bs-link-hover-color: var(--ia-primary);
    --bs-link-hover-color-rgb: 18, 40, 62;
    --bs-primary: var(--ia-primary);
    --bs-primary-rgb: 18, 40, 62;
    --bs-success: var(--ia-success);
    --bs-success-rgb: 26, 127, 55;
    --bs-danger: var(--ia-danger);
    --bs-danger-rgb: 198, 40, 40;
    --bs-info-rgb: 11, 98, 164;
}

h1, .h1 { font-size: 1.5rem; font-weight: 600; }
h2, .h2 { font-size: 1.15rem; font-weight: 600; }
h3, .h3 { font-size: 1rem; font-weight: 600; }

.btn-primary {
    --bs-btn-bg: var(--ia-primary);
    --bs-btn-border-color: var(--ia-primary);
    --bs-btn-hover-bg: var(--ia-primary-hover);
    --bs-btn-hover-border-color: var(--ia-primary-hover);
    --bs-btn-active-bg: var(--ia-primary-hover);
    --bs-btn-active-border-color: var(--ia-primary-hover);
    --bs-btn-disabled-bg: var(--ia-primary);
    --bs-btn-disabled-border-color: var(--ia-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--ia-primary);
    --bs-btn-border-color: var(--ia-primary);
    --bs-btn-hover-bg: var(--ia-primary);
    --bs-btn-hover-border-color: var(--ia-primary);
    --bs-btn-active-bg: var(--ia-primary-hover);
}

/* Bootstrap's grey and red are only just 4.5:1 on white and fail on --ia-bg; use the token colours. */
.btn-outline-secondary {
    --bs-btn-color: var(--ia-text-muted);
    --bs-btn-border-color: #8a97a5;
    --bs-btn-hover-bg: var(--ia-text-muted);
    --bs-btn-hover-border-color: var(--ia-text-muted);
    --bs-btn-active-bg: var(--ia-text);
}
.btn-outline-danger {
    --bs-btn-color: var(--ia-danger);
    --bs-btn-border-color: var(--ia-danger);
    --bs-btn-hover-bg: var(--ia-danger);
    --bs-btn-hover-border-color: var(--ia-danger);
    --bs-btn-active-bg: #a51f1f;
}
.btn-danger {
    --bs-btn-bg: var(--ia-danger);
    --bs-btn-border-color: var(--ia-danger);
    --bs-btn-hover-bg: #a51f1f;
    --bs-btn-hover-border-color: #a51f1f;
}
.text-danger { color: var(--ia-danger) !important; }
.text-success { color: var(--ia-success) !important; }

.list-group {
    --bs-list-group-active-bg: var(--ia-primary);
    --bs-list-group-active-border-color: var(--ia-primary);
    --bs-list-group-action-hover-bg: #eef2f6;
}
.progress { --bs-progress-bar-bg: var(--ia-info); }
.nav-tabs { --bs-nav-link-color: var(--ia-info); --bs-nav-tabs-link-active-color: var(--ia-text); }

.card { --bs-card-border-color: var(--ia-border); --bs-card-border-radius: var(--ia-radius-lg); box-shadow: var(--ia-shadow); }

/* Visible focus on every interactive element (WCAG 2.4.7, 2.4.11). */
:focus-visible {
    outline: 3px solid var(--ia-focus);
    outline-offset: 2px;
}
.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 .1rem #fff, 0 0 0 .3rem var(--ia-focus);
    outline: none;
}

h1:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

.ia-icon { flex: none; vertical-align: -0.125em; }

/* ==========================================================================
   Application shell: header, sidebar, main
   ========================================================================== */
.ia-skip-link {
    position: absolute;
    left: var(--ia-space-3);
    top: -100px;
    z-index: 2000;
    padding: var(--ia-space-2) var(--ia-space-4);
    background: var(--ia-surface);
    color: var(--ia-primary);
    border: 2px solid var(--ia-focus);
    border-radius: var(--ia-radius);
    font-weight: 600;
}
.ia-skip-link:focus { top: var(--ia-space-2); }

.ia-shell {
    display: grid;
    grid-template-columns: var(--ia-sidebar-width) minmax(0, 1fr);
    grid-template-rows: var(--ia-header-height) 1fr;
    grid-template-areas: "header header" "sidebar main";
    min-height: 100vh;
    /* The sidebar column stays white to the bottom of long pages (the sidebar itself is sticky). */
    background: linear-gradient(to right, var(--ia-surface) calc(var(--ia-sidebar-width) - 1px), var(--ia-border) calc(var(--ia-sidebar-width) - 1px),
        var(--ia-border) var(--ia-sidebar-width), transparent var(--ia-sidebar-width));
}

.ia-header {
    grid-area: header;
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: var(--ia-space-4);
    padding: 0 var(--ia-space-5) 0 var(--ia-space-4);
    background: var(--ia-primary);
    color: #fff;
}
.ia-brand {
    display: flex;
    align-items: center;
    gap: var(--ia-space-2);
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
}
.ia-brand:hover { color: #fff; }
/* The Hotel AI logo is bright artwork on a transparent background, made for dark surfaces like the navy header. */
.ia-brand img { display: block; }
.ia-org {
    margin-left: auto;
    color: #d6e0ea;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 30vw;
}
.ia-menu-button {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border: 0;
    border-radius: var(--ia-radius);
    background: transparent;
    color: #fff;
}

.ia-user-menu { position: relative; margin-left: auto; }
.ia-org + .ia-user-menu { margin-left: 0; }
.ia-user-menu > summary {
    display: flex;
    align-items: center;
    gap: var(--ia-space-2);
    min-height: 44px;
    padding: 0 var(--ia-space-2);
    border-radius: var(--ia-radius);
    cursor: pointer;
    list-style: none;
    color: #fff;
}
.ia-user-menu > summary::-webkit-details-marker { display: none; }
.ia-user-menu > summary:hover { background: rgba(255, 255, 255, .08); }
.ia-user-name { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ia-user-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 220px;
    padding: var(--ia-space-2) 0;
    background: var(--ia-surface);
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    box-shadow: 0 8px 24px rgba(18, 40, 62, .18);
}
.ia-user-menu-panel a, .ia-user-menu-panel button {
    display: flex;
    align-items: center;
    gap: var(--ia-space-2);
    width: 100%;
    min-height: 40px;
    padding: 0 var(--ia-space-4);
    border: 0;
    background: none;
    color: var(--ia-text);
    text-align: left;
    text-decoration: none;
}
.ia-user-menu-panel a:hover, .ia-user-menu-panel button:hover { background: var(--ia-bg); }

.ia-sidebar {
    grid-area: sidebar;
    position: sticky;
    top: var(--ia-header-height);
    height: calc(100vh - var(--ia-header-height));
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: var(--ia-surface);
    border-right: 1px solid var(--ia-border);
}
.ia-nav { padding: var(--ia-space-3) var(--ia-space-2); }
.ia-nav-list { list-style: none; margin: 0; padding: 0; }
.ia-nav-group {
    margin: var(--ia-space-4) var(--ia-space-3) var(--ia-space-1);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ia-text-muted);
}
.ia-nav-link {
    display: flex;
    align-items: center;
    gap: var(--ia-space-3);
    min-height: 40px;
    padding: var(--ia-space-2) var(--ia-space-3);
    border-radius: var(--ia-radius);
    color: var(--ia-text);
    text-decoration: none;
    line-height: 1.25;
}
.ia-nav-link:hover { background: var(--ia-bg); color: var(--ia-primary); }
.ia-nav-link.active {
    background: #e7eef6;
    color: var(--ia-primary);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--ia-primary);
}
.ia-nav-badge {
    margin-left: auto;
    padding: 1px 6px;
    border: 1px solid var(--ia-border);
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--ia-text-muted);
}
.ia-sidebar-footer {
    margin: auto 0 0;
    padding: var(--ia-space-4);
    font-size: .8rem;
}

.ia-main {
    grid-area: main;
    min-width: 0;
    padding: var(--ia-space-5) var(--ia-space-6) var(--ia-space-6);
}
.ia-main:focus { outline: none; }

.ia-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ia-space-1);
    margin: 0 0 var(--ia-space-3);
    padding: 0;
    list-style: none;
    font-size: .85rem;
    color: var(--ia-text-muted);
}
.ia-breadcrumb li + li::before { content: "\203A"; margin-right: var(--ia-space-1); }
.ia-breadcrumb [aria-current] { color: var(--ia-text); }

.ia-backdrop { display: none; }

/* Tablet and phone: the sidebar becomes a drawer opened from the header. */
@media (max-width: 991.98px) {
    .ia-shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "header" "main"; background: none; }
    .ia-menu-button { display: inline-flex; }
    .ia-header { padding: 0 var(--ia-space-3) 0 var(--ia-space-2); gap: var(--ia-space-2); }
    .ia-sidebar {
        position: fixed;
        z-index: 1030;
        top: var(--ia-header-height);
        bottom: 0;
        left: 0;
        width: min(85vw, 300px);
        height: auto;
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform .2s ease, visibility .2s;
        box-shadow: 0 0 24px rgba(18, 40, 62, .25);
    }
    body.ia-nav-open .ia-sidebar { transform: none; visibility: visible; }
    body.ia-nav-open .ia-backdrop {
        display: block;
        position: fixed;
        inset: var(--ia-header-height) 0 0 0;
        z-index: 1025;
        background: rgba(11, 26, 42, .4);
    }
    .ia-main { padding: var(--ia-space-4); }
    .ia-nav-link { min-height: 44px; }
}
@media (max-width: 575.98px) {
    .ia-user-name, .ia-org { display: none; }
    /* Visually hidden, not display:none: the logo has empty alt text, so this text is the home link's accessible name. */
    .ia-brand span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff8c5;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { position: absolute; right: .75rem; top: .5rem; border: 0; background: none; cursor: pointer; }

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.guest-portal-shell {
    min-height: 100vh;
    padding: clamp(1rem, 4vw, 2.5rem);
    background: #f4f7fa;
}

/* Public SMS opt-in card (/sms/opt-in, #121): the in-room card guests see, and the A2P opt-in proof. */
.ia-sms-card {
    width: min(100%, 30rem);
    margin: 0 auto;
    padding: 2rem 1.75rem;
    background: var(--ia-surface);
    border: 1px solid var(--ia-border);
    border-radius: 12px;
    color: var(--ia-text);
    text-align: center;
}
.ia-sms-card h1 { font-size: 1.5rem; margin-bottom: 1rem; }
.ia-sms-card-brand { color: var(--ia-text-muted); font-weight: 600; margin-bottom: .5rem; }
.ia-sms-card-number { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; }
.ia-sms-card-number a { color: var(--ia-primary); text-decoration: none; }
.ia-sms-card-terms { font-size: .9rem; border-top: 1px solid var(--ia-border); padding-top: 1rem; }
.ia-sms-card-footer { font-size: .85rem; color: var(--ia-text-muted); margin-bottom: 0; }

.guest-portal {
    width: min(100%, 40rem);
    margin: 0 auto;
}

.guest-portal-header {
    padding: 1.5rem 1.25rem;
    border-radius: 1rem;
    color: #fff;
    background: #12283e;
    margin-bottom: 1rem;
}

.guest-portal-header h1 {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
}

.guest-portal-card {
    margin-bottom: 1rem;
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 2px 12px #12283e12;
}

.guest-portal textarea {
    resize: vertical;
}

.guest-message {
    max-width: 88%;
    margin: .5rem 0;
    padding: .75rem 1rem;
    border-radius: 1rem;
    overflow-wrap: anywhere;
}

.guest-message-in {
    background: #edf1f5;
    margin-right: auto;
}

.guest-message-out {
    color: #fff;
    background: #12283e;
    margin-left: auto;
}
/* ==========================================================================
   Shared components (Components/Ui)
   ========================================================================== */
.ia-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--ia-space-3) var(--ia-space-5);
    margin-bottom: var(--ia-space-5);
}
.ia-page-heading { flex: 1 1 32rem; min-width: 0; }
.ia-page-heading h1 { margin-bottom: var(--ia-space-1); }
.ia-page-description { margin: 0; color: var(--ia-text-muted); max-width: 72ch; }
.ia-page-actions { display: flex; flex-wrap: wrap; gap: var(--ia-space-2); align-items: center; }

/* Status: tinted background, dark text of the same hue (>= 4.5:1), icon and words. */
.ia-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    vertical-align: middle;
}
.ia-status-neutral { background: #eef1f4; border-color: #d9e0e7; color: #3d4b59; }
.ia-status-info { background: #e6f0fa; border-color: #b9d3ee; color: #0b4f87; }
.ia-status-success { background: #e8f5ec; border-color: #b6dfc3; color: #15662c; }
.ia-status-warning { background: #fdf4dc; border-color: #f0d68a; color: #7a5200; }
.ia-status-danger { background: #fdecec; border-color: #f2b8b8; color: #a51f1f; }

.ia-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--ia-space-2);
    padding: var(--ia-space-6) var(--ia-space-4);
    border: 1px dashed var(--ia-border);
    border-radius: var(--ia-radius-lg);
    background: var(--ia-surface);
    color: var(--ia-text-muted);
    text-align: center;
}
.ia-empty-title { margin: 0; font-weight: 600; color: var(--ia-text); }
.ia-empty-text { margin: 0; max-width: 48ch; }

.ia-confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--ia-space-2); }
.ia-confirm-text { font-size: .85rem; color: var(--ia-danger); }

.ia-feedback { display: flex; align-items: center; gap: var(--ia-space-2); }

/* Dashboard (docs/10, section 6) */
.ia-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--ia-space-5); align-items: start; }
@media (max-width: 1199.98px) { .ia-dashboard { grid-template-columns: minmax(0, 1fr); } }
.ia-attention-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ia-space-2); }
.ia-attention {
    display: flex;
    align-items: flex-start;
    gap: var(--ia-space-3);
    padding: var(--ia-space-3) var(--ia-space-4);
    background: var(--ia-surface);
    border: 1px solid var(--ia-border);
    border-left-width: 4px;
    border-radius: var(--ia-radius);
}
.ia-attention .btn { flex: none; align-self: center; }
.ia-attention-body { flex: 1; min-width: 0; }
.ia-attention-title { margin: 0; font-weight: 600; }
.ia-attention-detail { margin: 0; color: var(--ia-text-muted); font-size: .9rem; }
.ia-attention-danger { border-left-color: var(--ia-danger); background: #fdf2f2; }
.ia-attention-danger > .ia-icon { color: var(--ia-danger); }
.ia-attention-warning { border-left-color: #c98a00; }
.ia-attention-warning > .ia-icon { color: var(--ia-warning); }
.ia-attention-info { border-left-color: var(--ia-info); }
.ia-attention-info > .ia-icon { color: var(--ia-info); }
.ia-attention-neutral { border-left-color: #8a97a5; }
.ia-attention-neutral > .ia-icon { color: var(--ia-text-muted); }
@media (max-width: 575.98px) {
    .ia-attention { flex-wrap: wrap; }
    .ia-attention .btn { width: 100%; }
}
.ia-quick-actions, .ia-activity { list-style: none; margin: 0; padding: 0; }
.ia-quick-actions a { display: flex; align-items: center; gap: var(--ia-space-2); padding: 6px 0; text-decoration: none; }
.ia-activity li { padding: 6px 0; border-top: 1px solid var(--ia-border); }
.ia-activity li:first-child { border-top: 0; }
.ia-activity-what { display: block; font-size: .9rem; }
.ia-activity-meta { display: block; font-size: .8rem; color: var(--ia-text-muted); }

/* Guests: list + detail (docs/10). On phones one at a time: the list, or the selected item with a Back button. */
.ia-filters { display: flex; flex-wrap: wrap; gap: var(--ia-space-2); }
@media (max-width: 767.98px) {
    .ia-split.ia-split-has-detail > .ia-split-list { display: none; }
    .ia-split:not(.ia-split-has-detail) > .ia-split-detail:empty { display: none; }
}
.ia-request-emergency:not(.active) { border-left: 4px solid var(--ia-danger); background: #fdf2f2; }
.ia-steps { display: flex; flex-wrap: wrap; gap: var(--ia-space-1); list-style: none; margin: 0 0 var(--ia-space-3); padding: 0; counter-reset: step; }
.ia-step {
    counter-increment: step;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--ia-border);
    border-radius: 999px;
    font-size: .8rem;
    color: var(--ia-text-muted);
    background: var(--ia-surface);
}
.ia-step::before { content: counter(step); font-weight: 600; }
.ia-step-done { color: #15662c; border-color: #b6dfc3; background: #e8f5ec; }
.ia-step-done::before { content: "\2713"; }
.ia-step-current { color: #fff; border-color: var(--ia-primary); background: var(--ia-primary); font-weight: 600; }

/* Rendered report text: headings smaller than the report title, in order. */
.ia-markdown h3 { font-size: 1.05rem; margin-top: var(--ia-space-4); }
.ia-markdown h4 { font-size: .95rem; margin-top: var(--ia-space-4); }
.ia-markdown h5, .ia-markdown h6 { font-size: .9rem; }
.ia-markdown table { max-width: 40rem; }
.ia-stars { color: #8a5a00; letter-spacing: 1px; }

/* Forms in sections (docs/10, Phase 9) */
.ia-fieldset { border: 1px solid var(--ia-border); border-radius: var(--ia-radius); padding: var(--ia-space-3) var(--ia-space-4) var(--ia-space-4); margin-bottom: var(--ia-space-4); background: var(--ia-surface); }
.ia-fieldset > legend { float: none; width: auto; padding: 0 var(--ia-space-2); margin: 0; font-size: 1rem; font-weight: 600; }
.ia-form-actions { display: flex; gap: var(--ia-space-2); padding-top: var(--ia-space-2); }

/* Tables on phones (docs/10, section 8): below 768 px each row becomes a card and every cell is labelled with its
   column name (data-label), instead of a squeezed or clipped table. Wider screens are unchanged. */
/* Small but valid targets (WCAG 2.5.8): disclosure toggles and link-style buttons at least 24px tall. */
main summary { min-height: 24px; padding: 2px 0; }
main .btn-link.p-0 { min-height: 24px; }
@media (max-width: 767.98px) {
    .ia-table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .ia-table-stack, .ia-table-stack tbody, .ia-table-stack tr, .ia-table-stack td, .ia-table-stack tbody th { display: block; width: 100%; }
    .ia-table-stack tbody tr {
        margin-bottom: var(--ia-space-3);
        padding: var(--ia-space-2) var(--ia-space-3);
        border: 1px solid var(--ia-border);
        border-radius: var(--ia-radius);
        background: var(--ia-surface);
    }
    .ia-table-stack tbody td, .ia-table-stack tbody th {
        display: grid;
        grid-template-columns: minmax(7.5rem, 40%) minmax(0, 1fr);
        overflow-wrap: anywhere;
        gap: var(--ia-space-2);
        padding: 6px 0;
        border: 0;
        border-top: 1px solid #eef1f4;
        text-align: left !important;
    }
    .ia-table-stack tbody tr > :first-child { border-top: 0; }
    .ia-table-stack tbody td[data-label]::before, .ia-table-stack tbody th[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--ia-text-muted);
        font-size: .85rem;
    }
    .ia-table-stack tbody td:not([data-label]), .ia-table-stack tbody th:not([data-label]) { grid-template-columns: 1fr; }
}
/* Tables kept as tables on small screens scroll inside their box, with a visible edge. */
.table-responsive { border-radius: var(--ia-radius); position: relative; } /* keeps visually-hidden text inside the scroll box */

/* Help page (HA-11): a section linked from a page's "Help for this page" starts below the sticky header. */
.ia-help-section {
    scroll-margin-top: calc(var(--ia-header-height) + 1rem);
}

.ia-help-image {
    display: block;
    max-width: min(100%, 960px);
}

/* Help center (docs/15): "How do I…" under a page title, task steps, search. */
.ia-howto > summary { cursor: pointer; color: var(--bs-link-color); }
.ia-howto > summary:focus-visible { outline: 2px solid var(--bs-link-color); outline-offset: 2px; }
.ia-howto ul { padding-left: 1.25rem; margin-top: .25rem; }
.ia-help-steps > li { padding-left: .25rem; }
.ia-help-steps .ia-markdown p:last-child { margin-bottom: 0; }
.ia-help-search { max-width: 42rem; }
.ia-help-results .ia-status { font-size: .75rem; }

/* City picker suggestions (#78). */
.ia-city-picker { position: relative; }
.ia-city-list {
    position: absolute;
    z-index: 20;
    left: calc(var(--bs-gutter-x) * .5);
    right: calc(var(--bs-gutter-x) * .5);
    margin: 2px 0 0;
    padding: 4px 0;
    list-style: none;
    background: var(--ia-surface);
    border: 1px solid var(--ia-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(18, 40, 62, .12);
}
.ia-city-list li { padding: .5rem .75rem; cursor: pointer; }
.ia-city-list li:hover, .ia-city-list li.active { background: var(--ia-primary); color: #fff; }

/* Guided walkthroughs (help-guide.js, docs/15 Priority 2): a ring around the control and a panel beside it. Neither
   blocks the page, so the highlighted control stays usable. */
.ia-guide-ring {
    position: fixed;
    z-index: 1080;
    border: 3px solid #d63384;
    border-radius: 8px;
    box-shadow: 0 0 0 4px rgba(214, 51, 132, .25);
    pointer-events: none;
}
.ia-guide-panel {
    position: fixed;
    z-index: 1081;
    width: min(22rem, calc(100vw - 16px));
    padding: .875rem 1rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--ia-radius, 8px);
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .18);
}
.ia-guide-panel:focus { outline: 2px solid var(--bs-link-color); outline-offset: 2px; }
.ia-guide-panel-docked { right: 16px; bottom: 16px; top: auto !important; left: auto !important; }
@media (prefers-reduced-motion: no-preference) { .ia-guide-ring { transition: top .15s, left .15s, width .15s, height .15s; } }

/* A property's own colour and logo on its public booking and pay pages (set on the Bookings page). The variables are
   put on the page's <main> only when the property chose a colour; the text colour is black or white, whichever reads
   better on it. */
.guest-brand .btn-primary {
    --bs-btn-bg: var(--ia-brand);
    --bs-btn-border-color: var(--ia-brand);
    --bs-btn-color: var(--ia-brand-text);
    --bs-btn-hover-bg: var(--ia-brand);
    --bs-btn-hover-border-color: var(--ia-brand);
    --bs-btn-hover-color: var(--ia-brand-text);
    --bs-btn-active-bg: var(--ia-brand);
    --bs-btn-active-border-color: var(--ia-brand);
    --bs-btn-active-color: var(--ia-brand-text);
    --bs-btn-disabled-bg: var(--ia-brand);
    --bs-btn-disabled-border-color: var(--ia-brand);
    --bs-btn-disabled-color: var(--ia-brand-text);
}
.guest-brand .btn-primary:hover,
.guest-brand .btn-primary:focus-visible { filter: brightness(.9); }
.guest-brand .list-group-item.active {
    background-color: var(--ia-brand);
    border-color: var(--ia-brand);
    color: var(--ia-brand-text);
}
.guest-brand-bar { border-top: 6px solid var(--ia-brand); border-radius: .25rem; }
.guest-brand-logo { max-height: 72px; max-width: min(240px, 60vw); height: auto; width: auto; }
