/* Nunito, self-hosted (never loaded from Google at runtime): the sign-in page's font, used on
   every page since HAAC-105. */
@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("../fonts/nunito-latin-var.woff2") format("woff2");
}

html, body {
    font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--hubvi-ink);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--hubvi-link);
}

.btn-primary {
    color: #fff;
    background-color: #1A4FE0;
    border-color: #1238B8;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

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

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.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."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1A4FE0;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.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;
}

/* Hubvi AAC app styles */

/* The website's colours (HAAC-105), taken from the sign-in page (signin.css): the same ink, link
   blue and button gradient everywhere. Blues only on the signed-in pages, no purple (customer
   feedback, Oct 2026). */
:root {
    --hubvi-ink: #110E3B;
    --hubvi-heading: #110E3B;
    --hubvi-muted: #4A4870;
    --hubvi-link: #1736E6;
    --hubvi-blue: #1A4FE0;
    --hubvi-blue-dark: #0F1E9E;
    --hubvi-blue-hover: #1238B8;
    --hubvi-blue-tint: #ECF2FF;
    --hubvi-button-gradient: linear-gradient(90deg, #12D2F4 0%, #1677F2 45%, #1C1BE0 100%);
    --hubvi-header-gradient: linear-gradient(90deg, #1B4FD8 0%, #1E86EE 100%);
    --hubvi-surface: #F3F6FF;
    --hubvi-line: #E3E7F4;
    --hubvi-line-strong: #D3DBF2;
    --hubvi-field-border: #C9CFEA;
    --hubvi-field-focus: #1A4FE0;
    --hubvi-shadow: 0 2px 10px rgba(17, 14, 59, 0.06);
    --hubvi-red: #B32121;
    --hubvi-red-hover: #961B1B;
}

.content h1 {
    font-weight: 900;
    letter-spacing: -0.01em;
}

.content h2, .content h3 {
    font-weight: 800;
}

/* Text fields everywhere outside sign-in: the sign-in page's field edge and focus ring. */
.content input:not([type=checkbox]):not([type=radio]):not([type=color]),
.content select,
.content textarea,
.modal-card input:not([type=checkbox]):not([type=radio]):not([type=color]),
.modal-card select,
.modal-card textarea {
    border: 1.5px solid var(--hubvi-field-border);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    font: inherit;
    color: var(--hubvi-ink);
    background: #fff;
}

.content input:not([type=checkbox]):not([type=radio]):focus,
.content select:focus,
.content textarea:focus,
.modal-card input:not([type=checkbox]):not([type=radio]):focus,
.modal-card select:focus,
.modal-card textarea:focus {
    outline: none;
    border-color: var(--hubvi-field-focus);
    box-shadow: 0 0 0 3px rgba(26, 79, 224, 0.18);
}

.content input[type=checkbox], .content input[type=radio],
.modal-card input[type=checkbox], .modal-card input[type=radio] {
    accent-color: var(--hubvi-blue);
}

.content h1, .content h2, .content h3,
.auth-card h1,
.modal-card h3 {
    color: var(--hubvi-heading);
}

/* The three button styles, as the app has them: primary (blue), secondary (white with a blue
   edge) and destructive (red). Every dashboard button uses one, so they all line up. */
.btn-primary-action,
.btn-secondary-action,
.btn-danger-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.5rem;
    padding: 0.45rem 1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
}

/* Primary = the sign-in page's "Log in" button: the cyan-to-blue gradient. */
.btn-primary-action {
    background: var(--hubvi-button-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(28, 27, 224, 0.18);
}

.btn-primary-action:hover:not(:disabled) {
    filter: brightness(1.08);
    box-shadow: 0 6px 16px rgba(28, 27, 224, 0.26);
}

.btn-secondary-action {
    background: white;
    border: 1.5px solid var(--hubvi-blue);
    color: var(--hubvi-blue);
}

.btn-secondary-action:hover:not(:disabled) {
    background: var(--hubvi-blue-tint);
}

.btn-danger-action {
    border-width: 1.5px;
    background: var(--hubvi-red);
    border-color: var(--hubvi-red);
    color: white;
}

.btn-danger-action:hover:not(:disabled) {
    background: var(--hubvi-red-hover);
    border-color: var(--hubvi-red-hover);
}

.btn-primary-action:disabled,
.btn-secondary-action:disabled,
.btn-danger-action:disabled {
    opacity: 0.55;
    cursor: default;
}

.btn-primary-action:focus-visible,
.btn-secondary-action:focus-visible,
.btn-danger-action:focus-visible {
    outline: 3px solid rgba(26, 79, 224, 0.4);
    outline-offset: 2px;
}

/* A row of buttons, e.g. under a form or beside a heading. */
.button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* Public pages (Layout/BlankLayout.razor, HAAC-105): logo bar, a white card on light blue, footer. */
.public-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--hubvi-surface);
}

