:root {
    color-scheme: light;
    --page: #fbf7e6;
    --page-accent: #f3eccf;
    --surface: #fffdf7;
    --card: #f3e5a7;
    --card-hover: #f7eab4;
    --field: #ffffff;
    --ink: #171713;
    --muted: #6c685a;
    --line: #171713;
    --soft-line: #d9cfaa;
    --primary: #1d1d18;
    --primary-ink: #ffffff;
    --danger: #a32a21;
    --success: #237a45;
    --focus: #c27616;
    --shadow: 0 9px 25px rgba(52, 43, 13, 0.09);
}

body[data-theme="dark"] {
    color-scheme: dark;
    --page: #171714;
    --page-accent: #24231e;
    --surface: #20201c;
    --card: #403b27;
    --card-hover: #49432c;
    --field: #171714;
    --ink: #f7f4e8;
    --muted: #bbb6a5;
    --line: #f0ead5;
    --soft-line: #55503f;
    --primary: #f1e8bd;
    --primary-ink: #171714;
    --danger: #ff8d80;
    --success: #75d99d;
    --focus: #f3bd59;
    --shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 95% -10%, var(--page-accent), transparent 32rem),
        var(--page);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

button,
input,
select {
    font: inherit;
}

button,
select,
input[type="checkbox"] {
    cursor: pointer;
}

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

.app-header {
    position: sticky;
    z-index: 20;
    top: 0;
    padding: 18px clamp(14px, 2.2vw, 34px) 14px;
    border-bottom: 1px solid var(--soft-line);
    background: color-mix(in srgb, var(--page) 92%, transparent);
    backdrop-filter: blur(16px);
}

.heading-row,
.toolbar,
.summary {
    width: min(1920px, 100%);
    margin-inline: auto;
}

.heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.eyebrow {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(1.65rem, 2.6vw, 2.5rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.schedule-note {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
}

.view-switch {
    display: inline-flex;
    padding: 3px;
    border: 2px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.view-tab {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 850;
    line-height: 1.25;
    text-decoration: none;
    transition: color 120ms ease, background 120ms ease;
}

.view-tab:hover {
    color: var(--ink);
    background: var(--page-accent);
}

.view-tab.is-active {
    color: var(--primary-ink);
    background: var(--primary);
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 16px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.filter-toggle {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid var(--soft-line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 700;
    user-select: none;
}

.filter-toggle input,
.option-toggle input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--primary);
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
    border: 2px solid var(--line);
    border-radius: 12px;
    font-weight: 800;
    transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

.primary-button {
    display: inline-flex;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    color: var(--primary-ink);
    background: var(--primary);
    box-shadow: 3px 3px 0 color-mix(in srgb, var(--line) 24%, transparent);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.icon-button:hover {
    transform: translateY(-1px);
}

.primary-button:disabled,
.task-button:disabled {
    cursor: default;
    opacity: 0.35;
    transform: none;
}

.icon-button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    color: var(--ink);
    background: var(--surface);
}

.summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 11px;
    color: var(--muted);
    font-size: 0.82rem;
}

.summary strong {
    color: var(--ink);
}

.planner-shell {
    width: min(1980px, 100%);
    margin: 0 auto;
    padding: 18px clamp(10px, 1.6vw, 26px) 50px;
}

.task-list {
    display: grid;
    gap: 12px;
}

.task-card {
    position: relative;
    overflow: hidden;
    border: 3px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow);
    transition: background 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.task-card:hover {
    background: var(--card-hover);
}

.task-card.is-completed {
    opacity: 0.64;
}

.task-card.is-completed .name-input {
    text-decoration: line-through;
}

.task-card.is-dragging {
    z-index: 5;
    opacity: 0.48;
    transform: scale(0.995);
}

.task-card.is-saving::after {
    position: absolute;
    z-index: 4;
    top: 7px;
    right: 56px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--card) 80%, transparent);
    content: "";
    animation: pulse 900ms ease-in-out infinite alternate;
}

@keyframes pulse {
    to { opacity: 0.35; }
}

/* Ширины колонок карточки на большом экране:
   перенос 42; название 1.45fr; категория 140; сложность 155; ссылка 1.2fr;
   старт 205; план 105; факт 105; окончание 180; управление 72. */
.task-main {
    display: grid;
    grid-template-columns:
        42px
        minmax(175px, 1.45fr)
        minmax(120px, 140px)
        minmax(135px, 155px)
        minmax(190px, 1.2fr)
        minmax(184px, 205px)
        minmax(92px, 105px)
        minmax(92px, 105px)
        minmax(164px, 180px)
        72px;
    gap: 8px;
    align-items: stretch;
    padding: 8px;
}

body.show-actual-end .task-main {
    grid-template-columns:
        42px
        minmax(175px, 1.45fr)
        minmax(120px, 140px)
        minmax(135px, 155px)
        minmax(190px, 1.2fr)
        minmax(184px, 205px)
        minmax(92px, 105px)
        minmax(92px, 105px)
        minmax(164px, 180px)
        minmax(164px, 180px)
        72px;
}

.reorder-controls {
    display: grid;
    grid-template-rows: 1fr 24px 24px;
    gap: 3px;
}

.drag-handle,
.task-button {
    display: grid;
    min-width: 0;
    place-items: center;
    border: 2px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    background: var(--field);
    font-weight: 900;
    line-height: 1;
}

.drag-handle {
    cursor: grab;
    font-size: 1.2rem;
    letter-spacing: -0.18em;
}

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

.task-button {
    padding: 0;
    font-size: 0.67rem;
}

.field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 7px 11px 8px;
    border: 3px solid var(--line);
    border-radius: 14px;
    background: var(--field);
}

