:root {
    --color-text: #1a1a1a;
    --color-muted: #555;
    --color-border: #d9d9d9;
    --color-bg: #fff;
    --color-bg-soft: #f5f5f4;
    --color-accent: #175c45;
    --color-note-bg: #fff8e1;
    --color-note-border: #e0c36a;
    --content-width: 72rem;
}

* {
    box-sizing: border-box;
}

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

.container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 1rem;
}

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

.site-header {
    border-bottom: 1px solid var(--color-border);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.site-logo {
    font-weight: 700;
    text-decoration: none;
    color: var(--color-text);
}

.lang-switcher {
    display: flex;
    gap: 0.75rem;
}

.lang-switcher span[aria-current] {
    font-weight: 700;
}

main.container {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

.lead {
    color: var(--color-muted);
    font-size: 1.1rem;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.75rem 1rem;
    align-items: end;
    padding: 1rem;
    margin: 1.5rem 0;
    background: var(--color-bg-soft);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.filters label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.filters input,
.filters select {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font: inherit;
    background: var(--color-bg);
}

.filters-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    display: inline-block;
    padding: 0.45rem 1rem;
    border: 1px solid var(--color-accent);
    border-radius: 6px;
    background: var(--color-accent);
    color: #fff;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.btn-secondary {
    background: transparent;
    color: var(--color-accent);
}

.results-count {
    color: var(--color-muted);
}

.cards {
    list-style: none;
    margin: 1rem 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: 1rem;
}

.card {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-title {
    margin: 0;
    font-size: 1.15rem;
}

.card-description {
    margin: 0;
    color: var(--color-muted);
    flex-grow: 1;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.5rem 0;
}

.badge {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg-soft);
    font-size: 0.8rem;
    color: var(--color-muted);
    white-space: nowrap;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.pagination span[aria-current] {
    font-weight: 700;
}

.preview-note,
.fallback-note {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-note-border);
    border-radius: 6px;
    background: var(--color-note-bg);
    font-size: 0.9rem;
}

.facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 1.25rem;
    margin: 0;
}

.facts dt {
    font-weight: 600;
}

.facts dd {
    margin: 0;
}

section {
    margin: 2rem 0;
}

section h2 {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.35rem;
}

.resources {
    list-style: none;
    padding-left: 0;
}

.resources li {
    margin-bottom: 0.35rem;
}

.resources i {
    width: 1.4em;
    text-align: center;
    color: var(--color-muted);
}

.dashboard-links {
    list-style: none;
    padding-left: 0;
}

.dashboard-links li {
    margin-bottom: 0.4rem;
}

.dashboard-links i {
    width: 1.4em;
    text-align: center;
    color: var(--color-muted);
}

.site-footer {
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    font-size: 0.9rem;
}

.empty {
    padding: 2rem;
    text-align: center;
    color: var(--color-muted);
    background: var(--color-bg-soft);
    border-radius: 8px;
}

.site-header-side {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logout-form {
    display: inline;
}

.link-button {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    color: var(--color-accent);
    text-decoration: underline;
    cursor: pointer;
}

.flash {
    padding: 0.6rem 0.9rem;
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.flash-success {
    background: #eaf6ef;
    border-color: #9ecfb2;
}

.flash-error {
    background: #fdeaea;
    border-color: #e3a5a5;
}

.auth-card {
    max-width: 28rem;
    margin: 2rem auto;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.auth-card form > div {
    margin-bottom: 0.9rem;
}

.auth-card label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
main form textarea,
main form input[type="file"] {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font: inherit;
}

.auth-links {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.dashboard-links {
    padding-left: 1.25rem;
}

.avatar-preview {
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--color-border);
}

.collection {
    margin-bottom: 0.9rem;
}

.collection-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.collection-item input {
    flex: 1;
}

.community-actions {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.structured-form {
    max-width: 46rem;
}

.structured-form section {
    margin: 1.5rem 0;
}

.structured-form > section > div,
.structured-form .collection {
    margin-bottom: 0.9rem;
}

form div:has(> input[type="checkbox"]) {
    display: inline-block;
    margin-right: 1.1rem;
}

form input[type="checkbox"] + label {
    display: inline;
    font-weight: 400;
    margin-left: 0.3rem;
}

.structured-form label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.structured-form input[type="text"],
.structured-form input[type="url"],
.structured-form select,
.structured-form textarea {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font: inherit;
    background: var(--color-bg);
}

.collection-item select {
    max-width: 12rem;
}

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

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

ul.form-errors,
.auth-card ul {
    color: #a33;
    padding-left: 1.1rem;
    margin: 0.25rem 0;
}
