:root {
    --bg: #f4f1ea;
    --surface: #fffdfa;
    --surface-alt: #efe6d7;
    --text: #1e1a16;
    --muted: #665f57;
    --accent: #006a6a;
    --accent-soft: #cfe8e8;
    --border: #d9cfbf;
    --danger: #a53a2b;
    --success: #2f6b38;
    --shadow: 0 14px 40px rgba(30, 26, 22, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    background:
        radial-gradient(circle at top left, rgba(0, 106, 106, 0.08), transparent 28%),
        linear-gradient(180deg, #f8f4ed 0%, var(--bg) 100%);
    color: var(--text);
}

a {
    color: inherit;
}

.shell {
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(217, 207, 191, 0.8);
    background: rgba(255, 253, 250, 0.88);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.brand__title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand__meta,
.eyebrow,
.muted {
    color: var(--muted);
}

.nav {
    display: flex;
    gap: 0.75rem;
}

.nav a {
    text-decoration: none;
    padding: 0.6rem 0.95rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.nav a.is-active,
.nav a:hover {
    border-color: var(--border);
    background: var(--surface-alt);
}

.page {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 3rem;
}

.hero,
.panel,
.card,
.upload-form {
    background: rgba(255, 253, 250, 0.96);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.hero {
    padding: 2rem;
    display: grid;
    gap: 1rem;
}

.hero h1,
.panel h2,
.card h3,
.upload-form h2 {
    margin: 0;
}

.hero p {
    max-width: 56rem;
    line-height: 1.6;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.8rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.button--ghost {
    background: transparent;
    color: var(--accent);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.review-meta-stack {
    grid-template-columns: 1fr;
}

.card {
    padding: 1.25rem;
}

.card dl {
    margin: 1rem 0 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 0.75rem;
}

.card dt {
    color: var(--muted);
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
}

.status::before {
    content: "";
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: currentColor;
}

.status--ok {
    color: var(--success);
}

.status--warn {
    color: var(--danger);
}

.panel {
    padding: 1.5rem;
    margin-top: 1rem;
}

.two-up {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1rem;
    margin-top: 1rem;
}

.checklist,
.upload-notes,
.upload-form ul {
    padding-left: 1.2rem;
    line-height: 1.65;
}

.upload-form {
    padding: 1.5rem;
}

.field {
    display: grid;
    gap: 0.45rem;
    margin-top: 1rem;
}

.field input[type="text"],
.field input[type="file"],
.field textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.flash {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
}

.flash--error {
    color: var(--danger);
    border-color: rgba(165, 58, 43, 0.35);
    background: rgba(165, 58, 43, 0.08);
}

.flash--success {
    color: var(--success);
    border-color: rgba(47, 107, 56, 0.35);
    background: rgba(47, 107, 56, 0.08);
}

.footer {
    padding: 0 0 2rem;
    text-align: center;
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    text-align: left;
    padding: 0.8rem 0.65rem;
    border-bottom: 1px solid var(--border);
}

.table th {
    color: var(--muted);
    font-weight: 700;
}

.table-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
    margin-top: 1rem;
}

.inline-form label {
    display: block;
    width: 100%;
    color: var(--muted);
}

.inline-form input[type="text"] {
    width: min(220px, 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.inline-form select {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.review-list {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
}

.review-block {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fffdfa;
    padding: 1rem 1.1rem;
}

.review-block--heading {
    border-left: 5px solid var(--accent);
}

.review-block--reference {
    border-left: 5px solid #9c7a2b;
}

.review-block--issue {
    border-left: 5px solid var(--danger);
}

.review-block__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.7rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 700;
    text-transform: capitalize;
}

.review-block__content p {
    margin: 0;
    line-height: 1.6;
}

.review-columns {
    align-items: start;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-weight: 700;
    text-transform: capitalize;
    background: var(--surface-alt);
}

.status-tag--matched {
    color: var(--success);
    border-color: rgba(47, 107, 56, 0.35);
    background: rgba(47, 107, 56, 0.08);
}

.status-tag--candidate,
.status-tag--unmatched {
    color: var(--danger);
    border-color: rgba(165, 58, 43, 0.35);
    background: rgba(165, 58, 43, 0.08);
}

.status-tag--parsed {
    color: var(--success);
    border-color: rgba(47, 107, 56, 0.35);
    background: rgba(47, 107, 56, 0.08);
}

.status-tag--uploaded,
.status-tag--processing {
    color: #8b5e1a;
    border-color: rgba(139, 94, 26, 0.35);
    background: rgba(139, 94, 26, 0.08);
}

.status-tag--failed {
    color: var(--danger);
    border-color: rgba(165, 58, 43, 0.35);
    background: rgba(165, 58, 43, 0.08);
}

.table-note-row td {
    padding-top: 0;
    font-size: 0.95rem;
}

@media (max-width: 760px) {
    .topbar,
    .two-up {
        grid-template-columns: 1fr;
        display: grid;
    }

    .nav {
        flex-wrap: wrap;
    }
}
