/* ── ReefPilot — Dark Ocean Theme ─────────────────────────────────────── */

:root {
    --bg-deep: #0B1622;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-input: rgba(255, 255, 255, 0.06);
    --accent: #00B4D8;
    --accent-dim: #0096B7;
    --accent-glow: rgba(0, 180, 216, 0.12);
    --text-primary: #F0F4F8;
    --text-secondary: #8899AA;
    --text-muted: #5A6A7A;
    --text: #F0F4F8;
    --text-dim: #8899AA;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-solid: #162233;
    --border: rgba(255, 255, 255, 0.06);
    --success: #34D399;
    --warning: #FBBF24;
    --danger: #F87171;
    --nav-height: 64px;
    --header-height: 52px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.2), 0 0 1px rgba(255, 255, 255, 0.05) inset;
    --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.3);
    --radius-card: 16px;
    --radius-sm: 12px;
    --radius-pill: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

.hidden { display: none !important; }

/* ── Focus Visible (accessibility / keyboard nav) ──────────────────── */

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── Offline Banner ────────────────────────────────────────────────── */

.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--warning);
    color: #1a1a1a;
    text-align: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
}

/* ── Screens ─────────────────────────────────────────────────────────── */

.screen {
    min-height: 100vh;
    min-height: 100dvh;
}

/* ── Auth ─────────────────────────────────────────────────────────────── */

.auth-container {
    max-width: 380px;
    margin: 0 auto;
    padding: 60px 24px 40px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    margin-bottom: 16px;
}

.auth-logo h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-switch {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

/* ── Form Elements ───────────────────────────────────────────────────── */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.form-group label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

input, select, textarea {
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    width: 100%;
}

input:focus, select:focus {
    border-color: var(--accent);
    background: rgba(0, 180, 216, 0.06);
}

input::placeholder {
    color: var(--text-muted);
}

.input-large {
    font-size: 24px;
    text-align: center;
    padding: 16px;
}

.select-large {
    font-size: 18px;
    padding: 14px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-row input {
    flex: 1;
}

.input-suffix {
    color: var(--text-secondary);
    font-size: 14px;
    white-space: nowrap;
}

.form-error {
    color: var(--danger);
    font-size: 13px;
    min-height: 18px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s, transform 0.15s;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-dim);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.06);
    border: none;
}

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

.btn-active {
    background: var(--accent);
    color: #fff;
}

/* ── Onboarding Chat ─────────────────────────────────────────────────── */

.onboard-chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
}

.onboard-chat-header {
    text-align: center;
    padding: 32px 24px 16px;
    flex-shrink: 0;
}

.onboard-logo {
    margin-bottom: 12px;
}

.onboard-chat-header h2 {
    font-size: 24px;
    color: var(--accent);
    font-weight: 700;
}

.onboard-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.onboard-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.onboard-chat-input-bar {
    padding: 8px 12px;
    padding-bottom: calc(8px + var(--safe-bottom));
    border-top: 1px solid var(--border);
    background: var(--bg-deep);
    flex-shrink: 0;
}

#onboard-chat-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

#onboard-chat-input {
    flex: 1;
    border-radius: 24px;
    padding: 12px 18px;
}

/* ── App Layout ──────────────────────────────────────────────────────── */

.app-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(11, 22, 34, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 100;
}

.header-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-title {
    font-size: 19px;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.header-user {
    font-size: 13px;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-tank-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 10px;
    color: var(--accent);
    padding: 7px 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s, background 0.2s;
}

.header-tank-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.12);
}

.app-content {
    padding-top: var(--header-height);
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
    min-height: 100vh;
    min-height: 100dvh;
}

.tab-content {
    padding: 20px;
    animation: tabFadeIn 0.3s ease;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    margin-top: 8px;
}

.section-header h2, .section-header h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ── Bottom Nav ──────────────────────────────────────────────────────── */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(11, 22, 34, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.nav-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.nav-tab:active {
    transform: scale(0.88);
}

.nav-tab.active {
    color: var(--accent);
}

.nav-tab svg {
    width: 24px;
    height: 24px;
}

/* ── Chat ─────────────────────────────────────────────────────────────── */

#tab-chat {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--header-height) - var(--nav-height) - var(--safe-bottom));
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-welcome {
    text-align: center;
    padding: 40px 20px;
}

.chat-welcome-icon {
    margin-bottom: 16px;
}

.chat-welcome h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--accent);
}

