/* style.css — Food Tracker */

:root {
    --bg: #121212;
    --surface: #1e1e1e;
    --surface-2: #2c2c2c;
    --border: #2f2f2f;

    --text: #ffffff;
    --text-2: rgba(255, 255, 255, 0.70);
    --text-3: rgba(255, 255, 255, 0.42);

    --blue: #1565c0;
    --blue-hover: #1b74d6;
    --blue-light: #64a5f5;
    --teal: #03dac6;

    --green: #4caf50;
    --amber: #ffc107;
    --red: #ff5252;

    --radius: 14px;
    --pad: 16px;
}

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

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textbox;
    appearance: textbox;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

/* Fixed so the on-screen keyboard can never scroll the whole document away —
   the app is sized to the visible viewport instead (see --app-h). */
body {
    position: fixed;
    inset: 0;
    width: 100%;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.4;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

/* ── App shell / screens ────────────────────────────────── */

/* --app-h tracks the visual viewport (set in script.js), so when the keyboard
   opens the app shrinks to the space above it rather than shifting off-screen. */
.app {
    position: relative;
    max-width: 520px;
    margin: 0 auto;
    height: 100dvh;
    height: var(--app-h, 100dvh);
    overflow: hidden;
    background: var(--bg);
}

@media (min-width: 560px) {
    .app {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.screen--sub {
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.26s;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.45);
}

.screen--sub.active {
    transform: translateX(0);
    visibility: visible;
}

.screen-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: var(--pad);
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* Home needs extra clearance so the FABs never cover the last entry. */
#home-body {
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

.screen-body.flush {
    padding: 0 0 8px;
}

/* ── Docked footer (save button) ────────────────────────── */

.form-dock {
    flex-shrink: 0;
    padding: 10px var(--pad);
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: var(--bg);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.35);
}

.form-dock .btn-lg {
    margin-top: 0;
}

.form-dock .error-msg:not(:empty) {
    margin: 0 0 8px;
}

/* ── App bar ────────────────────────────────────────────── */

.appbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 8px 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top));
    flex-shrink: 0;
}

.appbar h1 {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.01em;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appbar .back {
    margin-left: -8px;
    margin-right: 4px;
}

.appbar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s;
    flex-shrink: 0;
}

.icon-btn:active,
.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

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

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: var(--pad);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-2);
    margin: 24px 0 8px;
}

/* ── Progress tracker ───────────────────────────────────── */

.progress-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.prog-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    gap: 10px;
}

.prog-label {
    font-weight: 600;
    font-size: 16px;
}

.prog-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.prog-value.on-target {
    color: var(--green);
}

.prog-track {
    position: relative;
    height: 20px;
}

.prog-bg {
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    height: 12px;
    background: #424242;
    border-radius: 8px;
}

.prog-fill {
    position: absolute;
    top: 4px;
    left: 0;
    height: 12px;
    border-radius: 8px;
    transition: width 0.4s ease, background 0.2s;
}

.prog-fill.green {
    background: var(--green);
}

.prog-fill.amber {
    background: var(--amber);
}

.prog-fill.red {
    background: var(--red);
}

.prog-marker {
    position: absolute;
    top: 0;
    width: 2px;
    height: 20px;
    border-radius: 1px;
    transform: translateX(-1px);
}

.prog-marker.amber {
    background: rgba(255, 193, 7, 0.9);
}

.prog-marker.green {
    background: rgba(76, 175, 80, 0.9);
}

/* ── Entry cards ────────────────────────────────────────── */

.entries-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.entry-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border-radius: 12px;
    padding: 14px var(--pad);
    cursor: pointer;
    transition: background 0.12s;
}

.entry-card:active,
.entry-card:hover {
    background: #262626;
}

.entry-main {
    flex: 1;
    min-width: 0;
}

