* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(201, 168, 118, 0.3);
    tap-highlight-color: rgba(201, 168, 118, 0.3);
}

/* Light Theme (Default) */
:root {
    --bg-body: linear-gradient(135deg, #667eea 0%, #2d3561 100%);
    --bg-container: white;
    --bg-input: #f8f9fa;
    --bg-input-focus: white;
    --bg-input-active: #e9ecef;
    --bg-button: white;
    --bg-button-hover: #f0f4ff;
    --bg-button-active: #667eea;
    --bg-people-btn: #667eea;
    --bg-people-btn-hover: #5568d3;
    --bg-results: #f8f9fa;
    --bg-split: #667eea;
    --bg-modal: white;
    --bg-keypad: white;
    --bg-keypad-btn: white;
    --bg-keypad-function: #d0d0d0;
    --bg-keypad-done: #d0d0d0;

    --text-primary: #333;
    --text-secondary: #666;
    --text-label: #333;
    --text-input: #333;
    --text-button: #667eea;
    --text-button-active: white;
    --text-result: #333;
    --text-result-highlight: #667eea;
    --text-split: white;
    --text-display: #333;
    --text-keypad: #333;
    --text-keypad-function: #333;

    --border-input: #eee;
    --border-input-focus: #667eea;
    --border-button: #667eea;
    --border-button-active: #667eea;
    --border-container: transparent;
    --border-divider: #f0f0f0;
    --border-result: #e0e0e0;

    --symbol-color: #999;
    --accent-primary: #667eea;
    --accent-hover: #5568d3;

    --shadow-container: 0 20px 40px rgba(0,0,0,0.1);
    --shadow-modal: 0 20px 40px rgba(0,0,0,0.3);
    --modal-backdrop: rgba(0,0,0,0.5);
}

/* Dark Theme (HP 12C) */
[data-theme="dark"] {
    --bg-body: #1a1a1a;
    --bg-container: #2a2a2a;
    --bg-input: #1a1a1a;
    --bg-input-focus: #1a1a1a;
    --bg-input-active: #0a0a0a;
    --bg-button: #3a3a3a;
    --bg-button-hover: #4a4a4a;
    --bg-button-active: #c9a876;
    --bg-people-btn: #c9a876;
    --bg-people-btn-hover: #d4b586;
    --bg-results: #1a1a1a;
    --bg-split: #c9a876;
    --bg-modal: #2a2a2a;
    --bg-keypad: #000000;
    --bg-keypad-btn: #3a3a3a;
    --bg-keypad-function: #c9a876;
    --bg-keypad-done: #3a3a3a;

    --text-primary: #ffd580;
    --text-secondary: #999;
    --text-label: #b8945f;
    --text-input: #ffd580;
    --text-button: white;
    --text-button-active: #2a2520;
    --text-result: #ffd580;
    --text-result-highlight: #ffd580;
    --text-split: #2a2520;
    --text-display: #ffd580;
    --text-keypad: white;
    --text-keypad-function: #2a2520;

    --border-input: #3a3a3a;
    --border-input-focus: #c9a876;
    --border-button: #3a3a3a;
    --border-button-active: #c9a876;
    --border-container: #3a3a3a;
    --border-divider: #3a3a3a;
    --border-result: #3a3a3a;

    --symbol-color: #b8945f;
    --accent-primary: #c9a876;
    --accent-hover: #d4b586;

    --shadow-container: 0 20px 40px rgba(0,0,0,0.5);
    --shadow-modal: 0 20px 40px rgba(0,0,0,0.5);
    --modal-backdrop: rgba(0,0,0,0.8);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    background: #2a2a2a;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    max-width: 500px;
    margin: 0 auto;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    border: 1px solid #3a3a3a;
}

/* Utility Button */
.btn-utility {
    background: #3a3a3a;
    border: 1px solid #4a4a4a;
    color: #c9a876;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Roboto Mono', monospace;
}

.btn-utility:hover {
    background: #4a4a4a;
    border-color: #c9a876;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px 30px 30px 30px;
    overflow-y: auto;
}

.calculator-card {
    max-width: 100%;
}

/* Input Groups */
.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    color: #b8945f;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 18px;
    color: #b8945f;
    font-size: 24px;
    font-weight: 500;
    pointer-events: none;
}

.percent-symbol {
    position: absolute;
    right: 18px;
    color: #b8945f;
    font-size: 24px;
    font-weight: 500;
    pointer-events: none;
}

input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #3a3a3a;
    border-radius: 10px;
    font-size: 24px;
    font-weight: 500;
    transition: border-color 0.3s;
    background: #1a1a1a;
    color: #ffd580;
    font-family: 'Roboto Mono', monospace;
}

