/* Creator operations UI: responsive task, history, profile and announcement views. */
:root {
    --ops-ink: #17243a;
    --ops-muted: #64748b;
    --ops-soft: #8794a8;
    --ops-surface: rgba(255, 255, 255, .78);
    --ops-surface-strong: rgba(255, 255, 255, .93);
    --ops-line: rgba(148, 163, 184, .24);
    --ops-accent: #5548d9;
    --ops-accent-soft: rgba(85, 72, 217, .1);
    --ops-good: #087f5b;
    --ops-shadow: 0 18px 48px rgba(45, 53, 105, .1);
}
html[data-theme="dark"] {
    --ops-ink: #eef2ff;
    --ops-muted: #b3bfd5;
    --ops-soft: #8f9cb5;
    --ops-surface: rgba(19, 27, 48, .8);
    --ops-surface-strong: rgba(25, 34, 59, .96);
    --ops-line: rgba(165, 180, 252, .2);
    --ops-accent: #b3a9ff;
    --ops-accent-soft: rgba(165, 148, 255, .13);
    --ops-good: #6ee7b7;
    --ops-shadow: 0 18px 48px rgba(0, 0, 0, .24);
}

body.logged-in { color: var(--ops-ink); }
body.logged-in .main-content {
    width: min(100% - 48px, 1120px);
    max-width: 1120px;
    margin: 102px auto 0;
    padding: 0 0 calc(64px + env(safe-area-inset-bottom));
}
body.logged-in .main-content .page-header {
    align-items: flex-end;
    margin: 0 0 22px;
    padding: 0 0 16px;
    border-color: var(--ops-line);
}
body.logged-in .main-content .page-header h2 { color: var(--ops-ink); }
body.logged-in .main-content .page-header p { color: var(--ops-muted); margin-top: 5px; }
body.logged-in .card,
body.logged-in .card-static,
body.logged-in .task-history-card,
body.logged-in .profile-panel {
    color: var(--ops-ink);
    background: var(--ops-surface) !important;
    border: 1px solid var(--ops-line) !important;
    box-shadow: var(--ops-shadow) !important;
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    backdrop-filter: blur(22px) saturate(145%);
}
body.logged-in .card-static:hover { background: var(--ops-surface) !important; }
body.logged-in .main-content p,
body.logged-in .main-content small { color: var(--ops-muted); }
body.logged-in .main-content a:not(.btn) { color: var(--ops-accent); }
body.logged-in .main-content input,
body.logged-in .main-content select,
body.logged-in .main-content textarea {
    min-width: 0;
    color: var(--ops-ink);
    background: var(--ops-surface-strong);
    border: 1px solid var(--ops-line);
    border-radius: 12px;
}
body.logged-in .main-content input::placeholder,
body.logged-in .main-content textarea::placeholder { color: var(--ops-soft); }
body.logged-in .main-content label { color: var(--ops-muted); font-weight: 650; }
body.logged-in .main-content .btn-primary,
body.logged-in .main-content .btn:not(.btn-outline) {
    color: #fff !important;
    background: linear-gradient(135deg, #5b56e8, #7654d8) !important;
}
html[data-theme="dark"] body.logged-in .main-content .btn-primary,
html[data-theme="dark"] body.logged-in .main-content .btn:not(.btn-outline) { color: #fff !important; }
body.logged-in .main-content .btn-outline {
    color: var(--ops-accent) !important;
    background: var(--ops-accent-soft) !important;
    border: 1px solid var(--ops-line) !important;
}
body.logged-in .stats-pill {
    color: var(--ops-muted);
    background: var(--ops-surface);
    border: 1px solid var(--ops-line);
}
body.logged-in .empty-state { color: var(--ops-muted); }
body.logged-in .material-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 265px), 1fr)); gap: 16px; }
body.logged-in .mat-card { min-width: 0; padding: 17px; border-radius: 19px; }
body.logged-in .mat-card .mat-title { margin: 12px 0 8px; color: var(--ops-ink) !important; font-size: 1.04rem; overflow-wrap: anywhere; }
body.logged-in .mat-card .mat-desc { margin: 10px 0; color: var(--ops-muted) !important; line-height: 1.55; }
body.logged-in .mat-card .mat-time { color: var(--ops-muted) !important; }
body.logged-in .mat-card .mat-thumb { height: clamp(145px, 18vw, 210px); border-radius: 14px; }
body.logged-in .mat-card .mat-thumb img { height: 100%; }
body.logged-in .mat-card .mat-footer { align-items: center; }
body.logged-in .mat-card .badge { margin-top: 4px; }
body.logged-in .pagination { gap: 10px; }
body.logged-in .pagination .page-info { color: var(--ops-muted); }
body.logged-in #submissionList > .card { margin: 0 0 13px; padding: 18px; border-radius: 17px; }
body.logged-in .submission-record-card { margin: 0 0 13px; padding: 18px; border-radius: 17px; }
.history-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; color: var(--ops-ink); }
.submitted-metrics { display: flex; flex-wrap: wrap; gap: 7px; margin: 11px 0; }
.submitted-metrics span { padding: 6px 9px; border-radius: 9px; color: var(--ops-muted); background: var(--ops-accent-soft); font-size: .8rem; }
.claim-result-dialog { display: grid; gap: 14px; width: min(780px, calc(100% - 28px)); max-height: min(86dvh, 820px); overflow-y: auto; padding: clamp(17px, 3vw, 26px); border-radius: 22px; color: var(--ops-ink); background: var(--ops-surface-strong) !important; }
.claim-result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.claim-result-head h2 { color: var(--ops-ink); font-size: 1.3rem; }
.claim-result-actions { display: flex; flex-wrap: wrap; gap: 9px; }

