/* CollabCredit Styles — Dashboard-first, responsive, accessible */

:root {
    --color-bg: #f9f7f3;
    --color-surface: #ffffff;
    --color-text: #1e1e1e;
    --color-text-muted: #5e5e5e;
    --color-accent: #2a6e4f;
    --color-accent-hover: #1f553b;
    --color-danger: #b23b3b;
    --color-border: #ddd9ce;
    --color-chart-1: #2a6e4f;
    --color-chart-2: #d4a843;
    --color-chart-3: #4f7aa6;
    --color-chart-4: #b26a4f;
    --color-chart-5: #7a6e8a;
    --radius: 10px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-accent);
    font-weight: 700;
    font-size: 1.2rem;
}

.logo svg {
    flex-shrink: 0;
}

nav a {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    margin-left: 1.5rem;
    font-size: 0.95rem;
}

nav a:hover {
    color: var(--color-accent);
}

/* Main layout */
#app-root {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    width: 100%;
}

/* Setup card */
.project-setup {
    margin-bottom: 2rem;
}

.setup-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.setup-card h1 {
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
}

.setup-lede {
    color: var(--color-text-muted);
    margin-bottom: 1.25rem;
}

.project-name-row {
    margin-bottom: 1rem;
}

.project-name-row label,
.member-entry label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.project-name-row input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--color-bg);
}

.inline-add {
    display: flex;
    gap: 0.5rem;
}

.inline-add input {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--color-bg);
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    padding: 0.55rem 1.1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: var(--color-bg);
}

.member-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.member-list li {
    background: var(--color-bg);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.member-list li button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-danger);
    font-weight: bold;
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
}

.hint {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Task panel */
.task-panel {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.task-header h2 {
    font-size: 1.25rem;
}

.task-table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 600px;
}

th {
    text-align: left;
    padding: 0.5rem 0.6rem;
    border-bottom: 2px solid var(--color-border);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

td input, td select {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.9rem;
    background: var(--color-bg);
}

td input[type="number"] {
    width: 70px;
}

td input[type="checkbox"] {
    width: auto;
    transform: scale(1.1);
    cursor: pointer;
}

.delete-task-btn {
    background: none;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem 0.4rem;
}

.empty-state {
    color: var(--color-text-muted);
    font-style: italic;
    padding: 1rem 0;
}

/* Results dashboard */
.results-dashboard {
    margin-bottom: 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.chart-card, .stats-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.chart-card h2, .stats-card h2 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

.chart-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

canvas {
    flex-shrink: 0;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.fairness-display {
    text-align: center;
    margin: 1rem 0;
}

.fairness-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-accent);
}

.fairness-label {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.fairness-note {
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1.25rem;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

/* Support content */
.support-content {
    margin-top: 1rem;
}

.support-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.support-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.support-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
}

.support-card p, .support-card li {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.55;
}

.support-card ul {
    padding-left: 1.2rem;
}

.support-card li {
    margin-bottom: 0.4rem;
}

/* Footer */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-inner a {
    color: var(--color-accent);
    text-decoration: none;
    margin-left: 1rem;
}

.footer-inner a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 750px) {
    .results-grid,
    .support-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    nav a {
        margin-left: 0;
        margin-right: 1rem;
    }

    .task-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .action-buttons button {
        width: 100%;
    }
}

@media (max-width: 500px) {
    .setup-card, .task-panel, .chart-card, .stats-card, .support-card {
        padding: 1rem;
    }

    .fairness-number {
        font-size: 2.2rem;
    }

    .inline-add {
        flex-direction: column;
    }
}

/* Print styles */
@media print {
    .site-header, .site-footer, .action-buttons, .task-header button, .delete-task-btn, .inline-add, .member-entry, .project-name-row input {
        display: none;
    }

    body {
        background: #fff;
    }

    .setup-card, .task-panel, .chart-card, .stats-card, .support-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .results-grid {
        grid-template-columns: 1fr 1fr;
    }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
