* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #222;
}

.app {
    width: 100%;
    max-width: 700px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 20px 16px 100px;
    background: white;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    margin: 0;
    font-size: 28px;
}

#current-date {
    margin: 6px 0 0;
    color: #777;
}

.period-switcher {
    display: flex;
    gap: 8px;
    margin: 24px 0;
    overflow-x: auto;
}

.period-button {
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    padding: 9px 14px;
    white-space: nowrap;
    cursor: pointer;
}

.period-button.active {
    background: #222;
    color: white;
    border-color: #222;
}

.task-section {
    margin-top: 24px;
}

.task-section h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.day-block {
    margin-bottom: 24px;
}

.day-title {
    margin: 0 0 10px;
    font-size: 17px;
}

.task-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 14px;
    margin-bottom: 9px;

    border: 1px solid #e5e5e5;
    border-radius: 14px;

    background: white;
}

.task-card.high {
    border-left: 5px solid #d93025;
}

.task-card.medium {
    border-left: 5px solid #e5a000;
}

.task-check {
    width: 22px;
    height: 22px;
    margin-top: 1px;
    cursor: pointer;
}

.task-content {
    flex: 1;
}

.task-title {
    font-size: 16px;
    line-height: 1.3;
}

.task-info {
    margin-top: 5px;
    font-size: 12px;
    color: #777;
}

.overdue {
    color: #c62828;
}

.empty-message {
    color: #888;
    padding: 12px 0;
}

.add-button {
    position: fixed;
    right: 24px;
    bottom: 24px;

    width: 58px;
    height: 58px;

    border: none;
    border-radius: 50%;

    font-size: 34px;
    line-height: 1;

    cursor: pointer;

    background: #222;
    color: white;
}

@media (min-width: 700px) {
    .add-button {
        right: calc((100vw - 700px) / 2 + 24px);
    }
}
.hidden {
    display: none !important;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: flex;
    justify-content: center;
    align-items: flex-end;

    background: rgba(0, 0, 0, 0.35);
}

.modal-content {
    width: 100%;
    max-width: 700px;
    max-height: 90vh;

    overflow-y: auto;

    padding: 22px 18px 30px;

    background: white;

    border-radius: 22px 22px 0 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 22px;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.close-button {
    width: 40px;
    height: 40px;

    border: none;
    background: transparent;

    font-size: 32px;
    line-height: 1;

    cursor: pointer;
}

.form-label {
    display: block;

    margin-bottom: 18px;

    font-size: 14px;
    font-weight: 600;
}

.form-input {
    display: block;

    width: 100%;

    margin-top: 7px;
    padding: 12px;

    border: 1px solid #d7d7d7;
    border-radius: 10px;

    background: white;

    font-size: 16px;
}

.save-button {
    width: 100%;

    margin-top: 8px;
    padding: 14px;

    border: none;
    border-radius: 12px;

    background: #222;
    color: white;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;
}

@media (min-width: 700px) {
    .modal {
        align-items: center;
    }

    .modal-content {
        border-radius: 22px;
        max-height: 85vh;
    }
}

.weekday-selector {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 18px;
}

.weekday-selector label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;

    padding: 8px 3px;

    border: 1px solid #ddd;
    border-radius: 9px;

    font-size: 12px;
    cursor: pointer;
}

.weekday-selector input {
    width: 18px;
    height: 18px;
}

.repeat-interval-row {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: 7px;
}

.interval-input {
    width: 75px;

    padding: 12px;

    border: 1px solid #d7d7d7;
    border-radius: 10px;

    font-size: 16px;
    text-align: center;
}

.task-card {
    cursor: pointer;
}

.task-check {
    cursor: pointer;
}

.task-details h3 {
    margin: 0 0 22px;
    font-size: 22px;
    line-height: 1.35;
}

.details-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;

    padding: 12px 0;

    border-bottom: 1px solid #eee;

    font-size: 15px;
}

.details-row span {
    color: #777;
}

.details-row strong {
    text-align: right;
    font-weight: 600;
}

.details-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;

    margin-top: 24px;
}

.danger-button {
    width: 100%;

    padding: 14px;

    border: 1px solid #d93025;
    border-radius: 12px;

    background: white;
    color: #d93025;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;
}

.archive-button {
    width: 100%;

    padding: 12px 16px;

    border: 1px solid #ddd;
    border-radius: 12px;

    background: white;

    font-size: 15px;
    cursor: pointer;
}

.archive-button:hover {
    background: #f7f7f7;
}

.archive-description {
    margin: -8px 0 22px;

    color: #777;
    font-size: 14px;
}

.archive-modal-content {
    min-height: 60vh;
}

.archive-day {
    margin-bottom: 28px;
}

.archive-day-title {
    margin: 0 0 12px;

    font-size: 18px;
}

