:root {
    --ink: #14181a;
    --muted: #5e6366;
    --subtle: #909699;
    --line: #c4c9cc;
    --surface: #ffffff;
    --canvas: #f5f8fa;
    --brand: #2acb40;
    --brand-dark: #209930;
    --brand-pale: #e4f9e7;
    --link: #0969da;
    font-family: Inter, Arial, sans-serif;
    color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; }
body { background: var(--canvas); font-size: 12px; }
button { font: inherit; }

.home-shell { display: flex; min-height: 100vh; }
.home-sidebar { background: var(--surface); display: flex; flex: 0 0 240px; flex-direction: column; gap: 10px; min-height: 100vh; padding: 12px 0; }
.home-brand { align-items: center; display: flex; gap: 8px; height: 44px; padding: 0 12px; color: var(--brand-dark); font-family: 'IBM Plex Mono', monospace; font-size: 20px; font-weight: 600; line-height: 1; white-space: nowrap; }
.home-brand-mark { align-items: center; background: var(--brand); border-radius: 5.818px; display: flex; height: 32px; justify-content: center; width: 32px; }
.home-brand-mark img { height: 23.273px; width: 23.273px; }
.home-nav-wrap { display: flex; flex: 1; flex-direction: column; justify-content: space-between; min-height: 0; padding: 0 12px; }
.home-nav { display: flex; flex-direction: column; gap: 10px; }
.home-nav-item { align-items: center; border: 1px solid transparent; border-radius: 8px; color: var(--muted); display: flex; gap: 12px; height: 36px; padding: 5px 12px; text-decoration: none; }
.home-nav-item img { flex: 0 0 16px; height: 16px; width: 16px; }
.home-nav-item.is-active { background: var(--brand-pale); border-color: var(--brand); color: var(--ink); cursor: pointer; text-align: left; width: 100%; }
.home-user-card { align-items: center; background: var(--canvas); border-radius: 8px; display: flex; gap: 8px; height: auto; min-height: 52px; padding: 10px; }
.home-avatar { border-radius: 50%; height: 32px; object-fit: cover; object-position: bottom; width: 32px; }
.home-user-card div { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.home-user-card strong { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-user-card span { color: var(--subtle); font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.home-main { display: flex; flex: 1; flex-direction: column; gap: 32px; min-width: 0; overflow: auto; padding: 32px; }
.start-section, .content-section { width: 100%; }
.start-section { display: flex; flex-direction: column; gap: 16px; }
.section-top, .section-heading-row { align-items: center; display: flex; justify-content: space-between; }
.section-heading-row { flex-direction: row; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; font-weight: 600; line-height: normal; }
.machine-select { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; display: flex; height: 32px; justify-content: space-between; padding: 1px; width: 140px; }
.machine-select > img:first-child { height: 28px; width: 28px; }
.machine-select span { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.machine-select strong { color: #2e3133; font-size: 12px; font-weight: 500; line-height: 15px; }
.machine-select small { align-items: center; color: var(--brand); display: flex; font-size: 10px; line-height: 12px; }
.machine-select small i { background: var(--brand); border-radius: 50%; height: 5px; margin-right: 2px; width: 5px; }
.machine-select .chevron { height: 16px; margin: 0 6px; width: 16px; }
.start-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.start-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; height: 220px; justify-content: space-between; overflow: hidden; padding: 22px; }
.start-card-title { align-items: center; display: flex; gap: 10px; height: 32px; }
.start-card-title img { height: 24px; width: 24px; }
.start-card h2 { font-size: 20px; font-weight: 600; }
.start-card p { color: var(--muted); font-size: 14px; line-height: 18px; margin-top: 8px; max-width: 440px; }
.file-picker { align-items: center; background: var(--canvas); border: 1px dashed var(--link); border-radius: 7px; cursor: pointer; display: flex; gap: 12px; height: 70px; overflow: hidden; padding: 0 16px; text-align: left; width: 100%; }
.file-picker:hover, .file-picker:focus-visible { background: #edf5fd; outline: 2px solid transparent; }
.file-picker.is-loading { cursor: wait; opacity: .75; }
.file-picker > img { height: 24px; width: 24px; }
.file-picker span { display: flex; flex-direction: column; gap: 2px; }
.file-picker strong { color: #2e3133; font-size: 14px; font-weight: 500; }
.file-picker small { color: var(--muted); font-size: 12px; }
.start-button { align-items: center; align-self: flex-start; background: var(--brand-dark); border: none; border-radius: 6px; color: white; cursor: pointer; display: flex; gap: 4px; height: 36px; justify-content: center; padding: 0 24px; font-weight: 600; }
.start-button img { filter: brightness(0) invert(1); height: 16px; width: 16px; }

.start-card-ai {
    position: relative;
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: inset 0 3px 0 var(--brand);
}
.start-card-ai::before {
    content: "";
    position: absolute;
    right: 18px;
    top: 17px;
    width: 54px;
    height: 30px;
    background-image: radial-gradient(circle, rgba(32, 153, 48, .42) 1px, transparent 1.5px);
    background-size: 9px 9px;
    opacity: .55;
    pointer-events: none;
}
.start-card-ai .start-card-title em {
    align-items: center;
    background: var(--brand-pale);
    border: 1px solid #8fd39a;
    border-radius: 9px;
    color: var(--brand-dark);
    display: inline-flex;
    font-size: 9px;
    font-style: normal;
    font-weight: 600;
    height: 18px;
    letter-spacing: .04em;
    padding: 0 7px;
    text-transform: uppercase;
}
.start-card-ai p { max-width: 360px; }
.ai-card-footer { align-items: flex-start; display: flex; flex-direction: column; gap: 9px; }
.ai-card-footer > span { color: var(--subtle); font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }
.start-button-ai {
    background: linear-gradient(105deg, #187d27 0%, var(--brand-dark) 58%, #24ad37 100%);
    border: 1px solid #146c21;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 4px 10px rgba(32,153,48,.18);
    gap: 7px;
    min-width: 158px;
    overflow: hidden;
    position: relative;
}
.start-button-ai::after {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.24), transparent);
    content: "";
    height: 100%;
    left: -55%;
    position: absolute;
    top: 0;
    transform: skewX(-18deg);
    transition: left 420ms ease;
    width: 38%;
}
.start-button-ai > * { position: relative; z-index: 1; }
.start-button-ai .ai-button-mark { height: 15px; width: 15px; }
.start-button-ai > img:last-child { margin-left: 2px; }
.start-button-ai:hover::after, .start-button-ai:focus-visible::after {
    left: 120%;
}
.start-button-ai:hover, .start-button-ai:focus-visible {
    background: linear-gradient(105deg, #146c21 0%, #187d27 58%, var(--brand-dark) 100%);
    outline: 2px solid transparent;
}
@media (prefers-reduced-motion: reduce) { .start-button-ai::after { display: none; } }

.content-section { display: flex; flex-direction: column; gap: 12px; }
.section-heading { display: flex; flex-direction: column; gap: 4px; }
.section-heading h2 { font-size: 20px; font-weight: 600; line-height: 28px; }
.section-heading p { color: var(--muted); font-size: 12px; line-height: 16px; }
.section-heading-row > span, .more-scenarios { align-items: center; color: var(--link); display: flex; font-size: 12px; font-weight: 500; gap: 4px; }
.section-heading-row > span img, .more-scenarios img { height: 12px; width: 12px; }
.scenario-grid, .project-grid, .community-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.scenario-card, .project-card, .community-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.scenario-card { min-height: 178px; }
.scenario-card > img { display: block; height: auto; object-fit: cover; width: 100%; }
.scenario-card > div { padding: 10px; }
.scenario-card h3 { font-size: 14px; font-weight: 600; line-height: 20px; }
.scenario-card p { color: var(--muted); font-size: 12px; line-height: 16px; }
.more-scenarios { align-self: flex-end; background: var(--surface); border-radius: 14px; padding: 4px 10px; }

.project-card, .community-card { display: flex; flex-direction: column; gap: 8px; }
.project-image { aspect-ratio: 329.333 / 185.25; overflow: hidden; position: relative; }
.project-image > img:first-child { height: 100%; object-fit: cover; width: 100%; }
.file-tags { display: flex; gap: 4px; left: 10px; position: absolute; top: 10px; }
.file-tags span { background: #ebeef0; border-radius: 4px; color: var(--muted); font-size: 12px; line-height: 16px; padding: 2px 4px; }
.more-icon { background: var(--surface); border-radius: 8px; box-shadow: 0 1px 1px rgba(26,26,26,.2); height: 28px; padding: 2px; position: absolute; right: 10px; top: 10px; width: 28px; }
.project-info { align-items: center; display: flex; justify-content: space-between; padding: 0 10px 10px; }
.project-info h3 { color: var(--link); font-size: 16px; font-weight: 600; line-height: 20px; }
.project-info p { color: var(--subtle); font-size: 12px; line-height: 16px; }
.project-info em { background: #ebeef0; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 12px; font-style: normal; font-weight: 600; line-height: 16px; padding: 3px 8px; }
.project-card.is-ready .project-info em { background: #e4f9e7; border-color: var(--brand); color: var(--brand-dark); }

.community-image { aspect-ratio: 329.333 / 185.25; overflow: hidden; position: relative; }
.community-image > img { height: 100%; object-fit: cover; width: 100%; }
.community-image > div { display: flex; gap: 4px; position: absolute; right: 10px; top: 10px; }
.community-image span { align-items: center; backdrop-filter: blur(4px); background: rgba(235,238,240,.6); border-radius: 12px; color: var(--muted); display: flex; gap: 2px; height: 24px; padding: 4px; }
.community-image span img { height: 12px; width: 12px; }
.community-card > div:last-child { display: flex; flex-direction: column; gap: 4px; padding: 0 10px 10px; }
.community-card h3 { color: var(--link); font-size: 14px; font-weight: 600; line-height: 20px; }
.community-card p { align-items: center; color: var(--subtle); display: flex; font-size: 12px; gap: 4px; line-height: 16px; }
.community-card p img { border-radius: 50%; height: 16px; width: 16px; }

@media (max-width: 1180px) { .start-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .scenario-grid, .project-grid, .community-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .home-sidebar { flex-basis: 190px; } .home-main { padding: 24px; } .start-grid { grid-template-columns: 1fr; } .scenario-grid, .project-grid, .community-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .home-shell { display: block; } .home-sidebar { min-height: auto; width: 100%; } .home-nav-wrap { gap: 18px; } .home-nav { flex-direction: row; overflow: hidden; } .home-nav-item { flex: 0 0 auto; } .home-nav-item:not(.is-active) { display: none; } .home-user-card { display: none; } .home-login-btn { display: none; } .home-main { padding: 20px 16px; } .section-top { align-items: flex-start; gap: 12px; } h1 { font-size: 24px; } .start-card { padding: 18px; } .scenario-grid, .project-grid, .community-grid { grid-template-columns: 1fr; } }

.home-login-btn { align-items: center; background: var(--brand); border: none; border-radius: 8px; color: #fff; cursor: pointer; display: flex; gap: 8px; height: 40px; justify-content: center; padding: 0 16px; width: 100%; font-weight: 500; font-size: 14px; }
.home-login-btn:hover { background: var(--brand-dark); }
.home-login-btn img { height: 16px; width: 16px; filter: brightness(0) invert(1); }

.home-logout-btn { align-items: center; background: var(--brand); border: none; border-radius: 6px; color: #fff; cursor: pointer; display: flex; font-size: 12px; font-weight: 500; height: 24px; margin-top: 4px; padding: 0 10px; width: fit-content; }
.home-logout-btn:hover { background: var(--brand-dark); }
