.scb {
    --scb-ink: #00102e;
    --scb-text: #222831;
    --scb-muted: #4b5563;
    --scb-line: #dbe1e9;
    --scb-surface: #ffffff;
    --scb-soft: #f5f7fa;
    --scb-right: max(1rem, env(safe-area-inset-right));
    --scb-bottom: calc(3.75rem + env(safe-area-inset-bottom));
    color: var(--scb-text);
    font-family: inherit;
    line-height: 1.5;
}

.scb [hidden],
.scb .scb-dialog:not([open]) {
    display: none !important;
}

.scb .scb-launcher {
    position: fixed;
    z-index: 99990;
    inset: auto var(--scb-right) var(--scb-bottom) auto;
    display: grid;
    width: 3.35rem;
    height: 3.35rem;
    place-items: center;
    padding: 0;
    border: 1px solid var(--scb-ink);
    border-radius: 50%;
    background: var(--scb-ink);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 .3rem 1rem #00102e22;
}

.scb .scb-dialog[open] {
    position: fixed;
    z-index: 99991;
    display: flex;
    flex-direction: column;
    width: min(28rem, calc(100% - 2rem));
    max-width: none;
    max-height: min(43rem, calc(100vh - 2rem));
    max-height: min(43rem, calc(100dvh - 2rem));
    box-sizing: border-box;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--scb-line);
    border-radius: .95rem;
    background: var(--scb-surface);
    color: var(--scb-text);
    box-shadow: 0 .75rem 2rem #00102e26;
}

.scb .scb-dialog[data-layout="corner"][open] {
    inset: auto var(--scb-right) var(--scb-bottom) auto;
    margin: 0;
    max-height: min(43rem, calc(100vh - var(--scb-bottom) - 1rem));
    max-height: min(43rem, calc(100dvh - var(--scb-bottom) - 1rem));
}

.scb .scb-dialog[data-layout="modal"][open] {
    inset: 0;
    margin: auto;
}

.scb-dialog::backdrop {
    background: #00102e70;
}

.scb .scb-header {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem .85rem 1.2rem;
    border-bottom: 1px solid var(--scb-line);
    background: var(--scb-soft);
}

.scb .scb-header h2 {
    margin: 0;
    color: var(--scb-ink);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.scb .scb-close {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: var(--scb-ink);
    cursor: pointer;
}

.scb .scb-content {
    display: block;
    min-height: 0;
    padding: 1.2rem;
    overflow: auto;
    overscroll-behavior: contain;
}

.scb .scb-intro,
.scb .scb-note {
    margin: 0 0 .8rem;
    color: var(--scb-muted);
    font-size: .9375rem;
    line-height: 1.55;
}

.scb .scb-prompt {
    margin: 0 0 .9rem;
    color: var(--scb-ink);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.45;
}

.scb .scb-choices,
.scb .scb-form {
    display: grid;
    gap: .55rem;
    margin: 0;
}

.scb .scb-button {
    min-height: 2.75rem;
    box-sizing: border-box;
    margin: 0;
    padding: .55rem .8rem;
    border: 1px solid var(--scb-line);
    border-radius: .55rem;
    background: #fff;
    color: var(--scb-ink);
    font: inherit;
    font-weight: 600;
    line-height: 1.35;
    text-transform: none;
    text-align: left;
    white-space: normal;
    cursor: pointer;
}

.scb .scb-button:hover,
.scb .scb-close:hover {
    border-color: var(--scb-ink);
    background: var(--scb-soft);
    color: var(--scb-ink);
}

.scb .scb-primary,
.scb .scb-primary:hover {
    justify-self: start;
    border-color: var(--scb-ink);
    background: var(--scb-ink);
    color: #fff;
}

.scb .scb-quiet {
    justify-self: start;
    margin-top: .25rem;
    border: 0;
    padding-inline: .15rem;
    background: transparent;
    color: var(--scb-muted);
}

.scb .scb-button:disabled {
    opacity: .65;
    cursor: wait;
}

.scb .scb-field {
    display: grid;
    gap: .25rem;
    margin: 0;
    font-size: .9375rem;
    font-weight: 600;
}

.scb .scb-form input,
.scb .scb-form textarea {
    width: 100%;
    min-height: 2.75rem;
    box-sizing: border-box;
    margin: 0;
    padding: .55rem .65rem;
    border: 1px solid var(--scb-line);
    border-radius: .45rem;
    background: #fff;
    color: var(--scb-ink);
    font: inherit;
    font-size: 1rem;
}

.scb .scb-form textarea {
    resize: vertical;
}

.scb .scb-link {
    display: inline-block;
    width: fit-content;
    margin-right: .55rem;
    color: var(--scb-ink);
    text-decoration: underline;
    text-underline-offset: .17em;
}

.scb .scb-error {
    margin: 0 0 .5rem;
    color: #99251d;
    font-size: .9375rem;
}

.scb :where(button, input, textarea, a):focus-visible {
    outline: 2px solid #2461a3;
    outline-offset: 2px;
}
