* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ─── Auth ─── */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 400px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text);
}

.auth-form .input-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    box-sizing: border-box;
    background: var(--bg);
    color: var(--text);
}

.auth-main-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    position: relative;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-main-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.auth-main-btn:active {
    transform: translateY(0);
}

.auth-main-btn.loading {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.8;
}

.auth-main-btn.loading:hover {
    background: #cccccc;
    transform: none;
    box-shadow: none;
}

.loading-spinner {
    animation: spin 1s linear infinite;
    display: inline-block;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #888;
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle-btn,
.logout-btn {
    background: var(--header-action-bg);
    border: 1px solid var(--header-action-border);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.theme-toggle-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 16px;
}

.theme-toggle-btn:hover,
.logout-btn:hover {
    transform: translateY(-1px);
}

/* ─── Theme Variables ─── */
:root {
    --primary: #6C63FF;
    --primary-light: #8B85FF;
    --primary-dark: #5A52E0;
    --accent: #FF6584;
    --success: #4CAF50;
    --bg: #F0F2F5;
    --card-bg: #FFFFFF;
    --text: #2D3436;
    --text-secondary: #636E72;
    --border: #E0E0E0;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --radius: 16px;
    --header-action-bg: rgba(255, 255, 255, 0.2);
    --header-action-border: rgba(255, 255, 255, 0.3);
    --tooltip-bg: #1F2430;
    --tooltip-text: #FFFFFF;
    --highlight-bg: rgba(255, 214, 0, 0.35);
}

:root[data-theme='dark'] {
    --primary: #8F88FF;
    --primary-light: #A9A3FF;
    --primary-dark: #7A72F0;
    --accent: #FF7A97;
    --success: #4CC97A;
    --bg: #12141B;
    --card-bg: #1C202B;
    --text: #EDEFF5;
    --text-secondary: #A3A9B7;
    --border: #2A2F3A;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --header-action-bg: rgba(255, 255, 255, 0.12);
    --header-action-border: rgba(255, 255, 255, 0.2);
    --tooltip-bg: #FFFFFF;
    --tooltip-text: #1C202B;
    --highlight-bg: rgba(255, 214, 0, 0.2);
}

/* ─── Loading Spinner Animation ─── */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 40px;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 32px 24px 24px;
    text-align: center;
    border-radius: 0 0 32px 32px;
}

.app-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.85;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 4px;
    padding: 16px 16px 0;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 10;
}

.tab-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px 12px 0 0;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 -2px 12px rgba(108, 99, 255, 0.3);
}

/* Tab Content */
.tab-content {
    padding: 0 16px;
}

.reminder-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.reminder-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.reminder-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.reminder-note {
    font-size: 12px;
    color: var(--text-secondary);
}

#reminderTime {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    transition: 0.3s;
    border-radius: 999px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background: var(--primary);
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
}

.goal-progress {
    margin-top: 16px;
    padding: 14px;
    background: var(--bg);
    border-radius: 12px;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.goal-input {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--card-bg);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.goal-input input {
    width: 70px;
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    color: var(--text);
}

.goal-bar {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: rgba(108, 99, 255, 0.15);
    overflow: hidden;
    margin-bottom: 8px;
}

.goal-bar-fill {
    position: absolute;
    inset: 0;
    width: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    transition: width 0.3s ease;
}

.goal-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 16px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

/* Date Card */
.date-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.date-display {
    display: flex;
    align-items: center;
    gap: 16px;
}

.date-icon {
    font-size: 40px;
}

.date-main {
    font-size: 22px;
    font-weight: 700;
}

.date-week {
    font-size: 14px;
    opacity: 0.85;
    margin-top: 2px;
}

/* Weight Input */
.weight-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border-radius: 12px;
    padding: 4px;
}

.weight-input-group input {
    flex: 1;
    border: none;
    background: none;
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    color: var(--primary);
    padding: 12px;
    outline: none;
}

.weight-input-group input::placeholder {
    color: #B0B0B0;
    font-size: 18px;
    font-weight: 400;
}

.weight-input-group .unit {
    font-size: 18px;
    color: var(--text-secondary);
    padding-right: 16px;
}

/* Body Data Grid */
.body-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.bmi-card {
    border: 1px solid rgba(108, 99, 255, 0.15);
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.08), rgba(108, 99, 255, 0.02));
}

.bmi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    align-items: center;
}

.bmi-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
}

.bmi-estimate {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(108, 99, 255, 0.08);
}

.bmi-estimate-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.bmi-apply-btn {
    border: none;
    background: var(--primary);
    color: white;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.bmi-apply-btn:hover {
    background: var(--primary-dark);
}

.bmi-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.bmi-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.bmi-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(108, 99, 255, 0.12);
    color: var(--primary);
}

.bmi-status.success {
    background: rgba(76, 175, 80, 0.18);
    color: #2E7D32;
}

.bmi-status.warning {
    background: rgba(255, 165, 0, 0.18);
    color: #D9822B;
}

.bmi-status.danger {
    background: rgba(239, 83, 80, 0.2);
    color: #C62828;
}

