:root {
    --min: 15ch;
    --gap: 1rem;
    --mw: 30rem;
}

body {
    margin-bottom: 20vh;
}

h1 {
    font-family: sans-serif;
    margin-left: 1rem;
}

:is(.info-section ul) ul {
            padding-left: 1rem;
        }

/*
See https://gomakethings.com/how-to-build-a-reusable-grid-system-with-css-grid/
*/
.row {
    display: grid;
	grid-template-columns: repeat(12, 1fr);
	grid-template-rows: 1fr auto;
	column-gap: 1em;
    margin-bottom: 2rem;
    border-bottom: 1px solid;
    padding-bottom: 2rem;
}

.col-half {
	grid-column: auto / span 6;
}

.col-full {
    grid-column: auto / span 12;
}

.example {
    font-family: monospace;
    padding: 0 1rem;

    /* display: grid;
    grid-gap: var(--gap);
    min() with 100% prevents overflow in extra narrow spaces
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min)), 1fr)); */
}

.example p.description {
        max-width: var(--mw, 30rem);
        font-family: sans-serif;
        line-height: 1.5;
    }

.data {
    background-color: #f5f5f5;
    padding: 1rem;
    margin: 1rem 0;
}

h2 {
    font-size: 1.1rem;
}

h3 {
    margin-bottom: 1rem;
}

h3:first-child {
        margin-top: 0;
    }

section.section {
    margin-top: 1rem;
}

.participants-grid {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.participant {
    text-align: center;
    min-height: 10rem;
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    position: relative;
    overflow: hidden;
    background-color: #f5f5f5;
    border-color: #ccc;
}

.participant h4 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

.participant p {
        margin: 0;
        font-size: 0.8rem;
        margin-bottom: 1rem
    }

.participant .shard-container {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.6rem;
        margin-bottom: 0.5rem;
    }

.shard-box {
    width: 20px;
    height: 20px;
    border: 2px solid black;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.shard-box.no-shard {
        background-color: white;
    }

.shard-box.has-shard {
        background-color: #4caf50;
        border-color: #388e3c;
    }

.signing-selection label {
        display: flex;
        font-size: 1rem;
        gap: 1rem;
        align-items: center;
        cursor: pointer;
    }

.signing-selection input[type="checkbox"] {
        margin: 0;
        cursor: pointer;
    }

.status-indicators {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.status-card {
    padding: 1rem;
    min-height: 9.2rem;
    flex: 1;
    text-align: center;
    border: 2px solid;
    overflow: hidden;
}

.status-card.signing ul {
            text-align: left;
        }

.status-card.signing li {
            line-break: anywhere;
        }

.status-card h4 {
        margin-top: 0;
    }

.status-card.true {
        background: #d1ecf1;
        border-color: #bee5eb;
    }

.status-card.true h4,.status-card.true p {
            color: #0c5460;
        }

.status-card.false {
        background: #e2e3e5;
        border-color: #d1d3d4;
    }

.status-card p {
        margin: 5px 0;
        font-weight: bold;
    }

.action-buttons {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.btn {
    padding: 1rem 2rem;
    color: white;
    border: none;
    font-weight: bold;
}

.btn.primary {
    background: #007acc;
    cursor: pointer;
}

.btn.success {
    background: #28a745;
    cursor: pointer;
}

.btn.danger {
    background: #dc3545;
    cursor: pointer;
}

.btn[disabled] {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.status-section {
    background: #e8f5e8;
    padding: 1rem;
    margin: 1rem 0;
    min-height: 14rem;
    border-left: 4px solid #28a745;
}

.status-section .key-results {
        margin-top: 2rem;
    }

.status-section h3 {
        border-bottom: 1px solid;
    }

.processing-text {
    color: #666;
}

.error-section {
    background: #f8d7da;
    padding: 15px;
    margin: 20px 0;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
}

.error-section h3,
.error-section p {
    color: #721c24;
}

.key-comparison-section {
    background: #f8f9fa;
    padding: 15px;
    margin: 20px 0;
    border-left: 4px solid #6c757d;
}

.key-comparison-section h3 {
    color: #495057;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 15px 0;
}

.key-info {
    background: #fff;
    padding: 12px;
    border: 1px solid #dee2e6;
}

.key-info h4 {
    margin: 0 0 10px 0;
    color: #343a40;
    font-size: 14px;
}

.key-info p {
    margin: 5px 0;
    font-size: 12px;
    font-family: monospace;
}

.comparison-result {
    padding: 12px;
    margin-top: 15px;
}

.comparison-result.keys-match {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.comparison-result.keys-different {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.comparison-result p {
    margin: 8px 0;
}

.comparison-result .explanation {
    font-style: italic;
    margin-top: 10px;
    font-size: 13px;
}

.verification-section {
    padding: 15px;
    margin: 20px 0;
    border-left: 4px solid;
}

.verification-section.valid {
    background: #d1ecf1;
    border-color: #17a2b8;
}

.verification-section.invalid {
    background: #f8d7da;
    border-color: #dc3545;
}

.success-message {
    color: #155724;
    font-weight: bold;
    background: #d4edda;
    padding: 10px;
    margin-top: 10px;
}

.info-section {
    padding: 15px;
    margin: 20px 0;
    border-left: 4px solid #ffc107;
    max-width: var(--mw, 30rem);
}

.verification-controls {
    background: #f8f9fa;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #007acc;
}

.verification-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: bold;
    color: #343a40;
}

.message-input {
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    font-family: monospace;
    font-size: 14px;
}

.message-input:focus {
    outline: none;
    border-color: #007acc;
}

.radio-group {
    display: flex;
    gap: 15px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin: 0;
}

.verification-buttons {
    display: flex;
    gap: 10px;
}

.signature-display {
    background: #e9ecef;
    padding: 15px;
    border: 1px solid #ced4da;
}

.signature-display h4 {
    margin: 0 0 10px 0;
    color: #495057;
}

.signature-data {
    font-family: monospace;
    font-size: 12px;
    word-break: break-all;
}

.signature-data p {
    margin: 8px 0;
    padding: 8px;
    background: #fff;
    border: 1px solid #dee2e6;
}

.verification-result {
    padding: 15px;
    border: 2px solid;
}

.verification-result.valid {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.verification-result.invalid {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.verification-result h4 {
    margin: 0 0 10px 0;
}

.verification-result p {
    margin: 5px 0;
}
