* {
    box-sizing: border-box;
}

:root {
    --bg: #f7f7f5;
    --ink: #111111;
    --muted: #8b8b88;
    --line: #d9d9d5;
    --task: #111111;
    --penalty: #9c3b50;
    --visual-viewport-bottom: 0px;
}

html,
body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
}

body {
    overflow: hidden;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

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

.app-shell {
    position: relative;
    height: 100svh;
    height: min(100svh, var(--visual-viewport-height, 100svh));
    max-width: 700px;
    margin: 0 auto;
    padding: max(10px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}

.topbar {
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.day-picker-control {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.day-arrow {
    width: 30px;
    height: 34px;
    padding: 0;
    background: transparent;
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
}

.day-text-input {
    width: 92px;
    min-height: 34px;
    padding: 5px 7px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.day-weekday {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.day-weekday::after {
    content: " ";
    white-space: pre;
}

#dayTextInput {
    width: 85px;
    padding-left: 0;
    text-align: left;
}

.calendar-only {
    cursor: pointer;
    caret-color: transparent;
}

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

.settings-button {
    background: transparent;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 999px;
}

.settings-button {
    width: 36px;
    justify-content: center;
}

.settings-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.environment-label {
    font-weight: 700;
    padding: 6px 8px;
}

.today {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding-top: 8px;
    padding-bottom: 62px;
}

.day-section {
    flex: 0 0 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-section h2 {
    flex: 0 0 auto;
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.day-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.task-area,
.habit-area {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-content: flex-start;
}

.day-section.day-separated {
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.importance-control {
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.importance-control:has(input:checked) {
    border-color: var(--ink);
}

.importance-control:has(input:disabled) {
    opacity: .5;
    cursor: default;
}

.importance-control input:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.divider {
    width: 100%;
    height: 1px;
    background: var(--line);
    flex: 0 0 1px;
}

.pill {
    min-height: 33px;
    padding: 7px 11px;
    border-radius: 13px;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
    transition: transform .14s ease, opacity .14s ease;
}

.pill:active {
    transform: scale(.94);
}

.task-pill {
    background: var(--task);
    color: #fff;
}

.task-pill.completed {
    opacity: 0.45;
    text-decoration: line-through;
}

.habit-pill {
    color: #13211c;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04);
}

.habit-pill.completed,
.penalty-pill.completed {
    opacity: .45;
    text-decoration: line-through;
}

.habit-pill.missed {
    opacity: .58;
    text-decoration: line-through;
}

.penalty-pill {
    background: var(--penalty);
    color: #fff;
}

.add-button {
    position: absolute;
    right: 18px;
    bottom: max(18px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    padding: 0;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: 0;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
    z-index: 20;
}

.add-button::before,
.add-button::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.add-button::after {
    transform: rotate(90deg);
}

.bottom-navigation {
    position: absolute;
    left: 18px;
    bottom: max(18px, env(safe-area-inset-bottom));
    display: flex;
    gap: 7px;
    z-index: 20;
}

.bottom-navigation button {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 50%;
    background: #e9e9e4;
    color: var(--ink);
    font-weight: 800;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .10);
}

.bottom-navigation svg,
.head-icon-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty-state {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #777;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.popover {
    position: fixed;
    z-index: 50;
    background: white;
    border: 1px solid #e6e6e1;
    border-radius: 15px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, .12);
    padding: 6px;
    min-width: 140px;
}

.popover button {
    width: 100%;
    text-align: left;
    background: transparent;
    border-radius: 10px;
    padding: 10px 11px;
    font-weight: 650;
}

.add-menu {
    position: absolute;
    right: 18px;
    bottom: calc(max(18px, env(safe-area-inset-bottom)) + 63px);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, .25);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.release-notes-card article + article {
    border-top: 1px solid #ddd;
    margin-top: 20px;
    padding-top: 16px;
}

.release-notes-card h4 {
    margin: 16px 0 8px;
}

.release-notes-card ul {
    padding-left: 22px;
    line-height: 1.5;
}

.release-notes-card li + li {
    margin-top: 8px;
}

.modal-card {
    width: min(100%, 700px);
    max-height: 92svh;
    overflow-y: auto;
    background: var(--bg);
    border-radius: 22px 22px 0 0;
    padding: 18px 16px max(22px, env(safe-area-inset-bottom));
}

.account-access-card {
    max-width: 440px;
}

.account-access-modal {
    align-items: center;
    padding: max(20px, env(safe-area-inset-top)) 12px
        calc(max(28px, env(safe-area-inset-bottom)) + var(--visual-viewport-bottom));
}

.account-access-modal .modal-card {
    max-height: calc(100svh - 72px - var(--visual-viewport-bottom));
    border-radius: 22px;
    padding-bottom: 22px;
}

#registrationInviteToken {
    color: var(--muted);
    background: #eeeeea;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.access-intro,
.password-hint {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.access-intro {
    margin: 0 0 16px;
}

.password-hint {
    margin: -3px 0 0;
}

.all-tasks-card {
    height: min(92svh, 850px);
}

#taskNotes {
    width: 100%;
    font: inherit;
    padding: 11px 12px;
    border: 1px solid #deded9;
    border-radius: 12px;
    background: #fff;
    resize: vertical;
}
.task-with-notes {
    display: inline-flex;
    align-items: stretch;
    max-width: 100%;
    border-radius: 13px;
    color: #fff;
}
.task-with-notes.completed { opacity: .45; }
.task-with-notes > .pill {
    min-width: 0;
    padding-right: 0;
    border-radius: 13px 0 0 13px;
}
.task-with-notes > .pill.completed { opacity: 1; }
.task-note-button {
    background: transparent;
    color: inherit;
    padding: 7px 11px 7px 0;
    border-radius: 0 13px 13px 0;
    white-space: pre;
    font-size: 13px;
    line-height: 1;
    flex-shrink: 0;
}
.task-note-excerpt { font-size: 13px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.task-request { border-bottom: 1px solid var(--line); padding: 12px 0; }
.task-request-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
#taskRequestsButton { position: relative; }
#taskRequestsCount { position: absolute; top: 0; right: 1px; font-size: 11px; }
.task-search input { min-width: 0; }
.task-search-status { color: var(--muted); font-size: 13px; }

.all-tasks-list {
    display: grid;
    gap: 20px;
}

.task-group {
    display: grid;
    gap: 7px;
}

.task-group h3 {
    position: sticky;
    top: -18px;
    z-index: 1;
    margin: 0;
    padding: 10px 0 7px;
    background: var(--bg);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.all-task-row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 8px 10px;
    border: 1px solid #e4e4df;
    border-radius: 13px;
    background: #fff;
}

.all-habits-list {
    display: grid;
    gap: 7px;
}

.all-habit-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 8px 10px;
    border: 1px solid #e4e4df;
    border-radius: 13px;
    background: #fff;
}

.all-task-row.completed {
    opacity: .55;
}

.all-task-row.completed .all-task-title {
    text-decoration: line-through;
}

.all-task-color {
    width: 10px;
    height: 30px;
    border-radius: 999px;
}

.all-task-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.all-entry-content {
    min-width: 0;
}

.all-entry-content .all-task-date {
    display: block;
    margin-top: 3px;
}

.entry-actions {
    display: flex;
    gap: 5px;
}

.entry-actions button {
    min-height: 36px;
    padding: 0 9px;
    border-radius: 9px;
    background: #e9e9e4;
    color: var(--ink);
    font-size: 12px;
    font-weight: 750;
}

.entry-actions .danger-text-button {
    color: #9c263d;
}

.list-empty-state {
    margin: 30px 0;
    color: var(--muted);
    text-align: center;
}

.activity-list {
    display: grid;
    gap: 20px;
}

.activity-group {
    display: grid;
    gap: 7px;
}

.activity-group h3 {
    position: sticky;
    top: -18px;
    z-index: 1;
    margin: 0;
    padding: 10px 0 7px;
    background: var(--bg);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.activity-row {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.activity-time {
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.activity-message {
    line-height: 1.4;
}

.activity-details {
    display: grid;
    gap: 2px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.all-task-date {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.all-tasks-loader {
    width: 100%;
    padding: 18px 0 6px;
    border: 0;
    background: transparent;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.modal-head h2 {
    margin: 0;
    font-size: 21px;
}

.modal-head-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.head-icon-button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    background: #e9e9e4;
    color: var(--ink);
}

.close-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e9e9e4;
    font-size: 23px;
}

form {
    display: grid;
    gap: 13px;
}

#taskFields {
    display: grid;
    gap: 13px;
}

.repeat-mode,
.repeat-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.repeat-mode button {
    padding: 11px 8px;
    border: 1px solid #deded9;
    border-radius: 12px;
    background: #fff;
    font-weight: 700;
}

.repeat-mode button.selected {
    border-color: #111;
    background: #111;
    color: #fff;
}

label,
fieldset {
    display: grid;
    gap: 7px;
}

label>span,
legend,
.settings-section h3,
.settings-section h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    font-weight: 800;
}

.telegram-request-button {
    width: 38px;
    height: 38px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 19px;
    line-height: 1;
}

.telegram-time-toggles {
    display: flex;
    align-items: center;
    gap: 12px;
}

.telegram-time-toggles label {
    display: grid;
    justify-items: center;
    gap: 2px;
}

.telegram-time-toggles label > span {
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0;
}

.telegram-request-choices {
    display: grid;
    gap: 8px;
}

.telegram-request-choices button {
    min-height: 42px;
}

#telegramCustomMessageForm label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

#telegramCustomMessage {
    width: 100%;
    resize: vertical;
    margin-bottom: 14px;
}

.toggle-row span small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.field-label {
    display: block;
    margin-bottom: 7px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    font-weight: 800;
}

.date-input-control {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
}

.date-field {
    display: grid;
    gap: 7px;
}

.date-field > label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.calendar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #deded9;
    background: #fff;
    border-radius: 12px;
    color: var(--ink);
    font-weight: 700;
}

.calendar-icon {
    position: relative;
    width: 16px;
    height: 15px;
    border: 1.7px solid currentColor;
    border-radius: 4px;
}

.calendar-icon::before {
    content: "";
    position: absolute;
    left: -1.7px;
    right: -1.7px;
    top: 3px;
    border-top: 1.7px solid currentColor;
}

.calendar-icon::after {
    content: "";
    position: absolute;
    top: -3px;
    left: 3px;
    width: 1.7px;
    height: 5px;
    border-radius: 2px;
    background: currentColor;
    box-shadow: 6px 0 currentColor;
}

.day-picker-control > .calendar-button {
    width: 30px;
    height: 32px;
    border: 0;
    background: transparent;
}

.task-calendar-button {
    padding: 0 12px;
    font-size: 13px;
}

.calendar-modal-card {
    max-width: 420px;
}

.calendar-navigation {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    margin-bottom: 12px;
}

.calendar-navigation strong {
    text-align: center;
    text-transform: capitalize;
}

.calendar-navigation button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #e9e9e4;
    color: var(--ink);
    font-size: 25px;
    line-height: 1;
}

.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-weekdays {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.calendar-weekdays span {
    padding: 7px 0;
}

.calendar-day {
    aspect-ratio: 1;
    min-width: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-weight: 700;
}

.calendar-day:hover:not(:disabled):not(.selected) {
    background: #e9e9e4;
}

.calendar-day.outside-month {
    color: var(--muted);
    opacity: .55;
}

.calendar-day.calendar-today {
    box-shadow: inset 0 0 0 2px var(--ink);
}

.calendar-day.selected {
    background: var(--ink);
    color: #fff;
    box-shadow: none;
}

.calendar-day:disabled {
    cursor: default;
    opacity: .22;
}

.calendar-today-button {
    width: 100%;
    margin-top: 14px;
    min-height: 42px;
}

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

.toggle-row > span {
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.toggle-row input {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: #111;
}

.recurrence-option {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.recurrence-option > label { flex: 1; }
.recurrence-help { position: relative; }
.recurrence-help button {
    cursor: pointer;
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    font-weight: 700;
}
.recurrence-help p {
    display: none;
    position: absolute;
    right: 0;
    width: min(260px, 65vw);
    padding: 12px;
    background: var(--bg);
    color: var(--ink);
    border: 1px solid currentColor;
    border-radius: 12px;
    z-index: 2;
    font-size: 13px;
    margin: 0;
}
.recurrence-help:hover p,
.recurrence-help:focus-within p,
.recurrence-help button[aria-expanded="true"] + p { display: block; }

input,
select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #deded9;
    background: #fff;
    border-radius: 12px;
    outline: none;
}

fieldset {
    border: 0;
    padding: 0;
    margin: 0;
}

.audience-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.audience-picker button {
    flex: 1;
    min-width: 72px;
    background: #fff;
    border: 1px solid #deded9;
    border-radius: 11px;
    padding: 10px 8px;
    font-weight: 700;
}

.audience-picker button.selected {
    background: #111;
    color: #fff;
    border-color: #111;
}

.save-button {
    background: #111;
    color: #fff;
    border-radius: 13px;
    padding: 13px;
    font-weight: 800;
}

.form-warning {
    color: var(--penalty);
    min-height: 0;
    font-size: 13px;
    font-weight: 700;
}

.settings-section {
    padding: 15px 0;
    border-top: 1px solid var(--line);
}

.settings-section:first-of-type {
    border-top: 0;
}

.settings-section h3 {
    margin: 0 0 10px;
}

.settings-section h4 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
}

.account-section {
    padding-bottom: 0;
}

.account-details {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
}

.account-details > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
}

.account-details dt {
    color: var(--muted);
    font-size: 13px;
}

.account-details dd {
    margin: 0;
    font-weight: 750;
    text-align: right;
    overflow-wrap: anywhere;
}

.connection-settings {
    padding-bottom: 20px;
}

.admin-settings {
    padding-bottom: 20px;
}

.admin-settings > p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.admin-action-button {
    width: 100%;
    min-height: 42px;
}

.generated-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    margin-top: 8px;
}

.generated-link input {
    font-size: 12px;
}

.generated-link button,
.admin-reset-form button {
    padding: 0 11px;
    border-radius: 11px;
    background: var(--ink);
    color: #fff;
    font-weight: 700;
}

.admin-reset-form {
    margin-top: 16px;
}

.admin-reset-form > label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.admin-reset-form > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
}

.connection-settings > p,
.connection-empty {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.connection-form {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
}

.connection-form textarea {
    grid-column: 1 / -1;
    width: 100%;
    resize: vertical;
}

.connection-message {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.connection-form button {
    padding: 0 12px;
    border-radius: 12px;
    background: var(--ink);
    color: #fff;
    font-weight: 750;
}

.connection-settings h5 {
    margin: 16px 0 5px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.connection-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 45px;
    padding: 7px 0;
    border-bottom: 1px solid #e8e8e4;
}

.connection-row > span:first-child {
    display: grid;
    min-width: 0;
}

.connection-row small {
    color: var(--muted);
}

.connection-row button {
    padding: 7px 9px;
    border-radius: 9px;
    background: #e9e9e4;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.connection-actions {
    display: flex;
    gap: 5px;
}

.logout-button {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #dfc8cd;
    border-radius: 12px;
    background: transparent;
    color: var(--penalty);
    font-weight: 750;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.color-swatch {
    aspect-ratio: 1;
    border-radius: 11px;
    border: 2px solid transparent;
}

.color-swatch.selected {
    border-color: #111;
    box-shadow: inset 0 0 0 2px #fff;
}

.color-select-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    background: #e9e9e4;
    border-radius: 10px;
    font-weight: 700;
}

.category-form {
    grid-template-columns: 1fr auto auto;
    margin-top: 10px;
}

.secondary-button {
    padding: 8px 10px;
    background: #e9e9e4 !important;
    color: var(--ink) !important;
    border-radius: 10px;
    font-weight: 700;
}

.danger-button {
    padding: 10px 12px;
    background: var(--penalty);
    color: #fff;
    border-radius: 10px;
    font-weight: 700;
}

.dialog-actions,
.category-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
}

#deleteCategoryMessage {
    margin: 0;
    color: var(--muted);
    line-height: 1.4;
}

.confirm-modal-card {
    max-width: 420px;
}

.confirm-message {
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.45;
}

.category-form button {
    padding: 0 12px;
    background: #111;
    color: #fff;
    border-radius: 12px;
    font-weight: 700;
}

.add-category-button {
    margin-top: 10px;
    padding: 8px 10px;
    background: #e9e9e4;
    border-radius: 10px;
    font-weight: 700;
}

.color-modal-card {
    max-width: 420px;
}

.category-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
}

.category-left {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.category-dot {
    width: 20px;
    height: 20px;
    border-radius: 7px;
    flex: 0 0 auto;
}

.category-setting button {
    background: #e9e9e4;
    border-radius: 9px;
    padding: 6px 9px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 85px;
    transform: translateX(-50%);
    z-index: 200;
    background: #111;
    color: white;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
}

.undo-toast {
    position: fixed;
    left: 50%;
    bottom: max(84px, calc(env(safe-area-inset-bottom) + 72px));
    transform: translateX(-50%);
    z-index: 210;
    width: min(calc(100% - 24px), 430px);
    min-height: 50px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 13px 13px;
    border-radius: 14px;
    background: #111;
    color: #fff;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .25);
    font-size: 13px;
    font-weight: 700;
}

.undo-toast button {
    flex: 0 0 auto;
    padding: 7px 9px;
    border-radius: 9px;
    background: #fff;
    color: #111;
    font-size: 12px;
    font-weight: 800;
}

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

.undo-toast .undo-close {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
}

.undo-toast .undo-close:hover,
.undo-toast .undo-close:focus-visible {
    background: rgba(255, 255, 255, .16);
}

.undo-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: #fff;
    transform-origin: left;
    animation: undo-countdown 10s linear forwards;
}

@keyframes undo-countdown {
    to {
        transform: scaleX(0);
    }
}

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

    #confettiCanvas {
        display: none;
    }
}

@media (max-width: 600px) {
    .bottom-navigation {
        left: 12px;
    }

    .bottom-navigation button {
        width: 46px;
        min-width: 46px;
        padding: 0;
    }
}

#confettiCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 150;
}

@media (max-width: 380px) {
    .bottom-navigation {
        gap: 4px;
    }

    .bottom-navigation button {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
    }

    .all-task-row,
    .all-habit-row {
        grid-template-columns: 10px minmax(0, 1fr);
    }

    .entry-actions {
        grid-column: 2;
    }

    .pill {
        font-size: 12px;
        padding: 7px 9px;
    }

    .task-area,
    .habit-area {
        gap: 5px;
    }
}

.startup-screen {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    background: var(--bg);
    z-index: 100;
}

.startup-screen.hidden {
    display: none;
}

#onboardingText {
    line-height: 1.6;
}

.onboarding-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.onboarding-actions .save-button {
    width: auto;
    margin: 0;
}
