/**
 * Smart Teacher Admin Stylesheet
 * Native WordPress UI styling tailored for Ugandan secondary school teachers.
 */

:root {
    --st-primary: #1d4ed8;
    --st-primary-hover: #1e40af;
    --st-secondary: #475569;
    --st-success: #15803d;
    --st-warning: #b45309;
    --st-danger: #b91c1c;
    --st-border: #cbd5e1;
    --st-bg-light: #f8fafc;
    --st-card-bg: #ffffff;
    --st-text-main: #0f172a;
    --st-text-muted: #64748b;
    --st-purple: #7c3aed;
    --st-teal: #0f766e;
    --st-radius: 8px;
    --st-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --st-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.st-wrap {
    margin: 20px 20px 40px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--st-text-main);
}

/* Header & Banners */
.st-header-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #ffffff;
    padding: 24px 30px;
    border-radius: var(--st-radius);
    margin-bottom: 24px;
    box-shadow: var(--st-shadow-md);
}

.st-header-banner .st-title {
    color: #ffffff;
    font-size: 26px;
    font-weight: 700;
    margin: 8px 0 10px 0;
    line-height: 1.2;
}

.st-header-banner .st-subtitle {
    color: #e0e7ff;
    font-size: 14px;
    max-width: 750px;
    margin: 0;
    line-height: 1.5;
}

.st-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 16px 24px;
    border-radius: var(--st-radius);
    border: 1px solid var(--st-border);
    margin-bottom: 20px;
    box-shadow: var(--st-shadow);
}

.st-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.st-header-title h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--st-text-main);
}

.st-back-link {
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--st-primary);
    padding: 4px 8px;
    background: #eff6ff;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.st-back-link:hover {
    background: #dbeafe;
    color: var(--st-primary-hover);
}

/* Badges & Status Pills */
.st-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 20px;
}

.st-page-header .st-badge {
    background: #eff6ff;
    color: var(--st-primary);
    border: 1px solid #bfdbfe;
}

.st-badge-purple {
    background: #f5f3ff !important;
    color: var(--st-purple) !important;
    border: 1px solid #ddd6fe !important;
}

.st-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
}

.st-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

.st-status-warning .st-status-dot {
    background: #f59e0b;
}

.st-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #eff6ff;
    color: var(--st-primary);
    border: 1px solid #93c5fd;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.st-pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2563eb;
    animation: st-pulse 1.5s infinite;
}

@keyframes st-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* Notices */
.st-notice {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--st-radius);
    margin-bottom: 24px;
    box-shadow: var(--st-shadow);
}
.st-notice-warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-left: 4px solid #f59e0b;
}
.st-notice-icon {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #f59e0b;
}
.st-notice-content h3 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: #92400e;
}
.st-notice-content p {
    margin: 0 0 10px 0;
    color: #b45309;
    font-size: 13px;
}

/* Cards Grid */
.st-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.st-card {
    background: var(--st-card-bg);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--st-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.st-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--st-shadow-md);
}

.st-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #eff6ff;
    color: var(--st-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.st-card-icon span {
    font-size: 26px;
    width: 26px;
    height: 26px;
}
.st-icon-purple {
    background: #f5f3ff;
    color: var(--st-purple);
}
.st-icon-teal {
    background: #f0fdfa;
    color: var(--st-teal);
}

.st-card-body h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--st-text-main);
}
.st-card-body p {
    font-size: 13px;
    color: var(--st-text-muted);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.st-feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}
.st-feature-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--st-text-main);
    margin-bottom: 8px;
}
.st-feature-list li span {
    color: var(--st-success);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.st-card-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

/* Info Box */
.st-info-box {
    background: #ffffff;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 24px;
    box-shadow: var(--st-shadow);
}
.st-info-box h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--st-text-main);
}
.st-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.st-info-item h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    color: var(--st-primary);
}
.st-info-item p {
    margin: 0;
    font-size: 13px;
    color: var(--st-text-muted);
    line-height: 1.5;
}

/* Workspace Grid (SOW & Items) */
.st-workspace-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 20px;
    align-items: start;
}