.field-label {
    overflow: hidden;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.field input,
.field select,
.field-output {
    width: 100%;
    min-width: 0;
    min-height: 29px;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-size: 0.94rem;
    font-weight: 750;
}

.field select {
    padding-right: 18px;
}

.field input::placeholder {
    color: color-mix(in srgb, var(--muted) 72%, transparent);
    opacity: 1;
}

.field-output {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.manual-start-field {
    border-color: var(--focus);
}

.manual-start-field input {
    font-weight: 900;
}

.link-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
}

.open-link {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid var(--soft-line);
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
}

.open-link:hover {
    background: var(--page-accent);
}

.gear-button {
    width: 100%;
    height: 35px;
    border-radius: 12px;
    font-size: 1.1rem;
}

.card-actions {
    display: grid;
    grid-template-rows: 1fr 35px;
    gap: 5px;
}

.completion-control {
    display: grid;
    min-height: 34px;
    place-items: center;
    border: 2px solid var(--line);
    border-radius: 11px;
    background: var(--field);
}

.completion-control input {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--success);
}

.gear-button[aria-expanded="true"] {
    color: var(--primary-ink);
    background: var(--primary);
}

.actual-end-field {
    display: none;
}

body.show-actual-end .actual-end-field {
    display: flex;
}

.task-options {
    display: none;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 0 9px 9px 59px;
}

.task-card.is-expanded .task-options {
    display: flex;
}

.option-toggle {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--field);
    font-size: 0.875rem;
    font-weight: 800;
    user-select: none;
}

.delete-task-button {
    min-height: 38px;
    padding: 7px 12px;
    color: var(--danger);
    background: var(--field);
}

.outside-badge {
    position: absolute;
    z-index: 3;
    top: 2px;
    left: 59px;
    padding: 2px 7px;
    border-radius: 0 0 7px 7px;
    color: var(--primary-ink);
    background: var(--primary);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.loading-state,
.empty-state {
    min-height: 190px;
    place-items: center;
    border: 2px dashed var(--soft-line);
    border-radius: 18px;
    color: var(--muted);
    background: color-mix(in srgb, var(--surface) 65%, transparent);
}

.loading-state {
    display: grid;
}

.empty-state {
    display: grid;
    align-content: center;
    gap: 5px;
    text-align: center;
}

.empty-state[hidden],
.loading-state[hidden] {
    display: none;
}

.empty-state strong {
    color: var(--ink);
    font-size: 1.1rem;
}

.confirm-dialog {
    width: min(430px, calc(100% - 28px));
    padding: 0;
    border: 3px solid var(--line);
    border-radius: 18px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.28);
}

