:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #23232d;
    background: #f7f7fa;
    font-synthesis: none;
    --surface: #ffffff;
    --surface-soft: #f7f7fa;
    --border: #e7e7ee;
    --muted: #737384;
    --text: #23232d;
    --accent: #5b5ce2;
    --accent-soft: #eeeefe;
    --success: #27a877;
    --warning: #e49b27;
    --danger: #d44a62;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

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

button,
input {
    font: inherit;
}

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

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    display: flex;
    width: 260px;
    flex-direction: column;
    padding: 24px 18px;
    border-right: 1px solid var(--border);
    background: #fbfbfd;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 10px 28px;
    font-size: 1.05rem;
    font-weight: 750;
}

.brand-mark {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    font-weight: 800;
    box-shadow: 0 8px 20px rgb(91 92 226 / 22%);
}

.brand-mark.large {
    width: 52px;
    height: 52px;
    margin: 0 auto;
    border-radius: 15px;
    font-size: 1.25rem;
}

.nav-section {
    display: grid;
    gap: 4px;
}

.nav-link,
.project-link {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #5d5d6c;
    font-size: .92rem;
    text-align: left;
}

.nav-link span {
    width: 18px;
    color: #8b8b9b;
    text-align: center;
}

.nav-link.active {
    background: var(--accent-soft);
    color: #4445c7;
    font-weight: 650;
}

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

.nav-count {
    min-width: 22px;
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fff0f2;
    color: var(--danger);
    font-size: .68rem;
    line-height: 1.5;
    text-align: center;
}

.nav-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 30px 10px 8px;
    color: #8b8b9b;
    font-size: .75rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav-heading button {
    border: 0;
    background: transparent;
    color: #8b8b9b;
    font-size: 1.1rem;
}

.project-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.project-link.active {
    background: #f0f0f8;
    color: #414253;
    font-weight: 650;
}

.project-management-link {
    margin-top: 8px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 10px 10px;
}

.project-create {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    margin: 6px 8px 10px;
}

.project-create input {
    min-width: 0;
    height: 36px;
    padding: 0 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: 0;
}

.project-create button {
    width: 36px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: white;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 14px 10px 2px;
    border-top: 1px solid var(--border);
}

.sidebar-footer > span:last-child {
    display: grid;
    gap: 2px;
}

.sidebar-footer strong {
    font-size: .85rem;
}

.sidebar-footer small {
    color: var(--muted);
    font-size: .72rem;
}

.avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #e9e9f8;
    color: #5354b7;
    font-size: .72rem;
    font-weight: 750;
}

.main-content {
    min-height: 100vh;
    margin-left: 260px;
}

.app-shell.unauthenticated .main-content {
    margin-left: 0;
}

.project-empty {
    margin: 8px 12px;
    color: var(--muted);
    font-size: .8rem;
}

.task-page {
    width: min(900px, calc(100% - 64px));
    margin: 0 auto;
    padding: 64px 0 100px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--accent);
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

.page-header h1 {
    margin-bottom: 7px;
    font-size: clamp(2rem, 5vw, 2.7rem);
    letter-spacing: -.045em;
}

.page-header p {
    margin-bottom: 0;
    color: var(--muted);
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
}

.sync-button {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: .78rem;
}

.secondary-button,
.danger-button {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: #555562;
    font-weight: 700;
}

.danger-button {
    border-color: rgb(212 74 98 / 22%);
    background: #fff7f8;
    color: var(--danger);
}

.secondary-button:disabled,
.danger-button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.delete-button:not(:disabled) {
    border-color: rgb(212 74 98 / 28%);
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.sync-dot.offline {
    background: #9b9baa;
}

.sync-dot.pending {
    background: var(--warning);
}

.sync-dot.error {
    background: var(--danger);
}

.mobile-project-toolbar,
.mobile-project-filter {
    display: none;
}

.task-search-panel {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 8px 28px rgb(41 41 64 / 4%);
}

.task-search-query {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 11px;
    min-height: 46px;
    padding: 0 13px;
    border: 1px solid #dcdce5;
    border-radius: 11px;
    color: var(--accent);
}

.task-search-query:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(91 92 226 / 12%);
}