/* Mobile Segment Tabs for Generator Workspace */
.st-mobile-view-tabs {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 10px;
}

.st-mobile-tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.st-mobile-tab-btn:hover {
    color: #0f172a;
}

.st-mobile-tab-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
}

.st-mobile-tab-btn .st-tab-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    display: inline-block;
}

@media screen and (max-width: 1100px) {
    .st-workspace-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 1024px) {
    .st-mobile-view-tabs {
        display: grid;
    }
    .st-workspace-grid.st-mobile-active-preview > .st-panel-form {
        display: none !important;
    }
    .st-workspace-grid.st-mobile-active-form > .st-panel-preview {
        display: none !important;
    }
}

.st-panel {
    background: #ffffff;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    box-shadow: var(--st-shadow);
}

.st-panel-form {
    padding: 20px;
}

.st-panel-header {
    border-bottom: 1px solid var(--st-border);
    padding-bottom: 14px;
    margin-bottom: 16px;
}
.st-panel-header h2 {
    font-size: 16px;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--st-text-main);
}
.st-panel-header p {
    font-size: 12px;
    color: var(--st-text-muted);
    margin: 0;
}

/* Form Controls */
.st-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}
.st-row-2 > .st-field {
    flex: 1;
}

.st-field {
    margin-bottom: 14px;
}
.st-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--st-text-main);
}
.st-field input[type="text"],
.st-field input[type="number"],
.st-field input[type="password"],
.st-field select,
.st-field textarea {
    width: 100%;
    border: 1px solid var(--st-border);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    background: #ffffff;
    color: var(--st-text-main);
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.st-field input:focus,
.st-field select:focus,
.st-field textarea:focus {
    border-color: var(--st-primary);
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.2);
    outline: none;
}

.st-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.st-link-btn {
    background: none;
    border: none;
    color: var(--st-primary);
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
}
.st-link-btn:hover {
    text-decoration: underline;
}

.st-help-text {
    display: block;
    font-size: 11px;
    color: var(--st-text-muted);
    margin-top: 4px;
}

.st-field-hint {
    display: block;
    font-size: 11px;
    color: var(--st-text-muted);
    margin-top: 4px;
}

/* A syllabus outcome shown under the topic selector, so the teacher can see what
   the lesson is meant to achieve before generating anything. */
.st-outcome-hint {
    display: none;
    font-size: 11px;
    color: #1e40af;
    background: #eff6ff;
    border-left: 3px solid #2563eb;
    padding: 6px 8px;
    margin-top: 6px;
    border-radius: 0 4px 4px 0;
}

/* Collapsed advanced options, so the everyday form stays short. */
.st-advanced-box {
    margin-top: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    padding: 10px 12px;
}
.st-advanced-box > summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}
.st-advanced-box[open] > summary {
    margin-bottom: 10px;
}

/* The AOI and Examination sections swap over as the mode dropdown changes. */
.st-mode-section {
    border-top: 1px solid #e2e8f0;
    margin-top: 14px;
    padding-top: 14px;
}

/* One box per examination question. */
.st-item-topic-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.st-item-topic-row {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    background: #f8fafc;
}
.st-item-topic-row .st-item-topic-label,
.st-item-topic-row .st-item-topic-number {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 6px;
}
.st-item-topic-fields input,
.st-item-topic-fields textarea {
    width: 100%;
    margin-bottom: 6px;
}
.st-item-topic-fields textarea {
    font-size: 12px;
    resize: vertical;
}

.st-checkbox-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: normal;
    cursor: pointer;
}

/* Radio Group & Pill Checkboxes */
.st-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.st-radio-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--st-border);
    border-radius: 6px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}
.st-radio-card:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}
.st-radio-card input {
    margin-top: 3px;
}
.st-radio-content strong {
    display: block;
    font-size: 12px;
    color: var(--st-text-main);
}
.st-radio-content span {
    font-size: 11px;
    color: var(--st-text-muted);
}

.st-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.st-pill-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    user-select: none;
}
.st-pill-checkbox:hover {
    background: #e2e8f0;
}

