.mobile-lottery-calculator {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-top: 12px;
  color: #17332f;
}

[data-lottery-calculator="kl8"] .mobile-lotto-ball.number-temperature-hot {
  border-color: #c95f72 !important;
  background: #dc7b8d !important;
  color: #7f1425 !important;
}

[data-lottery-calculator="kl8"] .mobile-lotto-ball.number-temperature-warm {
  border-color: #c69e2f !important;
  background: #dfb94e !important;
  color: #624400 !important;
}

[data-lottery-calculator="kl8"] .mobile-lotto-ball.number-temperature-cold {
  border-color: #4d99c8 !important;
  background: #72b1d8 !important;
  color: #174f7a !important;
}

.mobile-lotto-builder,
.mobile-lotto-results {
  min-width: 0;
  border: 1px solid rgba(22, 94, 84, 0.2);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8f6 100%);
  box-shadow: 0 8px 24px rgba(13, 61, 55, 0.09);
  overflow: hidden;
}

.calculator-detail.is-direct-rotation-matrix > [data-mobile-set-tools] {
  margin-top: 0;
}

.calculator-detail.is-direct-rotation-matrix > .mobile-lottery-calculator[hidden] {
  display: none !important;
}

.mobile-official-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0;
  padding: 5px;
  border: 1px solid #abb5bd;
  border-radius: 7px;
  background: #d4d9dd;
}

.mobile-official-mode-tabs button {
  min-height: 36px;
  border: 1px solid #8293a1;
  border-radius: 6px;
  background: #e9edef;
  color: #273944;
  font-weight: 900;
}

.mobile-official-mode-tabs button[aria-pressed="true"] {
  border-color: #36578d;
  background: #36578d;
  color: #fff;
}

.mobile-lotto-heading,
.mobile-lotto-results > header,
.mobile-lotto-condition-panel > header,
.mobile-lotto-selection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-lotto-number-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 5px;
  padding: 0 10px 5px;
}

.mobile-lotto-number-entry input,
.mobile-lotto-number-entry button {
  box-sizing: border-box;
  min-height: 36px;
  border: 1px solid #9aa3a9;
  border-radius: 8px;
  padding: 0 8px;
  background: #dfe2e4;
  color: #29343d;
  font-size: 11px;
  font-weight: 800;
}

.mobile-lotto-number-entry button {
  background: #8eabc7;
  color: #fff;
}

.mobile-lottery-calculator {
  color: #29343d;
}