.chat-welcome p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.suggestion-chip {
    background: rgba(0, 180, 216, 0.08);
    border: none;
    border-radius: var(--radius-pill);
    padding: 10px 18px;
    font-size: 13px;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s, transform 0.15s;
}

.suggestion-chip:active {
    transform: scale(0.95);
    background: var(--accent-glow);
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-bubble.user {
    background: var(--accent);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 12px rgba(0, 180, 216, 0.25);
}

.chat-bubble.assistant {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    white-space: normal;
    box-shadow: var(--shadow-card);
}

.chat-bubble.assistant p {
    margin: 0 0 10px 0;
}
.chat-bubble.assistant p:last-child {
    margin-bottom: 0;
}
.chat-bubble.assistant strong {
    color: var(--accent);
    font-weight: 600;
}
.chat-bubble.assistant h3,
.chat-bubble.assistant h4 {
    margin: 12px 0 6px 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
}
.chat-bubble.assistant h3:first-child,
.chat-bubble.assistant h4:first-child {
    margin-top: 0;
}
.chat-bubble.assistant ul {
    margin: 6px 0 10px 0;
    padding-left: 18px;
}
.chat-bubble.assistant li {
    margin-bottom: 4px;
}
.chat-bubble.assistant code {
    background: rgba(255,255,255,0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 13px;
}
.chat-bubble.assistant em {
    opacity: 0.85;
}

.chat-typing {
    align-self: flex-start;
    background: var(--bg-card);
    padding: 12px 18px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.typing-logo {
    display: flex;
    align-items: center;
    animation: logoPulse 1.5s ease-in-out infinite;
}

.typing-logo svg {
    filter: drop-shadow(0 0 6px rgba(0, 180, 216, 0.4));
}

.typing-text {
    font-size: 14px;
    color: var(--accent);
    animation: textFade 1.5s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
}

@keyframes textFade {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.param-toast {
    background: rgba(0, 200, 83, 0.15);
    border: 1px solid rgba(0, 200, 83, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--success);
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-input-bar {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    background: rgba(11, 22, 34, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

#chat-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

#chat-input {
    flex: 1;
    border-radius: 24px;
    padding: 12px 18px;
}

.btn-send {
    background: var(--accent);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    flex-shrink: 0;
    transition: background 0.2s;
}

.btn-send:hover {
    background: var(--accent-dim);
}

.btn-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Parameters ──────────────────────────────────────────────────────── */

.param-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.param-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 16px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    border: none;
    box-shadow: var(--shadow-card);
}

.param-card:active {
    transform: scale(0.97);
}

.param-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.param-icon {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 4px 8px;
    border-radius: 6px;
}

.param-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.param-status-dot.good { background: var(--success); }
.param-status-dot.warning { background: var(--warning); }
.param-status-dot.danger { background: var(--danger); }
.param-status-dot.none { background: var(--text-muted); }

.param-value {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 2px;
}

.param-value.none {
    color: var(--text-muted);
    font-size: 14px;
}

.param-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.param-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Calculators ─────────────────────────────────────────────────────── */

.calc-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.calc-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 20px;
    border: none;
    box-shadow: var(--shadow-card);
}

.calc-card h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.calc-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.calc-result {
    margin-top: 16px;
    background: var(--accent-glow);
    border: 1px solid rgba(0, 180, 216, 0.3);
    border-radius: 10px;
    padding: 16px;
}

.calc-result-big {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}

.calc-result-detail {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ── Tank ─────────────────────────────────────────────────────────────── */

.tank-profile-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 20px;
    border: none;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
}

.tank-stat {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.tank-stat:last-child {
    border-bottom: none;
}

.tank-stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.tank-stat-value {
    font-weight: 600;
    font-size: 14px;
}

.item-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.item-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    box-shadow: var(--shadow-card);
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 600;
    font-size: 15px;
}

.item-detail {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.item-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
}

.item-delete:hover {
    color: var(--danger);
}

.empty-state {
    text-align: center;
    padding: 32px 24px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    opacity: 0.7;
}

/* ── Settings ────────────────────────────────────────────────────────── */

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.settings-item {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    box-shadow: var(--shadow-card);
}

.settings-value {
    color: var(--text-secondary);
    font-size: 14px;
}

.settings-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.settings-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: -4px;
}

.settings-link {
    display: block;
    padding: 12px 18px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    color: var(--accent);
    text-decoration: none;
    font-size: 15px;
    transition: background 0.15s;
}
.settings-link:active {
    background: var(--bg-card-hover);
}

.settings-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: -4px;
}

.btn-danger-outline {
    background: transparent;
    border: 1.5px solid var(--danger);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-danger-outline:active {
    background: rgba(248, 113, 113, 0.1);
}

/* ── Auth Form Extras ────────────────────────────────────────────────── */

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

.password-input-wrap input {
    flex: 1;
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.password-toggle:hover {
    opacity: 1;
}

.password-strength {
    display: flex;
    gap: 4px;
    height: 4px;
    margin-top: 4px;
}

.password-strength .strength-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.password-strength .strength-bar.weak { background: var(--danger); }
.password-strength .strength-bar.medium { background: var(--warning); }
.password-strength .strength-bar.strong { background: var(--success); }

.password-strength-label {
    font-size: 12px;
    margin-top: 2px;
    color: var(--text-muted);
}

.consent-group {
    margin-top: 4px;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.4;
}

.consent-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--accent);
}

.consent-label a {
    color: var(--accent);
    text-decoration: none;
}

.input-code {
    text-align: center;
    letter-spacing: 0.5em;
    font-size: 24px;
    font-weight: 600;
    font-family: 'SF Mono', 'Menlo', monospace;
    padding: 14px 16px;
}

.auth-info {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
    margin-bottom: 8px;
}

.auth-info strong {
    color: var(--text-primary);
}

.auth-link-row {
    text-align: center;
    font-size: 14px;
    margin-top: -4px;
}

.auth-link-row a {
    color: var(--accent);
    text-decoration: none;
}

/* ── Modal ────────────────────────────────────────────────────────────── */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: var(--safe-bottom);
}

.modal-content {
    background: #111E2E;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.4);
}

.modal-large {
    max-height: 90vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    padding: 0 4px;
}

.modal .form-group {
    margin-bottom: 14px;
}

/* ── Chart ────────────────────────────────────────────────────────────── */

.chart-range-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.chart-container {
    position: relative;
    height: 280px;
}

/* ── Toast ────────────────────────────────────────────────────────────── */

#toast-container {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: rgba(20, 35, 50, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    border-radius: var(--radius-pill);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-elevated);
    animation: toastIn 0.3s ease;
    white-space: nowrap;
}

