* {
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: thin;
  scrollbar-color: #ffffff20 transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: #ffffff20;
  border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: #ffffff40;
}

#ui0 {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1000;
  font-family: system-ui, sans-serif;
}

#ui1 {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  font-family: system-ui, sans-serif;
}

#ui2 {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 1000;
  font-family: system-ui, sans-serif;
}

#copyright {
  top: 10px;
  right: 10px;
  color: #ffffff40;
  font-size: 14px;
}

.vhr {
  display: inline-block;
  width: 1px;
  align-self: stretch;
  background: #444;
  margin-right: 8px;
}

.vhr2 {
  display: inline-block;
  width: 1px;
  align-self: stretch;
  background: #444;
}

.mode-panel {
  margin-bottom: 8px;
  background: #111;
  border: 1px solid #444;
  padding: 4px;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mode-panel span {
  margin: 0 8px;
}

.control-panel {
  background: #111;
  border: 1px solid #444;
  padding: 4px;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.control-panel span {
  margin: 0 8px;
}

.panel-in-btn {
  padding: 8px 12px;
  background: #222;
  color: #fff;
  border: 1px solid #444;
  cursor: pointer;
  flex: 1 0 auto;
}

.panel-in-btn:hover {
  background: #fff;
  border: 1px solid #fff;
  color: #000;
}

#example-panel {
  position: absolute;
  top: 0px;
  left: 0;
  width: 440px;
  max-height: 360px;
  overflow-y: scroll;
  background: #111;
  border: 1px solid #444;
  padding: 8px;
  z-index: 2000;
}

#example-panel.hidden {
  display: none;
}

#example-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#element-panel {
  margin-top: 10px;
  width: 420px;
  background: #111;
  border: 1px solid #444;
  padding: 8px;
}

#element-panel.hidden {
  display: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: #fff;
}

#element-panel {
  position: absolute;
  top: -10px;
  left: 0;
  width: 640px;
  background: #111;
  border: 1px solid #444;
  padding: 8px;
  z-index: 2000;
}

#element-panel.hidden {
  display: none;
}

#element-close, #example-close {
  background-color: #000;
  color: #fff;
  width: 24px;
  height: 24px;
  border: none;
  cursor: pointer;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  margin-bottom: 8px;
}

#periodic-table {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  gap: 4px;
}

.element-cell {
  height: 36px;
  font-size: 12px;
  font-weight: bold;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.element-cell:hover {
  outline: 2px solid #fff;
}

.nonmetal      { background: #7fd1b9; }
.metal         { background: #b7b7b7; }
.alkali        { background: #ffb347; }
.alkaline      { background: #ffd966; }
.transition    { background: #c0c0ff; }
.metalloid     { background: #8fd18f; }
.halogen       { background: #ff7f7f; }
.noble         { background: #9fd3ff; }
.lanthanoid    { background: #d7bde2; }
.actinoid      { background: #f5b7b1; }

.toast-container {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #1f8f3a;
  color: #ffffff;
  border-radius: 0;
  padding: 10px 12px;
  width: 360px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.toast.hide {
  opacity: 0;
  transform: translateX(20px);
}

.toast-title {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 4px;
}

.toast-desc {
  font-size: 13px;
  opacity: 0.9;
}

.toast-close {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px;
}

.toast-close:hover {
  opacity: 0.7;
}