.confirm-dialog::backdrop {
    background: rgba(0, 0, 0, 0.46);
    backdrop-filter: blur(3px);
}

.confirm-dialog form {
    padding: 22px;
}

.confirm-dialog h2 {
    margin: 0;
    font-size: 1.35rem;
}

.confirm-dialog p {
    margin: 8px 0 20px;
    color: var(--muted);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

.secondary-button,
.danger-button {
    min-height: 40px;
    padding: 8px 14px;
    color: var(--ink);
    background: var(--surface);
}

.danger-button {
    border-color: var(--danger);
    color: #ffffff;
    background: var(--danger);
}

.toast {
    position: fixed;
    z-index: 100;
    right: 18px;
    bottom: 18px;
    max-width: min(420px, calc(100% - 36px));
    padding: 12px 15px;
    border: 2px solid var(--line);
    border-radius: 12px;
    color: var(--primary-ink);
    background: var(--primary);
    box-shadow: var(--shadow);
    font-weight: 750;
}

.toast.is-error {
    border-color: var(--danger);
    background: var(--danger);
}

.toast[hidden] {
    display: none;
}

.statistics-shell {
    display: grid;
    width: min(1720px, 100%);
    gap: 18px;
    margin: 0 auto;
    padding: 22px clamp(12px, 2vw, 32px) 56px;
}

.statistics-filter-card,
.statistics-panel {
    overflow: hidden;
    border: 2px solid var(--line);
    border-radius: 19px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.statistics-filter-card {
    padding: clamp(16px, 2.2vw, 25px);
}

.statistics-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 17px;
}

.statistics-section-heading h2 {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.1;
}

.section-kicker {
    margin: 0 0 3px;
    color: var(--muted);
    font-size: 0.73rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.compact-heading {
    align-items: center;
    margin: 0;
    padding: 18px 20px 15px;
    border-bottom: 1px solid var(--soft-line);
}

.period-presets {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.preset-button {
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--soft-line);
    border-radius: 9px;
    color: var(--ink);
    background: var(--page);
    font-size: 0.78rem;
    font-weight: 800;
}

.preset-button:hover {
    border-color: var(--line);
    background: var(--page-accent);
}

.statistics-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 11px;
}

.statistics-search-field {
    grid-column: span 2;
}

.statistics-filter-field {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
}

.statistics-filter-field input,
.statistics-filter-field select {
    width: 100%;
    min-width: 0;
    min-height: 43px;
    padding: 8px 10px;
    border: 2px solid var(--soft-line);
    border-radius: 10px;
    color: var(--ink);
    background: var(--field);
    font-size: 0.91rem;
    font-weight: 700;
}

.statistics-filter-field input:hover,
.statistics-filter-field select:hover {
    border-color: var(--line);
}

.statistics-filter-field input::placeholder {
    color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.statistics-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 15px;
}

.statistics-loading,
.statistics-error {
    min-height: 68px;
    padding: 20px;
    border: 2px dashed var(--soft-line);
    border-radius: 15px;
    color: var(--muted);
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    text-align: center;
    font-weight: 750;
}

.statistics-error {
    border-style: solid;
    border-color: var(--danger);
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.statistics-loading[hidden],
.statistics-error[hidden],
.statistics-content[hidden] {
    display: none;
}

.statistics-content {
    display: grid;
    gap: 18px;
}

.statistics-content[aria-busy="true"] {
    opacity: 0.58;
}

.statistics-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    gap: 11px;
}

.metric-card {
    display: flex;
    min-height: 142px;
    flex-direction: column;
    justify-content: space-between;
    padding: 17px;
    border: 2px solid var(--line);
    border-radius: 17px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-card-accent {
    background: var(--card);
}

.metric-card > span {
    color: var(--muted);
    font-size: 0.79rem;
    font-weight: 850;
    letter-spacing: 0.02em;
}

.metric-card strong {
    margin-block: 8px;
    font-size: clamp(1.35rem, 2vw, 1.85rem);
    line-height: 1.05;
}

.metric-card small {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 650;
}

.statistics-breakdowns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.statistics-table-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.statistics-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.statistics-table th,
.statistics-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--soft-line);
    text-align: left;
    vertical-align: top;
}

