body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at 30% 20%, #ffece0, #f6fbff 45%, #e6f1ff 80%);
    color: #152234;
    min-height: 100vh;
    position: relative;
}

.bg-shape {
    position: fixed;
    width: 420px;
    height: 420px;
    filter: blur(90px);
    opacity: 0.45;
    z-index: -2;
}
.bg-one {
    background: #ff6f61;
    top: -120px;
    left: -80px;
}
.bg-two {
    background: #2bd899;
    bottom: -150px;
    right: -80px;
}
.bg-dots {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.35) 1px, transparent 0);
    background-size: 24px 24px;
    opacity: 0.4;
    z-index: -1;
}

.site-header {
    background: linear-gradient(120deg, #0d2f2a, #0f4c81);
    color: #fff;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 20;
    transition: transform 0.25s ease;
}

.hide-header {
    transform: translateY(-120%);
}

.nav-bar {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffb347, #ff6f61);
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    box-shadow: 0 6px 14px rgba(0,0,0,0.2);
}

.brand {
    font-weight: 800;
    letter-spacing: 0.5px;
}
.brand-sub {
    font-size: 0.9rem;
    opacity: 0.82;
    margin-top: -2px;
}

.nav-links a {
    color: #f7f7f7;
    text-decoration: none;
    margin-left: 1rem;
    font-weight: 700;
}

.nav-links a:hover {
    text-decoration: underline;
}

.user-pill {
    background: rgba(255,255,255,0.15);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.95rem;
    border: 1px solid rgba(255,255,255,0.2);
}

a {
    color: #0f6c4f;
}

main.page-shell {
    padding: 1.4rem;
    max-width: 1100px;
    margin: 0 auto;
}

.flash {
    padding: 0.85rem 1.1rem;
    margin-bottom: 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}

.flash-success { background: #dff6e6; }
.flash-danger  { background: #ffe0e0; }
.flash-warning { background: #fff6d9; }
.flash-info    { background: #e6f3ff; }

form {
    margin: 0.5rem 0 1.1rem;
}

label {
    font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: 0.65rem 0.7rem;
    margin: 0.25rem 0 0.7rem;
    box-sizing: border-box;
    border: 1px solid #c9d3de;
    border-radius: 10px;
    background: rgba(255,255,255,0.92);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #0f6c4f;
    box-shadow: 0 0 0 3px rgba(15,108,79,0.15);
}

button {
    padding: 0.55rem 1rem;
    border: none;
    background: linear-gradient(135deg, #ff4b4b, #ff7f6f);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 8px 18px rgba(255, 75, 75, 0.35);
}

button:hover {
    filter: brightness(1.05);
}

.button-link {
    display: inline-block;
    background: linear-gradient(135deg, #0f8b4c, #16a36b);
    color: #fff;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    border: none;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(22, 163, 107, 0.28);
}

.button-link:hover {
    filter: brightness(1.05);
}

/* Tables on import review page */

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* prevents columns from going crazy */
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    border: 1px solid #d5dbe3;
    padding: 6px;
    vertical-align: top;
    word-wrap: break-word;
}

.import-table input[type="text"] {
    width: 100%;
    box-sizing: border-box;
}

.small-input {
    max-width: 120px;
}

.ai-warning {
    font-size: 0.75rem;
    color: #b00;
    margin-top: 2px;
}

.loading-overlay {
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-box {
    background: #ffffff;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 320px;
}

.spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 4px solid #ccc;
    border-top-color: #007bff;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 0.75rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.full-height-table {
    margin-top: 0.5rem;
}

.exchange-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.exchange-card {
    background: rgba(255,255,255,0.9);
    border: 1px solid #d5d9de;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.07);
    position: relative;
    overflow: hidden;
}

.exchange-card h3 {
    margin: 0 0 0.25rem;
    font-family: "Playfair Display", serif;
    font-size: 1.25rem;
}

.exchange-slug {
    margin: 0 0 0.75rem;
    color: #4c5a68;
    font-size: 0.9rem;
}

.exchange-switcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.back-link {
    text-decoration: none;
    color: #234;
    font-weight: 600;
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid #234;
    color: #234;
    background: #eef2f7;
    font-size: 0.9rem;
}

.pill.active {
    background: #234;
    color: #fff;
}

.exchange-meta {
    background: rgba(255,255,255,0.92);
    border: 1px solid #d5d9de;
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

.join-url {
    width: 100%;
    max-width: 540px;
    margin: 0.3rem 0;
    border-radius: 10px;
}

.exchange-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.back-row {
    margin-bottom: 0.5rem;
}

.back-link {
    text-decoration: none;
    color: #0c7a43;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.item-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.item-card {
    background: #fff;
    border: 1px solid #d5dbe3;
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.claim-row {
    margin-top: 0.4rem;
}

.copy-btn {
    margin-left: 0.4rem;
    padding: 0.35rem 0.7rem;
    background: #0c7a43;
    border-radius: 8px;
}

.muted {
    color: #6a7585;
    display: block;
    margin-top: 0.15rem;
}

.panel {
    background: rgba(255,255,255,0.94);
    border: 1px solid #d5dbe3;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 14px 30px rgba(0,0,0,0.06);
}

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

.items-layout {
    grid-template-columns: 1.8fr 1fr;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

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

.item-card.compact {
    padding: 0.65rem 0.75rem;
}

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

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 720px) {
    .nav-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
    .nav-links {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }
    .nav-links a {
        margin-left: 0;
    }
    .user-pill {
        align-self: flex-start;
    }
    .family-panel {
        order: -1;
    }

    .hide-header {
        transform: translateY(-100%);
    }
}

.ghost-button {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    border: 1px solid #d5dbe3;
    background: rgba(255,255,255,0.7);
    color: #0f6c4f;
    text-decoration: none;
    font-weight: 700;
}

.ghost-button:hover {
    background: #eaf4ef;
}

/* Mobile-friendly import review table */
.review-table {
    width: 100%;
    border-collapse: collapse;
}

@media (max-width: 720px) {
    .table-stack tbody tr {
        display: block;
        border: 1px solid #d5dbe3;
        border-radius: 10px;
        padding: 0.75rem;
        margin-bottom: 0.65rem;
        background: #fff;
        box-shadow: 0 6px 14px rgba(0,0,0,0.05);
    }
    .table-stack thead {
        display: none;
    }
    .table-stack td {
        display: block;
        width: 100% !important;
        border: none;
        padding: 0.35rem 0;
    }
    .table-stack td::before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        margin-bottom: 0.15rem;
        color: #152234;
    }
}

.exchange-meta {
    background: #fff;
    border: 1px solid #d5d9de;
    border-radius: 6px;
    padding: 0.75rem;
    margin: 1rem 0;
}

.join-url {
    width: 100%;
    max-width: 540px;
    margin: 0.3rem 0;
}

.exchange-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

