/* Breakpoints used across the app: 520 / 620 / 760 / 1000. Don't add a fifth without folding it into one of these. */

:root {
    color-scheme: light;
    --ink: #0b1737;
    --muted: #63708a;
    --muted-light: #98a2b5;
    --surface: #fff;
    --surface-subtle: #f7f9fc;
    --border: #e5e9f1;
    --border-strong: #ccd4e2;
    --accent: #0b57e3;
    --accent-hover: #0849c3;
    --accent-soft: #edf4ff;
    --accent-focus: rgba(11, 87, 227, .16);
    --success: #249b68;
    --success-strong: #16734c;
    --success-soft: #eaf8f1;
    --danger: #b52d3a;
    --danger-soft: #fff3f4;
    --danger-border: #f2bdc2;
    --warning: #d08a00;
    --warning-strong: #8a5a00;
    --warning-soft: #fff8e8;
    --warning-border: #f0d9a8;
    --scrim: rgba(11, 18, 32, .52);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--surface);
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
    font-family: inherit;
}

a, button {
    -webkit-tap-highlight-color: transparent;
}

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

h1:focus {
    outline: none;
}

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: .82rem;
    font-weight: 720;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:disabled {
    opacity: .55;
    cursor: wait;
}

.button-primary {
    color: white;
    background: var(--accent);
    box-shadow: 0 6px 16px rgba(11, 87, 227, .18);
}

.button-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.button-secondary {
    border-color: var(--border-strong);
    color: var(--ink);
    background: var(--surface);
}

.button-secondary:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.icon-button {
    width: 36px;
    height: 36px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.icon-button:hover:not(:disabled) {
    color: var(--ink);
    background: var(--surface-subtle);
}

.icon-button:disabled {
    opacity: .3;
    cursor: default;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.validation-message {
    color: var(--danger);
    font-size: .72rem;
}

.invalid:not([type=checkbox]) {
    border-color: var(--danger) !important;
}

.route-loading {
    min-height: 100vh;
    display: grid;
    place-items: center;
    color: var(--muted);
}

.route-error {
    min-height: 100vh;
    max-width: 34rem;
    margin: 0 auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
}

.route-error h1 {
    margin: 0;
    font-size: 1.35rem;
    color: var(--ink);
}

.route-error p {
    margin: 0;
    color: var(--muted);
}

#blazor-error-ui {
    position: fixed;
    z-index: 1000;
    right: 18px;
    bottom: 18px;
    display: none;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border: 1px solid #f0b9bf;
    border-radius: 10px;
    color: #84222c;
    background: #fff4f5;
    box-shadow: 0 15px 40px rgba(70, 10, 18, .14);
    font-size: .82rem;
}

#blazor-error-ui .reload {
    color: inherit;
    font-weight: 700;
}

#blazor-error-ui .dismiss {
    border: 0;
    color: inherit;
    background: transparent;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Custom properties inherit past a scoped stylesheet's attribute selector, so this is the one
   definition WorkoutRow.razor.css's scoped rules read too. */
.page-shell {
    --workout-columns: 116px minmax(180px, 1fr) 104px 92px 88px 112px 104px;
}

.dialog-backdrop {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--scrim);
    backdrop-filter: blur(3px);
}

.confirm-dialog,
.picker-dialog {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(11, 18, 32, .24);
}

/* Kept off .picker-dialog: its header/search/list/footer children carry their own padding. */
.confirm-dialog {
    padding: 28px;
}

.confirm-dialog h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.28rem;
    letter-spacing: -.025em;
}

.confirm-dialog > p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.55;
}

.dialog-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 12px;
    font-weight: 800;
}

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

.state-panel {
    min-height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.state-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    border-radius: 14px;
    color: var(--accent);
    background: var(--accent-soft);
    font-size: 1.4rem;
    font-weight: 800;
}

.state-panel h2 {
    margin: 0;
    font-size: 1.08rem;
}

.state-panel p {
    margin: 8px 0 20px;
    color: var(--muted);
    font-size: .86rem;
}

.skeleton-row {
    display: grid;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.skeleton-row span {
    height: 12px;
    border-radius: 5px;
    background: linear-gradient(90deg, #eef1f6, #f8f9fb, #eef1f6);
    background-size: 220% 100%;
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    to {
        background-position: -220% 0;
    }
}

.search-box {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    color: var(--muted);
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-focus);
}

.search-box input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-size: .86rem;
}

.badge,
.status,
.status-badge,
.added-badge,
.active-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 720;
}

@media (max-width: 600px) {
    .dialog-backdrop {
        align-items: end;
        padding: 12px;
    }

    .confirm-dialog {
        padding: 22px;
        border-radius: 16px 16px 12px 12px;
    }

    .dialog-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .dialog-actions .button {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