.entry-name {
    font-weight: 600;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-time {
    font-size: 14px;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.entry-macros {
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.entry-cal {
    color: var(--blue-light);
    font-weight: 600;
    font-size: 15px;
}

.entry-pro {
    color: var(--teal);
    font-size: 13px;
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-3);
    font-size: 16px;
    line-height: 1.7;
}

/* ── Pull to refresh ────────────────────────────────────── */

.ptr {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 4;
    transform: translateY(-46px);
    opacity: 0;
}

.ptr.settling {
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.ptr-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    display: grid;
    place-content: center;
}

.ptr-arc {
    width: 18px;
    height: 18px;
    border: 2.5px solid transparent;
    border-top-color: var(--blue-light);
    border-right-color: var(--blue-light);
    border-radius: 50%;
}

.ptr.refreshing .ptr-arc {
    animation: spin 0.7s linear infinite;
}

/* ── FABs ───────────────────────────────────────────────── */

.fab-stack {
    position: absolute;
    right: var(--pad);
    bottom: calc(var(--pad) + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    z-index: 5;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* The snackbar and the FABs share the bottom edge. Lift the FABs while a toast
   is showing so "Add Food" stays tappable right after logging something. */
.app.toast-open .fab-stack {
    transform: translateY(-62px);
}

.fab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 15px 20px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
    transition: background 0.12s, transform 0.08s;
}

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

.fab:hover {
    background: var(--blue-hover);
}

/* ── Add / Edit screen ──────────────────────────────────── */

.source-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 0 0 14px;
}

.source-btn {
    flex: 1;
    max-width: 150px;
    background: var(--surface-2);
    border: none;
    border-radius: 12px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, transform 0.08s;
}

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

.source-btn:hover {
    background: #363636;
}

.source-btn svg {
    color: var(--blue-light);
}

.image-preview {
    position: relative;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
}

.image-preview img {
    width: 100%;
    max-height: 170px;
    object-fit: cover;
    display: block;
}

.img-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.img-analyzing {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--blue-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* The Add Food form is deliberately sized to fit whole with the keyboard up,
   so nothing has to resize (and shift) when it opens. At full height the
   slack simply falls below the form. */
.analyze-row {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.btn-analyze {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--blue-light);
    color: var(--blue-light);
    border-radius: 999px;
    padding: 11px 22px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s;
}

.btn-analyze:hover:not(:disabled) {
    background: rgba(100, 165, 245, 0.12);
}

.btn-analyze:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── Material-ish text fields ───────────────────────────── */

.field {
    position: relative;
    flex: 1;
    margin-bottom: 14px;
}

.field input,
.field select {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
    color: var(--text);
    font-family: inherit;
    font-size: 17px;
    padding: 18px 0 8px;
    border-radius: 0;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-bottom-color: var(--blue-light);
    border-bottom-width: 2px;
    padding-bottom: 7px;
}

.field label {
    position: absolute;
    left: 0;
    top: 18px;
    color: var(--text-3);
    font-size: 17px;
    pointer-events: none;
    transition: transform 0.15s ease, color 0.15s ease;
    transform-origin: left top;
}

.field input:focus+label,
.field input:not(:placeholder-shown)+label {
    transform: translateY(-18px) scale(0.75);
    color: var(--blue-light);
}

.field input:not(:focus):not(:placeholder-shown)+label {
    color: var(--text-3);
}

.field-row {
    display: flex;
    gap: 18px;
}

.select-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='0.6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    cursor: pointer;
}

.select-field select option {
    background: var(--surface-2);
    color: var(--text);
}

/* ── Checkbox ───────────────────────────────────────────── */

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    padding: 2px 0 4px;
    font-size: 16px;
}

/* Outlined box with a drawn tick — the filled default reads far too heavy
   against the dark background. */
.checkbox-row input {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin: 0;
    border: 2px solid var(--text-3);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    display: grid;
    place-content: center;
    transition: border-color 0.12s ease;
}

.checkbox-row input::before {
    content: "";
    width: 6px;
    height: 11px;
    margin-bottom: 3px;
    border: solid var(--blue-light);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.12s ease-in-out;
}

.checkbox-row input:checked {
    border-color: var(--blue-light);
}

.checkbox-row input:checked::before {
    transform: rotate(45deg) scale(1);
}

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

.btn-filled {
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, transform 0.08s;
}

.btn-filled:hover:not(:disabled) {
    background: var(--blue-hover);
}

.btn-filled:active:not(:disabled) {
    transform: scale(0.99);
}

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

.btn-lg {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 22px;
    font-size: 17px;
    letter-spacing: 0.03em;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-2);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-text:hover {
    background: rgba(255, 255, 255, 0.07);
}

.btn-text.primary {
    color: var(--blue-light);
}

.btn-text.danger {
    color: var(--red);
}

/* ── Templates ──────────────────────────────────────────── */

.template-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px var(--pad);
    transition: background 0.12s;
}

.template-row:active {
    background: rgba(255, 255, 255, 0.05);
}

.template-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.template-name {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 7px;
    line-height: 1.35;
}

.template-name .recur-icon {
    color: var(--green);
    display: inline-flex;
    flex-shrink: 0;
}

.template-macros {
    font-size: 14px;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    margin-top: 1px;
}

.template-btn {
    background: none;
    border: none;
    color: var(--text-2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}

.template-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.template-btn.add:hover {
    color: var(--blue-light);
}

.search-dock {
    position: relative;
    flex-shrink: 0;
    padding: 10px var(--pad);
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: var(--bg);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.35);
}

.search-dock input {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 16px;
    padding: 13px 40px 13px 44px;
}

.search-dock input:focus {
    outline: none;
    border-color: var(--blue-light);
}

.search-icon {
    position: absolute;
    left: calc(var(--pad) + 15px);
    top: 50%;
    transform: translateY(-50%);
    margin-top: calc(env(safe-area-inset-bottom) / -2);
    color: var(--text-2);
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: calc(var(--pad) + 8px);
    top: 50%;
    transform: translateY(-50%);
    margin-top: calc(env(safe-area-inset-bottom) / -2);
    background: none;
    border: none;
    color: var(--text-2);
    font-size: 22px;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
}