.archive-task-card {
    padding: 14px 16px;
    margin-bottom: 9px;

    border: 1px solid #e5e5e5;
    border-radius: 14px;

    background: white;
}

.archive-task-title {
    font-size: 16px;
}

.archive-task-info {
    margin-top: 6px;

    color: #777;
    font-size: 12px;
    line-height: 1.5;
}

.archive-export-button {
    width: 100%;

    margin-bottom: 22px;
    padding: 13px 16px;

    border: none;
    border-radius: 12px;

    background: #222;
    color: white;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
}

.archive-export-button:hover {
    background: #333;
}

.archive-actions {
    margin-bottom: 24px;
}

.archive-cleanup {
    margin-top: 18px;
    padding: 16px;

    border: 1px solid #e5e5e5;
    border-radius: 14px;
}

.archive-cleanup h3 {
    margin: 0 0 8px;

    font-size: 16px;
}

.archive-cleanup-hint {
    margin: 0 0 14px;

    color: #777;
    font-size: 13px;
    line-height: 1.4;
}

.archive-secondary-button,
.archive-delete-button {
    width: 100%;

    margin-top: 10px;
    padding: 13px 16px;

    border-radius: 12px;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
}

.archive-secondary-button {
    border: 1px solid #222;

    background: white;
    color: #222;
}

.archive-delete-button {
    border: 1px solid #d93025;

    background: white;
    color: #d93025;
}

.month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;
}

.month-header h2 {
    margin: 0;

    font-size: 22px;
    text-align: center;
}

.month-nav-button {
    width: 42px;
    height: 42px;

    border: 1px solid #ddd;
    border-radius: 50%;

    background: white;

    font-size: 28px;
    line-height: 1;

    cursor: pointer;
}

.month-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
}

.month-weekday {
    padding: 6px 0;

    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #777;
}

.month-day {
    display: flex;
    align-items: center;
    justify-content: center;

    aspect-ratio: 1 / 1;

    border: 1px solid #eeeeee;
    border-radius: 10px;

    background: white;

    font-size: 15px;
    cursor: pointer;
}

.month-day.empty {
    visibility: hidden;
}

.month-day.has-tasks {
    background: #eef3f8;
}

.month-day.has-high-priority {
    background: #ffe5e2;
}

.month-day-number {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    border-radius: 50%;
}

.month-day.today .month-day-number {
    background: #222;
    color: white;

    font-weight: 700;
}

.month-day.selected {
    box-shadow: inset 0 0 0 2px #222;
}

.month-day-details {
    margin-top: 28px;
}

.month-day-details h3 {
    margin: 0 0 14px;

    font-size: 20px;
}

.header-menu {
    position: relative;
}

.menu-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    padding: 0;

    border: none;
    border-radius: 50%;

    background: transparent;

    font-size: 30px;
    line-height: 1;

    cursor: pointer;
}

.menu-button:hover {
    background: #f5f5f5;
}

.main-menu {
    position: absolute;
    top: 48px;
    right: 0;

    z-index: 100;

    width: 180px;

    padding: 6px;

    border: 1px solid #e5e5e5;
    border-radius: 12px;

    background: white;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.12);
}

.menu-item {
    display: block;

    width: 100%;

    padding: 12px 14px;

    border: none;
    border-radius: 8px;

    background: transparent;

    text-align: left;
    font-size: 15px;

    cursor: pointer;
}

.menu-item:hover {
    background: #f5f5f5;
}

.settings-modal-content {
    max-width: 520px;
}

.settings-section h3 {
    margin: 0 0 16px;

    font-size: 17px;
}

.settings-option {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 13px 0;

    border-bottom: 1px solid #eeeeee;

    font-size: 16px;
    cursor: pointer;
}

.settings-option input {
    width: 20px;
    height: 20px;

    margin: 0;
}

.settings-hint {
    margin: 16px 0 8px;

    color: #777;
    font-size: 13px;
    line-height: 1.4;
}

.voice-input-row {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-top: 7px;
}

.voice-input-row .form-input {
    flex: 1;

    margin-top: 0;
}

.voice-button {
    flex-shrink: 0;

    width: 46px;
    height: 46px;

    border: 1px solid #d7d7d7;
    border-radius: 10px;

    background: white;

    font-size: 20px;

    cursor: pointer;
}

.voice-button.listening {
    background: #222;
}

.voice-status {
    display: block;

    min-height: 18px;
    margin-top: 5px;

    color: #777;
    font-size: 12px;
}

@media (max-width: 600px) {

    .app {
        padding-left: 12px;
        padding-right: 12px;
    }

    .menu-button {
        width: 48px;
        height: 48px;
    }

    .month-nav-button {
        width: 48px;
        height: 48px;
    }

    .task-check {
        width: 24px;
        height: 24px;
    }

    .add-button {
        right: 18px;
        bottom: 18px;

        width: 60px;
        height: 60px;
    }
}