/* Graphite refinement: separate surfaces, strong states, functional accents. */
html[data-palette="2"]{--canvas:#10151d!important;--surface:#1c2531!important;--stripe:#232e3c!important;--input:#101822!important;--line:#415167!important;--ink:#edf3fa!important;--muted:#b2bfd0!important;--accent:#70dbe3!important;--tint:#243e49!important;--selected:#244351!important;--function:#70dbe3;--function-soft:#203c46;color-scheme:dark}
html[data-palette="2"] .sidebar{background:#18212c;border-bottom-color:#3a485a}
html[data-palette="2"] .palette-bar,html[data-palette="2"] header{background:#151e28}
html[data-palette="2"] .panel{box-shadow:0 5px 20px #0002}
html[data-palette="2"] .resource-summary{background:linear-gradient(110deg,#24313e,#1b2531);border-color:#495b70}
html[data-palette="2"] .resource-summary b{color:#e8f2fc}
html[data-palette="2"] .resource-summary>div:first-child b{color:#70dbe3}
html[data-palette="2"] .resource-summary .warn{color:#efbf73}
html[data-palette="2"] .dense-filters{background:#1c2a37;border-color:#4b6176}
html[data-palette="2"] input:not([type=checkbox]),html[data-palette="2"] select{border-color:#566b82}
html[data-palette="2"] .table-top{background:#202c39;border-bottom-color:#4b5d72}
html[data-palette="2"] .control-table th,html[data-palette="2"] .control-table thead .farm-col,html[data-palette="2"] .control-table thead .check-col{background:#2d3a4b;color:#d8e4f2;border-bottom:2px solid #596b82;font-size:11px}
html[data-palette="2"] .control-table td{border-top-color:#3d4d60}
html[data-palette="2"] .control-table tbody tr:hover td{background:#293d4b}
html[data-palette="2"] .control-table tbody tr.selected td{background:#254551}
html[data-palette="2"] .control-table tbody tr.selected .check-col{box-shadow:inset 3px 0 #70dbe3}
html[data-palette="2"] :is(th,td,.mobile-controls>div):has([data-inline-key="build_on"],[data-inline-key="build_target"],[data-inline-key="speedup_build_on"],[data-header-key="build_on"],[data-header-key="build_target"],[data-header-key="speedup_build_on"]){--function:#f1c17a;--function-soft:#493b29}
html[data-palette="2"] :is(th,td,.mobile-controls>div):has([data-inline-key="gather_on"],[data-resources],[data-header-key="gather_on"],[data-header-key="gather_resources"]){--function:#8ed8b2;--function-soft:#243f38}
html[data-palette="2"] :is(th,td,.mobile-controls>div):has([data-inline-key="research_on"],[data-inline-key="speedup_research_on"],[data-header-key="research_on"],[data-header-key="speedup_research_on"]){--function:#c7b3ff;--function-soft:#3a3154}
html[data-palette="2"] :is(th,td,.mobile-controls>div):has([data-inline-key="train_on"],[data-inline-key="speedup_train_on"],[data-header-key="train_on"],[data-header-key="speedup_train_on"]){--function:#94c8ff;--function-soft:#263e57}
html[data-palette="2"] :is(th,td,.mobile-controls>div):has([data-inline-key="rewards_on"],[data-header-key="rewards_on"]){--function:#f2b1cf;--function-soft:#4a3041}
html[data-palette="2"] .control-table th:has(.header-control){border-top:3px solid var(--function);color:var(--function)}
html[data-palette="2"] .header-control{color:#deebf6;background:#111c27;border:1px solid #668098;font-size:10px;min-height:31px}
html[data-palette="2"] .header-control:disabled{opacity:1;color:#93a4b8;background:#263442;border-color:#485c70;cursor:not-allowed}
html[data-palette="2"] .header-control:not(:disabled){border-color:var(--function);box-shadow:0 0 0 1px #ffffff08}
html[data-palette="2"] .inline-toggle{padding:5px 8px;border-radius:7px;border:1px solid #5d6c7b;background:#25303c;gap:8px;min-height:37px}
html[data-palette="2"] .inline-toggle:has(input:checked){background:var(--function-soft);border-color:var(--function)}
html[data-palette="2"] .inline-toggle span{width:32px;height:19px;background:#4d5a69;box-shadow:inset 0 0 0 1px #82909d}
html[data-palette="2"] .inline-toggle span:after{background:#aebbc9;width:13px;height:13px;top:3px;left:3px}
html[data-palette="2"] .inline-toggle input:checked+span{background:var(--function);box-shadow:none}
html[data-palette="2"] .inline-toggle input:checked+span:after{background:#12202c;transform:translateX(13px)}
html[data-palette="2"] .inline-toggle b{color:#c6d1de;font-size:11px}
html[data-palette="2"] .inline-toggle input:checked~b{color:var(--function);font-weight:600}
html[data-palette="2"] .inline-toggle.unavailable{opacity:1;background:#202833;border-color:#435064}
html[data-palette="2"] .inline-toggle.unavailable b{color:#91a0b1}
html[data-palette="2"] .inline-toggle.unavailable span{opacity:.4}
html[data-palette="2"] .inline-select,html[data-palette="2"] .resource-picker{background:#101a25;border:1px solid var(--function);border-left-width:3px;color:#f0f5fa;font-size:11px;min-height:37px}
html[data-palette="2"] .resource-picker:hover{background:var(--function-soft)}
html[data-palette="2"] .cell-note,html[data-palette="2"] .row-level{color:#a9b8c9;font-size:10px}
html[data-palette="2"] .farm-title small{color:#b2bfd0}
html[data-palette="2"] .row-btn,html[data-palette="2"] .copy-credentials{border-color:#61748a;background:#273647;color:#e2edf7}
html[data-palette="2"] .command-strip button:disabled{opacity:1;background:#1b232d;border-color:#394657;color:#8e9cae}
html[data-palette="2"] .command-strip button:not(:disabled){border-color:#72869d;background:#2a3a4b;color:#e7f0fa}
html[data-palette="2"] .command-strip button[data-command="start"]:not(:disabled){background:#23443a;border-color:#8ed8b2;color:#a7e5c5}
html[data-palette="2"] .command-strip button[data-command="stop"]:not(:disabled){background:#453828;border-color:#e9ba73;color:#f3ce96}
html[data-palette="2"] .command-strip .danger:not(:disabled){background:#422c38;border-color:#c47e91;color:#f2bdcb}
html[data-palette="2"] input[type=checkbox]:not(.inline-toggle input){appearance:none;-webkit-appearance:none;width:19px;height:19px;display:inline-grid;place-items:center;border:1.5px solid #8092a7;border-radius:4px;background:#15202d;position:relative;flex-shrink:0}
html[data-palette="2"] input[type=checkbox]:not(.inline-toggle input):checked,html[data-palette="2"] input[type=checkbox]:not(.inline-toggle input):indeterminate{background:#70dbe3;border-color:#8ee6eb}
html[data-palette="2"] input[type=checkbox]:not(.inline-toggle input):checked:after{content:'✓';color:#132532;font-size:14px;font-weight:800;line-height:1}
html[data-palette="2"] input[type=checkbox]:not(.inline-toggle input):indeterminate:after{content:'−';color:#132532;font-size:17px;font-weight:700;line-height:1}
html[data-palette="2"] .farm-tabs button[data-farm-tab="building"]{--tab-accent:#f1c17a}
html[data-palette="2"] .farm-tabs button[data-farm-tab="gather"]{--tab-accent:#8ed8b2}
html[data-palette="2"] .farm-tabs button[data-farm-tab="army"]{--tab-accent:#c7b3ff}
html[data-palette="2"] .farm-tabs button[data-farm-tab="rewards"]{--tab-accent:#f2b1cf}
html[data-palette="2"] .farm-tabs button{color:#c1cddb}
html[data-palette="2"] .farm-tabs button.active{border-bottom-color:var(--tab-accent,#70dbe3);color:var(--tab-accent,#70dbe3);background:#283a49}
html[data-palette="2"] .farm-tabs button:hover{background:#263544;color:#fff}
html[data-palette="2"] .mobile-controls>div{border-bottom-color:#45546a}
html[data-palette="2"] .mobile-controls>div>span{color:var(--function,#d2ddea);font-size:12px}
@media(max-width:800px){html[data-palette="2"] .farm-card{border-top:2px solid #5c6f85;background:#1d2936;margin-bottom:10px}html[data-palette="2"] .farm-card:nth-child(even){background:#243141}html[data-palette="2"] .farm-card.selected{background:#244450}html[data-palette="2"] .mobile-controls .inline-toggle span{height:21px;width:35px}html[data-palette="2"] .mobile-controls .inline-toggle span:after{height:15px;width:15px}html[data-palette="2"] .mobile-controls .inline-toggle input:checked+span:after{transform:translateX(14px)}}
/* One consistent enabled-state color across every function. */
html[data-palette="2"] .inline-toggle{--function:#8ed8b2;--function-soft:#243f38}

/* Selected graphite theme: consistent checked state for selection controls too. */
html[data-palette="2"] input[type=checkbox]:not(.inline-toggle input):checked,html[data-palette="2"] input[type=checkbox]:not(.inline-toggle input):indeterminate{background:#8ed8b2;border-color:#a8e4c4}