:root[data-theme='dark'] .bmi-card {
    border: 1px solid rgba(143, 136, 255, 0.35);
    background: linear-gradient(135deg, rgba(143, 136, 255, 0.18), rgba(143, 136, 255, 0.06));
}

:root[data-theme='dark'] .bmi-status.success {
    color: #B9F6CA;
}

:root[data-theme='dark'] .bmi-status.warning {
    color: #FFD180;
}

:root[data-theme='dark'] .bmi-status.danger {
    color: #FF8A80;
}

.body-data-item label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg);
    border-radius: 10px;
    padding: 8px 12px;
}

.input-with-unit input {
    flex: 1;
    border: none;
    background: none;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    outline: none;
    width: 60px;
}

.input-with-unit input::placeholder {
    color: #C0C0C0;
}

.input-with-unit span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Photo Section */
.photo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photo-preview {
    width: 100%;
    min-height: 200px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.photo-preview:hover {
    border-color: var(--primary);
    background: rgba(108, 99, 255, 0.03);
}

.photo-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.camera-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

.photo-placeholder p {
    font-size: 14px;
}

.photo-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.preview-img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    display: none;
    border-radius: 10px;
}

.preview-img.show {
    display: block;
}

.remove-photo-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.remove-photo-btn.show {
    display: flex;
}

/* Note Input */
textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s;
    background: var(--bg);
}

textarea:focus {
    border-color: var(--primary);
}

textarea::placeholder {
    color: #B0B0B0;
}

/* Save Button */
.save-btn {
    width: 100%;
    padding: 18px;
    margin-top: 20px;
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.35);
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.45);
}

.save-btn:active {
    transform: translateY(0);
}

/* History */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 8px;
}

.history-header h2 {
    font-size: 18px;
}

.export-btn {
    padding: 8px 16px;
    border: 1px solid var(--primary);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.export-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.export-btn:hover {
    background: var(--primary);
    color: white;
}

.history-controls {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.history-search input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 14px;
}

.history-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.export-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.export-controls select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.filter-btn {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(108, 99, 255, 0.12);
}

/* History Item */
.history-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.3s ease;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-time {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.history-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}

.history-detail {
    background: var(--bg);
    padding: 10px 12px;
    border-radius: 10px;
}

.history-detail-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.history-detail-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.history-date {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.history-weight {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.history-weight .weight-unit {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

.weight-change {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: 8px;
}

.weight-change.down {
    background: #E8F5E9;
    color: #2E7D32;
}

.weight-change.up {
    background: #FFEBEE;
    color: #C62828;
}

.weight-change.same {
    background: #F5F5F5;
    color: #757575;
}

.history-body-data {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.history-note {
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.history-note mark {
    background: var(--highlight-bg);
    color: inherit;
    padding: 0 2px;
    border-radius: 4px;
}

.history-photo {
    width: 100%;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s;
    max-height: 300px;
    object-fit: cover;
}

.history-photo.empty {
    cursor: default;
    border: 1px dashed var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    min-height: 140px;
}

.history-photo:hover {
    transform: scale(1.02);
}

.history-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    gap: 8px;
}

.history-action-btn {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
    background: var(--bg);
    color: var(--text-secondary);
}

.history-action-btn.edit {
    border-color: rgba(108, 99, 255, 0.4);
    color: var(--primary);
}

.history-action-btn.delete {
    border-color: #EF5350;
    color: #EF5350;
}

.history-action-btn:hover {
    transform: translateY(-1px);
}

.history-action-btn.edit:hover {
    background: rgba(108, 99, 255, 0.12);
}

.history-action-btn.delete:hover {
    background: rgba(239, 83, 80, 0.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 60px;
    display: block;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 15px;
}

/* Chart */
.chart-container {
    padding-top: 16px;
}

.chart-container h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

.chart-period-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.period-btn {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: white;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.period-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.chart-canvas-wrapper {
    position: relative;
}

canvas {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    width: 100% !important;
    height: 250px !important;
}

.chart-tooltip {
    position: fixed;
    transform: translate(-50%, -100%);
    background: var(--tooltip-bg);
    color: var(--tooltip-text);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 999;
    text-align: center;
    line-height: 1.4;
}

.chart-tooltip.show {
    opacity: 1;
}

.chart-tooltip .tooltip-value {
    font-weight: 600;
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.summary-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.summary-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.summary-row strong {
    color: var(--text);
}

.summary-row strong.success {
    color: var(--success);
}

.summary-row strong.accent {
    color: var(--accent);
}

.summary-row strong.neutral {
    color: var(--text-secondary);
}

.last-record-card .summary-row {
    margin-bottom: 6px;
}

.last-record-card .summary-row strong {
    font-weight: 600;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.stat-value.accent {
    color: var(--accent);
}

.stat-value.success {
    color: var(--success);
}

.stat-unit {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

.modal-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 18px;
    cursor: pointer;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 12px 28px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 2000;
    transition: transform 0.3s ease;
    white-space: nowrap;
    max-width: 80%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

:root[data-theme='dark'] .toast {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Number input spinner hide */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Responsive */
@media (min-width: 481px) {
    .app {
        margin-top: 20px;
    }

    .app-header {
        border-radius: 24px 24px 32px 32px;
        margin: 0 16px;
    }
}