.task-search-query input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.task-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.task-filter-grid label {
    display: grid;
    gap: 6px;
    color: #60606e;
    font-size: .72rem;
    font-weight: 700;
}

.task-filter-grid select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    color: var(--text);
    font: inherit;
    font-weight: 500;
}

.task-filter-footer {
    display: flex;
    min-height: 30px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: .78rem;
}

.filter-clear-button {
    min-height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--accent);
    font-weight: 700;
}

.filter-clear-button:disabled {
    cursor: default;
    opacity: .45;
}

.project-management {
    display: grid;
    gap: 16px;
}

.project-new-card,
.project-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 8px 28px rgb(41 41 64 / 4%);
}

.project-new-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 1fr);
    align-items: center;
    gap: 24px;
    padding: 20px;
}

.project-new-card > div:first-child {
    display: grid;
    gap: 5px;
}

.project-new-card span,
.project-card-main span,
.project-section-heading p {
    color: var(--muted);
    font-size: .8rem;
}

.project-new-fields {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.project-new-fields input,
.project-edit-form input:not([type="color"]) {
    min-width: 0;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #dcdce5;
    border-radius: 10px;
    outline: 0;
    background: white;
    color: var(--text);
}

.project-new-fields input:focus,
.project-edit-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(91 92 226 / 12%);
}

.project-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-top: 12px;
}

.project-section-heading h2 {
    margin-bottom: 4px;
    font-size: 1.05rem;
}

.project-section-heading p {
    margin-bottom: 0;
}

.archived-heading {
    margin-top: 30px;
}

.project-card-list {
    display: grid;
    gap: 10px;
}

.project-card {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
}

.project-card-main {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
}

