:root {
    --accent: #0f766e;
    --accent-dark: #0c5d56;
    --accent-soft: #ccfbf1;
    --ink: #1c1917;
    --muted: #78716c;
    --border: #e7e5e4;
    --bg: #fafaf9;
    --surface: #ffffff;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --warning: #d97706;
    --warning-soft: #fffbeb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 220px);
    color: var(--ink);
    /* Respects notches/home-indicator safe areas on real devices. */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

input, select, textarea, button {
    font-family: inherit;
}

.hidden {
    display: none !important;
}

/* ---- Login ---- */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--surface);
    border-radius: 20px;
    padding: 32px 24px;
    box-shadow: 0 4px 12px rgba(28, 25, 23, 0.06), 0 16px 40px rgba(15, 118, 110, 0.12);
}

.login-logo {
    font-size: 26px;
    font-weight: 700;
    color: var(--accent-dark);
    margin: 0 0 4px;
    text-align: center;
}

.login-logo-img {
    display: block;
    max-width: 200px;
    max-height: 80px;
    margin: 0 auto 4px;
}

.login-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 24px;
}

.login-card label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 12px;
}

.login-card input {
    /* 48px min height - real touch target size, not a desktop input
       shrunk to fit a phone. */
    height: 48px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0 14px;
    font-size: 16px;
}

.login-card input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    margin: 10px 0 0;
}

.login-back-link {
    display: block;
    text-align: center;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 20px;
}

.primary-btn {
    height: 50px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.primary-btn:active {
    background: var(--accent-dark);
    transform: scale(0.98);
    box-shadow: 0 1px 3px rgba(15, 118, 110, 0.25);
}

.primary-btn:disabled {
    opacity: 0.6;
    box-shadow: none;
}

/* ---- App shell (post-login screens) ---- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(28, 25, 23, 0.08);
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--accent);
}

.app-header h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
}

.app-header .icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--muted);
    padding: 8px;
    cursor: pointer;
}

.app-content {
    padding: 16px;
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

/* ---- Offline / sync banners ---- */
.status-banner {
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-banner.offline {
    background: var(--warning-soft);
    color: var(--warning);
}

.status-banner.queued {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

/* ---- Cards / lists ---- */
.day-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.visits-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.visits-header-row h3 {
    margin: 0;
    font-size: 16px;
}

.calendar-toggle-btn {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-dark);
    cursor: pointer;
}

.visits-calendar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 700;
}

.calendar-nav button {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--accent-dark);
    padding: 4px 10px;
    cursor: pointer;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
}

.calendar-weekdays span {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    padding-bottom: 6px;
}

.calendar-cell {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-radius: 50%;
    cursor: pointer;
}

.calendar-cell.empty {
    cursor: default;
}

.calendar-cell.today {
    border: 1.5px solid var(--accent);
    font-weight: 700;
}

.calendar-cell.has-visit {
    background: rgba(15, 118, 110, 0.08);
    font-weight: 600;
}

.calendar-dot {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

.day-tab {
    flex: none;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.day-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ---- Date navigator (Schedule screen) - deliberately not a
   scrollable list, so there's nothing to ever scroll past or lose
   track of, and going backward is just as easy as forward. ---- */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px;
    margin-bottom: 16px;
    position: relative;
    box-shadow: 0 1px 3px rgba(28, 25, 23, 0.06);
}

.date-nav-arrow {
    background: none;
    border: none;
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

.date-nav-arrow:active {
    background: var(--accent-soft);
}

.date-nav-label {
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    padding: 8px 12px;
}

.date-nav-picker-input {
    /* The real <input type="date"> is invisible and never tapped
       directly - openDatePicker() triggers it programmatically when
       the visible label is tapped, giving a native date picker without
       an ugly raw date input sitting in the UI. */
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.visit-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 4px 10px rgba(28, 25, 23, 0.05);
    transition: box-shadow 0.15s ease, transform 0.1s ease;
    /* Real tap target - the whole card is tappable, not a small link
       inside it. */
    cursor: pointer;
}

.visit-card:active {
    background: #f5f5f4;
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(28, 25, 23, 0.06);
}

.visit-time {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-dark);
    margin: 0 0 4px;
}

.visit-client-name {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 4px;
}

.visit-address {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

/* Was used across several pages (availability.html, leave.html, and
   now the new client-facing screens) but never actually defined here
   at all - every one of those hint/subtitle lines has been rendering
   as plain unstyled black text this whole time, not the muted
   secondary text it was clearly meant to be. */
.finance-hint {
    font-size: 13px;
    color: var(--muted);
    margin: 4px 0;
    line-height: 1.4;
}

.notes-history-text {
    font-size: 14px;
    color: var(--ink);
    line-height: 1.5;
    white-space: pre-wrap;
    margin: 10px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.visit-status-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 3px 10px;
    border-radius: 999px;
    margin-top: 8px;
}

.visit-status-pill.done {
    background: var(--success-soft);
    color: var(--success);
}

.visit-status-pill.pending {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.visit-status-pill.paused {
    background: #f3f4f6;
    color: var(--muted);
}

.visit-status-pill.cancelled {
    background: var(--danger-soft);
    color: var(--danger);
}

.visit-status-pill.missed {
    background: var(--danger-soft);
    color: var(--danger);
    font-weight: 700;
}

/* Day-of-week picker for submitting availability - same tap-to-toggle
   pill pattern as the training player's own choice buttons. */
.av-day-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 4px;
}

.av-day-choice {
    padding: 10px 4px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}

.av-day-choice.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-dark);
}

