/* ---- theme toggle button ---- */
#theme-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;
  padding:0;border-radius:50%;background:#2a2a2a;border:1.5px solid #555;color:#e0e0e0;
  font-size:15px;line-height:1;cursor:pointer;flex-shrink:0;vertical-align:middle;}
#theme-btn:active{background:#3a3a3a;}
nav #theme-btn,.nav #theme-btn{margin-left:6px;}
[data-theme="light"] #theme-btn{background:#ffffff;border-color:#c4c8d0;color:#1c1e21;}

/* ---- toggle placement (far right, both themes) ---- */
.theme-slot{display:inline-flex;align-items:center;}
nav{display:flex;align-items:center;}
nav .theme-slot{margin-left:auto;}
.bar .nav{margin-right:auto;}

/* ---- light theme overrides ---- */
[data-theme="light"] body{background:#f4f5f7;color:#1c1e21;}
[data-theme="light"] input,[data-theme="light"] textarea,[data-theme="light"] select{
  background:#ffffff;color:#1c1e21;border-color:#c4c8d0;}
[data-theme="light"] ::placeholder{color:#9aa0ab;}
[data-theme="light"] #filter{background:#ffffff;color:#1c1e21;border-color:#c4c8d0;}
[data-theme="light"] #query{background:#ffffff;color:#1c1e21;border-color:#c4c8d0;}
[data-theme="light"] #saveTitle,[data-theme="light"] #saveNote,[data-theme="light"] #posInput{
  background:#ffffff;color:#1c1e21;border-color:#c4c8d0;}

/* rapporter */
[data-theme="light"] th{background:#eef0f3;color:#d35400;border-bottom-color:#c4c8d0;}
[data-theme="light"] th:hover{background:#e3e6ec;}
[data-theme="light"] td{border-bottom-color:#e2e5ea;}
[data-theme="light"] tr.data-row.stripe td{background:#eef1f5;}
[data-theme="light"] tr.data-row:hover td{background:#e6ebf4;}
[data-theme="light"] tr.data-row.expanded td{background:#e8f3e8;}
[data-theme="light"] .detail{background:#e8f3e8;border-bottom-color:#9cc79c;}
[data-theme="light"] .field-value{color:#1c1e21;}
[data-theme="light"] .field-value.coords{color:#1565c0;}
[data-theme="light"] .stale-filter{color:#33373e;}
[data-theme="light"] .count{color:#6a6f7a;}
[data-theme="light"] .empty{color:#9aa0ab;}

/* form */
[data-theme="light"] .qty-btn{background:#ffffff;color:#1c1e21;border-color:#c4c8d0;}
[data-theme="light"] .qty-btn.selected{background:#ffe9d6;color:#d35400;border-color:#ff6600;}
[data-theme="light"] .mgrs-field{color:#1565c0;}
[data-theme="light"] .mgrs-field:read-only{background:#eef0f3;}
[data-theme="light"] .footer{background:#f4f5f7;border-top-color:#d6d9e0;}
[data-theme="light"] .status.ok{background:#e3f6e3;color:#2e7d32;}
[data-theme="light"] .status.err{background:#fbe3e3;color:#c62828;}
[data-theme="light"] .icon-btn,[data-theme="light"] .gps-btn,[data-theme="light"] .manual-use{
  background:#eceef2;border-color:#c4c8d0;}
[data-theme="light"] .nav-btn{background:#ffffff;}
[data-theme="light"] .chip{background:#ffffff;border-color:#c4c8d0;color:#1c1e21;}
[data-theme="light"] .chip.selected{background:#ffe9d6;border-color:#ff6600;}
[data-theme="light"] .chip-dot{border-color:#b0b4be;}

/* analys */
[data-theme="light"] .sticky-top{background:#f4f5f7;border-bottom-color:#d6d9e0;}
[data-theme="light"] .preset-btn{background:#ffffff;color:#33373e;border-color:#c4c8d0;}
[data-theme="light"] .preset-btn:active{background:#eceef2;}
[data-theme="light"] .conv-q{background:#e9eff7;color:#445;}
[data-theme="light"] .conv-a{background:#ffffff;border-color:#d6d9e0;color:#26282c;}
[data-theme="light"] .conv-a a{color:#c2521a;}
[data-theme="light"] .conv-a th{background:#eef0f3;color:#c2521a;}
[data-theme="light"] .conv-a th,[data-theme="light"] .conv-a td{border-color:#c4c8d0;}
[data-theme="light"] .save-panel{background:#eef2f8;border-color:#c9d4e2;}
[data-theme="light"] #saveBtn{background:#ffffff;}
[data-theme="light"] #clear,[data-theme="light"] #saveCancel{background:#ffffff;color:#5a5f6a;}
[data-theme="light"] .followup-preset{background:#ffffff;color:#c2521a;}
[data-theme="light"] .followup textarea{background:#ffffff;}
[data-theme="light"] .followup button{background:#eceef2;border-color:#c4c8d0;}

/* analyser */
[data-theme="light"] .top{background:#f4f5f7;border-bottom-color:#d6d9e0;}
[data-theme="light"] .card{background:#ffffff;border-color:#d6d9e0;}
[data-theme="light"] .card:nth-child(even){background:#f0f2f6;}
[data-theme="light"] .card h2{color:#c2521a;}
[data-theme="light"] .card .meta{color:#6a6f7a;}
[data-theme="light"] .card .note{color:#33373e;}
[data-theme="light"] .btn-open{background:#ffffff;}
[data-theme="light"] .btn-pdf{background:#ffffff;color:#c2521a;border-color:#c4c8d0;}
[data-theme="light"] .btn-del{background:#ffffff;color:#b33;border-color:#e0b0b0;}

/* analys_view (screen) */
[data-theme="light"] .bar{background:#f4f5f7;border-bottom-color:#d6d9e0;}
[data-theme="light"] .doc-head .meta{color:#5a5f6a;}
[data-theme="light"] .doc-note{background:#eef2f8;color:#33373e;}
[data-theme="light"] .qa .q{color:#c2521a;}
[data-theme="light"] .qa .a{color:#26282c;}
[data-theme="light"] .qa .a a{color:#c2521a;}
[data-theme="light"] .qa + .qa{border-top-color:#d6d9e0;}
[data-theme="light"] .rep{border-color:#d6d9e0;}
[data-theme="light"] .rep:nth-child(even){background:#f0f2f6;}
[data-theme="light"] .rep .rh{color:#c2521a;}
[data-theme="light"] .rep .rf{color:#444;}
[data-theme="light"] .rep .rf b{color:#222;}

/* nav links readable on light */
[data-theme="light"] nav a,[data-theme="light"] .nav a{background:#ffffff;}