input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #c9a876;
}

.help-text {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

/* Tip Buttons */
.tip-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.tip-btn {
    padding: 12px;
    background: #3a3a3a;
    color: #ffd580;
    border: 2px solid #3a3a3a;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tip-btn:hover {
    background: #4a4a4a;
    border-color: #c9a876;
    color: #ffd580;
}

.tip-btn.active {
    background: #c9a876;
    color: #2a2520;
    border-color: #c9a876;
}

.custom-tip-wrapper {
    margin-top: 10px;
}

.custom-tip-wrapper input {
    padding-left: 45px;
    padding-right: 45px;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Total Bill Toggle Button */
.total-toggle-btn {
    width: 100%;
    padding: 10px 15px;
    background: #1a1a1a;
    border: 2px dashed #3a3a3a;
    border-radius: 10px;
    color: #c9a876;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.total-toggle-btn:hover {
    background: #2a2a2a;
    border-color: #c9a876;
}

.total-toggle-btn:active {
    transform: scale(0.98);
}

/* Total Close Button */
.total-close-btn {
    background: #3a3a3a;
    border: none;
    color: #b8945f;
    font-size: 18px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.total-close-btn:hover {
    background: #4a4a4a;
    color: #c9a876;
}

.total-close-btn:active {
    transform: scale(0.95);
}

.total-bill-group {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* People Selector */
.people-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.people-btn {
    width: 40px;
    height: 40px;
    background: #c9a876;
    color: #2a2520;
    border: none;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.people-btn:hover {
    background: #d4b586;
    transform: translateY(-2px);
}

.people-btn:active {
    transform: translateY(0);
}

.people-selector input {
    width: 50px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #ffd580;
    padding: 10px;
    font-family: 'Roboto Mono', monospace;
}

/* Results */
.results {
    background: #1a1a1a;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    border: 2px solid #3a3a3a;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #3a3a3a;
}

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

.result-label {
    color: #b8945f;
    font-size: 16px;
}

.result-value {
    color: #ffd580;
    font-size: 20px;
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
}

.total-row .result-value {
    color: #ffd580;
}

.split-row {
    background: #c9a876;
    margin: 15px -20px -20px -20px;
    padding: 20px;
    border-radius: 0 0 15px 15px;
}

.split-row .result-label,
.split-row .result-value {
    color: #2a2520;
}

.split-row .result-value {
    font-size: 28px;
}

/* Footer */
.app-footer {
    padding: 15px;
    text-align: center;
    border-top: 2px solid #3a3a3a;
    font-size: 14px;
}

.app-footer a {
    color: #c9a876;
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
    color: #d4b586;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #2a2a2a;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    border: 1px solid #3a3a3a;
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 2px solid #3a3a3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    color: #ffd580;
    font-weight: 400;
    font-size: 22px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #b8945f;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
}

.close-btn:hover {
    background: #3a3a3a;
    color: #c9a876;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-body p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #999;
}

.modal-body a {
    color: #c9a876;
    text-decoration: none;
}

.modal-body a:hover {
    color: #d4b586;
    text-decoration: underline;
}

.modal-body h3 {
    color: #c9a876;
    font-weight: 500;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
}

.modal-body ul {
    margin-left: 20px;
    margin-bottom: 15px;
    color: #999;
}

.modal-body li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.version {
    font-size: 12px;
    color: #666;
    margin-top: 20px !important;
}

.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: flex;
    align-items: center;
    color: #b8945f;
    cursor: pointer;
}

.option-group input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: auto;
    accent-color: #c9a876;
}

/* Toggle Switch */
.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3a3a3a;
    transition: 0.3s;
    border-radius: 28px;
    border: 2px solid #3a3a3a;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: #666;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #c9a876;
    border-color: #c9a876;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
    background-color: #2a2520;
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(201, 168, 118, 0.3);
}

.toggle-slider:hover {
    opacity: 0.9;
}

.option-group input[type="number"],
.option-group input[type="text"] {
    margin-top: 8px;
}

.option-group .input-wrapper {
    position: relative;
}

.option-group input[type="text"] {
    text-align: center;
    padding-left: 15px;
    padding-right: 45px;
    font-size: 18px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.theme-btn {
    padding: 12px;
    background: #3a3a3a;
    color: white;
    border: 2px solid #3a3a3a;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-btn:hover {
    background: #4a4a4a;
    border-color: #c9a876;
}

.theme-btn.active {
    background: #c9a876;
    color: #2a2520;
    border-color: #c9a876;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 2px solid #3a3a3a;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    padding: 20px 25px;
    border-top: 2px solid #3a3a3a;
    flex-shrink: 0;
}

.modal-buttons button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-cancel {
    background: #3a3a3a;
    color: white;
}

.modal-cancel:hover {
    background: #4a4a4a;
    transform: translateY(-2px);
}

.btn-primary {
    padding: 15px 40px;
    background: #c9a876;
    color: #2a2520;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.btn-primary:hover {
    background: #d4b586;
    transform: translateY(-2px);
}

.btn-secondary {
    padding: 15px 40px;
    background: #2a2a2a;
    color: #c9a876;
    border: 2px solid #c9a876;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #3a3a3a;
    transform: translateY(-2px);
}

.btn-danger {
    padding: 15px 40px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .app-container {
        min-height: calc(100vh - 20px);
    }

    .main-content {
        padding: 15px 20px 20px 20px;
    }

    .tip-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .result-value {
        font-size: 18px;
    }

    .split-row .result-value {
        font-size: 24px;
    }
}

/* Numeric Keypad */
.keypad-modal {
    align-items: flex-end;
}

.keypad-content {
    background: #000000;
    width: 100%;
    max-width: 500px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 30px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.keypad-display {
    background: #000000;
    padding: 20px 20px 15px 20px;
    border-radius: 20px 20px 0 0;
}

.keypad-label {
    color: #b8945f;
    font-size: 14px;
    margin-bottom: 5px;
}

.keypad-value {
    color: #ffd580;
    font-size: 36px;
    font-weight: 400;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    overflow-x: auto;
    font-family: 'Roboto Mono', monospace;
}

.keypad-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 15px 15px 20px 15px;
    background: #000000;
}

.keypad-btn {
    background: #3a3a3a;
    border: none;
    padding: 0;
    font-size: 28px;
    font-weight: 400;
    color: white;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 70px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto Mono', monospace;
}

.keypad-btn:active {
    transform: scale(0.95);
    opacity: 0.7;
}

.keypad-clear {
    background: #c9a876;
    color: #2a2520;
    font-weight: 500;
}

.keypad-backspace {
    background: #c9a876;
    color: #2a2520;
    font-size: 24px;
    font-weight: 500;
}

.keypad-done {
    background: #3a3a3a;
    color: white;
    font-weight: 500;
    grid-row: span 2;
}

.enter-text {
    font-size: 18px;
    line-height: 1.3;
    letter-spacing: 0.5px;
    font-family: 'Roboto Mono', monospace;
}

.keypad-zero {
    grid-column: span 2;
}

/* Make money inputs look clickable */
input[readonly] {
    cursor: pointer;
    background: #1a1a1a;
    color: #ffd580;
}

input[readonly]:focus {
    outline: none;
    border-color: #c9a876;
    background: #1a1a1a;
}

input[readonly]:active {
    background: #0a0a0a;
}

/* Save Button */
.save-btn {
    background: #3a3a3a;
    border: 1px solid #4a4a4a;
    color: #c9a876;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Roboto Mono', monospace;
    display: none; /* Hidden by default, shown when there's a calculation */
}

.save-btn:hover {
    background: #4a4a4a;
    border-color: #c9a876;
}

.save-btn:active {
    transform: scale(0.95);
}

/* Save Modal Styles */
.save-summary {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    border: 2px solid #3a3a3a;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: #b8945f;
    border-bottom: 1px solid #3a3a3a;
}

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

.summary-row span:last-child {
    color: #ffd580;
    font-family: 'Roboto Mono', monospace;
}

.highlight-row {
    margin-top: 8px;
    padding-top: 12px !important;
    border-top: 2px solid #c9a876 !important;
}

.highlight-row span {
    color: #ffd580 !important;
}

/* History Styles */
.history-help-text {
    color: #b8945f;
    font-size: 14px;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #3a3a3a;
}

.history-help-text strong {
    color: #c9a876;
}

.history-list {
    /* Scrolling handled by modal-body */
}

.history-item {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #3a3a3a;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #3a3a3a;
}

.history-label {
    color: #ffd580;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.history-date {
    color: #b8945f;
    font-size: 12px;
}

.history-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.history-load-btn {
    background: #c9a876;
    color: #2a2520;
    border: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 5px;
    transition: all 0.2s;
}

.history-load-btn:hover {
    background: #d4b586;
    transform: translateY(-1px);
}

.history-load-btn:active {
    transform: translateY(0);
}

.history-share-btn {
    background: #4a4a4a;
    color: #ffd580;
    border: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 5px;
    transition: all 0.2s;
}

.history-share-btn:hover {
    background: #5a5a5a;
    transform: translateY(-1px);
}

.history-share-btn:active {
    transform: translateY(0);
}

.history-delete-btn {
    background: #3a3a3a;
    color: #ffd580;
    border: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 5px;
    transition: all 0.2s;
}

.history-delete-btn:hover {
    background: #4a4a4a;
    transform: translateY(-1px);
}

.history-delete-btn:active {
    transform: translateY(0);
}

.history-details {
    font-size: 14px;
}

.history-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    color: #b8945f;
}

.history-detail-row span:last-child {
    color: #ffd580;
    font-family: 'Roboto Mono', monospace;
}

.history-highlight {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #c9a876;
}

.history-highlight span {
    color: #ffd580 !important;
    font-size: 15px;
}

/* Light Theme Overrides */
[data-theme="light"] * {
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
    tap-highlight-color: rgba(102, 126, 234, 0.3);
}

[data-theme="light"] body {
    background: linear-gradient(135deg, #667eea 0%, #2d3561 100%);
}

[data-theme="light"] .app-container {
    background: white;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid transparent;
}

[data-theme="light"] .btn-utility {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
}

[data-theme="light"] .btn-utility:hover {
    background: #f0f4ff;
    border-color: #5568d3;
    color: #5568d3;
}

[data-theme="light"] .save-btn {
    background: white;
    border: 1px solid #667eea;
    color: #667eea;
}

[data-theme="light"] .save-btn:hover {
    background: #f0f4ff;
    border-color: #5568d3;
    color: #5568d3;
}

[data-theme="light"] .input-group label {
    color: #333;
}

[data-theme="light"] .currency-symbol,
[data-theme="light"] .percent-symbol {
    color: #999;
}

[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="text"] {
    background: #f8f9fa;
    color: #333;
    border-color: #eee;
}

[data-theme="light"] input[type="number"]:focus,
[data-theme="light"] input[type="text"]:focus {
    border-color: #667eea;
    background: white;
}

[data-theme="light"] input[readonly] {
    background: #f8f9fa;
    color: #333;
}

[data-theme="light"] input[readonly]:focus {
    border-color: #667eea;
    background: white;
}

[data-theme="light"] input[readonly]:active {
    background: #e9ecef;
}

[data-theme="light"] .tip-btn {
    background: white;
    color: #667eea;
    border-color: #667eea;
}

[data-theme="light"] .tip-btn:hover {
    background: #f0f4ff;
    border-color: #667eea;
}

[data-theme="light"] .tip-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

[data-theme="light"] .total-toggle-btn {
    background: #f8f9fa;
    border-color: #ddd;
    color: #667eea;
}

[data-theme="light"] .total-toggle-btn:hover {
    background: #f0f4ff;
    border-color: #667eea;
}

[data-theme="light"] .total-close-btn {
    background: #f0f0f0;
    color: #999;
}

[data-theme="light"] .total-close-btn:hover {
    background: #e0e0e0;
    color: #666;
}

[data-theme="light"] .people-btn {
    background: #667eea;
    color: white;
}

[data-theme="light"] .people-btn:hover {
    background: #5568d3;
}

[data-theme="light"] .people-selector input {
    color: #333;
}

[data-theme="light"] .results {
    background: #f8f9fa;
    border-color: transparent;
}

[data-theme="light"] .result-row {
    border-bottom-color: #e0e0e0;
}

[data-theme="light"] .result-label {
    color: #666;
}

[data-theme="light"] .result-value {
    color: #333;
}

[data-theme="light"] .total-row .result-value {
    color: #667eea;
}

[data-theme="light"] .split-row {
    background: #667eea;
}

[data-theme="light"] .split-row .result-label,
[data-theme="light"] .split-row .result-value {
    color: white;
}

[data-theme="light"] .app-footer {
    border-top-color: #f0f0f0;
}

[data-theme="light"] .app-footer a {
    color: #667eea;
}

[data-theme="light"] .app-footer a:hover {
    color: #5568d3;
}

[data-theme="light"] .modal {
    background: rgba(0,0,0,0.5);
}

[data-theme="light"] .modal-content {
    background: white;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border-color: transparent;
}

[data-theme="light"] .modal-header {
    border-bottom-color: #f0f0f0;
}

[data-theme="light"] .modal-header h2 {
    color: #333;
}

[data-theme="light"] .close-btn {
    color: #999;
}

[data-theme="light"] .close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

[data-theme="light"] .modal-body a {
    color: #667eea;
}

[data-theme="light"] .modal-body a:hover {
    color: #5568d3;
}

[data-theme="light"] .modal-body h3 {
    color: #333;
}

[data-theme="light"] .option-group label {
    color: #333;
}

[data-theme="light"] .option-group input[type="checkbox"] {
    accent-color: #667eea;
}

[data-theme="light"] .theme-btn {
    background: white;
    color: #667eea;
    border-color: #667eea;
}

[data-theme="light"] .theme-btn:hover {
    background: #f0f4ff;
    border-color: #667eea;
}

[data-theme="light"] .theme-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

[data-theme="light"] .modal-footer {
    border-top-color: #f0f0f0;
}

[data-theme="light"] .modal-buttons {
    border-top-color: #f0f0f0;
}

[data-theme="light"] .modal-cancel {
    background: #666;
}

[data-theme="light"] .modal-cancel:hover {
    background: #555;
}

[data-theme="light"] .btn-primary {
    background: #667eea;
    color: white;
}

[data-theme="light"] .btn-primary:hover {
    background: #5568d3;
}

[data-theme="light"] .btn-secondary {
    background: white;
    color: #667eea;
    border-color: #667eea;
}

[data-theme="light"] .btn-secondary:hover {
    background: #f0f4ff;
}

[data-theme="light"] .keypad-content {
    background: white;
}

[data-theme="light"] .keypad-display {
    background: #f8f9fa;
}

[data-theme="light"] .keypad-label {
    color: #999;
}

[data-theme="light"] .keypad-value {
    color: #333;
}

[data-theme="light"] .keypad-buttons {
    background: #e0e0e0;
}

[data-theme="light"] .keypad-btn {
    background: white;
    color: #333;
}

[data-theme="light"] .keypad-btn:active {
    background: #f0f0f0;
}

[data-theme="light"] .keypad-clear,
[data-theme="light"] .keypad-backspace {
    background: #d0d0d0;
    color: #333;
}

[data-theme="light"] .keypad-clear:active,
[data-theme="light"] .keypad-backspace:active {
    background: #c0c0c0;
}

[data-theme="light"] .keypad-done {
    background: #d0d0d0;
    color: #333;
}

[data-theme="light"] .keypad-done:active {
    background: #c0c0c0;
}

[data-theme="light"] .toggle-slider {
    background-color: #ddd;
    border-color: #ddd;
}

[data-theme="light"] .toggle-slider:before {
    background-color: white;
}

[data-theme="light"] .toggle-switch input:checked + .toggle-slider {
    background-color: #667eea;
    border-color: #667eea;
}

[data-theme="light"] .toggle-switch input:checked + .toggle-slider:before {
    background-color: white;
}

[data-theme="light"] .toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

[data-theme="light"] .save-summary {
    background: #f8f9fa;
    border-color: #e0e0e0;
}

[data-theme="light"] .summary-row {
    color: #666;
    border-bottom-color: #e0e0e0;
}

[data-theme="light"] .summary-row span:last-child {
    color: #333;
}

[data-theme="light"] .highlight-row {
    border-top-color: #667eea !important;
}

[data-theme="light"] .highlight-row span {
    color: #667eea !important;
}

[data-theme="light"] .history-item {
    background: #f8f9fa;
    border-color: #e0e0e0;
}

[data-theme="light"] .history-header {
    border-bottom-color: #e0e0e0;
}

[data-theme="light"] .history-label {
    color: #333;
}

[data-theme="light"] .history-date {
    color: #999;
}

[data-theme="light"] .history-detail-row {
    color: #666;
}

[data-theme="light"] .history-detail-row span:last-child {
    color: #333;
}

[data-theme="light"] .history-highlight {
    border-top-color: #667eea;
}

[data-theme="light"] .history-highlight span {
    color: #667eea !important;
}

[data-theme="light"] #historyLabel {
    background: #f8f9fa;
    color: #333;
    border-color: #e0e0e0;
}

[data-theme="light"] .history-load-btn {
    background: #667eea;
    color: white;
}

[data-theme="light"] .history-load-btn:hover {
    background: #5568d3;
}

[data-theme="light"] .history-share-btn {
    background: #f0f0f0;
    color: #667eea;
}

[data-theme="light"] .history-share-btn:hover {
    background: #e0e0e0;
}

[data-theme="light"] .history-delete-btn {
    background: #e0e0e0;
    color: #666;
}

[data-theme="light"] .history-delete-btn:hover {
    background: #d0d0d0;
}

[data-theme="light"] .history-help-text {
    background: #f0f4ff;
    border-color: #e0e0e0;
    color: #666;
}

[data-theme="light"] .history-help-text strong {
    color: #667eea;
}