.mobile-lotto-builder,
.mobile-lotto-results {
  border-color: #969fa5;
  background: linear-gradient(180deg, #a6adb2 0%, #969da2 100%);
  box-shadow: 0 8px 20px rgba(17,24,39,.16);
}

.mobile-lotto-heading {
  background: linear-gradient(135deg, #687f96, #8eabc7);
}

.mobile-lotto-zone-tabs button,
.mobile-lotto-role-tabs button,
.mobile-lotto-result-tabs button,
.mobile-lotto-selection-head button,
.mobile-lotto-selection-actions button,
.mobile-lotto-condition-panel header button,
.mobile-lotto-count-presets button,
.mobile-lotto-result-actions button,
.mobile-lotto-results header button {
  border-color: #9aa3a9;
  background: #c0c6ca;
  color: #34434d;
}

.mobile-lotto-zone-tabs button[aria-selected="true"],
.mobile-lotto-role-tabs button[aria-selected="true"],
.mobile-lotto-result-tabs button[aria-selected="true"] {
  border-color: #6e91b2;
  background: #8eabc7;
}

.mobile-lotto-heading {
  padding: 13px 14px;
  color: #fff;
  background: linear-gradient(135deg, #0b5c52, #16887a);
}

.mobile-lotto-heading > span,
.mobile-lotto-results > header > span,
.mobile-lotto-condition-panel > header > span,
.mobile-lotto-selection-head > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mobile-lotto-heading strong {
  font-size: 17px;
  line-height: 1.2;
}

.mobile-lotto-heading-controls,
.mobile-lotto-temperature-window {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.mobile-lotto-heading-controls {
  flex-wrap: wrap;
}

.mobile-lotto-temperature-window {
  min-height: 32px;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.12);
}

.mobile-lotto-temperature-window input {
  width: 48px;
  height: 27px;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid rgba(25, 51, 64, 0.35);
  border-radius: 6px;
  padding: 0 3px;
  color: #17242d;
  text-align: center;
  font-weight: 900;
  background: #f7fafb;
}

.mobile-lotto-heading small,
.mobile-lotto-results header small,
.mobile-lotto-condition-panel header small,
.mobile-lotto-selection-head small {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.78;
}

.mobile-lotto-play {
  display: grid;
  flex: 0 0 auto;
  gap: 2px;
  font-size: 10px;
}

.mobile-lotto-play select,
.mobile-kl8-filter-grid input,
.mobile-kl8-filter-grid select,
.mobile-lotto-condition-entry input,
.mobile-lotto-condition-entry textarea {
  min-height: 38px;
  border: 1px solid rgba(27, 93, 83, 0.25);
  border-radius: 9px;
  background: #fff;
  color: #17332f;
  font: inherit;
}

.mobile-lotto-play select {
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.45);
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.96);
}

.mobile-lotto-zone-tabs,
.mobile-lotto-role-tabs,
.mobile-lotto-result-tabs {
  display: grid;
  gap: 6px;
  padding: 10px 12px 0;
}

.mobile-lotto-zone-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mobile-lotto-role-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mobile-lotto-zone-tabs button,
.mobile-lotto-role-tabs button,
.mobile-lotto-result-tabs button {
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(22, 94, 84, 0.18);
  border-radius: 10px;
  background: #edf5f2;
  color: #28534d;
  font-size: 12px;
  font-weight: 800;
}

.mobile-lotto-zone-tabs button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.mobile-lotto-zone-tabs button span {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.68;
}

.mobile-lotto-zone-tabs button[aria-selected="true"],
.mobile-lotto-role-tabs button[aria-selected="true"],
.mobile-lotto-result-tabs button[aria-selected="true"] {
  border-color: #b52f39;
  color: #fff;
  background: #b52f39;
  box-shadow: 0 4px 12px rgba(181, 47, 57, 0.2);
}

.mobile-lotto-role-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 3px;
  border-radius: 50%;
  background: #bd3841;
}

.mobile-lotto-role-dot.is-dan {
  background: #e6a51d;
}

.mobile-lotto-role-dot.is-kill {
  background: #7d8987;
}

.mobile-lotto-selection-head {
  padding: 8px 10px 5px;
}

.mobile-lotto-selection-head strong {
  font-size: 14px;
}

.mobile-lotto-selection-head > div {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.mobile-lotto-condition-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.mobile-lotto-selection-head button,
.mobile-lotto-selection-actions button,
.mobile-lotto-condition-panel header button,
.mobile-lotto-count-presets button,
.mobile-lotto-result-actions button,
.mobile-lotto-results header button {
  min-height: 36px;
  border: 1px solid rgba(22, 94, 84, 0.2);
  border-radius: 9px;
  padding: 0 9px;
  background: #fff;
  color: #275a52;
  font-size: 11px;
  font-weight: 800;
}

.mobile-lotto-selection-head button:disabled,
.mobile-lotto-condition-panel button:disabled {
  opacity: 0.42;
}

.mobile-lotto-selection-head .mobile-lotto-selection-mode {
  border-color: #7f9792;
  color: #315c55;
  background: #e9f1ef;
}

.mobile-lotto-selection-head .mobile-lotto-selection-mode[aria-pressed="true"] {
  border-color: #b52f39;
  color: #fff;
  background: #b52f39;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 3px 9px rgba(181, 47, 57, 0.2);
}

.mobile-lotto-number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(30px, 30px));
  justify-content: start;
  gap: 4px;
  padding: 4px 6px 10px;
}

