/* ==========================================
   DLS Grant Application & Test System
   ========================================== */

:root {
    --bg-primary: #121d2b;
    --bg-secondary: #1c2b3b;
    --bg-card: #213140;
    --bg-input: #253545;
    --border-color: #2d4a5e;
    --accent: #3498db;
    --accent-hover: #2980b9;
    --gold: #c9a227;
    --green: #27ae60;
    --red: #e74c3c;
    --orange: #e67e22;
    --text-primary: #ecf0f1;
    --text-secondary: #95a5a6;
    --text-muted: #7f8c8d;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ---- Header ---- */
.grant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 16px; }

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}
.back-link:hover { color: var(--accent); }

.header-brand { display: flex; align-items: center; gap: 10px; }

.brand-logo {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: var(--gold);
    letter-spacing: 2px;
}

.brand-text {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 300;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-center { display: flex; align-items: center; }

.timer-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 8px 20px;
    border-radius: 50px;
    border: 2px solid var(--accent);
    position: relative;
}

.timer-icon { font-size: 20px; }

.timer-value {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
    text-align: center;
}

.timer-display.warning { border-color: var(--orange); }
.timer-display.warning .timer-value { color: var(--orange); }
.timer-display.danger { border-color: var(--red); animation: pulse-border 1s infinite; }
.timer-display.danger .timer-value { color: var(--red); }

@keyframes pulse-border {
    0%, 100% { border-color: var(--red); }
    50% { border-color: transparent; }
}

.violations-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--red);
    color: white;
    font-size: 12px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-btn {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--gold);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}
.admin-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
    color: var(--gold);
}

/* ---- Language Switcher ---- */
.lang-switcher {
    display: flex;
    gap: 2px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    transition: var(--transition);
}
.lang-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.lang-btn.active { background: var(--accent); color: white; }

/* ---- Date Picker ---- */
.date-picker-group {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 8px;
}

.date-select {
    width: 100%;
    padding: 12px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Roboto', sans-serif;
    transition: var(--transition);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2395a5a6' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}
.date-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(52,152,219,0.15); }

/* ---- Detail Photos ---- */
.detail-photos {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.detail-photo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}
.detail-photo:hover { transform: scale(1.05); border-color: var(--accent); }

/* ---- Comments ---- */
.comments-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}
.comment-item {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
}
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
}
.comment-header strong { color: var(--accent); }
.comment-date { color: var(--text-muted); font-size: 11px; }
.comment-text { font-size: 13px; color: var(--text-primary); margin: 0; }

/* ---- Progress Bar ---- */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 24px 40px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: var(--transition);
}
.step.active { opacity: 1; }
.step.completed { opacity: 0.8; }
.step.completed .step-number { background: var(--green); border-color: var(--green); }

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 14px;
}
.step.active .step-number { background: var(--accent); color: white; }

.step-label { font-size: 14px; font-weight: 500; }

.step-line {
    width: 60px;
    height: 2px;
    background: var(--border-color);
    margin: 0 12px;
}

/* ---- Main Content ---- */
.grant-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.step-section { display: none; }
.step-section.active { display: block; animation: fadeSlideIn 0.4s ease forwards; }

/* ---- Welcome Card ---- */
.welcome-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.welcome-icon { font-size: 64px; margin-bottom: 16px; }

.welcome-card h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gold);
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 32px;
}

.welcome-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 500px;
    margin: 0 auto 32px;
    text-align: left;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}
.info-item .info-icon { font-size: 24px; flex-shrink: 0; margin-top: 2px; }
.info-item strong { display: block; margin-bottom: 2px; }
.info-item p { color: var(--text-secondary); font-size: 13px; margin: 0; }

/* ---- Form Card ---- */
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.form-card h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 24px;
    margin-bottom: 4px;
}

.form-hint {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.req { color: var(--red); }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Roboto', sans-serif;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(231,76,60,0.15);
}