/* Time/date fields shown as pairs side by side (From/To, Starting
   from/Until) rather than one long vertical stack of four separate
   fields. */
.av-time-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.av-time-row label {
    margin-top: 10px;
}

.leave-balance-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
}

.leave-balance-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    text-align: center;
}

.leave-balance-stat {
    display: flex;
    flex-direction: column;
}

.profile-photo-fallback {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.carer-profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 4px;
}

.carer-profile-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.carer-profile-bio {
    font-size: 14px;
    color: var(--ink);
    line-height: 1.5;
    white-space: pre-wrap;
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.carer-profile-training {
    margin: 4px 0 0;
    padding-left: 20px;
    font-size: 14px;
    color: var(--ink);
}

.carer-profile-training li {
    margin-bottom: 4px;
}

.client-face-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-radius: 16px;
}

.client-face-photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.85);
}

.client-face-photo-fallback {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.85);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
}

.client-face-name {
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    margin: 12px 0 0;
}

.client-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.client-dashboard-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 4px 10px rgba(28, 25, 23, 0.05);
}

.client-dashboard-tile:active {
    transform: scale(0.97);
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 12px;
    text-decoration: none;
    border: 1.5px solid var(--border);
}

.summary-card-clear {
    background: var(--success-soft);
    border-color: transparent;
}

.summary-card-alert {
    background: var(--danger-soft);
    border-color: transparent;
}

.summary-card-count {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.summary-card-clear .summary-card-count {
    background: var(--success);
}

.summary-card-alert .summary-card-count {
    background: var(--danger);
}

.summary-card-text {
    flex: 1;
    min-width: 0;
}

.summary-card-label {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.summary-card-description {
    font-size: 12.5px;
    color: var(--muted);
    margin: 2px 0 0;
}

.summary-card-clear .summary-card-description {
    color: var(--success);
}

.summary-card-alert .summary-card-description {
    color: var(--danger);
}

.summary-card-arrow {
    flex-shrink: 0;
    font-size: 20px;
    color: var(--muted);
}

.leave-balance-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
}

.leave-balance-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-top: 2px;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    padding: 60px 20px;
}

/* ---- More menu ---- */
.more-menu {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.more-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    text-align: left;
    cursor: pointer;
}

.more-menu-item:last-child {
    border-bottom: none;
}

.more-menu-item:active {
    background: #f5f5f4;
}

.more-menu-arrow {
    color: var(--muted);
    font-size: 20px;
}

.more-menu-signout {
    color: var(--danger);
}

/* ---- Expense form ---- */
.expense-form {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 20px;
}

.expense-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 12px;
    margin-bottom: 4px;
}

.expense-form input {
    width: 100%;
    box-sizing: border-box;
    height: 46px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 16px;
}

.expense-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---- Visit screen: clock in/out ---- */
.clock-card {
    background: linear-gradient(155deg, var(--accent-soft) 0%, #ffffff 130%);
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 20px 18px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.12);
}

.clock-status {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-dark);
    margin: 4px 0 0;
}

.visit-section textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
}

.visit-section textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.visit-section label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}

/* ---- MAR status buttons ---- */
.mar-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.mar-status-btn {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
}

.mar-status-btn.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ---- Bottom tab nav ---- */
.tab-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    box-shadow: 0 -1px 3px rgba(28, 25, 23, 0.08);
    display: flex;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 10;
}

.tab-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 0;
    text-decoration: none;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.tab-nav a.active {
    color: var(--accent);
}

.tab-nav .tab-icon {
    font-size: 20px;
}

/* ---- Sign-in reason modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
}

.modal-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 8px 30px rgba(28, 25, 23, 0.25);
    /* Was missing entirely, same bug as desktop's .modal-content -
       .modal-overlay is fixed at full viewport height and vertically
       centers this card with no height limit of its own, so any
       modal whose content grows taller than the viewport (a long
       bio, a big medications list) overflowed off both the top AND
       bottom of the screen with no way to scroll and reach it -
       arguably worse here than on desktop, since a phone screen is
       shorter to begin with. */
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.modal-message {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 14px;
}

.modal-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}

.modal-card textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
}

