/* ============================================
   CHECKLIST APP - Dark theme
   Black, gold and white, matching the iOS app's dark mode (AppTheme.swift):
   pure black page, #111 cards with gold outlines, gold accent with black type.
   Applied when <html data-theme="dark">; js/theme_boot.js sets that from the
   System / Light / Dark switch in the sidebar (System follows the computer).
   ============================================ */

:root[data-theme="dark"] {
  color-scheme: dark;

  /* Backgrounds */
  --bg-main: #000000;
  --bg-sidebar: #0a0a0a;
  --bg-card: #111111;
  --bg-hover: #1c1c1c;

  /* Lines: dividers stay grey, container outlines go gold */
  --border-light: #2c2c2c;
  --border-medium: #474747;
  --box-border: rgba(212, 175, 55, 0.65);
  --box-border-strong: rgba(212, 175, 55, 0.65);

  /* Accent: gold, with black type on a gold fill */
  --accent: #d4af37;
  --accent-hover: #e6c65a;
  --accent-light: rgba(212, 175, 55, 0.14);
  --on-accent: #000000;
  --on-success: #06170f;

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #b5b5b5;
  --text-muted: #8a8a8a;

  /* Priority and status, lifted to read on black */
  --priority-high: #ec5a3e;
  --priority-med: #ff9a3c;
  --priority-low: #ffc13c;
  --status-success: #3fb282;
  --status-pending: #ff9a3c;
  --status-denied: #ec5a3e;

  /* Shadows: black, and stronger, since they sit on black */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.75);

  /* Component colours (light value in the name; see theme.css) */
  --accent-a03: rgba(212, 175, 55, 0.05);
  --accent-a06: rgba(212, 175, 55, 0.11);
  --accent-a08: rgba(212, 175, 55, 0.14);
  --accent-a12: rgba(212, 175, 55, 0.22);
  --accent-a14: rgba(212, 175, 55, 0.25);
  --accent-a16: rgba(212, 175, 55, 0.29);
  --accent-a18: rgba(212, 175, 55, 0.32);
  --accent-a35: rgba(212, 175, 55, 0.5);
  --bd-000000: #5a5a5a;
  --bd-006644: #4ce6b2;
  --bd-172b4d: rgba(212, 175, 55, 0.5);
  --bd-253858: #5a5a5a;
  --bd-333333: #5a5a5a;
  --bd-6b21a8: #a054de;
  --bd-974f0c: #e6964c;
  --bd-97a0af: #5a5a5a;
  --bd-9aa5b8: #5a5a5a;
  --bd-a5adba: #5a5a5a;
  --bd-abf5d1: #216343;
  --bd-bfe3cf: #474747;
  --bd-c3d3ea: #474747;
  --bd-c45000: #e68b4c;
  --bd-c9d7ec: rgba(212, 175, 55, 0.4);
  --bd-d1d5db: #474747;
  --bd-e1e6ee: #333333;
  --bd-ebecf0: #262626;
  --bd-f0dfb8: #634f21;
  --bd-f0f1f4: #262626;
  --bd-f0f2f6: #262626;
  --bd-f1f2f4: #262626;
  --bd-f3d6cf: #632e21;
  --bd-f3d78a: #635221;
  --bd-f3d9a4: #634e21;
  --bd-f4f5f7: #262626;
  --bd-f5b5a6: #632e21;
  --bd-f5c2c0: #632421;
  --bd-f6f7f8: #262626;
  --bd-f6f7fa: #262626;
  --bd-fbd7d0: #632c21;
  --bd-fdebd3: #634721;
  --bd-ffbdad: #632e21;
  --bd-ffd79a: #634921;
  --bd-ffd8a8: #634621;
  --bd-ffe08a: #635221;
  --bd-ffe380: #635521;
  --bd-ffe8a3: #635321;
  --bd-ffffff: #111111;
  --bg-006644: #13ae7b;
  --bg-0b0f19: #2a2a2a;
  --bg-12294e: #1c1c1c;
  --bg-172b4d: #1c1c1c;
  --bg-1c3c70: #1c1c1c;
  --bg-253858: #2a2a2a;
  --bg-2f5695: #1c1c1c;
  --bg-42526e: #2a2a2a;
  --bg-4a5b78: #4a4a4a;
  --bg-5b7fbf: #d4af37;
  --bg-6b7280: #4a4a4a;
  --bg-8b2500: #ae3d13;
  --bg-9aa3b0: #3a3a3a;
  --bg-aab2be: #3a3a3a;
  --bg-bcd1f1: rgba(212, 175, 55, 0.14);
  --bg-bfe0cf: #2c2c2c;
  --bg-c1c7d0: #2c2c2c;
  --bg-c3b5eb: #1b1629;
  --bg-c7d4e6: #2c2c2c;
  --bg-d9efe4: #19261f;
  --bg-dbe4f1: rgba(212, 175, 55, 0.14);
  --bg-dbeafe: rgba(212, 175, 55, 0.14);
  /* In progress: gold, like every accent in dark */
  --bg-e3eefb: rgba(212, 175, 55, 0.18);
  --bg-f1f6fd: rgba(212, 175, 55, 0.10);
  --bd-cfe1f6: rgba(212, 175, 55, 0.45);
  --fg-1f5f99: #e6c65a;
  --fg-174a7c: #efe2b4;
  --bg-dcfce7: #122d1b;
  --bg-dfe1e6: #1c1c1c;
  --bg-dfe7f2: rgba(212, 175, 55, 0.14);
  --bg-e3ebf8: rgba(212, 175, 55, 0.14);
  --bg-e3f5ec: #18271f;
  --bg-e3fcef: #122d1f;
  --bg-e4ebf6: rgba(212, 175, 55, 0.14);
  --bg-e4edfb: rgba(212, 175, 55, 0.14);
  --bg-e6effa: rgba(212, 175, 55, 0.14);
  --bg-e7eaf0: #1c1c1c;
  --bg-e7f1ea: #1c1c1c;
  --bg-e8eef7: rgba(212, 175, 55, 0.14);
  --bg-e8eef8: rgba(212, 175, 55, 0.14);
  --bg-ece5ff: #19122d;
  --bg-ede9fe: #17122d;
  --bg-edf2fa: rgba(212, 175, 55, 0.14);
  --bg-edf2fc: rgba(212, 175, 55, 0.14);
  --bg-eef0f3: #1c1c1c;
  --bg-eef1f5: #1c1c1c;
  --bg-eef1f6: #1c1c1c;
  --bg-eef2f8: rgba(212, 175, 55, 0.14);
  --bg-eef3fa: rgba(212, 175, 55, 0.14);
  --bg-f0f1f3: #1c1c1c;
  --bg-f1e2dd: #261c18;
  --bg-f1edf9: #1d1728;
  --bg-f1f2f4: #1c1c1c;
  --bg-f1f4f9: rgba(212, 175, 55, 0.14);
  --bg-f1f5f9: rgba(212, 175, 55, 0.14);
  --bg-f2faf5: #18271d;
  --bg-f3cfa6: #2c2013;
  --bg-f3d78a: #2d2612;
  --bg-f3e8ff: #1f122d;
  --bg-f3f7fc: rgba(212, 175, 55, 0.14);
  --bg-f3fcf7: #15291e;
  --bg-f4f7fb: #161616;
  --bg-f5f8fd: rgba(212, 175, 55, 0.14);
  --bg-f6f7f9: #161616;
  --bg-f6f9fd: rgba(212, 175, 55, 0.14);
  --bg-f7e6e1: #291a16;
  --bg-f7f8f9: #161616;
  --bg-f7f8fa: #161616;
  --bg-f7f9fc: #161616;
  --bg-f8fafc: #161616;
  --bg-f9fafb: #161616;
  --bg-faf7ff: #1c122d;
  --bg-fafbfc: #161616;
  --bg-fafbfd: #161616;
  --bg-fbe8d2: #2d2012;
  --bg-fbfcfd: #161616;
  --bg-fcfdfe: #161616;
  --bg-fdeae4: #2d1812;
  --bg-fdecea: #2d1512;
  --bg-fdf3f2: #2c1513;
  --bg-fdfbf6: #2a2415;
  --bg-fee2e2: #2d1212;
  --bg-fef3c7: #2d2712;
  --bg-ffe7a3: #2d2612;
  --bg-ffe8cc: #2d2112;
  --bg-ffead1: #2d2012;
  --bg-ffebe6: #2d1712;
  --bg-fff0a6: #2d2812;
  --bg-fff1ee: #2d1712;
  --bg-fff3dc: #2d2412;
  --bg-fff3e2: #2d2212;
  --bg-fff4d6: #2d2612;
  --bg-fff4e5: #2d2112;
  --bg-fff5f2: #2d1812;
  --bg-fff5f5: #2d1212;
  --bg-fff7e6: #2d2412;
  --bg-fff8e6: #2d2512;
  --bg-fff8f0: #2d2012;
  --bg-fff8f6: #2d1812;
  --bg-fff9ec: #2d2412;
  --bg-fffae6: #2d2712;
  --bg-fffaeb: #2d2612;
  --bg-fffaf2: #2d2212;
  --bg-fffaf9: #2d1612;
  --bg-fffbeb: #2d2712;
  --box-bfe3cf: rgba(212, 175, 55, 0.65);
  --box-d8c2f5: rgba(212, 175, 55, 0.65);
  --box-ebecf0: rgba(212, 175, 55, 0.65);
  --box-f3d6cf: rgba(212, 175, 55, 0.65);
  --box-f5c2c7: rgba(212, 175, 55, 0.65);
  --fg-006644: #68f3c5;
  --fg-0b6b3a: #6bf0ac;
  --fg-101b32: #ffffff;
  --fg-111111: #ffffff;
  --fg-166534: #79e2a1;
  --fg-16a34a: #6fec9d;
  --fg-1b3665: #e6c65a;
  --fg-1d3a66: #e6c65a;
  --fg-1d4ed8: #6f90ec;
  --fg-1e3a5f: #e6c65a;
  --fg-1e40af: #c8a845;
  --fg-24406f: #e6c65a;
  --fg-2563eb: #6a94f1;
  --fg-344563: #d6d6d6;
  --fg-36b37e: #82d9b4;
  --fg-3b1c6e: #a27dde;
  --fg-3e4a5f: #d6d6d6;
  --fg-3e63a0: #c8a845;
  --fg-3f7a59: #93c7aa;
  --fg-42526e: #d6d6d6;
  --fg-5243aa: #948ad1;
  --fg-56617a: #d6d6d6;
  --fg-5b79ad: #c8a845;
  --fg-5c3d00: #f3c468;
  --fg-5e3db3: #9c85d6;
  --fg-5e7aa6: #c8a845;
  --fg-64748b: #b5b5b5;
  --fg-6b21a8: #b377e4;
  --fg-6b4f00: #f3ce68;
  --fg-6b4fbb: #9c89d2;
  --fg-6b7280: #b5b5b5;
  --fg-6d28d9: #a174e6;
  --fg-7a4b00: #f3bd68;
  --fg-7a5b00: #f3d068;
  --fg-7a869a: #b5b5b5;
  --fg-7c3aed: #9c69f1;
  --fg-8a1c14: #ea7970;
  --fg-8a5a00: #f3c368;
  --fg-8a6100: #f3ca68;
  --fg-8a6a20: #e0c27b;
  --fg-92400e: #f19d6a;
  --fg-946f00: #f3d068;
  --fg-974f0c: #f3ab68;
  --fg-98a0ae: #8f8f8f;
  --fg-991b1b: #e77474;
  --fg-a54800: #f3a568;
  --fg-a5adba: #8f8f8f;
  --fg-a7aebc: #8f8f8f;
  --fg-a8321c: #e88573;
  --fg-a8452f: #db907f;
  --fg-b07a3a: #d7b184;
  --fg-b0b7c3: #6a6a6a;
  --fg-b3bac5: #6a6a6a;
  --fg-b42318: #ec786f;
  --fg-b45309: #f3a468;
  --fg-b62c0b: #f38368;
  --fg-b65c02: #f3ad68;
  --fg-b6bdc8: #6a6a6a;
  --fg-b7791f: #e7b873;
  --fg-b8860b: #f3cb68;
  --fg-b91c1c: #ea7171;
  --fg-bf2600: #f38468;
  --fg-c1c7d0: #6a6a6a;
  --fg-c23a18: #ed876e;
  --fg-c25100: #f3a268;
  --fg-c2c8d2: #6a6a6a;
  --fg-c45000: #f3a168;
  --fg-c8cdd6: #6a6a6a;
  --fg-c9cfd9: #6a6a6a;
  --fg-ccd2da: #6a6a6a;
  --fg-d97706: #f3b268;
  --fg-dc2626: #e87272;
  --fg-eef0f3: #555555;
  --glass-a85: rgba(17, 17, 17, 0.85);
  --glass-a92: rgba(17, 17, 17, 0.92);
  --glass-a95: rgba(17, 17, 17, 0.95);
  --sh-333333: #000000;
  --sh-b9cbe8: #000000;
  --sh-ffffff: #000000;
}