.field-error {
    display: block;
    color: var(--red);
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

.field-hint {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Photo Upload */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.file-upload-area:hover { border-color: var(--accent); background: rgba(52,152,219,0.05); }
.file-upload-area.has-files { border-style: solid; border-color: var(--green); }

.upload-placeholder { color: var(--text-secondary); }
.upload-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.upload-placeholder p { margin: 0; }
.upload-placeholder small { color: var(--text-muted); }

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
.preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Radio Options */
.radio-group { display: flex; flex-direction: column; gap: 8px; }

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}
.radio-option:hover { border-color: var(--accent); }
.radio-option input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; }
.radio-label { font-size: 14px; }

/* Checkbox Grid (subjects) */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}
.checkbox-option:hover { border-color: var(--accent); }
.checkbox-option.selected { border-color: var(--accent); background: rgba(52,152,219,0.1); }
.checkbox-option.disabled { opacity: 0.4; cursor: not-allowed; }
.checkbox-option input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    gap: 16px;
}

/* ---- Buttons ---- */
.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Roboto', sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Roboto', sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.btn-secondary:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.btn-secondary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-lg { padding: 14px 36px; font-size: 16px; }

.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn-danger { background: var(--red); }
.btn-danger:hover { background: #c0392b; }

.btn-success { background: var(--green); }
.btn-success:hover { background: #219a52; }

.pulse-btn { animation: pulse-scale 2s infinite; }
@keyframes pulse-scale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* ---- Pre-test Card ---- */
.pretest-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.pretest-card h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 24px;
    margin-bottom: 8px;
}

.applicant-greeting {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 15px;
}

.test-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.test-info-item {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}
.test-info-item .info-icon { font-size: 28px; display: block; margin-bottom: 6px; }
.test-info-item strong { display: block; font-size: 14px; }
.test-info-item p { color: var(--text-muted); font-size: 12px; margin: 4px 0 0; }
.test-info-item.timer-info { border: 1px solid var(--gold); }

/* Pretest About */
.pretest-about {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin-bottom: 24px;
}
.pretest-about h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.pretest-about p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Pretest Sections */
.pretest-section {
    display: flex;
    gap: 16px;
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin-bottom: 16px;
}
.pretest-section-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
    padding-top: 2px;
}
.pretest-section h4 {
    font-family: 'Oswald', sans-serif;
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.pretest-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.pretest-section li {
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.pretest-section li::before {
    content: '•';
    position: absolute;
    left: 0;
    font-weight: bold;
}
.pretest-section-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Timer info section */
.pretest-timer-info {
    background: rgba(52,152,219,0.08);
    border: 1px solid rgba(52,152,219,0.2);
}
.pretest-timer-info li::before { color: var(--accent); }

/* Anticheat info section */
.pretest-anticheat-info {
    background: rgba(231,76,60,0.06);
    border: 1px solid rgba(231,76,60,0.2);
}

.anticheat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.anticheat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: rgba(231,76,60,0.05);
    border-radius: 6px;
}
.anticheat-item span:first-child {
    font-size: 16px;
    flex-shrink: 0;
}
.anticheat-warning {
    background: rgba(231,76,60,0.1);
    border: 1px solid rgba(231,76,60,0.3);
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--red);
    line-height: 1.6;
}

/* Requirements section */
.pretest-requirements {
    background: rgba(39,174,96,0.06);
    border: 1px solid rgba(39,174,96,0.2);
}
.pretest-requirements li::before { color: var(--green); }

/* Mobile warning */
.mobile-warning {
    background: rgba(231,76,60,0.15);
    border: 1px solid var(--red);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
}
.mobile-warning-title {
    color: var(--red);
    font-weight: 600;
    font-size: 15px;
}
.mobile-warning-text {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

/* Confirm checkbox */
.pretest-confirm {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: rgba(212,175,55,0.08);
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: var(--radius-sm);
}
.confirm-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}
.confirm-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--gold);
    cursor: pointer;
}

/* ---- Test Container ---- */
.test-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

/* Test Tabs */
.test-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.test-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    font-family: 'Roboto', sans-serif;
}
.test-tab:hover { color: var(--text-primary); }
.test-tab.active { background: var(--accent); color: white; }
.test-tab .tab-badge {
    display: inline-block;
    background: var(--green);
    color: white;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 6px;
}