/* Task cards and mobile-safe media handling. */
.task-history-list { display: grid; gap: 18px; }
.task-history-card { display: grid; gap: 16px; padding: clamp(16px, 2.4vw, 26px); border-radius: 22px; }
.task-history-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.task-history-head > div { min-width: 0; }
.task-eyebrow { display: inline-block; margin-bottom: 4px; color: var(--ops-accent); font-size: .76rem; font-weight: 750; letter-spacing: .06em; }
.task-history-head .his-title { color: var(--ops-ink); font-size: clamp(1.06rem, 2vw, 1.28rem); line-height: 1.4; overflow-wrap: anywhere; }
.task-history-head .badge { flex: 0 0 auto; }
.task-history-card .his-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: var(--ops-muted); font-size: .86rem; }
.task-history-card .his-meta strong { color: var(--ops-good); }
.task-media-panel, .task-copy-panel { min-width: 0; padding: 16px; border: 1px solid var(--ops-line); border-radius: 17px; background: var(--ops-accent-soft); }
.task-media-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; color: var(--ops-ink); }
.task-media-heading strong { display: inline-flex; align-items: center; gap: 8px; }
.task-media-heading > span { color: var(--ops-muted); font-size: .82rem; }
.task-video-preview { display: block; width: 100%; max-height: 540px; border-radius: 13px; background: #0b1020; object-fit: contain; }
.task-media-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.task-media-hint { margin: 10px 0 0; font-size: .8rem; line-height: 1.55; }
.task-image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.task-image-grid figure { min-width: 0; overflow: hidden; border: 1px solid var(--ops-line); border-radius: 13px; background: var(--ops-surface-strong); }
.task-image-grid img { display: block; width: 100%; max-height: 420px; object-fit: contain; background: rgba(15, 23, 42, .06); }
.task-image-grid figcaption { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 10px; }
.task-image-grid figcaption a { display: inline-flex; align-items: center; min-height: 36px; padding: 7px 10px; border-radius: 9px; background: var(--ops-accent-soft); font-size: .82rem; font-weight: 700; }
.task-copy-text { padding: 12px; border-radius: 12px; color: var(--ops-ink); background: var(--ops-surface-strong); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; user-select: text; -webkit-user-select: text; }
.task-topics { margin-top: 10px; color: var(--ops-accent); overflow-wrap: anywhere; }
.text-action { padding: 6px 10px; color: var(--ops-accent); background: transparent; border: 0; box-shadow: none; font-weight: 700; }
.task-last-status { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--ops-muted); background: var(--ops-accent-soft); font-size: .85rem; }
.task-last-status span:last-child { text-align: right; overflow-wrap: anywhere; }
.task-submit-details { border: 1px solid var(--ops-line); border-radius: 16px; background: var(--ops-surface-strong); }
.task-submit-details summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 16px; color: var(--ops-ink); cursor: pointer; list-style: none; font-weight: 750; }
.task-submit-details summary::-webkit-details-marker { display: none; }
.task-submit-details summary::after { content: '+'; color: var(--ops-accent); font-size: 1.25rem; }
.task-submit-details[open] summary::after { content: '−'; }
.task-submit-details summary small { text-align: right; font-weight: 500; }
.task-submit-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 0 16px 16px; }
.task-submit-form > label { align-self: end; margin-top: 2px; }
.task-submit-form > input, .task-submit-form > small, .task-submit-form > button { grid-column: 1 / -1; }
.task-submit-form > input, .task-submit-form > select { width: 100%; min-height: 44px; padding: 10px 12px; }
.task-submit-form .metric-inputs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.task-submit-form .metric-inputs input { width: 100%; min-height: 44px; padding: 9px; }
.task-submit-form input[type="file"] { padding: 8px; }
.task-submit-form button { justify-self: start; min-height: 44px; }