.st-form-actions {
    margin-top: 18px;
}
.st-submit-btn {
    width: 100%;
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    padding: 8px 16px !important;
    height: auto !important;
}

/* Preview Panel */
.st-panel-preview {
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.st-preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
    margin: 0;
    background: #f8fafc;
    border-radius: var(--st-radius) var(--st-radius) 0 0;
}

.st-toolbar-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.st-toolbar-title h2 {
    font-size: 15px;
    margin: 0;
}

.st-edit-badge {
    font-size: 11px;
    color: var(--st-success);
    background: #dcfce7;
    border: 1px solid #86efac;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.st-edit-badge span {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.st-toolbar-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.st-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    border: 1px solid var(--st-border);
    color: var(--st-text-main);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.st-btn-action:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}
.st-btn-action span {
    font-size: 16px;
    width: 16px;
    height: 16px;
}
.st-btn-danger:hover {
    background: #fef2f2;
    color: var(--st-danger);
    border-color: #fca5a5;
}

/* Viewport and Content Container */
.st-preview-viewport {
    flex: 1;
    overflow-x: auto;
    padding: 24px;
    background: #ffffff;
}

.st-preview-content {
    min-height: 480px;
    outline: none;
    font-size: 13px;
    line-height: 1.6;
    color: #1e293b;
}
.st-preview-content:focus {
    box-shadow: inset 0 0 0 2px #dbeafe;
    border-radius: 4px;
}

/* Empty State */
.st-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: var(--st-text-muted);
}
.st-empty-icon {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #cbd5e1;
    margin-bottom: 12px;
}
.st-empty-state h3 {
    font-size: 16px;
    color: var(--st-text-main);
    margin: 0 0 8px 0;
}
.st-empty-state p {
    font-size: 13px;
    max-width: 480px;
    margin: 0 0 12px 0;
    line-height: 1.5;
}
.st-empty-hint {
    color: #2563eb;
    background: #eff6ff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px !important;
}

/* Document & Table Standards */
.st-sow-document {
    font-family: Arial, sans-serif;
    color: #0f172a;
}

.st-document-header {
    text-align: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #0f172a;
}
.st-school-title {
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0 0 4px 0;
    letter-spacing: 0.5px;
}
.st-doc-subtitle {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #1e40af;
}
.st-meta-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    font-size: 12px;
    background: #f8fafc;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.st-meta-item {
    white-space: nowrap;
}
.st-meta-label {
    font-weight: 700;
    color: #334155;
}
.st-meta-value {
    color: #0f172a;
}

/* 9-Column NCDC Table */
.st-sow-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 11px;
    table-layout: fixed;
}
.st-sow-table caption {
    caption-side: top;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #1e3a8a;
    padding: 0 0 6px 0;
}
.st-sow-table th {
    background-color: #0f172a;
    color: #ffffff;
    font-weight: 700;
    padding: 8px 6px;
    text-align: left;
    border: 1px solid #334155;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
}
.st-sow-table tbody th {
    background-color: #f1f5f9;
    color: #0f172a;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
    vertical-align: top;
}
.st-sow-table td {
    border: 1px solid #cbd5e1;
    padding: 8px 6px;
    vertical-align: top;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
/* Column widths come from the <colgroup> the planner renders, so the table adapts
   when the optional REMARKS column is switched off. */
.st-sow-table colgroup col {
    min-width: 30px;
}
.st-sow-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}
.st-sow-table td[contenteditable="true"]:hover,
.st-sow-table th[contenteditable="true"]:hover {
    background-color: #eff6ff;
}
.st-sow-table td[contenteditable="true"]:focus,
.st-sow-table th[contenteditable="true"]:focus {
    background-color: #ffffff;
    outline: 2px solid var(--st-primary);
}

/* Assessment Item Elements */
.st-item-document {
    font-family: Arial, sans-serif;
    color: #1e293b;
    max-width: 900px;
    margin: 0 auto;
}
.st-item-header {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}
.st-item-header h2 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: var(--st-primary);
}
.st-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: var(--st-text-muted);
}