.toast.success { color: var(--success); }
.toast.error { color: var(--danger); }

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

/* ═══════════════════════════════════════════════════════════════════════════
   HOME / DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */

#tab-home {
    padding: 20px;
    padding-bottom: 32px;
}

/* ── Tank Hero Photo ────────────────────────────────────────────────── */

.tank-hero {
    position: relative;
    width: calc(100% + 40px);
    margin: -20px -20px 0;
    height: 240px;
    overflow: hidden;
    display: none;
}

.tank-hero.has-photo {
    display: block;
}

.tank-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tank-hero-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 30%,
        var(--bg-deep) 100%
    );
    pointer-events: none;
}

.tank-hero-upload-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s;
    z-index: 2;
}

.tank-hero-upload-btn:active {
    background: rgba(0, 0, 0, 0.7);
}

/* Show upload button even when no photo (placeholder state) */
.tank-hero.no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-card);
    width: 100%;
    margin: 0 0 8px;
    border: 1.5px dashed rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.tank-hero.no-photo .tank-hero-img,
.tank-hero.no-photo .tank-hero-fade {
    display: none;
}

.tank-hero.no-photo .tank-hero-upload-btn {
    position: static;
    background: none;
    border: none;
    color: var(--text-secondary);
    width: auto;
    height: auto;
    gap: 8px;
    font-size: 13px;
    backdrop-filter: none;
}

.tank-hero.no-photo .tank-hero-upload-btn::after {
    content: 'Add tank photo';
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Health Score Circle ─────────────────────────────────────────────── */

.health-score-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0 20px;
    position: relative;
    z-index: 1;
}