.public-header {
    display: flex;
    align-items: center;
    padding: 0.85rem clamp(1rem, 4vw, 2rem);
    background: #fff;
    border-bottom: 1px solid var(--hubvi-line);
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
}

.public-brand-symbol {
    width: 2.4rem;
    height: auto;
}

/* The sign-in lockup's gradient wordmark, smaller. */
.public-brand-wordmark {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    padding-bottom: 0.08em;
    background: linear-gradient(90deg, #2A8DF6 0%, #1F5CD6 30%, #3B2BC8 55%, #9A2F9A 78%, #EE3F7E 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.public-brand-product {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--hubvi-ink);
}

.auth-page {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(1rem, 4vw, 2.5rem) clamp(0.75rem, 3vw, 1.5rem);
}

.public-page .site-footer {
    background: #fff;
    border-top: 1px solid var(--hubvi-line);
}

.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 2rem 2.5rem;
    width: 100%;
    max-width: 360px;
}

.auth-card label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
}

.auth-card input {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.5rem;
    border: 1.5px solid var(--hubvi-field-border);
    border-radius: 6px;
}

.auth-card button[type="submit"] {
    width: 100%;
    margin-top: 0.5rem;
    min-height: 3rem;
    font-size: 1.05rem;
}

.auth-error {
    color: #b32121;
    font-weight: 600;
}

.who-am-i {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-right: 1rem;
    font-weight: 800;
    color: var(--hubvi-ink);
}

.who-am-i-icon {
    width: 1.3rem;
    height: 1.3rem;
    color: var(--hubvi-blue);
}

/* Font Awesome icons inside buttons and links take the text colour and size. */
.btn-primary-action .fa-icon,
.btn-secondary-action .fa-icon,
.btn-danger-action .fa-icon {
    width: 1em;
    height: 1em;
}

.speaker-list {
    list-style: none;
    padding: 0;
}

.speaker-list li {
    padding: 0.5rem 0;
    font-size: 1.1rem;
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.emoji-input {
    width: 4rem;
    text-align: center;
}

.tabs::-webkit-scrollbar {
    display: none;
}

/* Tabs as one segmented bar (customer feedback): the chosen tab is filled in the app's blue,
   so which one's open is obvious at a glance. */
.tabs {
    display: flex;
    gap: 0.25rem;
    width: fit-content;
    max-width: 100%;
    padding: 0.3rem;
    margin-bottom: 1.25rem;
    background: var(--hubvi-surface);
    border: 1px solid var(--hubvi-line-strong);
    border-radius: 12px;
    overflow-x: auto; /* Phone width: the tabs scroll sideways rather than the whole page. */
    scrollbar-width: none; /* ...by swiping, without a scrollbar under the tabs. */
    box-sizing: border-box;
}

.tab {
    flex: none;
    white-space: nowrap;
    background: none;
    border: none;
    border-radius: 9px;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--hubvi-muted);
    transition: background-color 0.15s, color 0.15s;
}

.tab:hover:not(.active) {
    background: white;
    color: var(--hubvi-blue);
}

.tab:focus-visible {
    outline: 2px solid var(--hubvi-blue);
    outline-offset: 2px;
}