.project-card-main > div {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.project-card-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card-color {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgb(35 35 45 / 5%);
}

.project-card-actions,
.project-edit-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.project-delete-confirmation {
    display: grid;
    flex: 0 0 auto;
    justify-items: end;
    gap: 3px;
    text-align: right;
}

.project-delete-confirmation > strong {
    color: var(--danger);
    font-size: .82rem;
}

.project-delete-confirmation > span {
    color: var(--muted);
    font-size: .72rem;
}

.project-delete-confirmation > div {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.project-edit-form {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(180px, 1fr) minmax(150px, .6fr) auto;
    align-items: end;
    gap: 12px;
}

.project-edit-form label {
    display: grid;
    gap: 6px;
    color: #555562;
    font-size: .76rem;
    font-weight: 700;
}

.project-color-field > span {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 9px;
}

.project-color-field input[type="color"] {
    width: 46px;
    height: 38px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
}

.project-color-field code {
    color: var(--muted);
    font-family: inherit;
    font-size: .76rem;
}

.project-management-empty {
    display: grid;
    min-height: 130px;
    place-content: center;
    justify-items: center;
    gap: 8px;
    border: 1px dashed #dadae5;
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
}

.project-management-empty span {
    font-size: 1.5rem;
}

.project-management-empty p {
    margin-bottom: 0;
}

.project-management-empty.compact {
    min-height: 78px;
}

.project-card-list.archived .project-card {
    background: #fafafd;
}

.quick-add {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    margin-bottom: 20px;
    padding: 0 12px 0 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 8px 28px rgb(41 41 64 / 5%);
}

.quick-add > span {
    color: var(--accent);
    font-size: 1.25rem;
}

.quick-add input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.quick-add input::placeholder {
    color: #a0a0ad;
}

.quick-add button,
.primary-button {
    min-height: 38px;
    padding: 0 17px;
    border: 0;
    border-radius: 9px;
    background: var(--accent);
    color: white;
    font-weight: 700;
}

.task-list {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.task-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 68px;
    padding: 11px 16px;
    border-bottom: 1px solid #eeeeF3;
    transition: background .15s ease, box-shadow .15s ease;
}

.task-row:last-child {
    border-bottom: 0;
}

.task-row:hover {
    background: #fafafe;
}

.task-row.drop-target {
    position: relative;
    z-index: 1;
    box-shadow: inset 0 0 0 2px var(--accent);
}

.complete-button {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1.5px solid #c5c5d2;
    border-radius: 50%;
    background: white;
    color: white;
    font-size: .72rem;
}

.task-row.completed .complete-button {
    border-color: var(--success);
    background: var(--success);
}

.task-row.overdue {
    background: #fffafb;
}

.task-row.overdue:hover {
    background: #fff6f8;
}

.task-order-actions {
    display: flex;
    min-width: 70px;
    align-items: center;
    gap: 2px;
}

.drag-handle,
.order-step-button {
    display: grid;
    width: 22px;
    height: 28px;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #b1b1bd;
    font-size: .8rem;
    line-height: 1;
}

.drag-handle {
    cursor: grab;
    font-size: 1rem;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle:hover,
.drag-handle:focus,
.order-step-button:hover,
.order-step-button:focus {
    outline: 0;
    background: var(--surface-soft);
    color: var(--accent);
}

.order-step-button:disabled {
    cursor: default;
    opacity: .25;
}

.task-main {
    min-width: 0;
}

.task-main strong {
    display: block;
    overflow: hidden;
    margin-bottom: 5px;
    font-size: .94rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-row.completed .task-main strong {
    color: #9999a6;
    text-decoration: line-through;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    color: #90909e;
    font-size: .73rem;
}

.label-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.label-chip i,
.label-option i {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.task-meta .priority {
    color: var(--danger);
}

.task-meta .overdue-chip {
    color: var(--danger);
    font-weight: 700;
}

.task-row-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.more-button,
.plan-button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #aaaab6;
}

.more-button:hover,
.plan-button:hover,
.plan-button.active {
    background: var(--surface-soft);
    color: var(--accent);
}

.plan-button {
    font-size: 1rem;
}

.task-plan-menu {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid #e1e1ec;
    border-radius: 10px;
    background: var(--surface-soft);
}

.task-plan-menu > span {
    margin-right: 3px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.task-plan-menu button,
.quick-plan-fieldset button {
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: #5b5b68;
    font-size: .75rem;
    font-weight: 700;
}

.task-plan-menu button:hover,
.quick-plan-fieldset button:hover,
.task-plan-menu button.selected,
.quick-plan-fieldset button.selected {
    border-color: rgb(91 92 226 / 30%);
    background: rgb(91 92 226 / 9%);
    color: var(--accent);
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    justify-content: flex-end;
    background: rgb(31 31 44 / 30%);
    backdrop-filter: blur(2px);
}

.task-drawer {
    width: min(500px, 100%);
    height: 100%;
    overflow-y: auto;
    padding: 30px;
    background: var(--surface);
    box-shadow: -20px 0 60px rgb(31 31 44 / 15%);
}

.drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 26px;
}

.drawer-header h2 {
    margin-bottom: 0;
    font-size: 1.5rem;
}

.drawer-header > button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 1.4rem;
}

.task-form {
    display: grid;
    gap: 19px;
}

.quick-plan-fieldset {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.quick-plan-fieldset legend {
    margin-bottom: 7px;
    color: #555562;
    font-size: .78rem;
    font-weight: 650;
}

.quick-plan-fieldset > div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.task-form label {
    display: grid;
    gap: 7px;
    color: #555562;
    font-size: .78rem;
    font-weight: 650;
}

.label-fieldset {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.label-fieldset legend {
    margin-bottom: 8px;
    color: var(--text);
    font-size: .82rem;
    font-weight: 700;
}

.label-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.label-option {
    display: inline-flex !important;
    min-height: 34px;
    flex-direction: row !important;
    align-items: center;
    gap: 7px !important;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    cursor: pointer;
    font-size: .78rem !important;
}

.label-option input {
    width: 14px;
    min-height: 0;
    height: 14px;
    margin: 0;
}

.inline-create {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.inline-create button {
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--accent);
    font-weight: 700;
}

.recurrence-interval {
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: center;
    gap: 10px;
}

.weekday-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.weekday-picker label {
    display: inline-flex !important;
    min-height: 34px;
    flex-direction: row !important;
    align-items: center;
    gap: 5px !important;
    padding: 0 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    cursor: pointer;
    font-size: .74rem !important;
}

.weekday-picker input {
    width: 13px;
    min-height: 0;
    height: 13px;
    margin: 0;
}

.task-form input,
.task-form select,
.task-form textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #dcdce5;
    border-radius: 10px;
    outline: 0;
    background: white;
    color: var(--text);
    font: inherit;
    font-weight: 400;
}

.task-form textarea {
    min-height: 220px;
    resize: vertical;
    line-height: 1.55;
}

.task-form input:focus,
.task-form select:focus,
.task-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(91 92 226 / 12%);
}

.task-form small {
    color: var(--muted);
    font-weight: 400;
}

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

.save-task {
    min-height: 46px;
    margin-top: 4px;
}

.empty-state,
.state-panel {
    padding: 72px 24px;
    text-align: center;
}

.empty-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 50%;
    background: #e7f6f0;
    color: var(--success);
    font-size: 1.3rem;
}

.empty-state h2,
.state-panel h1 {
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.empty-state p,
.state-panel p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .86rem;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(300px, 1fr) minmax(360px, 480px);
    align-items: center;
    gap: clamp(40px, 9vw, 130px);
    padding: 64px clamp(32px, 8vw, 120px);
    background:
        radial-gradient(circle at 20% 20%, rgb(91 92 226 / 12%), transparent 34%),
        var(--surface-soft);
}

.login-copy h1 {
    max-width: 650px;
    margin-bottom: 22px;
    font-size: clamp(2.6rem, 6vw, 5rem);
    line-height: .99;
    letter-spacing: -.065em;
}

.login-copy p {
    max-width: 560px;
    color: var(--muted);
    font-size: 1.06rem;
    line-height: 1.65;
}

.login-card {
    display: grid;
    gap: 19px;
    padding: 36px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgb(255 255 255 / 92%);
    box-shadow: 0 24px 70px rgb(41 41 64 / 10%);
}

.login-card h2 {
    margin: 18px 0 7px;
    font-size: 1.55rem;
}

.login-card p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .83rem;
}

.login-card label {
    display: grid;
    gap: 7px;
    color: #555562;
    font-size: .78rem;
    font-weight: 650;
}

.login-card label > input:not([type="checkbox"]) {
    min-height: 46px;
    padding: 0 13px;
    border: 1px solid #dcdce5;
    border-radius: 10px;
    outline: 0;
    background: white;
}

.login-card label > input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(91 92 226 / 12%);
}