.tank-hero.has-photo + .health-score-section {
    margin-top: -60px;
}

.health-score-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.health-score-ring svg {
    display: block;
}

.health-score-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
}

.health-score-label {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.3s;
}

/* ── Param Chips (Horizontal Scroll) ─────────────────────────────────── */

.param-chips-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.param-chips-scroll::-webkit-scrollbar {
    display: none;
}

.param-chip {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
}

.param-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.param-chip-dot.good { background: var(--success); }
.param-chip-dot.warning { background: var(--warning); }
.param-chip-dot.danger { background: var(--danger); }
.param-chip-dot.none { background: var(--text-muted); }

.param-chip-label {
    color: var(--text-secondary);
    white-space: nowrap;
}

.param-chip-value {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

/* ── Dashboard Sections ──────────────────────────────────────────────── */

.dashboard-section {
    margin-bottom: 24px;
}

.dash-section-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Insight Cards ───────────────────────────────────────────────────── */

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.insight-card {
    background: var(--bg-card);
    border: none;
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-card);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow-card);
}

.insight-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.insight-message {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
}

/* ── Maintenance Task Items ──────────────────────────────────────────── */

.maintenance-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.maint-task-item {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-card);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-card);
}

.maint-task-item.overdue {
    border-color: rgba(255, 82, 82, 0.4);
}

.maint-task-info {
    flex: 1;
    min-width: 0;
}

.maint-task-name {
    font-weight: 600;
    font-size: 14px;
}

.maint-task-due {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.maint-task-item.overdue .maint-task-due {
    color: var(--danger);
}

.maint-task-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* ── Milestone Cards ─────────────────────────────────────────────────── */

.milestones-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.milestone-card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-card);
    padding: 16px 18px;
    box-shadow: var(--shadow-card);
}

.milestone-card.completed {
    opacity: 0.7;
}

.milestone-card.locked {
    opacity: 0.5;
}

.milestone-status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
}

.milestone-status-badge.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.milestone-status-badge.completed {
    background: rgba(0, 200, 83, 0.15);
    color: var(--success);
}

.milestone-status-badge.locked {
    background: rgba(85, 102, 119, 0.2);
    color: var(--text-muted);
}

.milestone-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 2px;
}

.milestone-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ── Cost Summary Card (Dashboard) ───────────────────────────────────── */

.cost-summary-card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-card);
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-card);
}

.cost-summary-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.cost-summary-amount {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
}

.cost-summary-arrow {
    flex-shrink: 0;
    opacity: 0.5;
}

/* ── Quick Actions Row ─────────────────────────────────────────────── */

.quick-actions-row {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.quick-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-card);
    padding: 14px 8px;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: transform 0.15s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

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

.quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 180, 216, 0.12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-btn span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ── Dismissible Insights ──────────────────────────────────────────── */

.insight-card {
    position: relative;
}

.insight-dismiss-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0.4;
    transition: opacity 0.2s, background 0.2s;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.insight-dismiss-btn:hover,
.insight-dismiss-btn:active {
    opacity: 1;
    background: rgba(255,255,255,0.08);
}

/* ── Recent Activity ───────────────────────────────────────────────── */

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 12px 14px;
    box-shadow: var(--shadow-card);
}

.activity-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.activity-info {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 1px;
}

/* ── Cost Breakdown (Modal) ──────────────────────────────────────────── */

.cost-breakdown {
    margin-bottom: 8px;
}

.cost-breakdown-header {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.cost-breakdown-cats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cost-cat-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}

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

/* ── Cost Wizard & Dashboard ─────────────────────────────────────────── */

.cost-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    min-height: 50vh;
}

.cost-empty-state h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin: 16px 0 4px;
}

.cost-total-card {
    background: linear-gradient(135deg, rgba(0,180,216,0.1), rgba(0,180,216,0.03));
    border: none;
    border-radius: 20px;
    padding: 28px;
    text-align: center;
    margin-bottom: 12px;
    box-shadow: 0 4px 24px rgba(0, 180, 216, 0.08);
}

.cost-total-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cost-total-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
}

