/* Legal notice at the foot of every page (W21). Plain, readable, never hidden; stays below the page content. */
.demo-notice {
    clear: both;
    /* VS1: the notice is the last child of <body>. Keep it a full-width row in normal flow even when body is a flex row
       (body.auth-page) or a grid, and never let it slide under a fixed sidebar or bottom nav. */
    position: relative;
    z-index: 1;
    flex: 0 0 100%;
    order: 9999;
    grid-column: 1 / -1;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #d0d5dd);
    background: var(--surface-muted, #f5f6f8);
    color: var(--text-muted, #3c4451);
    font-size: var(--ui-text-small, 13px);
    line-height: 1.45;
    text-align: center;
}

/* Legacy signed-in shells keep a fixed sidebar (width --sidebar); start the notice beside it. Same breakpoint as .app-body. */
@media (min-width: 1100px) {
    body:has(> .app-shell > .sidebar):not(.is-flyin-embed) .demo-notice { margin-left: var(--sidebar); width: auto; }
}

/* V2 shells pin a 64px nav to the bottom on phones: keep the last line of the notice above it. */
@media (max-width: 767.98px) {
    body.layout-v2:not(.is-flyin-embed) .demo-notice { padding-bottom: calc(64px + 16px + env(safe-area-inset-bottom, 0px)); }
}

.demo-notice p {
    max-width: 72rem;
    margin: 0 auto;
}

.demo-notice a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.demo-notice a:focus-visible {
    outline: 3px solid var(--focus-ring, #1a56db);
    outline-offset: 2px;
}

.demo-terms-draft {
    margin: 0 0 16px;
    padding: 10px 14px;
    border: 2px solid #8a5a00;
    border-radius: 6px;
    background: #fff4d6;
    color: #4a3000;
    font-weight: 600;
}

.demo-terms-page {
    max-width: 48rem;
    margin: 24px auto;
    padding: 0 16px;
    line-height: 1.55;
}

.demo-terms-page li {
    margin-bottom: 4px;
}

.demo-terms-agree {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid var(--border-color, #d0d5dd);
    border-radius: 6px;
}

.demo-terms-agree label {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 44px;
    font-weight: 600;
}

.demo-terms-agree input[type="checkbox"] {
    width: var(--ui-check-size, 1.125rem);
    height: var(--ui-check-size, 1.125rem);
}

/* QA member #20: the "Terms of Use" link is at least 24px high to tap (padding above and below; the line spacing stays). */
.demo-notice a {
    padding-block: 4px;
}
