:root {
    --tme-primary: #2271b1;
    --tme-bg: #f0f0f1;
    --tme-white: #ffffff;
    --tme-border: #dcdcde;
    --tme-text: #3c434a;
    --tme-radius: 8px;
    --tme-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Main Container */
.tme-wrapper {
    max-width: 1000px;
    margin: 20px 20px 0 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.tme-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tme-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
}

/* Modern Card Layout */
.tme-card {
    background: var(--tme-white);
    border-radius: var(--tme-radius);
    box-shadow: var(--tme-shadow);
    border: 1px solid var(--tme-border);
    padding: 25px;
    margin-bottom: 20px;
}

.tme-card h3 {
    margin-top: 0;
    font-size: 18px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
    color: #2c3338;
}

/* Selection Cards (Modern Radio Buttons) */
.tme-mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.tme-mode-option {
    position: relative;
    border: 2px solid var(--tme-border);
    border-radius: var(--tme-radius);
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tme-mode-option:hover {
    border-color: var(--tme-primary);
    background: #f8faff;
}

.tme-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0; /* Hide default radio */
}

/* Highlight selected card */
.tme-mode-option.selected {
    border-color: var(--tme-primary);
    background: #f0f6fc;
}

.tme-mode-title {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    color: var(--tme-primary);
}

.tme-mode-desc {
    font-size: 13px;
    color: #646970;
    display: block;
    line-height: 1.4;
}

/* Form Layouts */
.tme-form-row {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.tme-label {
    width: 150px;
    font-weight: 500;
    color: #444;
}

.tme-input-group {
    flex: 1;
}

.tme-checkbox-group label {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 8px;
    background: #f6f7f7;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #dcdcde;
}

/* Format Selection */
.tme-format-options {
    display: flex;
    gap: 20px;
}

.tme-format-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

/* Submit Button Area */
.tme-submit-area {
    margin-top: 30px;
    text-align: right;
}

.tme-btn-primary {
    background: var(--tme-primary);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 600;
}

.tme-btn-primary:hover {
    background: #135e96;
}

/* Modern Progress Overlay */
#tme-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85); /* lighter, more modern */
    backdrop-filter: blur(4px); /* Glass effect */
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#tme-progress-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.tme-modal {
    background: white;
    padding: 40px;
    width: 400px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    border: 1px solid #eee;
}

.tme-progress-container {
    height: 8px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.tme-progress-bar {
    height: 100%;
    width: 50%;
    background: var(--tme-primary);
    animation: tme-slide 1.5s infinite ease-in-out;
}

@keyframes tme-slide {
    0% { width: 0%; margin-left: 0; }
    50% { width: 100%; margin-left: 0; }
    100% { width: 0%; margin-left: 100%; }
}