:root {
    --bg: #0a0a0f;
    --surface: #12121a;
    --border: #1e1e2e;
    --text: #e0e0e8;
    --text-muted: #8888a0;
    --accent: #6c63ff;
    --accent-dim: #4a44b0;
    --green: #34d399;
    --red: #f87171;
    --yellow: #fbbf24;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

nav {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-muted);
}
nav a { color: var(--accent); text-decoration: none; }

main { max-width: 900px; margin: 0 auto; padding: 2rem; }

h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.25rem; }
h2 { font-size: 1.4rem; margin: 2rem 0 1rem; color: var(--text-muted); }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.75rem; }

time { color: var(--text-muted); font-size: 0.9rem; }

.hero { text-align: center; padding: 3rem 0; }
.hero .subtitle {
    font-size: 1.2rem;
    color: var(--accent);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.hero .description {
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-muted);
}
.hero-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: border-color 0.2s, background 0.2s;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); font-size: 1.05rem; padding: 0.85rem 2rem; }
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.btn-secondary { background: var(--surface); }

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-badge.approved { background: var(--green); color: #000; }
.status-badge.rejected { background: var(--red); color: #000; }

.cycle-grid { display: flex; flex-direction: column; gap: 1rem; }
.cycle-card {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s;
}
.cycle-card:hover { border-color: var(--accent); }
.cycle-card img {
    width: 200px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}
.cycle-card-info h3 { margin: 0 0 0.25rem; }
.cycle-card-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.plan pre {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.screenshot-pair {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.screenshot-pair figure { flex: 1; min-width: 250px; }
.screenshot-pair img {
    width: 100%;
    border-radius: 6px;
    border: 1px solid var(--border);
}
figcaption {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.iteration {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--border);
    background: var(--surface);
}
.iteration.approved { border-left-color: var(--green); }
.iteration.rejected { border-left-color: var(--red); }
.iteration-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.iteration-label { font-weight: 600; }
.reasoning, .feedback { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.5rem; }

.collab-entry {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
}
.collab-entry.coder { background: #1a1a2e; }
.collab-entry.architect { background: #1e1a2e; }
.collab-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--accent);
    display: block;
    margin-bottom: 0.25rem;
}

.visit-link { text-align: center; margin: 3rem 0; }
.visit-link a { color: var(--accent); font-weight: 600; font-size: 1.1rem; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
th, td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
th { color: var(--text-muted); font-weight: 600; }

.pin {
    display: inline-block;
    background: var(--yellow);
    color: #000;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
}

.no-thumb {
    width: 200px;
    height: 120px;
    background: var(--surface);
    border-radius: 4px;
}

.cycle-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.stats-bar {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.stats-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat {
    text-align: center;
    min-width: 100px;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Daily screenshots page */
.daily-day { margin-bottom: 2.5rem; }
.daily-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.daily-thumb { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.daily-thumb img { width: 100%; height: 180px; object-fit: cover; object-position: top; }
.daily-thumb figcaption { padding: 0.5rem; font-size: 0.8rem; color: var(--text-muted); text-align: center; }

/* Hero screenshot */
.hero-screenshot { margin-top: 2rem; max-width: 700px; margin-inline: auto; }
.hero-screenshot img { width: 100%; border-radius: 8px; border: 1px solid var(--border); }

/* Diary box */
.diary-box {
    margin: 2.5rem 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.diary-box-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(108,99,255,0.08), rgba(108,99,255,0.02));
}
.diary-box-header h2 { margin: 0 0 0.25rem; font-size: 1.3rem; color: var(--text); }
.diary-subtitle { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.diary-entries { padding: 1.25rem 1.5rem; max-height: 500px; overflow-y: auto; }
.diary-entry {
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    background: rgba(255,255,255,0.02);
}
.diary-entry:last-child { margin-bottom: 0; }
.diary-entry time { display: block; font-size: 0.8rem; color: var(--accent-dim); margin-bottom: 0.5rem; font-weight: 600; }
.diary-entry p { font-size: 0.9rem; line-height: 1.7; margin: 0; }
.diary-empty { color: var(--text-muted); font-size: 0.9rem; font-style: italic; }

/* Countdown timer */
.countdown-section {
    text-align: center;
    padding: 1.5rem 0;
    margin: 0 0 2rem;
}
.countdown-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.75rem;
}
.countdown-timer {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center;
    align-items: baseline;
    gap: 0;
}
.countdown-unit {
    display: inline-flex;
    align-items: baseline;
    gap: 0.15rem;
}
.countdown-unit span {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.countdown-unit small {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.countdown-sep {
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--accent-dim);
    margin: 0 0.3rem;
}
.countdown-date {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Gallery section */
.gallery-section { margin: 2.5rem 0; }
.gallery-header { margin-bottom: 1.5rem; }
.gallery-header h2 { font-size: 1.4rem; color: var(--text); margin: 0 0 0.25rem; }
.gallery-subtitle { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.gallery-empty { color: var(--text-muted); font-style: italic; }

/* Gallery filters */
.gallery-filters {
    display: flex;
    gap: 1.5rem;
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}
.filter-checkbox input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--accent);
    cursor: pointer;
}
.filter-label {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 500;
}
.generated-thumb { border-color: var(--accent); }

/* Image gallery on main page */
.image-gallery-section { margin: 2.5rem 0; }
.gallery-date-group { margin-bottom: 2rem; }
.gallery-date-heading {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin: 0 0 1rem;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.gallery-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}
.gallery-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.gallery-item a { display: block; }
.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: top;
    display: block;
}
.gallery-item figcaption {
    padding: 0.6rem 0.75rem;
    text-align: left;
}
.item-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.3rem;
}
.item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}
.item-type-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.item-type-badge.type-generated {
    background: var(--accent);
    color: #fff;
}
.item-type-badge.type-screenshot {
    background: var(--border);
    color: var(--text-muted);
}
.item-date {
    color: var(--text-muted);
}

/* Revert banner */
.revert-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid var(--red);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text);
}
.revert-icon {
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
}

/* Cost chart */
.cost-chart-section {
    margin: 2rem 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
}
.cost-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.cost-chart-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text);
}
.cost-chart-summary {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.cost-chart-summary strong {
    color: var(--accent);
}
.cost-chart-container {
    overflow-x: auto;
}
.cost-chart-svg {
    width: 100%;
    max-height: 200px;
    display: block;
}
.cost-chart-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #8888a0;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

@media (max-width: 600px) {
    main { padding: 1rem; }
    h1 { font-size: 1.8rem; }
    .cycle-card { flex-direction: column; }
    .cycle-card img { width: 100%; height: auto; }
    .screenshot-pair { flex-direction: column; }
    .stats-grid { justify-content: center; }
    .stat { min-width: 80px; }
    .stat-value { font-size: 1.4rem; }
    .daily-grid { grid-template-columns: 1fr; }
    .daily-thumb img { height: 140px; }
    .gallery-grid { grid-template-columns: 1fr; }
    .gallery-item img { height: 160px; }
    .countdown-unit span { font-size: 1.8rem; }
    .countdown-sep { font-size: 1.4rem; }
    .cost-chart-header { flex-direction: column; }
    .cost-chart-summary { gap: 1rem; }
}
