:root {
    --h2m-navy: #0E2A47;
    --h2m-orange: #F59E0B;
    --h2m-blue: #1D5FA8;
    --h2m-bg: #F4F6F9;
    --h2m-border: #DDE3EA;
    --h2m-muted: #4A5568;
}

html, body {
    font-family: Inter, 'Segoe UI', Roboto, 'Nirmala UI', 'Noto Sans Devanagari', 'Noto Sans Telugu', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--h2m-bg);
    color: var(--h2m-navy);
    --maui-status-bar-safe-area-background: #0E2A47;
}

.h2m-title {
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.h2m-two {
    color: #B86E00;
}

.h2m-lead {
    color: var(--h2m-muted);
    margin-bottom: 1.5rem;
}

.h2m-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.h2m-card {
    flex: 1 1 260px;
    background: #fff;
    border: 1px solid var(--h2m-border);
    border-radius: 12px;
    padding: 1.25rem;
}

.h2m-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--h2m-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.h2m-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.h2m-note {
    color: var(--h2m-muted);
}

.h2m-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.h2m-h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.h2m-h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.h2m-small {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--h2m-muted);
}

.h2m-splash {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.h2m-plain {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.5rem 1rem;
}

.h2m-plain-card {
    width: 100%;
    max-width: 26rem;
    background: #fff;
    border: 1px solid var(--h2m-border);
    border-radius: 16px;
    padding: 1.75rem;
}

.h2m-code {
    font-size: 1.6rem;
    letter-spacing: 0.4em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.h2m-dev {
    background: #FFF1D6;
    color: #5C3A00;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.h2m-callout {
    background: #FFF7E6;
    border: 1px solid #F0D9A8;
    border-radius: 12px;
    padding: 1.25rem;
}

.h2m-card-link {
    font-weight: 600;
    text-decoration: none;
}

.h2m-table-box {
    overflow-x: auto;
    padding: 0;
}

.h2m-table-box th {
    font-size: 0.8rem;
    color: var(--h2m-muted);
    white-space: nowrap;
}

.h2m-nowrap {
    white-space: nowrap;
}

/* A long payment reference breaks inside its cell and does not stretch the table. */
.h2m-ref {
    max-width: 14rem;
    overflow-wrap: anywhere;
}

.h2m-row-problem {
    background: #FFF7E6;
}

.h2m-problem {
    color: #7A4300;
    font-weight: 500;
}

.h2m-ok {
    color: var(--h2m-blue);
    font-weight: 600;
}

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-accent {
    background-color: var(--h2m-orange);
    border-color: var(--h2m-orange);
    color: var(--h2m-navy);
    font-weight: 700;
}

.btn-accent:hover, .btn-accent:focus {
    background-color: #E08E00;
    border-color: #E08E00;
    color: var(--h2m-navy);
}

.btn-outline-primary {
    color: var(--h2m-navy);
    border-color: #9FB0C3;
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--h2m-navy);
    border-color: var(--h2m-navy);
    color: #fff;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:disabled {
    background-color: #1F4268;
    border-color: #1F4268;
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.h2m-owe {
    background: var(--h2m-navy);
    color: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    max-width: 26rem;
}

.h2m-owe-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #D5DFEA;
}

.h2m-owe-amount {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.5rem;
}

.h2m-num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.h2m-chip {
    display: inline-block;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.h2m-chip-ok {
    background: #E6F0FB;
    color: #174A85;
}

.h2m-chip-warn {
    background: #FFF1D6;
    color: #7A4300;
}

.h2m-chip-plain {
    background: #EDF0F4;
    color: var(--h2m-muted);
}

.h2m-row-muted td {
    color: var(--h2m-muted);
    text-decoration: line-through;
}

.h2m-row-muted td:last-child {
    text-decoration: none;
}

.h2m-paid-mark {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    background: var(--h2m-blue);
    color: #fff;
    font-size: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* A list of bills or payments that reads well on a phone: what it is on the left, the amount on the right. */
.h2m-list {
    list-style: none;
    margin-top: 0;
    padding: 0 1rem;
}

.h2m-list-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 1rem;
    align-items: start;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--h2m-border);
}

.h2m-list-item:last-child {
    border-bottom: 0;
}

.h2m-list-side {
    text-align: right;
}

.h2m-list-actions {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .h2m-list-item {
        grid-template-columns: 1fr auto auto;
        align-items: center;
    }

    .h2m-list-actions {
        grid-column: auto;
    }
}

.h2m-pay-bill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--h2m-border);
}

.h2m-qr {
    border: 1px solid var(--h2m-border);
    border-radius: 8px;
    background: #fff;
    padding: 6px;
}

