#timeline-check {
    max-width: 560px;
    margin: 40px auto;
    padding: 0 16px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

#timeline-check .tc-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

#timeline-check .tc-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 900;
    color: #111827;
}

#timeline-check .tc-subtitle {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.6;
    color: #6b7280;
}

#timeline-check .tc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

#timeline-check .tc-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#timeline-check .tc-field-wide {
    grid-column: 1 / -1;
}

#timeline-check label {
    font-size: 14px;
    font-weight: 800;
    color: #374151;
}

#timeline-check input[type="text"],
#timeline-check input[type="number"] {
    height: 46px;
    padding: 0 12px;
    font-size: 16px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    box-sizing: border-box;
}

#timeline-check input[type="text"]:hover,
#timeline-check input[type="number"]:hover {
    background: #f9fafb;
}

#timeline-check input[type="text"]:focus,
#timeline-check input[type="number"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#timeline-check .tc-hint {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

/* --- Runner level segmented cards --- */
#timeline-check .tc-seg {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

#timeline-check .tc-seg-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    column-gap: 10px;
    row-gap: 2px;
    align-items: start;

    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;

    cursor: pointer;
    user-select: none;
}

#timeline-check .tc-seg-item:hover {
    background: #f9fafb;
}

#timeline-check .tc-seg-item input[type="radio"] {
    margin-top: 3px;
}

#timeline-check .tc-seg-item span {
    font-size: 14px;
    font-weight: 900;
    color: #111827;
}

#timeline-check .tc-seg-item small {
    grid-column: 2 / 3;
    font-size: 12px;
    line-height: 1.4;
    color: #6b7280;
}

/* Checked state styling */
#timeline-check .tc-seg-item:has(input[type="radio"]:checked) {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Button + output (unchanged) */
#timeline-check .tc-btn {
    width: 100%;
    height: 48px;
    margin-top: 16px;
    border: 0;
    border-radius: 12px;
    background: #111827;
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 120ms ease, opacity 120ms ease;
}

#timeline-check .tc-btn:hover {
    opacity: 0.92;
}

#timeline-check .tc-btn:active {
    transform: translateY(1px) scale(0.99);
}

#timeline-check .tc-output {
    margin-top: 16px;
    padding: 14px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

#timeline-check .tc-output-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

#timeline-check .tc-output-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

#timeline-check .tc-output-value {
    font-size: 30px;
    font-weight: 900;
    color: #111827;
}

#timeline-check .tc-badge {
    font-size: 12px;
    font-weight: 900;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #111827;
    white-space: nowrap;
}

#timeline-check .tc-message {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
}

#timeline-check .tc-meta {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: #6b7280;
    white-space: pre-line;
}

/* Desktop layout */
@media (min-width: 720px) {
    #timeline-check .tc-card {
        padding: 26px;
    }

    #timeline-check .tc-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    #timeline-check .tc-seg {
        grid-template-columns: repeat(3, 1fr);
    }

    #timeline-check .tc-seg-item {
        grid-template-columns: 18px 1fr;
        align-content: start;
        min-height: 74px;
    }
}

.tc-output {
    font-size: 16px;
    line-height: 1.6;
}

.tc-section {
    margin-bottom: 20px;
}

.tc-label {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    /* gray-500 */
    margin-bottom: 6px;
}

.tc-big-number {
    font-size: 36px;
    font-weight: 700;
    color: #111827;
    /* gray-900 */
}

.tc-unit {
    font-size: 14px;
    color: #6b7280;
}

.tc-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 6px 0;
}

.tc-row-label {
    font-size: 15px;
    color: #374151;
    /* gray-700 */
}

.tc-row-value {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.tc-muted {
    margin-top: 4px;
    font-size: 14px;
    color: #6b7280;
}

.tc-highlight {
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.tc-assumptions {
    font-size: 14px;
    color: #6b7280;
}

.tc-assumptions ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

/* Center the key pace-difference display */
.tc-section:first-of-type {
    text-align: center;
}

.tc-big-number {
    font-size: 42px;
    /* keep it dominant */
    font-weight: 700;
    line-height: 1.1;
    margin: 8px 0 4px;
}

.tc-unit {
    font-size: 14px;
    color: #6b7280;
    /* muted */
    letter-spacing: 0.04em;
}

/* Navigation styling */

.tool-nav {
    max-width: 900px;
    margin: 0 auto 16px;
    padding: 12px 20px 0;
}

.tool-back {
    font-size: 0.9rem;
    color: #2563eb;
    text-decoration: none;
}

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

/* error line under button */
.tc-error {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: #b91c1c;
  min-height: 1.4em; /* keeps layout stable */
}

/* button shake */
@keyframes tc-shake {
  0% { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(6px); }
  45% { transform: translateX(-5px); }
  60% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
  90% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

.tc-btn.tc-shake {
  animation: tc-shake 380ms ease-in-out;
}

.tc-btn.tc-error-state {
  outline: 2px solid rgba(185, 28, 28, 0.35);
  outline-offset: 2px;
}

/* Error MSG */

/* error line under button */
.tc-error {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.4;
    color: #b91c1c;
    min-height: 1.4em;
    /* keeps layout stable */
}

/* button shake */
@keyframes tc-shake {
    0% {
        transform: translateX(0);
    }

    15% {
        transform: translateX(-6px);
    }

    30% {
        transform: translateX(6px);
    }

    45% {
        transform: translateX(-5px);
    }

    60% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-3px);
    }

    90% {
        transform: translateX(3px);
    }

    100% {
        transform: translateX(0);
    }
}

.tc-btn.tc-shake {
    animation: tc-shake 380ms ease-in-out;
}

.tc-btn.tc-error-state {
    outline: 2px solid rgba(185, 28, 28, 0.35);
    outline-offset: 2px;
}