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

/* Basis */
html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
    background: #f4f4f4;
    line-height: 1.6;
}

/* Layout */
.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header */
.site-header {
    padding: 1.25rem 0;
    border-bottom: 2px solid #1a1a1a;
    margin-bottom: 2rem;
}

.site-title {
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    color: #1a1a1a;
    letter-spacing: 0.02em;
}

.site-title:hover {
    text-decoration: underline;
}

/* Seitenüberschrift */
.page-header {
    margin-bottom: 1.25rem;
}

.back-link {
    font-size: 0.875rem;
    color: #555;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    line-height: 1.3;
}

h2 {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
    margin-bottom: 0.75rem;
}

/* Startseite: Überschrift + Button nebeneinander */
.page-header-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.page-header-row h1 {
    margin-bottom: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.45rem 1rem;
    border: 1px solid #999;
    border-radius: 3px;
    background: #fff;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:hover {
    background: #efefef;
}

.btn-primary {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.btn-primary:hover {
    background: #333;
    border-color: #333;
}

.btn-danger {
    border-color: #c00;
    color: #c00;
    background: #fff;
}

.btn-danger:hover {
    background: #fff5f5;
}

.btn-reveal {
    border-color: #444;
    background: #fff;
}

.btn-reveal:hover {
    background: #f0f0f0;
}

.btn-small {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

/* Meldungen */
.message {
    padding: 0.75rem 1rem;
    border-radius: 3px;
    margin-bottom: 1.5rem;
    border: 1px solid;
    list-style: none;
}

.message-error {
    background: #fff5f5;
    border-color: #f5c6cb;
    color: #721c24;
}

.message-error li + li {
    margin-top: 0.25rem;
}

.message-success {
    background: #f5fff8;
    border-color: #b7dfc4;
    color: #155724;
}

.empty-message {
    color: #666;
    font-style: italic;
    margin-bottom: 1.5rem;
}

/* Themenliste (Startseite) */
.topic-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.topic-item {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 1rem 1.25rem;
    background: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.topic-info {
    flex: 1;
    min-width: 0;
}

.topic-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    word-break: break-word;
}

.topic-meta {
    font-size: 0.85rem;
    color: #666;
}

.badge-revealed {
    color: #555;
}

.topic-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: flex-start;
}

/* Schätzungsliste */
.estimates-section {
    margin-bottom: 2rem;
}

.estimate-list {
    list-style: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.estimate-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.estimate-item:last-child {
    border-bottom: none;
}

.estimate-name {
    font-weight: 500;
    flex: 1;
    word-break: break-word;
}

.estimate-value {
    color: #333;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.revealed-notice {
    font-size: 0.85rem;
    color: #555;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

/* Aktions-Leiste auf der Themenseite */
.topic-actions-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

/* Formulare */
.form {
    max-width: 480px;
}

.form-group {
    margin-bottom: 1.25rem;
}

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

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1rem;
    font-family: inherit;
    color: #1a1a1a;
    background: #fff;
}

.form-input:focus {
    outline: 2px solid #1a1a1a;
    outline-offset: 1px;
    border-color: #1a1a1a;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* Inline-Formular (für Lösch-Buttons in Listen) */
.inline-form {
    display: inline;
}

/* Responsive */
@media (max-width: 500px) {
    .topic-item {
        flex-direction: column;
        align-items: stretch;
    }

    .topic-actions {
        justify-content: flex-start;
    }

    .estimate-item {
        flex-wrap: wrap;
    }

    .estimate-value {
        order: 3;
        flex-basis: 100%;
        padding-left: 0;
        color: #555;
        font-size: 0.9rem;
    }
}