.h2m-code-line {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.85rem;
    background: var(--h2m-bg);
    border: 1px solid var(--h2m-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    overflow-wrap: anywhere;
}

.h2m-notice-body {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.h2m-react {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--h2m-border);
    background: #fff;
    color: var(--h2m-navy);
    font-size: 0.9rem;
    cursor: pointer;
}

.h2m-react-on {
    background: #E6F0FB;
    border-color: var(--h2m-blue);
    font-weight: 600;
}

.h2m-react-count {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.h2m-comments {
    border-top: 1px solid var(--h2m-border);
    padding-top: 0.5rem;
}

.h2m-comment {
    padding: 0.4rem 0;
    overflow-wrap: anywhere;
}

.h2m-bar-row {
    padding: 0.5rem 0;
}

.h2m-bar {
    height: 8px;
    border-radius: 4px;
    background: #E3E9F0;
    margin-top: 0.3rem;
}

.h2m-bar-fill {
    height: 8px;
    border-radius: 4px;
    background: var(--h2m-blue);
}

.h2m-emergency {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    max-width: 60rem;
}

.h2m-emergency-item {
    background: #fff;
    border: 1px solid var(--h2m-border);
    border-radius: 12px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
}

.h2m-emergency-call {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.5rem;
    text-decoration: none;
    color: var(--h2m-navy);
    min-height: 44px;
}

.h2m-emergency-name {
    font-weight: 600;
}

.h2m-emergency-phone {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--h2m-blue);
    font-variant-numeric: tabular-nums;
}

.h2m-designs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.75rem;
}

.h2m-design {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem;
    background: #fff;
    border: 2px solid var(--h2m-border);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.h2m-design img {
    width: 100%;
    height: 190px;
    object-fit: contain;
    object-position: top;
    background: var(--h2m-bg);
    border-radius: 6px;
}

.h2m-design-on {
    border-color: var(--h2m-blue);
    background: #F0F6FD;
}

.h2m-template-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 22rem;
    overflow-y: auto;
}

.h2m-template {
    text-align: left;
    min-height: 44px;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--h2m-border);
    background: #fff;
    color: var(--h2m-navy);
    cursor: pointer;
}

.h2m-template-on {
    background: var(--h2m-navy);
    border-color: var(--h2m-navy);
    color: #fff;
    font-weight: 600;
}

.h2m-msg-preview {
    white-space: pre-line;
    overflow-wrap: anywhere;
    background: #E7F7E1;
    border: 1px solid #BFE3B3;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    max-width: 30rem;
}

.h2m-languages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.h2m-language {
    min-height: 36px;
    padding: 0 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--h2m-border);
    background: #fff;
    color: var(--h2m-navy);
    font-size: 0.9rem;
    cursor: pointer;
}

.h2m-language-on {
    background: var(--h2m-navy);
    border-color: var(--h2m-navy);
    color: #fff;
    font-weight: 600;
}

.h2m-languages-large .h2m-language {
    min-height: 56px;
    min-width: 9rem;
    font-size: 1.15rem;
    border-radius: 12px;
}

a, .btn-link {
    color: #1D5FA8;
}

.btn-primary {
    color: #fff;
    background-color: #0E2A47;
    border-color: #0E2A47;
}

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

h1:focus {
    outline: none;
}

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

/* The framework shows this bar only when a screen fails. It must stay hidden otherwise, in every layout. */
#blazor-error-ui {
    color-scheme: light only;
    background: #FFF1D6;
    color: #5C3A00;
    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;
}

/* A question that must be answered before leaving the screen. */
.h2m-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 42, 71, .55);
}

.h2m-dialog {
    width: 100%;
    max-width: 26rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(15, 42, 71, .3);
}

/* The society's own pictures. */
.h2m-society-photo {
    display: block;
    width: 100%;
    max-width: 46rem;
    max-height: 16rem;
    object-fit: cover;
    border-radius: 16px;
}

.h2m-picture-logo {
    display: block;
    max-width: 10rem;
    max-height: 6rem;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid #DDE3EA;
    border-radius: 10px;
    object-fit: contain;
}

/* Reports: money in and money out as bars of different colours. */
.h2m-bar-in .h2m-bar-fill {
    background: #2E8B57;
}

.h2m-bar-out .h2m-bar-fill {
    background: var(--h2m-orange);
}

.h2m-figure {
    flex: 1 1 200px;
}

/* The calendar: the day of the month on the left of each event. */
.h2m-event-day {
    flex: 0 0 3.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0;
    background: var(--h2m-bg);
    border: 1px solid var(--h2m-border);
    border-radius: 10px;
    line-height: 1.1;
}

.h2m-event-day-number {
    font-size: 1.35rem;
    font-weight: 700;
}

.h2m-event-day-name {
    font-size: 0.75rem;
    color: var(--h2m-muted);
    text-transform: uppercase;
}

.h2m-event-details {
    font-size: 0.9rem;
    white-space: pre-line;
    margin-top: 0.25rem;
}

.h2m-event-row {
    grid-template-columns: 3.25rem 1fr;
    align-items: start;
}

.h2m-event-row .h2m-list-actions {
    grid-column: 2;
}

.h2m-event-off .h2m-list-main > .fw-semibold {
    color: var(--h2m-muted);
    text-decoration: line-through;
}

/* Bank and cash: the account whose book is open below. */
.h2m-card-on {
    border-color: var(--h2m-blue);
    box-shadow: 0 0 0 2px rgba(29, 95, 168, 0.25);
}

/* The flat picker: a box to type in, with the few flats that match listed under it. */
.h2m-pick {
    position: relative;
}

.h2m-pick-list {
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    right: 0;
    margin: 4px 0 0;
    padding: 4px;
    list-style: none;
    max-height: 26rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--h2m-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(14, 42, 71, 0.14);
}

.h2m-pick-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
}

    .h2m-pick-option.on, .h2m-pick-option:hover {
        background: #EEF3F9;
    }

.h2m-pick-more {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--h2m-muted);
}

/* The search box and the pages above a long list (ListTools). */
.h2m-list-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

    .h2m-list-tools input {
        max-width: 22rem;
    }

.h2m-list-pages {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}