.login-card .check-label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 500;
}

.form-error {
    color: var(--danger) !important;
}

.primary-button {
    min-height: 46px;
}

.primary-button:disabled {
    cursor: wait;
    opacity: .65;
}

.mobile-nav {
    display: none;
}

.boot-screen {
    display: grid;
    min-height: 100vh;
    place-content: center;
    justify-items: center;
    gap: 18px;
}

.boot-logo {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 17px;
    background: var(--accent);
    color: white;
    font-size: 1.3rem;
    font-weight: 800;
}

.boot-loader {
    width: 28px;
    height: 28px;
    border: 3px solid #ddddf5;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.boot-screen p {
    color: var(--muted);
    font-size: .85rem;
}

#blazor-error-ui {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 100;
    display: none;
    padding: 14px 18px;
    border-radius: 10px;
    background: #fff2f4;
    color: #8f2940;
    box-shadow: 0 8px 30px rgb(0 0 0 / 12%);
}

#blazor-error-ui .dismiss {
    border: 0;
    background: transparent;
}

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

@media (max-width: 800px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .task-page {
        width: auto;
        padding: calc(28px + env(safe-area-inset-top)) 18px calc(98px + env(safe-area-inset-bottom));
    }

    .page-header {
        display: block;
    }

    .page-header-actions {
        justify-content: flex-start;
        margin-top: 18px;
    }

    .mobile-project-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: 10px;
        margin: -8px 0 18px;
    }

    .mobile-project-filter {
        display: grid;
        gap: 6px;
        color: var(--muted);
        font-size: .72rem;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .mobile-project-filter select {
        min-height: 44px;
        padding: 0 13px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface);
        color: var(--text);
        font: inherit;
        font-size: .9rem;
        font-weight: 600;
        letter-spacing: normal;
        text-transform: none;
    }

    .mobile-project-button {
        display: inline-flex;
        min-height: 44px;
        align-items: center;
        gap: 5px;
        padding: 0 13px;
        border: 1px solid rgb(91 92 226 / 18%);
        border-radius: 12px;
        background: rgb(91 92 226 / 8%);
        color: var(--accent);
        font-size: .82rem;
        font-weight: 750;
    }

    .task-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .task-order-actions {
        min-width: 58px;
    }

    .drag-handle {
        display: none;
    }

    .order-step-button {
        width: 28px;
        height: 32px;
        background: var(--surface-soft);
    }

    .project-new-card {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .project-edit-form {
        grid-template-columns: 1fr;
    }

    .mobile-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 20;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: end;
        min-height: calc(67px + env(safe-area-inset-bottom));
        padding: 8px 8px calc(7px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        background: rgb(255 255 255 / 94%);
        backdrop-filter: blur(18px);
    }

    .mobile-nav a,
    .mobile-nav button {
        display: grid;
        justify-items: center;
        gap: 4px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #8a8a98;
        font-size: .62rem;
    }

    .mobile-nav a span,
    .mobile-nav button span {
        font-size: 1rem;
    }

    .mobile-nav a.active,
    .mobile-nav button.active {
        color: var(--accent);
    }

    .mobile-nav .mobile-add {
        display: grid;
        width: 44px;
        height: 44px;
        margin: -15px auto 0;
        place-items: center;
        border: 0;
        border-radius: 14px;
        background: var(--accent);
        color: white;
        font-size: 1.35rem;
        box-shadow: 0 8px 22px rgb(91 92 226 / 28%);
    }

    .login-shell {
        display: block;
        padding: 40px 20px 80px;
    }

    .login-copy {
        margin-bottom: 34px;
    }

    .login-copy h1 {
        font-size: 2.65rem;
    }

    .login-card {
        padding: 25px;
    }

    .task-drawer {
        padding: calc(24px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 2.1rem;
    }

    .quick-add {
        grid-template-columns: auto 1fr;
    }

    .quick-add button {
        display: none;
    }

    .task-row {
        grid-template-columns: auto auto minmax(0, 1fr) auto;
        gap: 9px;
        padding-right: 9px;
    }

    .task-order-actions {
        min-width: 50px;
    }

    .order-step-button {
        width: 24px;
    }

    .task-row-actions {
        gap: 0;
    }

    .more-button,
    .plan-button {
        width: 34px;
    }

    .task-plan-menu {
        flex-wrap: wrap;
    }

    .task-plan-menu > span {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .project-card-actions,
    .project-edit-actions,
    .project-delete-confirmation,
    .project-delete-confirmation > div {
        width: 100%;
    }

    .project-card-actions button,
    .project-edit-actions button,
    .project-delete-confirmation button {
        flex: 1;
    }

    .project-delete-confirmation {
        justify-items: stretch;
        text-align: left;
    }

    .project-new-fields {
        grid-template-columns: 1fr;
    }

    .task-filter-grid {
        grid-template-columns: 1fr;
    }

    .task-search-panel {
        padding: 14px;
    }

    .task-filter-footer {
        align-items: stretch;
        flex-direction: column;
    }
}