.cost-line-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-card);
    margin-bottom: 10px;
    box-shadow: var(--shadow-card);
}

.cost-line-info {
    flex: 1;
    min-width: 0;
}

.cost-line-category {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-line-desc {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cost-line-right {
    text-align: right;
    flex-shrink: 0;
}

.cost-line-amount {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cost-badge-estimated {
    background: rgba(0,180,216,0.15);
    color: var(--accent);
}

.cost-badge-actual {
    background: rgba(0,200,83,0.15);
    color: var(--success);
}

.cost-line-edit {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    flex-shrink: 0;
}

.cost-line-edit:hover {
    color: var(--accent);
    background: var(--accent-glow);
}

/* ── Cost Segment Toggle ─────────────────────────────────────────────── */

.cost-segment-toggle {
    display: flex;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 3px;
    margin-top: 16px;
    gap: 2px;
}

.cost-segment-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cost-segment-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,180,216,0.3);
}

.cost-total-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Quick Add Purchase ──────────────────────────────────────────────── */

.cost-quick-add {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 16px;
    margin-top: 16px;
}

.cost-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cost-pill {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.cost-pill.active {
    border-color: var(--accent);
    background: rgba(0,180,216,0.12);
    color: var(--accent);
}

/* ── Purchase Item Card ──────────────────────────────────────────────── */

.purchase-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-card);
    margin-bottom: 8px;
}

.purchase-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.purchase-info {
    flex: 1;
    min-width: 0;
}

.purchase-desc {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.purchase-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.purchase-amount {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.purchase-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.purchase-delete:hover {
    color: var(--error);
}

.purchases-month-total {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.purchases-month-total span:first-child {
    font-size: 13px;
    color: var(--text-secondary);
}

.purchases-month-total span:last-child {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.cw-scrollable-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 45vh;
    overflow-y: auto;
    padding-right: 4px;
}

.cw-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
}

.cw-list-item:hover {
    border-color: var(--accent);
}

.cw-list-item.selected {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(0, 180, 216, 0.2);
}

.cw-list-item-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Wizard overrides */
.cw-skip-btn {
    min-width: 70px;
}

.cw-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cw-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.cw-toggle-row span {
    font-size: 14px;
    color: var(--text-primary);
}

.cw-toggle-options {
    display: flex;
    gap: 8px;
}

.cw-toggle-options .wizard-preset-btn {
    padding: 6px 16px;
    font-size: 13px;
}

.cw-freq-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0 8px 12px;
}

.cw-freq-row label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cw-freq-row select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text-primary);
}

/* ── Light chips (multi-light summary) ──────────────────────────────── */

.cw-lights-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.cw-light-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-primary);
}

.cw-light-chip-remove {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.cw-light-chip-remove:hover {
    color: #FF5252;
}

/* 6-tab nav spacing */
.bottom-nav .nav-tab {
    font-size: 10px;
}

.bottom-nav .nav-tab svg {
    width: 24px;
    height: 24px;
}

/* ── More Tab Grid ───────────────────────────────────────────────────── */

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

.more-card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-card);
    padding: 28px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.15s;
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
}

.more-card:active {
    transform: scale(0.96);
}

