* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f7f7f7;
    color: #171717;
}

/* =========================
   NAVBAR
========================= */

.navbar {
    height: 56px;
    padding: 0 32px;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    background: #ffffff;
    border-bottom: 1px solid #d8d8d8;
}

.nav-links {
    display: flex;
    gap: 22px;
}

.nav-link {
    color: #777;
    text-decoration: none;
    font-size: 13px;
}

.nav-link:hover,
.nav-link.active {
    color: #111;
}

/* =========================
   MAIN
========================= */

.container {
    width: min(1000px, calc(100% - 48px));
    margin: 0 auto;
    padding: 48px 0;
}

/* =========================
   PAGE HEADER
========================= */

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 30px;
}

.eyebrow {
    margin-bottom: 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #888;
}

.page-header h1 {
    font-size: 42px;
    line-height: 1;
    letter-spacing: -1.5px;
    font-weight: 700;
}

.subtitle {
    margin-top: 10px;
    color: #777;
    font-size: 14px;
}

.task-counter {
    text-align: right;
    color: #888;
    font-size: 12px;
}

.task-counter span:first-child {
    display: block;
    color: #171717;
    font-size: 25px;
    font-weight: 600;
}

/* =========================
   ADD TASK
========================= */

.add-task-card {
    display: grid;
    grid-template-columns: 1.5fr 1fr 0.65fr auto;
    align-items: end;
    gap: 12px;

    padding: 16px;

    background: #fff;
    border: 1px solid #d5d5d5;
    border-radius: 4px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label,
.json-panel label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #777;
}

.input-group input {
    width: 100%;
    height: 42px;
    padding: 0 11px;

    border: 1px solid #ccc;
    border-radius: 3px;

    background: #fff;
    color: #171717;

    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.input-group input:focus {
    border-color: #555;
}

/* =========================
   BUTTONS
========================= */

.add-button,
.primary-button,
.secondary-button {
    height: 42px;
    padding: 0 18px;

    border: 1px solid #222;
    border-radius: 3px;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}

.add-button,
.primary-button {
    background: #171717;
    color: #fff;
}

.add-button:hover,
.primary-button:hover {
    background: #333;
}

.secondary-button {
    background: #fff;
    color: #222;
    border-color: #ccc;
}

.secondary-button:hover {
    background: #f1f1f1;
}

/* =========================
   TASK SECTION
========================= */

.tasks-section {
    margin-top: 34px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.section-header h2 {
    font-size: 15px;
    font-weight: 600;
}

.text-button {
    border: 0;
    background: transparent;
    color: #777;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

.text-button:hover {
    color: #111;
}

/* =========================
   TASK LIST
========================= */

.task-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.task-item {
    min-height: 64px;

    display: flex;
    align-items: center;
    gap: 13px;

    padding: 11px 14px;

    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;

    transition: background 0.15s ease;
}

.task-item:hover {
    background: #fafafa;
}

.task-checkbox {
    width: 18px;
    height: 18px;

    flex-shrink: 0;

    appearance: none;

    border: 1px solid #aaa;
    border-radius: 50%;

    background: #fff;

    cursor: pointer;
    position: relative;
}

.task-checkbox:checked {
    background: #171717;
    border-color: #171717;
}

.task-checkbox:checked::after {
    content: "✓";

    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #fff;
    font-size: 11px;
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-title {
    position: relative;
    display: inline-block;

    font-size: 14px;
    font-weight: 500;
}

.task-title::after {
    content: "";

    position: absolute;
    left: 0;
    top: 50%;

    width: 100%;
    height: 1px;

    background: currentColor;

    transform: scaleX(0);
    transform-origin: left;

    transition: transform 0.3s ease;
}

.task-item.completed .task-title::after {
    transform: scaleX(1);
}

.task-item.completed {
    opacity: 0.48;
}

.task-deadline {
    margin-top: 4px;
    color: #999;
    font-size: 11px;
}

.task-countdown {
    min-width: 85px;

    text-align: right;

    font-family: "Courier New", monospace;
    font-size: 13px;
    font-weight: 600;
}

.task-countdown.overdue {
    color: #888;
}

.delete-task {
    width: 28px;
    height: 28px;

    border: 0;
    background: transparent;

    color: #aaa;

    font-size: 16px;
    cursor: pointer;
}

.delete-task:hover {
    color: #222;
}

/* =========================
   EMPTY STATE
========================= */

.empty-state {
    padding: 45px 20px;

    text-align: center;

    border: 1px dashed #ccc;
    background: #fff;
}

.empty-icon {
    margin-bottom: 10px;
    color: #aaa;
    font-size: 20px;
}

.empty-state h3 {
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 600;
}

.empty-state p {
    color: #999;
    font-size: 12px;
}

/* =========================
   JSON PAGE
========================= */

.load-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;
}

.json-panel {
    width: min(680px, 100%);

    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 16px 18px;

    border-bottom: 1px solid #ddd;
}

.panel-header h1 {
    font-size: 18px;
    font-weight: 600;
}

.panel-controls {
    display: flex;
    gap: 3px;
}

.panel-controls button {
    width: 28px;
    height: 28px;

    border: 0;
    background: transparent;

    color: #777;
    font-size: 18px;
    cursor: pointer;
}

.panel-controls button:hover {
    background: #eee;
    color: #111;
}

#panelContent {
    padding: 18px;
}

.panel-description {
    margin-bottom: 15px;
    color: #777;
    font-size: 12px;
}

.json-panel label {
    display: block;
    margin-bottom: 6px;
}

#jsonInput {
    width: 100%;
    min-height: 280px;

    padding: 12px;

    resize: vertical;

    border: 1px solid #ccc;
    border-radius: 3px;

    background: #fafafa;
    color: #222;

    font-family: "Courier New", monospace;
    font-size: 12px;
    line-height: 1.5;

    outline: none;
}

#jsonInput:focus {
    border-color: #555;
}

.json-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.json-message {
    min-height: 18px;
    margin-top: 10px;
    color: #777;
    font-size: 12px;
}

/* =========================
   BACK BUTTON
========================= */

.back-button {
    position: fixed;
    left: 24px;
    bottom: 18px;

    color: #777;
    text-decoration: none;
    font-size: 12px;
}

.back-button:hover {
    color: #111;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 750px) {

    .navbar {
        padding: 0 20px;
    }

    .container {
        width: calc(100% - 30px);
        padding: 35px 0;
    }

    .page-header {
        align-items: flex-start;
    }

    .page-header h1 {
        font-size: 34px;
    }

    .add-task-card {
        grid-template-columns: 1fr 1fr;
    }

    .add-button {
        width: 100%;
    }

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

    .task-countdown {
        margin-left: 31px;
        text-align: left;
    }
}

@media (max-width: 500px) {

    .navbar {
        height: auto;
        padding: 16px 20px;
    }

    .add-task-card {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        gap: 15px;
    }

    .task-counter {
        text-align: left;
    }

    .load-page {
        padding: 15px;
    }
}