.st-item-section {
    margin-bottom: 22px;
}
.st-item-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1.5px solid #e2e8f0;
    padding-bottom: 6px;
    margin: 0 0 10px 0;
}

.st-scenario-box {
    background: #fdfefe;
    border: 1px solid #cbd5e1;
    border-left: 4px solid var(--st-primary);
    border-radius: 0 6px 6px 0;
    padding: 16px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #1e293b;
    font-style: normal;
}

.st-task-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
}

.st-rubric-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 12px;
}
.st-rubric-table th {
    background: #1e293b;
    color: #ffffff;
    padding: 8px 10px;
    border: 1px solid #334155;
    text-align: left;
    font-size: 11px;
}
.st-rubric-table td {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    vertical-align: top;
}
.st-rubric-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

/* Inline Chat Refinement Bar */
.st-refine-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #f1f5f9;
    border-top: 1px solid var(--st-border);
    border-radius: 0 0 var(--st-radius) var(--st-radius);
}
.st-refine-icon {
    color: var(--st-primary);
    display: flex;
    align-items: center;
}
.st-refine-icon span {
    font-size: 22px;
    width: 22px;
    height: 22px;
}
.st-refine-input-wrapper {
    flex: 1;
}
.st-refine-input-wrapper input {
    width: 100%;
    border: 1px solid var(--st-border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    background: #ffffff;
    box-sizing: border-box;
}
.st-refine-button {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    padding: 6px 14px !important;
    height: auto !important;
    font-weight: 600;
}

/* Settings Form Styles */
.st-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.st-settings-card {
    background: #ffffff;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 24px;
    box-shadow: var(--st-shadow);
}
.st-settings-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--st-border);
    padding-bottom: 12px;
    margin-bottom: 16px;
}
.st-settings-card-header h2 {
    font-size: 16px;
    margin: 0;
    color: var(--st-text-main);
}
.st-settings-card-header span {
    color: var(--st-primary);
    font-size: 22px;
    width: 22px;
    height: 22px;
}
.st-desc {
    font-size: 13px;
    color: var(--st-text-muted);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.st-input-toggle-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.st-input-toggle-group input {
    flex: 1;
}

.st-test-row {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.st-test-feedback {
    font-size: 12px;
    font-weight: 600;
}
.st-feedback-success {
    color: var(--st-success);
}
.st-feedback-error {
    color: var(--st-danger);
}

.st-settings-save {
    margin-top: 20px;
}

/* Print Styles */
@media print {
    #adminmenumain, #wpadminbar, #wpfooter, .st-panel-form, .st-preview-toolbar, .st-refine-bar, .st-page-header {
        display: none !important;
    }
    .st-workspace-grid {
        display: block !important;
    }
    .st-panel-preview {
        border: none !important;
        box-shadow: none !important;
    }
    .st-preview-viewport {
        padding: 0 !important;
    }
    @page {
        size: A4 landscape;
        margin: 10mm;
    }
    thead {
        display: table-header-group !important;
    }
    /* Rows must be allowed to break across pages. A nine-column CBC row is often
       taller than one page, and page-break-inside: avoid silently clips it. */
    tr, th, td {
        page-break-inside: auto !important;
        break-inside: auto !important;
    }
    table {
        page-break-inside: auto !important;
        width: 100% !important;
        table-layout: fixed !important;
    }
    th, td {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        word-wrap: break-word !important;
        overflow-wrap: anywhere !important;
    }
    thead th {
        background-color: #e8e8e8 !important;
        color: #000000 !important;
    }
    tbody th {
        background-color: #f4f4f4 !important;
        color: #000000 !important;
    }
    .st-signature-section {
        page-break-inside: avoid !important;
    }
}

/* Signature and Administrative Endorsement Section */
.st-signature-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #0f172a;
    page-break-inside: avoid;
}
.st-signature-heading {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1e3a8a;
    margin: 0 0 10px 0;
}
.st-signature-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.st-signature-table th,
.st-signature-table td {
    border: 1px solid #94a3b8;
    padding: 10px 8px;
    font-size: 12px;
    vertical-align: middle;
    text-align: left;
}
.st-signature-table th {
    width: 28%;
    background: #f1f5f9;
    font-weight: 700;
    color: #0f172a;
}
.st-signature-table .st-sig-line {
    letter-spacing: 1px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
}
.st-signature-table tr.st-sig-legend td {
    border: none;
    font-size: 10px;
    color: #64748b;
    padding: 2px 8px 10px 8px;
}
.st-signature-caption {
    font-size: 11px;
    color: #475569;
    margin-top: 10px;
}

