:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --text: #1b2430;
    --muted: #667085;
    --primary: #153e75;
    --primary-light: #2a5ca8;
    --border: #e2e6ee;
    --success: #1a8f5e;
    --danger: #c0392b;
    --radius: 14px;
    --nav-height: 64px;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
}

#app-root {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

main {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px calc(var(--nav-height) + 24px);
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
}

h1 {
    font-size: 1.4rem;
    margin: 4px 0 16px;
}

h2 {
    font-size: 1.05rem;
    margin: 20px 0 8px;
    color: var(--primary);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
}

.summary-card {
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 18px;
}

.summary-card .value {
    font-size: 1.8rem;
    font-weight: 700;
}

.summary-card .label {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* Checklist */
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 1px;
    accent-color: var(--primary);
}

.checklist-item label {
    flex: 1;
    line-height: 1.4;
}

.checklist-item.checked label {
    color: var(--muted);
    text-decoration: line-through;
}

.progress-bar {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: white;
    border-radius: 4px;
    transition: width 0.2s ease;
}

/* Budget */
.budget-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}

.budget-row:last-child {
    border-bottom: none;
}

.budget-row .amount {
    font-weight: 600;
    white-space: nowrap;
}

.budget-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--surface);
    color: var(--text);
}

.margin-positive {
    color: var(--success);
}

.margin-negative {
    color: var(--danger);
}

/* Vocab flashcards */
.flashcard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    cursor: pointer;
    user-select: none;
}

.flashcard .word {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.flashcard .category {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.flashcard .translation {
    font-size: 1.4rem;
    margin-top: 10px;
    color: var(--text);
}

.flashcard .hint {
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--muted);
}

.flashcard-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

button {
    font-family: inherit;
    font-size: 0.95rem;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    flex: 1;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-danger {
    background: #fdecea;
    color: var(--danger);
}

.btn-success {
    background: #e7f6ef;
    color: var(--success);
}

/* Bottom nav */
nav.bottom-nav {
    position: sticky;
    bottom: 0;
    display: flex;
    height: var(--nav-height);
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
}

nav.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 500;
}

nav.bottom-nav a .icon {
    font-size: 1.3rem;
}

nav.bottom-nav a.active {
    color: var(--primary);
}