.statistics-table th {
    color: var(--muted);
    background: color-mix(in srgb, var(--page) 76%, var(--surface));
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.statistics-table tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--page-accent) 36%, transparent);
}

.statistics-table tbody tr:hover {
    background: color-mix(in srgb, var(--card) 45%, transparent);
}

.statistics-table tbody tr:last-child td {
    border-bottom: 0;
}

.group-label,
.task-name-cell {
    color: var(--ink);
    font-weight: 850;
}

.numeric-cell,
.duration-cell,
.date-cell {
    white-space: nowrap;
}

.subtle-cell {
    color: var(--muted);
}

.variance-cell,
.is-good,
.is-bad,
.is-neutral {
    font-weight: 850;
}

.is-good {
    color: var(--success);
}

.is-bad {
    color: var(--danger);
}

.is-neutral {
    color: var(--ink);
}

.table-empty {
    margin: 0;
    padding: 25px 20px;
    color: var(--muted);
    text-align: center;
}

.statistics-details-panel {
    min-width: 0;
}

.details-table {
    min-width: 1580px;
}

.details-table td {
    max-width: 260px;
}

.result-count {
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid var(--soft-line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--page);
    font-size: 0.76rem;
    font-weight: 850;
}

.link-note-cell {
    overflow: hidden;
    max-width: 250px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-note-cell a {
    color: var(--ink);
    font-weight: 750;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.table-badge {
    display: inline-flex;
    min-height: 23px;
    align-items: center;
    margin-top: 5px;
    padding: 3px 7px;
    border: 1px solid var(--soft-line);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 850;
    line-height: 1.1;
    white-space: nowrap;
}

.manual-badge {
    display: flex;
    width: max-content;
    color: var(--focus);
}

.outside-table-badge {
    color: var(--primary-ink);
    background: var(--primary);
}

.regular-table-badge {
    color: var(--muted);
    background: var(--page);
}

.statistics-empty {
    display: grid;
    min-height: 170px;
    align-content: center;
    gap: 5px;
    padding: 20px;
    color: var(--muted);
    text-align: center;
}

.statistics-empty strong {
    color: var(--ink);
    font-size: 1.05rem;
}

.statistics-empty[hidden],
.statistics-table[hidden],
.table-empty[hidden] {
    display: none;
}

noscript {
    display: block;
    margin: 18px;
    padding: 12px;
    border: 2px solid var(--danger);
}

.install-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 22px;
}

.install-shell {
    width: min(620px, 100%);
}

.install-card {
    padding: clamp(22px, 5vw, 42px);
    border: 3px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.install-card h1 {
    margin-bottom: 12px;
}

.install-lead {
    margin: 0 0 24px;
    color: var(--muted);
}

.install-form {
    display: grid;
    gap: 14px;
}

.install-field {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 800;
}

.install-field input {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 2px solid var(--line);
    border-radius: 11px;
    color: var(--ink);
    background: var(--field);
    font-size: 1rem;
    font-weight: 650;
}

.install-details {
    padding: 12px;
    border: 1px solid var(--soft-line);
    border-radius: 12px;
    background: var(--page);
}

.install-details summary {
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 800;
}

.install-details-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px;
    gap: 10px;
    margin-top: 12px;
}

.install-submit {
    width: 100%;
    margin-top: 4px;
}

.install-error {
    margin-bottom: 16px;
    padding: 11px 13px;
    border: 2px solid var(--danger);
    border-radius: 11px;
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 9%, var(--surface));
    font-weight: 750;
}