/* Profile and invitation center. */
.profile-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.profile-summary-card { display: grid; gap: 5px; min-width: 0; padding: 18px 20px; border: 1px solid var(--ops-line); border-radius: 18px; background: var(--ops-surface); box-shadow: var(--ops-shadow); }
.profile-summary-card span { color: var(--ops-muted); font-size: .84rem; }
.profile-summary-card strong { color: var(--ops-ink); font-size: clamp(1.2rem, 2.5vw, 1.7rem); overflow-wrap: anywhere; }
.profile-summary-card small { color: var(--ops-soft); }
.profile-panel { margin: 16px 0; padding: clamp(17px, 2.5vw, 26px); border-radius: 20px; }
.profile-panel-heading { margin-bottom: 17px; }
.profile-panel-heading h3 { margin: 0 0 4px; color: var(--ops-ink); font-size: 1.08rem; }
.profile-panel-heading p { margin: 0; }
.profile-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.profile-form > label, .profile-form-row > label { display: grid; gap: 7px; }
.profile-form input, .profile-form select { width: 100%; min-height: 44px; padding: 10px 12px; }
.profile-form input[disabled] { opacity: .78; }
.profile-form-row { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; }
.profile-payment-upload { display: grid; align-content: start; justify-items: start; min-width: 0; }
.profile-payment-upload .image-upload-dropzone { width: 140px; max-width: 100%; aspect-ratio: 1 / 1; margin: 4px 0 2px; padding: 12px; }
.profile-payment-upload > small { max-width: 34ch; color: var(--ops-muted); line-height: 1.5; }
.profile-form > button, .profile-qr-preview { grid-column: 1 / -1; }
.profile-form > button { justify-self: start; min-height: 44px; }
.profile-qr-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 12px; border: 1px solid var(--ops-line); border-radius: 14px; background: var(--ops-accent-soft); }
.profile-qr-preview img { width: 132px; height: 132px; object-fit: contain; border-radius: 10px; background: white; }
.profile-qr-preview label { display: inline-flex; align-items: center; gap: 8px; }
.profile-qr-preview input { width: 18px; height: 18px; min-height: auto; }
.referral-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 15px; }
.referral-stats > div { display: grid; gap: 4px; padding: 13px; border: 1px solid var(--ops-line); border-radius: 13px; background: var(--ops-accent-soft); }
.referral-stats span { color: var(--ops-muted); font-size: .78rem; }
.referral-stats strong { color: var(--ops-ink); font-size: 1.02rem; }
.invite-link-field { display: grid; gap: 7px; color: var(--ops-muted); font-weight: 700; }
.invite-link-field > div { display: flex; gap: 8px; min-width: 0; }
.invite-link-field input { flex: 1; min-width: 0; padding: 10px 12px; }
.invite-link-field button { flex: 0 0 auto; }
.referral-reward-list { display: grid; gap: 8px; margin-top: 16px; }
.referral-reward-list > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 12px; border-bottom: 1px solid var(--ops-line); }
.referral-reward-list span { color: var(--ops-muted); overflow-wrap: anywhere; }
.referral-reward-list strong { color: var(--ops-ink); text-align: right; }

