html,
body,
#app {
    min-height: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f7fb;
    color: #111827;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    overflow-wrap: anywhere;
}

.language-menu-popover {
    margin-top: 0.375rem;
}

.language-menu-list {
    min-width: 10rem;
    padding: 0.375rem;
}

.language-menu-item {
    min-height: 2.5rem;
    margin: 0.125rem 0;
    border-radius: 0.375rem;
}

.language-menu-item:hover,
.language-menu-item:focus-visible {
    background: #f1f5f9;
}

.language-menu-item-current {
    color: #1d4ed8;
    background: #eff6ff;
}

.language-menu-option {
    display: grid;
    grid-template-columns: 1.125rem minmax(0, 1fr) 1.125rem;
    align-items: center;
    width: 100%;
    gap: 0.625rem;
}

.language-current-indicator {
    color: #2563eb;
}

.page-heading,
.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.page-title,
.section-title {
    font-weight: 800;
    letter-spacing: 0;
}

.workspace-card,
.auth-card,
.metric-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.94);
}

.workspace-card {
    padding: 1.25rem;
}

.payment-confirmation-card {
    width: min(100%, 42rem);
    margin: 4rem auto;
}

.auth-card {
    width: min(100%, 30rem);
    padding: 1.5rem;
}

.metric-card {
    min-height: 7rem;
    padding: 1rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0 0.875rem;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    color: #1d4ed8;
    background: #eff6ff;
    font-weight: 700;
    white-space: nowrap;
}

.file-drop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 6rem;
    padding: 1rem;
    border: 1px dashed #93c5fd;
    border-radius: 0.5rem;
    color: #1d4ed8;
    background: #eff6ff;
    cursor: pointer;
    text-align: center;
    font-weight: 700;
}

.file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.shares-overview {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.create-share-action {
    display: flex;
    justify-content: center;
    padding: 0.25rem 0 0.5rem;
}

.create-share-action .mud-button-root {
    min-width: 11rem;
}

.shares-card {
    margin-top: 0;
}

.shares-table .mud-table-cell {
    vertical-align: top;
}

.invoices-table .mud-table-cell {
    vertical-align: middle;
}

.row-title,
.break-anywhere {
    overflow-wrap: anywhere;
}

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

.file-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(17, 24, 39, 0.42);
}

.file-modal {
    width: min(100%, 56rem);
    max-height: min(42rem, calc(100vh - 2rem));
    overflow: auto;
    padding: 1.25rem;
    border-radius: 0.5rem;
}

.file-modal-summary,
.files-table .mud-table-cell {
    min-width: 0;
}

.files-table .mud-table-cell {
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.details-grid > div {
    min-width: 0;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #f8fafc;
}

.profile-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.accent-card {
    border-color: #ccfbf1;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
}

.danger-zone {
    border-color: #fecaca;
    background: #fffafa;
}

.plan-option-card {
    height: 100%;
}

.plan-option-card.current-plan {
    border-color: #93c5fd;
    background: #f8fbff;
}

.plan-option-card > .mud-stack {
    height: 100%;
}

.plan-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
}

.plan-feature-list {
    display: grid;
    gap: 0.875rem;
}

.plan-feature {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr);
    align-items: start;
    gap: 0.75rem;
}

.plan-feature .mud-icon-root {
    margin-top: 0.125rem;
}

.plan-option-card .mud-button-root {
    margin-top: auto;
}

.loading-state {
    display: grid;
    place-items: center;
    min-height: 18rem;
}

.loading-progress {
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem;
}

.loading-progress circle {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
}

.loading-progress circle:last-child {
    stroke: #2563eb;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transform: rotate(-90deg);
}

.loading-progress-text {
    color: #667085;
    font-weight: 700;
    text-align: center;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff4c2;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 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;
}

@media (max-width: 720px) {
    .page-heading,
    .section-heading,
    .profile-row {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-card,
    .auth-card,
    .file-modal {
        padding: 1rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .shares-overview {
        gap: 1rem;
    }

    .create-share-action {
        padding: 0;
    }

    .create-share-action .mud-button-root {
        width: 100%;
    }

    .status-pill {
        align-self: flex-start;
    }

    .plan-card-header {
        gap: 0.75rem;
    }
}
