:root {
    --bg: #ffffff;
    --text: #1f2328;
    --muted: #57606a;
    --border: #d0d7de;
    --surface: #f6f8fa;
    --accent: #0969da;
    --success: #1a7f37;
    --warning-bg: #fff8c5;
    --warning-border: #d4a72c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page {
    max-width: 980px;
    margin: 0 auto;
    padding: 32px 20px 56px;
    position: relative;
}

h1 {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.2;
}

.page-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: baseline;
}

.home-title-link {
    color: var(--text);
    text-decoration: none;
}

.home-title-link:hover {
    text-decoration: none;
}

p {
    margin: 0 0 12px;
}

.muted {
    color: var(--muted);
}

.status-box {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 18px 0 24px;
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    font-size: 0.95rem;
    margin-top: 10px;
}

.stats strong {
    color: var(--success);
}

.small {
    font-size: 0.92rem;
}

.notice {
    border: 1px solid var(--warning-border);
    background: var(--warning-bg);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 14px 0 0;
}

.hidden {
    display: none !important;
}

.roadmap-tree,
.node-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.section {
    margin: 28px 0 34px;
}

.section-title {
    margin: 0 0 10px;
    font-size: 1.35rem;
}

.node-item {
    margin: 8px 0 10px;
}

.node-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.collapse-toggle,
.collapse-spacer {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
}

.collapse-toggle {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
}

.note-toggle {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    flex: 0 0 auto;
}

.note-toggle:hover {
    border-color: #8c959f;
    color: var(--text);
}

.note-toggle.has-note {
    color: var(--accent);
    border-color: #9ec5fe;
    background: #eef6ff;
}

.node-check {
    margin-top: 4px;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    cursor: pointer;
}

.node-main {
    min-width: 0;
    flex: 1 1 auto;
}

.node-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: baseline;
}

.node-label {
    font-weight: 600;
    min-width: 0;
}

.node-label.checked,
.node-label.checked a,
.node-label.completed,
.node-label.completed a {
    color: var(--muted);
    text-decoration: line-through;
}

.node-label.ignored,
.node-label.ignored a {
    color: #8c959f;
    text-decoration: line-through;
    text-decoration-style: dashed;
}

.node-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    color: var(--text);
    font: inherit;
}

.node-check.completed {
    background: #eaf6ec;
    border-color: #7bc096;
    color: var(--success);
}

.node-check.ignored {
    background: #f0f3f6;
    border-color: #b6bec8;
    color: var(--muted);
}

.node-meta {
    color: var(--text);
    font-size: 0.88rem;
}

.node-type-badge {
    display: inline-block;
    border-radius: 999px;
    background: #eef6ff;
    color: var(--accent);
    padding: 0.1rem 0.55rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ignored-meta {
    color: var(--muted);
}

.node-children {
    margin-top: 8px;
    padding-left: 14px;
}

.note-panel {
    margin: 8px 0 0 28px;
}

.note-textarea {
    width: 100%;
    min-height: 96px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    color: var(--text);
    background: #fff;
}

.note-textarea:focus {
    outline: 2px solid rgba(9, 105, 218, 0.15);
    border-color: var(--accent);
}

.empty-state {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    padding: 18px 16px;
}

.home-layout {
    display: grid;
    gap: 18px;
}

.home-list {
    display: grid;
    gap: 12px;
}

.home-card {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
}

.home-card-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.home-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 4px;
}

.home-card-text {
    margin: 0;
    color: var(--muted);
}

.home-card-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.import-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.import-input {
    flex: 1 1 320px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    color: var(--text);
    background: #fff;
}

.import-input:focus {
    outline: 2px solid rgba(9, 105, 218, 0.15);
    border-color: var(--accent);
}

.import-button {
    cursor: pointer;
}

.delete-button {
    cursor: pointer;
}

.progress-track {
    width: 100%;
    height: 10px;
    margin-top: 12px;
    background: #dfe7ef;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #0969da 0%, #2da44e 100%);
    transition: width 0.2s ease;
}

.home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
}

.home-link:hover {
    border-color: #8c959f;
    text-decoration: none;
}

.home-progress {
    color: var(--accent);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.save-indicator {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(9, 105, 218, 0.18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    pointer-events: none;
    z-index: 20;
    background: transparent;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

code {
    background: #f0f3f6;
    padding: 0.15em 0.35em;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.92em;
}

@media (max-width: 640px) {
    .page {
        padding: 24px 16px 40px;
    }

    h1 {
        font-size: 1.65rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .node-children {
        padding-left: 10px;
    }

    .note-panel {
        margin-left: 24px;
    }
}