.modal-card select {
    width: 100%;
    box-sizing: border-box;
    height: 46px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0 10px;
    font-size: 15px;
    font-family: inherit;
    background: var(--surface);
}

/* Was genuinely missing before - every existing modal used textarea/
   select only, none used a plain input, so this never got written
   until availability's own date/time fields needed it. */
.modal-card input {
    width: 100%;
    box-sizing: border-box;
    height: 46px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 15px;
    font-family: inherit;
    background: var(--surface);
    color: var(--ink);
}

.modal-card input:focus,
.modal-card textarea:focus,
.modal-card select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.modal-btn-secondary {
    flex: 1;
    height: 50px;
    background: var(--bg);
    color: var(--ink);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.modal-actions .primary-btn {
    flex: 1;
}

/* =========================================
   TRAINING PLAYER
   ========================================= */
.tp-progress-track {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.tp-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.2s ease;
}

.tp-progress-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    margin: 0 0 16px;
}

.tp-step-content {
    margin-bottom: 20px;
}

.tp-reading-body {
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    white-space: pre-wrap;
}

.tp-question-prompt {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 14px;
}

.tp-choice-list, .tp-ordering-chosen, .tp-ordering-pool, .tp-fillblank-pool {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-choice {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.tp-choice.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    font-weight: 700;
}

.tp-choice.correct {
    border-color: var(--success);
    background: var(--success-soft);
    color: var(--success);
    font-weight: 700;
}

.tp-choice.incorrect {
    border-color: var(--danger);
    background: var(--danger-soft);
    color: var(--danger);
}

.tp-choice:disabled {
    opacity: 0.85;
    cursor: default;
}

.tp-question-feedback {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}

.tp-question-feedback.correct {
    background: var(--success-soft);
    color: var(--success);
}

.tp-question-feedback.incorrect {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ---- Ordering ---- */
.tp-ordering-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin: 14px 0 6px;
}

.tp-ordering-chosen:empty::after {
    content: "Nothing placed yet";
    display: block;
    padding: 10px;
    color: var(--muted);
    font-size: 14px;
    font-style: italic;
}

.tp-ordering-item {
    background: var(--accent-soft);
    border-color: var(--accent);
}

/* ---- Matching ---- */
.tp-matching-columns {
    display: flex;
    gap: 10px;
}

.tp-matching-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.tp-matching-col .tp-choice {
    font-size: 14px;
    padding: 10px 12px;
    min-height: 44px;
}

.tp-matching-pairs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-matching-pair-row {
    background: var(--accent-soft);
    border-color: var(--accent);
    font-size: 14px;
}

/* ---- Hotspot ---- */
.tp-hotspot-wrap {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid var(--border);
    cursor: crosshair;
}

.tp-hotspot-wrap img {
    display: block;
    width: 100%;
    height: auto;
}

.tp-hotspot-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.tp-hotspot-marker {
    position: absolute;
    width: 22px;
    height: 22px;
    margin-left: -11px;
    margin-top: -11px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.85);
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.tp-hotspot-marker.correct {
    background: rgba(22, 163, 74, 0.85);
}

.tp-hotspot-zone-outline {
    position: absolute;
    border: 2px dashed var(--success);
    border-radius: 4px;
    background: rgba(22, 163, 74, 0.1);
}

/* ---- Fill in the blank ---- */
.tp-fillblank-sentence {
    font-size: 16px;
    line-height: 2;
    color: var(--ink);
}

.tp-blank-slot {
    display: inline-block;
    min-width: 70px;
    padding: 2px 10px;
    margin: 0 2px;
    border-bottom: 2px solid var(--accent);
    border-radius: 4px;
    background: var(--accent-soft);
    font-weight: 700;
    color: var(--accent-dark);
    text-align: center;
}

.tp-blank-slot.selected {
    background: var(--accent);
    color: white;
}

.tp-blank-slot.correct {
    background: var(--success-soft);
    border-bottom-color: var(--success);
    color: var(--success);
}

.tp-blank-slot.incorrect {
    background: var(--danger-soft);
    border-bottom-color: var(--danger);
    color: var(--danger);
}

/* ---- Nav + completion ---- */
.tp-nav {
    display: flex;
    gap: 10px;
}

.tp-nav .primary-btn {
    flex: 1;
}

.tp-completion {
    text-align: center;
    padding: 40px 20px;
}

.tp-completion-badge {
    width: 64px;
    height: 64px;
    line-height: 64px;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto 16px;
}

.tp-completion h2 {
    margin: 0 0 8px;
}

.tp-completion p {
    color: var(--muted);
    margin: 0 0 24px;
}

/* Reading step media (image/video/audio) - sits above the step's own
   text body. */
.tp-reading-media-img,
.tp-reading-media-video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 16px;
}

.tp-reading-media-audio {
    display: block;
    width: 100%;
    margin-bottom: 16px;
}