.install-note {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.install-note code {
    color: var(--ink);
}

.install-mark {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    place-items: center;
    border: 3px solid var(--line);
    border-radius: 50%;
    color: var(--primary-ink);
    background: var(--success);
    font-size: 1.5rem;
    font-weight: 900;
}

.install-link {
    text-decoration: none;
}

@media (max-width: 1490px) {
    .task-main,
    body.show-actual-end .task-main {
        grid-template-columns: 40px repeat(4, minmax(0, 1fr)) 54px;
    }

    .reorder-controls { grid-column: 1; grid-row: 1 / 4; }
    .name-field { grid-column: 2 / 4; grid-row: 1; }
    .category-field { grid-column: 4; grid-row: 1; }
    .complexity-field { grid-column: 5; grid-row: 1; }
    .card-actions { grid-column: 6; grid-row: 1; }
    .link-field { grid-column: 2 / 4; grid-row: 2; }
    .start-field { grid-column: 4 / 6; grid-row: 2; }
    .plan-field { grid-column: 2; grid-row: 3; }
    .fact-field { grid-column: 3; grid-row: 3; }
    .planned-end-field { grid-column: 4 / 6; grid-row: 3; }
    .actual-end-field { grid-column: 4 / 6; grid-row: 4; }
}

@media (max-width: 900px) {
    .app-header {
        position: static;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .filters {
        justify-content: flex-start;
    }

    .primary-button {
        align-self: flex-start;
    }

    .statistics-breakdowns {
        grid-template-columns: 1fr;
    }

    .statistics-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .compact-heading {
        align-items: center;
        flex-direction: row;
    }

    .period-presets {
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .app-header {
        padding: 14px 12px 12px;
    }

    .schedule-note {
        max-width: 290px;
    }

    .heading-row {
        flex-wrap: wrap;
    }

    .header-actions {
        width: 100%;
    }

    .view-switch {
        flex: 1 1 auto;
    }

    .view-tab {
        flex: 1 1 50%;
        padding-inline: 7px;
        text-align: center;
    }

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

    .filter-toggle {
        border-radius: 11px;
    }

    .planner-shell {
        padding: 12px 8px 36px;
    }

    .statistics-shell {
        gap: 12px;
        padding: 12px 8px 36px;
    }

    .statistics-search-field {
        grid-column: span 1;
    }

    .statistics-filter-card {
        padding: 14px;
        border-radius: 15px;
    }

    .statistics-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .metric-card {
        min-height: 132px;
        padding: 13px;
        border-radius: 14px;
    }

    .compact-heading {
        padding: 15px 14px 12px;
    }

    .task-main,
    body.show-actual-end .task-main {
        grid-template-columns: 36px minmax(0, 1fr) minmax(0, 1fr) 46px;
        gap: 6px;
        padding: 6px;
    }

    .reorder-controls { grid-column: 1; grid-row: 1 / 7; }
    .name-field { grid-column: 2 / 4; grid-row: 1; }
    .card-actions { grid-column: 4; grid-row: 1; }
    .category-field { grid-column: 2; grid-row: 2; }
    .complexity-field { grid-column: 3; grid-row: 2; }
    .link-field { grid-column: 2 / 4; grid-row: 3; }
    .start-field { grid-column: 2 / 4; grid-row: 4; }
    .plan-field { grid-column: 2; grid-row: 5; }
    .fact-field { grid-column: 3; grid-row: 5; }
    .planned-end-field { grid-column: 2 / 4; grid-row: 6; }
    .actual-end-field { grid-column: 2 / 4; grid-row: 7; }

    .field {
        min-height: 65px;
        padding-inline: 9px;
        border-width: 2px;
        border-radius: 11px;
    }

    .task-options,
    .task-card.is-expanded .task-options {
        display: grid;
        grid-template-columns: 1fr;
        padding: 0 6px 6px 48px;
    }

    .option-toggle {
        justify-content: flex-start;
    }

    .delete-task-button {
        width: 100%;
    }

    .outside-badge {
        left: 48px;
    }

    .install-page {
        padding: 10px;
    }

    .install-card {
        border-radius: 18px;
    }

    .install-details-grid {
        grid-template-columns: 1fr;
    }
}

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