body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    /* Breathing room before the footer on every page,
       so content never butts directly against it. */
    padding-bottom: 2rem;
}

/* Tool Mode: the buyer's page card on the Get Paid home */
.tool-page-card {
    padding: 18px 20px;
    max-width: 560px;
}

.tool-page-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tool-page-card__header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.tool-page-card__chip {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    white-space: nowrap;
}

.tool-page-card__url {
    font-family: "Consolas", "Monaco", "Andale Mono", monospace;
    font-size: 0.85rem;
    margin: 10px 0 16px;
    overflow-wrap: anywhere;
}

.tool-page-card__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Tool Mode: main's content grid stretches auto rows into the viewport slack (main is flex: 1),
   inflating the page header and every block. Top-align so slack stays at the foot of the page. */
main:has(.tool-home) {
    align-content: start;
    padding-top: 28px;
}

/* Tool Mode: page rhythm — cards hug their content instead of stretching to the tallest in the row */
.tool-home .dashboard-grid {
    align-items: start;
    gap: 18px;
    padding: 26px 0 10px;
}

/* Tool Mode: money stats and recent payments on the Get Paid home */
.tool-home-subline {
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.4;
    margin: 0 0 2px;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin: 22px 0 0;
}

.stat-card {
    padding: 12px 16px;
}

.stat-card__value {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.stat-card__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--md-sys-color-outline);
}

/* Healthy-metric accent. No Material success token exists; pinned dark green for contrast on surface. */
.stat-positive {
    color: #146c2e;
}

.data-table-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--md-sys-color-outline);
    padding: 8px 10px 8px 0;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.data-table td {
    padding: 9px 10px 9px 0;
    border-bottom: 1px solid #f0f0f2;
    font-variant-numeric: tabular-nums;
}

.data-table th:last-child,
.data-table td:last-child {
    padding-right: 0;
    white-space: nowrap;
}

/* Tool Mode: compact content panel — a color chip and uppercase title over plain rows */
.tool-panel {
    padding: 16px 18px;
}

.tool-panel__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 6px;
}

.tool-panel__chip {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background: var(--md-sys-color-primary-container);
    flex: none;
}

.tool-panel__chip--tertiary {
    background: var(--md-sys-color-tertiary-container);
}

.tool-panel__row {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
}

.tool-panel__row:last-child {
    border-bottom: none;
    padding-bottom: 2px;
}

.tool-panel__row:hover {
    color: var(--md-sys-color-primary);
}

/* Tool Mode: the unlock panel — one upgrade surface at the foot of the tool home */
.unlock-panel {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    margin-top: 20px;
    border-style: dashed;
}

.unlock-panel--primary {
    border-style: solid;
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-primary-container);
}

.unlock-panel__text {
    flex: 1;
}

.unlock-panel__text h2 {
    font-size: 1.05rem;
    margin: 0 0 4px;
}

.unlock-panel__text p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--md-sys-color-on-surface-variant);
}

.unlock-panel .button {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .unlock-panel {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Plan comparison: the tier cards on /admin/subscription/plans. Adopts the shared
   surface-card treatment and the Material tokens so the upgrade grid reads as the
   same product as the rest of the refreshed admin. */
.plan-comparison {
    max-width: 1200px;
    margin: 0 auto;
}

.plan-comparison__header {
    text-align: center;
    margin-bottom: 2rem;
}

/* .text-muted ships from several stylesheets that don't set alignment, and the global
   `body { text-align: left }` was winning the cascade on the subheading — pin it here. */
.plan-comparison__heading {
    margin-bottom: 0.5rem;
    text-align: center;
}

.plan-comparison__subheading {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(var(--plan-count, 3), 1fr);
    gap: 1.5rem;
    align-items: start;
}

.plan-card {
    padding: 1.5rem;
}

.plan-card--current {
    border-width: 2px;
    border-color: var(--md-sys-color-primary, #215fa6);
}

.plan-badge {
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: var(--md-sys-color-primary, #215fa6);
    color: var(--md-sys-color-on-primary, #fff);
    font-size: 0.75rem;
    font-weight: 600;
}

.plan-card__name {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.plan-card__desc {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.plan-price {
    margin-bottom: 0.5rem;
}

.plan-price__amount {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.plan-price__period {
    font-size: 0.875rem;
}

.plan-price__yearly {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.plan-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--md-sys-color-outline-variant, #c4c6cf);
}

.plan-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.plan-row__value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.plan-features__heading {
    font-size: 0.8rem;
    font-style: italic;
    margin: 0 0 0.5rem 0;
}

.plan-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.8rem;
}

.plan-feature__check {
    color: var(--md-sys-color-primary, #215fa6);
    font-weight: 600;
}

.plan-actions {
    margin-top: 1.25rem;
}

.plan-action {
    width: 100%;
    display: block;
    text-align: center;
    text-decoration: none;
}

.plan-action:disabled {
    opacity: 0.6;
    cursor: default;
}