/* Test Progress */
.test-progress {
    margin-bottom: 20px;
}

.progress-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.progress-track {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--green));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Questions */
.test-section { display: none; }
.test-section.active { display: block; }

.reading-passage {
    background: var(--bg-input);
    border-left: 4px solid var(--accent);
    padding: 20px 24px;
    margin-bottom: 24px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    max-height: 400px;
    overflow-y: auto;
}

.question-card {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    transition: var(--transition);
}
.question-card:hover { border-color: var(--border-color); }
.question-card.answered { border-left: 3px solid var(--green); }

.question-number {
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 4px;
}

.question-text {
    font-size: 15px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    text-align: left;
    font-family: 'Roboto', sans-serif;
    width: 100%;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.option-btn:hover { border-color: var(--accent); background: rgba(52,152,219,0.08); }
.option-btn.selected { border-color: var(--accent); background: rgba(52,152,219,0.15); }

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}
.option-btn.selected .option-letter { background: var(--accent); color: white; }

/* Test Actions */
.test-actions {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ---- Results Card ---- */
.results-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    text-align: center;
}

.results-icon { font-size: 64px; margin-bottom: 16px; }

.results-card h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    color: var(--gold);
    margin-bottom: 8px;
}

.results-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.score-item {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.score-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.score-value {
    font-family: 'Oswald', sans-serif;
    font-size: 32px;
    font-weight: 600;
}

.score-value.good { color: var(--green); }
.score-value.medium { color: var(--orange); }
.score-value.low { color: var(--red); }

.score-detail { font-size: 12px; color: var(--text-muted); }

.violations-summary {
    background: rgba(231,76,60,0.08);
    border: 1px solid rgba(231,76,60,0.2);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 24px;
}
.violations-summary.clean {
    background: rgba(39,174,96,0.08);
    border-color: rgba(39,174,96,0.2);
}

/* ---- Violation Overlay ---- */
.violation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeSlideIn 0.2s ease;
}

.violation-content {
    background: var(--bg-card);
    border: 2px solid var(--red);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    max-width: 420px;
}

.violation-icon { font-size: 64px; margin-bottom: 12px; }
.violation-content h2 { font-family: 'Oswald', sans-serif; font-size: 24px; margin-bottom: 8px; color: var(--red); }
.violation-content p { color: var(--text-secondary); margin-bottom: 8px; }
.violation-count { font-size: 20px; font-weight: 700; color: var(--red); }
.violation-warning { font-size: 13px; color: var(--text-muted); margin-bottom: 20px !important; }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    animation: fadeSlideIn 0.2s ease;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow);
}

.modal-card h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* ---- Admin Panel ---- */
.admin-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}
.admin-header h2 { font-family: 'Oswald', sans-serif; font-size: 22px; margin: 0; }

.admin-tabs {
    display: flex;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
}

.admin-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Roboto', sans-serif;
}
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.admin-content { padding: 24px; }

/* Admin Table */
.admin-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th {
    background: var(--bg-input);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.admin-table tr:hover td { background: rgba(52,152,219,0.04); }

.admin-table .score-cell {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 15px;
}

.detail-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}
.detail-btn:hover { background: var(--accent-hover); }
.detail-btn.delete-btn { background: transparent; color: var(--text-muted); font-size: 14px; padding: 4px 6px; }
.detail-btn.delete-btn:hover { background: rgba(231,76,60,0.15); color: var(--red); }

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; display: block; }

/* Test Editor */
.editor-section {
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.editor-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-input);
    cursor: pointer;
}
.editor-section-header h4 { margin: 0; font-size: 15px; }

.editor-section-body { padding: 16px; }

.editor-question {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.editor-question .q-number {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    color: var(--accent);
    min-width: 30px;
}

.editor-question .q-text { flex: 1; font-size: 13px; }

.editor-question .q-answer {
    color: var(--green);
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.editor-question .q-actions { display: flex; gap: 4px; }

.editor-question .q-actions button {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}
.editor-question .q-actions button:hover { border-color: var(--accent); color: var(--accent); }
.editor-question .q-actions button.delete:hover { border-color: var(--red); color: var(--red); }

/* Question Edit Modal */
.question-edit-form .form-group { margin-bottom: 12px; }
.question-edit-form label { font-size: 13px; margin-bottom: 4px; }
.question-edit-form input, .question-edit-form textarea, .question-edit-form select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
}
.options-edit { display: flex; flex-direction: column; gap: 6px; }
.option-edit-row { display: flex; gap: 8px; align-items: center; }
.option-edit-row .option-edit-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}
.option-edit-row input { flex: 1; }

