:root {
    --graphite-1000: #060708;
    --graphite-950: #0A0C0F;
    --graphite-900: #0E1115;
    --graphite-850: #12161A;
    --graphite-800: #171C21;
    --graphite-700: #1E242A;
    --graphite-600: #272E35;
    --ink-0: #F5F7F9;
    --ink-1: #C5CDD3;
    --ink-2: #98A2AA;
    --ink-3: #6C757D;
    --ink-4: #495159;
    --energy: #FF7D3C;
    --energy-deep: #7A2D12;
    --protein: #6FA8C9;
    --carbs: #E6A946;
    --fat: #A98AD8;
    --over: #FF5247;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --sans: "Archivo", system-ui, -apple-system, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--graphite-950);
    color: var(--ink-1);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

#app {
    height: 100%;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input {
    font-family: inherit;
}

.nw-icon {
    display: block;
}

/* The SVG carries width/height="236"; letting it fill its wrapper instead means
   a single rule (shrinking .ring-wrap on short screens) resizes the whole ring.
   No effect at the default 236px wrapper size. */
.energy-ring {
    display: block;
    width: 100%;
    height: 100%;
}

/* InputFile renders its own <input> outside Home's scoped CSS, so hide it here. */
.photo-btn input[type="file"] {
    display: none;
}

/* Loading splash (before Blazor boots) — animated NoWeigh lockup */
.boot {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: var(--graphite-950);
}

.boot-logo {
    width: min(58vw, 280px);
    height: auto;
    overflow: visible;
}

.boot-word {
    font-family: var(--sans);
    font-weight: 900;
    letter-spacing: -0.04em;
    font-size: 100px;
    opacity: 0;
    animation: boot-word 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

/* The orange strike "drives in" from the left, then loops while loading. */
.boot-strike {
    transform-box: fill-box;
    transform-origin: left center;
    transform: scaleX(0);
    animation: boot-strike 2.6s cubic-bezier(0.65, 0, 0.35, 1) 0.45s infinite;
}

.boot-cap {
    transform-box: fill-box;
    transform-origin: center center;
    opacity: 0;
    animation: boot-cap 2.6s cubic-bezier(0.65, 0, 0.35, 1) 0.45s infinite;
}

@keyframes boot-word {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes boot-strike {
    0%   { transform: scaleX(0); }
    26%  { transform: scaleX(1.03); }
    32%  { transform: scaleX(1); }
    80%  { transform: scaleX(1); opacity: 1; }
    92%  { transform: scaleX(1); opacity: 0; }
    93%  { transform: scaleX(0); opacity: 0; }
    100% { transform: scaleX(0); opacity: 0; }
}

@keyframes boot-cap {
    0%, 28% { opacity: 0; transform: scale(0); }
    36%     { opacity: 1; transform: scale(1.12); }
    42%     { opacity: 1; transform: scale(1); }
    80%     { opacity: 1; }
    92%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .boot-word, .boot-strike, .boot-cap {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

.loading-progress-text {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--ink-3);
    text-transform: uppercase;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

#blazor-error-ui {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    padding: 14px 20px;
    background: var(--over);
    color: #fff;
    font-size: 13px;
    z-index: 1000;
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    color: #fff;
    margin-left: 10px;
    cursor: pointer;
    text-decoration: underline;
}

.pwa-update {
    position: fixed;
    left: 50%;
    bottom: calc(var(--composer-h, 150px) + 12px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 45;
    width: min(calc(100% - 32px), 420px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px 12px 14px;
    background: rgba(14, 17, 21, 0.96);
    color: var(--ink-1);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pwa-update span {
    min-width: 0;
    font-size: 13px;
    line-height: 1.35;
}

.pwa-update button {
    flex: none;
    height: 34px;
    padding: 0 14px;
    border-radius: 17px;
    background: var(--energy);
    color: #1A0A03;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.pwa-update button:disabled {
    opacity: 0.65;
}
