:root {
    --color-primary: #3b82f6;
    --color-primary-dark: #2563eb;
    --color-danger: #dc2626;
    --color-success-bg: #dcfce7;
    --color-success-text: #166534;
    --color-error-bg: #fee2e2;
    --color-error-text: #991b1b;
    --color-border: #e2e8f0;
    --color-bg: #f8fafc;
    --color-text: #1e293b;
    --color-muted: #64748b;
    --radius: 10px;
}

* { box-sizing: border-box; }

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

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

header { margin-bottom: 24px; }

h1 { font-size: 1.75rem; margin: 0 0 4px; }
h2 { font-size: 1.2rem; margin: 0 0 16px; }

.subtitle { color: var(--color-muted); margin: 0; }

.card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin: 16px 0 6px;
    font-size: 0.9rem;
}
label:first-of-type { margin-top: 0; }

input[type="text"],
input[type="datetime-local"],
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

textarea { resize: vertical; }

.option-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.option-row input { flex: 1; }

button {
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    border: none;
    padding: 10px 18px;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    margin-top: 18px;
    display: block;
    width: 100%;
}
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-secondary {
    background: #eef2ff;
    color: var(--color-primary-dark);
    margin-top: 4px;
}

.btn-link {
    display: inline-block;
    text-decoration: none;
    margin-right: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
    margin-left: 8px;
}

.btn-remove {
    background: transparent;
    color: var(--color-danger);
    padding: 6px 10px;
    font-size: 1rem;
}

.btn-link-danger {
    background: transparent;
    color: var(--color-danger);
    padding: 2px 6px;
    text-decoration: underline;
    font-size: 0.85rem;
}

.btn-link-primary {
    color: var(--color-primary-dark);
    font-weight: 600;
    text-decoration: none;
}
.btn-link-primary:hover { text-decoration: underline; }

.link-row {
    display: flex;
    gap: 8px;
}
.link-row input {
    flex: 1;
    min-width: 0;
}
.link-row input {
    background: #f1f5f9;
    cursor: text;
}
.btn-copy {
    white-space: nowrap;
    flex-shrink: 0;
}
.link-row > a,
.link-row > button {
    flex-shrink: 0;
    white-space: nowrap;
}

.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.flash-success { background: var(--color-success-bg); color: var(--color-success-text); }
.flash-error   { background: var(--color-error-bg); color: var(--color-error-text); }

.table-wrapper { overflow-x: auto; }

.vote-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 420px;
}
.vote-table th, .vote-table td {
    border: 1px solid var(--color-border);
    padding: 8px 10px;
    text-align: center;
    font-size: 0.9rem;
    white-space: nowrap;
}
.vote-table th:first-child, .vote-table td:first-child {
    text-align: left;
    white-space: normal;
}
.vote-table tfoot td { background: #f8fafc; font-size: 0.85rem; }

.vote-form-table td:first-child { white-space: normal; }

.vote-cell.vote-yes   { background: #f0fdf4; }
.vote-cell.vote-no    { background: #fef2f2; }
.vote-cell.vote-maybe { background: #fffbeb; }

th.best-option, td.best-option { background: #dcfce7 !important; }

tr.own-row td:first-child { font-weight: 600; }
.own-badge { color: var(--color-primary-dark); font-weight: 600; font-size: 0.8em; }

.hint { color: var(--color-muted); font-size: 0.85rem; margin-top: 12px; }
.footer-note { color: var(--color-muted); font-size: 0.85rem; text-align: center; }
.footer-note a { color: var(--color-primary-dark); }
