
:root {
    font-family: Arial, Helvetica, sans-serif;
    color: #111111;
    background: #ffffff;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --text: #111111;
    --muted: #666666;
    --border: #dddddd;
    --background: #ffffff;
    --surface: #f7f7f7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
}

button, input, textarea, select {
    font: inherit;
}

button {
    cursor: pointer;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px max(24px, calc((100% - 1000px) / 2));
    border-bottom: 1px solid var(--border);
    background: var(--background);
}

.logo {
    color: var(--text);
    font-size: 1.45rem;
    font-weight: 700;
    text-decoration: none;
}

.subtitle,
label span,
#task-count,
.empty-state {
    color: var(--muted);
}

.subtitle {
    font-size: 0.9rem;
}

.container {
    width: min(100% - 40px, 760px);
    margin: 0 auto;
}

.welcome {
    padding: 32px 0 24px;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 600;
}

.task-form,
.task-section {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--background);
}

h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

form {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

label {
    margin-top: 5px;
    font-size: 0.9rem;
    font-weight: 600;
}

label span {
    font-weight: 400;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px;
    color: var(--text);
    background: var(--background);
    border: 1px solid #cccccc;
    border-radius: 5px;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #555555;
}

textarea {
    resize: vertical;
}

button[type="submit"] {
    margin-top: 8px;
    padding: 12px;
    color: #ffffff;
    font-weight: 600;
    background: #222222;
    border: 1px solid #222222;
    border-radius: 5px;
}

button[type="submit"]:hover {
    background: #444444;
}

#form-message {
    margin: 0;
    color: var(--text);
    font-size: 0.9rem;
}

.task-section {
    margin-top: 20px;
    margin-bottom: 40px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#task-count {
    font-size: 0.85rem;
}

.tabs {
    display: flex;
    gap: 4px;
    margin: 20px 0;
    padding: 4px;
    background: var(--surface);
    border-radius: 5px;
}

.tab {
    flex: 1;
    padding: 10px 8px;
    color: var(--text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.9rem;
}

.tab.active {
    background: #ffffff;
    border-color: var(--border);
    font-weight: 600;
}

.empty-state {
    padding: 24px 8px;
    text-align: center;
}

.task-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.task-card:last-child {
    border-bottom: none;
}

.task-details {
    min-width: 0;
    overflow-wrap: anywhere;
}

.task-details h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.task-details p {
    margin: 0 0 8px;
    color: var(--muted);
    white-space: pre-wrap;
}

.task-details small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.task-actions {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-end;
    gap: 6px;
}

.task-actions button {
    padding: 7px 10px;
    color: var(--text);
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 4px;
}

.task-actions button:hover {
    background: var(--surface);
}

@media (max-width: 520px) {
    .topbar {
        padding: 18px 20px;
    }

    .subtitle {
        max-width: 145px;
        text-align: right;
        font-size: 0.78rem;
    }

    .container {
        width: calc(100% - 28px);
    }

    .task-form,
    .task-section {
        padding: 16px;
    }

    .task-card {
        flex-direction: column;
    }

    .task-actions {
        justify-content: flex-start;
    }

    .tab {
        padding: 10px 4px;
        font-size: 0.82rem;
    }
}


.edit-form {
    display: grid;
    gap: 10px;
    width: 100%;
    margin: 0;
}

.edit-form .task-actions {
    justify-content: flex-start;
}

.edit-form .task-actions button {
    padding: 10px 14px;
}

.edit-form [data-edit-message] {
    margin: 0;
    color: var(--text);
}
