:root {
    --tsm-primary: #007bff;
    --tsm-success: #28a745;
    --tsm-warning: #ffc107;
    --tsm-danger: #dc3545;
    --tsm-text: #333;
    --tsm-light: #f8f9fa;
    --tsm-border: #e9ecef;
    --tsm-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tsm-tracking-container {
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--tsm-text);
}

/* 1. Timeline */
.tsm-pro-header {
    text-align: center;
    margin-bottom: 30px;
}

.tsm-pro-header h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
}

.tsm-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0 10px;
}

.tsm-timeline::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--tsm-border);
    z-index: 1;
}

.tsm-timeline-step {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 25%;
}

.tsm-step-icon {
    width: 30px;
    height: 30px;
    background: #fff;
    border: 3px solid var(--tsm-border);
    border-radius: 50%;
    margin: 0 auto 8px;
    transition: all 0.3s;
}

.tsm-step-label {
    font-size: 0.75rem;
    color: #999;
    font-weight: bold;
}

/* Active/Current state */
.tsm-timeline-step.active .tsm-step-icon {
    border-color: var(--tsm-primary);
    background: var(--tsm-primary);
}

.tsm-timeline-step.active::after {
    /* Connecting line fill for active */
    /* CSS driven active line is tricky without specific widths or JS. 
       Simple dot highlight is robust enough for now. */
}

.tsm-timeline-step.current .tsm-step-icon {
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.2);
}

.tsm-timeline-step.active .tsm-step-label {
    color: var(--tsm-text);
}

/* 2. Cards */
.tsm-pro-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--tsm-shadow);
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.tsm-pro-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tsm-border);
    font-size: 1.1rem;
    color: #2c3e50;
}

/* Info Grid */
.tsm-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.tsm-info-item {
    display: flex;
    flex-direction: column;
}

.tsm-info-item.tsm-full-width {
    grid-column: 1 / -1;
}

.tsm-info-item label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 4px;
}

.tsm-info-item span,
.tsm-info-item p {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

.tsm-tracking-number {
    font-family: monospace;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Action Area */
.tsm-action-area {
    margin-top: 20px;
    text-align: center;
}

.tsm-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.tsm-btn-outline {
    background: #fff;
    border: 2px solid var(--tsm-primary);
    color: var(--tsm-primary);
}

.tsm-btn-outline:hover {
    background: var(--tsm-primary);
    color: #fff;
}

.tsm-btn-primary {
    background: var(--tsm-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.tsm-btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.tsm-btn-block {
    display: block;
    width: 100%;
    margin-top: 20px;
}

/* 3. Form Styling */
.tsm-intro-text {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.tsm-form-group {
    margin-bottom: 20px;
}

.tsm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.tsm-form-group input[type="text"],
.tsm-form-group input[type="datetime-local"],
.tsm-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--tsm-border);
    border-radius: 8px;
    font-size: 1rem;
    appearance: none;
    /* iOS reset */
    box-sizing: border-box;
}

/* Condition Visual Selector */
.tsm-condition-selector {
    display: flex;
    gap: 10px;
}

.tsm-radio-card {
    flex: 1;
    position: relative;
    border: 2px solid var(--tsm-border);
    border-radius: 10px;
    padding: 15px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.tsm-radio-card input {
    position: absolute;
    opacity: 0;
}

.tsm-radio-card .icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 5px;
}

.tsm-radio-card .text {
    font-size: 0.9rem;
    font-weight: bold;
    color: #888;
}

/* Active States */
.tsm-radio-card input:checked+.icon+.text {
    color: var(--tsm-text);
}

.tsm-radio-card:has(input:checked) {
    background: #fff;
    border-color: var(--tsm-primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.tsm-radio-card.dead:has(input:checked) {
    border-color: var(--tsm-danger);
    background: #fff5f5;
}

/* Star Rating */
.tsm-star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 5px;
}

.tsm-star-rating input {
    display: none;
}

.tsm-star-rating label {
    font-size: 2.5rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.tsm-star-rating input:checked~label,
.tsm-star-rating label:hover,
.tsm-star-rating label:hover~label {
    color: var(--tsm-warning);
}

/* Upload Box */
.tsm-upload-box {
    border: 2px dashed #ccc;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
}

.tsm-upload-box:hover {
    border-color: var(--tsm-primary);
    background: #f0f7ff;
}

#tsm-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.tsm-preview-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Thank You Message (Success) */
.tsm-thank-you-message {
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease;
}

.tsm-thank-you-message .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.tsm-thank-you-message h3 {
    color: var(--tsm-success);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.tsm-thank-you-message p {
    color: #666;
    font-size: 1.1rem;
}

.tsm-thank-you-static {
    text-align: center;
    padding: 40px 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .tsm-info-grid {
        grid-template-columns: 1fr;
    }
}