/* Topic provenance status under the topics box */
.st-topics-status {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
}
.st-topics-status:empty {
    display: none;
}
.st-topics-status .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
    margin-right: 4px;
}
.st-status-ok {
    color: #14532d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 4px;
    padding: 6px 10px;
}
.st-status-warning {
    color: #7c2d12;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 4px;
    padding: 6px 10px;
}

/* In-document notice printed with a provisional topic list */
.st-provisional-warning {
    border: 1px solid #fdba74;
    border-left: 4px solid #ea580c;
    background: #fff7ed;
    color: #7c2d12;
    font-size: 12px;
    padding: 8px 10px;
    margin: 0 0 12px 0;
    border-radius: 4px;
}

/* A planned week the model failed to produce */
.st-sow-table tr.st-row-missing td {
    background: #fffbeb;
    color: #92400e;
    font-style: italic;
}

.st-live-school {
    display: block;
    margin-top: 4px;
    color: #475569;
}
.st-live-school strong {
    color: #0f172a;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.st-sig-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 12px;
}
.st-sig-card {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.st-sig-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1e3a8a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
}
.st-sig-field {
    font-size: 11px;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.st-sig-field strong {
    color: #0f172a;
}
.st-dots {
    color: #94a3b8;
    letter-spacing: 1px;
}
.st-stamp-box {
    display: inline-block;
    border: 1.5px dashed #94a3b8;
    background: #ffffff;
    height: 48px;
    width: 100%;
    margin-top: 4px;
    border-radius: 4px;
}

/* ------------------------------------------------------------------ */
/* Printable sheet documents                                           */
/* Activities of Integration, examination papers, lesson notes, records */
/* of work and lesson plans all share this shell.                       */
/* ------------------------------------------------------------------ */

.st-sheet {
    font-family: Arial, Helvetica, sans-serif;
    color: #0f172a;
    background: #ffffff;
    font-size: 12px;
    line-height: 1.6;
}

.st-sheet-header {
    text-align: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0f172a;
}

.st-sheet .st-school-title {
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0 0 4px 0;
    letter-spacing: 0.5px;
}
.st-sheet .st-doc-subtitle {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #1e40af;
    margin: 0;
}

.st-sheet-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    margin-bottom: 14px;
}
.st-sheet-meta-row {
    white-space: nowrap;
}
.st-sheet-meta-label {
    font-weight: 700;
    color: #334155;
}
.st-sheet-meta-value {
    color: #0f172a;
}

.st-sheet-instructions {
    border: 1px solid #cbd5e1;
    border-left: 4px solid #1e40af;
    background: #f8fafc;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 16px;
}
.st-sheet-instructions h4 {
    margin: 0 0 6px 0;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1e3a8a;
}
.st-instructions-body {
    font-size: 12px;
}
.st-instruction-list {
    margin: 0;
    padding-left: 20px;
}
.st-instruction-list li {
    margin-bottom: 3px;
}