.tab.active {
    background: var(--hubvi-button-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(28, 27, 224, 0.25);
}

.card {
    border: 1px solid var(--hubvi-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--hubvi-shadow);
    padding: 1rem;
    margin-bottom: 1rem;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.card-header .badge {
    background: #eee;
    color: #333;
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
    font-size: 0.85rem;
}

.share-code {
    font-family: monospace;
    color: var(--hubvi-muted);
}

.hint {
    color: var(--hubvi-muted);
    font-size: 0.9rem;
}

.order-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.order-input {
    width: 4rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid var(--hubvi-line);
}

.emoji-cell {
    font-size: 1.5rem;
}

.site-footer {
    text-align: center;
    padding: 1.25rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--hubvi-muted);
}

.site-footer a {
    color: var(--hubvi-muted);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--hubvi-link);
    text-decoration: underline;
}

.legal-page {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1.1rem, 4vw, 2.75rem) 2.5rem;
    line-height: 1.6;
    background: #fff;
    border: 1px solid var(--hubvi-line);
    border-radius: 16px;
    box-shadow: var(--hubvi-shadow);
}

.legal-page h1, .legal-page h2, .legal-page h3 {
    color: var(--hubvi-heading);
}

.legal-page h1 {
    font-weight: 900;
    letter-spacing: -0.01em;
}

.legal-page h2 {
    margin-top: 1.75rem;
    font-size: 1.35rem;
    font-weight: 800;
}

.legal-meta {
    color: var(--hubvi-muted);
    font-size: 0.9rem;
    margin-top: -0.5rem;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.legal-table th, .legal-table td {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid var(--hubvi-line);
    vertical-align: top;
}

.legal-page dt {
    font-weight: 600;
    margin-top: 1rem;
}

.legal-page dd {
    margin-left: 0;
    color: #444;
}

.add-button-bar {
    margin-bottom: 1rem;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.button-tile {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    border: 1px solid var(--hubvi-line);
    border-radius: 12px;
    padding: 0.75rem;
}

.button-tile-preview {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: white;
    color: black;
    border-radius: 10px;
    padding: 1rem 0.75rem;
    gap: 0.35rem;
    min-width: 0;
}

.button-tile-title {
    font-weight: 700;
    font-size: 1.05rem;
    word-break: break-word;
}

.button-tile-emoji {
    font-size: 2.25rem;
    line-height: 1;
}

.button-tile-phrase {
    font-size: 0.85rem;
    color: inherit;
    opacity: 0.75;
    word-break: break-word;
}

/* Tile + its optional description underneath, as the app lays them out. */
.button-tile-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.button-tile-description {
    font-size: 0.85rem;
    color: #444;
    text-align: center;
    word-break: break-word;
}

.category-description {
    margin: 0 0 0.75rem;
    color: var(--hubvi-muted);
}

.color-preview {
    max-width: 220px;
    margin: 0 auto 1rem;
}

/* Edit/Remove etc. under each tile, sharing the width equally. */
.button-tile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.button-tile-actions > button {
    flex: 1 1 0;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.card-header-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.draggable-tile {
    cursor: grab;
    transition: box-shadow 0.15s ease;
}

.draggable-tile:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.draggable-tile:active {
    cursor: grabbing;
}

.button-tile.dragging {
    opacity: 0.4;
}

/* Where a dragged button will land: another board's body, or a tile it'll go in front of. */
.board-body.drop-target {
    background: var(--hubvi-blue-tint);
    outline: 2px dashed var(--hubvi-blue);
    outline-offset: -6px;
}

.button-tile.drop-before {
    box-shadow: -4px 0 0 0 var(--hubvi-blue);
}

.search-results {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--hubvi-line);
    border-radius: 8px;
    margin-top: 0.75rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--hubvi-line);
    cursor: pointer;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--hubvi-blue-tint);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 14, 59, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}

/* Every modal: a heading, a body that scrolls, and a footer of buttons pinned to the bottom so
   Save/Cancel are always in reach, as on the app's Add Button page. */
.modal-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(17, 14, 59, 0.25);
}

.modal-card.modal-wide {
    max-width: 560px;
}

.modal-card > h3 {
    margin: 0;
    padding: 1.25rem 1.5rem 0.75rem;
    border-bottom: 1px solid var(--hubvi-line);
    font-weight: 900;
}

