:root {
    --bg: #0f1115;
    --panel: #171a21;
    --panel-2: #1e232c;
    --border: #2a3038;
    --text: #e6e8eb;
    --muted: #8b93a1;
    --accent: #4c8bf5;
    --accent-2: #66c0f4;
    --danger: #e5534b;
    --ok: #3fb950;
}

* { box-sizing: border-box; }

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

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

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.brand { font-size: 18px; font-weight: 700; color: var(--text); }
.brand span { color: var(--accent-2); }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.who { color: var(--muted); font-size: 14px; }

.container { max-width: 920px; margin: 0 auto; padding: 28px 24px 80px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 26px; }
.head-actions { display: flex; gap: 8px; }
.meta { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

/* buttons */
.btn {
    display: inline-block; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--panel-2); color: var(--text); font-size: 14px; cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #3b78e0; }
button.link { background: none; border: none; color: var(--accent-2); cursor: pointer; font-size: 13px; padding: 0; }
button.link.danger { color: var(--danger); }
.inline { display: inline; }

/* list table */
table.list { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
table.list th { color: var(--muted); font-weight: 600; background: var(--panel-2); }
table.list tr:last-child td { border-bottom: none; }
a.title { font-weight: 600; }

.status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status.s-draft { background: #33383f; color: var(--muted); }
.status.s-submitted { background: #1c3a5e; color: var(--accent-2); }
.status.s-reviewed { background: #1c3d24; color: var(--ok); }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty p { margin-bottom: 16px; }

/* form */
.pitch-form .statusbar { margin-bottom: 20px; }
.section {
    background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
    padding: 18px 20px; margin: 0 0 18px;
}
fieldset.section { min-width: 0; }
.section legend, .section h2 { font-size: 17px; font-weight: 700; padding: 0; margin: 0 0 6px; color: var(--accent-2); }
.section.reviewer { border-color: #4a3a1c; background: #1a170f; }
.section.reviewer legend, .section.reviewer h2 { color: #e3b341; }
.section-desc { color: var(--muted); font-size: 13px; margin: 0 0 14px; }

.field { margin-bottom: 16px; }
.field-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field-help { color: var(--muted); font-size: 12px; margin: 0 0 6px; }

input[type=text], textarea, select {
    width: 100%; padding: 9px 11px; background: var(--bg); color: var(--text);
    border: 1px solid var(--border); border-radius: 6px; font: inherit;
}
input[type=text]:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; }
select { width: auto; min-width: 160px; }

.options { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.opt { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.opt input { accent-color: var(--accent); }

.stars-input { display: flex; gap: 14px; }
.star { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { border: 1px solid var(--border); padding: 6px; text-align: left; font-size: 14px; vertical-align: top; }
table.grid th { background: var(--panel-2); color: var(--muted); font-weight: 600; }
table.grid td input { border: none; background: transparent; padding: 4px; }

.form-actions { display: flex; gap: 10px; margin-top: 8px; position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 40%); }

/* view */
.view-field { display: grid; grid-template-columns: 220px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.view-field:first-of-type { border-top: none; }
.view-label { color: var(--muted); font-size: 14px; font-weight: 600; }
.view-value { font-size: 14px; }
.prose { white-space: pre-wrap; }
.muted { color: var(--muted); }
.stars { color: #e3b341; letter-spacing: 2px; }
ul.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
ul.chips li { background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: 13px; }

/* comments */
.comments { margin-top: 30px; }
.comments h2 { font-size: 18px; color: var(--accent-2); }
.comment { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.comment-head { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.comment-anchor { color: var(--accent-2); font-size: 12px; }
.comment-body { font-size: 14px; }
.comment-form { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.comment-form select { align-self: flex-start; }
.comment-form button { align-self: flex-start; }

/* login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 40px; text-align: center; max-width: 380px; width: 100%; }
.login-logo { font-size: 44px; }
.login-card h1 { margin: 8px 0; font-size: 24px; }
.login-card .muted { font-size: 14px; margin-bottom: 24px; }
.login-card .error { color: var(--danger); font-size: 14px; margin-bottom: 16px; }
.google-btn {
    display: inline-flex; align-items: center; gap: 10px; background: #fff; color: #1f1f1f;
    padding: 11px 22px; border-radius: 8px; font-weight: 600; font-size: 15px;
}
.google-btn:hover { text-decoration: none; background: #f1f1f1; }
.google-btn .g { color: #4285f4; font-weight: 800; }

@media (max-width: 640px) {
    .view-field { grid-template-columns: 1fr; gap: 2px; }
    .page-head { flex-direction: column; }
}
