:root {
    --bg: #f0f2f5;
    --surface: #ffffff;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --error: #ef4444;
    --success: #10b981;
    --border: #e5e7eb;
    --receipt-bg: #fffdf8; 
}

* { box-sizing: border-box; font-family: 'Roboto', -apple-system, sans-serif; }
body { margin: 0; background: var(--bg); color: var(--text-main); padding-bottom: 40px; }

.app-bar {
    background: var(--primary);
    color: white;
    padding: 16px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.screen { padding: 16px; max-width: 600px; margin: 0 auto; }

.card {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 12px; }
.price-row { display: flex; gap: 10px; }
.price-row input { flex: 1; }
.price-row button { width: 100px; }

input {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: 0.2s;
}
input:focus { border-color: var(--primary); }

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-outline { background: transparent; color: var(--error); border: 2px solid var(--error); }
.bg-success { background: var(--success); }
.bg-primary { background: var(--primary); }

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.receipt-card { background: var(--receipt-bg); border-top: 6px solid var(--primary); border-radius: 8px; }
.receipt-header { text-align: center; margin-bottom: 20px; }
.receipt-header h3 { margin: 0 0 4px 0; font-size: 22px; text-transform: uppercase; letter-spacing: 1px; }
.receipt-header p { margin: 0; color: var(--text-muted); font-size: 13px; }

.receipt-list { list-style: none; padding: 0; margin: 0; }
.receipt-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px dashed #ccc; font-size: 16px;
}
.item-info { flex: 1; word-break: break-word; padding-right: 10px; }
.item-price { font-weight: bold; font-family: monospace; font-size: 18px; }
.delete-btn { background: none; border: none; color: var(--error); font-size: 18px; padding: 0 0 0 12px; cursor: pointer; }

.receipt-total { display: flex; justify-content: space-between; padding-top: 16px; margin-top: 8px; font-size: 22px; font-weight: 900; }
.watermark { text-align: center; font-size: 11px; color: #999; margin-top: 24px; font-style: italic; }
.footer-date { margin-top: 8px; }

/* Modal Styles for Mobile Share Fallback */
.modal {
    display: none; position: fixed; z-index: 200; left: 0; top: 0;
    width: 100%; height: 100%; background-color: rgba(0,0,0,0.85);
}
.modal-content {
    background-color: var(--surface); margin: 15% auto; padding: 20px;
    border-radius: 12px; width: 90%; max-width: 400px; position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
.close-btn {
    position: absolute; right: 15px; top: 10px; font-size: 28px;
    font-weight: bold; color: var(--text-muted); cursor: pointer;
}
#preview-image { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); }
