body {
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.35;
    margin: 0;
    padding: 12px;
    color: #222;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.topnav {
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topnav-with-title {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

.topnav-with-title .topnav-links {
    justify-self: start;
}

.topnav-with-title .topnav-user {
    justify-self: end;
}

.topnav-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.1;
    text-align: center;
}

.topnav-title-row {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.topnav-links a {
    text-decoration: none;
    margin-right: 10px;
    font-size: 16px;
}

.topnav-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topnav-user a {
    text-decoration: none;
    font-size: 16px;
}

.user-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e7ecef;
    color: #24333d;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    flex-shrink: 0;
}

h1 {
    font-size: 24px;
    margin: 0 0 16px 0;
}

.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.page-title-row h1 {
    margin-bottom: 0;
}

.add-project-toggle {
    border: 1px solid #bbb;
    border-radius: 999px;
    width: 30px;
    height: 30px;
    background: #fff;
    font-size: 22px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.is-hidden {
    display: none;
}

h2 {
    font-size: 18px;
    margin: 20px 0 10px 0;
}

.panel {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 12px;
    background: #fff;
}

.task-item,
.project-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 8px;
}

.task-item.reorderable {
    cursor: move;
}

.task-item.dragging {
    opacity: 0.6;
}

.task-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-line {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.task-title {
    white-space: nowrap;
}

.task-title-text {
    cursor: text;
}

.task-rename-form {
    display: none;
    margin: 0;
}

.task-rename-input {
    font-size: 16px;
    padding: 2px 4px;
    width: 280px;
    max-width: 100%;
}

.meta-inline {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.done-task .task-title,
.done-task .task-title-text,
.done-task .meta-inline {
    text-decoration: line-through;
    color: #777;
}

.next-toggle-form {
    margin: 0;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.project-grid .project-item {
    margin-bottom: 0;
    cursor: grab;
    transition: opacity 0.2s ease;
}

.project-item.dragging {
    opacity: 0.6;
}

.compact-card {
    padding: 10px;
}

.project-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.project-toggle {
    border: 1px solid #bbb;
    border-radius: 6px;
    background: #fff;
    padding: 4px 8px;
    font-size: 13px;
    cursor: pointer;
}

.project-task-container {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.project-task-container .task-item {
    border: none;
    padding: 4px 0;
    background: transparent;
    margin-bottom: 0;
}

.project-task-container .task-title {
    font-weight: 600;
    font-size: 14px;
}

.project-task-container.is-hidden {
    display: none;
}

.project-task-loading {
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
}

.project-task-empty {
    font-size: 13px;
    color: #777;
    margin: 4px 0 0;
}

.project-task-meta {
    font-size: 12px;
    color: #666;
    display: block;
    margin-top: 2px;
}

.project-title {
    margin: 0 0 6px 0;
    font-weight: 700;
}

.project-title a {
    text-decoration: none;
}

.meta {
    font-size: 13px;
    color: #555;
    margin-top: 4px;
}

.actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.actions form {
    margin: 0;
}

.actions button {
    padding: 4px 8px;
    font-size: 13px;
}

.icon-btn {
    min-width: 0;
    border: none;
    background: none;
    width: 20px;
    height: 20px;
    padding: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.done-inline-btn {
    width: 20px;
    min-width: 20px;
    height: 20px;
}

.icon-svg {
    width: 16px;
    height: 16px;
    display: block;
}

.cycle-icon .cycle-svg {
    display: none;
}

.cycle-form[data-current-horizon="today"] .cycle-today {
    display: block;
}

.cycle-form[data-current-horizon="week"] .cycle-week {
    display: block;
}

.cycle-form[data-current-horizon="backlog"] .cycle-backlog {
    display: block;
}

.cycle-form[data-current-horizon="waiting"] .cycle-waiting {
    display: block;
}

.cycle-form[data-current-horizon="waiting"] .icon-btn {
    color: #c77700;
}

.date-trigger {
    color: #8a8a8a;
}

.date-trigger.has-date {
    color: #2b6cb0;
}

.actions input[type="text"] {
    width: 150px;
    max-width: 150px;
    padding: 4px 6px;
    font-size: 13px;
}

.actions input[type="date"] {
    padding: 3px 4px;
    font-size: 13px;
}

.task-date-form .task-date-input {
    display: none;
    width: 130px;
}

.task-date-form.open .task-date-input {
    display: inline-block;
}

.task-line .task-date-form.open .task-date-input {
    display: inline-block;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px;
    font-size: 16px;
}

button {
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
}

form.block-form > div {
    margin-bottom: 10px;
}

.add-project-name-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.add-project-name-input {
    flex: 1;
}

.add-project-name-row button {
    white-space: nowrap;
}

.add-task-inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.add-task-inline-form input[type="text"] {
    flex: 1;
}

.add-task-inline-form button {
    white-space: nowrap;
}

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

ul.plain-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 17px;
    }

    button {
        width: 100%;
    }

    .actions form {
        margin-bottom: 6px;
    }

    .actions .icon-btn {
        width: auto;
    }

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

    .topnav-title {
        font-size: 22px;
    }

    .add-project-name-row button {
        width: auto;
    }

    .task-line {
        flex-wrap: wrap;
    }

    .task-title,
    .meta-inline {
        white-space: normal;
    }
}

.overdue {
    border-left: 4px solid #c62828;
    background: #fff5f5;
}

.due-today {
    border-left: 4px solid #ef6c00;
    background: #fffaf2;
}