.st-sheet-body h4 {
    font-size: 13px;
    font-weight: 800;
    color: #1e3a8a;
    margin: 16px 0 6px 0;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 3px;
}
.st-sheet-body h5 {
    font-size: 12px;
    font-weight: 700;
    margin: 12px 0 4px 0;
}
.st-sheet-body p {
    margin: 0 0 8px 0;
}
.st-sheet-body ul,
.st-sheet-body ol {
    margin: 0 0 10px 0;
    padding-left: 22px;
}
.st-sheet-body li {
    margin-bottom: 3px;
}
.st-sheet-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 14px 0;
    font-size: 11px;
}
.st-sheet-body caption {
    caption-side: top;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #1e3a8a;
    padding-bottom: 6px;
}
.st-sheet-body th,
.st-sheet-body td {
    border: 1px solid #64748b;
    padding: 6px 8px;
    vertical-align: top;
    text-align: left;
}
.st-sheet-body thead th {
    background: #e2e8f0;
    font-weight: 700;
    color: #0f172a;
}
.st-sheet-body tbody th {
    background: #f1f5f9;
}

.st-sheet-footer {
    text-align: center;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 12px;
    margin-top: 18px;
    padding-top: 8px;
    border-top: 1px solid #94a3b8;
}

/* Activity of Integration blocks */
.st-aoi-scenario {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 14px;
}
.st-aoi-task ol,
.st-aoi-task ul {
    margin-bottom: 10px;
}
.st-aoi-rubric table {
    font-size: 11px;
}

/* Examination blocks */
.st-exam-items {
    counter-reset: st-exam-item;
}
.st-exam-item {
    margin-bottom: 18px;
    page-break-inside: auto;
}
.st-exam-item-title {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}
.st-exam-item-marks {
    font-weight: 700;
    color: #1e40af;
    white-space: nowrap;
}
.st-exam-stimulus {
    background: #f8fafc;
    border-left: 3px solid #94a3b8;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 11.5px;
}

.st-marking-guide {
    margin-top: 26px;
    padding-top: 14px;
    border-top: 2px dashed #94a3b8;
    page-break-before: auto;
}
.st-marking-guide-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #b91c1c;
    margin: 0 0 4px 0;
}
.st-marking-guide-note {
    font-size: 11px;
    font-style: italic;
    color: #64748b;
    margin-bottom: 10px;
}

/* Record of work table */
.st-record-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 11px;
}
.st-record-table caption {
    caption-side: top;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #1e3a8a;
    padding-bottom: 6px;
}
.st-record-table th,
.st-record-table td {
    border: 1px solid #64748b;
    padding: 6px;
    vertical-align: top;
    text-align: left;
    word-wrap: break-word;
}
.st-record-table thead th {
    background: #e2e8f0;
    font-weight: 700;
    text-align: center;
}
.st-record-table tbody th {
    background: #f1f5f9;
    text-align: center;
    font-weight: 700;
}
/* The remarks column is left blank for the teacher's pen. */
.st-record-table tbody td:last-child {
    min-height: 22px;
}

/* Lesson plan table */
.st-sheet-plan .st-sheet-body table th:first-child,
.st-sheet-plan .st-sheet-body table td:first-child {
    width: 14%;
}

@media print {
    .st-sheet {
        font-size: 11px;
    }
    .st-sheet-header {
        page-break-after: avoid;
    }
    .st-sheet-meta,
    .st-sheet-instructions {
        page-break-inside: avoid;
    }
    .st-exam-item,
    .st-sheet-body table {
        page-break-inside: auto;
    }
    .st-marking-guide {
        page-break-before: always;
    }
    .st-sheet-body thead {
        display: table-header-group;
    }
    .st-sheet-footer {
        page-break-before: avoid;
    }
    .st-signature-section {
        margin-top: 20px !important;
        page-break-inside: avoid !important;
    }
    .st-sig-card {
        border: 1px solid #334155 !important;
        background: #ffffff !important;
    }
    .st-stamp-box {
        border: 1.5px dashed #334155 !important;
        height: 55px !important;
    }
}

/* ==========================================================================
   Comprehensive Mobile & Multi-Device Responsive System
   ========================================================================== */