/* ── History ────────────────────────────────────────────── */

.hist-week {
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.hist-week-head,
.hist-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px var(--pad);
    cursor: pointer;
    user-select: none;
}

.hist-week-title,
.hist-day-title {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.hist-week-title {
    font-size: 17px;
    font-weight: 600;
}

.hist-day-head {
    padding-left: 22px;
}

.hist-day-title {
    font-size: 15px;
    font-weight: 500;
}

.hist-caret {
    color: var(--text-3);
    transition: transform 0.16s;
    flex-shrink: 0;
}

.hist-caret.open {
    transform: rotate(90deg);
}

.hist-day {
    border-top: 1px solid var(--border);
}

.hist-avg-label {
    font-size: 12px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hist-entries {
    padding: 2px var(--pad) 10px 34px;
}

.hist-entry {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    font-size: 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hist-entry:last-child {
    border-bottom: none;
}

.hist-entry .he-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hist-entry .he-macros {
    color: var(--text-3);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    font-size: 14px;
}

.status-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.status.green {
    color: var(--green);
}

.status.amber {
    color: var(--amber);
}

.status.red {
    color: var(--red);
}

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

.stats-row {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-bottom: 14px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 14px;
    color: var(--text-2);
    margin-top: 2px;
}

.stats-updated {
    color: var(--blue-light);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.stats-note {
    color: var(--text-3);
    font-size: 13px;
    font-style: italic;
    text-align: center;
    margin-top: 3px;
}

/* ── Bottom sheet ───────────────────────────────────────── */

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.sheet-backdrop.hidden,
.dialog-backdrop.hidden {
    display: none;
}

.sheet {
    width: 100%;
    max-width: 520px;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    padding: 8px 0 calc(12px + env(safe-area-inset-bottom));
    animation: sheet-up 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes sheet-up {
    from {
        transform: translateY(100%);
    }
}

.sheet-handle {
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
    margin: 6px auto 12px;
}

.sheet-item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    width: 100%;
    background: none;
    border: none;
    color: var(--text);
    font-family: inherit;
    text-align: left;
    padding: 14px 22px;
    cursor: pointer;
    transition: background 0.12s;
}

.sheet-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.sheet-icon {
    color: var(--text-2);
    flex-shrink: 0;
    margin-top: 1px;
}

.sheet-item strong {
    display: block;
    font-size: 16px;
    font-weight: 500;
}

.sheet-item em {
    display: block;
    font-style: normal;
    font-size: 13px;
    color: var(--text-3);
    margin-top: 1px;
}

.sheet-item.danger,
.sheet-item.danger .sheet-icon {
    color: var(--red);
}

.sheet-item.recurring-on .sheet-icon {
    color: var(--green);
}

/* ── Dialogs ────────────────────────────────────────────── */

.dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.dialog {
    background: #262626;
    border-radius: var(--radius);
    padding: 22px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.dialog h3 {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 14px;
}

.dialog p {
    color: var(--text-2);
    font-size: 15px;
    margin-bottom: 8px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 10px;
}

/* ── Snackbar ───────────────────────────────────────────── */

.toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(16px + env(safe-area-inset-bottom));
    background: #323232;
    color: #fff;
    padding: 13px 18px;
    border-radius: 8px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 18px;
    z-index: 300;
    max-width: calc(100% - 32px);
    cursor: pointer;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
    width: calc(100% - 32px);
    max-width: 488px;
    animation: toast-up 0.2s ease;
}

@keyframes toast-up {
    from {
        opacity: 0;
        transform: translate(-50%, 12px);
    }
}

.toast.hidden {
    display: none;
}

.toast span {
    flex: 1;
    min-width: 0;
}

.toast-action {
    background: none;
    border: none;
    color: var(--blue-light);
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    flex-shrink: 0;
}

.toast-action.hidden {
    display: none;
}

/* ── Misc ───────────────────────────────────────────────── */

.hidden {
    display: none !important;
}

.error-msg {
    color: var(--red);
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
}

.error-msg:empty {
    margin: 0;
}

.skeleton-bar {
    height: 46px;
    background: var(--surface-2);
    border-radius: 8px;
    opacity: 0.5;
}

.progress-card .skeleton-bar+.skeleton-bar {
    margin-top: 20px;
}

.skeleton-card {
    height: 66px;
    background: var(--surface);
    border-radius: 12px;
    opacity: 0.6;
}

/* ── Login ──────────────────────────────────────────────── */

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100dvh;
    height: var(--app-h, 100dvh);
    padding: 24px;
}

.login-box {
    text-align: center;
    width: 100%;
    max-width: 300px;
}

.login-box h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
}

.login-box p {
    font-size: 15px;
    color: var(--text-3);
    margin-bottom: 22px;
}

.login-box form {
    display: flex;
    gap: 8px;
}

.login-box input {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 16px;
    padding: 12px 14px;
}

.login-box input:focus {
    outline: none;
    border-color: var(--blue-light);
}