/* Announcements are scrollable and fit short laptop and phone viewports. */
.announcement-modal { z-index: 3000; padding: 16px; }
.announcement-dialog { display: grid; gap: 16px; width: min(100%, 620px); max-height: min(82dvh, 760px); overflow: auto; padding: clamp(18px, 3vw, 28px); border-radius: 22px; color: var(--ops-ink); background: var(--ops-surface-strong) !important; }
.announcement-dialog-head { display: flex; justify-content: space-between; align-items: center; }
.announcement-kicker { color: var(--ops-accent); font-weight: 750; }
.announcement-dialog h2 { color: var(--ops-ink); font-size: clamp(1.2rem, 3vw, 1.55rem); }
.icon-button { width: 40px; height: 40px; padding: 0; color: var(--ops-muted); background: var(--ops-accent-soft); border: 1px solid var(--ops-line); border-radius: 50%; }
.announcement-dialog-list { display: grid; gap: 11px; }
.announcement-dialog-item { padding: 14px; border: 1px solid var(--ops-line); border-radius: 14px; background: var(--ops-surface); }
.announcement-dialog-title { margin-bottom: 6px; color: var(--ops-ink); font-weight: 750; }
.announcement-dialog-content { color: var(--ops-muted); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.announcement-dismiss-choice { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--ops-muted); font-size: .86rem; }
.announcement-dismiss-choice input { width: 18px; height: 18px; accent-color: var(--ops-accent); }
.announcement-dialog-actions { display: flex; justify-content: flex-end; }