.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.modal-body > :last-child {
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-top: 1px solid var(--hubvi-line);
    background: var(--hubvi-surface);
}

/* e.g. "Delete Mum" on the left, away from Cancel/Save. */
.modal-footer .footer-start {
    margin-right: auto;
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 0.5rem;
    }

    .modal-card > h3,
    .modal-body,
    .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .modal-footer .footer-start {
        flex-basis: 100%;
        margin-right: 0;
    }
}

.modal-card label {
    display: block;
    margin-bottom: 0.85rem;
    font-weight: 600;
}

.modal-card label input,
.modal-card label select,
.modal-card label textarea {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.5rem;
    border: 1.5px solid var(--hubvi-field-border);
    border-radius: 6px;
    font-weight: normal;
    box-sizing: border-box;
}

.modal-card label input.emoji-input {
    width: 4rem;
}

/* Speaker header + list (HAAC-41) */
.speaker-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.speaker-header h1 {
    margin: 0;
}

.speaker-header-text {
    flex: 1;
    min-width: 0;
}

.speaker-description {
    margin: 0.25rem 0 0;
    color: var(--hubvi-muted);
}

.speaker-edit-button {
    align-self: flex-start;
}

.speaker-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.speaker-list-text {
    display: flex;
    flex-direction: column;
}

.speaker-list-name {
    font-weight: 600;
}

.speaker-list-description {
    font-size: 0.9rem;
    color: #666;
}

.speaker-list .badge {
    background: #eee;
    color: var(--hubvi-muted);
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
}

/* Sharing (HAAC-52) */
.guest-note {
    background: #fff7e0;
    border: 1px solid #f0d58a;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    color: #6b5400;
}

.success-note {
    color: #2e7d32;
    font-weight: 600;
}

.badge.badge-default {
    background: var(--hubvi-blue);
    color: white;
}

/* Linked buttons (HAAC-46) */
.linked-badge {
    position: absolute;
    top: 0.35rem;
    right: 0.4rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--hubvi-blue-dark);
    color: white;
    font-size: 0.95rem;
    line-height: 1.6rem;
    text-align: center;
    font-weight: 700;
}

/* "New" buttons (HAAC-89): top left, so it never covers the linked badge. */
.new-badge {
    position: absolute;
    top: 0.35rem;
    left: 0.4rem;
    padding: 0 0.5rem;
    height: 1.6rem;
    border-radius: 0.8rem;
    /* HAAC-118: white NEW on red, matching the app (HAAC-107). The white outline keeps it
       visible on red tiles. Red is the danger token, used here on purpose to match. */
    background: var(--hubvi-red);
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(17, 14, 59, 0.25);
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Room above the title for the badges, so they never cover the text. */
.button-tile-preview.is-linked,
.button-tile-preview.has-new-badge {
    padding-top: 2.1rem;
}

.button-tile-link {
    font-size: 0.85rem;
    font-weight: 700;
}

.button-tile-boards {
    font-size: 0.8rem;
    color: var(--hubvi-muted);
    text-align: center;
}

/* Board checklist in the button modal (HAAC-55) */
.board-checklist {
    border: 1.5px solid var(--hubvi-field-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.85rem;
    max-height: 200px;
    overflow-y: auto;
}

.board-checklist legend {
    font-weight: 600;
    font-size: 1rem;
    float: none;
    width: auto;
    padding: 0 0.25rem;
    margin: 0;
}

.modal-card .board-checklist label.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-weight: normal;
}

.modal-card .board-checklist label.checkbox-row input {
    display: inline-block;
    width: auto;
    margin: 0;
}

.board-checklist .checklist-hint {
    margin: 0 0 0.35rem;
}

/* Sharing permissions (HAAC-64) */
.table-scroll {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.permissions-table .permission-cell {
    text-align: center;
    white-space: nowrap;
}

.permissions-table input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
}

.permissions-table .badge {
    background: var(--hubvi-blue);
    color: white;
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
    font-size: 0.85rem;
}

.row-actions {
    white-space: nowrap;
    text-align: right;
}

.row-actions .button-row {
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-top: 0.75rem;
}

.checkbox-group .checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Communication Boards laid out like the app (HAAC-74): a blue title bar per board, as the
   app's board headers are, with its buttons underneath. */
.board-card {
    padding: 0;
    overflow: hidden;
}

.board-title-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    background: var(--hubvi-header-gradient);
    color: white;
    padding: 0.6rem 1rem;
}

