/* MARK OS V1.0 unified prototype — dark-mode compatibility only.
 * Loaded after every module stylesheet. Light mode remains unchanged.
 */

/* Shared Shell details */
html[data-theme="dark"] .prototype-tag,
html[data-theme="dark"] .group-title,
html[data-theme="dark"] .profile-email,
html[data-theme="dark"] .subpage-note,
html[data-theme="dark"] .demo-footnote { color:var(--muted); }
html[data-theme="dark"] .row-icon { color:var(--blue-ink); }
html[data-theme="dark"] .toast { background:#dbe8fb;color:#101b2b; }

/* My Income and shared calendar/location controls */
html[data-theme="dark"] .income-calendar,
html[data-theme="dark"] .income-calendar-slot .income-calendar,
html[data-theme="dark"] .income-input-panel,
html[data-theme="dark"] .income-records,
html[data-theme="dark"] .income-date-bracket .income-source-group,
html[data-theme="dark"] .income-export-page fieldset,
html[data-theme="dark"] .income-dialog { background:var(--white);border-color:var(--line);color:var(--ink); }
html[data-theme="dark"] .income-location:not(.selected),
html[data-theme="dark"] .income-kind-tabs button[aria-pressed="true"],
html[data-theme="dark"] .income-entry-context select { background:var(--white);border-color:var(--line);color:var(--muted); }
html[data-theme="dark"] .income-kind-tabs,
html[data-theme="dark"] .income-amount,
html[data-theme="dark"] .income-filter-choices label,
html[data-theme="dark"] .income-old-version { background:#0c1625;border-color:var(--line); }
html[data-theme="dark"] .income-source-group h3,
html[data-theme="dark"] .income-record-group h3 { background:#172236;color:#b5c5da; }
html[data-theme="dark"] .income-day { color:var(--ink); }
html[data-theme="dark"] .income-calendar-tools button,
html[data-theme="dark"] .income-calendar-bottom,
html[data-theme="dark"] .income-calendar-bottom button,
html[data-theme="dark"] .income-weekdays,
html[data-theme="dark"] .income-day small,
html[data-theme="dark"] .income-day.outside strong,
html[data-theme="dark"] .income-location:not(.selected),
html[data-theme="dark"] .income-entry-context,
html[data-theme="dark"] .income-record-copy>span,
html[data-theme="dark"] .income-record-scope,
html[data-theme="dark"] .income-totals span,
html[data-theme="dark"] .income-history,
html[data-theme="dark"] .all-records-caption,
html[data-theme="dark"] .export-demo-notice,
html[data-theme="dark"] .export-wage-note,
html[data-theme="dark"] .export-result-count,
html[data-theme="dark"] .income-history-option,
html[data-theme="dark"] .income-time-mode,
html[data-theme="dark"] .income-date-inputs label { color:var(--muted); }
html[data-theme="dark"] .income-record-copy>strong,
html[data-theme="dark"] .income-page-header h1,
html[data-theme="dark"] .income-section-heading h2,
html[data-theme="dark"] .income-today-heading h2,
html[data-theme="dark"] .income-dialog h2 { color:var(--ink); }
html[data-theme="dark"] .income-record-value>strong.revenue,
html[data-theme="dark"] .income-totals>div+div strong { color:#b8c9e0; }
html[data-theme="dark"] .income-date-inputs input,
html[data-theme="dark"] .income-dialog input,
html[data-theme="dark"] .income-dialog textarea { background:#0c1625;border-color:var(--line);color:var(--ink); }
html[data-theme="dark"] .income-note-field input { color:#b9c8db;border-color:var(--line); }
html[data-theme="dark"] .income-record,
html[data-theme="dark"] .income-item+.income-item,
html[data-theme="dark"] .income-totals { border-color:var(--line); }
html[data-theme="dark"] .income-record.editable:active { background:#172a47; }

/* Today's Work */
html[data-theme="dark"] .tw-work-panel,
html[data-theme="dark"] .tw-record-panel,
html[data-theme="dark"] .tw-card,
html[data-theme="dark"] .tw-record-row,
html[data-theme="dark"] .tw-detail-section,
html[data-theme="dark"] .tw-dialog { background:var(--white);border-color:var(--line);color:var(--ink); }
html[data-theme="dark"] .tw-card:active { background:#172a47; }
html[data-theme="dark"] .tw-record-group h3,
html[data-theme="dark"] .tw-audit p,
html[data-theme="dark"] .tw-overall,
html[data-theme="dark"] .tw-professional { background:#172236;border-color:var(--line); }
html[data-theme="dark"] .tw-card-top>strong,
html[data-theme="dark"] .tw-record-row strong,
html[data-theme="dark"] .tw-section-heading h2,
html[data-theme="dark"] .tw-detail-header h1,
html[data-theme="dark"] .tw-detail-section>h2,
html[data-theme="dark"] .tw-detail-client strong,
html[data-theme="dark"] .tw-dialog h2 { color:var(--ink); }
html[data-theme="dark"] .tw-day-summary,
html[data-theme="dark"] .tw-day-summary>span:first-child,
html[data-theme="dark"] .tw-card-service,
html[data-theme="dark"] .tw-card-service>span,
html[data-theme="dark"] .tw-payment-summary,
html[data-theme="dark"] .tw-record-row>time,
html[data-theme="dark"] .tw-record-row small,
html[data-theme="dark"] .tw-section-heading>small,
html[data-theme="dark"] .tw-event-number,
html[data-theme="dark"] .tw-event-number span,
html[data-theme="dark"] .tw-detail-client p,
html[data-theme="dark"] .tw-detail-section dt,
html[data-theme="dark"] .tw-pay-history,
html[data-theme="dark"] .tw-audit,
html[data-theme="dark"] .tw-dialog-context,
html[data-theme="dark"] .tw-dialog label,
html[data-theme="dark"] .tw-detail-footnote { color:var(--muted); }
html[data-theme="dark"] .tw-card-top time,
html[data-theme="dark"] .tw-detail-section dd,
html[data-theme="dark"] .tw-payment-totals strong,
html[data-theme="dark"] .tw-pay-history strong { color:#b8c9e0; }
html[data-theme="dark"] .tw-payment-heading>strong { color:#9ac0ff; }
html[data-theme="dark"] .tw-payment-heading>span { color:#b8c9e0;border-color:var(--line); }
html[data-theme="dark"] .tw-status.upcoming { background:#3a3019;color:#f5d77d; }
html[data-theme="dark"] .tw-status.working { background:#153328;color:#8ee1bd; }
html[data-theme="dark"] .tw-status.completed,
html[data-theme="dark"] .tw-overall.closed { background:#162b4e;color:#9ac0ff; }
html[data-theme="dark"] .tw-detail-section dl>div,
html[data-theme="dark"] .tw-record-row,
html[data-theme="dark"] .tw-pay-history p,
html[data-theme="dark"] .tw-payment-totals>div+div { border-color:var(--line); }
html[data-theme="dark"] .tw-detail-section textarea,
html[data-theme="dark"] .tw-dialog input,
html[data-theme="dark"] .tw-dialog textarea,
html[data-theme="dark"] .tw-dialog select { background:#0c1625;border-color:var(--line);color:var(--ink); }

/* Team daily work and schedule */
html[data-theme="dark"] .team-schedule,
html[data-theme="dark"] .team-schedule .sch-header,
html[data-theme="dark"] .team-count,
html[data-theme="dark"] .team-day-count,
html[data-theme="dark"] .team-plan-cell,
html[data-theme="dark"] .team-person-tile:not(.selected):not(.team-first),
html[data-theme="dark"] .team-space-empty,
html[data-theme="dark"] .team-dialog { background:var(--white);border-color:var(--line);color:var(--ink); }
html[data-theme="dark"] .team-date-row,
html[data-theme="dark"] .team-week-arrow,
html[data-theme="dark"] .team-dialog-heading>button,
html[data-theme="dark"] .team-picker-name { background:#172236;border-color:var(--line); }
html[data-theme="dark"] .team-store-name,
html[data-theme="dark"] .team-person-tile:not(.selected),
html[data-theme="dark"] .team-day-count,
html[data-theme="dark"] .team-picker-name { color:#b8c9e0; }
html[data-theme="dark"] .team-schedule .sch-header-top h2,
html[data-theme="dark"] .team-schedule .sch-week-center>strong,
html[data-theme="dark"] .team-section-title h2,
html[data-theme="dark"] .team-person-heading h1,
html[data-theme="dark"] .team-dialog h2 { color:var(--ink); }
html[data-theme="dark"] .team-date>span,
html[data-theme="dark"] .team-axis,
html[data-theme="dark"] .team-week-state,
html[data-theme="dark"] .team-inherited,
html[data-theme="dark"] .team-board-footer,
html[data-theme="dark"] .team-section-title h2 small,
html[data-theme="dark"] .team-section-title>span,
html[data-theme="dark"] .team-demo-note,
html[data-theme="dark"] .team-person-heading h1 span,
html[data-theme="dark"] .team-dialog p,
html[data-theme="dark"] .team-dialog label,
html[data-theme="dark"] .team-dialog h3 { color:var(--muted); }
html[data-theme="dark"] .team-store-row,
html[data-theme="dark"] .team-store-name,
html[data-theme="dark"] .team-count,
html[data-theme="dark"] .team-single-day,
html[data-theme="dark"] .team-plan-cell,
html[data-theme="dark"] .team-board-footer,
html[data-theme="dark"] .team-date-row { border-color:var(--line); }
html[data-theme="dark"] .team-name-tag,
html[data-theme="dark"] .team-picker-name.selected { background:#162b4e;border-color:#294a78;color:#9ac0ff; }
html[data-theme="dark"] .is-historical .team-name-tag { background:#1b2739;border-color:var(--line);color:#8291a7; }
html[data-theme="dark"] .is-historical .team-plan-marker { background:#5d6879; }
html[data-theme="dark"] .team-dialog input { background:#0c1625;border-color:var(--line);color:var(--ink); }

/* Team management, owned/joined Teams and related dialogs */
html[data-theme="dark"] .rel-head,
html[data-theme="dark"] .rel-card,
html[data-theme="dark"] .rel-preset,
html[data-theme="dark"] .rel-location:not(.add),
html[data-theme="dark"] .rel-person:not(.add),
html[data-theme="dark"] .rel-tab:not(.active),
html[data-theme="dark"] .rel-schedule,
html[data-theme="dark"] .rel-kpi div,
html[data-theme="dark"] .rel-check,
html[data-theme="dark"] .rel-modal { background:var(--white);border-color:var(--line);color:var(--ink); }
html[data-theme="dark"] .rel-field input,
html[data-theme="dark"] .rel-field select,
html[data-theme="dark"] .rel-field textarea { background:#0c1625;border-color:var(--line);color:var(--ink); }
html[data-theme="dark"] .rel-head h1,
html[data-theme="dark"] .rel-card-copy strong,
html[data-theme="dark"] .rel-identity-copy strong,
html[data-theme="dark"] .rel-location strong,
html[data-theme="dark"] .rel-row-main strong,
html[data-theme="dark"] .rel-status-line strong,
html[data-theme="dark"] .rel-shift strong,
html[data-theme="dark"] .rel-modal h2 { color:var(--ink); }
html[data-theme="dark"] .rel-card-copy small,
html[data-theme="dark"] .rel-location small,
html[data-theme="dark"] .rel-row-main small,
html[data-theme="dark"] .rel-help,
html[data-theme="dark"] .rel-section-title span,
html[data-theme="dark"] .rel-field,
html[data-theme="dark"] .rel-management-note,
html[data-theme="dark"] .rel-history,
html[data-theme="dark"] .rel-modal p { color:var(--muted); }
html[data-theme="dark"] .rel-secondary { background:var(--white);border-color:var(--line);color:#b8c9e0; }
html[data-theme="dark"] .rel-danger { background:var(--white);border-color:#55313b;color:#ff9bad; }
html[data-theme="dark"] .rel-demo,
html[data-theme="dark"] .rel-permission { background:#172236;color:#aebdd2; }
html[data-theme="dark"] .rel-pill { background:#1b2739;color:#b1bfd2; }
html[data-theme="dark"] .rel-pill.blue { background:#162b4e;color:#9ac0ff; }
html[data-theme="dark"] .rel-pill.yellow { background:#3a3019;color:#f5d77d; }
html[data-theme="dark"] .rel-pill.gray { background:#252d38;color:#adb8c8; }
html[data-theme="dark"] .rel-pill.green,
html[data-theme="dark"] .rel-switch.on { background:#153328;color:#8ee1bd; }
html[data-theme="dark"] .rel-switch { background:#252f3e;color:#aebbd0; }
html[data-theme="dark"] .rel-avatar { background:#162b4e;color:#9ac0ff; }
html[data-theme="dark"] .rel-avatar.restaurant { background:#3c2a18;color:#ffc985; }
html[data-theme="dark"] .rel-person i { background:#162b4e;color:#9ac0ff; }
html[data-theme="dark"] .rel-person.probation i { background:#3a3019;color:#f5d77d; }
html[data-theme="dark"] .rel-person.inactive i { background:#252d38;color:#adb8c8; }
html[data-theme="dark"] .rel-day,
html[data-theme="dark"] .rel-week,
html[data-theme="dark"] .rel-shift,
html[data-theme="dark"] .rel-row { border-color:var(--line); }
html[data-theme="dark"] .rel-day { color:#a9b8cc; }
html[data-theme="dark"] .rel-day b { color:#b8c9e0; }
html[data-theme="dark"] .rel-actual { background:#352c19;border-left-color:#d5a531; }
html[data-theme="dark"] .rel-actual b { color:#f1cf71; }
html[data-theme="dark"] .rel-actual p { color:#d8c89a; }
html[data-theme="dark"] .rel-kpi b { color:#9ac0ff; }
html[data-theme="dark"] .rel-kpi span { color:var(--muted); }
html[data-theme="dark"] .rel-check.selected { background:#162b4e;border-color:#294a78;color:#9ac0ff; }

/* Me, Files, Settings and About: complete the existing Stage 1 dark rules */
html[data-theme="dark"] .me-field>span,
html[data-theme="dark"] .me-demo-pill { color:var(--muted); }
html[data-theme="dark"] .me-demo-pill { background:#1b2739; }
html[data-theme="dark"] .me-value,
html[data-theme="dark"] .me-identity { border-color:var(--line); }
html[data-theme="dark"] .me-connection-status>span { box-shadow:0 0 0 5px #153328; }

/* Native and module dialogs */
html[data-theme="dark"] .income-dialog::backdrop,
html[data-theme="dark"] .tw-dialog::backdrop,
html[data-theme="dark"] .team-dialog::backdrop,
html[data-theme="dark"] .rel-modal::backdrop { background:#000a; }