.more-card-icon {
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.more-card-label {
    font-size: 14px;
    font-weight: 600;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (min-width: 600px) {
    .param-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .more-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .modal-content {
        border-radius: 24px;
        margin-bottom: 20px;
    }

    .modal {
        align-items: center;
    }
}

/* ── Onboarding Wizard ────────────────────────────────────────────── */

.wizard-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px 30px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.wizard-progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 8px;
    overflow: hidden;
}

.wizard-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.wizard-step-label {
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
    margin-bottom: 16px;
}

.wizard-header {
    text-align: center;
    margin-bottom: 24px;
}

.wizard-header h2 {
    font-size: 22px;
    margin: 10px 0 0;
}

.onboard-logo {
    margin-bottom: 4px;
}

.wizard-steps-viewport {
    flex: 1;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

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

.wizard-option-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.wizard-preset-btn {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px 8px;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wizard-preset-btn.selected,
.wizard-preset-btn:active {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(0, 180, 216, 0.25);
}

.wizard-custom-input {
    margin-top: 16px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-large {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    text-align: center;
}

.input-suffix {
    color: var(--text-dim);
    font-size: 14px;
    white-space: nowrap;
}

.wizard-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.wizard-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 16px;
    color: var(--text-primary);
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wizard-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(0, 180, 216, 0.2);
}

.wizard-card-emoji {
    font-size: 32px;
    line-height: 1;
}

.wizard-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.wizard-card-sub {
    font-size: 11px;
    color: var(--text-dim);
}

.wizard-card-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: inline-block;
}

.wizard-card.selected .wizard-card-check {
    background: var(--accent);
    border-color: var(--accent);
}

.wizard-card.selected .wizard-card-check::after {
    content: '\2713';
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.wizard-number-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.wizard-pm-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.wizard-num-field {
    width: 80px;
    text-align: center;
}

.wizard-salt-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
}

.wizard-salt-btn {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s;
}

.wizard-salt-btn.selected {
    border-color: var(--accent);
    background: rgba(0, 180, 216, 0.08);
}

.wizard-day-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.wizard-day-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.wizard-day-btn.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.wizard-hint {
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 16px;
}

.wizard-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.wizard-pill {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.wizard-pill.selected {
    border-color: var(--accent);
    background: rgba(0, 180, 216, 0.15);
}

#wizard-problems-text {
    width: 100%;
    padding: 12px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 14px;
    resize: vertical;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    gap: 12px;
}

.wizard-back-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wizard-next-btn {
    flex: 1;
    padding: 14px;
    font-size: 16px;
}

/* Wizard Loading */
.wizard-loading {
    text-align: center;
    padding: 60px 20px;
}

.wizard-loading-logo {
    animation: logoPulse 1.5s ease-in-out infinite;
    margin-bottom: 20px;
}

.wizard-loading h3 {
    margin: 0 0 8px;
}

.wizard-loading-sub {
    color: var(--text-dim);
    font-size: 14px;
}

/* Wizard Plan Ready */
.wizard-plan-ready {
    text-align: center;
    padding: 40px 16px;
}

.wizard-plan-icon {
    margin-bottom: 16px;
}

.wizard-plan-ready h2 {
    margin: 0 0 20px;
    color: var(--accent);
}

.wizard-plan-summary {
    text-align: left;
    margin-bottom: 24px;
}

.plan-welcome {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 16px;
    color: var(--text);
}

.plan-tips, .plan-focus, .plan-tasks {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.plan-tips h4, .plan-focus h4, .plan-tasks h4 {
    font-size: 14px;
    color: var(--accent);
    margin: 0 0 8px;
}

.plan-tips ul, .plan-tasks ul {
    margin: 0;
    padding-left: 20px;
}

.plan-tips li, .plan-tasks li {
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text-dim);
}

.plan-focus p {
    font-size: 13px;
    color: var(--text-dim);
    margin: 0;
}

.wizard-go-btn {
    font-size: 18px;
    padding: 16px;
}

/* ── Calendar ─────────────────────────────────────────────────────── */

.cal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 12px;
}

.cal-header-row h2 {
    margin: 0;
}

.cal-view-toggle {
    display: flex;
    gap: 4px;
}

.cal-week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cal-nav-arrow {
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
}

.cal-week-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
}

.cal-week-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.cal-day-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.2s;
    position: relative;
}

.cal-day-cell:active {
    transform: scale(0.93);
}

.cal-day-cell.today {
    background: rgba(0, 180, 216, 0.1);
}

.cal-day-cell.selected {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(0, 180, 216, 0.2);
}

.cal-day-name {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.cal-day-num {
    font-size: 16px;
    font-weight: 600;
    margin-top: 2px;
}

.cal-day-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 4px;
}

.cal-task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 80px;
}

.cal-task-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border-radius: var(--radius-card);
    padding: 14px 16px;
    box-shadow: var(--shadow-card);
    transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.4s ease, padding 0.4s ease, margin 0.4s ease;
}

.cal-task-card.completing {
    background: rgba(0, 200, 83, 0.1);
    border-left: 3px solid var(--success);
}

.cal-task-card.completing .cal-task-title {
    text-decoration: line-through;
    color: var(--text-muted);
    transition: all 0.2s;
}