/* Applicant Detail Modal */
.applicant-detail { text-align: left; }
.applicant-detail h3 { margin-bottom: 16px; }
.detail-row {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}
.detail-row .detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 140px;
    flex-shrink: 0;
}
.detail-row .detail-value { flex: 1; }

/* Admin Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--accent);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Anti-cheat: prevent text selection during test */
.test-mode {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Loading state */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Animation for section transitions */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Focus ring for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .grant-header, .progress-bar, .test-actions, .form-actions, .admin-btn { display: none !important; }
    body { background: white; color: black; }
    .grant-content { max-width: 100%; padding: 0; }
}

/* ---- Scrollbar Styling ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---- Responsive: Tablet (max-width: 1024px) ---- */
@media (max-width: 1024px) {
    .grant-content { max-width: 100%; padding: 20px; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Responsive: Small Tablet / Large Phone (max-width: 768px) ---- */
@media (max-width: 768px) {
    .grant-header {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .header-left { gap: 10px; }
    .brand-text { display: none; }
    .brand-logo { font-size: 20px; }
    .back-link { font-size: 13px; }
    .header-right { gap: 8px; }
    .admin-btn { padding: 6px 12px; font-size: 12px; }
    .lang-switcher { padding: 2px; }
    .lang-btn { padding: 4px 8px; font-size: 11px; }
    .date-picker-group { grid-template-columns: 1fr; gap: 6px; }
    .date-select { padding: 14px 12px; font-size: 16px; }

    .progress-bar { padding: 14px 12px; }
    .step-label { display: none; }
    .step-line { width: 24px; margin: 0 6px; }
    .step-number { width: 28px; height: 28px; font-size: 13px; }

    .grant-content { padding: 12px; }

    /* Pretest */
    .anticheat-grid { grid-template-columns: 1fr; }
    .pretest-section { padding: 16px; gap: 12px; }
    .pretest-section-icon { width: 32px; font-size: 22px; }

    /* Welcome */
    .welcome-card { padding: 24px 16px; }
    .welcome-card h1 { font-size: 22px; }
    .welcome-icon { font-size: 48px; margin-bottom: 12px; }
    .welcome-subtitle { font-size: 14px; margin-bottom: 24px; }
    .welcome-info { gap: 10px; }
    .info-item { padding: 10px 12px; }
    .info-item .info-icon { font-size: 20px; }

    /* Form */
    .form-card { padding: 16px; }
    .form-card h2 { font-size: 20px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .form-group label { font-size: 13px; }
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="tel"],
    .form-group input[type="date"],
    .form-group input[type="password"],
    .form-group select,
    .form-group textarea {
        padding: 14px 12px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Subjects checkbox grid */
    .checkbox-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .checkbox-option { padding: 12px 10px; font-size: 13px; }

    /* Radio options */
    .radio-option { padding: 14px 12px; }

    /* Pre-test */
    .pretest-card { padding: 20px 16px; }
    .test-info-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .test-info-item { padding: 12px 8px; }
    .test-info-item .info-icon { font-size: 24px; }
    .test-info-item strong { font-size: 13px; }
    .rules-section { padding: 16px; }
    .rules-list li { font-size: 13px; padding: 5px 0 5px 18px; }

    /* Test */
    .test-container { padding: 12px; }
    .test-tabs { gap: 2px; padding: 3px; }
    .test-tab { padding: 10px 8px; font-size: 12px; }
    .question-card { padding: 16px 12px; margin-bottom: 10px; }
    .question-text { font-size: 14px; }
    .option-btn {
        padding: 12px;
        font-size: 14px;
        gap: 8px;
        -webkit-tap-highlight-color: transparent;
        min-height: 44px; /* Touch-friendly */
    }
    .reading-passage {
        padding: 14px 16px;
        font-size: 13px;
        max-height: 250px;
    }

    /* Results */
    .results-card { padding: 24px 16px; }
    .score-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .score-value { font-size: 26px; }
    .results-card h2 { font-size: 22px; }

    /* Timer */
    .timer-display { padding: 6px 14px; }
    .timer-value { font-size: 20px; min-width: 60px; }
    .timer-icon { font-size: 16px; }

    /* Admin */
    .admin-header { padding: 14px 16px; flex-wrap: wrap; gap: 8px; }
    .admin-header h2 { font-size: 18px; }
    .admin-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .admin-tab { padding: 10px 12px; font-size: 12px; white-space: nowrap; flex: none; min-width: auto; }
    .admin-content { padding: 12px; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-value { font-size: 22px; }
    .admin-table { font-size: 12px; }
    .admin-table th, .admin-table td { padding: 8px 6px; }

    /* Editor */
    .editor-question { flex-direction: column; padding: 10px; gap: 8px; }
    .editor-question .q-text { font-size: 12px; }
    .editor-section-header { padding: 10px 12px; }

    /* Modal */
    .modal-card { margin: 12px; max-width: calc(100% - 24px); padding: 20px 16px; }
    .violation-content { margin: 16px; padding: 28px 20px; max-width: calc(100% - 32px); }

    /* Buttons */
    .btn-primary, .btn-secondary { padding: 12px 20px; font-size: 14px; }
    .btn-lg { padding: 14px 24px; font-size: 15px; }

    /* File upload */
    .file-upload-area { padding: 20px; min-height: 100px; }
    .upload-icon { font-size: 28px; }
}

/* ---- Responsive: Phone (max-width: 480px) ---- */
@media (max-width: 480px) {
    .grant-header {
        padding: 8px 10px;
    }
    .header-left { flex: 1; min-width: 0; }
    .header-center { order: 3; width: 100%; justify-content: center; }
    .header-right {
        flex-shrink: 0;
        gap: 6px;
    }
    .admin-btn { padding: 5px 10px; font-size: 11px; }
    .admin-btn .admin-btn-text { display: none; }
    .lang-switcher { padding: 2px; }
    .lang-btn { padding: 3px 7px; font-size: 10px; }

    .progress-bar { padding: 10px 8px; }
    .step-line { width: 16px; margin: 0 4px; }
    .step-number { width: 26px; height: 26px; font-size: 12px; }

    .grant-content { padding: 8px; }

    /* Welcome */
    .welcome-card { padding: 20px 12px; }
    .welcome-card h1 { font-size: 20px; }
    .welcome-subtitle { font-size: 13px; }

    /* Form */
    .form-card { padding: 14px 12px; }
    .form-group { margin-bottom: 16px; }
    .checkbox-grid { grid-template-columns: 1fr; }

    /* Form actions stack vertically */
    .form-actions {
        flex-direction: column-reverse;
        gap: 10px;
        padding-bottom: 40px;
    }
    .form-actions button,
    .form-actions .btn-primary,
    .form-actions [type="submit"] {
        width: 100%;
        min-height: 52px;
        font-size: 16px;
        -webkit-appearance: none;
        appearance: none;
        cursor: pointer;
        position: relative;
        z-index: 10;
    }

    /* Test */
    .test-tabs {
        flex-direction: column;
        gap: 2px;
    }
    .test-tab { text-align: center; padding: 10px; }
    .option-btn {
        padding: 14px 10px;
        font-size: 13px;
    }
    .option-letter { width: 24px; height: 24px; font-size: 12px; }
    .reading-passage { max-height: 200px; font-size: 13px; line-height: 1.7; }
    .question-card { padding: 14px 10px; }

    /* Results */
    .score-grid { grid-template-columns: 1fr 1fr; }
    .score-item { padding: 12px 8px; }
    .score-value { font-size: 24px; }

    /* Admin */
    .admin-header { padding: 12px; }
    .admin-stats { grid-template-columns: 1fr 1fr; }

    /* Detail modal */
    .detail-row { flex-direction: column; gap: 2px; }
    .detail-row .detail-label { min-width: unset; }

    /* Buttons */
    .btn-primary, .btn-secondary { padding: 14px 16px; font-size: 15px; }
    .btn-lg { padding: 16px 20px; font-size: 16px; width: 100%; }
    .btn-sm { padding: 8px 12px; font-size: 12px; }
}

/* ---- Responsive: Very Small Phone (max-width: 360px) ---- */
@media (max-width: 360px) {
    .welcome-card h1 { font-size: 18px; }
    .timer-display { padding: 4px 10px; }
    .timer-value { font-size: 18px; min-width: 50px; }
    .brand-logo { font-size: 18px; }
    .test-info-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .score-grid { grid-template-columns: 1fr; }
    .admin-stats { grid-template-columns: 1fr; }
}

/* ---- Touch improvements ---- */
@media (hover: none) and (pointer: coarse) {
    .option-btn:hover { border-color: var(--border-color); background: var(--bg-secondary); }
    .option-btn.selected:hover { border-color: var(--accent); background: rgba(52,152,219,0.15); }
    .option-btn:active { background: rgba(52,152,219,0.12); border-color: var(--accent); }
    .checkbox-option:hover { border-color: transparent; }
    .checkbox-option.selected:hover { border-color: var(--accent); }
    .checkbox-option:active { border-color: var(--accent); }
    .radio-option:hover { border-color: transparent; }
    .radio-option:active { border-color: var(--accent); }
    .btn-primary:hover { transform: none; }
    .btn-primary:active { transform: scale(0.98); }
}

/* ---- Exam Monitor ---- */
.exam-monitor { }

.monitor-launch-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 20px;
}

.monitor-status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
}

.monitor-status-bar.status-active {
    background: rgba(39, 174, 96, 0.15);
    color: var(--green);
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.monitor-status-bar.status-inactive {
    background: rgba(231, 76, 60, 0.1);
    color: var(--red);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.quick-start-form h4 {
    font-family: 'Oswald', sans-serif;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.quick-start-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.quick-start-row .form-group {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
}

.quick-start-row .form-group label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

.quick-start-row .form-group input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.btn-start-exam {
    padding: 12px 28px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-start-exam:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.btn-stop-exam {
    padding: 12px 28px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-stop-exam:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.exam-time-info {
    display: flex;
    gap: 20px;
    flex: 1;
    flex-wrap: wrap;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.exam-time-info strong {
    color: var(--text-primary);
}

.monitor-link-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.monitor-link-panel code {
    flex: 1;
    padding: 6px 10px;
    background: var(--bg-input);
    border-radius: 4px;
    color: var(--gold);
    word-break: break-all;
    font-size: 12px;
    min-width: 200px;
}

.monitor-section {
    margin-top: 20px;
}

.monitor-section h4 {
    font-family: 'Oswald', sans-serif;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-green { background: rgba(39,174,96,0.15); color: var(--green); }
.badge-yellow { background: rgba(243,156,18,0.15); color: #f39c12; }
.badge-red { background: rgba(231,76,60,0.15); color: var(--red); }
.badge-gray { background: rgba(150,150,150,0.15); color: #999; }

.row-dimmed { opacity: 0.5; }

/* Heartbeat dot */
.heartbeat-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.hb-green {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: pulse-dot 2s ease-in-out infinite;
}

.hb-gray {
    background: #666;
}

/* Violations Feed */
.violations-feed {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    max-height: 400px;
    overflow-y: auto;
}

.violation-feed-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    transition: background 0.2s;
}

.violation-feed-item:last-child { border-bottom: none; }
.violation-feed-item:hover { background: rgba(255,255,255,0.03); }

.vf-time {
    color: var(--text-muted);
    font-size: 12px;
    font-family: monospace;
    white-space: nowrap;
}

.vf-icon { font-size: 16px; }

.vf-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.vf-detail {
    color: var(--red);
    flex: 1;
}

/* ---- Safe area for notched phones ---- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .grant-header { padding-top: max(12px, env(safe-area-inset-top)); }
    .test-actions { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
    .form-actions { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
}