.mobile-lotto-number-grid.is-kl8 {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  padding-inline: 6px;
}

.mobile-lotto-ball {
  position: relative;
  width: 30px;
  height: 30px;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  border: 1px solid #c7d5d2;
  border-radius: 50%;
  padding: 0;
  background: #fff;
  color: #34544f;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  touch-action: manipulation;
}

.desktop-unified-lottery-panel .mobile-lotto-number-grid {
  grid-template-columns: repeat(auto-fit, minmax(34px, 34px));
  justify-content: start;
  gap: 4px;
  padding-top: 3px;
  padding-bottom: 7px;
}

.desktop-unified-lottery-panel .mobile-lotto-ball {
  width: 34px;
  height: 34px;
  min-height: 34px;
  aspect-ratio: 1;
  font-size: 12px;
}

.desktop-unified-lottery-panel .mobile-lotto-number-grid.is-kl8 {
  grid-template-columns: repeat(10, 34px);
  gap: 4px;
  padding-inline: 12px;
}

.desktop-unified-lottery-panel .mobile-lotto-number-grid.is-kl8 .mobile-lotto-ball {
  width: 34px;
  height: 34px;
}

.desktop-unified-lottery-panel .mobile-lotto-heading {
  min-height: 38px;
  padding: 5px 9px;
}

.desktop-unified-lottery-panel .mobile-lotto-zone-tabs,
.desktop-unified-lottery-panel .mobile-lotto-role-tabs {
  padding-top: 5px;
}

.desktop-unified-lottery-panel .mobile-lotto-selection-head {
  padding-block: 5px 3px;
}

.mobile-lotto-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 10px 5px;
  border: 1px solid rgba(22, 94, 84, 0.12);
  border-radius: 7px;
  padding: 4px 7px;
  background: #f1f7f5;
  color: #315a54;
  font-size: 10px;
  line-height: 1.45;
}

.mobile-lotto-selected-list span {
  display: inline-flex;
  min-width: 0;
  gap: 3px;
}