@media (max-width: 760px) {
    body.logged-in .main-content { width: auto; margin: 84px 16px 0; padding: 0 0 calc(82px + env(safe-area-inset-bottom)); }
    body.logged-in .mobile-tab { height: calc(66px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
    body.logged-in .main-content .page-header { display: block; margin-bottom: 16px; }
    body.logged-in .main-content .page-header h2 { font-size: 1.24rem; }
    body.logged-in .material-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 12px; }
    .task-history-list { gap: 13px; }
    .task-history-card { gap: 13px; padding: 15px; border-radius: 18px; }
    .task-media-panel, .task-copy-panel { padding: 12px; border-radius: 14px; }
    .task-video-preview { max-height: 62vh; }
    .task-image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .task-image-grid img { max-height: 320px; }
    .task-image-grid figcaption { gap: 5px; padding: 7px 5px; }
    .task-image-grid figcaption a { min-height: 34px; padding: 6px 8px; font-size: .75rem; }
    .profile-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .profile-summary-card { padding: 14px; border-radius: 15px; }
    .profile-summary-card:last-child { grid-column: 1 / -1; }
    .profile-form { grid-template-columns: 1fr; gap: 12px; }
    .profile-form-row { grid-template-columns: 1fr; gap: 12px; }
    .profile-payment-upload .image-upload-dropzone { width: 132px; }
    .referral-stats { gap: 7px; }
    .referral-stats > div { padding: 10px 8px; }
    .referral-stats strong { font-size: .9rem; }
    .task-last-status { display: grid; gap: 5px; }
    .task-last-status span:last-child { text-align: left; }
}
@media (max-width: 480px) {
    body.logged-in .main-content { margin: 80px 12px 0; }
    .task-history-head { gap: 8px; }
    .task-history-head .badge { font-size: .69rem; }
    body.logged-in .material-grid { grid-template-columns: 1fr; }
    body.logged-in .mat-card { padding: 14px; }
    body.logged-in .mat-card .mat-thumb { height: 190px; }
    .task-history-card .his-meta { display: grid; gap: 3px; }
    .task-media-heading { align-items: flex-start; }
    .task-media-heading > span { text-align: right; }
    .task-image-grid { grid-template-columns: 1fr; }
    .task-image-grid img { max-height: 62vh; }
    .task-media-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .task-media-actions .btn { padding-inline: 8px; font-size: .8rem; }
    .task-submit-details summary { align-items: flex-start; flex-wrap: wrap; padding: 13px; }
    .task-submit-details summary small { order: 2; width: 100%; text-align: left; }
    .task-submit-form { grid-template-columns: 1fr; padding: 0 13px 13px; }
    .task-submit-form > label, .task-submit-form > input { grid-column: 1; }
    .task-submit-form .metric-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .task-submit-form button { width: 100%; }
    .profile-summary-grid { grid-template-columns: 1fr 1fr; }
    .profile-summary-card:last-child { grid-column: 1 / -1; }
    .invite-link-field > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .invite-link-field input { width: 100%; font-size: .78rem; }
    .referral-reward-list > div { align-items: flex-start; flex-direction: column; gap: 3px; }
    .referral-reward-list strong { text-align: left; }
    .announcement-dialog { max-height: 86dvh; }
    .claim-result-dialog { width: calc(100% - 20px); max-height: 88dvh; }
    .claim-result-actions { display: grid; grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .task-history-card, .task-image-grid figure, .announcement-dialog { scroll-behavior: auto; animation: none !important; transition: none !important; }
}

/* Day mode contrast pass: preserve readable text on translucent surfaces. */
html[data-theme="light"] body.logged-in {
    --ops-soft: #64748b;
}
html[data-theme="light"] body.logged-in .navbar,
html[data-theme="light"] body.logged-in .mobile-tab {
    color: #17243a !important;
    background: rgba(255, 255, 255, .96) !important;
    border-color: #d8dfeb !important;
    box-shadow: 0 10px 30px rgba(32, 41, 67, .1) !important;
}
html[data-theme="light"] body.logged-in .navbar-brand,
html[data-theme="light"] body.logged-in .navbar-links a,
html[data-theme="light"] body.logged-in .navbar-user,
html[data-theme="light"] body.logged-in .mobile-tab a {
    color: #26334a !important;
    text-shadow: none !important;
}
html[data-theme="light"] body.logged-in .navbar-links a:hover,
html[data-theme="light"] body.logged-in .navbar-links a.active,
html[data-theme="light"] body.logged-in .mobile-tab a.active,
html[data-theme="light"] body.logged-in .mobile-tab a:hover {
    color: #3730a3 !important;
    background: #eef0ff !important;
}
html[data-theme="light"] body.logged-in .mobile-tab a.active::before {
    background: #4f46e5 !important;
    box-shadow: none !important;
}
html[data-theme="light"] body.logged-in .navbar-user a {
    color: #b42318 !important;
}
html[data-theme="light"] body.logged-in .theme-toggle-nav {
    color: #3730a3 !important;
    background: #f1f2ff !important;
    border-color: #d4d8fa !important;
}
html[data-theme="light"] body.logged-in .main-content .hero-section {
    color: #17243a !important;
    background: linear-gradient(135deg, #eef2ff 0%, #f2efff 58%, #f8eff8 100%) !important;
    border-color: #cbd2f2 !important;
}
html[data-theme="light"] body.logged-in .main-content .hero-section h1,
html[data-theme="light"] body.logged-in .main-content .hero-section p {
    color: #202943 !important;
    -webkit-text-fill-color: currentColor !important;
    background: none !important;
    opacity: 1 !important;
    text-shadow: none !important;
}
html[data-theme="light"] body.logged-in .pagination button {
    color: #273449 !important;
    background: #fff !important;
    border: 1px solid #cbd5e1 !important;
}
html[data-theme="light"] body.logged-in .pagination button:hover:not(:disabled) {
    color: #3730a3 !important;
    background: #eef0ff !important;
    border-color: #a5b4fc !important;
}
html[data-theme="light"] body.logged-in .pagination button:disabled {
    color: #64748b !important;
    background: #f1f5f9 !important;
}
html[data-theme="light"] .msg-success {
    color: #166534 !important;
    background: #dcfce7 !important;
    border-color: #a7f3d0 !important;
}
html[data-theme="light"] .msg-error {
    color: #991b1b !important;
    background: #fee2e2 !important;
    border-color: #fecaca !important;
}
html[data-theme="light"] .spinner {
    border-color: #cbd5e1 !important;
    border-top-color: #4f46e5 !important;
}
.creator-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.35;
}
html[data-theme="light"] .creator-status-neutral { color: #475569; background: #f1f5f9; border-color: #cbd5e1; }
html[data-theme="light"] .creator-status-pending { color: #854d0e; background: #fef3c7; border-color: #fcd34d; }
html[data-theme="light"] .creator-status-approved { color: #166534; background: #dcfce7; border-color: #a7f3d0; }
html[data-theme="light"] .creator-status-rejected { color: #991b1b; background: #fee2e2; border-color: #fecaca; }
html[data-theme="dark"] .creator-status-neutral { color: #cbd5e1; background: #263247; border-color: #475569; }
html[data-theme="dark"] .creator-status-pending { color: #fde68a; background: #493512; border-color: #80601c; }
html[data-theme="dark"] .creator-status-approved { color: #a7f3d0; background: #123b32; border-color: #23634d; }
html[data-theme="dark"] .creator-status-rejected { color: #fecaca; background: #4a2028; border-color: #783341; }

/* Keep creator content readable over the legacy glass backgrounds in both themes. */
body.logged-in .main-content,
body.logged-in .main-content :where(.info-label, .info-value, .text-muted, .empty-state, .history-item .his-title, .history-item .his-meta) {
    color: var(--ops-ink);
}
body.logged-in .main-content .page-header h2 i,
body.logged-in .main-content .empty-state i {
    color: var(--ops-accent);
    background: none;
    -webkit-text-fill-color: currentColor;
}
body.logged-in .main-content .hero-section {
    color: var(--ops-ink) !important;
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(244,242,255,.92)) !important;
    border: 1px solid rgba(85,72,217,.2) !important;
    box-shadow: 0 18px 44px rgba(45,53,105,.12) !important;
}
body.logged-in .main-content .hero-section h1,
body.logged-in .main-content .hero-section p {
    color: #202943 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}
body.logged-in .main-content .hero-section p { max-width: 760px; margin: 0 auto 20px; line-height: 1.65; }
body.logged-in .main-content .hero-section::before,
body.logged-in .main-content .hero-section::after { opacity: .28; }

/* Status text remains legible on pale badge fills in daytime mode. */
body.logged-in .main-content .badge-info,
body.logged-in .main-content .badge-secondary {
    color: #3730a3 !important;
    background: #e8eaff !important;
    border: 1px solid #c7ceff !important;
}
body.logged-in .main-content .badge-success { color: #166534 !important; background: #dcfce7 !important; border-color: #a7f3d0 !important; }
body.logged-in .main-content .badge-warning { color: #854d0e !important; background: #fef3c7 !important; border-color: #fcd34d !important; }
body.logged-in .main-content .badge-danger { color: #991b1b !important; background: #fee2e2 !important; border-color: #fecaca !important; }
body.logged-in .main-content .stat-card,
body.logged-in .main-content .quick-item {
    color: var(--ops-ink) !important;
    background: var(--ops-surface) !important;
    border-color: var(--ops-line) !important;
}
body.logged-in .main-content .stat-card :where(h3, strong, span, i),
body.logged-in .main-content .quick-item :where(strong, span, i),
body.logged-in .main-content .info-label,
body.logged-in .main-content .info-value,
body.logged-in .main-content .history-title-row,
body.logged-in .main-content .history-title-row strong,
body.logged-in .main-content .history-item .his-title,
body.logged-in .main-content .history-item .his-meta { color: var(--ops-ink) !important; }
body.logged-in .main-content .stat-card .stat-label,
body.logged-in .main-content .quick-item small { color: var(--ops-muted) !important; }
body.logged-in .main-content .stats-pill { color: var(--ops-ink); }

/* Mobile-friendly image picker: visible dashed target, accessible native input, preview after selection. */
.image-upload-dropzone {
    position: relative;
    display: grid !important;
    place-items: center;
    width: min(100%, 224px);
    aspect-ratio: 1 / 1;
    min-height: 0;
    justify-self: start;
    margin: 4px 0 8px;
    padding: 16px;
    overflow: hidden;
    color: #1f2937 !important;
    text-align: center;
    background: #fff !important;
    border: 2px dashed #a1a1aa !important;
    border-radius: 14px;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease;
}
.task-submit-form .image-upload-dropzone { width: 132px; padding: 10px; border-radius: 12px; }
.task-submit-form .image-upload-placeholder { gap: 3px; }
.task-submit-form .image-upload-placeholder i { font-size: 1.25rem; }
.task-submit-form .image-upload-placeholder strong { font-size: .84rem; }
.image-upload-dropzone:hover,
.image-upload-dropzone:focus-within { background: #f8fafc !important; border-color: #6255d9 !important; }
.image-upload-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap;
    border: 0 !important;
}
.image-upload-placeholder { display: grid; justify-items: center; gap: 5px; color: #1f2937 !important; }
.image-upload-placeholder i { color: #9ca3af; font-size: 1.55rem; }
.image-upload-placeholder strong { color: #111827 !important; font-size: .96rem; }
.image-upload-placeholder small { color: #64748b !important; font-size: .82rem; }
.image-upload-preview { display: block; width: 100%; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.image-upload-preview[hidden] { display: none !important; }
.image-upload-dropzone.has-image { background: rgba(255,255,255,.86) !important; border-style: solid !important; }
.image-upload-dropzone.has-image .image-upload-placeholder { display: none; }

/* Third-party chat webviews cannot reliably launch the system browser; show a focused hand-off guide. */
#inAppBrowserGuide { display: none !important; }
html.in-app-browser body { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)); background: #f3f5fa !important; }
html.in-app-browser body > :not(#inAppBrowserGuide) { display: none !important; }
html.in-app-browser #inAppBrowserGuide { display: grid !important; width: min(100%, 520px); }
.in-app-browser-card { padding: clamp(22px, 6vw, 34px); color: #1e293b; background: rgba(255,255,255,.96); border: 1px solid #dbe2ef; border-radius: 22px; box-shadow: 0 20px 60px rgba(30,41,59,.12); }
.in-app-browser-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 18px; color: #4338ca; background: #eef2ff; border-radius: 14px; font-size: 1.15rem; }
.in-app-browser-kicker { margin: 0 0 6px; color: #4f46e5; font-size: .84rem; font-weight: 750; }
.in-app-browser-card h1 { margin: 0; color: #172033; font-size: clamp(1.35rem, 5vw, 1.7rem); line-height: 1.3; }
.in-app-browser-copy { margin: 12px 0 20px; color: #475569; line-height: 1.65; }
.in-app-browser-steps { display: grid; gap: 12px; margin: 0 0 20px; padding: 0; list-style: none; }
.in-app-browser-steps li { display: flex; align-items: flex-start; gap: 11px; }
.in-app-browser-steps li > span { display: grid; flex: 0 0 27px; place-items: center; height: 27px; color: #fff; background: #4f46e5; border-radius: 50%; font-size: .82rem; font-weight: 750; }
.in-app-browser-steps strong,.in-app-browser-steps small { display: block; }
.in-app-browser-steps strong { color: #1e293b; }
.in-app-browser-steps small { margin-top: 3px; color: #64748b; line-height: 1.5; }
.in-app-browser-link-label { display: block; margin-bottom: 6px; color: #475569; font-size: .82rem; font-weight: 700; }
.in-app-browser-link-row { display: flex; gap: 8px; }
.in-app-browser-link-row input { flex: 1; min-width: 0; height: 44px; padding: 0 10px; color: #334155; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 10px; font-size: .78rem; }
.in-app-browser-copy { min-height: 44px; padding: 0 15px; color: #fff; background: #4f46e5; border: 0; border-radius: 10px; font-weight: 700; cursor: pointer; }
.in-app-browser-copy:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 2px; }
.in-app-browser-feedback { margin: 10px 0 0; color: #64748b; font-size: .8rem; line-height: 1.5; }

html[data-theme="dark"] body.logged-in .main-content .hero-section {
    color: #f8fafc !important;
    background: linear-gradient(135deg, rgba(35,43,75,.97), rgba(48,38,76,.95)) !important;
    border-color: rgba(165,180,252,.24) !important;
}
html[data-theme="dark"] body.logged-in .main-content .hero-section h1,
html[data-theme="dark"] body.logged-in .main-content .hero-section p { color: #f8fafc !important; }
html[data-theme="dark"] body.logged-in .main-content .badge-info,
html[data-theme="dark"] body.logged-in .main-content .badge-secondary { color: #c7d2fe !important; background: #292957 !important; border-color: #4b4b89 !important; }
html[data-theme="dark"] body.logged-in .main-content .badge-success { color: #a7f3d0 !important; background: #123b32 !important; border-color: #23634d !important; }
html[data-theme="dark"] body.logged-in .main-content .badge-warning { color: #fde68a !important; background: #493512 !important; border-color: #80601c !important; }
html[data-theme="dark"] body.logged-in .main-content .badge-danger { color: #fecaca !important; background: #4a2028 !important; border-color: #783341 !important; }
html[data-theme="dark"] .image-upload-dropzone { color: #dbe4f4 !important; background: #172033 !important; border-color: #64748b !important; }
html[data-theme="dark"] .image-upload-dropzone:hover,
html[data-theme="dark"] .image-upload-dropzone:focus-within { background: #202747 !important; border-color: #a5b4fc !important; }
html[data-theme="dark"] .image-upload-placeholder,
html[data-theme="dark"] .image-upload-placeholder strong { color: #e2e8f0 !important; }
html[data-theme="dark"] .image-upload-placeholder i,
html[data-theme="dark"] .image-upload-placeholder small { color: #b3bfd5 !important; }
html[data-theme="dark"] .image-upload-dropzone.has-image { background: #111827 !important; }

/* First-run coach marks keep the real page visible and point at the next action. */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 4100;
    overflow: hidden;
    pointer-events: none;
}
.onboarding-scrim { position: fixed; z-index: 1; background: rgba(15, 23, 42, .72); pointer-events: auto; }
.onboarding-tooltip {
    position: fixed;
    z-index: 2;
    pointer-events: auto;
    left: 12px;
    top: 12px;
    width: min(calc(100vw - 24px), 380px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 18px;
    color: var(--ops-ink);
    background: var(--ops-surface-strong);
    border: 1px solid var(--ops-line);
    border-radius: 18px;
    box-shadow: 0 24px 72px rgba(8, 15, 35, .3);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    backdrop-filter: blur(24px) saturate(150%);
}
.onboarding-tooltip::before { content: ''; position: absolute; z-index: 1; left: var(--arrow-x, 50%); width: 0; height: 0; transform: translateX(-50%); pointer-events: none; }
.onboarding-tooltip[data-placement="above"]::before { bottom: 0; border: 11px solid transparent; border-top-color: var(--ops-surface-strong); border-bottom: 0; }
.onboarding-tooltip[data-placement="below"]::before { top: 0; border: 11px solid transparent; border-bottom-color: var(--ops-surface-strong); border-top: 0; }
.onboarding-tooltip header,
.onboarding-tooltip footer,
.onboarding-tooltip footer > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.onboarding-kicker { color: var(--ops-accent); font-size: .84rem; font-weight: 750; letter-spacing: .02em; }
.onboarding-tooltip .icon-button { flex: 0 0 40px; width: 40px; height: 40px; color: var(--ops-ink); background: var(--ops-accent-soft); border: 1px solid var(--ops-line); border-radius: 12px; }
.onboarding-progress { height: 5px; margin: 10px 0 16px; overflow: hidden; background: rgba(100, 116, 139, .2); border-radius: 99px; }
.onboarding-progress span { display: block; height: 100%; background: linear-gradient(90deg, #5548d9, #9278ee); border-radius: inherit; transition: width .2s ease; }
.onboarding-tooltip h2 { margin: 0 0 8px; color: var(--ops-ink); font-size: clamp(1.1rem, 4vw, 1.35rem); line-height: 1.35; }
.onboarding-tooltip > p { margin: 0 0 16px; color: var(--ops-muted); line-height: 1.65; }
.onboarding-tooltip .onboarding-go { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; margin-bottom: 16px; }
.onboarding-tooltip footer { flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--ops-line); }
.onboarding-tooltip footer > div { justify-content: flex-end; }
.onboarding-tooltip footer .btn { width: auto !important; min-height: 42px; white-space: nowrap; flex: 0 0 auto; }
.onboarding-tooltip .text-action { min-height: 40px; padding: 8px 2px; color: var(--ops-muted); background: transparent; border: 0; font: inherit; cursor: pointer; }
.onboarding-tooltip :where(button, a):focus-visible { outline: 3px solid #8b80ff; outline-offset: 3px; }
.onboarding-tooltip button:hover,
.onboarding-tooltip .btn:hover,
.onboarding-launcher:hover { transform: none; }
.onboarding-highlight { outline: 3px solid #9b8cff !important; outline-offset: 3px; box-shadow: 0 0 0 2px rgba(255,255,255,.94), 0 0 24px rgba(120,101,255,.7) !important; }
.onboarding-launcher { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 1050; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 15px; color: #fff; background: #5548d9; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; box-shadow: 0 8px 26px rgba(53, 48, 143, .3); font: inherit; font-weight: 700; cursor: pointer; }
.onboarding-launcher[hidden] { display: none !important; }
html[data-theme="dark"] .onboarding-progress { background: rgba(203, 213, 225, .2); }
html[data-theme="dark"] .onboarding-launcher { color: #17142b; background: #c4baff; }

@media (max-width: 760px) {
    .image-upload-dropzone { width: min(100%, 224px); padding: 14px; }
    .task-submit-form .image-upload-dropzone { width: 120px; padding: 8px; }
    .in-app-browser-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .in-app-browser-copy { padding-inline: 12px; }
    .onboarding-tooltip { padding: 16px; border-radius: 16px; }
    .onboarding-tooltip footer { align-items: center; }
    .onboarding-tooltip footer > div { flex-wrap: nowrap; flex: 0 0 auto; }
    .onboarding-launcher { right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); }
}