.board-outside .board-title-bar {
    background: #6b7a8f;
}

.board-title {
    font-weight: 800;
    font-size: 1.15rem;
}

.board-title-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-left: auto;
}

/* On the blue bar, a white edge reads better than a blue one. */
.board-title-actions .btn-secondary-action,
.board-title-actions .btn-danger-action {
    border-color: white;
}

.board-body {
    padding: 1rem;
}

.board-add-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.board-inline-action {
    margin-left: 0.5rem;
}

.board-section-heading {
    margin: 2rem 0 0.25rem;
    font-size: 1.15rem;
}

.clickable-tile {
    cursor: pointer;
}

.clickable-tile:hover {
    filter: brightness(0.95);
}

.search-result-boards {
    display: block;
    font-size: 0.8rem;
}

/* All buttons tab: search + "which buttons" filter beside the add button. */
.library-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.library-search,
.library-filter {
    min-height: 2.5rem;
    padding: 0.5rem;
    border: 1.5px solid var(--hubvi-field-border);
    border-radius: 6px;
}

.library-search {
    flex: 1 1 200px;
    max-width: 320px;
}

/* Profiles tab: each profile's boards as an ordered list with move/remove buttons. */
.profile-board-list {
    padding-left: 1.5rem;
    margin: 0 0 0.75rem;
}

.profile-board-row {
    padding: 0.2rem 0;
}

.profile-board-row::marker {
    color: var(--hubvi-muted);
}

.profile-board-name {
    display: inline-block;
    min-width: 12rem;
}

.profile-board-actions {
    display: inline-flex;
    gap: 0.35rem;
    margin-left: 0.75rem;
}

.profile-add-board {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.profile-add-board select {
    padding: 0.35rem;
    border: 1.5px solid var(--hubvi-field-border);
    border-radius: 6px;
    font-weight: normal;
}

/* Show password (HAAC-76) and "Register as" (HAAC-78): the box/circle and its words on one
   line, lined up with the fields' left edge. */
.auth-card label.checkbox-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin-top: -0.25rem;
    font-weight: normal;
    cursor: pointer;
}

.auth-card label.checkbox-row input {
    flex: none;
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    padding: 0;
    accent-color: var(--hubvi-blue);
}

.auth-card fieldset {
    margin-bottom: 1rem;
}

.auth-card fieldset legend {
    float: none;
    width: auto;
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
}

.auth-card fieldset label.checkbox-row {
    margin: 0 0 0.4rem;
}

.auth-card fieldset.invalid-choice legend {
    color: var(--hubvi-red);
}

/* Text boxes outside a label (search boxes, the add-speaker box), matching those in forms. */
.inline-form input,
.inline-form select,
.modal-search,
.emoji-field input {
    min-height: 2.5rem;
    padding: 0.5rem;
    border: 1.5px solid var(--hubvi-field-border);
    border-radius: 6px;
}