.mobile-lotto-selected-list b { flex: 0 0 auto; }
.mobile-lotto-selected-list em { color: #a62934; font-style: normal; font-weight: 800; overflow-wrap: anywhere; }
.mobile-lotto-selected-list.is-empty b { color: #758783; font-weight: 600; }

.desktop-unified-lottery-panel .mobile-lotto-selection-actions {
  padding-bottom: 7px;
}

.mobile-lotto-ball.is-pool {
  border-color: #b52f39;
  color: #fff;
  background: #c43c45;
  box-shadow: 0 2px 6px rgba(181, 47, 57, 0.25);
}

.mobile-lotto-ball.is-dan {
  border-color: #d89410;
  color: #4d3600;
  background: #ffd46c;
  box-shadow: 0 2px 6px rgba(216, 148, 16, 0.2);
}

.mobile-lotto-ball.is-kill {
  border-color: #86918f;
  color: #fff;
  background: #86918f;
  text-decoration: line-through 2px;
}

.mobile-lotto-selection-actions,
.mobile-lotto-main-actions,
.mobile-lotto-result-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 0 12px 10px;
}

.mobile-lotto-selection-rule,
.mobile-kl8-filters > p,
.mobile-lotto-preview-note {
  margin: 0;
  padding: 0 12px 11px;
  color: #667b77;
  font-size: 10px;
  line-height: 1.5;
}

.mobile-lotto-condition-panel,
.mobile-kl8-filters {
  margin: 0 10px 8px;
  border: 1px solid rgba(22, 94, 84, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.mobile-lotto-quick-layers {
  margin: 0 12px 12px;
  border: 1px solid rgba(22, 94, 84, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.mobile-lotto-quick-layers > summary {
  cursor: pointer;
  padding: 10px;
  color: #285b53;
  background: #eef6f3;
  font-size: 12px;
  font-weight: 900;
}

.mobile-lotto-quick-layers .calculator-section {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.mobile-lotto-quick-layers .indicator-chip {
  min-height: 34px;
  font-size: 11px;
}

.mobile-lotto-quick-layers .indicator-grid,
.mobile-lotto-quick-layers .indicator-grid--compact,
.mobile-lotto-quick-layers .indicator-grid--digits {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.mobile-lotto-quick-layers .indicator-chip.is-hot,
.mobile-lotto-quick-layers .indicator-chip[aria-pressed="true"] {
  border-color: #435d90;
  background: #435d90;
  color: #fff;
}

.mobile-lotto-quick-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 180px));
  gap: 8px;
  width: min(100%, 368px);
}

.mobile-lotto-quick-inputs label {
  display: grid;
  grid-template-columns: auto minmax(72px, 1fr);
  align-items: center;
  gap: 6px;
  color: #294c49;
  font-size: 12px;
  font-weight: 700;
}

.mobile-lotto-quick-inputs input {
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  border: 1px solid #bfd5d1;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  color: #173c39;
  font: inherit;
}

.mobile-lotto-condition-panel > header {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(22, 94, 84, 0.12);
  background: #eef6f3;
}

.mobile-lotto-condition-panel header strong,
.mobile-kl8-filters summary strong {
  font-size: 13px;
}

.mobile-lotto-condition-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 76px;
  gap: 6px;
  align-items: stretch;
  padding: 6px 8px 4px;
}

.mobile-lotto-condition-entry textarea {
  height: 44px;
  min-height: 44px;
  min-width: 0;
  resize: vertical;
  padding: 8px;
  line-height: 1.4;
}

.mobile-lotto-condition-entry label {
  display: grid;
  gap: 3px;
  color: #5c716d;
  font-size: 10px;
}

.mobile-lotto-condition-entry input {
  min-width: 0;
  padding: 0 7px;
}

.mobile-lotto-condition-entry > button,
.mobile-lotto-main-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  padding: 0 8px;
  color: #fff;
  background: #166d62;
  font-size: 12px;
  font-weight: 900;
}

.mobile-lotto-count-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 5px;
  padding: 0 8px 5px;
}

.mobile-lotto-count-presets button.is-hot,
.mobile-lotto-count-presets button[aria-pressed="true"] {
  border-color: #435d90;
  background: #435d90;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.mobile-lotto-condition-list {
  display: grid;
  gap: 6px;
  padding: 0 8px 6px;
}

.mobile-lotto-condition-source {
  margin: 0;
  padding: 0 8px 4px;
  color: #6b7f7a;
  font-size: 9px;
}

.mobile-lotto-condition-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 5px 8px 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(22, 94, 84, 0.13);
  color: #214c45;
  font-size: 11px;
}

.mobile-lotto-condition-list-head span {
  color: #aa2d39;
  font-weight: 800;
}

.mobile-lotto-condition {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  border-left: 4px solid #16887a;
  border-radius: 8px;
  padding: 5px 7px;
  background: #f1f7f5;
}

.mobile-lotto-condition span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.mobile-lotto-condition b {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-lotto-condition small {
  color: #5e7771;
  font-size: 10px;
}

.mobile-lotto-condition > button {
  flex: 0 0 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: #a22e37;
  background: #fff;
  font-size: 18px;
}

.mobile-lotto-empty {
  margin: 0;
  color: #70827f;
  font-size: 10px;
  line-height: 1.45;
}

.mobile-kl8-filters summary {
  cursor: pointer;
  padding: 10px;
  background: #eef6f3;
}

.mobile-kl8-filters summary span {
  display: inline-grid;
  gap: 2px;
  margin-left: 5px;
  vertical-align: middle;
}

.mobile-kl8-filters summary small {
  color: #657b76;
  font-size: 10px;
}

.mobile-kl8-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 10px;
}

.mobile-kl8-filter-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #526b66;
  font-size: 10px;
}

.mobile-kl8-filter-grid input,
.mobile-kl8-filter-grid select {
  width: 100%;
  min-width: 0;
  padding: 0 8px;
}

.mobile-lotto-main-actions {
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
}