/* ---------- Dark-only touches ---------- */

/* Appearance switch: the chosen segment in gold */
:root[data-theme="dark"] .theme-seg button.on {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.45);
}

/* Today: gold progress, like the app's progress card */
:root[data-theme="dark"] .td-day-bar i { background: var(--accent); }
:root[data-theme="dark"] .td-day.gold { border-color: rgba(255, 193, 7, 0.55); background: rgba(255, 193, 7, 0.08); }
:root[data-theme="dark"] .td-day.gold .td-day-bar i { background: #ffc107; }
:root[data-theme="dark"] .td-day-star.on { color: #ffc107; }

/* Green "done / approve" fills are lighter in dark, so their type turns dark */
:root[data-theme="dark"] .apx-btn.is-approve,
:root[data-theme="dark"] .mr-done-btn,
:root[data-theme="dark"] .ops-mr-done { color: #06170f; }
:root[data-theme="dark"] .apx-btn.is-approve .apx-k { color: #06170f; border-color: rgba(0, 0, 0, 0.35); background: rgba(0, 0, 0, 0.1); }

/* Dashboard day tiles: the label strip sits on gold */
:root[data-theme="dark"] .dash-tile small { color: var(--on-accent); }
:root[data-theme="dark"] .dash-col.gold .dash-tile small { background: #ffc107; }

/* Calendar Organizer: a person's colour as text is lifted to read on black */
:root[data-theme="dark"] .org-person.on .n { color: color-mix(in srgb, var(--c) 55%, #ffffff); }

/* Today › Needs attention: an amber outline on near-black, as in the app */
:root[data-theme="dark"] .td-attn { background: rgba(245, 165, 36, 0.05); border-color: rgba(245, 165, 36, 0.4); }
:root[data-theme="dark"] .td-attn-head:hover,
:root[data-theme="dark"] .td-attn .ops-checklist-item:hover { background: rgba(245, 165, 36, 0.08); }
:root[data-theme="dark"] .td-attn-body,
:root[data-theme="dark"] .td-attn .ops-checklist-item { border-color: rgba(245, 165, 36, 0.18); }

/* Floating surfaces (modals, drawers, popovers, menus) get the app's gold card
   edge; an outline keeps their own shadows and layout untouched. */
:root[data-theme="dark"] :is(.fs-modal-card, .modal-card, .link-modal, .oi-modal, .ops-detail-modal,
  .mu-drawer, .color-picker-popover, .mr-sort-menu, .ops-locfilter-pop, .st-loc-pop, .antitodos-menu,
  .ops-nextdue-pop, .org-tip, .org-toast) {
  outline: 1px solid rgba(212, 175, 55, 0.65);
  outline-offset: -1px;
}
/* Calendar: the done tick's mark on the lighter dark-theme green */
:root[data-theme="dark"] .org-chip .tick { color: #000; }
:root[data-theme="dark"] .org-chip[draggable="true"]:hover .title,
:root[data-theme="dark"] .org-dragcard { color: color-mix(in srgb, var(--c, var(--accent)) 55%, #ffffff); }