.modal-search {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* Button editor: emoji box + "Choose emoji", and the searchable picker (customer feedback). */
.modal-card .field {
    margin-bottom: 0.85rem;
}

.modal-card .field > label {
    margin-bottom: 0.25rem;
}

.emoji-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.emoji-field input:not(.emoji-input) {
    flex: 1;
    min-width: 0;
}

.emoji-field input.emoji-input {
    width: 4.5rem;
    font-size: 1.5rem;
    text-align: center;
    padding: 0.25rem;
}

.emoji-picker {
    margin-top: 0.5rem;
    border: 1.5px solid var(--hubvi-field-border);
    border-radius: 8px;
    padding: 0.6rem;
    background: #fafafa;
}

.emoji-picker-groups {
    max-height: 260px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.emoji-picker-group {
    font-weight: 700;
    color: var(--hubvi-heading);
    margin: 0.4rem 0 0.3rem;
}

.emoji-picker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.emoji-choice {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.6rem;
    line-height: 1;
    padding: 0;
    background: white;
    border: 1.5px solid var(--hubvi-field-border);
    border-radius: 10px;
    cursor: pointer;
}

.emoji-choice:hover {
    border-color: var(--hubvi-blue);
    background: var(--hubvi-blue-tint);
}

.emoji-choice.selected {
    border: 2px solid var(--hubvi-blue);
}

/* Colour swatches, as the app's: round, a thin grey edge so white shows, a thick ring when
   chosen. */
.swatch-row {
    margin-bottom: 0.85rem;
}

.swatch-row legend {
    float: none;
    width: auto;
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
}

.swatches {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem;
}

.swatch {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 50%;
    border: 1px solid #999;
    cursor: pointer;
}

.swatch.selected {
    box-shadow: 0 0 0 3px white, 0 0 0 6px var(--hubvi-heading);
}

.swatch:focus-visible {
    outline: 3px solid #90CAF9;
    outline-offset: 4px;
}

.swatch-custom-note {
    margin-left: -0.15rem;
}

/* Contacts (HAAC-86) */
.contacts-table td {
    vertical-align: middle;
}

/* Field help: the "?" next to a heading (Shared/HelpTip.razor). */
.help-tip {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    font-weight: normal;
}

.help-tip-button {
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    border: 1px solid var(--hubvi-blue);
    border-radius: 50%;
    background: white;
    color: var(--hubvi-blue);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.help-tip-button:hover,
.help-tip.open .help-tip-button {
    background: var(--hubvi-blue);
    color: white;
}

.help-tip-bubble {
    display: none;
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    /* Opens rightwards from the "?": headings sit at the left of a form, so a bubble centred
       on the "?" was cut off by the modal's edge. */
    left: -0.5rem;
    width: max-content;
    max-width: min(18rem, 75vw);
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    background: #1F2A37;
    color: white;
    font-size: 0.85rem;
    font-weight: normal;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.help-tip:hover .help-tip-bubble,
.help-tip.open .help-tip-bubble {
    display: block;
}

/* ...except at the right-hand end of the permissions table, where it opens leftwards. */
.permissions-table th:nth-last-child(2) .help-tip-bubble {
    left: auto;
    right: -0.5rem;
}

/* Wide screens have room for the permissions table, and its help shouldn't be clipped. */
@media (min-width: 900px) {
    .table-scroll {
        overflow-x: visible;
    }
}

/* Dashboard */
.dashboard-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.dashboard-header h1 {
    margin: 0;
}

.period-picker {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--hubvi-surface);
    border: 1px solid var(--hubvi-line-strong);
    border-radius: 10px;
}

.period-option {
    border: none;
    border-radius: 7px;
    background: none;
    padding: 0.35rem 0.8rem;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--hubvi-muted);
    cursor: pointer;
}

.period-option.active {
    background: var(--hubvi-button-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(28, 27, 224, 0.25);
}

.content h2.dashboard-section-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hubvi-muted);
    margin: 1.25rem 0 0.5rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 0.75rem;
}

.stat-tile {
    padding: 0.9rem 1rem;
    border: 1px solid var(--hubvi-line);
    border-radius: 14px;
    background: white;
    box-shadow: var(--hubvi-shadow);
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.1;
    color: var(--hubvi-heading);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    margin-top: 0.2rem;
    font-weight: 600;
    color: #33414F;
}

.stat-note {
    font-size: 0.85rem;
    color: #6B7A8F;
}

.speaker-usage {
    margin-top: 1.25rem;
    border-color: #E1E8F0;
}

.speaker-usage-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 1rem;
}

.content .speaker-usage-header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.speaker-usage-header a {
    color: inherit;
    text-decoration: none;
}

.speaker-usage-header a:hover {
    text-decoration: underline;
}

.speaker-usage-summary {
    margin: 0.4rem 0 0.75rem;
    color: #33414F;
}

.usage-columns {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .usage-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}

.usage-chart {
    margin: 0;
}

.usage-chart figcaption,
.content .top-buttons h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #33414F;
    margin: 0 0 0.5rem;
}

