:root {
    color-scheme: light;
    font-family: "Inter", "Segoe UI", sans-serif;
    line-height: 1.5;
    --surface: rgba(255, 255, 255, 0.9);
    --border: rgba(0, 0, 0, 0.1);
    --accent: #2f6fed;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, #eef2ff 0%, #f9fafb 100%);
    color: #111827;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

header {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.header-main {
    flex: 1 1 320px;
}

header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.9rem;
}

header p {
    margin: 0;
    max-width: 720px;
}

.share-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.share-actions button {
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(47, 111, 237, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.share-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(47, 111, 237, 0.25);
}

.share-actions button:active {
    transform: translateY(0);
    box-shadow: 0 8px 16px rgba(47, 111, 237, 0.2);
}

#share-feedback {
    font-size: 0.85rem;
    color: #1f2937;
}

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

.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

form section {
    display: grid;
    gap: 0.75rem;
}

form h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #1f2937;
}

label {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: #374151;
    gap: 0.25rem;
}

input[type="number"] {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.85);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="number"]:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

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

th {
    background-color: rgba(47, 111, 237, 0.1);
    font-weight: 600;
}

tbody tr:nth-child(odd) {
    background-color: rgba(15, 23, 42, 0.02);
}

.break-even-table th:first-child {
    position: sticky;
    left: 0;
    background-color: rgba(255, 255, 255, 0.9);
}

.diagonal {
    text-align: center;
    color: #9ca3af;
}

.status-ahead {
    color: #059669;
    font-weight: 500;
}

.status-payback {
    color: #1f2937;
    font-weight: 600;
}

.status-never {
    color: #b91c1c;
    font-weight: 500;
}

.status-unknown {
    color: #6b7280;
}

.summary {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.4rem;
}

.summary li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.error {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background-color: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
}

.loading {
    font-style: italic;
    color: #4b5563;
}

.break-even-note {
    font-size: 0.85rem;
    color: #4b5563;
    margin-top: 0.75rem;
}

@media (max-width: 640px) {
    header {
        flex-direction: column;
        margin-bottom: 1.5rem;
    }

    .share-actions {
        width: 100%;
    }

    .share-actions button {
        width: 100%;
        text-align: center;
    }

    main {
        padding: 1rem;
    }

    .card {
        padding: 1.25rem;
    }
}
