@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600&family=Space+Grotesk:wght@400;600&display=swap');

:root {
    --bg: #f4f0e7;
    --bg-accent: #e9e1d2;
    --ink: #1f1f1f;
    --muted: #6b6460;
    --accent: #0f766e;
    --accent-strong: #0a5c56;
    --warn: #b45309;
    --danger: #9f1239;
    --card: #ffffff;
    --border: #e4ddd3;
    --shadow: 0 16px 40px rgba(31, 31, 31, 0.08);
    --button-height-desktop: 2.75rem;
    --button-height-mobile: 3.125rem;
    --button-icon-size-desktop: 2.5rem;
    --button-icon-size-mobile: 3.125rem;
    --app-font-family-body: 'Space Grotesk', 'Segoe UI', sans-serif;
    --app-font-family-heading: 'Fraunces', 'Georgia', serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--app-font-family-body);
    color: var(--ink);
    background: radial-gradient(circle at top left, #fdfbf7 0%, var(--bg) 45%, #efe5d6 100%);
}

h1, h2, h3 {
    font-family: var(--app-font-family-heading);
    margin: 0 0 0.5rem 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(244, 240, 231, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.preview-mode-bar {
    width: 100%;
    background: var(--bg-accent);
    border-bottom: 1px solid var(--border);
}

.preview-mode-bar-inner {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
}

.preview-mode-text {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ink);
}

.preview-mode-menu {
    display: inline-flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.preview-mode-menu a {
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    padding: 0.24rem 0.62rem;
}

.preview-mode-stop-form {
    margin-left: auto;
}

.preview-mode-stop-form .button {
    min-height: 2.2rem;
    padding: 0.45rem 0.9rem;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.brand {
    font-family: var(--app-font-family-heading);
    font-size: 1.4rem;
    letter-spacing: 0.02em;
}

.brand-link {
    display: inline-flex;
    align-items: center;
}

.brand-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
}

.brand-custom-logo {
    max-height: 48px;
    max-width: 240px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.brand-sub {
    font-size: 0.78rem;
    line-height: 1.1;
    opacity: 0.85;
}

.nav {
    display: flex;
    gap: 1rem;
    font-size: 0.95rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.nav a:not(.button) {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
}

.nav a:not(.button):hover {
    background: var(--bg-accent);
}

.nav a:not(.button):focus-visible {
    background: var(--bg-accent);
    outline: 2px solid rgba(15, 118, 110, 0.35);
    outline-offset: 1px;
}

.nav .muted {
    color: var(--muted);
}

.header-inner .nav-toggle {
    display: none;
    align-items: center;
    min-height: 2.5rem;
    border-radius: 12px;
    padding: 0.55rem 0.9rem;
    gap: 0.55rem;
}

.nav-toggle-text {
    font-size: 0.92rem;
}

.nav-toggle-icon {
    display: inline-flex;
    flex-direction: column;
    gap: 0.22rem;
    justify-content: center;
    width: 1.05rem;
}

.nav-toggle-line {
    display: block;
    width: 1.05rem;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform-origin: center;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-line:nth-child(1) {
    transform: translateY(0.38rem) rotate(45deg);
}

.nav-toggle[aria-expanded='true'] .nav-toggle-line:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-line:nth-child(3) {
    transform: translateY(-0.38rem) rotate(-45deg);
}

.main {
    padding: 2rem 0 4rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card + .card {
    margin-top: 1.5rem;
}

.two-factor-manual-key-card {
    margin-bottom: 1.5rem;
}

.two-factor-code {
    display: block;
    margin-top: 0.35rem;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: 0.88rem;
    line-height: 1.45;
}

.hero {
    display: grid;
    gap: 1rem;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    min-height: var(--button-height-desktop);
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    text-decoration: none;
}

.button:hover,
button:hover {
    background: var(--accent-strong);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.2);
}

.button:disabled,
button:disabled,
.button[aria-disabled='true'] {
    background: #d6cec1;
    color: #7a736a;
    border-color: #d6cec1;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

.button:disabled:hover,
button:disabled:hover,
.button[aria-disabled='true']:hover {
    background: #d6cec1;
    box-shadow: none;
    transform: none;
}

.button[aria-disabled='true'] {
    pointer-events: none;
}

.button.secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--border);
}

.button.warn {
    background: var(--warn);
}

.button.danger {
    background: var(--danger);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.icon-button {
    width: var(--button-icon-size-desktop);
    height: var(--button-icon-size-desktop);
    padding: 0;
    border-radius: 14px;
}

.icon-button svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.budget-page-layout.budget-page {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    align-items: start;
}

.budget-page-layout > .card {
    margin: 0;
    min-width: 0;
}

.budget-page > .card + .card {
    margin-top: 0;
}

.budget-page-layout .budget-shared-overview {
    grid-column: 1 / -1;
}

.budget-page .actions {
    margin-top: 0;
    align-items: center;
}

.budget-page .actions form {
    margin: 0;
}

.budget-page .form-grid > * {
    min-width: 0;
}

.budget-page .table-wrap {
    max-width: 100%;
}

.budget-page .badge {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.budget-share-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
    align-items: center;
}

.budget-share-form-page {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    align-items: stretch;
    margin-top: 1rem;
}

.budget-share-form input,
.budget-share-form-page input {
    min-width: 0;
}

.budget-share-form .button,
.budget-share-form-page button {
    padding: 0.55rem 0.9rem;
}

.budget-share-form-page button {
    width: 100%;
}

.budget-share-links {
    display: grid;
    gap: 0.2rem;
    font-size: 0.88rem;
}

.budget-share-links a {
    color: var(--accent);
    text-decoration: underline;
}

.budget-share-page-grid {
    margin-top: 1.5rem;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.budget-share-page-grid h2 {
    margin-bottom: 0.75rem;
}

.budget-share-page-grid .notice {
    margin: 0;
}

.budget-share-email-list {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.budget-share-revoke-button {
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
}

.budget-share-actions {
    display: grid;
    gap: 0.45rem;
}

.budget-share-action-item {
    display: inline-flex;
    margin: 0;
}

.budget-shared-overview {
    margin-top: 0;
}

.invite-section-title {
    font-weight: 600;
    margin: 0 0 0.45rem;
}

.invite-page,
.invite-page .card,
.invite-page .form-grid > *,
.invite-page .invite-contact-row > * {
    min-width: 0;
}

.invite-page .table-wrap {
    max-width: 100%;
}

.invite-overview-table {
    min-width: 860px;
}

.invite-overview-table th,
.invite-overview-table td {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.invite-overview-table th:nth-child(1),
.invite-overview-table td:nth-child(1) {
    min-width: 14rem;
}

.invite-overview-table th:nth-child(4),
.invite-overview-table td:nth-child(4) {
    min-width: 10.5rem;
}

.invite-overview-table th:nth-child(6),
.invite-overview-table td:nth-child(6),
.invite-overview-table th:nth-child(7),
.invite-overview-table td:nth-child(7) {
    white-space: nowrap;
}

.invite-budget-list,
.invite-permission-list {
    display: grid;
    gap: 0.45rem;
}

.invite-contact-list {
    display: grid;
    gap: 0.6rem;
}

.invite-contact-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
    gap: 0.6rem;
    align-items: end;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.invite-contact-row-with-child,
.invite-contact-row-with-client {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(180px, 0.95fr) auto;
}

.invite-contact-row-with-child.invite-contact-row-with-client {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(170px, 0.85fr) minmax(170px, 0.85fr) auto;
}

.invite-contact-row label {
    margin-bottom: 0.3rem;
}

.invite-contact-actions {
    margin-top: 0.6rem;
}

.invite-contact-role-column {
    display: grid;
    align-items: center;
}

.invite-contact-remove {
    white-space: nowrap;
}

.invite-contact-add {
    white-space: nowrap;
}

.invite-permission-matrix-wrap .table {
    min-width: 680px;
}

.invite-permission-matrix.table {
    border-collapse: separate;
    border-spacing: 0 0.6rem;
}

.invite-permission-matrix th,
.invite-permission-matrix td {
    vertical-align: top;
}

.invite-permission-matrix thead th {
    border-bottom: 1px solid var(--border);
}

.invite-permission-matrix tbody td {
    background: #fff;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
}

.invite-permission-matrix tbody td:first-child {
    border-left: 1px solid var(--border);
    border-radius: 12px 0 0 12px;
}

.invite-permission-matrix tbody td:last-child {
    border-right: 1px solid var(--border);
    border-radius: 0 12px 12px 0;
}

.invite-permission-matrix th:last-child,
.invite-permission-matrix td:last-child {
    text-align: center;
}

.invite-matrix-budget-name {
    font-weight: 600;
}

.invite-matrix-toggle {
    margin: 0;
    min-width: 0;
    width: 100%;
}

.invite-matrix-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
}

.invite-matrix-permission-item {
    margin: 0;
}

.invite-budget-item {
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 500;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.invite-toggle-item {
    margin: 0;
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    column-gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.invite-toggle-item input[type="radio"],
.invite-toggle-item input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.invite-toggle-switch {
    width: 2.3rem;
    height: 1.35rem;
    border-radius: 999px;
    background: #c8c1b4;
    position: relative;
    transition: background-color 0.2s ease;
}

.invite-toggle-switch::after {
    content: '';
    position: absolute;
    left: 0.15rem;
    top: 0.15rem;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.invite-toggle-label {
    font-weight: 500;
}

.invite-toggle-state {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: lowercase;
}

.invite-toggle-state-on {
    display: none;
}

.invite-toggle-item input:checked + .invite-toggle-switch {
    background: var(--accent);
}

.invite-toggle-item input:checked + .invite-toggle-switch::after {
    transform: translateX(0.95rem);
}

.invite-toggle-item input:checked ~ .invite-toggle-state .invite-toggle-state-on {
    display: inline;
}

.invite-toggle-item input:checked ~ .invite-toggle-state .invite-toggle-state-off {
    display: none;
}

.invite-toggle-item.is-disabled {
    cursor: not-allowed;
    background: #f5f2ec;
    border-color: #d6cec1;
}

.invite-toggle-item input:disabled + .invite-toggle-switch,
.invite-toggle-item.is-disabled .invite-toggle-switch {
    background: #d6cec1;
}

.invite-toggle-item input:disabled:checked + .invite-toggle-switch,
.invite-toggle-item.is-disabled input:checked + .invite-toggle-switch {
    background: #93b6b1;
}

.invite-toggle-item input:disabled + .invite-toggle-switch::after,
.invite-toggle-item.is-disabled .invite-toggle-switch::after {
    background: #eee9df;
    box-shadow: none;
}

.invite-toggle-item input:disabled ~ .invite-toggle-label,
.invite-toggle-item.is-disabled .invite-toggle-label {
    color: #8b847a;
}

.invite-toggle-item input:disabled ~ .invite-toggle-state,
.invite-toggle-item.is-disabled .invite-toggle-state {
    color: #9a9388;
}

.invite-toggle-item input:disabled:focus-visible + .invite-toggle-switch {
    outline: none;
}

.invite-toggle-item input:focus-visible + .invite-toggle-switch {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.4rem;
}

input, select {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 1rem;
    background: #fff;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 0.4rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-weight: 600;
    background: #e8f7f5;
    color: #0f5132;
    border: 1px solid #cdebe6;
}

.flash-error {
    background: #fde8e8;
    color: #842029;
    border-color: #f5c2c7;
}

.flash-success {
    background: #e8f7f5;
    color: #0f5132;
    border-color: #cdebe6;
}

.grid-2 {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

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

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap .table {
    min-width: 520px;
}

.table th,
.table td {
    text-align: left;
    padding: 0.6rem 0.4rem;
    border-bottom: 1px solid var(--border);
}

.badge {
    display: inline-flex;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--bg-accent);
    font-size: 0.85rem;
    color: var(--muted);
}

.notice {
    color: var(--muted);
    font-size: 0.95rem;
}

.legal-card {
    max-width: 920px;
    margin: 0 auto;
}

.legal-meta {
    margin: 0 0 0.4rem;
}

.legal-content {
    display: grid;
    gap: 0.85rem;
}

.legal-content p {
    margin: 0;
    line-height: 1.6;
}

.legal-content a,
.legal-footer a {
    color: var(--accent);
    text-decoration: underline;
}

.legal-footer {
    margin-top: 1rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.legal-footer p {
    margin: 0.2rem 0 0;
}

.actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.billing-subscription-actions {
    display: grid;
    gap: 0.45rem;
    align-items: start;
}

.billing-plan-info-link {
    text-decoration: underline;
    width: fit-content;
}

.billing-plan-actions {
    margin-top: 1rem;
}

.billing-plan-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.billing-plan-card {
    display: grid;
    gap: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    background: #fff;
    scroll-margin-top: 6rem;
}

.billing-plan-meta {
    display: grid;
    gap: 0.3rem;
    font-size: 0.94rem;
}

.billing-plan-section-title {
    margin: 0 0 0.4rem;
    color: var(--muted);
    font-weight: 600;
}

.billing-plan-list {
    margin: 0;
    padding-left: 1.15rem;
    display: grid;
    gap: 0.35rem;
}

.auth-separator {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 1rem;
}

.auth-separator hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 0;
}

.auth-separator span {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.social-login-grid {
    display: grid;
    gap: 0.45rem;
    grid-template-columns: repeat(4, var(--button-icon-size-desktop));
    justify-content: center;
}

.social-login-icon-button {
    width: var(--button-icon-size-desktop);
    height: var(--button-icon-size-desktop);
    padding: 0;
    border-radius: 14px;
    justify-self: start;
}

.social-login-icon-button svg {
    display: block;
    width: 1.3rem;
    height: 1.3rem;
}

.whitelabel-theme-list {
    display: grid;
    gap: 1rem;
}

.whitelabel-theme-form {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
}

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

.whitelabel-color-grid label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.whitelabel-color-grid input[type='color'] {
    width: 100%;
    min-height: 2.2rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    padding: 0.2rem;
}

.whitelabel-target-box {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 0.75rem;
}

.whitelabel-target-list {
    display: grid;
    gap: 0.35rem;
}

.atom-lock-prefix {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.atom-lock-icon {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.atom-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.atom-icon-wrap svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.is-locked-atom {
    text-decoration: none;
}

@media (max-width: 720px) {
    .header-inner {
        align-items: center;
        gap: 0.6rem;
        flex-wrap: wrap;
    }

    .brand-link {
        min-width: 0;
        max-width: calc(100% - 6rem);
    }

    .js .header-inner .nav-toggle {
        display: inline-flex;
        margin-left: auto;
        flex: 0 0 auto;
    }

    .nav {
        width: 100%;
        gap: 0.3rem;
        flex-direction: column;
        align-items: stretch;
    }

    .no-js .nav,
    .js .nav.is-open {
        background: rgba(255, 255, 255, 0.94);
        border: 1px solid var(--border);
        border-radius: 16px;
        box-shadow: var(--shadow);
        margin-top: 0.15rem;
        padding: 0.45rem;
    }

    .js .nav {
        margin-top: 0;
        padding: 0;
        border: 1px solid transparent;
        box-shadow: none;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-0.4rem);
        transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.25s;
    }

    .js .nav.is-open {
        max-height: 35rem;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
        transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
    }

    .nav a:not(.button),
    .nav .button {
        width: 100%;
        justify-content: flex-start;
    }

    .nav a:not(.button) {
        min-height: var(--button-height-mobile);
        padding: 0.65rem 0.75rem;
        border-radius: 12px;
    }

    .nav .button {
        border-radius: 12px;
        min-height: var(--button-height-mobile);
        padding: 0.65rem 0.95rem;
    }

    .nav .button:hover {
        transform: none;
    }

    .preview-mode-bar-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .preview-mode-stop-form {
        margin-left: 0;
        width: 100%;
    }

    .preview-mode-stop-form .button {
        width: 100%;
    }

    .card {
        padding: 1.25rem;
        border-radius: 18px;
    }

    .button,
    button {
        min-height: var(--button-height-mobile);
    }

    .brand-custom-logo {
        max-height: 40px;
        max-width: 180px;
    }

    .whitelabel-color-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .actions .button,
    .actions button {
        width: 100%;
    }

    .icon-button,
    .social-login-icon-button {
        width: var(--button-icon-size-mobile);
        height: var(--button-icon-size-mobile);
    }

    .budget-page .actions {
        flex-direction: row;
        align-items: center;
    }

    .budget-page .actions .button,
    .budget-page .actions button {
        width: var(--button-icon-size-mobile);
    }

    .budget-share-form {
        grid-template-columns: 1fr;
    }

    .budget-share-form .button {
        width: 100%;
    }

    .invite-contact-row {
        grid-template-columns: 1fr;
    }

    .invite-contact-remove {
        width: 100%;
    }

    .invite-contact-actions .button {
        width: 100%;
    }

    .invite-matrix-permissions {
        flex-direction: column;
        align-items: stretch;
    }

    .invite-matrix-permission-item {
        width: 100%;
    }

    .invite-permission-matrix-wrap .table {
        min-width: 0;
    }

    .invite-permission-matrix.table {
        display: block;
        border-spacing: 0;
    }

    .invite-permission-matrix thead {
        display: none;
    }

    .invite-permission-matrix tbody {
        display: grid;
        gap: 0.75rem;
    }

    .invite-permission-matrix tbody tr {
        display: grid;
        gap: 0.65rem;
        padding: 0.75rem;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: #fff;
    }

    .invite-permission-matrix tbody td {
        display: block;
        padding: 0;
        border: 0;
        background: transparent;
    }

    .invite-permission-matrix tbody td:first-child,
    .invite-permission-matrix tbody td:last-child {
        border: 0;
        border-radius: 0;
    }

    .table-wrap .table {
        min-width: 420px;
    }

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

    .social-login-grid {
        grid-template-columns: repeat(4, minmax(0, var(--button-icon-size-mobile)));
        justify-content: center;
    }
}

@media (max-width: 900px) {
    .budget-page-layout.budget-page {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .main {
        padding: 1.5rem 0 3rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    input, select, button, .button {
        font-size: 0.98rem;
    }

    .form-grid > button {
        width: 100%;
    }
}