/* One bar per day, on a recessive baseline; 2px gaps between bars. */
.day-bars {
    display: grid;
    grid-template-columns: repeat(var(--days), minmax(0, 1fr));
    gap: 2px;
    align-items: end;
    height: 9rem;
    border-bottom: 1px solid #C9D3DE;
}

.day-bar-slot {
    position: relative;
    height: 100%;
    display: flex;
    align-items: flex-end;
    cursor: default;
    outline: none;
}

.day-bar {
    width: 100%;
    max-width: 2rem;
    margin: 0 auto;
    background: var(--hubvi-blue);
    border-radius: 4px 4px 0 0;
}

.day-bar-slot:hover .day-bar,
.day-bar-slot:focus-visible .day-bar {
    background: var(--hubvi-blue-dark);
}

.day-bar-slot:hover,
.day-bar-slot:focus-visible {
    background: rgba(21, 101, 192, 0.08);
}

.day-bar-tip {
    display: none;
    position: absolute;
    z-index: 5;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    background: #1F2A37;
    color: white;
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
}

.day-bar-slot:hover .day-bar-tip,
.day-bar-slot:focus-visible .day-bar-tip {
    display: block;
}

.day-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #6B7A8F;
}

.top-buttons-table {
    width: 100%;
    border-collapse: collapse;
}

.top-buttons-table th,
.top-buttons-table td {
    padding: 0.3rem 0;
    border-bottom: 1px solid #F0F3F7;
}

.top-buttons-table th {
    font-weight: 600;
    text-align: left;
    width: 45%;
    padding-right: 0.75rem;
}

.top-button-emoji {
    display: inline-block;
    width: 1.5rem;
}

.top-button-bar-cell {
    width: 40%;
}

.top-button-bar {
    height: 0.6rem;
    background: var(--hubvi-blue);
    border-radius: 0 4px 4px 0;
}

.top-button-count {
    width: 15%;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #33414F;
}


/* Status page (HAAC-99). State is always in words as well as colour. */
.status-summary {
    margin: 1rem 0 1.5rem;
    padding: 0.9rem 1.1rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
}

.status-summary--up { background: #E7F7EE; color: #145C33; }
.status-summary--down { background: #FDECEC; color: #8A1C1C; }
.status-summary--checking { background: #EEF1F6; color: #3D4A5C; }

.status-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    border: 1px solid #E2E6EE;
    border-radius: 10px;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1.1rem;
}

.status-row + .status-row {
    border-top: 1px solid #E2E6EE;
}

.status-dot {
    flex: none;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    background: #A9B2C0;
}

.status-row--up .status-dot { background: #1F9D55; }
.status-row--down .status-dot { background: #D93030; }

.status-name {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.status-detail {
    color: #5B6575;
    font-size: 0.9rem;
}

.status-state {
    font-weight: 700;
    white-space: nowrap;
}

.status-row--up .status-state { color: #145C33; }
.status-row--down .status-state { color: #8A1C1C; }

.status-checked {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    color: #5B6575;
}

/* HAAC-109: guest access switch and code, at the top of the Sharing tab. */
.guest-access-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.guest-access-toggle input {
    margin-top: 0.3rem;
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

.guest-access-toggle .hint {
    display: block;
    margin-top: 0.2rem;
}

.guest-access-code {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-left: 1.85rem;
}

.guest-access-code-value {
    font-size: 1.25rem;
    letter-spacing: 0.15em;
    color: var(--hubvi-ink);
}

/* HAAC-117: names the open section, now that the tab bar has moved to the sidebar. */
.speaker-section-title {
    margin: 0.25rem 0 1rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--hubvi-heading);
}

/* HAAC-111: access requests on the Sharing page, and their count elsewhere. */
.count-badge {
    display: inline-block;
    min-width: 1.5rem;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    background: var(--hubvi-blue);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    text-align: center;
    vertical-align: middle;
}

.access-requests-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0;
}

.access-request {
    border-top: 1px solid var(--hubvi-line);
    padding: 0.85rem 0;
    display: grid;
    gap: 0.6rem;
}

.access-request-message {
    margin: 0.4rem 0 0;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--hubvi-line-strong);
    background: var(--hubvi-surface);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}