@media screen and (max-width: 768px) {
    .st-wrap {
        margin: 10px 8px 30px 8px;
    }

    .st-header-banner {
        flex-direction: column;
        gap: 12px;
        padding: 16px 16px;
    }
    .st-header-banner .st-title {
        font-size: 20px;
    }
    .st-header-banner .st-subtitle {
        font-size: 13px;
    }

    .st-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }
    .st-header-title {
        flex-wrap: wrap;
        gap: 8px;
    }
    .st-header-title h1 {
        font-size: 18px;
    }

    /* Mobile Form Stacking & Touch Ergonomics */
    .st-panel-form {
        padding: 16px 12px;
    }
    .st-form-row {
        flex-direction: column;
        gap: 0;
        margin-bottom: 0;
    }
    .st-row-2 > .st-field {
        width: 100%;
        flex: none;
    }
    .st-field {
        margin-bottom: 12px;
    }
    .st-field label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    .st-field input[type="text"],
    .st-field input[type="number"],
    .st-field input[type="password"],
    .st-field select,
    .st-field textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents auto-zoom in iOS Safari on focus */
        padding: 8px 12px;
        box-sizing: border-box;
    }

    .st-checkbox-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .st-pill-checkbox {
        padding: 10px 12px;
        font-size: 13px;
    }

    .st-submit-btn {
        min-height: 46px;
        font-size: 15px;
    }

    /* Preview Toolbar & Export Actions on Mobile */
    .st-preview-toolbar {
        padding: 12px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .st-toolbar-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        width: 100%;
    }
    .st-btn-action {
        justify-content: center;
        padding: 9px 8px;
        font-size: 12px;
        min-height: 38px;
    }

    /* Preview Viewport & Smooth Touch Scrolling */
    .st-preview-viewport {
        padding: 14px 10px;
        -webkit-overflow-scrolling: touch;
    }
    .st-meta-grid {
        flex-direction: column;
        gap: 6px;
        text-align: left;
    }
    .st-meta-item {
        white-space: normal;
    }

    /* Refine Chat Bar on Mobile */
    .st-refine-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
    }
    .st-refine-icon {
        display: none;
    }
    .st-refine-input-wrapper input {
        min-height: 44px;
        font-size: 14px;
        padding: 8px 12px;
    }
    .st-refine-button {
        width: 100%;
        justify-content: center;
        min-height: 42px;
        font-size: 14px;
    }

    /* Signature Section Table on Mobile */
    .st-signature-table th {
        width: 35%;
        font-size: 11px;
    }
    .st-signature-table td {
        font-size: 11px;
    }
}

@media screen and (max-width: 480px) {
    .st-toolbar-actions {
        grid-template-columns: 1fr;
    }
    .st-header-banner {
        padding: 14px 12px;
    }
    .st-header-banner .st-title {
        font-size: 18px;
    }
}


/* ------------------------------------------------------------------ */
/* Modal Dialog for Support Materials & Images                         */
/* ------------------------------------------------------------------ */
.st-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    z-index: 100050;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: stFadeIn 0.2s ease;
}

@keyframes stFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.st-modal-dialog {
    animation: stSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes stSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ------------------------------------------------------------------ */
/* Multi-Account API Pool Cards                                        */
/* ------------------------------------------------------------------ */
.st-account-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.st-account-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.06);
}

.st-account-card.is-disabled {
    background: #f8fafc;
    border-color: #e2e8f0;
    opacity: 0.75;
}

.st-account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.st-account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    align-items: flex-end;
}

.st-account-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
}

.st-account-status-active {
    background: #dcfce7;
    color: #15803d;
}

.st-account-status-paused {
    background: #f1f5f9;
    color: #64748b;
}

.st-account-status-error {
    background: #fee2e2;
    color: #b91c1c;
}

.st-support-visual-container figure {
    transition: transform 0.2s ease;
}

.st-support-visual-container figure:hover {
    transform: scale(1.01);
}


/* ------------------------------------------------------------------ */
/* Frontend Navigation & Accessible Auth Portal                        */
/* ------------------------------------------------------------------ */
.st-frontend-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.st-frontend-nav a {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.st-frontend-nav a:hover,
.st-frontend-nav a.active {
    background: #eff6ff;
    color: #1d4ed8;
}

.st-frontend-nav a:focus-visible,
.st-auth-tab:focus-visible,
.st-auth-wrapper input:focus-visible,
.st-auth-wrapper button:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}