.mobile-lotto-main-actions button:not(.is-primary) {
  border: 1px solid #1c756a;
  color: #155e55;
  background: #fff;
}

.mobile-lotto-main-actions .is-primary {
  background: #b52f39;
  box-shadow: 0 5px 14px rgba(181, 47, 57, 0.22);
}

.mobile-lotto-status {
  min-height: 20px;
  margin: 0;
  padding: 0 12px 13px;
  color: #176c61;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.mobile-lotto-status.is-error {
  color: #b32833;
}

.mobile-lotto-results > header {
  padding: 7px 9px;
  border-bottom: 1px solid rgba(22, 94, 84, 0.13);
  background: #eff6f4;
}

.mobile-lotto-results header strong {
  font-size: 14px;
}

.mobile-lotto-results.is-empty > p {
  margin: 0;
  padding: 8px 10px;
  color: #6c817c;
  font-size: 11px;
  line-height: 1.55;
}

.mobile-lotto-result-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(22, 94, 84, 0.12);
}

.mobile-lotto-result-metrics > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px 4px;
  text-align: center;
  background: #fff;
}

.mobile-lotto-result-metrics span {
  color: #687d78;
  font-size: 10px;
}

.mobile-lotto-result-metrics b {
  overflow: hidden;
  color: #a72933;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-lotto-result-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-bottom: 8px;
}

.mobile-lotto-result-tabs button {
  min-height: 36px;
}

.mobile-lotto-result-output {
  display: block;
  width: calc(100% - 24px);
  min-height: 120px;
  max-height: 42vh;
  margin: 0 12px 10px;
  border: 1px solid #c5d5d1;
  border-radius: 10px;
  padding: 10px;
  resize: vertical;
  background: #10221f;
  color: #e8f8f3;
  font: 600 12px/1.65 ui-monospace, "SFMono-Regular", Consolas, monospace;
  box-sizing: border-box;
}

.mobile-lotto-result-actions {
  padding-top: 2px;
  padding-bottom: 12px;
}

@media (orientation: landscape) and (min-width: 600px) {
  .mobile-lottery-calculator {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    align-items: start;
  }

  .mobile-lotto-number-grid { grid-template-columns: repeat(auto-fit, minmax(30px, 30px)); }

  .mobile-kl8-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mobile-lotto-results {
    position: sticky;
    top: 6px;
    max-height: calc(100vh - 28px);
    overflow-y: auto;
  }

  .mobile-lotto-result-output {
    max-height: calc(100vh - 300px);
  }
}

.desktop-unified-lottery-panel,
.desktop-unified-lottery-panel .mobile-lottery-calculator,
.desktop-unified-lottery-panel .mobile-lotto-builder {
  min-height: 0;
}

.desktop-unified-lottery-panel .mobile-lottery-calculator {
  align-items: start;
}

.desktop-unified-lottery-panel .mobile-lotto-builder {
  overflow-y: auto;
}

.desktop-unified-lottery-panel .mobile-lotto-heading strong {
  font-size: 15px;
}

.desktop-unified-lottery-panel .mobile-lotto-heading small,
.desktop-unified-lottery-panel .mobile-lotto-condition-panel header small {
  line-height: 1.15;
}

.desktop-unified-lottery-panel .mobile-lotto-condition-panel > header {
  padding: 4px 7px;
}

.desktop-unified-lottery-panel .mobile-lotto-condition-panel > header button {
  min-height: 30px;
}

.desktop-unified-lottery-panel .mobile-lotto-zone-tabs button,
.desktop-unified-lottery-panel .mobile-lotto-role-tabs button {
  min-height: 36px;
}

.desktop-unified-lottery-panel .mobile-lotto-results {
  min-height: 0;
  overflow-y: auto;
}

