* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f5f7;
    color: #222;
}

header {
    background: #20242a;
    color: white;
    padding: 18px 24px;
}

header h1 {
    margin: 0;
    font-size: 26px;
}

header p {
    margin: 4px 0 0;
    color: #c7cbd1;
    font-size: 14px;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.toolbar,
.detail-actions,
.form-actions,
.section-heading,
.contact-heading,
.contact-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar { margin-bottom: 20px; }
.detail-actions { margin-bottom: 16px; }
.form-actions { margin-top: 20px; }

.section-heading {
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.section-heading h3 {
    margin: 0;
    padding: 0;
    border: none;
}

.contact-heading {
    justify-content: space-between;
    align-items: flex-start;
}

.contact-buttons {
    gap: 6px;
}

.small-button {
    padding: 7px 10px;
    font-size: 14px;
}

.tiny-button {
    padding: 5px 8px;
    font-size: 12px;
}

input,
select,
textarea,
button {
    font: inherit;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #c7cbd1;
}

input,
select,
textarea {
    background: white;
    color: #222;
}

input[type="checkbox"] {
    width: auto;
    padding: 0;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 8px;
}

textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
}

#search {
    flex: 1;
    min-width: 220px;
}

#areaFilter {
    min-width: 200px;
}

button {
    background: #20242a;
    color: white;
    border: none;
    cursor: pointer;
}

button:hover {
    background: #343a42;
}

.secondary-button {
    background: #e3e5e8;
    color: #222;
}

.secondary-button:hover {
    background: #d4d7db;
}

.summary {
    margin-bottom: 12px;
    color: #555;
}

.venue-list {
    display: grid;
    gap: 12px;
}

.venue-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

.venue-card:hover {
    border-color: #999;
}

.venue-card h2 {
    margin: 0 0 6px;
    font-size: 19px;
}

.area {
    display: inline-block;
    font-size: 13px;
    font-weight: bold;
    background: #e8eaed;
    padding: 4px 8px;
    border-radius: 12px;
    margin-bottom: 10px;
}

.venue-details {
    font-size: 14px;
    line-height: 1.5;
}

.loading,
.error,
.empty,
.success {
    padding: 16px;
    background: white;
    border-radius: 8px;
}

.error { color: #a00000; }
.success { color: #176b2c; }

.detail-header {
    margin-bottom: 20px;
}

.detail-header h2 {
    margin: 10px 0 5px;
    font-size: 28px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 16px;
}

.detail-section {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 18px;
}

.detail-section h3 {
    margin: 0 0 14px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.detail-row {
    margin: 7px 0;
    line-height: 1.4;
}

.detail-label {
    font-weight: bold;
}

.record {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.record:last-child {
    border-bottom: none;
}

.record-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.contact-details {
    margin-top: 6px;
    line-height: 1.6;
}

.contact-entry {
    margin-top: 3px;
}

.primary-marker {
    font-size: 12px;
    font-weight: bold;
    background: #e8eaed;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

.muted {
    color: #666;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-weight: bold;
}

.form-field.full {
    grid-column: 1 / -1;
}

.form-panel {
    max-width: 850px;
}

.visit-acts {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

a {
    color: #1558a6;
}

@media (max-width: 700px) {
    main { padding: 14px; }

    .toolbar,
    .detail-actions,
    .form-actions {
        flex-direction: column;
    }

    #search,
    #areaFilter,
    button {
        width: 100%;
    }

    .detail-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-field.full {
        grid-column: auto;
    }

    .section-heading,
    .contact-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .contact-buttons {
        flex-direction: column;
    }

    input[type="checkbox"] {
        width: auto;
    }
}