.cal-task-card.completing .cal-task-done-btn {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.cal-task-card.completed {
    opacity: 0;
    max-height: 0;
    padding: 0 16px;
    margin: 0;
    overflow: hidden;
    transform: translateX(60px);
    transition: all 0.4s ease;
}

.cal-task-card.overdue {
    border-left: 3px solid #ef4444;
    background: rgba(239, 68, 68, 0.06);
}

.cal-task-card.upcoming-task {
    opacity: 0.9;
}

.cal-task-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cal-task-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cal-task-icon {
    font-size: 24px;
}

.cal-task-title {
    font-size: 14px;
    font-weight: 600;
    display: block;
}

.cal-task-freq {
    font-size: 11px;
    color: var(--text-dim);
}

.cal-task-card.overdue .cal-task-freq {
    color: #ef4444;
}

.cal-task-done-btn {
    padding: 7px 18px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.cal-task-done-btn:active {
    background: var(--accent);
    color: #fff;
    transform: scale(0.95);
}

.cal-fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 180, 216, 0.4);
    z-index: 50;
}

/* ── Task List (new unified view) ─────────────────────────────────── */

.task-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 80px;
}

.task-group-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 16px 0 6px 4px;
}

.task-group-header:first-child {
    padding-top: 4px;
}

.task-group-header.overdue {
    color: var(--danger);
}

.task-group-header.today {
    color: var(--accent);
}

.task-day-label {
    font-size: 12px;
    color: var(--text-dim);
    padding: 10px 0 4px 4px;
    font-weight: 600;
}

.task-freq-pill {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 180, 216, 0.1);
    color: var(--text-secondary);
    white-space: nowrap;
    text-transform: capitalize;
    transition: all 0.3s;
}

.task-freq-pill.completed-pill {
    background: rgba(0, 200, 83, 0.15);
    color: var(--success);
    font-weight: 600;
}

.btn-icon-round {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    padding: 7px 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s, color 0.2s;
}

.btn-icon-round:active {
    transform: scale(0.9);
    color: var(--accent);
}

.dash-section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── Tasks Setup Flow ──────────────────────────────────────────────── */

.tasks-setup-card {
    padding: 8px 0;
}

.tasks-setup-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.tasks-setup-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.tasks-setup-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.setup-chip {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.setup-chip.selected {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

.tasks-setup-custom {
    margin-bottom: 8px;
}

/* ── Due Today Section (Tasks tab) ─────────────────────────────────── */

.tasks-due-section {
    margin-bottom: 8px;
}

.tasks-due-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.due-overdue-badge {
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 82, 82, 0.15);
    color: var(--danger);
    padding: 2px 8px;
    border-radius: 10px;
}

/* ── Dashboard Due Today Cards ─────────────────────────────────────── */

.dash-due-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border-radius: var(--radius-card);
    padding: 14px 16px;
    margin-bottom: 10px;
    border-left: 3px solid var(--accent);
    box-shadow: var(--shadow-card);
}

.dash-due-card.overdue {
    border-left-color: var(--danger);
    background: rgba(255, 82, 82, 0.06);
}

.dash-due-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.dash-due-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.dash-due-title-text {
    font-size: 14px;
    font-weight: 600;
}

.dash-due-freq {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 1px;
}

.dash-due-card.overdue .dash-due-freq {
    color: var(--danger);
}

.dash-due-card.completing {
    background: rgba(0, 200, 83, 0.08);
    border-left-color: var(--success);
}

.dash-due-card.completing .dash-due-title-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.dash-due-card.completing .cal-task-done-btn {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.dash-due-card.completed {
    opacity: 0;
    transform: scale(0.95) translateX(40px);
    transition: opacity 0.4s, transform 0.4s;
}

/* ── Dashboard Setup Prompt ────────────────────────────────────────── */

.dash-setup-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(0, 180, 216, 0.08);
    border: none;
    border-radius: var(--radius-card);
    padding: 16px 18px;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s;
    box-shadow: 0 2px 16px rgba(0, 180, 216, 0.1);
}

.dash-setup-card:active {
    transform: scale(0.98);
    background: rgba(0, 180, 216, 0.15);
}

.dash-setup-icon {
    flex-shrink: 0;
}

.dash-setup-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.dash-setup-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}