@media (max-width: 350px) {
  .mobile-lotto-quick-inputs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .mobile-lotto-quick-inputs label {
    grid-template-columns: 1fr;
  }

  .mobile-lotto-number-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .mobile-lotto-selection-actions,
  .mobile-lotto-result-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-lotto-condition-entry {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .mobile-lotto-condition-entry > button {
    grid-column: 1 / -1;
  }
}
.mobile-set-tools { margin: 8px 0; }
.mobile-set-panel { display: grid; gap: 8px; border: 1px solid #b8cbc7; border-radius: 10px; background: #f4faf8; padding: 9px; color: #173d38; }
.mobile-set-panel > header, .mobile-matrix-zone > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mobile-set-panel > header span, .mobile-matrix-zone > header span { color: #6d817d; font-size: 9px; }
.mobile-set-panel__header > div { display: grid; gap: 2px; min-width: 0; }
.mobile-set-panel__header > div span { display: block; }
.mobile-set-panel__header > select { flex: 0 0 min(31vw, 116px); min-width: 0; min-height: 34px; border: 1px solid #aebfbb; border-radius: 7px; background: #fff; color: #244a45; padding: 0 5px; font-size: 11px; font-weight: 900; }
.mobile-set-panel textarea { width: 100%; resize: vertical; border: 1px solid #aebfbb; border-radius: 8px; background: #fff; color: #183c37; padding: 7px; font: 12px/1.5 Consolas, monospace; }
.mobile-set-operation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.mobile-set-operation button, .mobile-set-panel > button, .mobile-matrix-settings select { min-height: 34px; border: 1px solid #aebfbb; border-radius: 7px; background: #fff; color: #315a54; font-weight: 800; }
.mobile-set-operation button.is-on, .mobile-set-panel > button.is-primary { border-color: #a62b38; background: #ba3240; color: #fff; }
.mobile-set-panel output { display: block; min-height: 45px; overflow-wrap: anywhere; border-radius: 7px; background: #e6f1ee; padding: 8px; color: #173d38; font-size: 11px; line-height: 1.55; white-space: pre-wrap; }
.mobile-matrix-zone { display: grid; gap: 5px; border-top: 1px solid #cfddda; padding-top: 7px; }
.mobile-matrix-settings label { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; gap: 6px; font-size: 10px; }
.mobile-matrix-number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(30px, 30px));
  justify-content: start;
  gap: 4px;
}
.mobile-matrix-number-grid.is-kl8 {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}
.mobile-matrix-number {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  border: 1px solid #cbdde1;
  border-radius: 50%;
  padding: 0;
  background: #fff;
  color: #17313f;
  font-size: 10px;
  font-weight: 900;
}
.mobile-matrix-number-grid.is-kl8 .mobile-matrix-number {
  width: 100%;
  height: auto;
}
.mobile-matrix-actions { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 5px; }
.mobile-matrix-actions button,
.mobile-kl8-hit-verifier button { min-height: 34px; border: 1px solid #aebfbb; border-radius: 7px; background: #fff; color: #315a54; padding-inline: 4px; font-size: 11px; font-weight: 800; line-height: 1; white-space: nowrap; }
.mobile-matrix-actions button.is-primary,
.mobile-kl8-hit-verifier button.is-primary { border-color: #a62b38; background: #ba3240; color: #fff; }
.mobile-kl8-hit-verifier { display: grid; gap: 5px; min-width: 0; }
.mobile-kl8-hit-verifier > div { display: grid; grid-template-columns: minmax(0, 1fr) 66px 74px; gap: 4px; }
.mobile-kl8-hit-verifier input { box-sizing: border-box; min-width: 0; min-height: 34px; border: 1px solid #aebfbb; border-radius: 7px; background: #fff; color: #183c37; padding: 5px 7px; font-size: 11px; }
.mobile-kl8-hit-verifier pre { box-sizing: border-box; max-height: 220px; margin: 0; overflow: auto; border: 1px solid #b9c9c6; border-radius: 7px; background: #e6f1ee; color: #173d38; padding: 7px; font: 10px/1.5 Consolas, monospace; white-space: pre-wrap; }
.lotto-n-out-n-three-chart { display: grid; gap: 7px; min-width: 0; }
.lotto-n-out-n-three-chart[hidden] { display: none; }
.mobile-omission-three-chart-grid { display: grid; gap: 9px; min-width: 0; }
.mobile-omission-three-chart-card { display: grid; gap: 4px; min-width: 0; overflow: hidden; border: 1px solid var(--calc-border, #dfe2e7); border-radius: 8px; background: #fff; padding: 6px; box-shadow: 0 2px 5px rgba(20,31,55,.1); }
.mobile-omission-three-chart-card > header { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #17242d; font-size: 10px; }
.mobile-omission-three-chart-card > header span { color: #667986; font-size: 9px; }
.mobile-omission-three-chart-charts { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; overflow: hidden; border: 1px solid #30344a; border-radius: 5px; background: #17182c; }
.mobile-omission-three-chart-pane { position: relative; display: block; min-width: 0; overflow: hidden; }
.mobile-omission-three-chart-pane + .mobile-omission-three-chart-pane { border-top: 1px solid rgba(216,222,226,.72); }
.mobile-omission-three-chart-pane > b { position: absolute; z-index: 2; top: 2px; left: 4px; border-radius: 2px; background: rgba(23,24,44,.72); color: rgba(235,240,244,.82); padding: 1px 3px; font-size: 8px; line-height: 1.2; pointer-events: none; }
.mobile-omission-three-chart-pane canvas { display: block; width: 100% !important; max-width: 100%; border-radius: 0; }
@media (orientation: landscape) and (min-width: 680px) {
  .mobile-omission-three-chart-charts { grid-template-columns: minmax(0,1fr); }
}

/* Keep KL8/SSQ/DLT on the same visual workbench as FC3D/PL3/PL5. */
.mobile-lottery-calculator { color: #132a37; }
.mobile-lotto-builder,
.mobile-lotto-results {
  border-color: #dfe2e7;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(20, 31, 55, 0.12);
}
.mobile-lotto-heading { color: #17242d; background: #fff; }
.mobile-lotto-heading small,
.mobile-lotto-results header small,
.mobile-lotto-condition-panel header small,
.mobile-lotto-selection-head small { color: #667986; }
.mobile-lotto-zone-tabs button,
.mobile-lotto-role-tabs button,
.mobile-lotto-result-tabs button,
.mobile-lotto-selection-head button,
.mobile-lotto-selection-actions button,
.mobile-lotto-condition-panel header button,
.mobile-lotto-count-presets button,
.mobile-lotto-result-actions button,
.mobile-lotto-results header button,
.mobile-lotto-number-entry input,
.mobile-lotto-number-entry button,
.mobile-lotto-condition-entry input,
.mobile-lotto-condition-entry textarea {
  border-color: #d4dce2;
  background: #fff;
  color: #17313f;
}
.mobile-lotto-number-entry button,
.mobile-lotto-main-actions .is-primary {
  border-color: #36578d;
  background: #36578d;
  color: #fff;
}
.mobile-lotto-zone-tabs button[aria-selected="true"],
.mobile-lotto-role-tabs button[aria-selected="true"],
.mobile-lotto-result-tabs button[aria-selected="true"],
.mobile-lotto-selection-head .mobile-lotto-selection-mode[aria-pressed="true"],
.mobile-lotto-count-presets button.is-selected,
.mobile-lotto-count-presets button[aria-pressed="true"] {
  border-color: #d93246;
  background: #d93246;
  color: #fff;
  box-shadow: 0 2px 7px rgba(217, 50, 70, 0.18);
}
.mobile-lotto-condition-panel,
.mobile-lotto-quick-layers,
.mobile-lotto-selected-list,
.mobile-lotto-result-metrics,
.mobile-kl8-filter-panel { border-color: #dfe2e7; background: #f9fcfc; }
.mobile-lotto-condition { border-left-color: #36578d; background: #f1f5fb; }
.mobile-lotto-result-output { border-color: #d1dfe3; background: #fff; color: #17313f; }
