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

:root {
    --bg: #fafaf9;
    --surface: #ffffff;
    --border: #e7e5e4;
    --text: #1c1917;
    --text-muted: #a8a29e;
    --accent: #292524;
    --accent-hover: #44403c;
    --check: #16a34a;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 520px;
    margin: 0 auto;
    padding: 0 16px 120px;
}

header {
    padding: 48px 0 32px;
    text-align: center;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.input-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
    padding: 12px 0;
    display: flex;
    gap: 8px;
}

.input-bar input {
    flex: 1;
    height: 48px;
    padding: 0 16px;
    font-size: 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}

.input-bar input:focus {
    border-color: var(--accent);
}

.input-bar button {
    height: 48px;
    padding: 0 20px;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.input-bar button:hover { background: var(--accent-hover); }

.todo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: opacity 0.2s, transform 0.2s;
    animation: slide-in 0.2s ease-out;
}

@keyframes slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.todo-item.done { opacity: 0.55; }

.todo-item .checkbox {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.todo-item .checkbox:hover { border-color: var(--check); }

.todo-item.done .checkbox {
    background: var(--check);
    border-color: var(--check);
}

.todo-item.done .checkbox svg { display: block; }

.checkbox svg {
    display: none;
    width: 14px;
    height: 14px;
    stroke: #fff;
    stroke-width: 2.5;
    fill: none;
}

.todo-item .text {
    flex: 1;
    font-size: 1rem;
    line-height: 1.4;
    word-break: break-word;
}

.todo-item.done .text { text-decoration: line-through; }

.todo-item .edit-input {
    flex: 1;
    height: 36px;
    padding: 0 10px;
    font-size: 1rem;
    border: 1.5px solid var(--accent);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    outline: none;
}

.actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.actions button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.actions button:hover { background: var(--bg); color: var(--text); }
.actions .delete-btn:hover { color: var(--danger); }

.actions button svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 48px 16px;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.tool-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tool-link {
    display: block;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 500;
    transition: background 0.15s;
}

.tool-link:hover {
    background: var(--border);
}

@media (min-width: 600px) {
    .container { padding-bottom: 64px; }
    header { padding: 64px 0 40px; }
    header h1 { font-size: 1.75rem; }
}
